12 |
- /*! For license information please see index.min.js.LICENSE.txt */
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("GISDK"),require("React"),require("ReactDOM"),require("_"),require("antd")):"function"==typeof define&&define.amd?define(["GISDK","React","ReactDOM","_","antd"],e):"object"==typeof exports?exports.GI_ASSETS_SCENE=e(require("GISDK"),require("React"),require("ReactDOM"),require("_"),require("antd")):t.GI_ASSETS_SCENE=e(t.GISDK,t.React,t.ReactDOM,t._,t.antd)}(self,((t,e,n,r,i)=>(()=>{var o={3722:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.get=a,e.set=o,e.getJSON=u,e.remove=s,e.default=void 0;var r,i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,n):{};r.get||r.set?Object.defineProperty(e,n,r):e[n]=t[n]}return e.default=t,e}(n(9836));function o(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.path,i=void 0===r?"/":r,o=n.domain,a=n.expires,s=n.maxAge,u=void 0===s?1512e3:s,l=n.secure,c=n.sameSite;if(t){e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[()]/g,escape);var h=[];i&&h.push("path=".concat(i)),o&&h.push("domain=".concat(o)),a&&h.push("expires=".concat(a)),u&&h.push("max-age=".concat(u)),l&&h.push("secure"),c&&h.push("samesite=".concat(c)),document.cookie="".concat(t,"=").concat(e,";").concat(h.join(";"))}}function a(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t?void 0:{},r=document.cookie?document.cookie.split("; "):[],i=/(%[0-9A-Z]{2})+/g,o=0;o<r.length;o++){var a=r[o].split("="),s=a.slice(1).join("=");e.json||'"'!==s.charAt(0)||(s=s.slice(1,-1));try{var u=a[0].replace(i,decodeURIComponent);if(s=s.replace(i,decodeURIComponent),e.json)try{s=JSON.parse(s)}catch(t){}if(t===u){n=s;break}t||(n[u]=s)}catch(t){}}return n}function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(t,"",i.assign(e,{expires:"Thu, 01 Jan 1970 00:00:00 GMT",maxAge:-1}))}function u(){return a(void 0,{json:!0})}!function(t){t.strict="strict",t.lax="lax"}(r||(r={}));var l={set:o,get:a,getJSON:u,remove:s};e.default=l},5558:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createInstance=u,e.default=void 0;var r=a(n(3300)),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,n):{};r.get||r.set?Object.defineProperty(e,n,r):e[n]=t[n]}return e.default=t,e}(n(9836)),o=a(n(3722));function a(t){return t&&t.__esModule?t:{default:t}}var s={key:"x-hng",maxAge:15552e3,path:"/"};function u(t){return t=i.assign({},s,t),new r.default(t)}var l=u(),c={locale:l,cookie:o.default,util:i,create:u,getKey:l.getKey.bind(l),getLocale:l.getLocale.bind(l),getLocaleString:l.getLocaleString.bind(l),getEnv:l.getEnv.bind(l),setLocale:l.setLocale.bind(l),setRegion:l.setRegion.bind(l),setLang:l.setLang.bind(l),setCurrency:l.setCurrency.bind(l),setTimeZone:l.setTimeZone.bind(l),setLocaleWithObject:l.setLocaleWithObject.bind(l),clear:l.clear.bind(l)},h=c;e.default=h,t.exports=c},3300:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LOCALE_KEY_NAME=void 0;var r,i=a(n(3722)),o=a(n(9836));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,n):{};r.get||r.set?Object.defineProperty(e,n,r):e[n]=t[n]}return e.default=t,e}function s(t){return s="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},s(t)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}e.LOCALE_KEY_NAME=r,function(t){t.region="region",t.lang="lang",t.currency="currency",t.tz="tz"}(r||(e.LOCALE_KEY_NAME=r={}));var c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,"key",void 0),l(this,"maxAge",void 0),l(this,"domain",void 0),l(this,"path",void 0),l(this,"container",void 0),this.key=e.key||"",this.maxAge=e.maxAge,this.domain=e.domain,this.path=e.path,this.container=o.getContainerType()}var e,n;return e=t,(n=[{key:"getKey",value:function(){return this.key}},{key:"getPureLocale",value:function(){return this[this.container]?this[this.container]():""}},{key:"getLocale",value:function(t){var e=this.getPureLocale();if(t&&t.short&&e[r.lang]){var n=e[r.lang].split("-")[0];e[r.lang]=n}return e.region&&(e.regionID=e.region),e.lang&&(e.language=e.lang),e}},{key:"getEnv",value:function(t){var e=o.assign({},{short:!0},t);return this.getLocale(e)}},{key:"getLocaleString",value:function(){var t=this.getPureLocale();return o.stringifyToQueryString(t)}},{key:"setLocale",value:function(t,e){if(t){var n=l({},t,e);this.setLocaleWithObject(n)}}},{key:"setRegion",value:function(t){t&&this.setLocale(r.region,t)}},{key:"setLang",value:function(t){t&&this.setLocale(r.lang,t)}},{key:"setCurrency",value:function(t){t&&this.setLocale(r.currency,t)}},{key:"setTimeZone",value:function(t){t&&this.setLocale(r.tz,t)}},{key:"setLocaleWithObject",value:function(t){if(this.container!==o.ContainerType.weex){var e=this.getLocale(),n=o.assign({},e,t);delete n.language;var r=o.stringifyToQueryString(n);i.set(this.key,r,{path:this.path||"/",maxAge:this.maxAge,domain:this.domain})}}},{key:"weex",value:function(){var t="";return"object"===("undefined"==typeof WXEnvironment?"undefined":s(WXEnvironment))&&(t=WXEnvironment&&WXEnvironment[this.key]||""),o.parseQueryString(t)}},{key:"web",value:function(){var t="",e={};if(location&&location.search){var n=location.search.replace(/^[?#&]/,""),a=o.parseQueryString(n),u=o.objectValues(r);Object.keys(a).forEach((function(t){u.indexOf(t)>=0&&(e[t]=a[t])}))}if("object"===("undefined"==typeof window?"undefined":s(window))){var l=window;if(t=window[this.key]){var c=o.parseQueryString(t);e=o.assign({},c,e)}else if("object"===s(l.g_config)){var h=l.g_config,p=h.regionID,f=h.language,d={};p&&(d[r.region]=p),f&&(d[r.lang]=f),e=o.assign({},d,e)}}if(!t){var m={};if(t=i.get(this.key))m=o.parseQueryString(t);else{var g=i.get("hng");if(g){var y=g.split("|");y[0]&&(m[r.region]=y[0]),y[1]&&(m[r.lang]=y[1]),y[2]&&(m[r.currency]=y[2])}}e=o.assign({},m,e)}return e}},{key:"clear",value:function(){i.remove(this.key)}}])&&u(e.prototype,n),t}();e.default=c},9836:(t,e)=>{"use strict";function n(t){return n="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},n(t)}var r;function i(t,e){if(""===e)return[t];var n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}function o(t){try{return decodeURIComponent(t)}catch(e){return t}}function a(t){try{return encodeURIComponent(t)}catch(e){return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getContainerType=function(){var t="";return"function"==typeof callNative?t=r.weex:"object"!==("undefined"==typeof navigator?"undefined":n(navigator))||"Mozilla"!==navigator.appCodeName&&"Gecko"!==navigator.product||(t=r.web),t},e.splitOnFirst=i,e.decode=o,e.encode=a,e.parseQueryString=function(t){if(!t)return{};var e=t.split("&"),n={};return e.forEach((function(t){var e,r=(2,function(t){if(Array.isArray(t))return t}(e=i(t.replace(/\+/g," "),"="))||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),2!==n.length);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),a=r[0],s=r[1],u=void 0===s?"":o(s);n[a]=u})),n},e.stringifyToQueryString=function(t){return Object.keys(t).map((function(e){var n=t[e];return void 0===n?"":null===n?a(e):"".concat(a(e),"=").concat(a(n))})).filter((function(t){return t.length>0})).join("&")},e.objectValues=function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(t[n]);return e},e.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},e.ContainerType=void 0,e.ContainerType=r,function(t){t.weex="weex",t.web="web"}(r||(e.ContainerType=r={}))},4959:(t,e,n)=>{"use strict";e.ZP=void 0;var r,i,o=n(2370),a=(r=n(4998))&&r.__esModule?r:{default:r},s=n(6142),u="__GLOBAL_STRING_FORMAT__",l={};function c(t){if(t)return i=t,t;if(i)return i;if(o.isWeex)return l;var e=void 0!==n.g?n.g:window;return e[u]||(e[u]={}),e[u]}var h={init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.name,i=void 0===r?"default":r,o=c(n.context),s=new a.default(t,e);return o[i]=s,s},format:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.name,i=void 0===r?"default":r,o=c()[i];return o?o.format(t,e,n):((0,s.error)("\n Not found instance named ".concat(i,",\n make sure to call formatString.format() after formatString.init()\n ")),t.defaultMessage||t.id||"")},StringFormat:a.default};e.ZP=h},4998:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(2462))&&r.__esModule?r:{default:r},o=n(6142);function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";"string"!=typeof t&&((0,o.error)('"locale" is not a string, please check your input locale'),t="");var e=t.toLowerCase();return e.replace("-","_")}function l(t,e){if(t===e)return!0;var n=t.match(/(\S*)_/);return!!n&&l(n[1],e)}function c(t,e){var n=u(t),r=u(e);return n===r||l(n,r)}var h=function(){function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,"dictionary",void 0),s(this,"strings",void 0),s(this,"locale",void 0),s(this,"medusa",void 0),this.dictionary={},this.locale=e||"",n||((0,o.warn)('param "strings" is undefined, please check your incoming'),n={}),n.medusa&&(this.medusa=n.medusa,delete n.medusa),this.strings=n;var a=n[e];a||(Object.keys(n).forEach((function(t){u(t)===u(e)&&((0,o.warn)("no string list for locale: ".concat(e," , will replace it with ").concat(t)),a=n[t])})),a||Object.keys(n).forEach((function(t){c(e,t)&&((0,o.warn)("no value for locale: ".concat(e," , will replace it with").concat(t)),a=n[t])}))),(!a||a&&0===Object.keys(a).length)&&((0,o.warn)("no value for locale: ".concat(e,", please check your second param")),a={}),Object.keys(a).forEach((function(t){try{var n=new i.default(a[t],e);r.dictionary[t]=n}catch(e){r.dictionary[t]={},(0,o.error)(e)}}))}var e,n;return e=t,n=[{key:"getStrings",value:function(){return this.strings}},{key:"formatString",value:function(t,e,n){var r=this.medusa,i=this.locale,o=t.format(e);return r&&r.app_name&&"pd-KV"===i&&(o="##@@@".concat(n,"##").concat(r.app_name,"@@@##").concat(o)),o}},{key:"format",value:function(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},a=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=r.defaultMessage||r.defaultString||"",l=a&&Object.keys(a).length>0,c="",h={},p={},f=s.React,d=s.component,m=s.tagName,g=void 0===m?"span":m;if(l){var y=Math.floor(1099511627776*Math.random()).toString(16),v=(t=0,function(){return t+=1,"ELEMENT-".concat(y,"-").concat(t)});c="@__".concat(y,"__@"),Object.keys(a).forEach((function(t){var e=a[t];if(f&&f.isValidElement(e)){var n=v();h[t]=c+n+c,p[n]=e}else h[t]=e}))}if(this.dictionary[r.id])try{e=this.formatString(this.dictionary[r.id],h,r.id)}catch(t){var _=r.id?", using id as fallback.":"",b=u?", using defaultString as fallback.":_;(0,o.error)("format string: ".concat(r.id," for locale ").concat(this.locale," ").concat(b," \n").concat(t)),e=u||r.id||""}else if("string"==typeof r)(0,o.error)("type of \"des\" must be object, like: {id: '', defaultString: ''}, instead of string "),e=r||"";else{(0,o.warn)('there is no string with id="'.concat(r.id,'" for locale: "').concat(this.locale,'", use defaultString or id as fallback'));var x=u||r.id||"";try{var w=new i.default(x,this.locale);e=this.formatString(w,h,r.id)}catch(t){e=x}}if(p&&Object.keys(p).length>0){var S=e.split(c).filter((function(t){return!!t})).map((function(t){return p[t]||t})),E=d||g;return f?f.createElement.apply(f,[E,null].concat(function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(n=S)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}())):S}return e}}],n&&a(e.prototype,n),t}();e.default=h},6142:(t,e,n)=>{"use strict";var r=n(3656);Object.defineProperty(e,"__esModule",{value:!0}),e.warn=function(t){"undefined"!=typeof console&&console.warn&&void 0!==r&&r.env},e.error=function(t){"undefined"!=typeof console&&console.error&&void 0!==r&&r.env}},5576:function(t){"use strict";t.exports=function(){function t(t){var r=[];return t.AMapUI&&r.push(e(t.AMapUI)),t.Loca&&r.push(n(t.Loca)),Promise.all(r)}function e(t){return new Promise((function(e,n){var i=[];if(t.plugins)for(var u=0;u<t.plugins.length;u+=1)-1==o.AMapUI.plugins.indexOf(t.plugins[u])&&i.push(t.plugins[u]);if(a.AMapUI===r.failed)n("前次请求 AMapUI 失败");else if(a.AMapUI===r.notload){a.AMapUI=r.loading,o.AMapUI.version=t.version||o.AMapUI.version,u=o.AMapUI.version;var l=document.body||document.head,c=document.createElement("script");c.type="text/javascript",c.src="https://webapi.amap.com/ui/"+u+"/main.js",c.onerror=function(t){a.AMapUI=r.failed,n("请求 AMapUI 失败")},c.onload=function(){if(a.AMapUI=r.loaded,i.length)window.AMapUI.loadUI(i,(function(){for(var t=0,n=i.length;t<n;t++){var r=i[t].split("/").slice(-1)[0];window.AMapUI[r]=arguments[t]}for(e();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()}));else for(e();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()},l.appendChild(c)}else a.AMapUI===r.loaded?t.version&&t.version!==o.AMapUI.version?n("不允许多个版本 AMapUI 混用"):i.length?window.AMapUI.loadUI(i,(function(){for(var t=0,n=i.length;t<n;t++){var r=i[t].split("/").slice(-1)[0];window.AMapUI[r]=arguments[t]}e()})):e():t.version&&t.version!==o.AMapUI.version?n("不允许多个版本 AMapUI 混用"):s.AMapUI.push((function(t){t?n(t):i.length?window.AMapUI.loadUI(i,(function(){for(var t=0,n=i.length;t<n;t++){var r=i[t].split("/").slice(-1)[0];window.AMapUI[r]=arguments[t]}e()})):e()}))}))}function n(t){return new Promise((function(e,n){if(a.Loca===r.failed)n("前次请求 Loca 失败");else if(a.Loca===r.notload){a.Loca=r.loading,o.Loca.version=t.version||o.Loca.version;var i=o.Loca.version,u=o.AMap.version.startsWith("2"),l=i.startsWith("2");if(u&&!l||!u&&l)n("JSAPI 与 Loca 版本不对应!!");else{u=o.key,l=document.body||document.head;var c=document.createElement("script");c.type="text/javascript",c.src="https://webapi.amap.com/loca?v="+i+"&key="+u,c.onerror=function(t){a.Loca=r.failed,n("请求 AMapUI 失败")},c.onload=function(){for(a.Loca=r.loaded,e();s.Loca.length;)s.Loca.splice(0,1)[0]()},l.appendChild(c)}}else a.Loca===r.loaded?t.version&&t.version!==o.Loca.version?n("不允许多个版本 Loca 混用"):e():t.version&&t.version!==o.Loca.version?n("不允许多个版本 Loca 混用"):s.Loca.push((function(t){t?n(t):n()}))}))}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var r,i;(i=r||(r={})).notload="notload",i.loading="loading",i.loaded="loaded",i.failed="failed";var o={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},a={AMap:r.notload,AMapUI:r.notload,Loca:r.notload},s={AMap:[],AMapUI:[],Loca:[]},u=[];return{load:function(e){return new Promise((function(n,i){if(a.AMap==r.failed)i("");else if(a.AMap==r.notload){var s=e.key,l=e.version,c=e.plugins;s?(window.AMap&&"lbs.amap.com"!==location.host&&i("禁止多种API加载方式混用"),o.key=s,o.AMap.version=l||o.AMap.version,o.AMap.plugins=c||o.AMap.plugins,a.AMap=r.loading,l=document.body||document.head,window.___onAPILoaded=function(o){if(delete window.___onAPILoaded,o)a.AMap=r.failed,i(o);else for(a.AMap=r.loaded,t(e).then((function(){n(window.AMap)})).catch(i);u.length;)u.splice(0,1)[0]()},(c=document.createElement("script")).type="text/javascript",c.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+o.AMap.version+"&key="+s+"&plugin="+o.AMap.plugins.join(","),c.onerror=function(t){a.AMap=r.failed,i(t)},l.appendChild(c)):i("请填写key")}else if(a.AMap==r.loaded)if(e.key&&e.key!==o.key)i("多个不一致的 key");else if(e.version&&e.version!==o.AMap.version)i("不允许多个版本 JSAPI 混用");else{if(s=[],e.plugins)for(l=0;l<e.plugins.length;l+=1)-1==o.AMap.plugins.indexOf(e.plugins[l])&&s.push(e.plugins[l]);s.length?window.AMap.plugin(s,(function(){t(e).then((function(){n(window.AMap)})).catch(i)})):t(e).then((function(){n(window.AMap)})).catch(i)}else if(e.key&&e.key!==o.key)i("多个不一致的 key");else if(e.version&&e.version!==o.AMap.version)i("不允许多个版本 JSAPI 混用");else{var h=[];if(e.plugins)for(l=0;l<e.plugins.length;l+=1)-1==o.AMap.plugins.indexOf(e.plugins[l])&&h.push(e.plugins[l]);!function(t){"function"==typeof t&&(a.AMap===r.loaded?t(window.AMap):u.push(t))}((function(){h.length?window.AMap.plugin(h,(function(){t(e).then((function(){n(window.AMap)})).catch(i)})):t(e).then((function(){n(window.AMap)})).catch(i)}))}}))},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,o={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},a={AMap:r.notload,AMapUI:r.notload,Loca:r.notload},s={AMap:[],AMapUI:[],Loca:[]}}}}()},5048:(t,e,n)=>{"use strict";n.d(e,{S$:()=>G,bf:()=>H,ni:()=>N,oI:()=>Z,sX:()=>V});var r=n(3656);function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var l={exports:{}},c={exports:{}},h={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0},t.exports=e.default}(h,h.exports);var p={},f={exports:{}},d={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=e.pop();return t.call(this,e,r)}},t.exports=e.default}(d,d.exports);var m={};Object.defineProperty(m,"__esModule",{value:!0}),m.fallback=b,m.wrap=x;var g,y=m.hasQueueMicrotask="function"==typeof queueMicrotask&&queueMicrotask,v=m.hasSetImmediate="function"==typeof setImmediate&&setImmediate,_=m.hasNextTick="object"==typeof r&&"function"==typeof r.nextTick;function b(t){setTimeout(t,0)}function x(t){return function(e){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return t((function(){return e.apply(void 0,n)}))}}g=y?queueMicrotask:v?setImmediate:_?r.nextTick:b,m.default=x(g),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.isAsync)(t)?function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=e.pop();return a(t.apply(this,e),r)}:(0,n.default)((function(e,n){var r;try{r=t.apply(this,e)}catch(t){return n(t)}if(r&&"function"==typeof r.then)return a(r,n);n(null,r)}))};var n=o(d.exports),r=o(m),i=p;function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e){return t.then((function(t){s(e,null,t)}),(function(t){s(e,t&&t.message?t:new Error(t))}))}function s(t,e,n){try{t(e,n)}catch(t){(0,r.default)((function(t){throw t}),t)}}t.exports=e.default}(f,f.exports),Object.defineProperty(p,"__esModule",{value:!0}),p.isAsyncIterable=p.isAsyncGenerator=p.isAsync=void 0;var w,S=(w=f.exports)&&w.__esModule?w:{default:w};function E(t){return"AsyncFunction"===t[Symbol.toStringTag]}p.default=function(t){if("function"!=typeof t)throw new Error("expected a function");return E(t)?(0,S.default)(t):t},p.isAsync=E,p.isAsyncGenerator=function(t){return"AsyncGenerator"===t[Symbol.toStringTag]},p.isAsyncIterable=function(t){return"function"==typeof t[Symbol.asyncIterator]};var M={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(void 0===e&&(e=t.length),!e)throw new Error("arity is undefined");return function(){for(var n=this,r=[],i=arguments.length;i--;)r[i]=arguments[i];return"function"==typeof r[e-1]?t.apply(this,r):new Promise((function(i,o){r[e-1]=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];if(t)return o(t);i(e.length>1?e:e[0])},t.apply(n,r)}))}},t.exports=e.default}(M,M.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=o(h.exports),r=o(p),i=o(M.exports);function o(t){return t&&t.__esModule?t:{default:t}}e.default=(0,i.default)((function(t,e,i){var o=(0,n.default)(e)?[]:{};t(e,(function(t,e,n){(0,r.default)(t)((function(t){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];r.length<2&&(r=r[0]),o[e]=r,n(t)}))}),(function(t){return i(t,o)}))}),3),t.exports=e.default}(c,c.exports);var T={exports:{}},A={exports:{}},C={exports:{}},O={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];if(null!==t){var r=t;t=null,r.apply(this,e)}}return Object.assign(e,t),e},t.exports=e.default}(O,O.exports);var P={exports:{}},k={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()},t.exports=e.default}(k,k.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,n.default)(t))return function(t){var e=-1,n=t.length;return function(){return++e<n?{value:t[e],key:e}:null}}(t);var e=(0,r.default)(t);return e?function(t){var e=-1;return function(){var n=t.next();return n.done?null:(e++,{value:n.value,key:e})}}(e):function(t){var e=t?Object.keys(t):[],n=-1,r=e.length;return function i(){var o=e[++n];return"__proto__"===o?i():n<r?{value:t[o],key:o}:null}}(t)};var n=i(h.exports),r=i(k.exports);function i(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default}(P,P.exports);var L={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];if(null===t)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}},t.exports=e.default}(L,L.exports);var I={exports:{}},R={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={},t.exports=e.default}(R,R.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,i){var o=!1,a=!1,s=!1,u=0,l=0;function c(){u>=e||s||o||(s=!0,t.next().then((function(t){var e=t.value,n=t.done;if(!a&&!o){if(s=!1,n)return o=!0,void(u<=0&&i(null));u++,r(e,l,h),l++,c()}})).catch(p))}function h(t,e){if(u-=1,!a)return t?p(t):!1===t?(o=!0,void(a=!0)):e===n.default||o&&u<=0?(o=!0,i(null)):void c()}function p(t){a||(s=!1,o=!0,i(t))}c()};var n=function(t){return t&&t.__esModule?t:{default:t}}(R.exports);t.exports=e.default}(I,I.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=u(O.exports),r=u(P.exports),i=u(L.exports),o=p,a=u(I.exports),s=u(R.exports);function u(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){return function(e,u,l){if(l=(0,n.default)(l),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return l(null);if((0,o.isAsyncGenerator)(e))return(0,a.default)(e,t,u,l);if((0,o.isAsyncIterable)(e))return(0,a.default)(e[Symbol.asyncIterator](),t,u,l);var c=(0,r.default)(e),h=!1,p=!1,f=0,d=!1;function m(t,e){if(!p)if(f-=1,t)h=!0,l(t);else if(!1===t)h=!0,p=!0;else{if(e===s.default||h&&f<=0)return h=!0,l(null);d||g()}}function g(){for(d=!0;f<t&&!h;){var e=c();if(null===e)return h=!0,void(f<=0&&l(null));f+=1,u(e.value,e.key,(0,i.default)(m))}d=!1}g()}},t.exports=e.default}(C,C.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=o(C.exports),r=o(p),i=o(M.exports);function o(t){return t&&t.__esModule?t:{default:t}}e.default=(0,i.default)((function(t,e,i,o){return(0,n.default)(e)(t,(0,r.default)(i),o)}),4),t.exports=e.default}(A,A.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=i(A.exports),r=i(M.exports);function i(t){return t&&t.__esModule?t:{default:t}}e.default=(0,r.default)((function(t,e,r){return(0,n.default)(t,1,e,r)}),3),t.exports=e.default}(T,T.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,n.default)(r.default,t,e)};var n=i(c.exports),r=i(T.exports);function i(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default}(l,l.exports);var D=u(l.exports),N=function(){function t(){this.args=[],this.tasks=[]}return t.prototype.call=function(){for(var t=arguments,e=[],n=0;n<arguments.length;n++)e[n]=t[n];return this.args=e,D(this.tasks)},t.prototype.tap=function(t,e){var n=this;this.tasks.push((function(r){e.apply(void 0,s([],a(n.args),!1)),r(null,t)}))},t}(),F={exports:{}},z={exports:{}};!function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=l(h.exports),r=l(R.exports),i=l(A.exports),o=l(O.exports),a=l(L.exports),s=l(p),u=l(M.exports);function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e,n){n=(0,o.default)(n);var i=0,s=0,u=t.length,l=!1;function c(t,e){!1===t&&(l=!0),!0!==l&&(t?n(t):++s!==u&&e!==r.default||n(null))}for(0===u&&n(null);i<u;i++)e(t[i],i,(0,a.default)(c))}function f(t,e,n){return(0,i.default)(t,1/0,e,n)}e.default=(0,u.default)((function(t,e,r){return((0,n.default)(t)?c:f)(t,(0,s.default)(e),r)}),3),t.exports=e.default}(z,z.exports),function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,r.default)(n.default,t,e)};var n=i(z.exports),r=i(c.exports);function i(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default}(F,F.exports);var B=u(F.exports),j=(function(){function t(){this.tasks=[]}t.prototype.promise=function(){return B(this.tasks)},t.prototype.tapPromise=function(t,e){var n=this;this.tasks.push((function(r){return i(n,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,e()];case 1:return n.sent(),r(null,t),[2]}}))}))}))}}(),{exports:{}});!function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=a(O.exports),r=a(L.exports),i=a(p),o=a(M.exports);function a(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.default)((function(t,e){if(e=(0,n.default)(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var o=0;function a(e){(0,i.default)(t[o++]).apply(void 0,e.concat([(0,r.default)(s)]))}function s(n){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];if(!1!==n)return n||o===t.length?e.apply(void 0,[n].concat(r)):void a(r)}a([])})),t.exports=e.default}(j,j.exports);var U=u(j.exports),Z=(function(){function t(){this.tasks=[]}t.prototype.call=function(){return U(this.tasks)},t.prototype.tap=function(t,e){0===this.tasks.length?this.tasks.push((function(t){var n=e();t(!!n&&null,n)})):this.tasks.push((function(n,r){r(!!e.apply(void 0,s([],a(n),!1))&&null,t)}))}}(),function(){function t(){this.tasks=[]}return t.prototype.call=function(){return D(this.tasks)},t.prototype.tap=function(t,e){this.tasks.push((function(n){n(e(),t)}))},t}()),V=function(){function t(){this.args=[],this.tasks=[]}return t.prototype.promise=function(){for(var t=arguments,e=[],n=0;n<arguments.length;n++)e[n]=t[n];return this.args=e,D(this.tasks)},t.prototype.tapPromise=function(t,e){var n=this;this.tasks.push((function(r){return i(n,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,e.apply(void 0,s([],a(this.args),!1))];case 1:return n.sent(),r(null,t),[2]}}))}))}))},t}(),G=function(){function t(){this.args=[],this.tasks=[]}return t.prototype.promise=function(){for(var t=arguments,e=[],n=0;n<arguments.length;n++)e[n]=t[n];return this.args=e,D(this.tasks)},t.prototype.tapPromise=function(t,e){var n=this;this.tasks.push((function(r){return i(n,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return[4,e.apply(void 0,s([],a(this.args),!1))];case 1:return n=i.sent(),r(n,t),[2]}}))}))}))},t}(),H=function(){function t(){this.tasks=[]}return t.prototype.promise=function(){return U(this.tasks)},t.prototype.tapPromise=function(t,e){0===this.tasks.length?this.tasks.push((function(t){e().then((function(e){t(null,e)}))})):this.tasks.push((function(t,n){e(t).then((function(t){n(null,t)}))}))},t}()},2095:function(t,e){!function(t){"use strict";function e(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var n={}.toString,r=function(t,e){return n.call(t)==="[object "+e+"]"},i=function(t){return Array.isArray?Array.isArray(t):r(t,"Array")},o=function(t){if("object"!=typeof(e=t)||null===e||!r(t,"Object"))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n},a=(Object.values,5);function s(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,s){for(var u in r=r||0,s=s||a,n){var l;n.hasOwnProperty(u)&&(null!==(l=n[u])&&o(l)?(o(e[u])||(e[u]={}),r<s?t(e[u],l,r+1,s):e[u]=n[u]):i(l)?(e[u]=[],e[u]=e[u].concat(l)):void 0!==l&&(e[u]=l))}}(t,e[r]);return t}function u(t){return t}var l,c=function(t,e){var n=(e=void 0===e?{}:e).fontSize,i=e.fontFamily,o=e.fontWeight,a=e.fontStyle;return e=e.fontVariant,(l=l||document.createElement("canvas").getContext("2d")).font=[a,e,o,n+"px",i].join(" "),l.measureText(r(t,"String")?t:"").width};if(!function(t){return r(t,"Function")}(c))throw new TypeError("Expected a function");new Map;var h="undefined"!=typeof Float32Array?Float32Array:Array;function p(){var t=new h(9);return h!=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}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function f(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function d(t,e,n,r,i){var o=t[0];return o=[o,t=t[1]],(t=p())[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=o[0],t[7]=o[1],t[8]=1,t}c=new h(3),h!=Float32Array&&(c[0]=0,c[1]=0,c[2]=0);class m{constructor(t){this.options=s({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=s({},this.options,t),this.rescale(t)}rescale(t){}}function g(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function y(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function v(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class _ extends m{constructor(t){super(t)}getDefaultOptions(){return{domain:[],range:[]}}map(t){return 0===this.domainIndexMap.size&&g(this.domainIndexMap,this.getDomain(),this.domainKey),y({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&g(this.rangeIndexMap,this.getRange(),this.rangeKey),y({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=v(e),this.rangeKey=v(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new _(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||(({domain:t,compare:e}=this.options),this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}class b extends _{constructor(t){super(t)}getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:void 0,flex:[]}}clone(){return new b(this.options)}getStep(t){return void 0===this.valueStep?1:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){const e=t.domain;var n=e.length;if(0===n)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};const{range:r,paddingOuter:i,paddingInner:o,flex:a=[],round:s,align:u}=t;t=a;var l=0<(l=(c=e.length)-t.length)?[...t,...new Array(l).fill(1)]:l<0?t.slice(0,c):t,[c,t]=r,h=(t-=c)/(2/n*i+1-1/n*o);const p=h*o/n;h-=n*p;const f=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),d=h/f.reduce(((t,e)=>t+e));l=new Map(e.map(((t,e)=>(e=f[e]*d,[t,s?Math.floor(e):e]))));const m=new Map(e.map(((t,e)=>(e=f[e]*d+p,[t,s?Math.floor(e):e]))));h=Array.from(m.values()).reduce(((t,e)=>t+e)),c+=(t-(h-h/n*o))*u;let g=s?Math.round(c):c;const y=new Array(n);for(let t=0;t<n;t+=1){y[t]=(v=g,Math.round(1e12*v)/1e12);var v=e[t];g+=m.get(v)}return{valueBandWidth:l,valueStep:m,adjustedRange:y}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}function x(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function w(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}const S=Math.sqrt(50),E=Math.sqrt(10),M=Math.sqrt(2);function T(t,e,n){return n=(e=(e-t)/Math.max(0,n))/10**(t=Math.floor(Math.log(e)/Math.LN10)),0<=t?(n>=S?10:n>=E?5:n>=M?2:1)*10**t:-(10**-t)/(n>=S?10:n>=E?5:n>=M?2:1)}const A=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],u=r[a];return u<s&&([s,u]=[u,s],[o,a]=[a,o]),0<(i=T(s,u,n))?(s=Math.floor(s/i)*i,u=Math.ceil(u/i)*i,i=T(s,u,n)):i<0&&(s=Math.ceil(s*i)/i,u=Math.floor(u*i)/i,i=T(s,u,n)),0<i?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(u/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(u*i)/i),r};function C(t){return null!=t&&!Number.isNaN(t)}c={exports:{}};var O,P={exports:{}},k=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},L=Array.prototype.concat,I=Array.prototype.slice,R=P.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];k(i)?e=L.call(e,I.call(i)):e.push(i)}return e},D=(R.wrap=function(t){return function(){return t(R(arguments))}},{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]}),N=P.exports,F=Object.hasOwnProperty,z=Object.create(null);for(O in D)F.call(D,O)&&(z[D[O]]=O);var B=c.exports={to:{},get:{}};function j(t,e,n){return Math.min(Math.max(e,t),n)}function U(t){return(t=Math.round(t).toString(16).toUpperCase()).length<2?"0"+t:t}B.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=B.get.hsl(t),n="hsl";break;case"hwb":e=B.get.hwb(t),n="hwb";break;default:e=B.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},B.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,2+o),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:F.call(D,e[1])?((i=D[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]))}e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=j(i[n],0,255);return i[3]=j(i[3],0,1),i},B.get.hsl=function(t){return t&&(t=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,j(parseFloat(t[2]),0,100),j(parseFloat(t[3]),0,100),j(isNaN(e)?1:e,0,1)]):null;var e},B.get.hwb=function(t){return t&&(t=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,j(parseFloat(t[2]),0,100),j(parseFloat(t[3]),0,100),j(isNaN(e)?1:e,0,1)]):null;var e},B.to.hex=function(){var t=N(arguments);return"#"+U(t[0])+U(t[1])+U(t[2])+(t[3]<1?U(Math.round(255*t[3])):"")},B.to.rgb=function(){var t=N(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},B.to.rgb.percent=function(){var t=N(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},B.to.hsl=function(){var t=N(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},B.to.hwb=function(){var t=N(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},B.to.keyword=function(t){return z[t.slice(0,3)]};var Z=c.exports;function V(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function G(t){if(!(t=Z.get(t)))return null;var e,n,{model:t,value:r}=t;return"rgb"===t?r:"hsl"===t?(r=(t=r)[0]/360,e=t[1]/100,n=t[2]/100,t=t[3],0==e?[255*n,255*n,255*n,t]:[255*V(n=2*n-(e=n<.5?n*(1+e):n+e-n*e),e,r+1/3),255*V(n,e,r),255*V(n,e,r-1/3),t]):null}const H=(t,e)=>n=>t*(1-n)+e*n,W=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return H(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const i=G(n),o=G(r);return null===i||null===o?i?()=>n:()=>r:t=>{const e=new Array(4);for(let a=0;a<4;a+=1){var n=i[a],r=o[a];e[a]=n*(1-t)+r*t}var[a,s,u,l]=e;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(u)}, ${l})`}}},q=(t,e)=>{const n=H(t,e);return t=>Math.round(n(t))},Y=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&0<n)return[o];let s=T(o,a,n);if(0===s||!Number.isFinite(s))return[];if(0<s){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i},X=(t,e,n)=>{var[t,r]=t,[e,i]=e;let o,a;return x(a=t<r?(o=w(t,r),n(e,i)):(o=w(r,t),n(i,e)),o)},$=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r);var a=t[0]>t[r],s=a?[...t].reverse():t,u=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=w(s[t],s[t+1]),o[t]=n(u[t],u[t+1]);return e=>{var n=function(t,e,n,r,i){let o=1,a=r||t.length;const s=t=>t;for(;o<a;){var u=Math.floor((o+a)/2);s(t[u])>e?a=u:o=u+1}return o}(t,e,0,r)-1,a=i[n];return x(o[n],a)(e)}},K=(t,e,n,r)=>(2<Math.min(t.length,e.length)?$:X)(t,e,r=r?q:n);class J extends m{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:H,tickCount:5}}map(t){return C(t)?this.output(t):this.options.unknown}invert(t){return C(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){const t=this.options.tickMethod;var[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return A}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,n=(t=this.options.domain.map(t),Math.min(t.length,n.length));if(e){e=t[0];const r=(t=t[n-1])<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return u}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options;var a=K(n.map(t),r,o,i);this.output=x(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options;t=K(i,r.map(t),H),this.input=x(e,n,t)}}class Q extends J{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:W,tickMethod:Y,tickCount:5}}chooseTransforms(){return[u,u]}clone(){return new Q(this.options)}}class tt extends b{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:void 0,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new tt(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}function et(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function nt(t,e,n,r,i){var o=new Q({range:[e,e+r]}),a=new Q({range:[n,n+i]});return{transform:function(t){var e=t[0];return t=t[1],[o.map(e),a.map(t)]},untransform:function(t){var e=t[0];return t=t[1],[o.invert(e),a.invert(t)]}}}function rt(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function it(t,e,n,r,i){return t[0]}function ot(t,e,n,r,i){var o=t[0],a=t[1],s=t[2],u=(t=t[3],new Q({range:[s,t]})),l=new Q({range:[o,a]}),c=1<(s=i/r)?1:s,h=1<s?1/s:1;return{transform:function(t){var e=t[0];return t=t[1],e=l.map(e),[(t=u.map(t))*Math.cos(e)*c*.5+.5,t*Math.sin(e)*h*.5+.5]},untransform:function(t){var e=t[0],n=(t=t[1],e=2*(e-.5)/c,t=2*(t-.5)/h,Math.sqrt(Math.pow(e,2)+Math.pow(t,2)));return t=f(Math.atan2(t,e),o,a),[l.invert(t),u.invert(n)]}}}function at(t,e,n,r,i){return{transform:function(t){var e=t[0];return[t[1],e]},untransform:function(t){var e=t[0];return[t[1],e]}}}function st(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return dt.apply(void 0,e([[-1,-1]],n,!1))}function ut(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return dt.apply(void 0,e([[-1,1]],n,!1))}function lt(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return dt.apply(void 0,e([[1,-1]],n,!1))}function ct(t,e,n,r,i){t=t[0];var o,a=p();return o=Math.sin(t),t=Math.cos(t),a[0]=t,a[1]=o,a[2]=0,a[3]=-o,a[4]=t,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a}function ht(t,e,n,r,i){var o=t[0],a=t[1],s=t[2],u=(t[3]-s)/(+a/(2*Math.PI)+1),l=u/(2*Math.PI),c=new Q({range:[s,s+.99*u]}),h=new Q({range:[o,a]}),p=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0];return t=t[1],e=h.map(e),t=c.map(t),[Math.cos(e)*(l*e+t)*p*.5+.5,Math.sin(e)*(l*e+t)*d*.5+.5]},untransform:function(t){var e=t[0],n=(t=t[1],e=2*(e-.5)/p,t=2*(t-.5)/d,Math.sqrt(Math.pow(e,2)+Math.pow(t,2)));return t=f(Math.atan2(t,e)+Math.floor(n/u)*Math.PI*2,o,a),e=n-l*t,[h.invert(t),c.invert(e)]}}}function pt(t,e,n,r,i){var o=t[0],a=t[1],s=t[2],u=(t=t[3],new Q({range:[s,t]}));return{transform:function(t){for(var e=[],n=t.length,r=new tt({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[o,a]}),i=0;i<n;i++){var s=t[i],l=r.map(i);s=u.map(s),e.push(l,s)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}}P=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var ft=et(c=["January","February","March","April","May","June","July","August","September","October","November","December"],3),dt=(function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o,a=i[r];for(o in a)t[o]=a[o]}}({},{dayNamesShort:et(P,3),dayNames:P,monthNamesShort:ft,monthNames:c,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),function(t,e,n,r,i){var o=t[0];return o=[o,t=t[1]],(t=p())[0]=o[0],t[1]=0,t[2]=0,t[3]=0,t[4]=o[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t});function mt(t){return 1/Math.tan(t)}function gt(t,e,n,r,i){var o=mt(t[0]);return{transform:function(t){return[t[0]+(t=t[1])*o,t]},untransform:function(t){return[t[0]-(t=t[1])*o,t]}}}function yt(t,e,n,r,i){var o=mt(t[0]);return{transform:function(t){var e=t[0];return[e,t[1]+e*o]},untransform:function(t){var e=t[0];return[e,t[1]-e*o]}}}function vt(t,e,n,r,i){var o=t<e;return i=(o?e-r:i-e)||i-r,(r=o?-1:1)*i*(n+1)/(n+i/((t-e)*r))+e}function _t(t,e,n,r,i){var o=t<e;return(i=(o?e-r:i-e)||i-r)/(i*(n+1)/(t-e)-n*(o?-1:1))+e}function bt(t,e,n){return n?new Q({range:[0,1],domain:[0,e]}).map(t):t}function xt(t,e,n,r,i){var o=t[0],a=t[1],s=bt(o,r,void 0!==(t=t[2])&&t);return{transform:function(t){var e=t[0];return t=t[1],[vt(e,s,a,0,1),t]},untransform:function(t){var e=t[0];return t=t[1],[_t(e,s,a,0,1),t]}}}function wt(t,e,n,r,i){var o=t[0],a=t[1],s=bt(o,i,void 0!==(t=t[2])&&t);return{transform:function(t){return[t[0],vt(t[1],s,a,0,1)]},untransform:function(t){return[t[0],_t(t[1],s,a,0,1)]}}}function St(t,e,n,r,i){var o=t[0],a=t[1],s=t[2],u=t[3],l=bt(o,r,t=void 0!==(t=t[4])&&t),c=bt(a,i,t);return{transform:function(t){var e=t[0];return t=t[1],[vt(e,l,s,0,1),vt(t,c,u,0,1)]},untransform:function(t){var e=t[0];return t=t[1],[_t(e,l,s,0,1),_t(t,c,u,0,1)]}}}function Et(t,e,n,r,i){var o=t[0],a=t[1],s=t[2],u=t[3],l=(t=void 0!==(t=t[4])&&t,new Q({range:[0,r]})),c=new Q({range:[0,i]}),h=t?o:l.map(o),p=t?a:c.map(a);return{transform:function(t){var e=t[0],n=(t=t[1],l.map(e)-h),r=c.map(t)-p,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=vt(i,0,u,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=p+e*Math.sin(t),[l.invert(i),c.invert(r)])},untransform:function(t){var e=t[0],n=(t=t[1],l.map(e)-h),r=c.map(t)-p,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=_t(i,0,u,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=p+e*Math.sin(t),[l.invert(i),c.invert(r)])}}}function Mt(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:nt,translate:d,custom:rt,matrix:it,polar:ot,transpose:at,scale:dt,"shear.x":gt,"shear.y":yt,reflect:st,"reflect.x":ut,"reflect.y":lt,rotate:ct,helix:ht,parallel:pt,fisheye:St,"fisheye.x":xt,"fisheye.y":wt,"fisheye.circular":Et},this.update(t)}Mt.prototype.update=function(t){this.options=s({},this.options,t),this.recoordinate()},Mt.prototype.clone=function(){return new Mt(this.options)},Mt.prototype.getOptions=function(){return this.options},Mt.prototype.clear=function(){this.update({transformations:[]})},Mt.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},Mt.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},Mt.prototype.transform=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this.options.transformations;return this.update({transformations:e(e([],r,!0),[e([],t,!0)],!1)}),this},Mt.prototype.map=function(t){return this.output(t)},Mt.prototype.invert=function(t){return this.input(t)},Mt.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},Mt.prototype.compose=function(t){for(var n=(t=void 0!==t&&t)?e([],this.options.transformations,!0).reverse():this.options.transformations,r=t?function(t){return t.untransform}:function(t){return t.transform},i=[],o=[],a=function(t,e){return o.push((e=void 0===e||e)?(n=t,function(t){for(var e=[],r=0;r<t.length-1;r+=2){var i=[t[r],t[r+1]];i=n(i),e.push.apply(e,i)}return e}):t);var n},s=0,l=n;s<l.length;s++){var c,h,p,f,d=(m=l[s])[0],m=m.slice(1),g=this.transformers[d];g&&(c=(f=this.options).x,h=f.y,p=f.width,f=f.height,(m=g=g(e([],m,!0),c,h,p,f))instanceof Float32Array||m instanceof Array?i.push(g):(i.length&&(a(this.createMatrixTransform(i,t)),i.splice(0,i.length)),a(r(g)||u,"parallel"!==d)))}return i.length&&a(this.createMatrixTransform(i,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):u}.apply(void 0,o)},Mt.prototype.createMatrixTransform=function(t,e){var n,r,i,o,a,s,u,l,c,f,d,m,g=p();return e&&t.reverse(),t.forEach((function(t){return function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=(e=e[8],n[0]),p=n[1],f=n[2],d=n[3],m=n[4],g=n[5],y=n[6],v=n[7];return n=n[8],t[0]=h*r+p*a+f*l,t[1]=h*i+p*s+f*c,t[2]=h*o+p*u+f*e,t[3]=d*r+m*a+g*l,t[4]=d*i+m*s+g*c,t[5]=d*o+m*u+g*e,t[6]=y*r+v*a+n*l,t[7]=y*i+v*s+n*c,t[8]=y*o+v*u+n*e,t}(g,g,t)})),e&&(e=t=g,(m=new h(9))[0]=e[0],m[1]=e[1],m[2]=e[2],m[3]=e[3],m[4]=e[4],m[5]=e[5],m[6]=e[6],m[7]=e[7],m[8]=e[8],m=(e=m)[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],(d=m*(l=(e=e[8])*o-a*u)+n*(c=-e*i+a*s)+r*(f=u*i-o*s))&&(t[0]=l*(d=1/d),t[1]=(-e*n+r*u)*d,t[2]=(a*n-r*o)*d,t[3]=c*d,t[4]=(e*m-r*s)*d,t[5]=(-a*m+r*i)*d,t[6]=f*d,t[7]=(-u*m+n*s)*d,t[8]=(o*m-n*i)*d)),function(t){var e,n,r,i,o;return t=[t[0],t[1],1],r=g,i=(n=e=t)[0],o=n[1],n=n[2],e[0]=i*r[0]+o*r[3]+n*r[6],e[1]=i*r[1]+o*r[4]+n*r[7],e[2]=i*r[2]+o*r[5]+n*r[8],[t[0],t[1]]}},t.Coordinate=Mt,Object.defineProperty(t,"__esModule",{value:!0})}(e)},5483:(t,e,n)=>{"use strict";var r,i,o,a;function s(t){r||(r=document.createElement("table"),i=document.createElement("tr"),o=/^\s*<(\w+|!)[^>]*>/,a={tr:document.createElement("tbody"),tbody:r,thead:r,tfoot:r,td:i,th:i,"*":document.createElement("div")});var e=o.test(t)&&RegExp.$1;e&&e in a||(e="*");var n=a[e];t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,n.innerHTML=""+t;var s=n.childNodes[0];return s&&n.contains(s)&&n.removeChild(s),s}n.d(e,{Z:()=>s})},3275:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}()},6794:()=>{window._iconfont_svg_string_3580659='<svg><symbol id="l7-icon-area1" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.064889 219.136l38.798223 466.261333a113.777778 113.777778 0 1 1-133.518223 145.237334H279.210667a113.777778 113.777778 0 1 1-60.302223-137.272889L697.856 227.555556A113.777778 113.777778 0 0 1 796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m577.592889-534.072889L269.198222 796.444444c4.152889 7.168 7.509333 14.791111 10.012445 22.812445h465.578666a114.119111 114.119111 0 0 1 65.479111-71.224889l-38.798222-466.261333a112.924444 112.924444 0 0 1-23.210666-7.964445zM796.444444 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-area" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.008 219.136l38.855112 466.261333a113.777778 113.777778 0 0 1-16.497778 224.540445L853.333333 967.111111a113.777778 113.777778 0 0 1-108.544-79.644444H279.210667a113.834667 113.834667 0 0 1-100.067556 79.36L170.666667 967.111111a113.777778 113.777778 0 0 1-17.066667-226.304l30.492444-351.175111a113.777778 113.777778 0 0 1 34.986667-218.680889L227.555556 170.666667a113.777778 113.777778 0 0 1 99.896888 59.221333l355.84-71.395556a113.777778 113.777778 0 0 1 104.675556-101.262222L796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m526.051555-582.314666L340.650667 296.903111a113.891556 113.891556 0 0 1-88.462223 98.645333l-30.947555 355.84c27.477333 13.653333 48.64 38.115556 58.026667 67.754667h465.521777a114.119111 114.119111 0 0 1 65.536-71.168l-38.855111-466.261333a113.948444 113.948444 0 0 1-74.752-56.206222zM227.555556 238.933333a45.511111 45.511111 0 1 0 0 91.022223 45.511111 45.511111 0 0 0 0-91.022223z m568.888888-113.777777a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-delete" viewBox="0 0 1024 1024"><path d="M705.422222 85.333333a34.133333 34.133333 0 0 1 34.133334 34.133334V227.555556h136.533333a34.133333 34.133333 0 0 1 0 68.266666h-25.543111l-24.348445 610.076445a34.133333 34.133333 0 0 1-34.133333 32.768H231.936a34.133333 34.133333 0 0 1-34.076444-32.768L173.340444 295.822222H147.911111a34.133333 34.133333 0 1 1 0-68.266666H284.444444V119.466667a34.133333 34.133333 0 0 1 34.133334-34.133334h386.844444zM241.720889 295.822222l22.983111 574.577778h494.535111l23.04-574.577778H241.720889zM671.288889 153.6H352.711111V227.555556h318.577778V153.6z" ></path></symbol><symbol id="l7-icon-color" viewBox="0 0 1024 1024"><path d="M512 56.888889c9.841778 0 19.626667 0.341333 29.354667 0.910222 69.176889 4.437333 119.068444 62.577778 124.302222 131.072l0.455111 9.386667c0.739556 44.600889 15.303111 84.935111 44.999111 114.631111 27.022222 27.022222 62.805333 41.528889 102.570667 44.430222l12.060444 0.568889c72.476444 1.194667 135.793778 52.451556 140.458667 124.757333 1.137778 18.261333 1.251556 36.807111 0.170667 55.637334-13.198222 233.585778-211.399111 424.220444-445.326223 428.714666L512 967.111111a455.111111 455.111111 0 0 1-455.054222-464.156444c4.551111-233.927111 195.185778-432.128 428.771555-445.326223C494.535111 57.116444 503.296 56.888889 512 56.888889z m0 68.266667a385.706667 385.706667 0 0 0-22.414222 0.625777C291.726222 136.988444 129.080889 305.948444 125.155556 504.263111c-4.152889 212.366222 163.100444 387.185778 372.508444 394.353778l13.425778 0.227555 8.533333-0.113777c198.371556-3.811556 367.331556-166.456889 378.538667-364.373334a396.174222 396.174222 0 0 0-0.170667-47.331555c-1.991111-31.232-29.127111-56.604444-67.128889-60.472889l-8.248889-0.455111-14.051555-0.682667c-56.547556-4.209778-107.406222-25.884444-145.806222-64.284444-38.855111-38.798222-60.416-90.225778-64.284445-145.749334l-0.910222-21.333333c-2.901333-38.001778-28.785778-66.048-60.302222-68.096A433.891556 433.891556 0 0 0 512 125.155556zM438.044444 682.666667a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m-170.666666-227.555556a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m142.222222-227.555555a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z" ></path></symbol><symbol id="l7-icon-base-map" viewBox="0 0 1024 1024"><path d="M923.761778 115.029333A34.133333 34.133333 0 0 1 967.111111 147.911111v624.128a34.133333 34.133333 0 0 1-22.186667 32.028445l-278.755555 103.992888a34.133333 34.133333 0 0 1-23.665778 0.056889L381.724444 812.714667a34.133333 34.133333 0 0 0-23.665777 0.113777L102.968889 908.060444a34.133333 34.133333 0 0 1-45.738667-26.965333L56.888889 876.088889V251.960889a34.133333 34.133333 0 0 1 22.186667-32.028445l278.755555-103.992888a34.133333 34.133333 0 0 1 20.992-0.967112l266.183111 72.988445a34.133333 34.133333 0 0 0 18.204445 0zM403.911111 192.625778v555.576889l216.177778 79.075555V251.960889l-216.177778-59.335111z m-68.266667 4.380444L125.155556 275.569778v551.310222l210.432-78.506667V197.006222zM898.844444 192.853333l-210.545777 58.936889v575.089778l210.545777-78.563556V192.853333z" ></path></symbol><symbol id="l7-icon-dot" viewBox="0 0 1024 1024"><path d="M341.333333 739.555556a113.777778 113.777778 0 0 1 8.533334 227.271111L341.333333 967.111111a113.777778 113.777778 0 0 1-8.533333-227.271111L341.333333 739.555556z m0 68.266666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM910.222222 341.333333a113.777778 113.777778 0 0 1 8.533334 227.271111L910.222222 568.888889a113.777778 113.777778 0 0 1-8.533333-227.271111L910.222222 341.333333z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM227.555556 56.888889a113.777778 113.777778 0 0 1 8.533333 227.271111L227.555556 284.444444a113.777778 113.777778 0 0 1-8.533334-227.271111L227.555556 56.888889z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-display" viewBox="0 0 1024 1024"><path d="M512 170.666667c284.444444 0 455.111111 227.555556 455.111111 341.333333s-170.666667 341.333333-455.111111 341.333333-455.111111-227.555556-455.111111-341.333333 170.666667-341.333333 455.111111-341.333333z m0 68.266666C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 110.762667 178.574222 273.066667 386.844444 273.066667s386.844444-162.304 386.844444-273.066667c0-110.762667-178.574222-273.066667-386.844444-273.066667zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-enlarge" viewBox="0 0 1024 1024"><path d="M546.133333 147.911111l-0.056889 329.955556H876.088889a34.133333 34.133333 0 0 1 0 68.266666H546.076444v329.955556a34.133333 34.133333 0 0 1-68.266666 0V546.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h329.898667V147.911111a34.133333 34.133333 0 0 1 68.266666 0z" ></path></symbol><symbol id="l7-icon-export-picture" viewBox="0 0 1024 1024"><path d="M883.873684 161.684211a32.336842 32.336842 0 0 1 32.336842 32.336842v582.063158a32.336842 32.336842 0 0 1-32.336842 32.336842H86.231579a32.336842 32.336842 0 0 1-32.336842-32.336842V194.021053a32.336842 32.336842 0 0 1 32.336842-32.336842h797.642105z m-32.336842 64.673684H118.568421v517.389473h170.792421a32.175158 32.175158 0 0 1 0.431158-0.646736l3.772632-4.473264 330.320842-330.374736a32.336842 32.336842 0 0 1 38.588631-5.389474l4.473263 3.018105 184.589474 147.725474V226.357895z m-202.428631 248.131368L379.850105 743.747368H851.536842v-107.304421l-202.428631-161.953684zM323.368421 323.368421a107.789474 107.789474 0 1 1 0 215.578947 107.789474 107.789474 0 0 1 0-215.578947z m0 64.673684a43.115789 43.115789 0 1 0 0 86.231579 43.115789 43.115789 0 0 0 0-86.231579z" ></path></symbol><symbol id="l7-icon-exit-fullscreen" viewBox="0 0 1024 1024"><path d="M841.955556 591.644444a34.133333 34.133333 0 0 1 5.518222 67.811556l-5.518222 0.455111h-133.745778l192 192.056889a34.133333 34.133333 0 0 1-38.343111 55.182222l-5.176889-2.958222-4.721778-3.982222L659.911111 708.266667V841.955556a34.133333 34.133333 0 0 1-28.615111 33.678222L625.777778 876.088889a34.133333 34.133333 0 0 1-33.678222-28.615111L591.644444 841.955556V625.777778a34.133333 34.133333 0 0 1 28.615112-33.678222L625.777778 591.644444h216.177778z m-443.733334 0a34.133333 34.133333 0 0 1 33.678222 28.615112L432.355556 625.777778v216.177778a34.133333 34.133333 0 0 1-67.811556 5.518222L364.088889 841.955556v-133.745778l-192.056889 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L315.847111 659.911111H182.044444a34.133333 34.133333 0 0 1-33.678222-28.615111L147.911111 625.777778a34.133333 34.133333 0 0 1 28.615111-33.678222L182.044444 591.644444H398.222222zM167.310222 119.808l4.721778 3.982222L364.088889 315.847111V182.044444a34.133333 34.133333 0 0 1 28.615111-33.678222L398.222222 147.911111a34.133333 34.133333 0 0 1 33.678222 28.615111L432.355556 182.044444V398.222222a34.133333 34.133333 0 0 1-28.615112 33.678222L398.222222 432.355556H182.044444a34.133333 34.133333 0 0 1-5.518222-67.811556L182.044444 364.088889h133.802667L123.790222 172.032a34.133333 34.133333 0 0 1 43.52-52.224z m732.899556 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L708.266667 364.088889H841.955556a34.133333 34.133333 0 0 1 33.678222 28.615111L876.088889 398.222222a34.133333 34.133333 0 0 1-28.615111 33.678222L841.955556 432.355556H625.777778a34.133333 34.133333 0 0 1-33.678222-28.615112L591.644444 398.222222V182.044444a34.133333 34.133333 0 0 1 67.811556-5.518222l0.455111 5.518222v133.802667l192.056889-192.056889a34.133333 34.133333 0 0 1 48.241778 0z" ></path></symbol><symbol id="l7-icon-line" viewBox="0 0 1024 1024"><path d="M853.333333 56.888889a113.777778 113.777778 0 0 1 8.533334 227.271111L853.333333 284.444444c-19.000889 0-36.864-4.664889-52.622222-12.856888l-529.123555 529.066666a113.777778 113.777778 0 0 1-92.387556 166.115556L170.666667 967.111111a113.777778 113.777778 0 0 1-8.533334-227.271111L170.666667 739.555556c19.000889 0 36.864 4.664889 52.622222 12.856888l529.123555-529.066666a113.777778 113.777778 0 0 1 92.387556-166.115556L853.333333 56.888889zM170.666667 807.822222a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m682.666666-682.666666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-layer" viewBox="0 0 1024 1024"><path d="M767.089778 625.777778l180.167111 82.773333a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730667-420.977778 193.422222a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422222a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730667L256.853333 625.777778l81.749334 37.546666L172.771556 739.555556 512 895.374222 851.171556 739.555556l-165.831112-76.231112 81.749334-37.546666z m0-227.555556l180.167111 82.773334a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730666-420.977778 193.422223a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422223a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730666L256.853333 398.222222l81.749334 37.546667-165.831111 76.174222L512 667.818667l339.171556-155.875556-165.831112-76.174222L767.089778 398.222222zM497.720889 60.017778a34.133333 34.133333 0 0 1 28.558222 0l420.977778 193.422222a34.133333 34.133333 0 0 1 0 62.008889l-420.977778 193.422222a34.133333 34.133333 0 0 1-28.558222 0l-420.977778-193.422222a34.133333 34.133333 0 0 1 0-62.008889zM512 128.568889L172.771556 284.387556 512 440.263111l339.171556-155.875555L512 128.568889z" ></path></symbol><symbol id="l7-icon-narrow" viewBox="0 0 1024 1024"><path d="M910.222222 512a34.133333 34.133333 0 0 1-34.133333 34.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h728.177778a34.133333 34.133333 0 0 1 34.133333 34.133333z" ></path></symbol><symbol id="l7-icon-fullscreen" viewBox="0 0 1024 1024"><path d="M645.176889 597.674667l4.721778 3.982222L841.955556 793.6l0.056888-133.688889a34.133333 34.133333 0 0 1 28.615112-33.678222L876.088889 625.777778a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 659.911111v216.177778a34.133333 34.133333 0 0 1-28.615111 33.678222L876.088889 910.222222h-216.177778a34.133333 34.133333 0 0 1-5.518222-67.811555l5.518222-0.455111h133.745778l-192-192.056889a34.133333 34.133333 0 0 1 43.52-52.224z m-222.833778 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L230.286222 841.955556H364.088889a34.133333 34.133333 0 0 1 33.678222 28.615111L398.222222 876.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L364.088889 910.222222H147.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 876.088889v-216.177778a34.133333 34.133333 0 0 1 67.811555-5.518222l0.455111 5.518222-0.056888 133.745778 192.113777-192a34.133333 34.133333 0 0 1 48.241778 0zM364.088889 113.777778a34.133333 34.133333 0 0 1 5.518222 67.811555L364.088889 182.044444H230.343111l192 192.056889a34.133333 34.133333 0 0 1-43.52 52.224l-4.721778-3.982222-192.113777-192.056889L182.044444 364.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L147.911111 398.222222a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 364.088889V147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L147.911111 113.777778h216.177778z m512 0a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 147.911111v216.177778a34.133333 34.133333 0 0 1-67.811555 5.518222L841.955556 364.088889l-0.056889-133.745778-192 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L793.6 182.044444H659.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L625.777778 147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L659.911111 113.777778h216.177778z" ></path></symbol><symbol id="l7-icon-hide" viewBox="0 0 1024 1024"><path d="M875.52 87.836444a34.133333 34.133333 0 0 1 7.281778 43.121778l-3.527111 5.006222-682.666667 796.444445a34.133333 34.133333 0 0 1-55.409778-39.367111l3.527111-5.006222 97.166223-113.379556C123.164444 697.969778 56.888889 582.940444 56.888889 512c0-113.777778 170.666667-341.333333 455.111111-341.333333a496.64 496.64 0 0 1 208.952889 45.112889l106.439111-124.188445a34.133333 34.133333 0 0 1 48.128-3.754667z m-38.684444 202.524445C921.031111 362.951111 967.111111 452.835556 967.111111 512c0 113.777778-170.666667 341.333333-455.111111 341.333333-50.631111 0-97.678222-7.224889-140.8-19.740444l50.232889-58.595556A417.393778 417.393778 0 0 0 512 785.066667c208.270222 0 386.844444-162.304 386.844444-273.066667 0-52.849778-40.675556-117.418667-105.813333-170.496l43.804445-51.2zM512 238.933333C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 66.787556 64.853333 152.291556 162.133333 209.692444L377.173333 616.675556a170.666667 170.666667 0 0 1 217.713778-253.895112l78.620445-91.704888A432.924444 432.924444 0 0 0 512 238.933333z m166.684444 236.088889a170.666667 170.666667 0 0 1-177.664 207.303111l177.607112-207.303111zM512 409.6a102.4 102.4 0 0 0-88.746667 153.486222L548.864 416.426667A102.172444 102.172444 0 0 0 512 409.6z" ></path></symbol><symbol id="l7-icon-rectangle" viewBox="0 0 1024 1024"><path d="M170.666667 56.888889a113.777778 113.777778 0 0 1 108.544 79.644444H853.333333a34.133333 34.133333 0 0 1 33.678223 28.615111L887.466667 170.666667v574.122666a113.777778 113.777778 0 1 1-142.677334 142.734223L170.666667 887.466667a34.133333 34.133333 0 0 1-33.678223-28.615111L136.533333 853.333333V279.210667A113.777778 113.777778 0 0 1 170.666667 56.888889z m682.666666 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-34.133333-603.022222H279.210667a114.062222 114.062222 0 0 1-74.353778 74.410667L204.8 819.2h539.989333a114.062222 114.062222 0 0 1 74.410667-74.410667V204.8zM170.666667 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-ranging" viewBox="0 0 1024 1024"><path d="M723.171556 50.403556l250.424888 250.424888a31.061333 31.061333 0 0 1 0 43.918223L344.746667 973.596444a31.061333 31.061333 0 0 1-43.918223 0L50.403556 723.171556a31.061333 31.061333 0 0 1 0-43.918223L679.253333 50.403556a31.061333 31.061333 0 0 1 43.918223 0z m-21.959112 74.524444l-39.765333 39.822222 98.986667 98.872889a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222 62.179556 62.122667a34.133333 34.133333 0 0 1-44.088889 51.882667L563.2 387.242667 501.077333 325.063111 437.191111 388.949333l98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222L387.242667 563.2a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.584-62.122667-62.179556-63.886222 63.886222 98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-39.765333 39.822222 197.802667 197.745778 576.284444-576.284444-197.802667-197.745778z" ></path></symbol><symbol id="l7-icon-reposition" viewBox="0 0 1024 1024"><path d="M512 56.888889a34.133333 34.133333 0 0 1 34.133333 34.133333v24.177778A398.336 398.336 0 0 1 908.856889 477.866667h24.177778a34.133333 34.133333 0 0 1 0 68.266666h-24.177778A398.336 398.336 0 0 1 546.133333 908.856889L546.133333 932.977778a34.133333 34.133333 0 0 1-68.266666 0v-24.177778A398.336 398.336 0 0 1 115.2 546.133333L91.022222 546.133333a34.133333 34.133333 0 1 1 0-68.266666h24.177778A398.336 398.336 0 0 1 477.866667 115.2V91.022222A34.133333 34.133333 0 0 1 512 56.888889z m34.190222 126.862222L546.133333 193.422222a34.133333 34.133333 0 1 1-68.266666 0v-9.671111A330.069333 330.069333 0 0 0 183.751111 477.866667h9.671111a34.133333 34.133333 0 1 1 0 68.266666l-9.671111 0.056889A330.069333 330.069333 0 0 0 477.866667 840.248889V830.577778a34.133333 34.133333 0 0 1 68.266666 0l0.056889 9.671111A330.069333 330.069333 0 0 0 840.248889 546.133333L830.577778 546.133333a34.133333 34.133333 0 0 1 0-68.266666h9.671111A330.069333 330.069333 0 0 0 546.133333 183.751111zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-round" viewBox="0 0 1024 1024"><path d="M512 56.888889a455.111111 455.111111 0 0 1 391.395556 687.502222 113.777778 113.777778 0 0 1-159.061334 158.890667A455.111111 455.111111 0 0 1 120.604444 279.608889 113.777778 113.777778 0 0 1 279.608889 120.604444 452.835556 452.835556 0 0 1 512 56.888889z m0 68.266667a384.910222 384.910222 0 0 0-191.715556 50.744888A113.777778 113.777778 0 0 1 175.957333 320.284444a386.844444 386.844444 0 0 0 527.815111 527.758223 113.777778 113.777778 0 0 1 144.270223-144.440889A386.844444 386.844444 0 0 0 512 125.155556z m299.406222 640.739555a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM212.593778 167.082667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-guanbi" viewBox="0 0 1024 1024"><path d="M576 512l277.333333 277.333333-64 64-277.333333-277.333333L234.666667 853.333333 170.666667 789.333333l277.333333-277.333333L170.666667 234.666667 234.666667 170.666667l277.333333 277.333333L789.333333 170.666667 853.333333 234.666667 576 512z" ></path></symbol></svg>',function(t){try{var e,n=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss");if(!(e=e.getAttribute("data-disable-injectsvg"))){var r,i,o,a,s;if(n&&!t.__iconfont__svg__cssinject__){t.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console&&console.log(e)}}r=function(){var e,n=document.createElement("div");n.innerHTML=t._iconfont_svg_string_3580659,(n=n.getElementsByTagName("svg")[0])&&(n.setAttribute("aria-hidden","true"),n.style.position="absolute",n.style.width=0,n.style.height=0,n.style.overflow="hidden",(e=document.body).firstChild?function(t,e){e.parentNode.insertBefore(t,e)}(n,e.firstChild):e.appendChild(n))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(r,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),r()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=r,a=t.document,s=!1,function t(){try{a.documentElement.doScroll("left")}catch(e){return void setTimeout(t,50)}u()}(),a.onreadystatechange=function(){"complete"==a.readyState&&(a.onreadystatechange=null,u())})}function u(){s||(s=!0,o())}}catch(l){}}(window)},1522:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ButtonControl:()=>S,Control:()=>w,ExportImage:()=>R,Fullscreen:()=>Z,GeoLocate:()=>V,LayerPopup:()=>Q,LayerSwitch:()=>G,Logo:()=>H,MapTheme:()=>Y,Marker:()=>m,MarkerLayer:()=>_,MouseLocation:()=>X,PopperControl:()=>T,Popup:()=>J,PositionType:()=>h.PositionType,Scale:()=>$,SelectControl:()=>O,Zoom:()=>K});var r=n(3659),i=n(3192),o=n(6838),a=n(5161),s=n(6193),u=n(9097),l=n(6875),c=n(6297),h=n(108),p=n(5619),f=n(1883),d=n.n(f);var m=function(t){(0,s.Z)(d,t);var e,n,f=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function d(t){var e;return(0,i.Z)(this,d),e=f.call(this),(0,c.Z)((0,a.Z)(e),"added",!1),(0,c.Z)((0,a.Z)(e),"eventHandle",(function(t){e.polyfillEvent(t),e.emit(t.type,{target:t,data:e.markerOption.extData,lngLat:e.lngLat})})),e.markerOption=(0,r.Z)((0,r.Z)({},e.getDefault()),t),(0,p.bindAll)(["update","onMove","onMapClick"],(0,a.Z)(e)),e.init(),e}return(0,o.Z)(d,[{key:"getMarkerLayerContainerSize",value:function(){}},{key:"getDefault",value:function(){return{element:void 0,anchor:p.anchorType.BOTTOM,offsets:[0,0],color:"#5B8FF9",draggable:!1}}},{key:"addTo",value:function(t){this.scene=t,this.mapsService=t.get(h.TYPES.IMapService),this.sceneSerive=t.get(h.TYPES.ISceneService);var e=this.markerOption.element;return this.mapsService.getMarkerContainer().appendChild(e),this.registerMarkerEvent(e),this.mapsService.on("camerachange",this.update),this.update(),this.added=!0,this.emit("added"),this}},{key:"remove",value:function(){this.mapsService&&(this.mapsService.off("click",this.onMapClick),this.mapsService.off("move",this.update),this.mapsService.off("moveend",this.update),this.mapsService.off("camerachange",this.update)),this.unRegisterMarkerEvent(),this.removeAllListeners();var t=this.markerOption.element;return t&&p.DOM.remove(t),this.popup&&this.popup.remove(),this}},{key:"setLnglat",value:function(t){return this.lngLat=t,Array.isArray(t)&&(this.lngLat={lng:t[0],lat:t[1]}),this.popup&&this.popup.setLnglat(this.lngLat),this.update(),this}},{key:"getLnglat",value:function(){return this.lngLat}},{key:"getElement",value:function(){return this.markerOption.element}},{key:"setElement",value:function(t){var e=this;if(!this.added)return this.once("added",(function(){e.setElement(t)})),this;var n=this.markerOption.element;return n&&p.DOM.remove(n),this.markerOption.element=t,this.init(),this.mapsService.getMarkerContainer().appendChild(t),this.registerMarkerEvent(t),this.update(),this}},{key:"openPopup",value:function(){var t=this;if(!this.added)return this.once("added",(function(){t.openPopup()})),this;var e=this.popup;return e?(e.isOpen()||e.addTo(this.scene),this):this}},{key:"closePopup",value:function(){var t=this;this.added||this.once("added",(function(){t.closePopup()}));var e=this.popup;return e&&e.remove(),this}},{key:"setPopup",value:function(t){return this.popup=t,this.lngLat&&this.popup.setLnglat(this.lngLat),this}},{key:"togglePopup",value:function(){var t=this.popup;return t?(t.isOpen()?t.remove():t.addTo(this.scene),this):this}},{key:"getPopup",value:function(){return this.popup}},{key:"getOffset",value:function(){return this.markerOption.offsets}},{key:"setDraggable",value:function(t){throw new Error("Method not implemented.")}},{key:"isDraggable",value:function(){return this.markerOption.draggable}},{key:"getExtData",value:function(){return this.markerOption.extData}},{key:"setExtData",value:function(t){this.markerOption.extData=t}},{key:"update",value:function(){if(this.mapsService){var t=this.markerOption,e=t.element,n=t.anchor;this.updatePosition(),p.DOM.setTransform(e,"".concat(p.anchorTranslate[n]))}}},{key:"onMapClick",value:function(t){var e=this.markerOption.element;this.popup&&e&&this.togglePopup()}},{key:"getCurrentContainerSize",value:function(){var t=this.mapsService.getContainer();return{containerHeight:(null==t?void 0:t.scrollHeight)||0,containerWidth:(null==t?void 0:t.scrollWidth)||0,bounds:this.mapsService.getBounds()}}},{key:"updatePosition",value:function(){if(this.mapsService){var t=this.markerOption,e=t.element,n=t.offsets,r=this.lngLat,i=r.lng,o=r.lat,a=this.mapsService.lngLatToContainer([i,o]);if(e){e.style.display="block",e.style.whiteSpace="nowrap";var s=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize(),u=s.containerHeight,l=s.containerWidth,c=s.bounds;if(!c)return;if(Math.abs(c[0][0])>180||Math.abs(c[1][0])>180){if(a.x>l){var h=this.mapsService.lngLatToContainer([i-360,o]);a.x=h.x}if(a.x<0){var p=this.mapsService.lngLatToContainer([i+360,o]);a.x=p.x}}(a.x>l||a.x<0||a.y>u||a.y<0)&&(e.style.display="none"),e.style.left=a.x+n[0]+"px",e.style.top=a.y-n[1]+"px"}}}},{key:"init",value:function(){var t=this,e=this.markerOption.element,n=this.markerOption,r=n.color,i=n.anchor;if(!e){this.defaultMarker=!0,e=p.DOM.create("div"),this.markerOption.element=e;var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","48px"),o.setAttributeNS(null,"width","48px"),o.setAttributeNS(null,"viewBox","0 0 1024 1024");var a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttributeNS(null,"d","M512 490.666667C453.12 490.666667 405.333333 442.88 405.333333 384 405.333333 325.12 453.12 277.333333 512 277.333333 570.88 277.333333 618.666667 325.12 618.666667 384 618.666667 442.88 570.88 490.666667 512 490.666667M512 85.333333C346.88 85.333333 213.333333 218.88 213.333333 384 213.333333 608 512 938.666667 512 938.666667 512 938.666667 810.666667 608 810.666667 384 810.666667 218.88 677.12 85.333333 512 85.333333Z"),a.setAttributeNS(null,"fill",r),o.appendChild(a),e.appendChild(o)}p.DOM.addClass(e,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach((function(n){var r,i,o=(null===(r=t.markerOption)||void 0===r?void 0:r.style)&&(null===(i=t.markerOption)||void 0===i?void 0:i.style[n]);e&&(e.style[n]=o)})),(0,p.applyAnchorClass)(e,i,"marker")}},{key:"registerMarkerEvent",value:function(t){t.addEventListener("click",this.onMapClick),t.addEventListener("mousemove",this.eventHandle),t.addEventListener("click",this.eventHandle),t.addEventListener("mousedown",this.eventHandle),t.addEventListener("mouseup",this.eventHandle),t.addEventListener("dblclick",this.eventHandle),t.addEventListener("contextmenu",this.eventHandle),t.addEventListener("mouseover",this.eventHandle),t.addEventListener("mouseout",this.eventHandle),t.addEventListener("touchstart",this.eventHandle),t.addEventListener("touchend",this.eventHandle)}},{key:"unRegisterMarkerEvent",value:function(){var t=this.getElement();t.removeEventListener("click",this.onMapClick),t.removeEventListener("mousemove",this.eventHandle),t.removeEventListener("click",this.eventHandle),t.removeEventListener("mousedown",this.eventHandle),t.removeEventListener("mouseup",this.eventHandle),t.removeEventListener("dblclick",this.eventHandle),t.removeEventListener("contextmenu",this.eventHandle),t.removeEventListener("mouseover",this.eventHandle),t.removeEventListener("mouseout",this.eventHandle),t.removeEventListener("touchstart",this.eventHandle),t.removeEventListener("touchend",this.eventHandle)}},{key:"polyfillEvent",value:function(t){this.mapsService&&"GAODE2.x"===this.mapsService.version&&((0,p.isPC)()||("touchstart"===t.type&&(this.touchStartTime=Date.now()),"touchend"===t.type&&Date.now()-this.touchStartTime<300&&this.emit("click",{target:t,data:this.markerOption.extData,lngLat:this.lngLat})))}},{key:"addDragHandler",value:function(t){return null}},{key:"onUp",value:function(t){throw new Error("Method not implemented.")}}]),d}(f.EventEmitter),g=n(9479),y=n(1469),v=n.n(y);var _=function(t){(0,s.Z)(d,t);var e,n,f=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function d(t){var e,n;return(0,i.Z)(this,d),n=f.call(this),(0,c.Z)((0,a.Z)(n),"markers",[]),(0,c.Z)((0,a.Z)(n),"points",[]),(0,c.Z)((0,a.Z)(n),"clusterMarkers",[]),n.markerLayerOption=(0,g.merge)(n.getDefault(),t),(0,p.bindAll)(["update"],(0,a.Z)(n)),n.zoom=(null===(e=n.markerLayerOption.clusterOption)||void 0===e?void 0:e.zoom)||-99,n}return(0,o.Z)(d,[{key:"getDefault",value:function(){return{cluster:!1,clusterOption:{radius:80,maxZoom:20,minZoom:0,zoom:-99,style:{},className:""}}}},{key:"addTo",value:function(t){return this.scene=t,this.mapsService=t.get(h.TYPES.IMapService),this.markerLayerOption.cluster&&(this.initCluster(),this.update(),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update)),this.mapsService.on("camerachange",this.setContainerSize.bind(this)),this.mapsService.on("viewchange",this.setContainerSize.bind(this)),this.addMarkers(),this.inited=!0,this}},{key:"setContainerSize",value:function(){if(this.mapsService){var t=this.mapsService.getContainer();this.containerSize={containerWidth:(null==t?void 0:t.scrollWidth)||0,containerHeight:(null==t?void 0:t.scrollHeight)||0,bounds:this.mapsService.getBounds()}}}},{key:"getContainerSize",value:function(){return this.containerSize}},{key:"addMarker",value:function(t){var e=this.markerLayerOption.cluster;if(t.getMarkerLayerContainerSize=this.getContainerSize.bind(this),e&&(this.addPoint(t,this.markers.length),this.mapsService)){var n=this.mapsService.getZoom(),r=this.mapsService.getBounds();this.bbox=(0,p.padBounds)(r,.5),this.zoom=Math.floor(n),this.getClusterMarker(this.bbox,this.zoom)}this.markers.push(t)}},{key:"removeMarker",value:function(t){this.markers.indexOf(t);var e=this.markers.indexOf(t);e>-1&&this.markers.splice(e,1)}},{key:"hide",value:function(){this.markers.map((function(t){t.getElement().style.opacity="0"})),this.clusterMarkers.map((function(t){t.getElement().style.opacity="0"}))}},{key:"show",value:function(){this.markers.map((function(t){t.getElement().style.opacity="1"})),this.clusterMarkers.map((function(t){t.getElement().style.opacity="1"}))}},{key:"getMarkers",value:function(){return this.markerLayerOption.cluster?this.clusterMarkers:this.markers}},{key:"addMarkers",value:function(){var t=this;this.getMarkers().forEach((function(e){e.addTo(t.scene)}))}},{key:"clear",value:function(){this.markers.forEach((function(t){t.remove()})),this.clusterMarkers.forEach((function(t){t.remove()})),this.markers=[],this.points=[],this.clusterMarkers=[]}},{key:"destroy",value:function(){this.clear(),this.removeAllListeners(),this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.mapsService.off("camerachange",this.setContainerSize.bind(this)),this.mapsService.off("viewchange",this.setContainerSize.bind(this))}},{key:"addPoint",value:function(t,e){var n=t.getLnglat(),i={geometry:{type:"Point",coordinates:[n.lng,n.lat]},properties:(0,r.Z)((0,r.Z)({},t.getExtData()),{},{marker_id:e})};this.points.push(i),this.clusterIndex&&this.clusterIndex.load(this.points)}},{key:"initCluster",value:function(){if(this.markerLayerOption.cluster){var t=this.markerLayerOption.clusterOption,e=t.radius,n=t.minZoom,r=void 0===n?0:n,i=t.maxZoom;this.clusterIndex=new(v())({radius:e,minZoom:r,maxZoom:i}),this.clusterIndex.load(this.points)}}},{key:"getClusterMarker",value:function(t,e){var n=this,r=t[0].concat(t[1]),i=this.clusterIndex.getClusters(r,e);this.clusterMarkers.forEach((function(t){t.remove()})),this.clusterMarkers=[],i.forEach((function(t){var e,r=n.markerLayerOption.clusterOption,i=r.field,o=r.method;if(null!==(e=t.properties)&&void 0!==e&&e.cluster_id){var a,s=n.getLeaves(null===(a=t.properties)||void 0===a?void 0:a.cluster_id);if(t.properties.clusterData=s,i&&o){var u=null==s?void 0:s.map((function(t){return(0,c.Z)({},i,t.properties[i])})),l=p.Satistics.getColumn(u,i),h=p.Satistics.getSatByColumn(o,l),f="point_"+o;t.properties[f]=h.toFixed(2)}}var d=n.clusterMarker(t);n.clusterMarkers.push(d),d.addTo(n.scene)}))}},{key:"getLeaves",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t?this.clusterIndex.getLeaves(t,e,n):null}},{key:"clusterMarker",value:function(t){var e=this.markerLayerOption.clusterOption.element,n=void 0===e?this.generateElement.bind(this):e;return new m({element:n(t)}).setLnglat({lng:t.geometry.coordinates[0],lat:t.geometry.coordinates[1]})}},{key:"normalMarker",value:function(t){var e=t.properties.marker_id;return this.markers[e]}},{key:"update",value:function(){if(this.mapsService&&0!==this.markers.length){var t=this.mapsService.getZoom(),e=this.mapsService.getBounds();(!this.bbox||Math.abs(t-this.zoom)>=1||!(0,p.boundsContains)(this.bbox,e))&&(this.bbox=(0,p.padBounds)(e,.5),this.zoom=Math.floor(t),this.getClusterMarker(this.bbox,this.zoom))}}},{key:"generateElement",value:function(t){var e=p.DOM.create("div","l7-marker-cluster"),n=p.DOM.create("div","",e),r=p.DOM.create("span","",n),i=this.markerLayerOption.clusterOption,o=i.field,a=i.method;t.properties.point_count=t.properties.point_count||1;var s=o&&a?t.properties["point_"+a]||t.properties[o]:t.properties.point_count;return r.textContent=s,e}}]),d}(f.EventEmitter),b=(n(6794),n(9458)),x=n(5162);var w=function(t){(0,s.Z)(c,t);var e,n,a=(e=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function c(t){var e;return(0,i.Z)(this,c),e=a.call(this),c.controlCount++,e.controlOption=(0,r.Z)((0,r.Z)({},e.getDefault(t)),t||{}),e}return(0,o.Z)(c,[{key:"getOptions",value:function(){return this.controlOption}},{key:"setOptions",value:function(t){var e=this.getDefault(t);Object.entries(t).forEach((function(n){var r=(0,x.Z)(n,2),i=r[0];void 0===r[1]&&(t[i]=e[i])})),"position"in t&&this.setPosition(t.position),"className"in t&&this.setClassName(t.className),"style"in t&&this.setStyle(t.style),this.controlOption=(0,r.Z)((0,r.Z)({},this.controlOption),t)}},{key:"addTo",value:function(t){this.mapsService=t.get(h.TYPES.IMapService),this.renderService=t.get(h.TYPES.IRendererService),this.layerService=t.get(h.TYPES.ILayerService),this.controlService=t.get(h.TYPES.IControlService),this.configService=t.get(h.TYPES.IGlobalConfigService),this.scene=t.get(h.TYPES.ISceneService),this.sceneContainer=t,this.isShow=!0,this.container=this.onAdd(),p.DOM.addClass(this.container,"l7-control");var e=this.controlOption,n=e.className,r=e.style;return n&&this.setClassName(n),r&&this.setStyle(r),this.insertContainer(),this.emit("add",this),this}},{key:"remove",value:function(){if(!this.mapsService)return this;p.DOM.remove(this.container),this.onRemove(),this.emit("remove",this)}},{key:"onAdd",value:function(){return p.DOM.create("div")}},{key:"onRemove",value:function(){}},{key:"show",value:function(){var t=this.container;p.DOM.removeClass(t,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}},{key:"hide",value:function(){var t=this.container;p.DOM.addClass(t,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}},{key:"getDefault",value:function(t){return{position:h.PositionType.TOPRIGHT,name:"".concat(c.controlCount)}}},{key:"getContainer",value:function(){return this.container}},{key:"getIsShow",value:function(){return this.isShow}},{key:"_refocusOnMap",value:function(t){if(this.mapsService&&t&&t.screenX>0&&t.screenY>0){var e=this.mapsService.getContainer();null!==e&&e.focus()}}},{key:"setPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.PositionType.TOPLEFT,e=this.controlService;return e&&e.removeControl(this),this.controlOption.position=t,e&&e.addControl(this,this.sceneContainer),this}},{key:"setClassName",value:function(t){var e=this.container,n=this.controlOption.className;n&&p.DOM.removeClass(e,n),t&&p.DOM.addClass(e,t)}},{key:"setStyle",value:function(t){var e=this.container;t?e.setAttribute("style",t):e.removeAttribute("style")}},{key:"insertContainer",value:function(){var t=this.controlOption.position,e=this.container;if(t instanceof Element)t.appendChild(e);else{var n=this.controlService.controlCorners[t];["bottomleft","bottomright","righttop","rightbottom"].includes(t)?n.insertBefore(e,n.firstChild):n.appendChild(e)}}},{key:"checkUpdateOption",value:function(t,e){return e.some((function(e){return e in t}))}}]),c}(d());(0,c.Z)(w,"controlCount",0);var S=function(t){(0,s.Z)(h,t);var e,n,r=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function h(){var t;(0,i.Z)(this,h);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"isDisable",!1),t}return(0,o.Z)(h,[{key:"setIsDisable",value:function(t){var e,n;this.isDisable=t,t?null===(e=this.button)||void 0===e||e.setAttribute("disabled","true"):null===(n=this.button)||void 0===n||n.removeAttribute("disabled")}},{key:"createButton",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return p.DOM.create("button","l7-button-control ".concat(t))}},{key:"onAdd",value:function(){this.button=this.createButton(),this.isDisable=!1;var t=this.controlOption,e=t.title,n=t.btnText,r=t.btnIcon;return this.setBtnTitle(e),this.setBtnText(n),this.setBtnIcon(r),this.button}},{key:"onRemove",value:function(){this.button=this.buttonIcon=this.buttonText=void 0,this.isDisable=!1}},{key:"setOptions",value:function(t){var e=t.title,n=t.btnText,r=t.btnIcon;this.checkUpdateOption(t,["title"])&&this.setBtnTitle(e),this.checkUpdateOption(t,["btnIcon"])&&this.setBtnIcon(r),this.checkUpdateOption(t,["btnText"])&&this.setBtnText(n),(0,b.Z)((0,l.Z)(h.prototype),"setOptions",this).call(this,t)}},{key:"setBtnTitle",value:function(t){var e;null===(e=this.button)||void 0===e||e.setAttribute("title",null!=t?t:"")}},{key:"setBtnIcon",value:function(t){if(this.buttonIcon&&p.DOM.remove(this.buttonIcon),t){var e,n,r,i=null===(e=this.button)||void 0===e?void 0:e.firstChild;i?null===(n=this.button)||void 0===n||n.insertBefore(t,i):null===(r=this.button)||void 0===r||r.appendChild(t),this.buttonIcon=t}}},{key:"setBtnText",value:function(t){if(this.button)if(p.DOM.removeClass(this.button,"l7-button-control--row"),p.DOM.removeClass(this.button,"l7-button-control--column"),t){var e,n=this.buttonText;n||(n=p.DOM.create("div","l7-button-control__text"),null===(e=this.button)||void 0===e||e.appendChild(n),this.buttonText=n),n.innerText=t,p.DOM.addClass(this.button,this.controlOption.vertical?"l7-button-control--column":"l7-button-control--row")}else!t&&this.buttonText&&(p.DOM.remove(this.buttonText),this.buttonText=void 0)}}]),h}(w);var E=function(t){(0,s.Z)(h,t);var e,n,r=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function h(t,e){var n;return(0,i.Z)(this,h),n=r.call(this),(0,c.Z)((0,a.Z)(n),"isShow",!1),(0,c.Z)((0,a.Z)(n),"timeout",null),(0,c.Z)((0,a.Z)(n),"show",(function(){return n.isShow||!n.contentDOM.innerHTML||(n.resetPopperPosition(),p.DOM.removeClass(n.popperDOM,"l7-popper-hide"),n.isShow=!0,n.option.unique&&h.conflictPopperList.forEach((function(t){t!==(0,a.Z)(n)&&t.isShow&&t.hide()})),n.emit("show")),(0,a.Z)(n)})),(0,c.Z)((0,a.Z)(n),"hide",(function(){return n.isShow?(p.DOM.addClass(n.popperDOM,"l7-popper-hide"),n.isShow=!1,n.emit("hide"),(0,a.Z)(n)):(0,a.Z)(n)})),(0,c.Z)((0,a.Z)(n),"setHideTimeout",(function(){n.timeout||(n.timeout=window.setTimeout((function(){n.isShow&&(n.hide(),n.timeout=null)}),300))})),(0,c.Z)((0,a.Z)(n),"clearHideTimeout",(function(){n.timeout&&(window.clearTimeout(n.timeout),n.timeout=null)})),(0,c.Z)((0,a.Z)(n),"onBtnClick",(function(){n.isShow?n.hide():n.show()})),(0,c.Z)((0,a.Z)(n),"onBtnMouseLeave",(function(){n.setHideTimeout()})),(0,c.Z)((0,a.Z)(n),"onBtnMouseMove",(function(){n.clearHideTimeout(),n.isShow||n.show()})),n.button=t,n.option=e,n.init(),e.unique&&h.conflictPopperList.push((0,a.Z)(n)),n}return(0,o.Z)(h,[{key:"buttonRect",get:function(){return this.button.getBoundingClientRect()}},{key:"getPopperDOM",value:function(){return this.popperDOM}},{key:"getIsShow",value:function(){return this.isShow}},{key:"getContent",value:function(){return this.content}},{key:"setContent",value:function(t){"string"==typeof t?this.contentDOM.innerHTML=t:t instanceof HTMLElement&&(p.DOM.clearChildren(this.contentDOM),this.contentDOM.appendChild(t)),this.content=t}},{key:"init",value:function(){var t=this.option.trigger;this.popperDOM=this.createPopper(),"click"===t?this.button.addEventListener("click",this.onBtnClick):(this.button.addEventListener("mousemove",this.onBtnMouseMove),this.button.addEventListener("mouseleave",this.onBtnMouseLeave),this.popperDOM.addEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.addEventListener("mouseleave",this.onBtnMouseLeave))}},{key:"destroy",value:function(){this.button.removeEventListener("click",this.onBtnClick),this.button.removeEventListener("mousemove",this.onBtnMouseMove),this.button.removeEventListener("mousemove",this.onBtnMouseLeave),this.popperDOM.removeEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.removeEventListener("mouseleave",this.onBtnMouseLeave),p.DOM.remove(this.popperDOM)}},{key:"resetPopperPosition",value:function(){var t={},e=this.option,n=e.container,r=e.offset,i=void 0===r?[0,0]:r,o=e.placement,a=(0,x.Z)(i,2),s=a[0],u=a[1],l=this.button.getBoundingClientRect(),c=n.getBoundingClientRect(),h=p.DOM.getDiffRect(l,c),f=h.left,d=h.right,m=h.top,g=h.bottom,y=!1,v=!1;/^(left|right)/.test(o)?(o.includes("left")?t.right="".concat(l.width+d,"px"):o.includes("right")&&(t.left="".concat(l.width+f,"px")),o.includes("start")?t.top="".concat(m,"px"):o.includes("end")?t.bottom="".concat(g,"px"):(t.top="".concat(m+l.height/2,"px"),v=!0,t.transform="translate(".concat(s,"px, calc(").concat(u,"px - 50%))"))):/^(top|bottom)/.test(o)&&(o.includes("top")?t.bottom="".concat(l.height+g,"px"):o.includes("bottom")&&(t.top="".concat(l.height+m,"px")),o.includes("start")?t.left="".concat(f,"px"):o.includes("end")?t.right="".concat(d,"px"):(t.left="".concat(f+l.width/2,"px"),y=!0,t.transform="translate(calc(".concat(s,"px - 50%), ").concat(u,"px)"))),t.transform="translate(calc(".concat(s,"px - ").concat(y?"50%":"0%","), calc(").concat(u,"px - ").concat(v?"50%":"0%",")");var _=o.split("-");_.length&&p.DOM.addClass(this.popperDOM,_.map((function(t){return"l7-popper-".concat(t)})).join(" ")),p.DOM.addStyle(this.popperDOM,p.DOM.css2Style(t))}},{key:"createPopper",value:function(){var t=this.option,e=t.container,n=t.className,r=void 0===n?"":n,i=t.content,o=p.DOM.create("div","l7-popper l7-popper-hide ".concat(r)),a=p.DOM.create("div","l7-popper-content"),s=p.DOM.create("div","l7-popper-arrow");return o.appendChild(a),o.appendChild(s),e.appendChild(o),this.popperDOM=o,this.contentDOM=a,i&&this.setContent(i),o}}]),h}(f.EventEmitter);(0,c.Z)(E,"conflictPopperList",[]);var M={topleft:"right-start",topcenter:"bottom",topright:"left-start",bottomleft:"right-end",bottomcenter:"top",bottomright:"left-end",lefttop:"bottom-start",leftcenter:"right",leftbottom:"top-start",righttop:"bottom-end",rightcenter:"left",rightbottom:"top-end"},T=function(t){(0,s.Z)(c,t);var e,n,a=(e=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function c(){return(0,i.Z)(this,c),a.apply(this,arguments)}return(0,o.Z)(c,[{key:"getPopper",value:function(){return this.popper}},{key:"hide",value:function(){this.popper.hide(),(0,b.Z)((0,l.Z)(c.prototype),"hide",this).call(this)}},{key:"getDefault",value:function(t){var e,n=(0,b.Z)((0,l.Z)(c.prototype),"getDefault",this).call(this,t),i=null!==(e=null==t?void 0:t.position)&&void 0!==e?e:n.position;return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(c.prototype),"getDefault",this).call(this,t)),{},{popperPlacement:i instanceof Element?"bottom":M[i],popperTrigger:"click"})}},{key:"onAdd",value:function(){var t=(0,b.Z)((0,l.Z)(c.prototype),"onAdd",this).call(this);return this.initPopper(),t}},{key:"onRemove",value:function(){this.popper.destroy()}},{key:"initPopper",value:function(){var t=this,e=this.controlOption,n=e.popperClassName,r=e.popperPlacement,i=e.popperTrigger,o=this.mapsService.getMapContainer();return this.popper=new E(this.button,{className:n,placement:r,trigger:i,container:o,unique:!0}),this.popper.on("show",(function(){t.emit("popperShow",t)})).on("hide",(function(){t.emit("popperHide",t)})),this.popper}},{key:"setOptions",value:function(t){if((0,b.Z)((0,l.Z)(c.prototype),"setOptions",this).call(this,t),this.checkUpdateOption(t,["popperPlacement","popperTrigger","popperClassName"])){var e=this.popper.getContent();this.popper.destroy(),this.initPopper(),this.popper.setContent(e)}}}]),c}(S),A=n(9908);var C=function(t){return t.ActiveOptionClassName="l7-select-control-item-active",t.OptionValueAttrKey="data-option-value",t.OptionIndexAttrKey="data-option-index",t}(C||{}),O=function(t){(0,s.Z)(h,t);var e,n,r=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function h(){var t;(0,i.Z)(this,h);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"selectValue",[]),(0,c.Z)((0,a.Z)(t),"createNormalOption",(function(e){var n=t.selectValue.includes(e.value),r=p.DOM.create("div","l7-select-control-item ".concat(n?C.ActiveOptionClassName:""));t.getIsMultiple()&&r.appendChild(t.createCheckbox(n)),e.icon&&r.appendChild(e.icon);var i=p.DOM.create("span");return i.innerText=e.text,r.appendChild(i),r})),(0,c.Z)((0,a.Z)(t),"onItemClick",(function(e){if(t.getIsMultiple()){var n=t.selectValue.findIndex((function(t){return t===e.value}));n>-1?t.selectValue.splice(n,1):t.selectValue=[].concat((0,A.Z)(t.selectValue),[e.value])}else t.selectValue=[e.value];t.setSelectValue(t.selectValue)})),t}return(0,o.Z)(h,[{key:"setOptions",value:function(t){(0,b.Z)((0,l.Z)(h.prototype),"setOptions",this).call(this,t);var e=t.options;e&&this.popper.setContent(this.getPopperContent(e))}},{key:"onAdd",value:function(){var t=(0,b.Z)((0,l.Z)(h.prototype),"onAdd",this).call(this),e=this.controlOption.defaultValue;return e&&(this.selectValue=this.transSelectValue(e)),this.popper.setContent(this.getPopperContent(this.controlOption.options)),t}},{key:"getSelectValue",value:function(){return this.getIsMultiple()?this.selectValue:this.selectValue[0]}},{key:"setSelectValue",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.transSelectValue(t);this.optionDOMList.forEach((function(t){var n=t.getAttribute(C.OptionValueAttrKey),i=e.getIsMultiple()?t.querySelector("input[type=checkbox]"):void 0;r.includes(n)?(p.DOM.addClass(t,C.ActiveOptionClassName),i&&p.DOM.setChecked(i,!0)):(p.DOM.removeClass(t,C.ActiveOptionClassName),i&&p.DOM.setChecked(i,!1))})),this.selectValue=r,n&&this.emit("selectChange",this.getIsMultiple()?r:r[0])}},{key:"getIsMultiple",value:function(){return!1}},{key:"getPopperContent",value:function(t){var e=this,n=this.isImageOptions(),r=p.DOM.create("div",n?"l7-select-control--image":"l7-select-control--normal");this.getIsMultiple()&&p.DOM.addClass(r,"l7-select-control--multiple");var i=t.map((function(t,r){var i=n?e.createImageOption(t):e.createNormalOption(t);return i.setAttribute(C.OptionValueAttrKey,t.value),i.setAttribute(C.OptionIndexAttrKey,window.String(r)),i.addEventListener("click",e.onItemClick.bind(e,t)),i}));return r.append.apply(r,(0,A.Z)(i)),this.optionDOMList=i,r}},{key:"createImageOption",value:function(t){var e=this.selectValue.includes(t.value),n=p.DOM.create("div","l7-select-control-item ".concat(e?C.ActiveOptionClassName:"")),r=p.DOM.create("img");r.setAttribute("src",t.img),p.DOM.setUnDraggable(r),n.appendChild(r);var i=p.DOM.create("div","l7-select-control-item-row");this.getIsMultiple()&&n.appendChild(this.createCheckbox(e));var o=p.DOM.create("span");return o.innerText=t.text,i.appendChild(o),n.appendChild(i),n}},{key:"createCheckbox",value:function(t){var e=p.DOM.create("input");return e.setAttribute("type","checkbox"),t&&p.DOM.setChecked(e,!0),e}},{key:"isImageOptions",value:function(){return!!this.controlOption.options.find((function(t){return t.img}))}},{key:"transSelectValue",value:function(t){return Array.isArray(t)?t:[t]}}]),h}(T),P=n(800),k=n(1109),L=n.n(k),I=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.classList.add("l7-iconfont"),e.setAttribute("aria-hidden","true");var n=document.createElementNS("http://www.w3.org/2000/svg","use");return n.setAttributeNS("http://www.w3.org/1999/xlink","href","#".concat(t)),e.appendChild(n),e};var R=function(t){(0,s.Z)(f,t);var e,n,h,p=(n=f,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,l.Z)(n);if(h){var r=(0,l.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,u.Z)(this,t)});function f(){var t;(0,i.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=p.call.apply(p,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"onClick",(0,P.Z)(L().mark((function e(){var n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=t.controlOption.onExport)){e.next=5;break}e.next=10;break;case 5:return e.t0=n,e.next=8,t.getImage();case 8:e.t1=e.sent,(0,e.t0)(e.t1);case 10:case"end":return e.stop()}}),e)})))),(0,c.Z)((0,a.Z)(t),"mergeImage",(0,P.Z)(L().mark((function e(){var n,r,i,o,a,s,u,l,c,h,p,f,d,m=arguments;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=t.controlOption.imageType,o=null!==(n=null===(r=t.mapsService.getContainer())||void 0===r?void 0:r.getBoundingClientRect())&&void 0!==n?n:{},a=o.width,s=void 0===a?0:a,u=o.height,l=void 0===u?0:u,(c=document.createElement("canvas")).width=s,c.height=l,h=c.getContext("2d"),p=m.length,f=new Array(p),d=0;d<p;d++)f[d]=m[d];return e.next=9,Promise.all(f.map((function(t){return new Promise((function(e){var n=new Image;n.onload=function(){e(n)},n.src=t}))})));case 9:return e.sent.forEach((function(t){null==h||h.drawImage(t,0,0,s,l)})),e.abrupt("return",c.toDataURL("image/".concat(i)));case 12:case"end":return e.stop()}}),e)})))),t}return(0,o.Z)(f,[{key:"onAdd",value:function(){var t=(0,b.Z)((0,l.Z)(f.prototype),"onAdd",this).call(this);return t.addEventListener("click",this.onClick),t}},{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(f.prototype),"getDefault",this).call(this,t)),{},{title:"导出图片",btnIcon:I("l7-icon-export-picture"),imageType:"png"})}},{key:"getImage",value:(e=(0,P.Z)(L().mark((function t(){var e,n;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.mapsService.exportMap("png");case 2:return e=t.sent,t.next=5,this.scene.exportPng("png");case 5:return n=t.sent,t.abrupt("return",this.mergeImage.apply(this,(0,A.Z)([e,n].filter((function(t){return t})))));case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),f}(S);function D(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return N(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var F=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],z=function(){if("undefined"==typeof document)return!1;for(var t=F[0],e={},n=0,r=F;n<r.length;n++){var i=r[n];if((null==i?void 0:i[1])in document){var o,a=D(i.entries());try{for(a.s();!(o=a.n()).done;){var s=(0,x.Z)(o.value,2),u=s[0],l=s[1];e[t[u]]=l}}catch(t){a.e(t)}finally{a.f()}return e}}return!1}(),B={change:z.fullscreenchange,error:z.fullscreenerror},j={request:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.documentElement,e=arguments.length>1?arguments[1]:void 0;return new Promise((function(n,r){var i=function t(){j.off("change",t),n()};j.on("change",i);var o=t[z.requestFullscreen](e);o instanceof Promise&&o.then(i).catch(r)}))},exit:function(){return new Promise((function(t,e){if(j.isFullscreen){var n=function e(){j.off("change",e),t()};j.on("change",n);var r=document[z.exitFullscreen]();r instanceof Promise&&r.then(n).catch(e)}else t()}))},toggle:function(t,e){return j.isFullscreen?j.exit():j.request(t,e)},onchange:function(t){j.on("change",t)},onerror:function(t){j.on("error",t)},on:function(t,e){var n=B[t];n&&document.addEventListener(n,e,!1)},off:function(t,e){var n=B[t];n&&document.removeEventListener(n,e,!1)},raw:z};Object.defineProperties(j,{isFullscreen:{get:function(){return Boolean(document[z.fullscreenElement])}},element:{enumerable:!0,get:function(){var t;return null!==(t=document[z.fullscreenElement])&&void 0!==t?t:void 0}},isEnabled:{enumerable:!0,get:function(){return Boolean(document[z.fullscreenEnabled])}}}),z||(j={isEnabled:!1});const U=j;var Z=function(t){(0,s.Z)(f,t);var e,n,h=(e=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function f(t){var e;return(0,i.Z)(this,f),e=h.call(this,t),(0,c.Z)((0,a.Z)(e),"isFullscreen",!1),(0,c.Z)((0,a.Z)(e),"toggleFullscreen",(0,P.Z)(L().mark((function t(){return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!U.isEnabled){t.next=3;break}return t.next=3,U.toggle(e.mapContainer);case 3:case"end":return t.stop()}}),t)})))),(0,c.Z)((0,a.Z)(e),"onClick",(function(){e.toggleFullscreen()})),(0,c.Z)((0,a.Z)(e),"onFullscreenChange",(function(){e.isFullscreen=!!document.fullscreenElement;var t=e.controlOption,n=t.btnText,r=t.btnIcon,i=t.title,o=t.exitBtnText,a=t.exitBtnIcon,s=t.exitTitle;e.isFullscreen?(e.setBtnTitle(s),e.setBtnText(o),e.setBtnIcon(a)):(e.setBtnTitle(i),e.setBtnText(n),e.setBtnIcon(r)),e.emit("fullscreenChange",e.isFullscreen)})),U.isEnabled||console.warn("当前浏览器环境不支持对地图全屏化"),e}return(0,o.Z)(f,[{key:"setOptions",value:function(t){var e=t.exitBtnText,n=t.exitBtnIcon,r=t.exitTitle;this.isFullscreen&&(this.checkUpdateOption(t,["exitBtnIcon"])&&this.setBtnIcon(n),this.checkUpdateOption(t,["exitBtnText"])&&this.setBtnText(e),this.checkUpdateOption(t,["exitTitle"])&&this.setBtnTitle(r)),(0,b.Z)((0,l.Z)(f.prototype),"setOptions",this).call(this,t)}},{key:"onAdd",value:function(){var t=(0,b.Z)((0,l.Z)(f.prototype),"onAdd",this).call(this);return t.addEventListener("click",this.onClick),this.mapContainer=p.DOM.getContainer(this.scene.getSceneConfig().id),this.mapContainer.addEventListener("fullscreenchange",this.onFullscreenChange),t}},{key:"onRemove",value:function(){(0,b.Z)((0,l.Z)(f.prototype),"onRemove",this).call(this),this.mapContainer.removeEventListener("fullscreenchange",this.onFullscreenChange)}},{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(f.prototype),"getDefault",this).call(this,t)),{},{title:"全屏",btnIcon:I("l7-icon-fullscreen"),exitTitle:"退出全屏",exitBtnIcon:I("l7-icon-exit-fullscreen")})}}]),f}(S);var V=function(t){(0,s.Z)(p,t);var e,n,h=(e=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function p(t){var e;return(0,i.Z)(this,p),e=h.call(this,t),(0,c.Z)((0,a.Z)(e),"getGeoLocation",(function(){return new Promise((function(t,e){window.navigator.geolocation.getCurrentPosition((function(n){var r=n.coords,i=null!=r?r:{},o=i.longitude,a=i.latitude;(0,g.isNaN)(o)||(0,g.isNaN)(a)?e():t([o,a])}),(function(t){e(t)}))}))})),(0,c.Z)((0,a.Z)(e),"onClick",(0,P.Z)(L().mark((function t(){var n,r,i;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(window.navigator.geolocation){t.next=2;break}return t.abrupt("return");case 2:return n=e.controlOption.transform,t.next=5,e.getGeoLocation();case 5:if(r=t.sent,i=e.mapsService.getZoom(),t.t0=e.mapsService,t.t1=i>15?i:15,!n){t.next=15;break}return t.next=12,n(r);case 12:t.t2=t.sent,t.next=16;break;case 15:t.t2=r;case 16:t.t3=t.t2,t.t0.setZoomAndCenter.call(t.t0,t.t1,t.t3);case 18:case"end":return t.stop()}}),t)})))),window.navigator.geolocation||console.warn("当前浏览器环境不支持获取地理定位"),e}return(0,o.Z)(p,[{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(p.prototype),"getDefault",this).call(this,t)),{},{title:"定位",btnIcon:I("l7-icon-reposition")})}},{key:"onAdd",value:function(){var t=(0,b.Z)((0,l.Z)(p.prototype),"onAdd",this).call(this);return t.addEventListener("click",this.onClick),t}}]),p}(S);var G=function(t){(0,s.Z)(p,t);var e,n,h=(e=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function p(){var t;(0,i.Z)(this,p);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=h.call.apply(h,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"onLayerChange",(function(){var e;null!==(e=t.controlOption.layers)&&void 0!==e&&e.length||(t.selectValue=t.getLayerVisible(),t.setOptions({options:t.getLayerOptions()}))})),(0,c.Z)((0,a.Z)(t),"onLayerVisibleChane",(function(){t.setSelectValue(t.getLayerVisible())})),(0,c.Z)((0,a.Z)(t),"onSelectChange",(function(){t.layers.forEach((function(e){var n=t.selectValue.includes(e.name),r=e.isVisible();n&&!r&&e.show(),!n&&r&&e.hide()}))})),t}return(0,o.Z)(p,[{key:"layers",get:function(){var t=this.layerService,e=this.controlOption.layers;if(Array.isArray(e)&&e.length){var n=[];return e.forEach((function(e){if(e instanceof Object&&n.push(e),"string"==typeof e){var r=t.getLayer(e)||t.getLayerByName(e);r&&n.push(r)}})),n}return t.getLayers()||[]}},{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(p.prototype),"getDefault",this).call(this,t)),{},{title:"图层控制",btnIcon:I("l7-icon-layer"),options:[]})}},{key:"getLayerVisible",value:function(){return this.layers.filter((function(t){return t.isVisible()})).map((function(t){return t.name}))}},{key:"getLayerOptions",value:function(){return this.layers.map((function(t){return{text:t.name,value:t.name}}))}},{key:"setOptions",value:function(t){var e=this.checkUpdateOption(t,["layers"]);(0,b.Z)((0,l.Z)(p.prototype),"setOptions",this).call(this,t),e&&(this.selectValue=this.getLayerVisible(),this.controlOption.options=this.getLayerOptions(),this.popper.setContent(this.getPopperContent(this.controlOption.options)))}},{key:"onAdd",value:function(){var t;return null!==(t=this.controlOption.options)&&void 0!==t&&t.length||(this.controlOption.options=this.getLayerOptions()),this.controlOption.defaultValue||(this.controlOption.defaultValue=this.getLayerVisible()),this.on("selectChange",this.onSelectChange),this.layerService.on("layerChange",this.onLayerChange),(0,b.Z)((0,l.Z)(p.prototype),"onAdd",this).call(this)}},{key:"onRemove",value:function(){this.off("selectChange",this.onSelectChange),this.layerService.off("layerChange",this.onLayerChange)}},{key:"getIsMultiple",value:function(){return!0}}]),p}(O);var H=function(t){(0,s.Z)(a,t);var e,n,r=(e=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function a(){return(0,i.Z)(this,a),r.apply(this,arguments)}return(0,o.Z)(a,[{key:"getDefault",value:function(){return{position:h.PositionType.BOTTOMLEFT,name:"logo",href:"https://l7.antv.antgroup.com/",img:"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*GRb1TKp4HcMAAAAAAAAAAAAAARQnAQ"}}},{key:"onAdd",value:function(){var t=p.DOM.create("div","l7-control-logo");return this.setLogoContent(t),t}},{key:"onRemove",value:function(){return null}},{key:"setOptions",value:function(t){(0,b.Z)((0,l.Z)(a.prototype),"setOptions",this).call(this,t),this.checkUpdateOption(t,["img","href"])&&(p.DOM.clearChildren(this.container),this.setLogoContent(this.container))}},{key:"setLogoContent",value:function(t){var e=this.controlOption,n=e.href,r=e.img,i=p.DOM.create("img");if(i.setAttribute("src",r),i.setAttribute("aria-label","AntV logo"),p.DOM.setUnDraggable(i),n){var o=p.DOM.create("a","l7-control-logo-link");o.target="_blank",o.href=n,o.rel="noopener nofollow",o.setAttribute("rel","noopener nofollow"),o.appendChild(i),t.appendChild(o)}else t.appendChild(i)}}]),a}(w),W={normal:{text:"标准",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*qdFDSbvIalgAAAAAAAAAAAAADmJ7AQ/original"},light:{text:"月光银",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d-vcRLzu8WIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"幻影黑",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*HMbRTI3XnpIAAAAAAAAAAAAADmJ7AQ/original"},fresh:{text:"草色青",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kqaGQ5kjSiAAAAAAAAAAAAAADmJ7AQ/original"},grey:{text:"雅士灰",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*XegrTpZIbqAAAAAAAAAAAAAADmJ7AQ/original"},graffiti:{text:"涂鸦",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*G5g9SZ_Jg4cAAAAAAAAAAAAADmJ7AQ/original"},macaron:{text:"马卡龙",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*irVvQbDpQMwAAAAAAAAAAAAADmJ7AQ/original"},darkblue:{text:"极夜蓝",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*lKRzQYB4iR0AAAAAAAAAAAAADmJ7AQ/original"},wine:{text:"酱籽",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*orY0T7QL-lwAAAAAAAAAAAAADmJ7AQ/original"}},q={normal:{text:"标准",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kIyZTok4Uk0AAAAAAAAAAAAADmJ7AQ/original"},light:{text:"亮",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Z3JRQKDI-cIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"暗",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d7HCQbfmyaoAAAAAAAAAAAAADmJ7AQ/original"},satellite:{text:"卫星",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*TytUT6pS9okAAAAAAAAAAAAADmJ7AQ/original"},outdoors:{text:"户外",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hWwFSYJEFWsAAAAAAAAAAAAADmJ7AQ/original"}};var Y=function(t){(0,s.Z)(p,t);var e,n,h=(e=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function p(){var t;(0,i.Z)(this,p);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=h.call.apply(h,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"onMapThemeChange",(function(){t.mapsService.setMapStyle(t.selectValue[0])})),t}return(0,o.Z)(p,[{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(p.prototype),"getDefault",this).call(this,t)),{},{title:"地图样式",btnIcon:I("l7-icon-color"),options:[]})}},{key:"getStyleOptions",value:function(){var t="mapbox"===this.mapsService.getType()?q:W;return Object.entries(this.mapsService.getMapStyleConfig()).filter((function(t){var e=(0,x.Z)(t,2),n=e[0];return"string"==typeof e[1]&&"blank"!==n})).map((function(e){var n,r=(0,x.Z)(e,2),i=r[0],o=r[1],a=null!==(n=t[i])&&void 0!==n?n:{},s=a.text;return{text:null!=s?s:i,value:o,img:a.img,key:i}}))}},{key:"getMapStyle",value:function(){return this.mapsService.getMapStyle()}},{key:"onAdd",value:function(){var t,e=this;if(null!==(t=this.controlOption.options)&&void 0!==t&&t.length||(this.controlOption.options=this.getStyleOptions()),this.controlOption.defaultValue){var n,r,i=this.controlOption.defaultValue;this.controlOption.defaultValue=null!==(n=null===(r=this.controlOption.options.find((function(t){return t.key===i})))||void 0===r?void 0:r.value)&&void 0!==n?n:i}else{var o=this.getMapStyle();o?this.controlOption.defaultValue=o:this.mapsService.map.once("styledata",(function(){var t=e.mapsService.getMapStyle();e.controlOption.defaultValue=t,e.setSelectValue(t,!1)}))}return this.on("selectChange",this.onMapThemeChange),(0,b.Z)((0,l.Z)(p.prototype),"onAdd",this).call(this)}},{key:"getIsMultiple",value:function(){return!1}}]),p}(O);var X=function(t){(0,s.Z)(d,t);var e,n,f=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function d(){var t;(0,i.Z)(this,d);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=f.call.apply(f,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"location",[0,0]),(0,c.Z)((0,a.Z)(t),"onMouseMove",(function(e){var n=t.location,r=e.lngLat||e.lnglat,i=t.controlOption.transform;r&&(n=[r.lng,r.lat]),t.location=n,i&&(n=i(n)),t.insertLocation2HTML(n),t.emit("locationChange",n)})),t}return(0,o.Z)(d,[{key:"getLocation",value:function(){return this.location}},{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(d.prototype),"getDefault",this).call(this,t)),{},{position:h.PositionType.BOTTOMLEFT,transform:function(t){var e=(0,x.Z)(t,2),n=e[0],r=e[1];return[+(+n).toFixed(6),+(+r).toFixed(6)]}})}},{key:"onAdd",value:function(){var t=p.DOM.create("div","l7-control-mouse-location");return t.innerHTML=" ",this.mapsService.on("mousemove",this.onMouseMove),t}},{key:"onRemove",value:function(){this.mapsService.off("mousemove",this.onMouseMove)}},{key:"insertLocation2HTML",value:function(t){this.container.innerText=t.join(", ")}}]),d}(w);var $=function(t){(0,s.Z)(d,t);var e,n,f=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function d(){var t;(0,i.Z)(this,d);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=f.call.apply(f,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"update",(function(){var e=t.mapsService,n=t.controlOption.maxWidth,r=e.getSize()[1]/2,i=e.containerToLngLat([0,r]),o=e.containerToLngLat([n,r]),a=(0,p.lnglatDistance)([i.lng,i.lat],[o.lng,o.lat]);t.updateScales(a)})),t}return(0,o.Z)(d,[{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(d.prototype),"getDefault",this).call(this,t)),{},{name:"scale",position:h.PositionType.BOTTOMLEFT,maxWidth:100,metric:!0,updateWhenIdle:!1,imperial:!1,lockWidth:!0})}},{key:"onAdd",value:function(){var t=p.DOM.create("div","l7-control-scale");this.resetScaleLines(t);var e=this.controlOption.updateWhenIdle;return this.mapsService.on(e?"moveend":"mapmove",this.update),this.mapsService.on(e?"zoomend":"zoomchange",this.update),t}},{key:"onRemove",value:function(){var t=this.controlOption.updateWhenIdle;this.mapsService.off(t?"zoomend":"zoomchange",this.update),this.mapsService.off(t?"moveend":"mapmove",this.update)}},{key:"setOptions",value:function(t){(0,b.Z)((0,l.Z)(d.prototype),"setOptions",this).call(this,t),this.checkUpdateOption(t,["lockWidth","maxWidth","metric","updateWhenIdle","imperial"])&&this.resetScaleLines(this.container)}},{key:"updateScales",value:function(t){var e=this.controlOption,n=e.metric,r=e.imperial;n&&t&&this.updateMetric(t),r&&t&&this.updateImperial(t)}},{key:"resetScaleLines",value:function(t){p.DOM.clearChildren(t);var e=this.controlOption,n=e.metric,r=e.imperial,i=e.maxWidth;e.lockWidth&&p.DOM.addStyle(t,"width: ".concat(i,"px")),n&&(this.mScale=p.DOM.create("div","l7-control-scale-line",t)),r&&(this.iScale=p.DOM.create("div","l7-control-scale-line",t)),this.update()}},{key:"updateScale",value:function(t,e,n){var r=this.controlOption.maxWidth;t.style.width=Math.round(r*n)+"px",t.innerHTML=e}},{key:"getRoundNum",value:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}},{key:"updateMetric",value:function(t){var e=this.getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this.updateScale(this.mScale,n,e/t)}},{key:"updateImperial",value:function(t){var e,n,r,i=3.2808399*t;i>5280?(e=i/5280,n=this.getRoundNum(e),this.updateScale(this.iScale,n+" mi",n/e)):(r=this.getRoundNum(i),this.updateScale(this.iScale,r+" ft",r/i))}}]),d}(w);var K=function(t){(0,s.Z)(d,t);var e,n,f=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function d(){var t;(0,i.Z)(this,d);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=f.call.apply(f,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"zoomIn",(function(){!t.disabled&&t.mapsService.getZoom()<t.mapsService.getMaxZoom()&&t.mapsService.zoomIn()})),(0,c.Z)((0,a.Z)(t),"zoomOut",(function(){!t.disabled&&t.mapsService.getZoom()>t.mapsService.getMinZoom()&&t.mapsService.zoomOut()})),(0,c.Z)((0,a.Z)(t),"updateDisabled",(function(){var e=t.mapsService;t.zoomInButton.removeAttribute("disabled"),t.zoomOutButton.removeAttribute("disabled"),(t.disabled||e.getZoom()<=e.getMinZoom())&&t.zoomOutButton.setAttribute("disabled","true"),(t.disabled||e.getZoom()>=e.getMaxZoom())&&t.zoomInButton.setAttribute("disabled","true")})),t}return(0,o.Z)(d,[{key:"getDefault",value:function(t){return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(d.prototype),"getDefault",this).call(this,t)),{},{position:h.PositionType.BOTTOMRIGHT,name:"zoom",zoomInText:I("l7-icon-enlarge"),zoomInTitle:"Zoom in",zoomOutText:I("l7-icon-narrow"),zoomOutTitle:"Zoom out"})}},{key:"setOptions",value:function(t){(0,b.Z)((0,l.Z)(d.prototype),"setOptions",this).call(this,t),this.checkUpdateOption(t,["zoomInText","zoomInTitle","zoomOutText","zoomOutTitle"])&&this.resetButtonGroup(this.container)}},{key:"onAdd",value:function(){var t=p.DOM.create("div","l7-control-zoom");return this.resetButtonGroup(t),this.mapsService.on("zoomend",this.updateDisabled),this.mapsService.on("zoomchange",this.updateDisabled),t}},{key:"onRemove",value:function(){this.mapsService.off("zoomend",this.updateDisabled),this.mapsService.off("zoomchange",this.updateDisabled)}},{key:"disable",value:function(){return this.disabled=!0,this.updateDisabled(),this}},{key:"enable",value:function(){return this.disabled=!1,this.updateDisabled(),this}},{key:"resetButtonGroup",value:function(t){p.DOM.clearChildren(t),this.zoomInButton=this.createButton(this.controlOption.zoomInText,this.controlOption.zoomInTitle,"l7-button-control",t,this.zoomIn),this.zoomOutButton=this.createButton(this.controlOption.zoomOutText,this.controlOption.zoomOutTitle,"l7-button-control",t,this.zoomOut),this.updateDisabled()}},{key:"createButton",value:function(t,e,n,r,i){var o=p.DOM.create("button",n,r);return"string"==typeof t?o.innerHTML=t:o.append(t),o.title=e,o.addEventListener("click",i),o}}]),d}(w);var J=function(t){(0,s.Z)(d,t);var e,n,f=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function d(t){var e;(0,i.Z)(this,d),e=f.call(this),(0,c.Z)((0,a.Z)(e),"isShow",!0),(0,c.Z)((0,a.Z)(e),"onMouseMove",(function(t){var n,r=e.mapsService.getMapContainer(),i=null!==(n=null==r?void 0:r.getBoundingClientRect())&&void 0!==n?n:{},o=i.left,a=void 0===o?0:o,s=i.top,u=void 0===s?0:s;e.setPopupPosition(t.clientX-a,t.clientY-u)})),(0,c.Z)((0,a.Z)(e),"updateLngLatPosition",(function(){if(e.mapsService&&!e.popupOption.followCursor){var t=e.lngLat,n=t.lng,r=t.lat,i=e.mapsService.lngLatToContainer([n,r]),o=i.x,a=i.y;e.setPopupPosition(o,a)}})),(0,c.Z)((0,a.Z)(e),"onKeyDown",(function(t){27===t.keyCode&&e.remove()})),(0,c.Z)((0,a.Z)(e),"onCloseButtonClick",(function(t){t.stopPropagation&&t.stopPropagation(),e.hide()})),(0,c.Z)((0,a.Z)(e),"update",(function(){var t=!!e.lngLat,n=e.popupOption,r=n.className,i=n.style,o=n.maxWidth,a=n.anchor,s=n.stopPropagation;if(e.mapsService&&t&&e.content){var u=e.mapsService.getMarkerContainer();!e.container&&u&&(e.container=p.DOM.create("div","l7-popup ".concat(null!=r?r:""," ").concat(e.isShow?"":"l7-popup-hide"),u),i&&e.container.setAttribute("style",i),e.tip=p.DOM.create("div","l7-popup-tip",e.container),e.container.appendChild(e.content),s&&["mousemove","mousedown","mouseup","click","dblclick"].forEach((function(t){e.container.addEventListener(t,(function(t){t.stopPropagation()}))})),e.container.style.whiteSpace="nowrap"),e.updateLngLatPosition(),p.DOM.setTransform(e.container,"".concat(p.anchorTranslate[a])),(0,p.applyAnchorClass)(e.container,a,"popup"),o?e.container.getBoundingClientRect().width>parseFloat(o)&&(e.container.style.width=o):e.container.style.removeProperty("width")}})),e.popupOption=(0,r.Z)((0,r.Z)({},e.getDefault(null!=t?t:{})),t);var n=e.popupOption.lngLat;return n&&(e.lngLat=n),e}return(0,o.Z)(d,[{key:"lngLat",get:function(){var t;return null!==(t=this.popupOption.lngLat)&&void 0!==t?t:{lng:0,lat:0}},set:function(t){this.popupOption.lngLat=t}},{key:"getIsShow",value:function(){return this.isShow}},{key:"addTo",value:function(t){this.mapsService=t.get(h.TYPES.IMapService),this.sceneService=t.get(h.TYPES.ISceneService),this.layerService=t.get(h.TYPES.ILayerService),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update),this.scene=t,this.update(),this.updateCloseOnClick(),this.updateCloseOnEsc(),this.updateFollowCursor();var e=this.popupOption,n=e.html,r=e.text,i=e.title;return n?this.setHTML(n):r&&this.setText(r),i&&this.setTitle(i),this.emit("open"),this}},{key:"remove",value:function(){if(null!=this&&this.isOpen())return this.content&&p.DOM.remove(this.content),this.container&&(p.DOM.remove(this.container),delete this.container),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.updateCloseOnClick(!0),this.updateCloseOnEsc(!0),this.updateFollowCursor(!0),delete this.mapsService),this.emit("close"),this}},{key:"getOptions",value:function(){return this.popupOption}},{key:"setOptions",value:function(t){return this.show(),this.popupOption=(0,r.Z)((0,r.Z)({},this.popupOption),t),this.checkUpdateOption(t,["html","text","title","closeButton","closeButtonOffsets","maxWidth","anchor","stopPropagation","className","style","lngLat","offsets"])&&(this.container&&(p.DOM.remove(this.container),this.container=void 0),this.popupOption.html?this.setHTML(this.popupOption.html):this.popupOption.text&&this.setText(this.popupOption.text),this.popupOption.title&&this.setTitle(this.popupOption.title)),this.checkUpdateOption(t,["closeOnEsc"])&&this.updateCloseOnEsc(),this.checkUpdateOption(t,["closeOnClick"])&&this.updateCloseOnClick(),this.checkUpdateOption(t,["followCursor"])&&this.updateFollowCursor(),this.checkUpdateOption(t,["html"])&&t.html?this.setHTML(t.html):this.checkUpdateOption(t,["text"])&&t.text&&this.setText(t.text),this.checkUpdateOption(t,["lngLat"])&&t.lngLat&&this.setLnglat(t.lngLat),this}},{key:"open",value:function(){return this.addTo(this.scene),this}},{key:"close",value:function(){return this.remove(),this}},{key:"show",value:function(){if(!this.isShow)return this.container&&p.DOM.removeClass(this.container,"l7-popup-hide"),this.isShow=!0,this.emit("show"),this}},{key:"hide",value:function(){if(this.isShow)return this.container&&p.DOM.addClass(this.container,"l7-popup-hide"),this.isShow=!1,this.emit("hide"),this}},{key:"setHTML",value:function(t){return this.popupOption.html=t,this.setDOMContent(t)}},{key:"setText",value:function(t){return this.popupOption.text=t,this.setDOMContent(window.document.createTextNode(t))}},{key:"setTitle",value:function(t){this.show(),this.popupOption.title=t,t?(this.contentTitle||(this.contentTitle=p.DOM.create("div","l7-popup-content__title"),this.content.firstChild?this.content.insertBefore(this.contentTitle,this.content.firstChild):this.content.append(this.contentTitle)),p.DOM.clearChildren(this.contentTitle),p.DOM.appendElementType(this.contentTitle,t)):this.contentTitle&&(p.DOM.remove(this.contentTitle),this.contentTitle=void 0)}},{key:"panToPopup",value:function(){var t=this.lngLat,e=t.lng,n=t.lat;return this.popupOption.autoPan&&this.mapsService.panTo([e,n]),this}},{key:"setLngLat",value:function(t){return this.setLnglat(t)}},{key:"setLnglat",value:function(t){var e=this;return this.show(),this.lngLat=t,Array.isArray(t)&&(this.lngLat={lng:t[0],lat:t[1]}),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update)),this.update(),this.popupOption.autoPan&&setTimeout((function(){e.panToPopup()}),0),this}},{key:"getLnglat",value:function(){return this.lngLat}},{key:"setMaxWidth",value:function(t){return this.popupOption.maxWidth=t,this.update(),this}},{key:"isOpen",value:function(){return!!this.mapsService}},{key:"getDefault",value:function(t){return{closeButton:!0,closeOnClick:!1,maxWidth:"240px",offsets:[0,0],anchor:p.anchorType.BOTTOM,stopPropagation:!0,autoPan:!1,autoClose:!0,closeOnEsc:!1,followCursor:!1}}},{key:"setDOMContent",value:function(t){return this.show(),this.createContent(),p.DOM.appendElementType(this.contentPanel,t),this.update(),this}},{key:"updateCloseOnClick",value:function(t){var e=this,n=this.mapsService;n&&(null==n||n.off("click",this.onCloseButtonClick),this.popupOption.closeOnClick&&!t&&requestAnimationFrame((function(){null==n||n.on("click",e.onCloseButtonClick)})))}},{key:"updateCloseOnEsc",value:function(t){window.removeEventListener("keydown",this.onKeyDown),this.popupOption.closeOnEsc&&!t&&window.addEventListener("keydown",this.onKeyDown)}},{key:"updateFollowCursor",value:function(t){var e,n=null===(e=this.mapsService)||void 0===e?void 0:e.getContainer();n&&(null==n||n.removeEventListener("mousemove",this.onMouseMove),this.popupOption.followCursor&&!t&&(null==n||n.addEventListener("mousemove",this.onMouseMove)))}},{key:"createContent",value:function(){var t=this;if(this.content&&p.DOM.remove(this.content),this.contentTitle=void 0,this.content=p.DOM.create("div","l7-popup-content",this.container),this.setTitle(this.popupOption.title),this.popupOption.closeButton){var e=I("l7-icon-guanbi");p.DOM.addClass(e,"l7-popup-close-button"),this.content.appendChild(e),this.popupOption.closeButtonOffsets&&(e.style.right=this.popupOption.closeButtonOffsets[0]+"px",e.style.top=this.popupOption.closeButtonOffsets[1]+"px"),e.setAttribute("aria-label","Close popup"),e.addEventListener("click",(function(){t.hide()})),this.closeButton=e}else this.closeButton=void 0;this.contentPanel=p.DOM.create("div","l7-popup-content__panel",this.content)}},{key:"setPopupPosition",value:function(t,e){if(this.container){var n=this.popupOption.offsets;this.container.style.left=t+n[0]+"px",this.container.style.top=e-n[1]+"px"}}},{key:"checkUpdateOption",value:function(t,e){return e.some((function(e){return e in t}))}}]),d}(f.EventEmitter);var Q=function(t){(0,s.Z)(f,t);var e,n,h=(e=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)});function f(){var t;(0,i.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=h.call.apply(h,[this].concat(n)),(0,c.Z)((0,a.Z)(t),"layerConfigMap",new WeakMap),t}return(0,o.Z)(f,[{key:"layerConfigItems",get:function(){var t,e=this.popupOption,n=e.config,r=e.items;return null!==(t=null!=n?n:r)&&void 0!==t?t:[]}},{key:"addTo",value:function(t){return(0,b.Z)((0,l.Z)(f.prototype),"addTo",this).call(this,t),this.bindLayerEvent(),this.hide(),this}},{key:"remove",value:function(){return(0,b.Z)((0,l.Z)(f.prototype),"remove",this).call(this),this.unbindLayerEvent(),this}},{key:"setOptions",value:function(t){return this.unbindLayerEvent(),(0,b.Z)((0,l.Z)(f.prototype),"setOptions",this).call(this,t),this.bindLayerEvent(),this}},{key:"getDefault",value:function(t){var e="click"===t.trigger;return(0,r.Z)((0,r.Z)({},(0,b.Z)((0,l.Z)(f.prototype),"getDefault",this).call(this,t)),{},{trigger:"hover",followCursor:!e,lngLat:{lng:0,lat:0},offsets:[0,10],closeButton:!1,closeOnClick:!1,autoClose:!1,closeOnEsc:!1})}},{key:"bindLayerEvent",value:function(){var t=this,e=this.popupOption.trigger;this.layerConfigItems.forEach((function(n){var i,o=t.getLayerByConfig(n);if(o){var a=(0,r.Z)({},n);if("hover"===e){var s=t.onLayerMouseMove.bind(t,o),u=t.onLayerMouseOut.bind(t,o);a.onMouseMove=s,a.onMouseOut=u,null==o||o.on("mousemove",s),null==o||o.on("mouseout",u)}else{var l=t.onLayerClick.bind(t,o);a.onClick=l,null==o||o.on("click",l)}var c=null==o||null===(i=o.getSource)||void 0===i?void 0:i.call(o),h=t.onSourceUpdate.bind(t,o);null==c||c.on("update",h),a.onSourceUpdate=h,t.layerConfigMap.set(o,a)}}))}},{key:"unbindLayerEvent",value:function(){var t=this;this.layerConfigItems.forEach((function(e){var n=t.getLayerByConfig(e),r=n&&t.layerConfigMap.get(n);if(r){var i,o=r.onMouseMove,a=r.onMouseOut,s=r.onClick,u=r.onSourceUpdate;o&&n.off("mousemove",o),a&&n.off("mouseout",a),s&&n.off("click",s),u&&(null==n||null===(i=n.getSource())||void 0===i||i.off("update",u))}}))}},{key:"onLayerMouseMove",value:function(t,e){if(!this.isSameFeature(t,e.featureId)){var n=this.getLayerInfoFrag(t,e),r=n.title,i=n.content;this.setDOMContent(i),this.setTitle(r),this.displayFeatureInfo={layer:t,featureId:e.featureId},this.show()}}},{key:"onLayerMouseOut",value:function(t,e){this.displayFeatureInfo=void 0,this.isShow&&this.hide()}},{key:"onLayerClick",value:function(t,e){if(this.isShow&&this.isSameFeature(t,e.featureId))this.hide();else{var n=this.getLayerInfoFrag(t,e),r=n.title,i=n.content;this.setDOMContent(i),this.setLnglat(e.lngLat),this.setTitle(r),this.displayFeatureInfo={layer:t,featureId:e.featureId},this.show()}}},{key:"onSourceUpdate",value:function(t){this.hide(),this.displayFeatureInfo=void 0}},{key:"getLayerInfoFrag",value:function(t,e){var n,r=this.layerConfigMap.get(t),i=document.createDocumentFragment();if(r){var o=e.feature;"Feature"===o.type&&"properties"in o&&"geometry"in o&&(o=o.properties);var a=r.title,s=r.fields,u=r.customContent;if(a){n=document.createDocumentFragment();var l=a instanceof Function?a(o):a;p.DOM.appendElementType(n,l)}if(u){var c=u instanceof Function?u(o):u;p.DOM.appendElementType(i,c)}else null!=s&&s.length&&(null==s||s.forEach((function(t){var n,r,a="string"==typeof t?{field:t}:t,s=a.field,u=a.formatField,l=a.formatValue,c=a.getValue,h=p.DOM.create("div","l7-layer-popup__row"),f=c?c(e.feature):(0,g.get)(o,s),d=null!==(n=u instanceof Function?u(s,o):u)&&void 0!==n?n:s,m=null!==(r=l instanceof Function?l(f,o):l)&&void 0!==r?r:f,y=p.DOM.create("span","l7-layer-popup__key",h);p.DOM.appendElementType(y,d),p.DOM.appendElementType(y,document.createTextNode(":"));var v=p.DOM.create("span","l7-layer-popup__value",h);Array.isArray(m)&&m.every((function(t){return!(t instanceof Object)}))&&(m=m.map((function(t){return String(t)})).join(",")),p.DOM.appendElementType(v,m),i.appendChild(h)})))}return{title:n,content:i}}},{key:"getLayerByConfig",value:function(t){var e=t.layer;return e instanceof Object?e:"string"==typeof e?this.layerService.getLayer(e)||this.layerService.getLayerByName(e):void 0}},{key:"isSameFeature",value:function(t,e){var n=this.displayFeatureInfo;return n&&t===n.layer&&e===n.featureId}}]),f}(J);!function(t,e){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(e||(e=document),e)){var i=e.head||e.getElementsByTagName("head")[0];if(!i){i=e.createElement("head");var o=e.body||e.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):e.documentElement.appendChild(i)}var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),i.appendChild(a)}}(".l7-marker-container {\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.l7-marker {\n position: absolute !important;\n top: 0;\n left: 0;\n z-index: 5;\n cursor: pointer;\n}\n.l7-marker-cluster {\n width: 40px;\n height: 40px;\n background-color: rgba(181, 226, 140, 0.6);\n background-clip: padding-box;\n border-radius: 20px;\n}\n.l7-marker-cluster div {\n width: 30px;\n height: 30px;\n margin-top: 5px;\n margin-left: 5px;\n font: 12px 'Helvetica Neue', Arial, Helvetica, sans-serif;\n text-align: center;\n background-color: rgba(110, 204, 57, 0.6);\n border-radius: 15px;\n}\n.l7-marker-cluster span {\n line-height: 30px;\n}\n.l7-touch .l7-control-attribution,\n.l7-touch .l7-control-layers,\n.l7-touch .l7-bar {\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.l7-touch .l7-control-layers,\n.l7-touch .l7-bar {\n background-clip: padding-box;\n border: 2px solid rgba(0, 0, 0, 0.2);\n}\n.mapboxgl-ctrl-logo,\n.amap-logo {\n display: none !important;\n}\n.l7-select-box {\n border: 3px dashed gray;\n border-radius: 2px;\n position: absolute;\n z-index: 1000;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.l7-control-container {\n font: 12px/1.5 'Helvetica Neue', Arial, Helvetica, sans-serif;\n}\n.l7-control-container .l7-control {\n position: relative;\n z-index: 800;\n float: left;\n clear: both;\n color: #595959;\n font-size: 12px;\n pointer-events: visiblePainted;\n /* IE 9-10 doesn't have auto */\n pointer-events: auto;\n}\n.l7-control-container .l7-control.l7-control--hide {\n display: none;\n}\n.l7-control-container .l7-top {\n top: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n}\n.l7-control-container .l7-top .l7-control:not(.l7-control--hide) {\n margin-top: 8px;\n}\n.l7-control-container .l7-right {\n right: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n}\n.l7-control-container .l7-right .l7-control:not(.l7-control--hide) {\n margin-right: 8px;\n}\n.l7-control-container .l7-bottom {\n bottom: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n}\n.l7-control-container .l7-bottom .l7-control:not(.l7-control--hide) {\n margin-bottom: 8px;\n}\n.l7-control-container .l7-left {\n left: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n}\n.l7-control-container .l7-left .l7-control:not(.l7-control--hide) {\n margin-left: 8px;\n}\n.l7-control-container .l7-center {\n position: absolute;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.l7-control-container .l7-center.l7-top,\n.l7-control-container .l7-center.l7-bottom {\n width: 100%;\n}\n.l7-control-container .l7-center.l7-left,\n.l7-control-container .l7-center.l7-right {\n height: 100%;\n}\n.l7-control-container .l7-center .l7-control {\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.l7-control-container .l7-row {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n}\n.l7-control-container .l7-row.l7-top {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n.l7-control-container .l7-row.l7-bottom {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n.l7-control-container .l7-column {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.l7-control-container .l7-column.l7-left {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n.l7-control-container .l7-column.l7-right {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n.l7-button-control {\n min-width: 28px;\n height: 28px;\n background-color: #fff;\n border-width: 0;\n border-radius: 2px;\n outline: 0;\n cursor: pointer;\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 0 6px;\n -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n line-height: 16px;\n}\n.l7-button-control .l7-iconfont {\n fill: #595959;\n color: #595959;\n width: 16px;\n height: 16px;\n}\n.l7-button-control.l7-button-control--row {\n padding: 0 16px 0 13px;\n}\n.l7-button-control.l7-button-control--row * + .l7-button-control__text {\n margin-left: 8px;\n}\n.l7-button-control.l7-button-control--column {\n height: 44px;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.l7-button-control.l7-button-control--column .l7-iconfont {\n margin-top: 3px;\n}\n.l7-button-control.l7-button-control--column .l7-button-control__text {\n margin-top: 3px;\n font-size: 10px;\n -webkit-transform: scale(0.83333);\n transform: scale(0.83333);\n}\n.l7-button-control:not(:disabled):hover {\n background-color: #f3f3f3;\n}\n.l7-button-control:not(:disabled):active {\n background-color: #f3f3f3;\n}\n.l7-button-control:disabled {\n background-color: #fafafa;\n color: #bdbdbd;\n cursor: not-allowed;\n}\n.l7-button-control:disabled .l7-iconfont {\n fill: #bdbdbd;\n color: #bdbdbd;\n}\n.l7-button-control:disabled:hover {\n background-color: #fafafa;\n}\n.l7-button-control:disabled:active {\n background-color: #fafafa;\n}\n.l7-popper {\n position: absolute;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n z-index: 5;\n color: #595959;\n}\n.l7-popper.l7-popper-hide {\n display: none;\n}\n.l7-popper .l7-popper-content {\n min-height: 28px;\n background: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n}\n.l7-popper .l7-popper-arrow {\n width: 0;\n height: 0;\n border-width: 4px;\n border-style: solid;\n border-top-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n border-right-color: transparent;\n -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n}\n.l7-popper.l7-popper-left {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n}\n.l7-popper.l7-popper-left .l7-popper-arrow {\n border-left-color: #fff;\n margin: 10px 0;\n}\n.l7-popper.l7-popper-right {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: reverse;\n -ms-flex-direction: row-reverse;\n flex-direction: row-reverse;\n}\n.l7-popper.l7-popper-right .l7-popper-arrow {\n border-right-color: #fff;\n margin: 10px 0;\n}\n.l7-popper.l7-popper-top {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.l7-popper.l7-popper-top .l7-popper-arrow {\n border-top-color: #fff;\n margin: 0 10px;\n}\n.l7-popper.l7-popper-bottom {\n -webkit-box-orient: vertical;\n -webkit-box-direction: reverse;\n -ms-flex-direction: column-reverse;\n flex-direction: column-reverse;\n}\n.l7-popper.l7-popper-bottom .l7-popper-arrow {\n border-bottom-color: #fff;\n margin: 0 10px;\n}\n.l7-popper.l7-popper-start {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n.l7-popper.l7-popper-end {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n.l7-select-control--normal {\n padding: 4px 0;\n}\n.l7-select-control--normal .l7-select-control-item {\n height: 24px;\n line-height: 24px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 0 16px;\n font-size: 12px;\n}\n.l7-select-control--normal .l7-select-control-item > * + * {\n margin-left: 6px;\n}\n.l7-select-control--normal .l7-select-control-item input[type='checkbox'] {\n height: 14px;\n width: 14px;\n}\n.l7-select-control--normal .l7-select-control-item:hover {\n background-color: #f3f3f3;\n}\n.l7-select-control--image {\n padding: 12px 12px 0 12px;\n width: 474px;\n height: 320px;\n overflow: auto;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n.l7-select-control--image .l7-select-control-item {\n margin-right: 12px;\n border-radius: 2px;\n overflow: hidden;\n border: 1px solid #fff;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n width: calc((100% - 36px) / 3);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n margin-bottom: 12px;\n position: relative;\n font-size: 12px;\n}\n.l7-select-control--image .l7-select-control-item img {\n width: 142px;\n height: 80px;\n}\n.l7-select-control--image .l7-select-control-item input[type='checkbox'] {\n position: absolute;\n right: 0;\n top: 0;\n}\n.l7-select-control--image .l7-select-control-item .l7-select-control-item-row {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n line-height: 26px;\n}\n.l7-select-control--image .l7-select-control-item .l7-select-control-item-row > * + * {\n margin-left: 8px;\n}\n.l7-select-control--image .l7-select-control-item.l7-select-control-item-active {\n border-color: #0370fe;\n}\n.l7-select-control--image .l7-select-control-item:nth-child(3n) {\n margin-right: 0;\n}\n.l7-select-control-item {\n cursor: pointer;\n}\n.l7-select-control-item input[type='checkbox'] {\n margin: 0;\n cursor: pointer;\n}\n.l7-select-control--multiple .l7-select-control-item:hover {\n background-color: transparent;\n}\n.l7-control-logo {\n width: 89px;\n height: 16px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.l7-control-logo img {\n height: 100%;\n width: 100%;\n}\n.l7-control-logo .l7-control-logo-link {\n display: block;\n cursor: pointer;\n}\n.l7-control-logo .l7-control-logo-link img {\n cursor: pointer;\n}\n.l7-control-mouse-location {\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n padding: 2px 4px;\n min-width: 130px;\n}\n.l7-control-zoom {\n -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);\n border-radius: 2px;\n overflow: hidden;\n}\n.l7-control-zoom .l7-button-control {\n -webkit-box-shadow: 0 0 0;\n box-shadow: 0 0 0;\n border-radius: 0;\n font-size: 16px;\n}\n.l7-control-zoom .l7-button-control .l7-iconfont {\n width: 14px;\n height: 14px;\n}\n.l7-control-zoom .l7-button-control:first-child {\n border-bottom: 1px solid #f0f0f0;\n}\n.l7-control-scale {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.l7-control-scale .l7-control-scale-line {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 2px 5px 1px;\n overflow: hidden;\n color: #595959;\n font-size: 10px;\n line-height: 1.1;\n white-space: nowrap;\n background: #fff;\n border: 2px solid #000;\n border-top: 0;\n -webkit-transition: width 0.1s;\n transition: width 0.1s;\n}\n.l7-control-scale .l7-control-scale-line + .l7-control-scale .l7-control-scale-line {\n margin-top: -2px;\n border-top: 2px solid #777;\n border-bottom: none;\n}\n.l7-right .l7-control-scale {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n.l7-right .l7-control-scale .l7-control-scale-line {\n text-align: right;\n}\n.l7-popup {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n.l7-popup.l7-popup-hide {\n display: none;\n}\n.l7-popup .l7-popup-content {\n position: relative;\n padding: 16px;\n font-size: 14px;\n background: #fff;\n border-radius: 3px;\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.l7-popup .l7-popup-content .l7-popup-content__title {\n margin-bottom: 8px;\n font-weight: bold;\n}\n.l7-popup .l7-popup-content .l7-popup-close-button,\n.l7-popup .l7-popup-content .l7-popup-content__title,\n.l7-popup .l7-popup-content .l7-popup-content__panel {\n white-space: normal;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n pointer-events: initial;\n}\n.l7-popup .l7-popup-content .l7-popup-close-button {\n position: absolute;\n top: 0;\n right: 0;\n width: 18px;\n height: 18px;\n padding: 0;\n font-size: 14px;\n line-height: 18px;\n text-align: center;\n background-color: transparent;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n}\n.l7-popup .l7-popup-tip {\n position: relative;\n z-index: 1;\n width: 0;\n height: 0;\n border: 10px solid transparent;\n}\n.l7-popup.l7-popup-anchor-bottom,\n.l7-popup.l7-popup-anchor-bottom-left,\n.l7-popup.l7-popup-anchor-bottom-right {\n -webkit-box-orient: vertical;\n -webkit-box-direction: reverse;\n -ms-flex-direction: column-reverse;\n flex-direction: column-reverse;\n}\n.l7-popup.l7-popup-anchor-bottom .l7-popup-tip,\n.l7-popup.l7-popup-anchor-bottom-left .l7-popup-tip,\n.l7-popup.l7-popup-anchor-bottom-right .l7-popup-tip {\n bottom: 1px;\n}\n.l7-popup.l7-popup-anchor-top,\n.l7-popup.l7-popup-anchor-top-left,\n.l7-popup.l7-popup-anchor-top-right {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.l7-popup.l7-popup-anchor-top .l7-popup-tip,\n.l7-popup.l7-popup-anchor-top-left .l7-popup-tip,\n.l7-popup.l7-popup-anchor-top-right .l7-popup-tip {\n top: 1px;\n}\n.l7-popup.l7-popup-anchor-left {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n}\n.l7-popup.l7-popup-anchor-right {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: reverse;\n -ms-flex-direction: row-reverse;\n flex-direction: row-reverse;\n}\n.l7-popup-anchor-top .l7-popup-tip {\n position: relative;\n -webkit-align-self: center;\n -ms-flex-item-align: center;\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n.l7-popup-anchor-top-left .l7-popup-tip {\n -webkit-align-self: flex-start;\n -ms-flex-item-align: start;\n align-self: flex-start;\n border-top: none;\n border-bottom-color: #fff;\n border-left: none;\n}\n.l7-popup-anchor-top-right .l7-popup-tip {\n -webkit-align-self: flex-end;\n -ms-flex-item-align: end;\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n.l7-popup-anchor-bottom .l7-popup-tip {\n -webkit-align-self: center;\n -ms-flex-item-align: center;\n align-self: center;\n border-top-color: #fff;\n border-bottom: none;\n}\n.l7-popup-anchor-bottom-left .l7-popup-tip {\n -webkit-align-self: flex-start;\n -ms-flex-item-align: start;\n align-self: flex-start;\n border-top-color: #fff;\n border-bottom: none;\n border-left: none;\n}\n.l7-popup-anchor-bottom-right .l7-popup-tip {\n -webkit-align-self: flex-end;\n -ms-flex-item-align: end;\n align-self: flex-end;\n border-top-color: #fff;\n border-right: none;\n border-bottom: none;\n}\n.l7-popup-anchor-left .l7-popup-tip {\n -webkit-align-self: center;\n -ms-flex-item-align: center;\n align-self: center;\n border-right-color: #fff;\n border-left: none;\n}\n.l7-popup-anchor-right .l7-popup-tip {\n right: 1px;\n -webkit-align-self: center;\n -ms-flex-item-align: center;\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n.l7-popup-anchor-top-left .l7-popup-content {\n border-top-left-radius: 0;\n}\n.l7-popup-anchor-top-right .l7-popup-content {\n border-top-right-radius: 0;\n}\n.l7-popup-anchor-bottom-left .l7-popup-content {\n border-bottom-left-radius: 0;\n}\n.l7-popup-anchor-bottom-right .l7-popup-content {\n border-bottom-right-radius: 0;\n}\n.l7-popup-track-pointer {\n display: none;\n}\n.l7-popup-track-pointer * {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n pointer-events: none;\n}\n.l7-map:hover .l7-popup-track-pointer {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.l7-map:active .l7-popup-track-pointer {\n display: none;\n}\n.l7-layer-popup__row {\n font-size: 12px;\n}\n.l7-layer-popup__row + .l7-layer-popup__row {\n margin-top: 4px;\n}\n")},108:(t,e,n)=>{"use strict";n.r(e),n.d(e,{AttributeType:()=>zr,BasePostProcessingPass:()=>Fn,BlendType:()=>H,CameraUniform:()=>Br,CoordinateSystem:()=>nt,CoordinateUniform:()=>vt,IDebugLog:()=>jr,ILayerStage:()=>Y,InteractionEvent:()=>wt,MapServiceEvent:()=>Zr,MaskOperation:()=>q,PassType:()=>cn,PositionType:()=>D,RasterTileType:()=>Ur,ScaleTypes:()=>Nr,SceneEventList:()=>Vr,StencilType:()=>W,StyleScaleType:()=>Fr,TYPES:()=>u,container:()=>Sr,createLayerContainer:()=>Tr,createSceneContainer:()=>Mr,gl:()=>kt,lazyInject:()=>xr,lazyMultiInject:()=>wr,packCircleVertex:()=>Dr}),n(171);var r,i=n(1883),o=n.n(i),a=n(7745),s=n(719),u={IEventEmitter:Symbol.for("IEventEmitter"),ISceneService:Symbol.for("ISceneService"),IGlobalConfigService:Symbol.for("IGlobalConfigService"),ICameraService:Symbol.for("ICameraService"),ICoordinateSystemService:Symbol.for("ICoordinateSystemService"),ILayerService:Symbol.for("ILayerService"),IDebugService:Symbol.for("IDebugService"),ILayerMappingService:Symbol.for("ILayerMappingService"),ILayerStyleService:Symbol.for("ILayerStyleService"),IMapService:Symbol.for("IMapService"),IMarkerService:Symbol.for("IMarkerService"),IPopupService:Symbol.for("PopupService"),IFactoryMapService:Symbol.for("Factory<IMapService>"),IRendererService:Symbol.for("IRendererService"),IShaderModuleService:Symbol.for("IShaderModuleService"),IIconService:Symbol.for("IIconService"),IFontService:Symbol.for("IFontService"),IInteractionService:Symbol.for("IInteractionService"),IPickingService:Symbol.for("IPickingService"),IControlService:Symbol.for("IControlService"),IStyleAttributeService:Symbol.for("IStyleAttributeService"),ILayer:Symbol.for("ILayer"),ILayerPlugin:Symbol.for("ILayerPlugin"),INormalPass:Symbol.for("INormalPass"),IPostProcessor:Symbol.for("IPostProcessor"),IPostProcessingPass:Symbol.for("IPostProcessingPass"),IFactoryPostProcessingPass:Symbol.for("Factory<IPostProcessingPass>"),IFactoryNormalPass:Symbol.for("Factory<IFactoryNormalPass>"),IMultiPassRenderer:Symbol.for("IMultiPassRenderer"),SceneID:Symbol.for("SceneID"),MapConfig:Symbol.for("MapConfig")},l=n(3659),c=n(3192),h=n(6838),p=n(5161),f=n(6193),d=n(9097),m=n(6875),g=n(6297),y=n(5619),v=n(9361),_=n.n(v);function b(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return x(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function w(t,e,n){var r,i=b(e);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.icon,s=o.xOffset;t[a.id]=(0,l.Z)((0,l.Z)({},a),{},{x:s,y:n,image:a.image,width:a.width,height:a.height})}}catch(t){i.e(t)}finally{i.f()}}function S(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function E(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return M(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var T=function(){for(var t=[],e=32;e<128;e++)t.push(String.fromCharCode(e));return t}();function A(t,e,n,r){t.font="".concat(r," ").concat(n,"px ").concat(e),t.fillStyle="black",t.textBaseline="middle"}function C(t,e){for(var n=0;n<t.length;n++)e.data[4*n+3]=t[n]}var O,P=(0,a.b2)()(r=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,c.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,g.Z)((0,p.Z)(t),"fontAtlas",void 0),(0,g.Z)((0,p.Z)(t),"iconFontMap",void 0),(0,g.Z)((0,p.Z)(t),"iconFontGlyphs",{}),(0,g.Z)((0,p.Z)(t),"fontOptions",void 0),(0,g.Z)((0,p.Z)(t),"key",void 0),(0,g.Z)((0,p.Z)(t),"cache",new y.LRUCache(3)),t}return(0,h.Z)(i,[{key:"scale",get:function(){return 1}},{key:"canvas",get:function(){var t=this.cache.get(this.key);return t&&t.data}},{key:"mapping",get:function(){var t=this.cache.get(this.key);return t&&t.mapping||{}}},{key:"getCanvasByKey",value:function(t){var e=this.cache.get(t);return e&&e.data}},{key:"getMappingByKey",value:function(t){var e=this.cache.get(t);return e&&e.mapping||{}}},{key:"init",value:function(){this.cache.clear(),this.fontOptions={fontFamily:"sans-serif",fontWeight:"normal",characterSet:T,fontSize:24,buffer:3,sdf:!0,cutoff:.25,radius:8,iconfont:!1},this.key="",this.iconFontMap=new Map}},{key:"addIconGlyphs",value:function(t){var e=this;t.forEach((function(t){e.iconFontGlyphs[t.name]=t.unicode}))}},{key:"addIconFont",value:function(t,e){this.iconFontMap.set(t,e)}},{key:"getIconFontKey",value:function(t){return this.iconFontMap.get(t)||t}},{key:"getGlyph",value:function(t){return this.iconFontGlyphs[t]?String.fromCharCode(parseInt(this.iconFontGlyphs[t],16)):""}},{key:"setFontOptions",value:function(t){this.fontOptions=(0,l.Z)((0,l.Z)({},this.fontOptions),t),this.key=this.getKey();var e=this.getNewChars(this.key,this.fontOptions.characterSet),n=this.cache.get(this.key);if(!n||0!==e.length){var r=this.generateFontAtlas(this.key,e,n);this.fontAtlas=r,this.cache.set(this.key,r)}}},{key:"addFontFace",value:function(t,e){var n=this,r=document.createElement("style");r.type="text/css",r.innerText="\n @font-face{\n font-family: '".concat(t,"';\n src: url('").concat(e,"') format('woff2'),\n url('").concat(e,"') format('woff'),\n url('").concat(e,"') format('truetype');\n }"),r.onload=function(){if(document.fonts)try{document.fonts.load("24px ".concat(t),"L7text"),document.fonts.ready.then((function(){n.emit("fontloaded",{fontFamily:t})}))}catch(t){console.warn("当前环境不支持 document.fonts !"),console.warn("当前环境不支持 iconfont !"),console.warn(t)}},document.getElementsByTagName("head")[0].appendChild(r)}},{key:"destroy",value:function(){this.cache.clear(),this.iconFontMap.clear()}},{key:"generateFontAtlas",value:function(t,e,n){var r=this.fontOptions,i=r.fontFamily,o=r.fontWeight,a=r.fontSize,s=r.buffer,u=r.sdf,c=r.radius,h=r.cutoff,p=r.iconfont,f=n&&n.data;f||((f=y.$window.document.createElement("canvas")).width=1024);var d=f.getContext("2d",{willReadFrequently:!0});A(d,i,a,o);var m=function(t){var e=t.characterSet,n=t.getFontWidth,r=t.fontHeight,i=t.buffer,o=t.maxCanvasWidth,a=t.mapping,s=void 0===a?{}:a,u=t.xOffset,l=void 0===u?0:u,c=t.yOffset,h=void 0===c?0:c,p=0,f=l;Array.from(e).forEach((function(t,e){if(!s[t]){var r=n(t,e);f+30>o&&(f=0,p++),s[t]={x:f,y:h+30*p,width:30,height:30,advance:r},f+=30}}));var d=r+2*i;return{mapping:s,xOffset:f,yOffset:h+p*d,canvasHeight:S(h+(p+1)*d)}}((0,l.Z)({getFontWidth:function(t){return d.measureText(t).width},fontHeight:1*a,buffer:s,characterSet:e,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),g=m.mapping,v=m.canvasHeight,b=m.xOffset,x=m.yOffset,w=d.getImageData(0,0,f.width,f.height);if(f.height=v,d.putImageData(w,0,0),A(d,i,a,o),u){var M,T=new(_())(a,s,c,h,i,o),O=d.getImageData(0,0,T.size,T.size),P=E(e);try{for(P.s();!(M=P.n()).done;){var k=M.value;if(p){var L=String.fromCharCode(parseInt(k.replace("&#x","").replace(";",""),16));C(T.draw(L),O)}else C(T.draw(k),O);d.putImageData(O,g[k].x,g[k].y)}}catch(t){P.e(t)}finally{P.f()}}else{var I,R=E(e);try{for(R.s();!(I=R.n()).done;){var D=I.value;d.fillText(D,g[D].x,g[D].y+1*a)}}catch(t){R.e(t)}finally{R.f()}}return{xOffset:b,yOffset:x,mapping:g,data:f,width:f.width,height:f.height}}},{key:"getKey",value:function(){var t=this.fontOptions,e=t.fontFamily,n=t.fontWeight;return"".concat(e,"_").concat(n)}},{key:"getNewChars",value:function(t,e){var n=this.cache.get(t);if(!n)return e;var r=[],i=n.mapping,o=new Set(Object.keys(i));return new Set(e).forEach((function(t){o.has(t)||r.push(t)})),r}}]),i}(i.EventEmitter))||r,k=n(800),L=n(1109),I=n.n(L);var R,D,N,F=(0,a.b2)()(O=function(t){(0,f.Z)(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,m.Z)(n);if(r){var i=(0,m.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,d.Z)(this,t)});function o(){var t;(0,c.Z)(this,o);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,g.Z)((0,p.Z)(t),"canvasHeight",128),(0,g.Z)((0,p.Z)(t),"texture",void 0),(0,g.Z)((0,p.Z)(t),"canvas",void 0),(0,g.Z)((0,p.Z)(t),"iconData",void 0),(0,g.Z)((0,p.Z)(t),"iconMap",void 0),(0,g.Z)((0,p.Z)(t),"ctx",void 0),(0,g.Z)((0,p.Z)(t),"loadingImageCount",0),t}return(0,h.Z)(o,[{key:"isLoading",value:function(){return 0===this.loadingImageCount}},{key:"init",value:function(){this.iconData=[],this.iconMap={},this.canvas=y.$window.document.createElement("canvas"),this.canvas.width=128,this.canvas.height=128,this.ctx=this.canvas.getContext("2d")}},{key:"addImage",value:(e=(0,k.Z)(I().mark((function t(e,n){var r,i;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Image,this.loadingImageCount++,this.hasImage(e)?console.warn("Image Id already exists"):this.iconData.push({id:e,size:64}),this.updateIconMap(),t.next=6,this.loadImage(n);case 6:r=t.sent,(i=this.iconData.find((function(t){return t.id===e})))&&(i.image=r,i.width=r.width,i.height=r.height),this.update();case 10:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"addImageMini",value:function(t,e,n){var r=this,i=n.getSceneConfig().canvas,o=i.createImage();if(this.loadingImageCount++,this.hasImage(t))throw new Error("Image Id already exists");this.iconData.push({id:t,size:64}),this.updateIconMap(),this.loadImageMini(e,i).then((function(e){o=e;var n=r.iconData.find((function(e){return e.id===t}));n&&(n.image=o,n.width=o.width,n.height=o.height),r.update()}))}},{key:"getTexture",value:function(){return this.texture}},{key:"getIconMap",value:function(){return this.iconMap}},{key:"getCanvas",value:function(){return this.canvas}},{key:"hasImage",value:function(t){return this.iconMap.hasOwnProperty(t)}},{key:"removeImage",value:function(t){this.hasImage(t)&&(this.iconData=this.iconData.filter((function(e){return e.id!==t})),delete this.iconMap[t],this.update())}},{key:"destroy",value:function(){this.removeAllListeners("imageUpdate"),this.iconData=[],this.iconMap={}}},{key:"loadImage",value:function(t){return new Promise((function(e,n){if(t instanceof HTMLImageElement)e(t);else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e(r)},r.onerror=function(){n(new Error("Could not load image at "+t))},r.src=t instanceof File?URL.createObjectURL(t):t}}))}},{key:"update",value:function(){this.updateIconMap(),this.updateIconAtlas(),this.loadingImageCount--,0===this.loadingImageCount&&this.emit("imageUpdate")}},{key:"updateIconAtlas",value:function(){var t=this;this.canvas.width=1024,this.canvas.height=this.canvasHeight,Object.keys(this.iconMap).forEach((function(e){var n=t.iconMap[e],r=n.x,i=n.y,o=n.image,a=n.width,s=void 0===a?64:a,u=n.height,l=void 0===u?64:u,c=Math.max(s,l)/64,h=l/c,p=s/c;o&&t.ctx.drawImage(o,r+(64-p)/2,i+(64-h)/2,p,h)}))}},{key:"updateIconMap",value:function(){var t=function(t,e,n){var r,i=0,o=0,a=0,s=[],u={},l=b(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;if(!u[c.id]){var h=c.size;i+h+3>1024&&(w(u,s,o),i=0,o=a+o+3,a=0,s=[]),s.push({icon:c,xOffset:i}),i=i+h+3,a=Math.max(a,h)}}}catch(t){l.e(t)}finally{l.f()}return s.length>0&&w(u,s,o),{mapping:u,canvasHeight:S(a+o+3)}}(this.iconData),e=t.mapping,n=t.canvasHeight;this.iconMap=e,this.canvasHeight=n}},{key:"loadImageMini",value:function(t,e){return new Promise((function(n,r){var i=e.createImage();i.crossOrigin="anonymous",i.onload=function(){n(i)},i.onerror=function(){r(new Error("Could not load image at "+t))},i.src=t}))}}]),o}(i.EventEmitter))||O,z=n(5162),B=n(2401),j=(0,a.b2)()(R=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"viewport",void 0),(0,g.Z)(this,"overridedViewProjectionMatrix",void 0),(0,g.Z)(this,"jitteredViewProjectionMatrix",void 0),(0,g.Z)(this,"jitteredProjectionMatrix",void 0),(0,g.Z)(this,"viewMatrixInverse",void 0),(0,g.Z)(this,"cameraPosition",void 0)}return(0,h.Z)(t,[{key:"init",value:function(){}},{key:"update",value:function(t){this.viewport=t,this.viewMatrixInverse=B.create(),B.invert(this.viewMatrixInverse,t.getViewMatrix()),this.cameraPosition=[this.viewMatrixInverse[12],this.viewMatrixInverse[13],this.viewMatrixInverse[14]]}},{key:"getProjectionMatrix",value:function(){return this.jitteredProjectionMatrix||this.viewport.getProjectionMatrix()}},{key:"getModelMatrix",value:function(){return this.viewport.getModelMatrix()}},{key:"getViewMatrix",value:function(){return this.viewport.getViewMatrix()}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.getViewMatrixUncentered()}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.getViewProjectionMatrixUncentered()}},{key:"getViewProjectionMatrix",value:function(){return this.overridedViewProjectionMatrix||this.jitteredViewProjectionMatrix||this.viewport.getViewProjectionMatrix()}},{key:"getZoom",value:function(){return this.viewport.getZoom()}},{key:"getZoomScale",value:function(){return this.viewport.getZoomScale()}},{key:"getCenter",value:function(){var t=this.viewport.getCenter(),e=(0,z.Z)(t,2);return[e[0],e[1]]}},{key:"getFocalDistance",value:function(){return this.viewport.getFocalDistance()}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"projectFlat",value:function(t,e){return this.viewport.projectFlat(t,e)}},{key:"setViewProjectionMatrix",value:function(t){this.overridedViewProjectionMatrix=t}},{key:"jitterProjectionMatrix",value:function(t,e){var n=B.fromTranslation(B.create(),[t,e,0]);this.jitteredProjectionMatrix=B.multiply(B.create(),n,this.viewport.getProjectionMatrix()),this.jitteredViewProjectionMatrix=B.multiply(B.create(),this.jitteredProjectionMatrix,this.viewport.getViewMatrix())}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0}}]),t}())||R,U=n(9908);function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t){t.TOPRIGHT="topright",t.TOPLEFT="topleft",t.BOTTOMRIGHT="bottomright",t.BOTTOMLEFT="bottomleft",t.TOPCENTER="topcenter",t.BOTTOMCENTER="bottomcenter",t.LEFTCENTER="leftcenter",t.RIGHTCENTER="rightcenter",t.LEFTTOP="lefttop",t.RIGHTTOP="righttop",t.LEFTBOTTOM="leftbottom",t.RIGHTBOTTOM="rightbottom"}(D||(D={}));var V,G,H,W,q,Y,X={topleft:"column",topright:"column",bottomright:"column",bottomleft:"column",leftcenter:"column",rightcenter:"column",topcenter:"row",bottomcenter:"row",lefttop:"row",righttop:"row",leftbottom:"row",rightbottom:"row"},$=(0,a.b2)()(N=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"container",void 0),(0,g.Z)(this,"controlCorners",void 0),(0,g.Z)(this,"controlContainer",void 0),(0,g.Z)(this,"scene",void 0),(0,g.Z)(this,"mapsService",void 0),(0,g.Z)(this,"controls",[]),(0,g.Z)(this,"unAddControls",[])}return(0,h.Z)(t,[{key:"init",value:function(t,e){this.container=t.container,this.scene=e,this.mapsService=e.get(u.IMapService),this.initControlPos()}},{key:"addControl",value:function(t,e){e.get(u.IMapService).map?(t.addTo(this.scene),this.controls.push(t)):this.unAddControls.push(t)}},{key:"getControlByName",value:function(t){return this.controls.find((function(e){return e.controlOption.name===t}))}},{key:"removeControl",value:function(t){var e=this.controls.indexOf(t);return e>-1&&this.controls.splice(e,1),t.remove(),this}},{key:"addControls",value:function(){var t=this;this.unAddControls.forEach((function(e){e.addTo(t.scene),t.controls.push(e)})),this.unAddControls=[]}},{key:"destroy",value:function(){var t,e=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(this.controls);try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.controls=[],this.clearControlPos()}},{key:"initControlPos",value:function(){var t=this.controlCorners={},e=this.controlContainer=y.DOM.create("div","l7-control-container",this.container);Object.values(D).forEach((function(n){var r,i;!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=n.map((function(t){return"l7-"+t})).join(" ");t[n.filter((function(t){return!["row","column"].includes(t)})).join("")]=y.DOM.create("div",r,e)}((r=n,i=r.replace(/^(top|bottom|left|right|center)/,"$1-").split("-"),[].concat((0,U.Z)(i),[X[r]])))})),this.checkCornerOverlap()}},{key:"clearControlPos",value:function(){for(var t in this.controlCorners)this.controlCorners[t]&&y.DOM.remove(this.controlCorners[t]);this.controlContainer&&y.DOM.remove(this.controlContainer)}},{key:"checkCornerOverlap",value:function(){var t=this,e=window.MutationObserver;if(e)for(var n=function(){var n=i[r].match(/^(top|bottom)(left|right)$/);if(n){var o=(0,z.Z)(n,3),a=o[1],s=o[2],u=t.controlCorners["".concat(a).concat(s)];new e((function(t){var e=(0,z.Z)(t,1)[0].target;u&&(u.style[a]=e.clientHeight+"px")})).observe(t.controlCorners["".concat(s).concat(a)],{childList:!0,attributes:!0})}},r=0,i=Object.keys(this.controlCorners);r<i.length;r++)n()}}]),t}())||N,K=(0,a.b2)()(V=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"container",void 0),(0,g.Z)(this,"scene",void 0),(0,g.Z)(this,"mapsService",void 0),(0,g.Z)(this,"markers",[]),(0,g.Z)(this,"markerLayers",[]),(0,g.Z)(this,"unAddMarkers",[]),(0,g.Z)(this,"unAddMarkerLayers",[])}return(0,h.Z)(t,[{key:"addMarkerLayer",value:function(t){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markerLayers.push(t),t.addTo(this.scene)):this.unAddMarkerLayers.push(t)}},{key:"removeMarkerLayer",value:function(t){t.destroy(),this.markerLayers.indexOf(t);var e=this.markerLayers.indexOf(t);e>-1&&this.markerLayers.splice(e,1)}},{key:"addMarker",value:function(t){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(t),t.addTo(this.scene)):this.unAddMarkers.push(t)}},{key:"addMarkers",value:function(){var t=this;this.unAddMarkers.forEach((function(e){e.addTo(t.scene),t.markers.push(e)})),this.unAddMarkers=[]}},{key:"addMarkerLayers",value:function(){var t=this;this.unAddMarkerLayers.forEach((function(e){t.markerLayers.push(e),e.addTo(t.scene)})),this.unAddMarkers=[]}},{key:"removeMarker",value:function(t){t.remove(),this.markers.indexOf(t);var e=this.markers.indexOf(t);e>-1&&this.markers.splice(e,1)}},{key:"removeAllMarkers",value:function(){this.destroy()}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(u.IMapService)}},{key:"destroy",value:function(){this.markers.forEach((function(t){t.remove()})),this.markers=[],this.markerLayers.forEach((function(t){t.destroy()})),this.markerLayers=[]}},{key:"removeMakerLayerMarker",value:function(t){t.destroy()}}]),t}())||V,J=(0,a.b2)()(G=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"scene",void 0),(0,g.Z)(this,"mapsService",void 0),(0,g.Z)(this,"popups",[]),(0,g.Z)(this,"unAddPopups",[])}return(0,h.Z)(t,[{key:"isMarkerReady",get:function(){return this.mapsService.map&&this.mapsService.getMarkerContainer()}},{key:"removePopup",value:function(t){null!=t&&t.isOpen()&&t.remove();var e=this.popups.indexOf(t);e>-1&&this.popups.splice(e,1);var n=this.unAddPopups.indexOf(t);n>-1&&this.unAddPopups.splice(n,1)}},{key:"destroy",value:function(){this.popups.forEach((function(t){return t.remove()}))}},{key:"addPopup",value:function(t){var e=this;t&&t.getOptions().autoClose&&[].concat((0,U.Z)(this.popups),(0,U.Z)(this.unAddPopups)).forEach((function(t){t.getOptions().autoClose&&e.removePopup(t)})),this.isMarkerReady?(t.addTo(this.scene),this.popups.push(t)):this.unAddPopups.push(t),t.on("close",(function(){e.removePopup(t)}))}},{key:"initPopup",value:function(){var t=this;this.unAddPopups.length&&this.unAddPopups.forEach((function(e){t.addPopup(e),t.unAddPopups=[]}))}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(u.IMapService)}}]),t}())||G,Q=n(9479);!function(t){t.normal="normal",t.additive="additive",t.subtractive="subtractive",t.min="min",t.max="max",t.none="none"}(H||(H={})),function(t){t.MULTIPLE="MULTIPLE",t.SINGLE="SINGLE"}(W||(W={})),function(t){t.AND="and",t.OR="or"}(q||(q={})),function(t){t.INIT="init",t.UPDATE="update"}(Y||(Y={}));const tt={MapToken:"您正在使用 Demo 测试 Token, 生产环境务必自行注册 Token 确保服务稳定",SDK:"请确认引入了mapbox-gl api且在L7之前引入"};var et,nt,rt={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,isMini:!1,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},it={colors:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],size:10,shape:"circle",scales:{},shape2d:["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],shape3d:["cylinder","triangleColumn","hexagonColumn","squareColumn"],minZoom:-1,maxZoom:24,visible:!0,autoFit:!1,pickingBuffer:0,enablePropagation:!1,zIndex:0,blend:"normal",maskLayers:[],enableMask:!0,maskOperation:q.AND,pickedFeatureID:-1,enableMultiPassRenderer:!1,enablePicking:!0,active:!1,activeColor:"#2f54eb",enableHighlight:!1,enableSelect:!1,highlightColor:"#2f54eb",activeMix:0,selectColor:"blue",selectMix:0,enableTAA:!1,jitterScale:1,enableLighting:!1,animateOption:{enable:!1,interval:.2,duration:4,trailLength:.15},forward:!0},ot=(0,a.b2)()(et=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"sceneConfigCache",{}),(0,g.Z)(this,"layerConfigCache",{}),(0,g.Z)(this,"layerAttributeConfigCache",{})}return(0,h.Z)(t,[{key:"getSceneConfig",value:function(t){return this.sceneConfigCache[t]}},{key:"getSceneWarninfo",value:function(t){return tt[t]}},{key:"setSceneConfig",value:function(t,e){this.sceneConfigCache[t]=(0,l.Z)((0,l.Z)({},rt),e)}},{key:"getLayerConfig",value:function(t){return this.layerConfigCache[t]}},{key:"setLayerConfig",value:function(t,e,n){this.layerConfigCache[e]=(0,l.Z)({},(0,Q.merge)({},this.sceneConfigCache[t],it,n))}},{key:"getAttributeConfig",value:function(t){return this.layerAttributeConfigCache[t]}},{key:"setAttributeConfig",value:function(t,e){this.layerAttributeConfigCache[t]=(0,l.Z)((0,l.Z)({},this.layerAttributeConfigCache[t]),e)}},{key:"clean",value:function(){this.sceneConfigCache={},this.layerConfigCache={}}}]),t}())||et,at=n(6902),st=n(7677),ut=n(5512),lt=Math.PI/180,ct=4003e4;function ht(t){var e=t.latitude,n=void 0===e?0:e,r=t.zoom,i=void 0===r?0:r,o=t.scale,a=t.highPrecision,s=void 0!==a&&a,u=t.flipY,l=void 0!==u&&u,c={},h=512*(o=void 0!==o?o:Math.pow(2,i)),p=Math.cos(n*lt),f=h/360,d=f/p,m=h/ct/p;if(c.pixelsPerMeter=[m,-m,m],c.metersPerPixel=[1/m,-1/m,1/m],c.pixelsPerDegree=[f,-d,m],c.degreesPerPixel=[1/f,-1/d,1/m],s){var g=lt*Math.tan(n*lt)/p,y=f*g/2,v=h/ct*g,_=v/d*m;c.pixelsPerDegree2=[0,-y,v],c.pixelsPerMeter2=[_,0,_],l&&(c.pixelsPerDegree2[1]=-c.pixelsPerDegree2[1],c.pixelsPerMeter2[1]=-c.pixelsPerMeter2[1])}return l&&(c.pixelsPerMeter[1]=-c.pixelsPerMeter[1],c.metersPerPixel[1]=-c.metersPerPixel[1],c.pixelsPerDegree[1]=-c.pixelsPerDegree[1],c.degreesPerPixel[1]=-c.degreesPerPixel[1]),c}!function(t){t[t.LNGLAT=1]="LNGLAT",t[t.LNGLAT_OFFSET=2]="LNGLAT_OFFSET",t[t.VECTOR_TILE=3]="VECTOR_TILE",t[t.IDENTITY=4]="IDENTITY",t[t.P20=5]="P20",t[t.P20_OFFSET=6]="P20_OFFSET",t[t.METER_OFFSET=7]="METER_OFFSET",t[t.P20_2=8]="P20_2"}(nt||(nt={}));var pt,ft,dt,mt,gt,yt,vt={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter",Mvp:"u_Mvp"},_t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],bt=(pt=(0,a.b2)(),ft=(0,a.f3)(u.ICameraService),pt((mt=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"needRefresh",!0),(0,at.Z)(this,"cameraService",gt,this),(0,g.Z)(this,"coordinateSystem",void 0),(0,g.Z)(this,"viewportCenter",void 0),(0,g.Z)(this,"viewportCenterProjection",void 0),(0,g.Z)(this,"pixelsPerDegree",void 0),(0,g.Z)(this,"pixelsPerDegree2",void 0),(0,g.Z)(this,"pixelsPerMeter",void 0)}return(0,h.Z)(t,[{key:"refresh",value:function(t){var e=this.cameraService.getZoom(),n=this.cameraService.getZoomScale(),r=t||this.cameraService.getCenter(),i=ht({latitude:r[1],zoom:e}),o=i.pixelsPerMeter,a=i.pixelsPerDegree;this.viewportCenter=r,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=o,this.pixelsPerDegree=a,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===nt.LNGLAT||this.coordinateSystem===nt.P20?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===nt.LNGLAT_OFFSET?this.calculateLnglatOffset(r,e):this.coordinateSystem===nt.P20_OFFSET&&this.calculateLnglatOffset(r,e,n,!0),this.needRefresh=!1}},{key:"getCoordinateSystem",value:function(){return this.coordinateSystem}},{key:"setCoordinateSystem",value:function(t){this.coordinateSystem=t}},{key:"getViewportCenter",value:function(){return this.viewportCenter}},{key:"getViewportCenterProjection",value:function(){return this.viewportCenterProjection}},{key:"getPixelsPerDegree",value:function(){return this.pixelsPerDegree}},{key:"getPixelsPerDegree2",value:function(){return this.pixelsPerDegree2}},{key:"getPixelsPerMeter",value:function(){return this.pixelsPerMeter}},{key:"calculateLnglatOffset",value:function(t,e,n,r){var i=ht({latitude:t[1],zoom:e,scale:n,flipY:r,highPrecision:!0}),o=i.pixelsPerMeter,a=i.pixelsPerDegree,s=i.pixelsPerDegree2,u=this.cameraService.getViewMatrix(),l=this.cameraService.getProjectionMatrix(),c=B.multiply([],l,u),h=this.cameraService.projectFlat([Math.fround(t[0]),Math.fround(t[1])],Math.pow(2,e));this.viewportCenterProjection=ut.fF([],[h[0],h[1],0,1],c),u=this.cameraService.getViewMatrixUncentered()||u,c=B.multiply([],l,u),c=B.multiply([],c,_t),this.cameraService.setViewProjectionMatrix(c),this.pixelsPerMeter=o,this.pixelsPerDegree=a,this.pixelsPerDegree2=s}}]),t}(),gt=(0,st.Z)(mt.prototype,"cameraService",[ft],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dt=mt))||dt),xt=n(7743);var wt,St,Et,Mt,Tt,At,Ct=(0,a.b2)()(yt=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,c.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,g.Z)((0,p.Z)(t),"renderMap",new Map),(0,g.Z)((0,p.Z)(t),"enable",!1),(0,g.Z)((0,p.Z)(t),"renderEnable",!1),(0,g.Z)((0,p.Z)(t),"cacheLogs",{}),t}return(0,h.Z)(i,[{key:"setEnable",value:function(t){this.enable=!!t}},{key:"log",value:function(t,e){var n=this;if(this.enable){var r=t.split("."),i=null;r.forEach((function(t,o){null!==i?(i[t]||(i[t]={}),o!==r.length-1&&(i=i[t])):(n.cacheLogs[t]||(n.cacheLogs[t]={}),o!==r.length-1&&(i=n.cacheLogs[t])),o===r.length-1&&(i[t]=(0,l.Z)((0,l.Z)({time:Date.now()},i[t]),e))}))}}},{key:"getLog",value:function(t){var e=this;switch((0,xt.Z)(t)){case"string":return this.cacheLogs[t];case"object":return t.map((function(t){return e.cacheLogs[t]})).filter((function(t){return void 0!==t}));case"undefined":return this.cacheLogs}}},{key:"removeLog",value:function(t){delete this.cacheLogs[t]}},{key:"generateRenderUid",value:function(){return this.renderEnable?(0,y.guid)():""}},{key:"renderDebug",value:function(t){this.renderEnable=t}},{key:"renderStart",value:function(t){if(this.renderEnable&&this.enable){var e=this.renderMap.get(t)||{};this.renderMap.set(t,(0,l.Z)((0,l.Z)({},e),{},{renderUid:t,renderStart:Date.now()}))}}},{key:"renderEnd",value:function(t){if(this.renderEnable&&this.enable){var e=this.renderMap.get(t);if(e){var n=e.renderStart,r=Date.now();this.emit("renderEnd",(0,l.Z)((0,l.Z)({},e),{},{renderEnd:r,renderDuration:r-n})),this.renderMap.delete(t)}}}},{key:"destroy",value:function(){this.cacheLogs=null,this.renderMap.clear()}}]),i}(i.EventEmitter))||yt,Ot=n(9315),Pt=n.n(Ot);!function(t){t.Hover="hover",t.Click="click",t.Select="select",t.Active="active",t.Drag="drag"}(wt||(wt={}));var kt,Lt,It,Rt,Dt,Nt,Ft,zt,Bt,jt,Ut,Zt,Vt,Gt,Ht={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancel"},Wt=(St=(0,a.b2)(),Et=(0,a.f3)(u.IMapService),St((Tt=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,c.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,g.Z)((0,p.Z)(t),"indragging",!1),(0,at.Z)((0,p.Z)(t),"mapService",At,(0,p.Z)(t)),(0,g.Z)((0,p.Z)(t),"hammertime",void 0),(0,g.Z)((0,p.Z)(t),"lastClickTime",0),(0,g.Z)((0,p.Z)(t),"lastClickXY",[-1,-1]),(0,g.Z)((0,p.Z)(t),"clickTimer",void 0),(0,g.Z)((0,p.Z)(t),"$containter",void 0),(0,g.Z)((0,p.Z)(t),"onDrag",(function(e){var n=t.interactionEvent(e);n.type=Ht[n.type],"dragging"===n.type?t.indragging=!0:t.indragging=!1,t.emit(wt.Drag,n)})),(0,g.Z)((0,p.Z)(t),"onHammer",(function(e){e.srcEvent.stopPropagation();var n=t.interactionEvent(e);t.emit(wt.Hover,n)})),(0,g.Z)((0,p.Z)(t),"onTouch",(function(e){var n=e.touches[0];t.onHover({x:n.pageX,y:n.pageY,type:"touch"})})),(0,g.Z)((0,p.Z)(t),"onHover",(function(e){var n=e.clientX,r=e.clientY,i=e.type,o=t.mapService.getMapContainer();if(o)if(y.isMini)n=n-o.left-0,r=r-o.top-0;else{var a=o.getBoundingClientRect(),s=a.top;n=n-a.left-o.clientLeft,r=r-s-o.clientTop}var u=t.mapService.containerToLngLat([n,r]);if("click"!==i)"touch"!==i?"click"!==i&&"dblclick"!==i&&t.emit(wt.Hover,{x:n,y:r,lngLat:u,type:i,target:e}):t.isDoubleTap(n,r,u);else{if(!y.isMini&&"ontouchstart"in document.documentElement==1)return;t.isDoubleTap(n,r,u)}})),t}return(0,h.Z)(i,[{key:"init",value:function(){this.addEventListenerOnMap(),this.$containter=this.mapService.getMapContainer()}},{key:"destroy",value:function(){this.hammertime&&this.hammertime.destroy(),this.removeEventListenerOnMap(),this.off(wt.Hover)}},{key:"triggerHover",value:function(t){var e=t.x,n=t.y;this.emit(wt.Hover,{x:e,y:n})}},{key:"triggerSelect",value:function(t){this.emit(wt.Select,{featureId:t})}},{key:"triggerActive",value:function(t){this.emit(wt.Active,{featureId:t})}},{key:"handleMiniEvent",value:function(t){this.onHover({clientX:t.touches[0].pageX,clientY:t.touches[0].pageY,type:"touch"})}},{key:"addEventListenerOnMap",value:function(){var t=this.mapService.getMapContainer();if(t)if(y.isMini)y.$window.document.addEventListener("touchstart",this.handleMiniEvent.bind(this));else{var e=new(Pt().Manager)(t);e.add(new(Pt().Tap)({event:"dblclick",taps:2})),e.add(new(Pt().Tap)({event:"click"})),e.add(new(Pt().Pan)({threshold:0,pointers:0})),e.add(new(Pt().Press)({})),e.on("dblclick click",this.onHammer),e.on("panstart panmove panend pancancel",this.onDrag),t.addEventListener("mousemove",this.onHover),t.addEventListener("mousedown",this.onHover,!0),t.addEventListener("mouseup",this.onHover),t.addEventListener("contextmenu",this.onHover),this.hammertime=e}}},{key:"removeEventListenerOnMap",value:function(){if(y.isMini)y.$window.document.removeEventListener("touchstart",this.handleMiniEvent.bind(this));else{var t=this.mapService.getMapContainer();t&&(t.removeEventListener("mousemove",this.onHover),this.hammertime.off("dblclick click",this.onHammer),this.hammertime.off("panstart panmove panend pancancel",this.onDrag),t.removeEventListener("mousedown",this.onHover),t.removeEventListener("mouseup",this.onHover),t.removeEventListener("contextmenu",this.onHover))}}},{key:"interactionEvent",value:function(t){var e,n,r=t.type;"touch"===t.pointerType?(n=Math.floor(t.pointers[0].clientY),e=Math.floor(t.pointers[0].clientX)):(n=Math.floor(t.srcEvent.y),e=Math.floor(t.srcEvent.x));var i=this.mapService.getMapContainer();if(i){var o=i.getBoundingClientRect(),a=o.top;e-=o.left,n-=a}return{x:e,y:n,lngLat:this.mapService.containerToLngLat([e,n]),type:r,target:t.srcEvent}}},{key:"isDoubleTap",value:function(t,e,n){var r=this,i=(new Date).getTime(),o="click";i-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-t)<10&&Math.abs(this.lastClickXY[1]-e)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),o="dblclick",this.emit(wt.Hover,{x:t,y:e,lngLat:n,type:o})):(this.lastClickTime=i,this.lastClickXY=[t,e],this.clickTimer=setTimeout((function(){o="click",r.emit(wt.Hover,{x:t,y:e,lngLat:n,type:o})}),400))}}]),i}(o()),At=(0,st.Z)(Tt.prototype,"mapService",[Et],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mt=Tt))||Mt),qt=0;function Yt(t){if(y.isMini)return null;var e=t;if("string"==typeof t&&(e=document.getElementById(t)),e){var n=document.createElement("div");return n.style.cssText+="\n position: absolute;\n z-index:2;\n height: 100%;\n width: 100%;\n pointer-events: none;\n ",n.id="l7-scene-".concat(qt++),n.classList.add("l7-scene"),e.appendChild(n),n}return null}!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL"}(kt||(kt={}));var Xt,$t,Kt,Jt,Qt,te,ee,ne,re,ie=(Lt=(0,a.b2)(),It=(0,a.f3)(u.IMapService),Rt=(0,a.f3)(u.IRendererService),Dt=(0,a.f3)(u.IGlobalConfigService),Nt=(0,a.f3)(u.IInteractionService),Ft=(0,a.f3)(u.ILayerService),Lt((Bt=function(){function t(){var e=this;(0,c.Z)(this,t),(0,g.Z)(this,"pickedColors",void 0),(0,g.Z)(this,"pickedTileLayers",[]),(0,at.Z)(this,"mapService",jt,this),(0,at.Z)(this,"rendererService",Ut,this),(0,at.Z)(this,"configService",Zt,this),(0,at.Z)(this,"interactionService",Vt,this),(0,at.Z)(this,"layerService",Gt,this),(0,g.Z)(this,"pickingFBO",void 0),(0,g.Z)(this,"width",0),(0,g.Z)(this,"height",0),(0,g.Z)(this,"alreadyInPicking",!1),(0,g.Z)(this,"pickBufferScale",1),(0,g.Z)(this,"pickFromPickingFBO",(function(t,n){var r=n.x,i=n.y,o=n.lngLat,a=n.type,s=n.target,u=!1,c=e.rendererService,h=c.readPixels,p=c.getContainer,f=e.getContainerSize(p()),d=f.width,m=f.height;d*=y.DOM.DPR,m*=y.DOM.DPR;var g=t.getLayerConfig(),v=g.enableHighlight,_=g.enableSelect,b=r*y.DOM.DPR,x=i*y.DOM.DPR;if(b>d-1*y.DOM.DPR||b<0||x>m-1*y.DOM.DPR||x<0)return!1;var w=h({x:Math.floor(b/e.pickBufferScale),y:Math.floor((m-(i+1)*y.DOM.DPR)/e.pickBufferScale),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO});if(e.pickedColors=w,0!==w[0]||0!==w[1]||0!==w[2]){var S=(0,y.decodePickingColor)(w),E=t.layerPickService.getFeatureById(S);S!==t.getCurrentPickId()&&"mousemove"===a&&(a="mouseenter");var M={x:r,y:i,type:a,lngLat:o,featureId:S,feature:E,target:s};E&&(u=!0,t.setCurrentPickId(S),e.triggerHoverOnLayer(t,M))}else{var T={x:r,y:i,lngLat:o,type:null!==t.getCurrentPickId()&&"mousemove"===a?"mouseout":"un"+a,featureId:null,target:s,feature:null};e.triggerHoverOnLayer(t,(0,l.Z)((0,l.Z)({},T),{},{type:"unpick"})),e.triggerHoverOnLayer(t,T),t.setCurrentPickId(null)}if(v&&t.layerPickService.highlightPickedFeature(w),_&&"click"===a&&(null==w?void 0:w.toString())!==[0,0,0,0].toString()){var A=(0,y.decodePickingColor)(w);null===t.getCurrentSelectedId()||A!==t.getCurrentSelectedId()?(t.layerPickService.selectFeature(w),t.setCurrentSelectedId(A)):(t.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),t.setCurrentSelectedId(null))}return u}))}var e,n,r;return(0,h.Z)(t,[{key:"init",value:function(t){var e=this.rendererService,n=e.createTexture2D,r=e.createFramebuffer,i=e.getContainer,o=this.getContainerSize(i()),a=o.width,s=o.height;a*=y.DOM.DPR,s*=y.DOM.DPR,this.pickBufferScale=this.configService.getSceneConfig(t).pickBufferScale||1,this.pickingFBO=r({color:n({width:Math.round(a/this.pickBufferScale),height:Math.round(s/this.pickBufferScale),wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})}),this.interactionService.on(wt.Hover,this.pickingAllLayer.bind(this))}},{key:"boxPickLayer",value:(r=(0,k.Z)(I().mark((function t(e,n,r){var i,o,a,s=this;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=this.rendererService,o=i.useFramebuffer,a=i.clear,this.resizePickingFBO(),o(this.pickingFBO,(function(){a({framebuffer:s.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),e.hooks.beforePickingEncode.call(),e.renderModels({ispick:!0}),e.hooks.afterPickingEncode.call();var t=s.pickBox(e,n);r(t)}));case 3:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return r.apply(this,arguments)})},{key:"pickBox",value:function(t,e){var n=this,r=e.map((function(t){var e=t<0?0:t;return Math.floor(e*y.DOM.DPR/n.pickBufferScale)})),i=(0,z.Z)(r,4),o=i[0],a=i[1],s=i[2],u=i[3],c=this.rendererService,h=c.readPixels,p=c.getContainer,f=this.getContainerSize(p()),d=f.width,m=f.height;if(d*=y.DOM.DPR,m*=y.DOM.DPR,o>(d-1)*y.DOM.DPR/this.pickBufferScale||s<0||a>(m-1)*y.DOM.DPR/this.pickBufferScale||u<0)return[];for(var g=Math.min(d/this.pickBufferScale,s)-o,v=Math.min(m/this.pickBufferScale,u)-a,_=h({x:o,y:Math.floor(m/this.pickBufferScale-(u+1)),width:g,height:v,data:new Uint8Array(g*v*4),framebuffer:this.pickingFBO}),b=[],x={},w=0;w<_.length/4;w+=1){var S=_.slice(4*w,4*w+4),E=(0,y.decodePickingColor)(S);if(-1!==E&&!x[E]){var M=t.layerPickService.getFeatureById(E);b.push((0,l.Z)((0,l.Z)({},M),{},{pickedFeatureIdx:E})),x[E]=!0}}return b}},{key:"handleCursor",value:function(t,e){var n=t.getLayerConfig(),r=n.cursor,i=void 0===r?"":r;if(n.cursorEnabled){var o="GAODE2.x"===this.mapService.version?this.mapService.getMapContainer():this.mapService.getMarkerContainer(),a=null==o?void 0:o.style.getPropertyValue("cursor");"unmousemove"===e&&""!==a?null==o||o.style.setProperty("cursor",""):"mousemove"===e&&(null==o||o.style.setProperty("cursor",i))}}},{key:"destroy",value:function(){this.pickingFBO.destroy(),this.pickingFBO=null}},{key:"getContainerSize",value:function(t){return t.getContext?{width:t.width/y.DOM.DPR,height:t.height/y.DOM.DPR}:t.getBoundingClientRect()}},{key:"pickingAllLayer",value:(n=(0,k.Z)(I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.layerService.needPick(e.type)&&this.isPickingAllLayer()){t.next=2;break}return t.abrupt("return");case 2:return this.alreadyInPicking=!0,t.next=5,this.pickingLayers(e);case 5:this.layerService.renderLayers(),this.alreadyInPicking=!1;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"isPickingAllLayer",value:function(){return!(this.alreadyInPicking||this.layerService.alreadyInRendering||this.interactionService.indragging||!this.layerService.getShaderPickStat())}},{key:"resizePickingFBO",value:function(){var t=this.rendererService.getContainer,e=this.getContainerSize(t()),n=e.width,r=e.height;n*=y.DOM.DPR,r*=y.DOM.DPR,this.width===n&&this.height===r||(this.pickingFBO.resize({width:Math.round(n/this.pickBufferScale),height:Math.round(r/this.pickBufferScale)}),this.width=n,this.height=r)}},{key:"pickingLayers",value:(e=(0,k.Z)(I().mark((function t(e){var n,r,i,o=this;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.rendererService,r=n.useFramebuffer,i=n.clear,this.resizePickingFBO(),r(this.pickingFBO,(function(){o.layerService.getRenderList().filter((function(t){return t.needPick(e.type)})).reverse().some((function(t){i({framebuffer:o.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),t.layerPickService.pickRender(e);var n=o.pickFromPickingFBO(t,e);return o.layerService.pickedLayerId=n?+t.id:-1,n&&!t.getLayerConfig().enablePropagation}))}));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"triggerHoverOnLayer",value:function(t,e){(function(t){var e,n=!0;if((null==t||null===(e=t.target)||void 0===e?void 0:e.target)instanceof HTMLElement)for(var r,i=null==t||null===(r=t.target)||void 0===r?void 0:r.target;i;){var o,a=Array.from(i.classList);if(a.includes("l7-marker")||a.includes("l7-popup")){n=!1;break}i=null===(o=i)||void 0===o?void 0:o.parentElement}return n})(e)&&(this.handleCursor(t,e.type),t.emit(e.type,e))}}]),t}(),jt=(0,st.Z)(Bt.prototype,"mapService",[It],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ut=(0,st.Z)(Bt.prototype,"rendererService",[Rt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zt=(0,st.Z)(Bt.prototype,"configService",[Dt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vt=(0,st.Z)(Bt.prototype,"interactionService",[Nt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gt=(0,st.Z)(Bt.prototype,"layerService",[Ft],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zt=Bt))||zt),oe=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,c.Z)(this,t),(0,g.Z)(this,"autoStart",void 0),(0,g.Z)(this,"startTime",0),(0,g.Z)(this,"oldTime",0),(0,g.Z)(this,"running",!1),(0,g.Z)(this,"elapsedTime",0),this.autoStart=e}return(0,h.Z)(t,[{key:"start",value:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}]),t}();function ae(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return se(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function se(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ue,le,ce,he,pe,fe,de,me,ge,ye,ve,_e,be,xe,we,Se,Ee,Me,Te,Ae,Ce,Oe,Pe,ke,Le,Ie,Re,De,Ne,Fe,ze,Be,je,Ue,Ze,Ve,Ge,He,We,qe,Ye,Xe=(Xt=(0,a.b2)(),$t=(0,a.f3)(u.IRendererService),Kt=(0,a.f3)(u.IMapService),Jt=(0,a.f3)(u.IDebugService),Xt((te=function(t){(0,f.Z)(v,t);var e,n,r,i,o,a,s,u,l=(s=v,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,m.Z)(s);if(u){var n=(0,m.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,d.Z)(this,t)});function v(){var t;(0,c.Z)(this,v);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=l.call.apply(l,[this].concat(n)),(0,g.Z)((0,p.Z)(t),"pickedLayerId",-1),(0,g.Z)((0,p.Z)(t),"clock",new oe),(0,g.Z)((0,p.Z)(t),"alreadyInRendering",!1),(0,g.Z)((0,p.Z)(t),"layers",[]),(0,g.Z)((0,p.Z)(t),"layerList",[]),(0,g.Z)((0,p.Z)(t),"layerRenderID",void 0),(0,g.Z)((0,p.Z)(t),"sceneInited",!1),(0,g.Z)((0,p.Z)(t),"animateInstanceCount",0),(0,g.Z)((0,p.Z)(t),"shaderPicking",!0),(0,g.Z)((0,p.Z)(t),"enableRender",!0),(0,at.Z)((0,p.Z)(t),"renderService",ee,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"mapService",ne,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"debugService",re,(0,p.Z)(t)),(0,g.Z)((0,p.Z)(t),"reRender",(0,Q.throttle)((function(){t.renderLayers()}),32)),(0,g.Z)((0,p.Z)(t),"throttleRenderLayers",(0,Q.throttle)((function(){t.renderLayers()}),16)),t}return(0,h.Z)(v,[{key:"needPick",value:function(t){return this.layerList.some((function(e){return e.needPick(t)}))}},{key:"add",value:function(t){var e=this;this.layers.push(t),this.sceneInited&&t.init().then((function(){e.renderLayers()}))}},{key:"addMask",value:function(t){var e=this;this.sceneInited&&t.init().then((function(){e.renderLayers()}))}},{key:"initLayers",value:(a=(0,k.Z)(I().mark((function t(){var e=this;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.sceneInited=!0,this.layers.forEach(function(){var t=(0,k.Z)(I().mark((function t(n){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.startInit){t.next=4;break}return t.next=3,n.init();case 3:e.updateLayerRenderList();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"getSceneInited",value:function(){return this.sceneInited}},{key:"getRenderList",value:function(){return this.layerList}},{key:"getLayers",value:function(){return this.layers}},{key:"getLayer",value:function(t){return this.layers.find((function(e){return e.id===t}))}},{key:"getLayerByName",value:function(t){return this.layers.find((function(e){return e.name===t}))}},{key:"remove",value:(o=(0,k.Z)(I().mark((function t(e,n){var r,i;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n?(r=n.layerChildren.indexOf(e))>-1&&n.layerChildren.splice(r,1):(i=this.layers.indexOf(e))>-1&&this.layers.splice(i,1),e.destroy(),this.reRender(),this.emit("layerChange",this.layers);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"removeAllLayers",value:(i=(0,k.Z)(I().mark((function t(){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.destroy(),this.reRender();case 2:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"setEnableRender",value:function(t){this.enableRender=t}},{key:"renderLayers",value:(r=(0,k.Z)(I().mark((function t(){var e,n,r,i,o,a;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.alreadyInRendering&&this.enableRender){t.next=2;break}return t.abrupt("return");case 2:this.updateLayerRenderList(),e=this.debugService.generateRenderUid(),this.debugService.renderStart(e),this.alreadyInRendering=!0,this.clear(),n=ae(this.layerList),t.prev=8,n.s();case 10:if((r=n.n()).done){t.next=23;break}if(i=r.value,o=i.getLayerConfig(),a=o.enableMask,i.masks.filter((function(t){return t.inited})).length>0&&a&&this.renderMask(i.masks),!i.getLayerConfig().enableMultiPassRenderer){t.next=19;break}return t.next=17,i.renderMultiPass();case 17:t.next=21;break;case 19:return t.next=21,i.render();case 21:t.next=10;break;case 23:t.next=28;break;case 25:t.prev=25,t.t0=t.catch(8),n.e(t.t0);case 28:return t.prev=28,n.f(),t.finish(28);case 31:this.debugService.renderEnd(e),this.alreadyInRendering=!1;case 33:case"end":return t.stop()}}),t,this,[[8,25,28,31]])}))),function(){return r.apply(this,arguments)})},{key:"renderMask",value:function(t){var e=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});var n,r=t.length>1?W.MULTIPLE:W.SINGLE,i=ae(t);try{for(i.s();!(n=i.n()).done;)n.value.render({isStencil:!0,stencilType:r,stencilIndex:e++})}catch(t){i.e(t)}finally{i.f()}}},{key:"beforeRenderData",value:(n=(0,k.Z)(I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.hooks.beforeRenderData.promise();case 2:t.sent&&this.renderLayers();case 4:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"renderTileLayerMask",value:function(t){var e=0,n=t.getLayerConfig().enableMask,r=void 0===n||n,i=t.tileMask?1:0,o=t.masks.filter((function(t){return t.inited})),a=(i+=r?o.length:1)>1?W.MULTIPLE:W.SINGLE;if((t.tileMask||o.length&&r)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),o.length&&r){var s,u=ae(o);try{for(u.s();!(s=u.n()).done;)s.value.render({isStencil:!0,stencilType:a,stencilIndex:e++})}catch(t){u.e(t)}finally{u.f()}}t.tileMask&&t.tileMask.render({isStencil:!0,stencilType:a,stencilIndex:e++,stencilOperation:q.OR})}},{key:"renderTileLayer",value:(e=(0,k.Z)(I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.renderTileLayerMask(e),!e.getLayerConfig().enableMultiPassRenderer){t.next=6;break}return t.next=4,e.renderMultiPass();case 4:t.next=8;break;case 6:return t.next=8,e.render();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"updateLayerRenderList",value:function(){var t=this;this.layerList=[],this.layers.filter((function(t){return t.inited})).filter((function(t){return t.isVisible()})).sort((function(t,e){return t.zIndex-e.zIndex})).forEach((function(e){t.layerList.push(e)}))}},{key:"destroy",value:function(){this.layers.forEach((function(t){t.destroy()})),this.layers=[],this.layerList=[],this.emit("layerChange",this.layers)}},{key:"startAnimate",value:function(){0==this.animateInstanceCount++&&(this.clock.start(),this.runRender())}},{key:"stopAnimate",value:function(){0==--this.animateInstanceCount&&(this.stopRender(),this.clock.stop())}},{key:"getOESTextureFloat",value:function(){return this.renderService.extensionObject.OES_texture_float}},{key:"enableShaderPick",value:function(){this.shaderPicking=!0}},{key:"disableShaderPick",value:function(){this.shaderPicking=!1}},{key:"getShaderPickStat",value:function(){return this.shaderPicking}},{key:"clear",value:function(){var t=(0,y.rgb2arr)(this.mapService.bgColor);this.renderService.clear({color:t,depth:1,stencil:0,framebuffer:null})}},{key:"runRender",value:function(){this.renderLayers(),this.layerRenderID=y.$window.requestAnimationFrame(this.runRender.bind(this))}},{key:"stopRender",value:function(){y.$window.cancelAnimationFrame(this.layerRenderID)}}]),v}(i.EventEmitter),ee=(0,st.Z)(te.prototype,"renderService",[$t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ne=(0,st.Z)(te.prototype,"mapService",[Kt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),re=(0,st.Z)(te.prototype,"debugService",[Jt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qt=te))||Qt),$e=n(2718),Ke=function(){function t(e){var n=this;(0,c.Z)(this,t),(0,g.Z)(this,"name",void 0),(0,g.Z)(this,"type",void 0),(0,g.Z)(this,"scale",void 0),(0,g.Z)(this,"descriptor",void 0),(0,g.Z)(this,"featureBufferLayout",[]),(0,g.Z)(this,"needRescale",!1),(0,g.Z)(this,"needRemapping",!1),(0,g.Z)(this,"needRegenerateVertices",!1),(0,g.Z)(this,"featureRange",{startIndex:0,endIndex:1/0}),(0,g.Z)(this,"vertexAttribute",void 0),(0,g.Z)(this,"defaultCallback",(function(t){var e;return 0===t.length?(null===(e=n.scale)||void 0===e?void 0:e.defaultValues)||[]:t.map((function(t,e){var r;return(null===(r=n.scale)||void 0===r?void 0:r.scalers[e].func)(t)}))})),this.setProps(e)}return(0,h.Z)(t,[{key:"setProps",value:function(t){Object.assign(this,t)}},{key:"mapping",value:function(t){var e;if(null!==(e=this.scale)&&void 0!==e&&e.callback){var n,r=null===(n=this.scale)||void 0===n?void 0:n.callback.apply(n,(0,U.Z)(t));if(!(0,Q.isNil)(r))return[r]}return this.defaultCallback(t)}},{key:"resetDescriptor",value:function(){this.descriptor&&(this.descriptor.buffer.data=[])}}]),t}(),Je=["buffer","update","name"],Qe=["buffer","update","name"],tn=(ue={},(0,g.Z)(ue,kt.FLOAT,4),(0,g.Z)(ue,kt.UNSIGNED_BYTE,1),(0,g.Z)(ue,kt.UNSIGNED_SHORT,2),ue),en=(le=(0,a.b2)(),ce=(0,a.f3)(u.IRendererService),le((pe=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"attributesAndIndices",void 0),(0,at.Z)(this,"rendererService",fe,this),(0,g.Z)(this,"attributes",[]),(0,g.Z)(this,"triangulation",void 0),(0,g.Z)(this,"featureLayout",{sizePerElement:0,elements:[]})}return(0,h.Z)(t,[{key:"registerStyleAttribute",value:function(t){var e=this.getLayerStyleAttribute(t.name||"");return e?e.setProps(t):(e=new Ke(t),this.attributes.push(e)),e}},{key:"unRegisterStyleAttribute",value:function(t){var e=this.attributes.findIndex((function(e){return e.name===t}));e>-1&&this.attributes.splice(e,1)}},{key:"updateScaleAttribute",value:function(t){this.attributes.forEach((function(e){var n,r=e.name,i=null===(n=e.scale)||void 0===n?void 0:n.field;(t[r]||i&&t[i])&&(e.needRescale=!0,e.needRemapping=!0,e.needRegenerateVertices=!0)}))}},{key:"updateStyleAttribute",value:function(t,e,n){var r=this.getLayerStyleAttribute(t);r||(r=this.registerStyleAttribute((0,l.Z)((0,l.Z)({},e),{},{name:t})));var i=e.scale;i&&r&&(r.scale=i,r.needRescale=!0,r.needRemapping=!0,r.needRegenerateVertices=!0,n&&n.featureRange&&(r.featureRange=n.featureRange))}},{key:"getLayerStyleAttributes",value:function(){return this.attributes}},{key:"getLayerStyleAttribute",value:function(t){return this.attributes.find((function(e){return e.name===t}))}},{key:"getLayerAttributeScale",value:function(t){var e,n=this.getLayerStyleAttribute(t),r=null==n||null===(e=n.scale)||void 0===e?void 0:e.scalers;return r&&r[0]?r[0].func:null}},{key:"updateAttributeByFeatureRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=this.attributes.find((function(e){return e.name===t}));if(o&&o.descriptor){var a=o.descriptor,s=a.update,u=a.buffer,l=a.size,c=void 0===l?0:l,h=tn[u.type||kt.FLOAT];if(s){var p=this.featureLayout,f=p.elements,d=p.sizePerElement,m=f.slice(n,r);if(!m.length)return;var g=m[0].offset*c*h,y=m.map((function(t,n){for(var r=t.featureIdx,i=t.vertices,o=t.normals,a=i.length/d,u=[],l=0;l<a;l++){var c=o?o.slice(3*l,3*l+3):[];u.push.apply(u,(0,U.Z)(s(e[r],r,i.slice(l*d,l*d+d),n,c)))}return u})).reduce((function(t,e){return t.push.apply(t,(0,U.Z)(e)),t}),[]);o.vertexAttribute.updateBuffer({data:y,offset:g}),null==i||i.emit("legend:".concat(t),{type:t,attr:o})}}}},{key:"createAttributesAndIndices",value:function(t,e,n){var r=this;this.featureLayout={sizePerElement:0,elements:[]},e&&(this.triangulation=e);var i=this.attributes.map((function(t){return t.resetDescriptor(),t.descriptor})),o=0,a=0,s=[],u=3;t.forEach((function(t,e){var l=r.triangulation(t,n),c=l.indices,h=l.vertices,p=l.normals,f=l.size,d=l.indexes,m=l.count;"number"==typeof m&&(a+=m),c.forEach((function(t){s.push(t+o)})),u=f;var g=h.length/f;r.featureLayout.sizePerElement=u,r.featureLayout.elements.push({featureIdx:e,vertices:h,normals:p,offset:o}),o+=g;for(var y=function(n){var r=(null==p?void 0:p.slice(3*n,3*n+3))||[],o=h.slice(n*f,n*f+f),a=0;d&&void 0!==d[n]&&(a=d[n]),i.forEach((function(i,s){var u;i&&i.update&&(u=i.buffer.data).push.apply(u,(0,U.Z)(i.update(t,e,o,n,r,a)))}))},v=0;v<g;v++)y(v)}));var c=this.rendererService,h=c.createAttribute,p=c.createBuffer,f=c.createElements,d={};i.forEach((function(t,e){if(t){var n=t.buffer,i=(t.update,t.name,(0,$e.Z)(t,Je)),o=h((0,l.Z)({buffer:p(n)},i));d[t.name||""]=o,r.attributes[e].vertexAttribute=o}}));var m=f({data:s,type:kt.UNSIGNED_INT,count:s.length});return this.attributesAndIndices={attributes:d,elements:m,count:a},this.attributesAndIndices}},{key:"createAttributes",value:function(t,e){var n=this;this.featureLayout={sizePerElement:0,elements:[]},e&&(this.triangulation=e);var r=this.attributes.map((function(t){return t.resetDescriptor(),t.descriptor})),i=0,o=[],a=3;t.forEach((function(t,e){var s=n.triangulation(t),u=s.indices,l=s.vertices,c=s.normals,h=s.size,p=s.indexes;u.forEach((function(t){o.push(t+i)})),a=h;var f=l.length/h;n.featureLayout.sizePerElement=a,n.featureLayout.elements.push({featureIdx:e,vertices:l,normals:c,offset:i}),i+=f;for(var d=function(n){var i=(null==c?void 0:c.slice(3*n,3*n+3))||[],o=l.slice(n*h,n*h+h),a=0;p&&void 0!==p[n]&&(a=p[n]),r.forEach((function(r,s){var u;r&&r.update&&(u=r.buffer.data).push.apply(u,(0,U.Z)(r.update(t,e,o,n,i,a)))}))},m=0;m<f;m++)d(m)}));var s=this.rendererService,u=s.createAttribute,c=s.createBuffer,h={};return r.forEach((function(t,e){if(t){var r=t.buffer,i=(t.update,t.name,(0,$e.Z)(t,Qe)),o=u((0,l.Z)({buffer:c(r)},i));h[t.name||""]=o,n.attributes[e].vertexAttribute=o}})),{attributes:h}}},{key:"clearAllAttributes",value:function(){var t;this.attributes.forEach((function(t){t.vertexAttribute&&t.vertexAttribute.destroy()})),null===(t=this.attributesAndIndices)||void 0===t||t.elements.destroy(),this.attributes=[]}}]),t}(),fe=(0,st.Z)(pe.prototype,"rendererService",[ce],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),he=pe))||he),nn=n(5048),rn=n(1154),on=n.n(rn);var an,sn=(de=(0,a.b2)(),me=(0,a.f3)(u.SceneID),ge=(0,a.f3)(u.IIconService),ye=(0,a.f3)(u.IFontService),ve=(0,a.f3)(u.IControlService),_e=(0,a.f3)(u.IGlobalConfigService),be=(0,a.f3)(u.IMapService),xe=(0,a.f3)(u.ICoordinateSystemService),we=(0,a.f3)(u.IRendererService),Se=(0,a.f3)(u.ILayerService),Ee=(0,a.f3)(u.IDebugService),Me=(0,a.f3)(u.ICameraService),Te=(0,a.f3)(u.IInteractionService),Ae=(0,a.f3)(u.IPickingService),Ce=(0,a.f3)(u.IShaderModuleService),Oe=(0,a.f3)(u.IMarkerService),Pe=(0,a.f3)(u.IPopupService),de((Le=function(t){(0,f.Z)(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,m.Z)(r);if(i){var n=(0,m.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,d.Z)(this,t)});function a(){var t;return(0,c.Z)(this,a),t=o.call(this),(0,g.Z)((0,p.Z)(t),"destroyed",!1),(0,g.Z)((0,p.Z)(t),"loaded",!1),(0,at.Z)((0,p.Z)(t),"id",Ie,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"iconService",Re,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"fontService",De,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"controlService",Ne,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"configService",Fe,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"map",ze,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"coordinateSystemService",Be,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"rendererService",je,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"layerService",Ue,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"debugService",Ze,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"cameraService",Ve,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"interactionService",Ge,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"pickingService",He,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"shaderModuleService",We,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"markerService",qe,(0,p.Z)(t)),(0,at.Z)((0,p.Z)(t),"popupService",Ye,(0,p.Z)(t)),(0,g.Z)((0,p.Z)(t),"inited",!1),(0,g.Z)((0,p.Z)(t),"initPromise",void 0),(0,g.Z)((0,p.Z)(t),"rendering",!1),(0,g.Z)((0,p.Z)(t),"$container",void 0),(0,g.Z)((0,p.Z)(t),"canvas",void 0),(0,g.Z)((0,p.Z)(t),"markerContainer",void 0),(0,g.Z)((0,p.Z)(t),"hooks",void 0),(0,g.Z)((0,p.Z)(t),"handleWindowResized",(function(){t.emit("resize"),t.$container&&(t.initContainer(),y.DOM.triggerResize(),t.coordinateSystemService.needRefresh=!0,t.render())})),(0,g.Z)((0,p.Z)(t),"handleMapCameraChanged",(function(e){t.cameraService.update(e),t.render()})),t.hooks={init:new nn.sX},t}return(0,h.Z)(a,[{key:"init",value:function(t){var e=this;this.configService.setSceneConfig(this.id,t),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",(function(){return e.render()})),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,k.Z)(I().mark((function t(){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.debugService.log("map.mapInitStart",{type:e.map.version}),t.next=3,new Promise((function(t){e.map.onCameraChanged((function(n){e.cameraService.init(),e.cameraService.update(n),t()})),e.map.init()}));case 3:e.map.onCameraChanged(e.handleMapCameraChanged),e.map.addMarkerContainer(),e.markerService.addMarkers(),e.markerService.addMarkerLayers(),e.popupService.initPopup(),e.interactionService.init(),e.interactionService.on(wt.Drag,e.addSceneEvent.bind(e));case 10:case"end":return t.stop()}}),t)})))),this.hooks.init.tapPromise("initRenderer",(0,k.Z)(I().mark((function n(){var r,i;return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=e.map.getOverlayContainer(),e.$container=r||Yt(e.configService.getSceneConfig(e.id).id||""),!e.$container){n.next=13;break}return e.canvas=y.DOM.create("canvas","",e.$container),e.setCanvas(),n.next=7,e.rendererService.init(e.canvas,e.configService.getSceneConfig(e.id),t.gl);case 7:e.registerContextLost(),e.initContainer(),on()(e.$container,e.handleWindowResized),y.$window.matchMedia&&(null===(i=y.$window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"))||void 0===i||i.addListener(e.handleWindowResized)),n.next=14;break;case 13:console.error("容器 id 不存在");case 14:e.pickingService.init(e.id);case 15:case"end":return n.stop()}}),n)})))),this.render()}},{key:"registerContextLost",value:function(){var t=this,e=this.rendererService.getCanvas();e&&e.addEventListener("webglcontextlost",(function(){return t.emit("webglcontextlost")}))}},{key:"initMiniScene",value:function(t){var e=this;this.configService.setSceneConfig(this.id,t),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",(function(){return e.render()})),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,k.Z)(I().mark((function t(){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){e.map.onCameraChanged((function(n){e.cameraService.init(),e.cameraService.update(n),"GAODE2.x"!==e.map.version&&t()})),e.map.initMiniMap()}));case 2:e.map.onCameraChanged(e.handleMapCameraChanged),e.interactionService.init(),e.interactionService.on(wt.Drag,e.addSceneEvent.bind(e));case 5:case"end":return t.stop()}}),t)})))),this.hooks.init.tapPromise("initRenderer",(0,k.Z)(I().mark((function n(){var r;return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.canvas,e.$container=r||null,!e.$container){n.next=7;break}return n.next=5,e.rendererService.init(t.canvas,e.configService.getSceneConfig(e.id),void 0);case 5:n.next=8;break;case 7:console.error("容器 id 不存在");case 8:e.pickingService.init(e.id);case 9:case"end":return n.stop()}}),n)})))),this.initPromise=this.hooks.init.promise(),this.render()}},{key:"addLayer",value:function(t){this.layerService.sceneService=this,this.layerService.add(t)}},{key:"addMask",value:function(t){this.layerService.sceneService=this,this.layerService.addMask(t)}},{key:"render",value:(n=(0,k.Z)(I().mark((function t(){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.rendering&&!this.destroyed){t.next=2;break}return t.abrupt("return");case 2:if(this.rendering=!0,this.inited){t.next=16;break}return t.next=6,this.hooks.init.promise();case 6:return this.destroyed&&this.destroy(),t.next=9,this.layerService.initLayers();case 9:this.layerService.renderLayers(),this.controlService.addControls(),this.loaded=!0,this.emit("loaded"),this.inited=!0,t.next=20;break;case 16:return t.next=18,this.layerService.initLayers();case 18:return t.next=20,this.layerService.renderLayers();case 20:this.rendering=!1;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addFontFace",value:function(t,e){this.fontService.addFontFace(t,e)}},{key:"getSceneContainer",value:function(){return this.$container}},{key:"exportPng",value:(e=(0,k.Z)(I().mark((function t(e){var n,r,i;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null===(n=this.$container)||void 0===n?void 0:n.getElementsByTagName("canvas")[0],t.next=3,this.render();case 3:return i="jpg"===e?null==r?void 0:r.toDataURL("image/jpeg"):null==r?void 0:r.toDataURL("image/png"),t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"getSceneConfig",value:function(){return this.configService.getSceneConfig(this.id)}},{key:"getPointSizeRange",value:function(){return this.rendererService.getPointSizeRange()}},{key:"addMarkerContainer",value:function(){var t=this.$container.parentElement;null!==t&&(this.markerContainer=y.DOM.create("div","l7-marker-container",t))}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"destroy",value:function(){var t,e,n,r=this;this.inited?((0,rn.unbind)(this.$container,this.handleWindowResized),y.$window.matchMedia&&(null===(n=y.$window.matchMedia("screen and (min-resolution: 2dppx)"))||void 0===n||n.removeListener(this.handleWindowResized)),this.pickingService.destroy(),this.layerService.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.fontService.destroy(),this.iconService.destroy(),this.removeAllListeners(),this.inited=!1,this.map.destroy(),setTimeout((function(){var t;null===(t=r.$container)||void 0===t||t.removeChild(r.canvas),r.canvas=null,r.rendererService.destroy()})),null===(t=this.$container)||void 0===t||null===(e=t.parentNode)||void 0===e||e.removeChild(this.$container),this.emit("destroy")):this.destroyed=!0}},{key:"initContainer",value:function(){var t,e,n=y.DOM.DPR,r=(null===(t=this.$container)||void 0===t?void 0:t.clientWidth)||400,i=(null===(e=this.$container)||void 0===e?void 0:e.clientHeight)||300,o=this.canvas;o&&(o.width=r*n,o.height=i*n),this.rendererService.viewport({x:0,y:0,width:n*r,height:n*i})}},{key:"setCanvas",value:function(){var t,e,n=y.DOM.DPR,r=(null===(t=this.$container)||void 0===t?void 0:t.clientWidth)||400,i=(null===(e=this.$container)||void 0===e?void 0:e.clientHeight)||300,o=this.canvas;o.width=r*n,o.height=i*n,o.style.width="100%",o.style.height="100%"}},{key:"addSceneEvent",value:function(t){this.emit(t.type,t)}}]),a}(i.EventEmitter),Ie=(0,st.Z)(Le.prototype,"id",[me],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Re=(0,st.Z)(Le.prototype,"iconService",[ge],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),De=(0,st.Z)(Le.prototype,"fontService",[ye],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ne=(0,st.Z)(Le.prototype,"controlService",[ve],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fe=(0,st.Z)(Le.prototype,"configService",[_e],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ze=(0,st.Z)(Le.prototype,"map",[be],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Be=(0,st.Z)(Le.prototype,"coordinateSystemService",[xe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),je=(0,st.Z)(Le.prototype,"rendererService",[we],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ue=(0,st.Z)(Le.prototype,"layerService",[Se],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ze=(0,st.Z)(Le.prototype,"debugService",[Ee],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ve=(0,st.Z)(Le.prototype,"cameraService",[Me],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ge=(0,st.Z)(Le.prototype,"interactionService",[Te],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),He=(0,st.Z)(Le.prototype,"pickingService",[Ae],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),We=(0,st.Z)(Le.prototype,"shaderModuleService",[Ce],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qe=(0,st.Z)(Le.prototype,"markerService",[Oe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ye=(0,st.Z)(Le.prototype,"popupService",[Pe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ke=Le))||ke),un=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function ln(t){var e={};return{content:t=t.replace(un,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:e}}var cn,hn,pn="#define PI 3.14159265359",fn=/precision\s+(high|low|medium)p\s+float/,dn=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,mn=/void\s+main\s*\([^)]*\)\s*\{\n?/,gn=(0,a.b2)()(an=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"moduleCache",{}),(0,g.Z)(this,"rawContentCache",{})}return(0,h.Z)(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("common",{vs:pn,fs:pn}),this.registerModule("decode",{vs:"#define SHIFT_RIGHT17 1.0 / 131072.0\n#define SHIFT_RIGHT18 1.0 / 262144.0\n#define SHIFT_RIGHT19 1.0 / 524288.0\n#define SHIFT_RIGHT20 1.0 / 1048576.0\n#define SHIFT_RIGHT21 1.0 / 2097152.0\n#define SHIFT_RIGHT22 1.0 / 4194304.0\n#define SHIFT_RIGHT23 1.0 / 8388608.0\n#define SHIFT_RIGHT24 1.0 / 16777216.0\n\n#define SHIFT_LEFT17 131072.0\n#define SHIFT_LEFT18 262144.0\n#define SHIFT_LEFT19 524288.0\n#define SHIFT_LEFT20 1048576.0\n#define SHIFT_LEFT21 2097152.0\n#define SHIFT_LEFT22 4194304.0\n#define SHIFT_LEFT23 8388608.0\n#define SHIFT_LEFT24 16777216.0\n\nvec2 unpack_float(float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec4 decode_color(vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n",fs:""}),this.registerModule("projection",{vs:"#define TILE_SIZE 512.0\n#define PI 3.1415926536\n#define WORLD_SCALE TILE_SIZE / (PI * 2.0)\n\n#define COORDINATE_SYSTEM_LNGLAT 1.0 // mapbox\n#define COORDINATE_SYSTEM_LNGLAT_OFFSET 2.0 // mapbox offset\n#define COORDINATE_SYSTEM_VECTOR_TILE 3.0\n#define COORDINATE_SYSTEM_IDENTITY 4.0\n#define COORDINATE_SYSTEM_P20 5.0 // amap\n#define COORDINATE_SYSTEM_P20_OFFSET 6.0 // amap offset\n#define COORDINATE_SYSTEM_METER_OFFSET 7.0\n\n#define COORDINATE_SYSTEM_P20_2 8.0 // amap2.0\n\nuniform mat4 u_ViewMatrix;\nuniform mat4 u_ProjectionMatrix;\nuniform mat4 u_ViewProjectionMatrix;\nuniform float u_Zoom : 1;\nuniform float u_ZoomScale : 1;\n\nuniform float u_CoordinateSystem;\nuniform vec2 u_ViewportCenter;\nuniform vec4 u_ViewportCenterProjection;\nuniform vec3 u_PixelsPerDegree;\nuniform vec3 u_PixelsPerDegree2;\nuniform vec3 u_PixelsPerMeter;\n\nuniform vec2 u_ViewportSize;\nuniform float u_DevicePixelRatio;\nuniform float u_FocalDistance;\nuniform vec3 u_CameraPosition;\n\n// uniform mat4 u_Mvp;\n\n// web mercator coords -> world coords\nvec2 project_mercator(vec2 lnglat) {\n float x = lnglat.x;\n return vec2(\n radians(x) + PI,\n PI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\n\nfloat project_scale(float meters) {\n return meters * u_PixelsPerMeter.z;\n}\n\n\n// offset coords -> world coords\nvec4 project_offset(vec4 offset) {\n float dy = offset.y;\n dy = clamp(dy, -1., 1.);\n vec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy;\n return vec4(offset.xyz * pixels_per_unit, offset.w);\n}\n\nvec3 project_normal(vec3 normal) {\n vec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0);\n return normalize(normal_modelspace.xyz * u_PixelsPerMeter);\n}\n\nvec3 project_offset_normal(vec3 vector) {\n if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01\n || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // normals generated by the polygon tesselator are in lnglat offsets instead of meters\n return normalize(vector * u_PixelsPerDegree);\n }\n return project_normal(vector);\n}\n// || u_CoordinateSystem < COORDINATE_SYSTEM_P20_OFFSET + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_P20_OFFSET - 0.01\n// reverse Y\nvec3 reverse_offset_normal(vec3 vector) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 ||u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET ) {\n return vector * vec3(1.0, -1.0, 1.0);\n }\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0\n return vector;\n }\n return vector;\n}\n\nvec4 project_mvt_offset_position(vec4 position) {\n float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;\n float b = COORDINATE_SYSTEM_P20_OFFSET;\n float c = COORDINATE_SYSTEM_LNGLAT;\n if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n return project_offset(vec4(0.0, 0.0, position.z, position.w));\n }\n if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {\n return vec4(\n project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,\n project_scale(position.z),\n position.w\n );\n }\n return position;\n}\n\nvec4 project_position(vec4 position) {\n float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;\n float b = COORDINATE_SYSTEM_P20_OFFSET;\n float c = COORDINATE_SYSTEM_LNGLAT;\n if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n float X = position.x - u_ViewportCenter.x;\n float Y = position.y - u_ViewportCenter.y;\n return project_offset(vec4(X, Y, position.z, position.w));\n }\n if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {\n return vec4(\n project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,\n project_scale(position.z),\n position.w\n );\n }\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {\n return vec4(\n (project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale - vec2(215440491., 106744817.)) * vec2(1., -1.),\n project_scale(position.z),\n position.w\n );\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // return vec4(\n // (position.xy * WORLD_SCALE * u_ZoomScale) * vec2(1., -1.), \n // project_scale(position.z), \n // position.w);\n\n return vec4(\n position.xy, \n project_scale(position.z), \n position.w);\n }\n return position;\n\n // TODO: 瓦片坐标系 & 常规世界坐标系\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0;\n return offset * u_FocalDistance;\n}\n\nfloat project_pixel_allmap(float pixel) {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return pixel * pow(2.0, u_Zoom);\n }\n return pixel * u_FocalDistance ;\n}\n\n// 适配纹理贴图的等像素大小\nfloat project_pixel_texture(float pixel) {\n // mapbox zoom > 12\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n return pixel * pow(0.5, u_Zoom) * u_FocalDistance ;\n }\n\n // amap2 zoom > 12\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;\n }\n\n // amap zoom > 12\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n return pixel * pow(0.5, u_Zoom)* u_FocalDistance ;\n }\n \n // amap zoom < 12\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {\n return pixel * pow(2.0, (20.0 - u_Zoom))* u_FocalDistance ;\n }\n return pixel * 2.0 * u_FocalDistance;;\n}\n\n// 在不论什么底图下需要统一处理的时候使用\nfloat project_float_pixel(float pixel) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // mapbox P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;\n }\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // amap P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, (19.0 - u_Zoom));\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // amap2 P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3\n return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;\n }\n return pixel * u_FocalDistance;\n}\n\nfloat project_pixel(float pixel) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // amap P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // amap2 P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3\n return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;\n }\n return pixel * u_FocalDistance;\n}\nvec2 project_pixel(vec2 pixel) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3\n return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;\n }\n return pixel * -1. * u_FocalDistance;\n}\nvec3 project_pixel(vec3 pixel) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3\n return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;\n }\n return pixel * -1. * u_FocalDistance;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n position.w *= u_PixelsPerMeter.z;\n }\n\n return viewProjectionMatrix * position + center;\n}\n\n// Projects from common space coordinates to clip space\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(\n position,\n u_ViewProjectionMatrix,\n u_ViewportCenterProjection\n );\n}\n\nvec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) {\n vec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection);\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n pos.w = pos.w / u_PixelsPerMeter.z;\n }\n return pos;\n}\n\n\nbool isEqual( float a, float b) {\n return a< b + 0.001 && a > b - 0.001;\n}",fs:""}),this.registerModule("project",{vs:"\n#define E 2.718281828459045\nvec2 ProjectFlat(vec2 lnglat){\n float maxs=85.0511287798;\n float lat=max(min(maxs,lnglat.y),-maxs);\n float scale= 268435456.;\n float d=PI/180.;\n float x=lnglat.x*d;\n float y=lat*d;\n y=log(tan((PI/4.)+(y/2.)));\n\n float a=.5/PI,\n b=.5,\n c=-.5/PI;\n d=.5;\n x=scale*(a*x+b);\n y=scale*(c*y+d);\n return vec2(x,y);\n}\n\nvec2 unProjectFlat(vec2 px){\n float a=.5/PI;\n float b=.5;\n float c=-.5/PI;\n float d=.5;\n float scale = 268435456.;\n float x=(px.x/scale-b)/a;\n float y=(px.y/scale-d)/c;\n y=(atan(pow(E,y))-(PI/4.))*2.;\n d=PI/180.;\n float lat=y/d;\n float lng=x/d;\n return vec2(lng,lat);\n}\n\nfloat pixelDistance(vec2 from, vec2 to) {\n vec2 a1 = ProjectFlat(from);\n vec2 b1 = ProjectFlat(to);\n return distance(a1, b1);\n}\n\n// gaode2.0\nvec2 customProject(vec2 lnglat) { // 经纬度 => 平面坐标\n float t = lnglat.x;\n float e = lnglat.y;\n float Sm = 180.0 / PI;\n float Tm = 6378137.0;\n float Rm = PI / 180.0;\n float r = 85.0511287798;\n e = max(min(r, e), -r);\n t *= Rm;\n e *= Rm;\n e = log(tan(PI / 4.0 + e / 2.0));\n return vec2(t * Tm, e * Tm);\n}\n\nvec2 unProjCustomCoord(vec2 point) { // 平面坐标 => 经纬度\n float Sm = 57.29577951308232; //180 / Math.PI\n float Tm = 6378137.0;\n float t = point.x;\n float e = point.y;\n return vec2(t / Tm * Sm, (2.0 * atan(exp(e / Tm)) - PI / 2.0) * Sm);\n}\n\n\nfloat customPixelDistance(vec2 from, vec2 to) {\n vec2 a1 = ProjectFlat(from);\n vec2 b1 = ProjectFlat(to);\n return distance(a1, b1);\n}",fs:""}),this.registerModule("sdf_2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}\n"}),this.registerModule("lighting",{vs:"// Blinn-Phong model\n// apply lighting in vertex shader instead of fragment shader\n// @see https://learnopengl.com/Advanced-Lighting/Advanced-Lighting\nuniform float u_Ambient : 1.0;\nuniform float u_Diffuse : 1.0;\nuniform float u_Specular : 1.0;\nuniform int u_NumOfDirectionalLights : 1;\nuniform int u_NumOfSpotLights : 0;\n\n#define SHININESS 32.0\n#define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3\n#define MAX_NUM_OF_SPOT_LIGHTS 3\n\nstruct DirectionalLight {\n vec3 direction;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n};\n\nstruct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n float constant;\n float linear;\n float quadratic;\n float angle;\n float blur;\n float exponent;\n};\n\nuniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS];\nuniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS];\n\nvec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {\n vec3 lightDir = normalize(light.direction);\n // diffuse shading\n float diff = max(dot(normal, lightDir), 0.0);\n // Blinn-Phong specular shading\n vec3 halfwayDir = normalize(lightDir + viewDir);\n float spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS);\n\n vec3 ambient = light.ambient * u_Ambient;\n vec3 diffuse = light.diffuse * diff * u_Diffuse;\n vec3 specular = light.specular * spec * u_Specular;\n\n return ambient + diffuse + specular;\n}\n\n// vec3 calc_spot_light(SpotLight light, vec3 normal, vec3 fragPos, vec3 viewDir) {\n// vec3 lightDir = normalize(light.position - fragPos);\n// // diffuse shading\n// float diff = max(dot(normal, lightDir), 0.0);\n// // specular shading\n// vec3 reflectDir = reflect(-lightDir, normal);\n// float spec = pow(max(dot(viewDir, reflectDir), 0.0), SHININESS);\n// // attenuation\n// float distance = length(light.position - fragPos);\n// float attenuation = 1.0 / (light.constant + light.linear * distance +\n// light.quadratic * (distance * distance));\n\n// vec3 ambient = light.ambient * u_Ambient;\n// vec3 diffuse = light.diffuse * diff * u_Diffuse;\n// vec3 specular = light.specular * spec * u_Specular;\n\n// float spotEffect = dot(normalize(light.direction), -lightDir);\n// float spotCosCutoff = cos(light.angle / 180.0 * PI);\n// float spotCosOuterCutoff = cos((light.angle + light.blur) / 180.0 * PI);\n// float spotCosInnerCutoff = cos((light.angle - light.blur) / 180.0 * PI);\n// if (spotEffect > spotCosCutoff) {\n// spotEffect = pow(smoothstep(spotCosOuterCutoff, spotCosInnerCutoff, spotEffect), light.exponent);\n// } else {\n// spotEffect = 0.0;\n// }\n\n// return ambient + attenuation * (spotEffect * diffuse + specular);\n// }\n\nvec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {\n vec3 weight = vec3(0.0);\n for (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) {\n if (i >= u_NumOfDirectionalLights) {\n break;\n }\n weight += calc_directional_light(u_DirectionalLights[i], normal, viewDir);\n }\n // for (int i = 0; i < MAX_NUM_OF_SPOT_LIGHTS; i++) {\n // if (i >= u_NumOfSpotLights) {\n // break;\n // }\n // weight += calc_spot_light(u_SpotLights[i], normal, position, viewDir);\n // }\n return weight;\n}\n",fs:""}),this.registerModule("light",{vs:"#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\n\nfloat calc_lighting(vec4 pos) {\n\n vec3 worldPos = vec3(pos * u_ModelMatrix);\n\n vec3 worldNormal = a_Normal;\n // //cal light weight\n vec3 viewDir = normalize(u_CameraPosition - worldPos);\n\n vec3 lightDir = normalize(vec3(1, -10.5, 12));\n\n vec3 halfDir = normalize(viewDir+lightDir);\n // //lambert\n float lambert = dot(worldNormal, lightDir);\n //specular\n float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\n //sum to light weight\n float lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular;\n\n return lightWeight;\n}\n",fs:""}),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec3 u_CurrentSelectedId : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform vec4 u_SelectColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\nuniform float u_shaderPick;\nuniform float u_EnableSelect: 0.0;\n\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n#define NORMAL 0.0\n#define HIGHLIGHT 1.0\n#define SELECT 2.0\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\n// 判断当前点是否已经被 select 选中\nbool isVertexSelected(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_CurrentSelectedId.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_CurrentSelectedId.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_CurrentSelectedId.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n if(u_shaderPick < 0.5) {\n return;\n }\n // compares only in highlight stage\n\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // if (u_EnableSelect == 1.0 && u_PickingStage == PICKING_HIGHLIGHT && isVertexSelected(pickingColor)) {\n // // 选中态\n // v_PickingResult.a = SELECT;\n // } else if (u_PickingStage == PICKING_HIGHLIGHT && isVertexPicked(pickingColor)) {\n // // 高亮态\n // v_PickingResult.a = HIGHLIGHT;\n // } else {\n // v_PickingResult.a = NORMAL;\n // }\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}\n\nfloat setPickingOrder(float z) {\n bool selected = bool(v_PickingResult.a);\n return selected ? z + 1. : 0.;\n}\n",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform vec4 u_SelectColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_shaderPick;\n\nuniform float u_activeMix: 0;\n\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n#define HIGHLIGHT 1.0\n#define SELECT 2.0\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color, float weight) {\n // float selected = v_PickingResult.a;\n bool selected = bool(v_PickingResult.a);\n\n // if (selected == SELECT) {\n if (selected) {\n // // 点击选中状态\n // vec4 selectColor = u_SelectColor * COLOR_SCALE;\n // return selectColor;\n // } else if (selected == HIGHLIGHT) {\n // // hover 高亮状态\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(mix(resultRGB * weight, color.rgb, u_activeMix), color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n // 过滤多余的 shader 计算\n // return color;\n if(u_shaderPick < 0.5) {\n return color; // 暂时去除 直接取消计算在选中时拖拽地图会有问题\n } else {\n return filterPickingColor(filterHighlightColor(color, 1.0));\n }\n \n}\n\nvec4 filterColorAlpha(vec4 color, float alpha) {\n // 过滤多余的 shader 计算\n // return color;\n if(u_shaderPick < 0.5) {\n return color; // 暂时去除 直接取消计算在选中时拖拽地图会有问题\n } else {\n return filterPickingColor(filterHighlightColor(color, alpha));\n }\n}\n\n"}),this.registerModule("commom_attr_vert",{vs:"#ifdef USE_ATTRIBUTE_OPACITY\n attribute float a_Opacity;\n#endif\n\n#ifdef USE_ATTRIBUTE_OFFSETS\n attribute vec2 a_Offsets;\n#endif\n\n#ifdef USE_ATTRIBUTE_STROKE\n attribute vec4 a_Stroke;\n#endif",fs:""}),this.registerModule("opacity_attr_vert",{vs:"float opacity = u_opacity;\n\n#ifdef USE_ATTRIBUTE_OPACITY\n opacity = a_Opacity;\n#endif",fs:""})}},{key:"registerModule",value:function(t,e){var n=e.vs,r=e.fs,i=e.uniforms,o=e.inject,a=ln(n),s=a.content,u=a.uniforms,c=ln(r),h=c.content,p=c.uniforms;this.rawContentCache[t]={fs:h,inject:o,uniforms:(0,l.Z)((0,l.Z)((0,l.Z)({},u),p),i),vs:s}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this,n=this.rawContentCache[t].vs,r=this.rawContentCache[t].fs,i=this.rawContentCache[t].inject,o={};null!=i&&i["vs:#decl"]&&(n=(null==i?void 0:i["vs:#decl"])+n,o=ln(null==i?void 0:i["vs:#decl"]).uniforms),null!=i&&i["vs:#main-start"]&&(n=n.replace(mn,(function(t){return t+(null==i?void 0:i["vs:#main-start"])})));var a=this.processModule(n,[],"vs"),s=a.content,u=a.includeList,c=this.processModule(r,[],"fs"),h=c.content,p=c.includeList,f="",d=(0,Q.uniq)(u.concat(p).concat(t)).reduce((function(t,n){return(0,l.Z)((0,l.Z)({},t),e.rawContentCache[n].uniforms)}),(0,l.Z)({},o));return fn.test(h)||(f+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"),f+=h,this.moduleCache[t]={fs:f.trim(),uniforms:d,vs:s.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(dn,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a,e,n).content})),includeList:e}}},{key:"injectDefines",value:function(t){return Object.keys(t).reduce((function(e,n){return e+"#define ".concat(n.toUpperCase()," ").concat(t[n],";\n")}),"\n")}}]),t}())||an,yn=n(9458);!function(t){t.Normal="normal",t.PostProcessing="post-processing"}(cn||(cn={}));var vn,_n=(0,a.b2)()(hn=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"shaderModuleService",void 0),(0,g.Z)(this,"rendererService",void 0),(0,g.Z)(this,"cameraService",void 0),(0,g.Z)(this,"mapService",void 0),(0,g.Z)(this,"interactionService",void 0),(0,g.Z)(this,"layerService",void 0),(0,g.Z)(this,"config",void 0)}return(0,h.Z)(t,[{key:"getName",value:function(){return""}},{key:"getType",value:function(){return cn.Normal}},{key:"init",value:function(t,e){this.config=e,this.rendererService=t.getContainer().get(u.IRendererService),this.cameraService=t.getContainer().get(u.ICameraService),this.mapService=t.getContainer().get(u.IMapService),this.interactionService=t.getContainer().get(u.IInteractionService),this.layerService=t.getContainer().get(u.ILayerService),this.shaderModuleService=t.getContainer().get(u.IShaderModuleService)}},{key:"render",value:function(t){}}]),t}())||hn;var bn,xn,wn,Sn,En,Mn=(0,a.b2)()(vn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"getName",value:function(){return"clear"}},{key:"init",value:function(t,e){(0,yn.Z)((0,m.Z)(i.prototype),"init",this).call(this,t,e)}},{key:"render",value:function(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}]),i}(_n))||vn;function Tn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return An(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?An(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Cn,On=(bn=(0,a.b2)(),xn=(0,a.f3)(u.IPostProcessor),bn((Sn=function(){function t(){(0,c.Z)(this,t),(0,g.Z)(this,"passes",[]),(0,at.Z)(this,"postProcessor",En,this),(0,g.Z)(this,"layer",void 0),(0,g.Z)(this,"renderFlag",void 0),(0,g.Z)(this,"width",0),(0,g.Z)(this,"height",0)}var e;return(0,h.Z)(t,[{key:"setLayer",value:function(t){this.layer=t}},{key:"setRenderFlag",value:function(t){this.renderFlag=t}},{key:"getRenderFlag",value:function(){return this.renderFlag}},{key:"getPostProcessor",value:function(){return this.postProcessor}},{key:"render",value:(e=(0,k.Z)(I().mark((function t(){var e,n,r;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=Tn(this.passes),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=9;break}return r=n.value,t.next=7,r.render(this.layer);case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:return t.next=19,this.postProcessor.render(this.layer);case 19:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))),function(){return e.apply(this,arguments)})},{key:"resize",value:function(t,e){this.width===t&&this.height===e||(this.postProcessor.resize(t,e),this.width=t,this.height=e)}},{key:"add",value:function(t,e){t.getType()===cn.PostProcessing?this.postProcessor.add(t,this.layer,e):(t.init(this.layer,e),this.passes.push(t))}},{key:"insert",value:function(t,e,n){t.init(this.layer,e),this.passes.splice(n,0,t)}},{key:"destroy",value:function(){this.passes.length=0}}]),t}(),En=(0,st.Z)(Sn.prototype,"postProcessor",[xn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wn=Sn))||wn);var Pn,kn,Ln,In,Rn,Dn,Nn=(0,a.b2)()(Cn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,c.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,g.Z)((0,p.Z)(t),"pickingFBO",void 0),(0,g.Z)((0,p.Z)(t),"layer",void 0),(0,g.Z)((0,p.Z)(t),"width",0),(0,g.Z)((0,p.Z)(t),"height",0),(0,g.Z)((0,p.Z)(t),"alreadyInRendering",!1),(0,g.Z)((0,p.Z)(t),"pickFromPickingFBO",(function(e){var n=e.x,r=e.y,i=e.lngLat,o=e.type;if(t.layer.isVisible()&&t.layer.needPick(o)){var a,s=t.rendererService,u=s.getViewportSize,c=s.readPixels,h=s.useFramebuffer,p=u(),f=p.width,d=p.height,m=t.layer.getLayerConfig(),g=m.enableHighlight,v=m.enableSelect,_=n*y.DOM.DPR,b=r*y.DOM.DPR;_>f||_<0||b>d||b<0||h(t.pickingFBO,(function(){var e;if(0!==(a=c({x:Math.round(_),y:Math.round(d-(r+1)*y.DOM.DPR),width:1,height:1,data:new Uint8Array(4),framebuffer:t.pickingFBO}))[0]||0!==a[1]||0!==a[2]){var s=(0,y.decodePickingColor)(a),u=t.layer.getSource().getFeatureById(s),h={x:n,y:r,type:o,lngLat:i,featureId:s,feature:u};u&&(t.layer.setCurrentPickId(s),t.triggerHoverOnLayer(h))}else{var p={x:n,y:r,lngLat:i,type:null===t.layer.getCurrentPickId()?"un"+o:"mouseout",featureId:null,feature:null};t.triggerHoverOnLayer((0,l.Z)((0,l.Z)({},p),{},{type:"unpick"})),t.triggerHoverOnLayer(p),t.layer.setCurrentPickId(null)}g&&t.highlightPickedFeature(a),v&&"click"===o&&(null===(e=a)||void 0===e?void 0:e.toString())!==[0,0,0,0].toString()&&t.selectFeature(a)}))}})),t}return(0,h.Z)(i,[{key:"getType",value:function(){return cn.Normal}},{key:"getName",value:function(){return"pixelPicking"}},{key:"init",value:function(t,e){(0,yn.Z)((0,m.Z)(i.prototype),"init",this).call(this,t,e),this.layer=t;var n=this.rendererService,r=n.createTexture2D,o=n.createFramebuffer,a=(0,n.getViewportSize)(),s=a.width,u=a.height;this.pickingFBO=o({color:r({width:s,height:u,wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})}),this.interactionService.on(wt.Hover,this.pickFromPickingFBO),this.interactionService.on(wt.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(wt.Active,this.highlightFeatureHandle.bind(this))}},{key:"render",value:function(t){var e=this;if(!this.alreadyInRendering){var n=this.rendererService,r=n.getViewportSize,i=n.useFramebuffer,o=n.clear,a=r(),s=a.width,u=a.height;this.alreadyInRendering=!0,this.width===s&&this.height===u||(this.pickingFBO.resize({width:s,height:u}),this.width=s,this.height=u),i(this.pickingFBO,(function(){o({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n=e.layer.multiPassRenderer.getRenderFlag();e.layer.multiPassRenderer.setRenderFlag(!1),t.hooks.beforePickingEncode.call(),t.render(),t.hooks.afterPickingEncode.call(),e.layer.multiPassRenderer.setRenderFlag(n),e.alreadyInRendering=!1}))}}},{key:"triggerHoverOnLayer",value:function(t){this.layer.emit(t.type,t)}},{key:"highlightPickedFeature",value:function(t){var e=(0,z.Z)(t,3),n=e[0],r=e[1],i=e[2];this.layer.hooks.beforeHighlight.call([n,r,i]),this.layerService.renderLayers()}},{key:"selectFeature",value:function(t){var e=(0,z.Z)(t,3),n=e[0],r=e[1],i=e[2];this.layer.hooks.beforeSelect.call([n,r,i]),this.layerService.renderLayers()}},{key:"selectFeatureHandle",value:function(t){var e=t.featureId,n=(0,y.encodePickingColor)(e);this.selectFeature(new Uint8Array(n))}},{key:"highlightFeatureHandle",value:function(t){var e=t.featureId,n=(0,y.encodePickingColor)(e);this.highlightPickedFeature(new Uint8Array(n))}}]),i}(_n))||Cn,Fn=(Pn=(0,a.b2)(),kn=(0,a.f3)(u.IShaderModuleService),Pn((In=function(){function t(){(0,c.Z)(this,t),(0,at.Z)(this,"shaderModuleService",Rn,this),(0,g.Z)(this,"rendererService",void 0),(0,g.Z)(this,"config",void 0),(0,g.Z)(this,"quad","attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}"),(0,g.Z)(this,"enabled",!0),(0,g.Z)(this,"renderToScreen",!1),(0,g.Z)(this,"model",void 0),(0,g.Z)(this,"name",void 0),(0,g.Z)(this,"optionsToUpdate",{})}return(0,h.Z)(t,[{key:"getName",value:function(){return this.name}},{key:"setName",value:function(t){this.name=t}},{key:"getType",value:function(){return cn.PostProcessing}},{key:"init",value:function(t,e){this.config=e,this.rendererService=t.getContainer().get(u.IRendererService),this.shaderModuleService=t.getContainer().get(u.IShaderModuleService);var n=this.rendererService,r=n.createAttribute,i=n.createBuffer,o=n.createModel,a=this.setupShaders(),s=a.vs,c=a.fs,h=a.uniforms;this.model=o({vs:s,fs:c,attributes:{a_Position:r({buffer:i({data:[-4,-4,4,-4,0,4],type:kt.FLOAT}),size:2})},uniforms:(0,l.Z)((0,l.Z)({u_Texture:null},h),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:"copy"===this.getName()}})}},{key:"render",value:function(t,e){var n=this,r=t.multiPassRenderer.getPostProcessor(),i=this.rendererService,o=i.useFramebuffer,a=i.getViewportSize,s=i.clear,u=a(),c=u.width,h=u.height;o(this.renderToScreen?null:r.getWriteFBO(),(function(){s({framebuffer:r.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});var t=(0,l.Z)({u_BloomFinal:0,u_Texture:r.getReadFBO(),u_ViewportSize:[c,h]},n.convertOptionsToUniforms(n.optionsToUpdate));e&&(t.u_BloomFinal=1,t.u_Texture2=e),n.model.draw({uniforms:t})}))}},{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(t){this.enabled=t}},{key:"setRenderToScreen",value:function(t){this.renderToScreen=t}},{key:"updateOptions",value:function(t){this.optionsToUpdate=(0,l.Z)((0,l.Z)({},this.optionsToUpdate),t)}},{key:"setupShaders",value:function(){throw new Error("Method not implemented.")}},{key:"convertOptionsToUniforms",value:function(t){var e={};return Object.keys(t).forEach((function(n){(0,Q.isNil)(t[n])||(e["u_".concat((0,Q.upperFirst)((0,Q.camelCase)(n)))]=t[n])})),e}}]),t}(),Rn=(0,st.Z)(In.prototype,"shaderModuleService",[kn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ln=In))||Ln);var zn,Bn=(0,a.b2)()(Dn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform float u_BloomFinal: 0.0;\nuniform sampler2D u_Texture;\nuniform sampler2D u_Texture2;\n\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform float u_radius: 5.0;\nuniform float u_intensity: 0.3;\nuniform float u_baseRadio: 0.5;\n\n// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl\nvec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 off1 = vec2(1.3846153846) * direction;\n vec2 off2 = vec2(3.2307692308) * direction;\n color += texture2D(image, uv) * 0.2270270270;\n color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n return color;\n}\n\nfloat luminance(vec4 color) {\n return 0.2125 * color.r + 0.7154 * color.g + 0.0721 * color.b;\n}\n\nvoid main() {\n // vec4 baseColor = texture2D(u_Texture, v_UV);\n\n float r = sqrt(u_radius);\n\n vec4 c1 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(u_radius, 0.0));\n // c1 *= luminance(c1);\n vec4 c2 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(0.0, u_radius));\n // c2 *= luminance(c2);\n vec4 c3 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, r));\n // c3 *= luminance(c3);\n vec4 c4 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, -r));\n // c4 *= luminance(c4);\n vec4 inbloomColor = (c1 + c2 + c3 + c4) * 0.25;\n\n // float lum = luminance(inbloomColor);\n // inbloomColor.rgb *= lum;\n\n if(u_BloomFinal > 0.0) {\n vec4 baseColor = texture2D(u_Texture2, v_UV);\n float baselum = luminance(baseColor);\n gl_FragColor = mix(inbloomColor, baseColor, u_baseRadio);\n if(baselum <= 0.2) {\n gl_FragColor = inbloomColor * u_intensity;\n }\n } else {\n gl_FragColor = inbloomColor;\n }\n}"});var t=this.shaderModuleService.getModule("blur-pass"),e=t.vs,n=t.fs,r=t.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:e,fs:n,uniforms:(0,l.Z)((0,l.Z)({},r),{},{u_ViewportSize:[o,a]})}}},{key:"convertOptionsToUniforms",value:function(t){var e={};return(0,Q.isNil)(t.bloomRadius)||(e.u_radius=t.bloomRadius),(0,Q.isNil)(t.bloomIntensity)||(e.u_intensity=t.bloomIntensity),(0,Q.isNil)(t.bloomBaseRadio)||(e.u_baseRadio=t.bloomBaseRadio),e}}]),i}(Fn))||Dn;var jn,Un=(0,a.b2)()(zn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_BlurDir: [1.0, 0.0];\n\n// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl\nvec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 off1 = vec2(1.3846153846) * direction;\n vec2 off2 = vec2(3.2307692308) * direction;\n color += texture2D(image, uv) * 0.2270270270;\n color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n return color;\n}\n\nvoid main() {\n gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);\n}"});var t=this.shaderModuleService.getModule("blur-pass"),e=t.vs,n=t.fs,r=t.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:e,fs:n,uniforms:(0,l.Z)((0,l.Z)({},r),{},{u_ViewportSize:[o,a]})}}},{key:"convertOptionsToUniforms",value:function(t){var e={};return(0,Q.isNil)(t.blurRadius)||(e.u_BlurDir=[t.blurRadius,0]),e}}]),i}(Fn))||zn;var Zn,Vn=(0,a.b2)()(jn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_BlurDir: [1.0, 0.0];\n\n// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl\nvec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 off1 = vec2(1.3846153846) * direction;\n vec2 off2 = vec2(3.2307692308) * direction;\n color += texture2D(image, uv) * 0.2270270270;\n color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n return color;\n}\n\nvoid main() {\n gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);\n}"});var t=this.shaderModuleService.getModule("blur-pass"),e=t.vs,n=t.fs,r=t.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:e,fs:n,uniforms:(0,l.Z)((0,l.Z)({},r),{},{u_ViewportSize:[o,a]})}}},{key:"convertOptionsToUniforms",value:function(t){var e={};return(0,Q.isNil)(t.blurRadius)||(e.u_BlurDir=[0,t.blurRadius]),e}}]),i}(Fn))||jn;var Gn,Hn=(0,a.b2)()(Zn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:'varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_Center : [0.5, 0.5];\nuniform float u_Angle : 0;\nuniform float u_Size : 8;\n\n#pragma include "common"\n\nfloat scale = PI / u_Size;\n\nfloat pattern(float u_Angle, vec2 texSize, vec2 texCoord) {\n float s = sin(u_Angle), c = cos(u_Angle);\n vec2 tex = texCoord * texSize - u_Center * texSize;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/colorhalftone.js\nvec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n vec3 cmy = 1.0 - color.rgb;\n float k = min(cmy.x, min(cmy.y, cmy.z));\n cmy = (cmy - k) / (1.0 - k);\n cmy = clamp(\n cmy * 10.0 - 3.0 + vec3(\n pattern(u_Angle + 0.26179, texSize, texCoord),\n pattern(u_Angle + 1.30899, texSize, texCoord),\n pattern(u_Angle, texSize, texCoord)\n ),\n 0.0,\n 1.0\n );\n k = clamp(k * 10.0 - 5.0 + pattern(u_Angle + 0.78539, texSize, texCoord), 0.0, 1.0);\n return vec4(1.0 - cmy - k, color.a);\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = colorHalftone_filterColor(gl_FragColor, u_ViewportSize, v_UV);\n}'});var t=this.shaderModuleService.getModule("colorhalftone-pass"),e=t.vs,n=t.fs,r=t.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:e,fs:n,uniforms:(0,l.Z)((0,l.Z)({},r),{},{u_ViewportSize:[o,a]})}}}]),i}(Fn))||Zn;var Wn,qn=(0,a.b2)()(Gn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("copy-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}"}),this.shaderModuleService.getModule("copy-pass")}}]),i}(Fn))||Gn;var Yn,Xn=(0,a.b2)()(Wn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_Center : [0.5, 0.5];\nuniform float u_Scale : 10;\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/hexagonalpixelate.js\nvec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 tex = (texCoord * texSize - u_Center * texSize) / u_Scale;\n tex.y /= 0.866025404;\n tex.x -= tex.y * 0.5;\n vec2 a;\n if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {\n a = vec2(floor(tex.x), floor(tex.y));\n }\n else a = vec2(ceil(tex.x), ceil(tex.y));\n vec2 b = vec2(ceil(tex.x), floor(tex.y));\n vec2 c = vec2(floor(tex.x), ceil(tex.y));\n vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);\n vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);\n vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);\n vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);\n float alen = length(TEX - A);\n float blen = length(TEX - B);\n float clen = length(TEX - C);\n vec2 choice;\n if (alen < blen) {\n if (alen < clen) choice = a;\n else choice = c;\n } else {\n if (blen < clen) choice = b;\n else choice = c;\n }\n choice.x += choice.y * 0.5;\n choice.y *= 0.866025404;\n choice *= u_Scale / texSize;\n return texture2D(texture, choice + u_Center);\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = hexagonalPixelate_sampleColor(u_Texture, u_ViewportSize, v_UV);\n}"});var t=this.shaderModuleService.getModule("hexagonalpixelate-pass"),e=t.vs,n=t.fs,r=t.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:e,fs:n,uniforms:(0,l.Z)((0,l.Z)({},r),{},{u_ViewportSize:[o,a]})}}}]),i}(Fn))||Wn;var $n,Kn=(0,a.b2)()(Yn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("ink-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform float u_Strength : 0.6;\n\nvec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 dx = vec2(1.0 / texSize.x, 0.0);\n vec2 dy = vec2(0.0, 1.0 / texSize.y);\n vec4 color = texture2D(texture, texCoord);\n float bigTotal = 0.0;\n float smallTotal = 0.0;\n vec3 bigAverage = vec3(0.0);\n vec3 smallAverage = vec3(0.0);\n for (float x = -2.0; x <= 2.0; x += 1.0) {\n for (float y = -2.0; y <= 2.0; y += 1.0) {\n vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;\n bigAverage += sample;\n bigTotal += 1.0;\n if (abs(x) + abs(y) < 2.0) {\n smallAverage += sample;\n smallTotal += 1.0;\n }\n }\n }\n vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);\n float power = u_Strength * u_Strength * u_Strength * u_Strength * u_Strength;\n return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = ink_sampleColor(u_Texture, u_ViewportSize, v_UV);\n}"});var t=this.shaderModuleService.getModule("ink-pass"),e=t.vs,n=t.fs,r=t.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:e,fs:n,uniforms:(0,l.Z)((0,l.Z)({},r),{},{u_ViewportSize:[o,a]})}}}]),i}(Fn))||Yn;var Jn,Qn=(0,a.b2)()($n=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("noise-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\nuniform float u_Amount : 0.5;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\nvec4 noise_filterColor(vec4 color, vec2 texCoord) {\n float diff = (rand(texCoord) - 0.5) * u_Amount;\n color.r += diff;\n color.g += diff;\n color.b += diff;\n return color;\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = noise_filterColor(gl_FragColor, v_UV);\n}"}),this.shaderModuleService.getModule("noise-pass")}}]),i}(Fn))||$n;var tr,er,nr,rr,ir,or,ar,sr=(0,a.b2)()(Jn=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("sepia-pass",{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nuniform float u_Amount : 0.5;\n\n// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/sepia.js\nvec4 sepia_filterColor(vec4 color) {\n float r = color.r;\n float g = color.g;\n float b = color.b;\n color.r =\n min(1.0, (r * (1.0 - (0.607 * u_Amount))) + (g * (0.769 * u_Amount)) + (b * (0.189 * u_Amount)));\n color.g = min(1.0, (r * 0.349 * u_Amount) + (g * (1.0 - (0.314 * u_Amount))) + (b * 0.168 * u_Amount));\n color.b = min(1.0, (r * 0.272 * u_Amount) + (g * 0.534 * u_Amount) + (b * (1.0 - (0.869 * u_Amount))));\n return color;\n}\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n gl_FragColor = sepia_filterColor(gl_FragColor);\n}"}),this.shaderModuleService.getModule("sepia-pass")}}]),i}(Fn))||Jn,ur=(tr=(0,a.b2)(),er=(0,a.f3)(u.IRendererService),nr=(0,a.zY)(),tr((ir=function(){function t(){(0,c.Z)(this,t),(0,at.Z)(this,"rendererService",or,this),(0,g.Z)(this,"passes",[]),(0,g.Z)(this,"readFBO",void 0),(0,g.Z)(this,"writeFBO",void 0)}var e,n;return(0,h.Z)(t,[{key:"getReadFBO",value:function(){return this.readFBO}},{key:"getWriteFBO",value:function(){return this.writeFBO}},{key:"getCurrentFBOTex",value:function(){var t=this.rendererService,e=t.getViewportSize,n=t.createTexture2D,r=e();return n({x:0,y:0,width:r.width,height:r.height,copy:!0})}},{key:"getReadFBOTex",value:function(){var t=this,e=this.rendererService.useFramebuffer;return new Promise((function(n){e(t.readFBO,(0,k.Z)(I().mark((function e(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n(t.getCurrentFBOTex());case 1:case"end":return e.stop()}}),e)}))))}))}},{key:"renderBloomPass",value:(n=(0,k.Z)(I().mark((function t(e,n){var r,i;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getReadFBOTex();case 2:r=t.sent,i=0;case 4:if(!(i<4)){t.next=11;break}return t.next=7,n.render(e,r);case 7:this.swap(),i++,t.next=4;break;case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"render",value:(e=(0,k.Z)(I().mark((function t(e){var n,r;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0;case 1:if(!(n<this.passes.length)){t.next=15;break}if((r=this.passes[n]).setRenderToScreen(this.isLastEnabledPass(n)),"bloom"!==r.getName()){t.next=9;break}return t.next=7,this.renderBloomPass(e,r);case 7:t.next=12;break;case 9:return t.next=11,r.render(e);case 11:n!==this.passes.length-1&&this.swap();case 12:n++,t.next=1;break;case 15:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"resize",value:function(t,e){this.readFBO.resize({width:t,height:e}),this.writeFBO.resize({width:t,height:e})}},{key:"add",value:function(t,e,n){t.init(e,n),this.passes.push(t)}},{key:"insert",value:function(t,e,n,r){t.init(n,r),this.passes.splice(e,0,t)}},{key:"getPostProcessingPassByName",value:function(t){return this.passes.find((function(e){return e.getName()===t}))}},{key:"init",value:function(){var t=this.rendererService,e=t.createFramebuffer,n=t.createTexture2D;this.readFBO=e({color:n({width:1,height:1,wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})}),this.writeFBO=e({color:n({width:1,height:1,wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})})}},{key:"isLastEnabledPass",value:function(t){for(var e=t+1;e<this.passes.length;e++)if(this.passes[e].isEnabled())return!1;return!0}},{key:"swap",value:function(){var t=this.readFBO;this.readFBO=this.writeFBO,this.writeFBO=t}}]),t}(),or=(0,st.Z)(ir.prototype,"rendererService",[er],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),(0,st.Z)(ir.prototype,"init",[nr],Object.getOwnPropertyDescriptor(ir.prototype,"init"),ir.prototype),rr=ir))||rr);var lr,cr,hr,pr,fr,dr=(0,a.b2)()(ar=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,c.Z)(this,i),r.apply(this,arguments)}return(0,h.Z)(i,[{key:"getType",value:function(){return cn.Normal}},{key:"getName",value:function(){return"render"}},{key:"init",value:function(t,e){(0,yn.Z)((0,m.Z)(i.prototype),"init",this).call(this,t,e)}},{key:"render",value:function(t){var e=this.rendererService,n=e.useFramebuffer,r=e.clear,i=t.multiPassRenderer.getPostProcessor().getReadFBO();n(i,(function(){r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:i}),t.multiPassRenderer.setRenderFlag(!1),t.models.forEach((function(e){e.draw({uniforms:t.layerModel.getUninforms()})})),t.multiPassRenderer.setRenderFlag(!0)}))}}]),i}(_n))||ar;var mr="varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}";function gr(t,e){for(var n=0,r=1/e,i=t;i>0;)n+=r*(i%e),i=Math.floor(i/e),r/=e;return n}var yr=1,vr=(lr=(0,a.b2)(),cr=(0,a.f3)(u.IShaderModuleService),lr((pr=function(t){(0,f.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,m.Z)(e);if(n){var i=(0,m.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,c.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,at.Z)((0,p.Z)(t),"shaderModuleService",fr,(0,p.Z)(t)),(0,g.Z)((0,p.Z)(t),"haltonSequence",[]),(0,g.Z)((0,p.Z)(t),"accumulatingId",0),(0,g.Z)((0,p.Z)(t),"frame",0),(0,g.Z)((0,p.Z)(t),"timer",void 0),(0,g.Z)((0,p.Z)(t),"sampleRenderTarget",void 0),(0,g.Z)((0,p.Z)(t),"prevRenderTarget",void 0),(0,g.Z)((0,p.Z)(t),"outputRenderTarget",void 0),(0,g.Z)((0,p.Z)(t),"copyRenderTarget",void 0),(0,g.Z)((0,p.Z)(t),"blendModel",void 0),(0,g.Z)((0,p.Z)(t),"outputModel",void 0),(0,g.Z)((0,p.Z)(t),"copyModel",void 0),t}return(0,h.Z)(i,[{key:"getType",value:function(){return cn.Normal}},{key:"getName",value:function(){return"taa"}},{key:"init",value:function(t,e){(0,yn.Z)((0,m.Z)(i.prototype),"init",this).call(this,t,e);var n=this.rendererService,r=n.createFramebuffer,o=n.createTexture2D;this.sampleRenderTarget=r({color:o({width:1,height:1,wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})}),this.prevRenderTarget=r({color:o({width:1,height:1,wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})}),this.outputRenderTarget=r({color:o({width:1,height:1,wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})}),this.copyRenderTarget=r({color:o({width:1,height:1,wrapS:kt.CLAMP_TO_EDGE,wrapT:kt.CLAMP_TO_EDGE})});for(var a=0;a<30;a++)this.haltonSequence.push([gr(a,2),gr(a,3)]);this.blendModel=this.createTriangleModel("blend-pass","uniform float u_opacity : 1.0;\nuniform float u_MixRatio : 0.5;\n\nuniform sampler2D u_Diffuse1;\nuniform sampler2D u_Diffuse2;\n\nvarying vec2 v_UV;\n\nvoid main() {\n vec4 texel1 = texture2D(u_Diffuse1, v_UV);\n vec4 texel2 = texture2D(u_Diffuse2, v_UV);\n gl_FragColor = u_opacity * mix(texel1, texel2, u_MixRatio);\n}\n"),this.outputModel=this.createTriangleModel("copy-pass",mr,{blend:{enable:!0,func:{srcRGB:kt.ONE,dstRGB:kt.ONE_MINUS_SRC_ALPHA,srcAlpha:kt.ONE,dstAlpha:kt.ONE_MINUS_SRC_ALPHA},equation:{rgb:kt.FUNC_ADD,alpha:kt.FUNC_ADD}}}),this.copyModel=this.createTriangleModel("copy-pass",mr)}},{key:"render",value:function(t){var e=this,n=this.rendererService,r=n.clear,i=n.getViewportSize,o=n.useFramebuffer,a=i(),s=a.width,u=a.height;this.sampleRenderTarget.resize({width:s,height:u}),this.prevRenderTarget.resize({width:s,height:u}),this.outputRenderTarget.resize({width:s,height:u}),this.copyRenderTarget.resize({width:s,height:u}),this.resetFrame(),this.stopAccumulating();var l=t.multiPassRenderer.getPostProcessor().getReadFBO();o(l,(function(){r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:l}),t.multiPassRenderer.setRenderFlag(!1),t.render(),t.multiPassRenderer.setRenderFlag(!0)}));var c=function n(r){e.accumulatingId&&r===e.accumulatingId&&(e.isFinished()||(e.doRender(t),y.$window.requestAnimationFrame((function(){n(r)}))))};this.accumulatingId=yr++,this.timer=y.$window.setTimeout((function(){c(e.accumulatingId)}),50)}},{key:"doRender",value:function(t){var e=this,n=this.rendererService,r=n.clear,i=n.getViewportSize,o=n.useFramebuffer,a=i(),s=a.width,u=a.height,l=t.getLayerConfig().jitterScale,c=void 0===l?1:l,h=this.haltonSequence[this.frame%this.haltonSequence.length];this.cameraService.jitterProjectionMatrix((2*h[0]-1)/s*c,(2*h[1]-1)/u*c),t.multiPassRenderer.setRenderFlag(!1),t.hooks.beforeRender.call(),o(this.sampleRenderTarget,(function(){r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:e.sampleRenderTarget}),t.render()})),t.hooks.afterRender.call(),t.multiPassRenderer.setRenderFlag(!0);var p=t.getLayerConfig();o(this.outputRenderTarget,(function(){e.blendModel.draw({uniforms:{u_opacity:p.opacity||1,u_MixRatio:0===e.frame?1:.9,u_Diffuse1:e.sampleRenderTarget,u_Diffuse2:0===e.frame?t.multiPassRenderer.getPostProcessor().getReadFBO():e.prevRenderTarget}})})),0===this.frame&&r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.copyRenderTarget}),this.frame>=1&&(o(this.copyRenderTarget,(function(){e.outputModel.draw({uniforms:{u_Texture:e.outputRenderTarget}})})),o(t.multiPassRenderer.getPostProcessor().getReadFBO(),(function(){e.copyModel.draw({uniforms:{u_Texture:e.copyRenderTarget}})})),t.multiPassRenderer.getPostProcessor().render(t));var f=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=f,this.frame++,this.cameraService.clearJitterProjectionMatrix()}},{key:"isFinished",value:function(){return this.frame>=this.haltonSequence.length}},{key:"resetFrame",value:function(){this.frame=0}},{key:"stopAccumulating",value:function(){this.accumulatingId=0,y.$window.clearTimeout(this.timer)}},{key:"createTriangleModel",value:function(t,e,n){this.shaderModuleService.registerModule(t,{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e});var r=this.shaderModuleService.getModule(t),i=r.vs,o=r.fs,a=r.uniforms,s=this.rendererService,u=s.createAttribute,c=s.createBuffer;return(0,s.createModel)((0,l.Z)({vs:i,fs:o,attributes:{a_Position:u({buffer:c({data:[-4,-4,4,-4,0,4],type:kt.FLOAT}),size:2})},uniforms:(0,l.Z)({},a),depth:{enable:!1},count:3},n))}}]),i}(_n),fr=(0,st.Z)(pr.prototype,"shaderModuleService",[cr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hr=pr))||hr),_r=new a.W2;_r.bind(u.IGlobalConfigService).to(ot).inSingletonScope(),(0,a.GW)((0,a.b2)(),i.EventEmitter),_r.bind(u.IEventEmitter).to(i.EventEmitter);var br=(0,s.Z)(_r,!1),xr=function(t){var e=br.lazyInject(t);return function(t,n,r){e.call(this,t,n),r&&(r.initializer=function(){return t[n]})}},wr=function(t){var e=br.lazyMultiInject(t);return function(t,n,r){e.call(this,t,n),r&&(r.initializer=function(){return t[n]})}};const Sr=_r;var Er=0;function Mr(){var t=new a.W2;return t.parent=_r,t.bind(u.SceneID).toConstantValue("".concat(Er++)),t.bind(u.IShaderModuleService).to(gn).inSingletonScope(),t.bind(u.ILayerService).to(Xe).inSingletonScope(),t.bind(u.IDebugService).to(Ct).inSingletonScope(),t.bind(u.ISceneService).to(sn).inSingletonScope(),t.bind(u.ICameraService).to(j).inSingletonScope(),t.bind(u.ICoordinateSystemService).to(bt).inSingletonScope(),t.bind(u.IInteractionService).to(Wt).inSingletonScope(),t.bind(u.IPickingService).to(ie).inSingletonScope(),t.bind(u.IControlService).to($).inSingletonScope(),t.bind(u.IMarkerService).to(K).inSingletonScope(),t.bind(u.IIconService).to(F).inSingletonScope(),t.bind(u.IFontService).to(P).inSingletonScope(),t.bind(u.IPopupService).to(J).inSingletonScope(),t.bind(u.INormalPass).to(Mn).whenTargetNamed("clear"),t.bind(u.INormalPass).to(Nn).whenTargetNamed("pixelPicking"),t.bind(u.INormalPass).to(dr).whenTargetNamed("render"),t.bind(u.INormalPass).to(vr).whenTargetNamed("taa"),t.bind(u.IFactoryNormalPass).toFactory((function(t){return function(e){return t.container.getNamed(u.INormalPass,e)}})),t.bind(u.IPostProcessingPass).to(qn).whenTargetNamed("copy"),t.bind(u.IPostProcessingPass).to(Bn).whenTargetNamed("bloom"),t.bind(u.IPostProcessingPass).to(Un).whenTargetNamed("blurH"),t.bind(u.IPostProcessingPass).to(Vn).whenTargetNamed("blurV"),t.bind(u.IPostProcessingPass).to(Qn).whenTargetNamed("noise"),t.bind(u.IPostProcessingPass).to(sr).whenTargetNamed("sepia"),t.bind(u.IPostProcessingPass).to(Hn).whenTargetNamed("colorHalftone"),t.bind(u.IPostProcessingPass).to(Xn).whenTargetNamed("hexagonalPixelate"),t.bind(u.IPostProcessingPass).to(Kn).whenTargetNamed("ink"),t.bind(u.IFactoryPostProcessingPass).toFactory((function(t){return function(e){var n=t.container.getNamed(u.IPostProcessingPass,e);return n.setName(e),n}})),t}function Tr(t){var e=new a.W2;return e.parent=t,e.bind(u.IStyleAttributeService).to(en).inSingletonScope(),e.bind(u.IMultiPassRenderer).to(On).inSingletonScope(),e.bind(u.IPostProcessor).to(ur).inSingletonScope(),e}var Ar=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"];function Cr(t){return Ar.indexOf(t)}var Or=64,Pr=131072,kr=524288,Lr=2097152,Ir=8388608;function Rr(t,e){return 256*(t=(0,Q.clamp)(Math.floor(t),0,255))+(0,Q.clamp)(Math.floor(e),0,255)}function Dr(t){var e=t.color,n=t.radius,r=t.tileX,i=t.tileY,o=t.shape,a=t.opacity,s=t.stroke,u=t.strokeWidth,l=t.strokeOpacity,c=[],h=[],p=[],f=[Rr(e[0],e[1]),Rr(e[2],e[3])],d=[Rr(s[0],s[1]),Rr(s[2],s[3])];return[[-1,-1],[1,-1],[1,1],[-1,1]].forEach((function(t){var e=(0,z.Z)(t,2),s=e[0],m=e[1];c.push([].concat(f,[(s+1)*Ir+(m+1)*Lr+Cr(o)*Pr+n,(r+512)*kr+(i+512)*Or])),h.push([].concat(d,[u,l])),p.push([a,0,0,0])})),{packedBuffer:c,packedBuffer2:h,packedBuffer3:p}}var Nr,Fr,zr,Br={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"},jr={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"};!function(t){t.LINEAR="linear",t.SEQUENTIAL="sequential",t.POWER="power",t.LOG="log",t.IDENTITY="identity",t.TIME="time",t.QUANTILE="quantile",t.QUANTIZE="quantize",t.THRESHOLD="threshold",t.CAT="cat",t.DIVERGING="diverging"}(Nr||(Nr={})),function(t){t.CONSTANT="constant",t.VARIABLE="variable"}(Fr||(Fr={})),function(t){t[t.Attribute=0]="Attribute",t[t.InstancedAttribute=1]="InstancedAttribute",t[t.Uniform=2]="Uniform"}(zr||(zr={}));var Ur,Zr=["mapload","mapchange","mapAfterFrameChange"],Vr=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"];!function(t){t.IMAGE="image",t.CUSTOMIMAGE="customImage",t.ARRAYBUFFER="arraybuffer",t.RGB="rgb",t.TERRAINRGB="terrainRGB",t.CUSTOMRGB="customRGB",t.CUSTOMARRAYBUFFER="customArrayBuffer",t.CUSTOMTERRAINRGB="customTerrainRGB"}(Ur||(Ur={}))},1301:(t,e,n)=>{"use strict";n.r(e),n.d(e,{BaseLayer:()=>V,BaseModel:()=>H,CanvasLayer:()=>J,CanvasUpdateType:()=>$,CityBuildingLayer:()=>Kt,EarthLayer:()=>bn,GeometryLayer:()=>ne,HeatmapLayer:()=>le,ImageLayer:()=>he,LineLayer:()=>Ce,LinearDir:()=>q,MaskLayer:()=>wn,PointLayer:()=>rn,PolygonLayer:()=>ln,RasterLayer:()=>mn,SizeUnitType:()=>X,TextureBlend:()=>Y,TileDebugLayer:()=>gn,WindLayer:()=>Zn,lineStyleType:()=>W});var r,i=n(108),o=n(800),a=n(3192),s=n(6838),u=n(5161),l=n(6193),c=n(9097),h=n(6875),p=n(6297),f=n(1109),d=n.n(f),m=n(2718),g=n(3659),y=n(6902),v=n(7677),_=n(5048),b=n(8134),x=n(5619),w=n(1883),S=n(9479),E=(r={},(0,p.Z)(r,i.BlendType.additive,{enable:!0,func:{srcRGB:i.gl.ONE,dstRGB:i.gl.ONE,srcAlpha:1,dstAlpha:1}}),(0,p.Z)(r,i.BlendType.none,{enable:!1}),(0,p.Z)(r,i.BlendType.normal,{enable:!0,func:{srcRGB:i.gl.SRC_ALPHA,dstRGB:i.gl.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}),(0,p.Z)(r,i.BlendType.subtractive,{enable:!0,func:{srcRGB:i.gl.ONE,dstRGB:i.gl.ONE,srcAlpha:i.gl.ZERO,dstAlpha:i.gl.ONE_MINUS_SRC_COLOR},equation:{rgb:i.gl.FUNC_SUBTRACT,alpha:i.gl.FUNC_SUBTRACT}}),(0,p.Z)(r,i.BlendType.max,{enable:!0,func:{srcRGB:i.gl.ONE,dstRGB:i.gl.ONE},equation:{rgb:i.gl.MAX_EXT}}),(0,p.Z)(r,i.BlendType.min,{enable:!0,func:{srcRGB:i.gl.ONE,dstRGB:i.gl.ONE},equation:{rgb:i.gl.MIN_EXT}}),r),M=n(5895);function T(t,e,n,r,i){var o=(null==i?void 0:i.getLayerConfig()).arrow,a=void 0===o?{enable:!1}:o,s=e.map((function(e){var r,i,o,s,u={id:e._id,coordinates:e.coordinates};if(t.filter((function(t){return void 0!==t.scale})).forEach((function(t){var r=function(t,e){var n;if(!t.scale)return[];var r=(null==t||null===(n=t.scale)||void 0===n?void 0:n.scalers)||[],i=[];return r.forEach((function(n){var r,o=n.field;(e.hasOwnProperty(o)||"variable"===(null===(r=t.scale)||void 0===r?void 0:r.type))&&i.push(e[o])})),t.mapping?t.mapping(i):[]}(t,e);t.needRemapping=!1,"color"===t.name&&(r=r.map((function(t){return(0,x.rgb2arr)(t)}))),u[t.name]=Array.isArray(r)&&1===r.length?r[0]:r,"shape"===t.name&&(u.shape=n.getIconFontKey(u[t.name]))})),"line"===u.shape&&a.enable){var l=u.coordinates,c=(r=l[0],o=[(i=l[1])[0]-r[0],i[1]-r[1]],s=(0,x.normalize)(o),[r[0]+1e-4*s[0],r[1]+1e-4*s[1]]);u.coordinates.splice(1,0,c,c)}return u}));return function(t,e,n){if(t.length>0&&e.version===M.G["GAODE2.x"]){var r=n.coordCenter;t[0].coordinates[0],t.filter((function(t){return!t.originCoordinates})).map((function(t){t.version=M.G["GAODE2.x"],t.originCoordinates=(0,S.cloneDeep)(t.coordinates),t.coordinates=e.coordToAMap2RelativeCoordinates(t.coordinates,r)}))}}(s,r,i),function(t,e){t.length>0&&e.version===M.G.SIMPLE&&t.map((function(t){t.simpleCoordinate||(t.coordinates=function(t,e){if("number"==typeof t[0])return e.simpleMapCoord.unproject(t);if(t[0]&&t[0][0]instanceof Array){var n=[];return t.map((function(t){var r=[];t.map((function(t){r.push(e.simpleMapCoord.unproject(t))})),n.push(r)})),n}var r=[];return t.map((function(t){r.push(e.simpleMapCoord.unproject(t))})),r}(t.coordinates,e),t.simpleCoordinate=!0)}))}(s,r),s}var A=n(5162);function C(t){return t.map((function(t){return"string"==typeof t&&(t=[t,{}]),t}))}function O(t,e,n,r){var i=t.multiPassRenderer;return t.getLayerConfig().enableTAA?i.add(r("taa")):i.add(r("render")),C(e).forEach((function(t){var e=(0,A.Z)(t,2),r=e[0],o=e[1];i.add(n(r),o)})),i.add(n("copy")),i}var P,k,L,I=function(){function t(e){(0,a.Z)(this,t),this.layer=e}return(0,s.Z)(t,[{key:"pickRender",value:function(t){var e=this.layer.getContainer().get(i.TYPES.ILayerService),n=this.layer;if(n.tileLayer)return n.tileLayer.pickRender(t);n.hooks.beforePickingEncode.call(),e.renderTileLayerMask(n),n.renderModels({ispick:!0}),n.hooks.afterPickingEncode.call()}},{key:"pick",value:function(t,e){var n=this.layer.getContainer().get(i.TYPES.IPickingService);return"RasterLayer"===t.type?this.pickRasterLayer(t,e):(this.pickRender(e),n.pickFromPickingFBO(t,e))}},{key:"pickRasterLayer",value:function(t,e,n){var r=this.layer.getContainer(),o=r.get(i.TYPES.IPickingService),a=r.get(i.TYPES.IMapService),s=this.layer.getSource().extent,u=(0,x.lngLatInExtent)(e.lngLat,s),l={x:e.x,y:e.y,type:e.type,lngLat:e.lngLat,target:e,rasterValue:null},c=n||t;if(u){var h=this.readRasterValue(t,s,a,e.x,e.y);return l.rasterValue=h,o.triggerHoverOnLayer(c,l),!0}return l.type="mousemove"===e.type?"mouseout":"un"+e.type,o.triggerHoverOnLayer(c,(0,g.Z)((0,g.Z)({},l),{},{type:"unpick"})),o.triggerHoverOnLayer(c,l),!1}},{key:"readRasterValue",value:function(t,e,n,r,i){var o=t.getSource().data.dataArray[0],a=(0,A.Z)(e,4),s=a[0],u=void 0===s?0:s,l=a[1],c=void 0===l?0:l,h=a[2],p=void 0===h?10:h,f=a[3],d=void 0===f?-10:f,m=n.lngLatToContainer([u,c]),g=n.lngLatToContainer([p,d]),y=g.x-m.x,v=m.y-g.y,_=[(r-m.x)/y,(i-g.y)/v],b=o.width||1,x=o.height||1,w=Math.floor(_[0]*b),S=Math.floor(_[1]*x),E=Math.max(0,S-1)*b+w;return o.data[E]}},{key:"selectFeature",value:function(t){var e=this.layer,n=(0,A.Z)(t,3),r=n[0],i=n[1],o=n[2];e.hooks.beforeSelect.call([r,i,o])}},{key:"highlightPickedFeature",value:function(t){var e=(0,A.Z)(t,3),n=e[0],r=e[1],i=e[2];this.layer.hooks.beforeHighlight.call([n,r,i])}},{key:"getFeatureById",value:function(t){return this.layer.getSource().getFeatureById(t)}}]),t}(),R=function(){function t(e){(0,a.Z)(this,t),this.layer=e;var n=this.layer.getContainer();this.rendererService=n.get(i.TYPES.IRendererService)}return(0,s.Z)(t,[{key:"getColorTexture",value:function(t,e){var n=this.getTextureKey(t,e);return this.key===n||(this.createColorTexture(t,e),this.key=n),this.colorTexture}},{key:"createColorTexture",value:function(t,e){var n=this.rendererService.createTexture2D,r=this.getColorRampBar(t,e),i=n({data:new Uint8Array(r.data),width:r.width,height:r.height,flipY:!1});return this.colorTexture=i,i}},{key:"setColorTexture",value:function(t,e,n){this.key=this.getTextureKey(e,n),this.colorTexture=t}},{key:"destroy",value:function(){var t;null===(t=this.colorTexture)||void 0===t||t.destroy()}},{key:"getColorRampBar",value:function(t,e){switch(t.type){case"cat":return(0,x.generateCatRamp)(t);case"quantize":return(0,x.generateQuantizeRamp)(t);case"custom":return(0,x.generateCustomRamp)(t,e);case"linear":return(0,x.generateLinearRamp)(t,e);default:return(0,x.generateColorRamp)(t)}}},{key:"getTextureKey",value:function(t,e){var n;return"".concat(t.colors.join("_"),"_").concat(null==t||null===(n=t.positions)||void 0===n?void 0:n.join("_"),"_").concat(t.type,"_").concat(null==e?void 0:e.join("_"))}}]),t}(),D=["passes"],N=["moduleName","vertexShader","fragmentShader","inject","triangulation","segmentNumber"];function F(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var B,j,U,Z=0,V=(P=(0,i.lazyInject)(i.TYPES.IGlobalConfigService),k=function(t){(0,l.Z)(z,t);var e,n,r,f,v,w,M,A,P,k=(A=z,P=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(A);if(P){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function z(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,z),t=k.call(this),(0,p.Z)((0,u.Z)(t),"id","".concat(Z++)),(0,p.Z)((0,u.Z)(t),"name","".concat(Z)),(0,p.Z)((0,u.Z)(t),"visible",!0),(0,p.Z)((0,u.Z)(t),"zIndex",0),(0,p.Z)((0,u.Z)(t),"inited",!1),(0,p.Z)((0,u.Z)(t),"layerModelNeedUpdate",!1),(0,p.Z)((0,u.Z)(t),"pickedFeatureID",null),(0,p.Z)((0,u.Z)(t),"selectedFeatureID",null),(0,p.Z)((0,u.Z)(t),"styleNeedUpdate",!1),(0,p.Z)((0,u.Z)(t),"forceRender",!1),(0,p.Z)((0,u.Z)(t),"clusterZoom",0),(0,p.Z)((0,u.Z)(t),"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),(0,p.Z)((0,u.Z)(t),"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),(0,p.Z)((0,u.Z)(t),"hooks",{init:new _.S$,afterInit:new _.oI,beforeRender:new _.oI,beforeRenderData:new _.bf,afterRender:new _.ni,beforePickingEncode:new _.ni,afterPickingEncode:new _.ni,beforeHighlight:new _.ni(["pickedColor"]),afterHighlight:new _.ni,beforeSelect:new _.ni(["pickedColor"]),afterSelect:new _.ni,beforeDestroy:new _.ni,afterDestroy:new _.ni}),(0,p.Z)((0,u.Z)(t),"models",[]),(0,p.Z)((0,u.Z)(t),"startInit",!1),(0,p.Z)((0,u.Z)(t),"layerChildren",[]),(0,p.Z)((0,u.Z)(t),"masks",[]),(0,y.Z)((0,u.Z)(t),"configService",L,(0,u.Z)(t)),(0,p.Z)((0,u.Z)(t),"animateOptions",{enable:!1}),(0,p.Z)((0,u.Z)(t),"currentPickId",null),(0,p.Z)((0,u.Z)(t),"encodeStyleAttribute",{}),(0,p.Z)((0,u.Z)(t),"enableEncodeStyles",[]),(0,p.Z)((0,u.Z)(t),"pendingStyleAttributes",[]),(0,p.Z)((0,u.Z)(t),"scaleOptions",{}),(0,p.Z)((0,u.Z)(t),"animateStatus",!1),(0,p.Z)((0,u.Z)(t),"isDestroyed",!1),(0,p.Z)((0,u.Z)(t),"encodeDataLength",0),(0,p.Z)((0,u.Z)(t),"sourceEvent",(function(){t.dataState.dataSourceNeedUpdate=!0;var e=t.getLayerConfig();e&&e.autoFit&&t.fitBounds(e.fitBoundsOptions),t.layerSource.getSourceCfg().autoRender&&t.reRender()})),t.name=e.name||t.id,t.zIndex=e.zIndex||0,t.rawConfig=e,t}return(0,s.Z)(z,[{key:"addMask",value:function(t){this.masks.push(t),this.enableMask()}},{key:"removeMask",value:function(t){var e=this.masks.indexOf(t);e>-1&&this.masks.splice(e,1)}},{key:"disableMask",value:function(){this.updateLayerConfig({enableMask:!1})}},{key:"enableMask",value:function(){this.updateLayerConfig({enableMask:!0})}},{key:"addMaskLayer",value:function(t){this.masks.push(t)}},{key:"removeMaskLayer",value:function(t){var e=this.masks.indexOf(t);e>-1&&this.masks.splice(e,1),t.destroy()}},{key:"getAttribute",value:function(t){return this.styleAttributeService.getLayerStyleAttribute(t)}},{key:"getLayerConfig",value:function(){return this.configService.getLayerConfig(this.id)}},{key:"updateLayerConfig",value:function(t){var e=this;if(Object.keys(t).map((function(n){n in e.rawConfig&&(e.rawConfig[n]=t[n])})),this.startInit){var n=this.container.get(i.TYPES.SceneID);this.configService.setLayerConfig(n,this.id,(0,g.Z)((0,g.Z)((0,g.Z)({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),t)),this.needUpdateConfig={}}else this.needUpdateConfig=(0,g.Z)((0,g.Z)({},this.needUpdateConfig),t)}},{key:"setContainer",value:function(t,e){this.container=t,this.sceneContainer=e}},{key:"getContainer",value:function(){return this.container}},{key:"addPlugin",value:function(t){return this.plugins.push(t),this}},{key:"init",value:(M=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.container.get(i.TYPES.SceneID),this.startInit=!0,this.configService.setLayerConfig(e,this.id,this.rawConfig),this.layerType=this.rawConfig.layerType,this.iconService=this.container.get(i.TYPES.IIconService),this.fontService=this.container.get(i.TYPES.IFontService),this.rendererService=this.container.get(i.TYPES.IRendererService),this.layerService=this.container.get(i.TYPES.ILayerService),this.debugService=this.container.get(i.TYPES.IDebugService),this.interactionService=this.container.get(i.TYPES.IInteractionService),this.pickingService=this.container.get(i.TYPES.IPickingService),this.mapService=this.container.get(i.TYPES.IMapService),n=this.getLayerConfig(),r=n.enableMultiPassRenderer,o=n.passes,r&&null!=o&&o.length&&o.length>0&&this.mapService.on("mapAfterFrameChange",(function(){u.renderLayers()})),this.cameraService=this.container.get(i.TYPES.ICameraService),this.coordinateService=this.container.get(i.TYPES.ICoordinateSystemService),this.shaderModuleService=this.container.get(i.TYPES.IShaderModuleService),this.postProcessingPassFactory=this.container.get(i.TYPES.IFactoryPostProcessingPass),this.normalPassFactory=this.container.get(i.TYPES.IFactoryNormalPass),this.styleAttributeService=this.container.get(i.TYPES.IStyleAttributeService),r&&(this.multiPassRenderer=this.container.get(i.TYPES.IMultiPassRenderer),this.multiPassRenderer.setLayer(this)),this.pendingStyleAttributes.forEach((function(t){var e=t.attributeName,n=t.attributeField,r=t.attributeValues,i=t.updateOptions;u.styleAttributeService.updateStyleAttribute(e,{scale:(0,g.Z)({field:n},u.splitValuesAndCallbackInAttribute(r,u.getLayerConfig()[e]))},i)})),this.pendingStyleAttributes=[],this.plugins=this.container.getAll(i.TYPES.ILayerPlugin),a=F(this.plugins);try{for(a.s();!(s=a.n()).done;)s.value.apply(this,{rendererService:this.rendererService,mapService:this.mapService,styleAttributeService:this.styleAttributeService,normalPassFactory:this.normalPassFactory,postProcessingPassFactory:this.postProcessingPassFactory})}catch(t){a.e(t)}finally{a.f()}return this.layerPickService=new I(this),this.textureService=new R(this),this.log(i.IDebugLog.LayerInitStart),t.next=31,this.hooks.init.promise();case 31:this.log(i.IDebugLog.LayerInitEnd),this.inited=!0,this.emit("inited",{target:this,type:"inited"}),this.emit("add",{target:this,type:"add"}),this.hooks.afterInit.call();case 36:case"end":return t.stop()}}),t,this)}))),function(){return M.apply(this,arguments)})},{key:"log",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"init";if(!this.tileLayer&&!this.isTileLayer){var r="".concat(this.id,".").concat(n,".").concat(t),i={id:this.id,type:this.type};null===(e=this.debugService)||void 0===e||e.log(r,i)}}},{key:"updateModelData",value:function(t){t.attributes&&t.elements?this.models.map((function(e){e.updateAttributesAndElements(t.attributes,t.elements)})):console.warn("data error")}},{key:"createModelData",value:function(t,e){var n;if(null!==(n=this.layerModel)&&void 0!==n&&n.createModelData)return this.layerModel.createModelData(e);var r=this.calculateEncodeData(t,e),i=this.triangulation;return r&&i?this.styleAttributeService.createAttributesAndIndices(r,i):{attributes:void 0,elements:void 0}}},{key:"setLayerPickService",value:function(t){this.layerPickService=t}},{key:"calculateEncodeData",value:function(t,e){return this.inited?function(t,e,n,r,i,o){var a=new b.default(i,o),s=T(r.getLayerStyleAttributes()||[],a.data.dataArray,e,n,t);return a.destroy(),s}(this,this.fontService,this.mapService,this.styleAttributeService,t,e):(console.warn("layer not inited!"),null)}},{key:"prepareBuildModel",value:function(){0!==Object.keys(this.needUpdateConfig||{}).length&&this.updateLayerConfig({});var t=this.getLayerConfig().animateOption;null!=t&&t.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}},{key:"color",value:function(t,e,n){return this.updateStyleAttribute("color",t,e,n),this}},{key:"texture",value:function(t,e,n){return this.updateStyleAttribute("texture",t,e,n),this}},{key:"rotate",value:function(t,e,n){return this.updateStyleAttribute("rotate",t,e,n),this}},{key:"size",value:function(t,e,n){return this.updateStyleAttribute("size",t,e,n),this}},{key:"filter",value:function(t,e,n){var r=this.updateStyleAttribute("filter",t,e,n);return this.dataState.dataSourceNeedUpdate=r&&this.inited,this}},{key:"shape",value:function(t,e,n){this.shapeOption={field:t,values:e};var r=this.updateStyleAttribute("shape",t,e,n);return this.dataState.dataSourceNeedUpdate=r&&this.inited,this}},{key:"label",value:function(t,e,n){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:t,attributeValues:e,updateOptions:n}),this}},{key:"animate",value:function(t){var e={};return(0,S.isObject)(t)?(e.enable=!0,e=(0,g.Z)((0,g.Z)({},e),t)):e.enable=t,this.updateLayerConfig({animateOption:e}),this}},{key:"source",value:function(t,e){return"source"===(null==t?void 0:t.type)?(this.setSource(t),this):(this.sourceOption={data:t,options:e},this.clusterZoom=0,this)}},{key:"setData",value:function(t,e){var n=this;return this.inited?(this.log(i.IDebugLog.SourceInitStart,i.ILayerStage.UPDATE),this.layerSource.setData(t,e),this.log(i.IDebugLog.SourceInitEnd,i.ILayerStage.UPDATE)):this.on("inited",(function(){n.log(i.IDebugLog.SourceInitStart,i.ILayerStage.UPDATE),n.getSource()?n.layerSource.setData(t,e):n.source(new b.default(t,e)),n.layerSource.once("update",(function(){n.log(i.IDebugLog.SourceInitEnd,i.ILayerStage.UPDATE)}))})),this}},{key:"style",value:function(t){var e=this,n=t.passes,r=(0,m.Z)(t,D);n&&C(n).forEach((function(t){var n=e.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(t[0]);n&&n.updateOptions(t[1])}));var i=r;return Object.keys(r).forEach((function(t){var e=r[t];!Array.isArray(e)||2!==e.length||(0,S.isNumber)(e[0])||(0,S.isNumber)(e[1])||(i[t]={field:e[0],value:e[1]})})),this.encodeStyle(i),this.updateLayerConfig(i),this}},{key:"encodeStyle",value:function(t){var e=this;Object.keys(t).forEach((function(n){e.enableEncodeStyles.includes(n)&&(0,S.isPlainObject)(t[n])&&(t[n].field||t[n].value)&&!(0,S.isEqual)(e.encodeStyleAttribute[n],t[n])?(e.encodeStyleAttribute[n]=t[n],e.updateStyleAttribute(n,t[n].field,t[n].value),e.styleNeedUpdate=!0):e.encodeStyleAttribute[n]&&delete e.encodeStyleAttribute[n]}))}},{key:"scale",value:function(t,e){var n=(0,g.Z)({},this.scaleOptions);if((0,S.isObject)(t)?this.scaleOptions=(0,g.Z)((0,g.Z)({},this.scaleOptions),t):this.scaleOptions[t]=e,this.styleAttributeService&&!(0,S.isEqual)(n,this.scaleOptions)){var r=(0,S.isObject)(t)?t:(0,p.Z)({},t,e);this.styleAttributeService.updateScaleAttribute(r)}return this}},{key:"renderLayers",value:function(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.tileLayer?(this.tileLayer.render(),this):(this.layerService.beforeRenderData(this),this.encodeDataLength<=0&&!this.forceRender||this.renderModels(t),this)}},{key:"renderMultiPass",value:(w=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.encodeDataLength<=0)||this.forceRender){t.next=2;break}return t.abrupt("return");case 2:if(!this.multiPassRenderer||!this.multiPassRenderer.getRenderFlag()){t.next=7;break}return t.next=5,this.multiPassRenderer.render();case 5:t.next=8;break;case 7:this.multiPassRenderer,this.renderModels();case 8:case"end":return t.stop()}}),t,this)}))),function(){return w.apply(this,arguments)})},{key:"active",value:function(t){var e={};return e.enableHighlight=!!(0,S.isObject)(t)||t,(0,S.isObject)(t)?(e.enableHighlight=!0,t.color&&(e.highlightColor=t.color),t.mix&&(e.activeMix=t.mix)):e.enableHighlight=!!t,this.updateLayerConfig(e),this}},{key:"setActive",value:function(t,e){var n=this;if((0,S.isObject)(t)){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o;this.updateLayerConfig({highlightColor:(0,S.isObject)(e)?e.color:this.getLayerConfig().highlightColor,activeMix:(0,S.isObject)(e)?e.mix:this.getLayerConfig().activeMix}),this.pick({x:i,y:a})}else this.updateLayerConfig({pickedFeatureID:t,highlightColor:(0,S.isObject)(e)?e.color:this.getLayerConfig().highlightColor,activeMix:(0,S.isObject)(e)?e.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call((0,x.encodePickingColor)(t)).then((function(){setTimeout((function(){n.reRender()}),1)}))}},{key:"select",value:function(t){var e={};return e.enableSelect=!!(0,S.isObject)(t)||t,(0,S.isObject)(t)?(e.enableSelect=!0,t.color&&(e.selectColor=t.color),t.mix&&(e.selectMix=t.mix)):e.enableSelect=!!t,this.updateLayerConfig(e),this}},{key:"setSelect",value:function(t,e){var n=this;if((0,S.isObject)(t)){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o;this.updateLayerConfig({selectColor:(0,S.isObject)(e)?e.color:this.getLayerConfig().selectColor,selectMix:(0,S.isObject)(e)?e.mix:this.getLayerConfig().selectMix}),this.pick({x:i,y:a})}else this.updateLayerConfig({pickedFeatureID:t,selectColor:(0,S.isObject)(e)?e.color:this.getLayerConfig().selectColor,selectMix:(0,S.isObject)(e)?e.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call((0,x.encodePickingColor)(t)).then((function(){setTimeout((function(){n.reRender()}),1)}))}},{key:"setBlend",value:function(t){return this.updateLayerConfig({blend:t}),this.reRender(),this}},{key:"show",value:function(){return this.updateLayerConfig({visible:!0}),this.reRender(),this.emit("show"),this}},{key:"hide",value:function(){return this.updateLayerConfig({visible:!1}),this.reRender(),this.emit("hide"),this}},{key:"setIndex",value:function(t){return this.zIndex=t,this.layerService.updateLayerRenderList(),this.layerService.renderLayers(),this}},{key:"setCurrentPickId",value:function(t){this.currentPickId=t}},{key:"getCurrentPickId",value:function(){return this.currentPickId}},{key:"setCurrentSelectedId",value:function(t){this.selectedFeatureID=t}},{key:"getCurrentSelectedId",value:function(){return this.selectedFeatureID}},{key:"isVisible",value:function(){var t=this.mapService.getZoom(),e=this.getLayerConfig(),n=e.visible,r=e.minZoom,i=void 0===r?-1/0:r,o=e.maxZoom;return!!n&&t>=i&&t<(void 0===o?1/0:o)}},{key:"setMultiPass",value:function(t,e){if(this.updateLayerConfig({enableMultiPassRenderer:t}),e&&this.updateLayerConfig({passes:e}),t){var n=this.getLayerConfig().passes,r=void 0===n?[]:n;this.multiPassRenderer=O(this,r,this.postProcessingPassFactory,this.normalPassFactory),this.multiPassRenderer.setRenderFlag(!0);var i=this.rendererService.getViewportSize(),o=i.width,a=i.height;this.multiPassRenderer.resize(o,a)}return this}},{key:"setMinZoom",value:function(t){return this.updateLayerConfig({minZoom:t}),this}},{key:"getMinZoom",value:function(){return this.getLayerConfig().minZoom}},{key:"getMaxZoom",value:function(){return this.getLayerConfig().maxZoom}},{key:"get",value:function(t){return this.getLayerConfig()[t]}},{key:"setMaxZoom",value:function(t){return this.updateLayerConfig({maxZoom:t}),this}},{key:"setAutoFit",value:function(t){return this.updateLayerConfig({autoFit:t}),this}},{key:"fitBounds",value:function(t){if(!this.inited)return this.updateLayerConfig({autoFit:!0}),this;var e=this.getSource().extent;return e.some((function(t){return Math.abs(t)===1/0}))||this.mapService.fitBounds([[e[0],e[1]],[e[2],e[3]]],t),this}},{key:"destroy",value:function(){var t,e,n,r,i=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isDestroyed||(this.layerChildren.map((function(t){return t.destroy(!1)})),this.layerChildren=[],this.getLayerConfig().maskfence&&(this.masks.map((function(t){return t.destroy(!1)})),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),null===(t=this.multiPassRenderer)||void 0===t||t.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),null===(e=this.layerModel)||void 0===e||e.clearModels(i),null===(n=this.tileLayer)||void 0===n||n.destroy(),this.models=[],null===(r=this.debugService)||void 0===r||r.removeLog(this.id),this.emit("remove",{target:this,type:"remove"}),this.emit("destroy",{target:this,type:"destroy"}),this.removeAllListeners(),this.isDestroyed=!0)}},{key:"clear",value:function(){this.styleAttributeService.clearAllAttributes()}},{key:"clearModels",value:function(){var t;this.models.forEach((function(t){return t.destroy()})),null===(t=this.layerModel)||void 0===t||t.clearModels(),this.models=[]}},{key:"isDirty",value:function(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter((function(t){return t.needRescale||t.needRemapping||t.needRegenerateVertices})).length}},{key:"setSource",value:function(t){var e=this;if(this.layerSource&&this.layerSource.off("update",this.sourceEvent),this.layerSource=t,this.clusterZoom=0,this.inited&&this.layerSource.cluster){var n=this.mapService.getZoom();this.layerSource.updateClusterData(n)}this.layerSource.inited&&this.sourceEvent(),this.layerSource.on("update",(function(t){var n=t.type;if(void 0===e.coordCenter){var r,i=e.layerSource.center;e.coordCenter=i,null!==(r=e.mapService)&&void 0!==r&&r.setCoordCenter&&e.mapService.setCoordCenter(i)}if("update"===n){if(e.tileLayer)return void e.tileLayer.reload();e.sourceEvent()}}))}},{key:"getSource",value:function(){return this.layerSource}},{key:"getScaleOptions",value:function(){return this.scaleOptions}},{key:"setEncodedData",value:function(t){this.encodedData=t,this.encodeDataLength=t.length}},{key:"getEncodedData",value:function(){return this.encodedData}},{key:"getScale",value:function(t){return this.styleAttributeService.getLayerAttributeScale(t)}},{key:"getLegend",value:function(t){var e,n,r,i=this.styleAttributeService.getLayerStyleAttribute(t);return{type:null===(n=((null==i||null===(e=i.scale)||void 0===e?void 0:e.scalers)||[])[0].option)||void 0===n?void 0:n.type,field:null==i||null===(r=i.scale)||void 0===r?void 0:r.field,items:this.getLegendItems(t)}}},{key:"getLegendItems",value:function(t){var e=this.styleAttributeService.getLayerAttributeScale(t);return e?e.invertExtent?e.range().map((function(n){return(0,p.Z)({value:e.invertExtent(n)},t,n)})):e.ticks?e.ticks().map((function(n){return(0,p.Z)({value:n},t,e(n))})):null!=e&&e.domain?e.domain().filter((function(t){return!(0,S.isUndefined)(t)})).map((function(n){return(0,p.Z)({value:n},t,e(n))})):[]:[]}},{key:"pick",value:function(t){var e=t.x,n=t.y;this.interactionService.triggerHover({x:e,y:n})}},{key:"boxSelect",value:function(t,e){this.pickingService.boxPickLayer(this,t,e)}},{key:"buildLayerModel",value:(v=(0,o.Z)(d().mark((function t(e){var n,r,o,a,s,u,l,c,h,p,f,y,v=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.moduleName,r=e.vertexShader,o=e.fragmentShader,a=e.inject,s=e.triangulation,u=e.segmentNumber,l=(0,m.Z)(e,N),this.shaderModuleService.registerModule(n,{vs:r,fs:o,inject:a}),c=this.shaderModuleService.getModule(n),h=c.vs,p=c.fs,f=c.uniforms,y=this.rendererService.createModel,t.abrupt("return",new Promise((function(t){var e=v.styleAttributeService.createAttributesAndIndices(v.encodedData,s,u),n=e.attributes,r=e.elements,o=e.count,a=(0,g.Z)({attributes:n,uniforms:f,fs:p,vs:h,elements:r,blend:E[i.BlendType.normal]},l);o&&(a.count=o),t(y(a))})));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"createAttributes",value:function(t){var e=t.triangulation;return this.styleAttributeService.createAttributes(this.encodedData,e).attributes}},{key:"getTime",value:function(){return this.layerService.clock.getDelta()}},{key:"setAnimateStartTime",value:function(){this.animateStartTime=this.layerService.clock.getElapsedTime()}},{key:"stopAnimate",value:function(){this.animateStatus&&(this.layerService.stopAnimate(),this.animateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}},{key:"getLayerAnimateTime",value:function(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}},{key:"needPick",value:function(t){var e=this.getLayerConfig(),n=e.enableHighlight,r=void 0===n||n,i=e.enableSelect,o=void 0===i||i,a=-1!==this.eventNames().indexOf(t)||-1!==this.eventNames().indexOf("un"+t);return"click"!==t&&"dblclick"!==t||!o||(a=!0),"mousemove"!==t||!r&&-1===this.eventNames().indexOf("mouseenter")&&-1===this.eventNames().indexOf("unmousemove")&&-1===this.eventNames().indexOf("mouseout")||(a=!0),this.isVisible()&&a}},{key:"buildModels",value:(f=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return t.stop()}}),t)}))),function(){return f.apply(this,arguments)})},{key:"rebuildModels",value:(r=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.buildModels();case 2:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"renderMulPass",value:(n=(0,o.Z)(d().mark((function t(e){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.render();case 2:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"renderModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.encodeDataLength<=0&&!this.forceRender?(this.clearModels(),this):(this.hooks.beforeRender.call(),this.models.forEach((function(n){n.draw({uniforms:t.layerModel.getUninforms(),blend:t.layerModel.getBlend(),stencil:t.layerModel.getStencil(e)},(null==e?void 0:e.ispick)||!1)})),this.hooks.afterRender.call(),this)}},{key:"updateStyleAttribute",value:function(t,e,n,r){var i=this.configService.getAttributeConfig(this.id)||{};return!(0,S.isEqual)(i[t],{field:e,values:n})&&(-1!==["color","size","texture","rotate","filter","label","shape"].indexOf(t)&&this.configService.setAttributeConfig(this.id,(0,p.Z)({},t,{field:e,values:n})),this.startInit?this.styleAttributeService.updateStyleAttribute(t,{scale:(0,g.Z)({field:e},this.splitValuesAndCallbackInAttribute(n,this.getLayerConfig()[e]))},r):this.pendingStyleAttributes.push({attributeName:t,attributeField:e,attributeValues:n,updateOptions:r}),!0)}},{key:"getLayerAttributeConfig",value:function(){return this.configService.getAttributeConfig(this.id)}},{key:"getShaderPickStat",value:function(){return this.layerService.getShaderPickStat()}},{key:"setEarthTime",value:function(t){console.warn("empty fn")}},{key:"processData",value:function(t){return t}},{key:"getModelType",value:function(){throw new Error("Method not implemented.")}},{key:"getDefaultConfig",value:function(){return{}}},{key:"initLayerModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.models.forEach((function(t){return t.destroy()})),this.models=[],t.next=4,this.layerModel.initModels();case 4:this.models=t.sent;case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"reRender",value:function(){this.inited&&this.layerService.reRender()}},{key:"splitValuesAndCallbackInAttribute",value:function(t,e){return{values:(0,S.isFunction)(t)?void 0:t||e,callback:(0,S.isFunction)(t)?t:void 0}}}]),z}(w.EventEmitter),L=(0,v.Z)(k.prototype,"configService",[P],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),k);function G(t){return t.maskOperation===i.MaskOperation.OR?{enable:!0,mask:255,func:{cmp:i.gl.ALWAYS,ref:1,mask:255},opFront:{fail:i.gl.KEEP,zfail:i.gl.REPLACE,zpass:i.gl.REPLACE}}:{enable:!0,mask:255,func:{cmp:t.stencilType===i.StencilType.SINGLE||0===t.stencilIndex?i.gl.ALWAYS:i.gl.LESS,ref:t.stencilType===i.StencilType.SINGLE?1:0===t.stencilIndex?2:1,mask:255},opFront:{fail:i.gl.KEEP,zfail:i.gl.REPLACE,zpass:i.gl.REPLACE}}}var H=(B=(0,i.lazyInject)(i.TYPES.IGlobalConfigService),j=function(){function t(e){(0,a.Z)(this,t),(0,p.Z)(this,"preStyleAttribute",{}),(0,p.Z)(this,"encodeStyleAttribute",{}),(0,y.Z)(this,"configService",U,this),this.layer=e,this.rendererService=e.getContainer().get(i.TYPES.IRendererService),this.pickingService=e.getContainer().get(i.TYPES.IPickingService),this.shaderModuleService=e.getContainer().get(i.TYPES.IShaderModuleService),this.styleAttributeService=e.getContainer().get(i.TYPES.IStyleAttributeService),this.mapService=e.getContainer().get(i.TYPES.IMapService),this.iconService=e.getContainer().get(i.TYPES.IIconService),this.fontService=e.getContainer().get(i.TYPES.IFontService),this.cameraService=e.getContainer().get(i.TYPES.ICameraService),this.layerService=e.getContainer().get(i.TYPES.ILayerService),this.registerStyleAttribute(),this.registerBuiltinAttributes(),this.startModelAnimate();var n=this.rendererService.createTexture2D;this.createTexture2D=n}var e,n,r;return(0,s.Z)(t,[{key:"getBlend",value:function(){var t=this.layer.getLayerConfig().blend,e=void 0===t?"normal":t;return E[i.BlendType[e]]}},{key:"getStencil",value:function(t){var e=this.layer.getLayerConfig(),n=e.mask,r=void 0!==n&&n,o=e.maskInside,a=void 0===o||o,s=e.enableMask,u=e.maskOperation,l=void 0===u?i.MaskOperation.AND:u;return"MaskLayer"===this.layer.type?G({isStencil:!0,stencilType:i.StencilType.SINGLE}):t.isStencil?G((0,g.Z)((0,g.Z)({},t),{},{maskOperation:l})):function(t,e){return{enable:t,mask:255,func:{cmp:i.gl.EQUAL,ref:e?1:0,mask:1}}}(r||s&&0!==this.layer.masks.length||void 0!==this.layer.tileMask,a)}},{key:"getDefaultStyle",value:function(){return{}}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"needUpdate",value:(r=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",!1);case 1:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})},{key:"buildModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"initModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){}},{key:"getAttribute",value:function(){throw new Error("Method not implemented.")}},{key:"render",value:function(t){throw new Error("Method not implemented.")}},{key:"registerBuiltinAttributes",value:function(){throw new Error("Method not implemented.")}},{key:"animateOption2Array",value:function(t){return[t.enable?0:1,t.duration||4,t.interval||.2,t.trailLength||.1]}},{key:"startModelAnimate",value:function(){this.layer.getLayerConfig().animateOption.enable&&this.layer.setAnimateStartTime()}},{key:"getInject",value:function(){var t=this.layer.encodeStyleAttribute,e="",n={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2"};this.layer.enableEncodeStyles.forEach((function(r){t[r]&&(e+="#define USE_ATTRIBUTE_".concat(r.toUpperCase()," 0.0; \n\n")),e+="\n #ifdef USE_ATTRIBUTE_".concat(r.toUpperCase(),"\n attribute ").concat(n[r]," a_").concat(r.charAt(0).toUpperCase()+r.slice(1),";\n#else\n uniform ").concat(n[r]," u_").concat(r,";\n#endif\n\n")}));var r="";return this.layer.enableEncodeStyles.forEach((function(t){r+="\n\n#ifdef USE_ATTRIBUTE_".concat(t.toUpperCase(),"\n ").concat(n[t]," ").concat(t," = a_").concat(t.charAt(0).toUpperCase()+t.slice(1),";\n#else\n ").concat(n[t]," ").concat(t," = u_").concat(t,";\n#endif\n\n")})),{"vs:#decl":e,"vs:#main-start":r}}},{key:"getStyleAttribute",value:function(){var t=this,e={},n={opacity:1,stroke:[1,0,0,1],offsets:[0,0]};return this.layer.enableEncodeStyles.forEach((function(r){if(!t.layer.encodeStyleAttribute[r]){var i=t.layer.getLayerConfig()[r],o=void 0===i?n[r]:i;"stroke"===r&&(o=(0,x.rgb2arr)(o)),e["u_"+r]=o}})),e}},{key:"registerStyleAttribute",value:function(){var t=this;Object.keys(this.layer.encodeStyleAttribute).forEach((function(e){var n=function(t){switch(t){case"stroke":return{name:"stroke",type:i.AttributeType.Attribute,descriptor:{name:"a_Stroke",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:4,update:function(t){var e=t.stroke;return void 0===e?[1,1,1,1]:e}}};case"opacity":return{name:"opacity",type:i.AttributeType.Attribute,descriptor:{name:"a_Opacity",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.opacity;return[void 0===e?1:e]}}};case"offsets":return{name:"offsets",type:i.AttributeType.Attribute,descriptor:{name:"a_Offsets",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t){return t.offsets}}};default:return}}(e);n&&t.styleAttributeService.registerStyleAttribute(n)}))}},{key:"updateEncodeAttribute",value:function(t,e){this.encodeStyleAttribute[t]=e}}]),t}(),U=(0,v.Z)(j.prototype,"configService",[B],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),j),W=function(t){return t[t.solid=0]="solid",t[t.dash=1]="dash",t}({}),q=function(t){return t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t}({}),Y=function(t){return t.NORMAL="normal",t.REPLACE="replace",t}({}),X=function(t){return t[t.pixel=0]="pixel",t[t.meter=1]="meter",t}({}),$=function(t){return t.ALWAYS="always",t.DRAGEND="dragend",t}({});const K={canvas:function(t){(0,l.Z)(m,t);var e,n,r,i,f=(r=m,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(i){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function m(){var t;(0,a.Z)(this,m);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=f.call.apply(f,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateMode",$.ALWAYS),(0,p.Z)((0,u.Z)(t),"renderUpdate",(function(){var e=t.layer.getLayerConfig(),n=e.zIndex,r=void 0===n?10:n,i=e.update,o=void 0===i?$.ALWAYS:i,a=e.animateOption,s=void 0===a?{enable:!1,duration:20}:a;+t.canvas.style.zIndex===r&&(t.canvas.style.zIndex=r+""),t.updateMode!==o&&(t.updateMode=o,t.unBindListener(),t.bindListener()),t.updateMode===$.ALWAYS&&s.enable&&t.renderCanvas()})),(0,p.Z)((0,u.Z)(t),"unBindListener",(function(){t.mapService.off("mapchange",t.renderCanvas),t.mapService.off("zoomstart",t.clearCanvas),t.mapService.off("zoomend",t.renderCanvas),t.mapService.off("movestart",t.clearCanvas),t.mapService.off("moveend",t.renderCanvas)})),(0,p.Z)((0,u.Z)(t),"bindListener",(function(){t.updateMode===$.ALWAYS?t.mapService.on("mapchange",t.renderCanvas):(t.mapService.on("zoomstart",t.clearCanvas),t.mapService.on("zoomend",t.renderCanvas),t.mapService.on("movestart",t.clearCanvas),t.mapService.on("moveend",t.renderCanvas))})),(0,p.Z)((0,u.Z)(t),"clearCanvas",(function(){if(t.ctx){var e=t.rendererService.getViewportSize(),n=e.width,r=e.height;t.ctx.clearRect(0,0,n,r)}})),(0,p.Z)((0,u.Z)(t),"renderCanvas",(function(){var e=t.rendererService.getViewportSize(),n=e.width,r=e.height;if(t.prevSize[0]!==n||t.prevSize[1]!==r){t.prevSize=[n,r];var i=t.mapService.getSize(),o=(0,A.Z)(i,2),a=o[0],s=o[1];t.canvas.width=n,t.canvas.height=r,t.canvas.style.width=a+"px",t.canvas.style.height=s+"px"}var u=t.layer.getLayerConfig().drawingOnCanvas;t.ctx&&u({canvas:t.canvas,ctx:t.ctx,mapService:t.mapService,size:[n,r]})})),t}return(0,s.Z)(m,[{key:"clearModels",value:function(){var t;this.canvas&&(null===(t=this.mapService.getContainer())||void 0===t||t.removeChild(this.canvas),this.canvas=null),this.unBindListener()}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.update,r=void 0===n?$.ALWAYS:n,this.updateMode=r,this.initCanvas(),this.renderCanvas(),this.bindListener(),this.mapService.getContainer(),t.abrupt("return",[]);case 7:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"initCanvas",value:function(){var t,e=this.layer.getLayerConfig().zIndex,n=this.mapService.getSize(),r=(0,A.Z)(n,2),i=r[0],o=r[1],a=this.rendererService.getViewportSize(),s=a.width,u=a.height;this.prevSize=[s,u];var l=document.createElement("canvas");this.canvas=l,l.width=s,l.height=u,l.style.pointerEvents="none",l.style.width=i+"px",l.style.height=o+"px",l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.zIndex=e+"",null===(t=this.mapService.getContainer())||void 0===t||t.appendChild(l);var c=l.getContext("2d");this.ctx=c}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){}}]),m}(H)};var J=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","CanvasLayer"),(0,p.Z)((0,u.Z)(t),"forceRender",!0),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new K[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"hide",value:function(){return this.layerModel.clearCanvas&&this.layerModel.clearCanvas(),this.updateLayerConfig({visible:!1}),this.reRender(),this}},{key:"renderModels",value:function(){var t,e=this;return null!=this&&null!==(t=this.layerModel)&&void 0!==t&&t.renderUpdate&&this.layerModel.renderUpdate(),this.models.forEach((function(t){t.draw({uniforms:e.layerModel.getUninforms()},!1)})),this}},{key:"getDefaultConfig",value:function(){return{canvas:{}}[this.getModelType()]}},{key:"getModelType",value:function(){return"canvas"}}]),f}(V),Q=n(9908),tt=n(6319),et=n.n(tt),nt=n(2401),rt=n(2329),it=100;function ot(t){return t/180*Math.acos(-1)}function at(t){var e=ot(t[0])+Math.PI/2,n=ot(t[1]),r=it+.4*Math.random(),i=r*Math.cos(n)*Math.cos(e);return[r*Math.cos(n)*Math.sin(e),r*Math.sin(n),i]}function st(t,e){var n=nt.create(),r=nt.create(),i=rt.fromValues(0,1,0),o=rt.fromValues(0,0,0);t=void 0!==t?t:1;for(var a=2+(void 0!==(e=e||{}).segments?e.segments:32),s=2*a,u=[],l=[],c=[],h=[],p=[],f=[],d=0;d<=a;d++){for(var m=d/a,g=m*Math.PI,y=0;y<=s;y++){var v=y/s,_=v*Math.PI*2;nt.identity(r),nt.rotateZ(r,r,-g),nt.identity(n),nt.rotateY(n,n,_),rt.transformMat4(o,i,r),rt.transformMat4(o,o,n),rt.scale(o,o,-t),c.push(o.slice()),h.push.apply(h,(0,Q.Z)(o.slice())),rt.normalize(o,o),p.push.apply(p,(0,Q.Z)(o.slice())),f.push([v,1-m]),h.push(v,1-m)}if(d>0)for(var b=c.length,x=b-2*(s+1);x+s+2<b;x++)u.push([x,x+1,x+s+1]),l.push(x,x+1,x+s+1),u.push([x+s+1,x+1,x+s+2]),l.push(x+s+1,x+1,x+s+2)}return{cells:u,positions:c,uvs:f,positionsArr:h,indicesArr:l,normalArr:p}}var ut=n(9341),lt=ut.Ue(),ct=(ut.Ue(),ut.Ue()),ht=ut.Ue(),pt=ut.Ue();function ft(t,e,n,r,i){ut.IH(t,n,r),ut.Fv(t,t),e=ut.al(-t[1],t[0]);var o=ut.al(-n[1],n[0]);return[i/ut.AK(e,o),e]}function dt(t,e){return ut.t8(t,-e[1],e[0])}function mt(t,e,n){return ut.lu(t,e,n),ut.Fv(t,t),t}function gt(t,e){return t[0]===e[0]&&t[1]===e[1]}var yt,vt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.Z)(this,t),(0,p.Z)(this,"lastFlip",-1),(0,p.Z)(this,"miter",ut.al(0,0)),(0,p.Z)(this,"started",!1),(0,p.Z)(this,"dash",!1),(0,p.Z)(this,"totalDistance",0),(0,p.Z)(this,"currentIndex",0),this.join=e.join||"miter",this.cap=e.cap||"butt",this.miterLimit=e.miterLimit||10,this.thickness=e.thickness||1,this.dash=e.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return(0,s.Z)(t,[{key:"simpleExtrude",value:function(t){var e=this.complex;if(t.length<=1)return e;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var n=t.length,r=e.startIndex,i=1;i<n;i++){var o=t[i-1],a=t[i],s=i<t.length-1?t[i+1]:null;r+=this.simpleSegment(e,r,o,a,s)}if(this.dash)for(var u=0;u<e.positions.length/6;u++)e.positions[6*u+5]=this.totalDistance;return e.startIndex=e.positions.length/6,e}},{key:"simpleExtrude_gaode2",value:function(t,e){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var r=t.length,i=n.startIndex,o=1;o<r;o++){var a,s,u,l=t[o-1];l.push(null!==(a=e[o-1][2])&&void 0!==a?a:0);var c=e[o-1],h=t[o];h.push(null!==(s=e[o][2])&&void 0!==s?s:0);var p=e[o],f=o<t.length-1?[].concat((0,Q.Z)(t[o+1]),[null!==(u=e[o+1][2])&&void 0!==u?u:0]):null,d=o<e.length-1?e[o+1]:null;i+=this.simpleSegment(n,i,l,h,f,c,p,d)}if(this.dash)for(var m=0;m<n.positions.length/6;m++)n.positions[6*m+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"extrude_gaode2",value:function(t,e){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var r=t.length,i=n.startIndex,o=1;o<r;o++){var a,s,u,l=t[o-1];l.push(null!==(a=e[o-1][2])&&void 0!==a?a:0);var c=e[o-1],h=t[o];h.push(null!==(s=e[o][2])&&void 0!==s?s:0);var p=e[o],f=o<t.length-1?[].concat((0,Q.Z)(t[o+1]),[null!==(u=e[o+1][2])&&void 0!==u?u:0]):null,d=o<e.length-1?e[o+1]:null;i+=this.segment_gaode2(n,i,l,h,f,c,p,d)}if(this.dash)for(var m=0;m<n.positions.length/6;m++)n.positions[6*m+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"extrude",value:function(t){var e=this.complex;if(t.length<=1)return e;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var n=t.length,r=e.startIndex,i=1;i<n;i++){var o=t[i-1],a=t[i],s=i<t.length-1?t[i+1]:null;r+=this.segment(e,r,o,a,s)}if(this.dash)for(var u=0;u<e.positions.length/6;u++)e.positions[6*u+5]=this.totalDistance;return e.startIndex=e.positions.length/6,e}},{key:"simpleSegment",value:function(t,e,n,r,i){var o=0,a=t.indices,s=t.positions,u=t.normals,l=(0,x.aProjectFlat)([r[0],r[1]]),c=(0,x.aProjectFlat)([n[0],n[1]]);mt(ct,l,c);var h=0;if(this.dash&&(h=this.lineSegmentDistance(l,c),this.totalDistance+=h),this.normal||(this.normal=ut.Ue(),dt(this.normal,ct)),this.started||(this.started=!0,this.extrusions(s,u,n,this.normal,this.thickness,this.totalDistance-h)),a.push(e+0,e+1,e+2),i){var p=(0,x.aProjectFlat)([i[0],i[1]]);gt(l,p)&&ut.IH(p,l,ut.Fv(p,ut.$X(p,l,c))),mt(ht,p,l);var f=ft(pt,ut.Ue(),ct,ht,this.thickness),d=(0,A.Z)(f,2),m=d[0],g=d[1];ut.AK(pt,this.normal),this.extrusions(s,u,r,g,m,this.totalDistance),a.push.apply(a,(0,Q.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),ut.JG(this.normal,g),o+=2,this.lastFlip=-1}else dt(this.normal,ct),this.extrusions(s,u,r,this.normal,this.thickness,this.totalDistance),a.push.apply(a,(0,Q.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),o+=2;return o}},{key:"segment_gaode2",value:function(t,e,n,r,i,o,a,s){var u=0,l=t.indices,c=t.positions,h=t.normals,p="square"===this.cap,f="bevel"===this.join,d=(0,x.aProjectFlat)([a[0],a[1]]),m=(0,x.aProjectFlat)([o[0],o[1]]);mt(ct,r,n);var g=0;if(this.dash&&(g=this.lineSegmentDistance(d,m),this.totalDistance+=g),this.normal||(this.normal=ut.Ue(),dt(this.normal,ct)),!this.started)if(this.started=!0,p){var y=ut.Ue(),v=ut.Ue();ut.IH(y,this.normal,ct),ut.IH(v,this.normal,ct),h.push(v[0],v[1],0),h.push(y[0],y[1],0),c.push(n[0],n[1],0|n[2],this.totalDistance-g,-this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),c.push(n[0],n[1],0|n[2],this.totalDistance-g,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(c,h,n,this.normal,this.thickness,this.totalDistance-g);if(l.push(e+0,e+1,e+2),i){gt(r,i)&&ut.IH(i,r,ut.Fv(i,ut.$X(i,r,n))),mt(ht,i,r);var _=ft(pt,ut.Ue(),ct,ht,this.thickness),b=(0,A.Z)(_,2),w=b[0],S=b[1],E=ut.AK(pt,this.normal)<0?-1:1,M=f;M||"miter"!==this.join||w>this.miterLimit&&(M=!0),M?(h.push(this.normal[0],this.normal[1],0),h.push(S[0],S[1],0),c.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*E,0|r[2]),this.complex.indexes.push(this.currentIndex),c.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness*E,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l.push.apply(l,(0,Q.Z)(this.lastFlip!==-E?[e,e+2,e+3]:[e+2,e+1,e+3])),l.push(e+2,e+3,e+4),dt(lt,ht),ut.JG(this.normal,lt),h.push(this.normal[0],this.normal[1],0),c.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*E,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,u+=3):(this.extrusions(c,h,r,S,w,this.totalDistance),l.push.apply(l,(0,Q.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),E=-1,ut.JG(this.normal,S),u+=2),this.lastFlip=E}else{if(dt(this.normal,ct),p){var T=ut.Ue(),C=ut.Ue();ut.lu(C,ct,this.normal),ut.IH(T,ct,this.normal),h.push(C[0],C[1],0),h.push(T[0],T[1],0),c.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),c.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(c,h,r,this.normal,this.thickness,this.totalDistance);l.push.apply(l,(0,Q.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),u+=2}return u}},{key:"segment",value:function(t,e,n,r,i){var o=0,a=t.indices,s=t.positions,u=t.normals,l="square"===this.cap,c="bevel"===this.join,h=(0,x.aProjectFlat)([r[0],r[1]]),p=(0,x.aProjectFlat)([n[0],n[1]]);mt(ct,h,p);var f=0;if(this.dash&&(f=this.lineSegmentDistance(h,p),this.totalDistance+=f),this.normal||(this.normal=ut.Ue(),dt(this.normal,ct)),!this.started)if(this.started=!0,l){var d=ut.Ue(),m=ut.Ue();ut.IH(d,this.normal,ct),ut.IH(m,this.normal,ct),u.push(m[0],m[1],0),u.push(d[0],d[1],0),s.push(n[0],n[1],0|n[2],this.totalDistance-f,-this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),s.push(n[0],n[1],0|n[2],this.totalDistance-f,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(s,u,n,this.normal,this.thickness,this.totalDistance-f);if(a.push(e+0,e+1,e+2),i){var g=(0,x.aProjectFlat)([i[0],i[1]]);gt(h,g)&&ut.IH(g,h,ut.Fv(g,ut.$X(g,h,p))),mt(ht,g,h);var y=ft(pt,ut.Ue(),ct,ht,this.thickness),v=(0,A.Z)(y,2),_=v[0],b=v[1],w=ut.AK(pt,this.normal)<0?-1:1,S=c;S||"miter"!==this.join||_>this.miterLimit&&(S=!0),S?(u.push(this.normal[0],this.normal[1],0),u.push(b[0],b[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*w,0|r[2]),this.complex.indexes.push(this.currentIndex),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness*w,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,a.push.apply(a,(0,Q.Z)(this.lastFlip!==-w?[e,e+2,e+3]:[e+2,e+1,e+3])),a.push(e+2,e+3,e+4),dt(lt,ht),ut.JG(this.normal,lt),u.push(this.normal[0],this.normal[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*w,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,o+=3):(this.extrusions(s,u,r,b,_,this.totalDistance),a.push.apply(a,(0,Q.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),w=-1,ut.JG(this.normal,b),o+=2),this.lastFlip=w}else{if(dt(this.normal,ct),l){var E=ut.Ue(),M=ut.Ue();ut.lu(M,ct,this.normal),ut.IH(E,ct,this.normal),u.push(M[0],M[1],0),u.push(E[0],E[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(s,u,r,this.normal,this.thickness,this.totalDistance);a.push.apply(a,(0,Q.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),o+=2}return o}},{key:"extrusions",value:function(t,e,n,r,i,o){e.push(r[0],r[1],0),e.push(r[0],r[1],0),t.push(n[0],n[1],0|n[2],o,-i,0|n[2]),this.complex.indexes.push(this.currentIndex),t.push(n[0],n[1],0|n[2],o,i,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}}]),t}();function _t(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t[0][0],r=t[0][t[0].length-1];n[0]===r[0]&&n[1]===r[1]&&(t[0]=t[0].slice(0,t[0].length-1));for(var i=t[0].length,o=et().flatten(t),a=o.vertices,s=o.dimensions,u=[],l=[],c=[],h=0;h<a.length/s;h++)u.push(a[h*s],a[h*s+1],1,-1,-1),c.push(0,0,1);var p=et()(o.vertices,o.holes,o.dimensions);l.push.apply(l,(0,Q.Z)(p));for(var f=function(){var t=o.vertices.slice(d*s,(d+1)*s),n=o.vertices.slice((d+1)*s,(d+2)*s);0===n.length&&(n=o.vertices.slice(0,s));var r=u.length/5;u.push(t[0],t[1],1,0,0,n[0],n[1],1,.1,0,t[0],t[1],0,0,.8,n[0],n[1],0,.1,.8);var i=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=rt.create(),o=rt.create(),a=rt.create();r&&(t=(0,x.lngLatToMeters)(t),e=(0,x.lngLatToMeters)(e),n=(0,x.lngLatToMeters)(n));var s=rt.fromValues.apply(rt,(0,Q.Z)(t)),u=rt.fromValues.apply(rt,(0,Q.Z)(e)),l=rt.fromValues.apply(rt,(0,Q.Z)(n));rt.sub(i,l,u),rt.sub(o,s,u),rt.cross(a,i,o);var c=rt.create();return rt.normalize(c,a),c}([n[0],n[1],1],[t[0],t[1],0],[t[0],t[1],1],e);c.push.apply(c,(0,Q.Z)(i).concat((0,Q.Z)(i),(0,Q.Z)(i),(0,Q.Z)(i))),l.push.apply(l,(0,Q.Z)([1,2,0,3,2,1].map((function(t){return t+r}))))},d=0;d<i;d++)f();return{positions:u,index:l,normals:c}}var bt=function(t){return t.CYLINDER="cylinder",t.SQUARECOLUMN="squareColumn",t.TRIANGLECOLUMN="triangleColumn",t.HEXAGONCOLUMN="hexagonColumn",t.PENTAGONCOLUMN="pentagonColumn",t}({}),xt=function(t){return t.CIRCLE="circle",t.SQUARE="square",t.TRIANGLE="triangle",t.HEXAGON="hexagon",t.PENTAGON="pentagon",t}({});function wt(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=2*Math.PI/t,r=[],i=0;i<t;i++)r.push(n*i+e*Math.PI/12);return r.map((function(t){return[Math.sin(t+Math.PI/4),Math.cos(t+Math.PI/4),0]}))}function St(){return wt(30)}function Et(){return wt(4)}function Mt(){return wt(3)}function Tt(){return wt(6,1)}function At(){return wt(5)}var Ct=(yt={},(0,p.Z)(yt,xt.CIRCLE,St),(0,p.Z)(yt,xt.HEXAGON,Tt),(0,p.Z)(yt,xt.TRIANGLE,Mt),(0,p.Z)(yt,xt.SQUARE,Et),(0,p.Z)(yt,xt.PENTAGON,At),(0,p.Z)(yt,bt.CYLINDER,St),(0,p.Z)(yt,bt.HEXAGONCOLUMN,Tt),(0,p.Z)(yt,bt.TRIANGLECOLUMN,Mt),(0,p.Z)(yt,bt.SQUARECOLUMN,Et),(0,p.Z)(yt,bt.PENTAGONCOLUMN,At),yt),Ot={};function Pt(t){var e=(0,x.calculateCentroid)(t.coordinates);return{vertices:[].concat((0,Q.Z)(e),(0,Q.Z)(e),(0,Q.Z)(e),(0,Q.Z)(e)),indices:[0,1,2,2,3,0],size:e.length}}function kt(t){var e=at((0,x.calculateCentroid)(t.coordinates));return{vertices:[].concat((0,Q.Z)(e),(0,Q.Z)(e),(0,Q.Z)(e),(0,Q.Z)(e)),indices:[0,1,2,2,3,0],size:e.length}}function Lt(t){var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Ot&&Ot[t])return Ot[t];var n=_t([Ct[t]?Ct[t]():Ct.cylinder()],e);return Ot[t]=n,n}(t.shape,!1);return{vertices:e.positions,indices:e.index,normals:e.normals,size:5}}function It(t){var e=(0,x.calculateCentroid)(t.coordinates);return{vertices:(0,Q.Z)(e),indices:[0],size:e.length}}function Rt(t){var e=t.coordinates,n=t.originCoordinates,r=t.version,i=new vt({dash:!0,join:"bevel"});if("GAODE2.x"===r){var o=e;Array.isArray(o[0][0])||(o=[e]);var a=n;Array.isArray(a[0][0])||(a=[n]);for(var s=0;s<o.length;s++){var u=o[s],l=a[s];i.extrude_gaode2(u,l)}}else{var c=e;c[0]&&!Array.isArray(c[0][0])&&(c=[e]),c.forEach((function(t){i.extrude(t)}))}var h=i.complex;return{vertices:h.positions,indices:h.indices,normals:h.normals,indexes:h.indexes,size:6}}function Dt(t){var e=t.coordinates.flat();return{vertices:[1,0,0].concat((0,Q.Z)(e),[1,2,-3],(0,Q.Z)(e),[1,1,-3],(0,Q.Z)(e),[0,1,0],(0,Q.Z)(e),[0,0,0],(0,Q.Z)(e),[1,0,0],(0,Q.Z)(e),[1,2,-3],(0,Q.Z)(e),[1,1,-3],(0,Q.Z)(e),[0,1,0],(0,Q.Z)(e),[0,0,0],(0,Q.Z)(e)),normals:[-1,2,1,2,-1,1,1,-1,1,1,-1,1,-1,-1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function Nt(t){var e=t.coordinates,n=[];if(!Array.isArray(e[0]))return{vertices:[],indices:[],normals:[],size:6,count:0};var r=function(t){var e=t;Array.isArray(e)&&Array.isArray(e[0])&&Array.isArray(e[0][0])&&(e=t.flat());var n=0;if(e.length<2)return{results:e,totalDistance:0};var r=[],i=zt(e[0],n);r.push(i);for(var o=1;o<e.length-1;o++){n+=Ft(e[o-1],e[o]);var a=zt(e[o],n);r.push(a),r.push(a)}return n+=Ft(e[e.length-2],e[e.length-1]),r.push(zt(e[e.length-1],n)),{results:r,totalDistance:n}}(e),i=r.results,o=r.totalDistance;return i.map((function(t){n.push(t[0],t[1],t[2],t[3],0,o)})),{vertices:n,indices:[],normals:[],size:6,count:i.length}}function Ft(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function zt(t,e){return t.length<3&&t.push(0),void 0!==e&&t.push(e),t}function Bt(t){var e=t.coordinates,n=et().flatten(e),r=n.vertices,i=n.dimensions,o=n.holes;return{indices:et()(r,o,i),vertices:r,size:i}}function jt(t){var e=t.coordinates,n=et().flatten(e),r=n.vertices,i=n.dimensions,o=n.holes;return{indices:et()(r,o,i),vertices:Ut(r),size:i+4}}function Ut(t){for(var e=[],n=(0,x.calculatePointsCenterAndRadius)(t),r=n.center,i=n.radius,o=0;o<t.length;o+=2){var a=t[o],s=t[o+1];e.push.apply(e,[a,s,0].concat((0,Q.Z)(r),[i]))}return e}function Zt(t){var e=_t(t.coordinates,!0);return{vertices:e.positions,indices:e.index,normals:e.normals,size:5}}function Vt(t){var e,n,r,i,o,a,s=(e=t.shape,o=Ct[e]?Ct[e]():Ct.circle(),a=-1===["cylinder","triangleColumn","hexagonColumn","squareColumn"].indexOf(e)?(n=[o],r=et().flatten(n),i=et()(r.vertices,r.holes,r.dimensions),{positions:r.vertices,index:i}):function(t){var e=t[0][0],n=t[0][t[0].length-1];e[0]===n[0]&&e[1]===n[1]&&(t[0]=t[0].slice(0,t[0].length-1));for(var r=t[0].length,i=et().flatten(t),o=i.vertices,a=i.dimensions,s=[],u=[],l=0;l<o.length/a;l++)2===a?s.push(o[2*l],o[2*l+1],1):s.push(o[3*l],o[3*l+1],1);var c=et()(i.vertices,i.holes,i.dimensions);u.push.apply(u,(0,Q.Z)(c));for(var h=function(){var t=i.vertices.slice(p*a,(p+1)*a),e=i.vertices.slice((p+1)*a,(p+2)*a);0===e.length&&(e=i.vertices.slice(0,a));var n=s.length/3;s.push(t[0],t[1],1,e[0],e[1],1,t[0],t[1],0,e[0],e[1],0),u.push.apply(u,(0,Q.Z)([0,2,1,2,3,1].map((function(t){return t+n}))))},p=0;p<r;p++)h();return{positions:s,index:u}}([o]),a);return{vertices:s.positions,indices:s.index,size:3}}function Gt(t){var e=t.coordinates;return{vertices:[].concat((0,Q.Z)(e[0]),[0,0,1,e[1][0],e[0][1],0,1,1],(0,Q.Z)(e[1]),[0,1,0],(0,Q.Z)(e[0]),[0,0,1],(0,Q.Z)(e[1]),[0,1,0,e[0][0],e[1][1],0,0,0]),indices:[0,1,2,3,4,5],size:5}}function Ht(t,e){for(var n=e||30,r=t.coordinates,i=[],o=[],a=function(t){i.push(t,1,t,r[0][0],r[0][1],r[1][0],r[1][1],t,-1,t,r[0][0],r[0][1],r[1][0],r[1][1]),t!==n-1&&o.push.apply(o,(0,Q.Z)([0,1,2,1,3,2].map((function(e){return 2*t+e}))))},s=0;s<n;s++)a(s);return{vertices:i,indices:o,size:7}}function Wt(t){var e=t.coordinates;2===e.length&&e.push(0);var n=qt(-1,1),r=qt(1,1),i=qt(-1,-1),o=qt(1,-1);return{vertices:[].concat((0,Q.Z)(e),(0,Q.Z)(n),(0,Q.Z)(e),(0,Q.Z)(i),(0,Q.Z)(e),(0,Q.Z)(o),(0,Q.Z)(e),(0,Q.Z)(r)),indices:[0,1,2,3,0,2],size:5}}function qt(t,e){return[(t+1)/2,(e+1)/2]}function Yt(){var t=st(it,{segments:36});return{vertices:t.positionsArr,indices:t.indicesArr,size:5,normals:t.normalArr}}function Xt(){var t=st(it+40,{segments:36});return{vertices:t.positionsArr,indices:t.indicesArr,size:5,normals:t.normalArr}}var $t=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.baseColor,i=void 0===r?"rgb(16,16,16)":r,o=t.brightColor,a=void 0===o?"rgb(255,176,38)":o,s=t.windowColor,u=void 0===s?"rgb(30,60,89)":s,l=t.time,c=void 0===l?0:l,h=t.sweep,p=void 0===h?{enable:!1,sweepRadius:1,sweepColor:"rgb(255, 255, 255)",sweepSpeed:.4,sweepCenter:this.cityCenter}:h;return{u_cityCenter:p.sweepCenter||this.cityCenter,u_cityMinSize:this.cityMinSize*p.sweepRadius,u_circleSweep:p.enable?1:0,u_circleSweepColor:(0,x.rgb2arr)(p.sweepColor).slice(0,3),u_circleSweepSpeed:p.sweepSpeed,u_opacity:n,u_baseColor:(0,x.rgb2arr)(i),u_brightColor:(0,x.rgb2arr)(a),u_windowColor:(0,x.rgb2arr)(u),u_time:this.layer.getLayerAnimateTime()||c}}},{key:"calCityGeo",value:function(){var t=(0,A.Z)(this.layer.getSource().extent,4),e=t[0],n=t[1],r=t[2],i=t[3];if("GAODE2.x"===this.mapService.version){this.cityCenter=this.mapService.lngLatToCoord([(r+e)/2,(i+n)/2]);var o=this.mapService.lngLatToCoord([r,i]),a=this.mapService.lngLatToCoord([e,n]);this.cityMinSize=Math.sqrt(Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2))/4}else{var s=r-e,u=i-n;this.cityCenter=[(r+e)/2,(i+n)/2],this.cityMinSize=Math.sqrt(Math.pow(s,2)+Math.pow(u,2))/4}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.calCityGeo(),this.startModelAnimate(),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:'precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\n\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvarying vec4 v_Color;\nuniform mat4 u_Mvp;\n\nuniform float u_circleSweep;\nuniform vec2 u_cityCenter;\n\nvarying float v_worldDis;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n v_texCoord = a_Uv;\n\n if(u_circleSweep > 0.0) {\n vec2 lnglatscale = vec2(0.0);\n if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {\n lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);\n }\n v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'uniform float u_opacity: 1.0;\nuniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\nuniform float u_near : 0;\nuniform float u_far : 1;\nvarying vec4 v_Color;\nvarying vec2 v_texCoord;\nuniform float u_Zoom : 1;\nuniform float u_time;\n\nuniform float u_circleSweep;\nuniform float u_cityMinSize;\nuniform vec3 u_circleSweepColor;\nuniform float u_circleSweepSpeed;\n\nvarying float v_worldDis;\n\n#pragma include "picking"\n\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\n float s = step(hot, n);\n vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\n\n return mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\n\nfloat LinearizeDepth()\n{\n float z = gl_FragCoord.z * 2.0 - 1.0;\n return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\n\nvec3 fog(vec3 color, vec3 fogColor, float depth){\n float fogFactor=clamp(depth,0.0,1.0);\n vec3 output_color=mix(fogColor,color,fogFactor);\n return output_color;\n}\n\nfloat sdRect(vec2 p, vec2 sz) {\n vec2 d = abs(p) - sz;\n float outside = length(max(d, 0.));\n float inside = min(max(d.x, d.y), 0.);\n return outside + inside;\n}\n\nvoid main() {\n gl_FragColor = v_Color;\n vec3 baseColor = u_baseColor.xyz;\n vec3 brightColor = u_brightColor.xyz;\n vec3 windowColor = u_windowColor.xyz;\n float targetColId = 5.;\n float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\n vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\n if(v_texCoord.x < 0.) { //顶部颜色\n vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\n gl_FragColor = vec4( foggedColor, v_Color.w);\n }else { // 侧面颜色\n vec2 st = v_texCoord;\n vec2 UvScale = v_texCoord;\n float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\n float tStart = 0.25 * tStep;\n float tEnd = 0.75 * tStep;\n float u = mod(UvScale.x, tStep);\n float v = mod(UvScale.y, tStep);\n float ux = floor(UvScale.x/tStep);\n float uy = floor(UvScale.y/tStep);\n float n = random(vec2(ux,uy));\n float lightP = u_time;\n float head = 1.0- step(0.005,st.y);\n /*step3*/\n // 将窗户颜色和墙面颜色区别开来\n float sU = step(tStart, u) - step(tEnd, u);\n float sV = step(tStart, v) - step(tEnd, v);\n vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\n float dist = sdRect(vec2(u,v), windowSize);\n float s = sU * sV;\n\n float curColId = floor(UvScale.x / tStep);\n float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\n\n float mLightP = mod(lightP, 2.);\n float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\n if(ux == targetColId){\n n =0.;\n }\n float timeP = min(0.75, abs ( sin(u_time/3.0) ) );\n float hot = smoothstep(1.0,0.0,timeP);\n vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\n //vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);\n float sFinal = s * sCol * sRow;\n color += mix(baseColor, brightColor, sFinal*n);\n if (st.y<0.01){\n color = baseColor;\n }\n if(head ==1.0) { // 顶部亮线\n color = brightColor;\n }\n color = color * v_Color.rgb;\n\n vec3 foggedColor = fog(color,fogColor,depth);\n\n gl_FragColor = vec4(foggedColor,1.0);\n }\n\n\n if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {\n float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);\n gl_FragColor.rgb += r * r * u_circleSweepColor;\n }\n \n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Zt,depth:{enable:!0},cull:{enable:!0,face:i.gl.BACK}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?10:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),f}(H);var Kt=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","CityBuildingLayer"),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layerModel=new $t(this),t.next=3,this.initLayerModels();case 3:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"setLight",value:function(t){this.updateLayerConfig({time:t})}},{key:"getModelType",value:function(){return"citybuilding"}}]),f}(V);var Jt=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"radian",0),(0,p.Z)((0,u.Z)(t),"planeGeometryTriangulation",(function(){var e=t.layer.getLayerConfig().center,n=void 0===e?[120,30]:e;return{size:4,indices:[0,1,2,2,3,0],vertices:[].concat((0,Q.Z)(n),[1,1],(0,Q.Z)(n),[0,1],(0,Q.Z)(n),[0,0],(0,Q.Z)(n),[1,0])}})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=t.width,r=void 0===n?1:n,i=t.height,o=void 0===i?1:i,a=t.raisingHeight,s=void 0===a?0:a,u=1;return"GAODE2.x"!==this.mapService.version&&"GAODE1.x"!==this.mapService.version||(u=-1),this.radian=u*Math.PI*(this.mapService.getRotation()%360)/180,{u_raisingHeight:Number(s),u_RotateMatrix:new Float32Array([Math.cos(this.radian),Math.sin(this.radian),-Math.sin(this.radian),Math.cos(this.radian)]),u_opacity:e||1,u_texture:this.texture,u_size:[r,o]}}},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy()}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.drawCanvas,r=this.rendererService.createTexture2D,this.texture=r({height:0,width:0}),n&&this.updateTexture(n),t.next=6,this.layer.buildLayerModel({moduleName:"geometryBillboard",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform float u_raisingHeight: 0.0;\nuniform mat4 u_Mvp;\nuniform float u_opacity;\nuniform vec2 u_size: [1.0, 1.0];\nuniform mat2 u_RotateMatrix;\n\nattribute vec3 a_Extrude;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nattribute vec3 a_Color;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\n\n#pragma include "projection"\n#pragma include "picking"\nvoid main() {\n vec3 extrude = a_Extrude;\n v_Color = a_Color;\n v_uv = a_Uv;\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n // 计算经纬度点位坐标\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\n // 计算绕 z 轴旋转后的偏移\n vec2 offsetXY = project_pixel(u_RotateMatrix * vec2(extrude.x * u_size.x, 0.0));\n // 绕 z 轴旋转\n float x = project_pos.x + offsetXY.x;\n float y = project_pos.y + offsetXY.y;\n // z 轴不参与旋转\n float z = project_pixel(extrude.y * u_size.y + raiseHeight);\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));\n gl_Position = u_Mvp * (vec4(x, y, z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(x , y, z , 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nuniform sampler2D u_texture;\nuniform float u_opacity;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\n\n#pragma include "picking"\nvoid main() {\n gl_FragColor = texture2D(u_texture, vec2(v_uv.x, 1.0 - v_uv.y));\n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:this.planeGeometryTriangulation,primitive:i.gl.TRIANGLES,depth:{enable:!0}});case 6:return o=t.sent,t.abrupt("return",[o]);case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"updateTexture",value:function(t){var e=this.rendererService.createTexture2D,n=this.layer.getLayerConfig(),r=n.canvasWidth,o=void 0===r?1:r,a=n.canvasHeight,s=void 0===a?1:a,u=document.createElement("canvas");u.width=o,u.height=s,u.getContext("2d")&&(t(u),this.texture=e({data:u,width:u.width,height:u.height,wrapS:i.gl.CLAMP_TO_EDGE,wrapT:i.gl.CLAMP_TO_EDGE}),this.layerService.reRender())}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:i.AttributeType.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r){var i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[2],n[3]]}}})}}]),g}(H);var Qt=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"terrainImageLoaded",!1),(0,p.Z)((0,u.Z)(t),"planeGeometryTriangulation",(function(){var e,n=t.layer.getLayerConfig(),r=n.width,i=void 0===r?1:r,o=n.height,a=void 0===o?1:o,s=n.widthSegments,u=void 0===s?1:s,l=n.heightSegments,c=void 0===l?1:l,h=n.center,p=void 0===h?[120,30]:h,f=n.terrainTexture,d=(e=t).initPlane.apply(e,[i,a,u,c].concat((0,Q.Z)(p))),m=d.indices,g=d.positions;return f&&t.loadTerrainTexture(g,m),{vertices:g,indices:m,size:5}})),t}return(0,s.Z)(g,[{key:"initPlane",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:120,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:30,a=t/2,s=e/2,u=Math.floor(n),l=Math.floor(r),c=u+1,h=l+1,p=t/u,f=e/l,d=[],m=[],g=0;g<h;g++)for(var y=g*f-s,v=0;v<c;v++){var _=v*p-a;if(this.mapService.version===M.G["GAODE2.x"]){var b=this.mapService.lngLatToCoord([_+i,-y+o]),x=(0,A.Z)(b,2),w=x[0],S=x[1];m.push(w,S,0)}else m.push(_+i,-y+o,0);m.push(v/u),m.push(1-g/l)}for(var E=0;E<l;E++)for(var T=0;T<u;T++){var C=T+c*E,O=T+c*(E+1),P=T+1+c*(E+1),k=T+1+c*E;d.push(C,O,k),d.push(O,P,k)}return{indices:d,positions:m}}},{key:"getUninforms",value:function(){var t,e=this.layer.getLayerConfig(),n=e.opacity,r=e.mapTexture,i=e.terrainClipHeight,o=void 0===i?0:i,a=e.terrainTexture;return this.mapTexture!==r&&(this.mapTexture=r,null===(t=this.texture)||void 0===t||t.destroy(),this.updateTexture(r)),{u_opacity:n||1,u_mapFlag:r?1:0,u_terrainClipHeight:a?o:-1,u_texture:this.texture}}},{key:"clearModels",value:function(){var t;this.terrainImage=null,null===(t=this.texture)||void 0===t||t.destroy()}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.mapTexture,this.mapTexture=n,r=this.rendererService.createTexture2D,this.texture=r({height:0,width:0}),this.updateTexture(n),t.next=7,this.layer.buildLayerModel({moduleName:"geometryPlane",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\n\nuniform mat4 u_Mvp;\nuniform float u_opacity;\nuniform float u_terrainClipHeight;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nattribute vec3 a_Color;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\nvarying float v_clip;\n\n#pragma include "projection"\n#pragma include "picking"\nvoid main() {\n v_Color = a_Color;\n v_uv = a_Uv;\n \n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n v_clip = 1.0;\n if(a_Position.z < u_terrainClipHeight) {\n v_clip = 0.0;\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n\n // float x = 1.0;\n // float y = 0.0;\n // float z = 0.0;\n // mat3 translateMatrix = mat3(\n // 1.0, 0.0, 0.0 \n // 0.0, 1.0, 0.0\n // -project_pos.x, -project_pos.y, 1.0\n // );\n // mat4 translateMatrix = mat4(\n // 1.0, 0.0, 0.0, 0.0 ,\n // 0.0, 1.0, 0.0, 0.0,\n // 0.0, 0.0, 1.0, 0.0,\n // 1.0, 0.0, 0.0, 1.0\n // );\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, a_Position.z, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nuniform sampler2D u_texture;\nuniform float u_mapFlag;\nuniform float u_opacity;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\nvarying float v_clip;\n\n#pragma include "picking"\nvoid main() {\n // gl_FragColor = vec4(v_Color, u_opacity);\n if(u_mapFlag > 0.0) {\n gl_FragColor = texture2D(u_texture, vec2(v_uv.x, 1.0 - v_uv.y));\n gl_FragColor.a *= u_opacity;\n } else {\n // gl_FragColor = vec4(v_uv, 0.0, u_opacity);\n gl_FragColor = vec4(v_Color, u_opacity);\n }\n gl_FragColor.a *= v_clip;\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:this.planeGeometryTriangulation,primitive:i.gl.TRIANGLES,depth:{enable:!0},cull:{enable:!0,face:i.gl.BACK}});case 7:return o=t.sent,t.abrupt("return",[o]);case 9:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"createModelData",value:function(t){if(t){var e=this.layer.getLayerConfig(),n=e.widthSegments,r=e.heightSegments,i=e.width,o=e.height,a=t,s=a.widthSegments,u=a.heightSegments,l=a.width,c=a.height;this.layer.style({widthSegments:void 0!==s?s:n,heightSegments:void 0!==u?u:r,width:void 0!==l?l:i,height:void 0!==c?c:o})}var h=this.layer.getEncodedData();return this.styleAttributeService.createAttributesAndIndices(h,this.planeGeometryTriangulation)}},{key:"updateTexture",value:function(t){var e=this,n=this.rendererService.createTexture2D;if(t){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.texture=n({data:r,width:r.width,height:r.height,wrapS:i.gl.CLAMP_TO_EDGE,wrapT:i.gl.CLAMP_TO_EDGE}),e.layerService.reRender()},r.src=t}else this.texture=n({width:0,height:0})}},{key:"getImageData",value:function(t){var e=document.createElement("canvas"),n=e.getContext("2d"),r=t.width,i=t.height;return e.width=r,e.height=i,n.drawImage(t,0,0,r,i),n.getImageData(0,0,r,i)}},{key:"translateVertex",value:function(t,e,n,r,i,o){for(var a=n.width,s=n.height,u=this.getImageData(n).data,l=Math.floor(r),c=Math.floor(i),h=l+1,p=c+1,f=a/l,d=s/c,m=0;m<p;m++)for(var g=Math.floor(m*d)*a,y=0;y<h;y++){var v=4*(g+Math.floor(y*f)),_=u[v],b=u[v+1],x=u[v+2];t[5*(m*h+y)+2]=o(_,b,x)}var w=this.layer.getEncodedData(),S=this.styleAttributeService.createAttributesAndIndices(w,(function(){return{vertices:t,indices:e,size:5}}));this.layer.updateModelData(S),this.layerService.throttleRenderLayers()}},{key:"loadTerrainTexture",value:function(t,e){var n=this,r=this.layer.getLayerConfig(),i=r.widthSegments,o=void 0===i?1:i,a=r.heightSegments,s=void 0===a?1:a,u=r.terrainTexture,l=r.rgb2height,c=void 0===l?function(t,e,n){return t+e+n}:l;if(this.terrainImage)this.terrainImageLoaded?this.translateVertex(t,e,this.terrainImage,o,s,c):this.terrainImage.onload=function(){n.translateVertex(t,e,n.terrainImage,o,s,c)};else{var h=new Image;this.terrainImage=h,h.crossOrigin="anonymous",h.onload=function(){n.terrainImageLoaded=!0,setTimeout((function(){return n.layer.emit("terrainImageLoaded",null)})),n.translateVertex(t,e,h,o,s,c)},h.src=u}}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),g}(H);var te=function(t){return t.UP="up",t.DOWN="down",t}(te||{});const ee={plane:Qt,sprite:function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"planeGeometryUpdateTriangulation",(function(){for(var e=t.layer.getLayerConfig().spriteBottom,n=void 0===e?-1e5:e,r=t.spriteUpdate,i=n,o=t.spriteTop,a=0;a<t.positions.length;a+=5)t.spriteAnimate===te.UP?(t.positions[a+2]+=r,t.positions[a+2]>o&&(t.positions[a+2]=i)):(t.positions[a+2]-=r,t.positions[a+2]<i&&(t.positions[a+2]=o));return{vertices:t.positions,indices:t.indices,size:5}})),(0,p.Z)((0,u.Z)(t),"updateModel",(function(){var e=t.layer.createAttributes({triangulation:t.planeGeometryUpdateTriangulation});t.layer.models.map((function(t){t.updateAttributes(e)})),t.layerService.throttleRenderLayers(),t.timer=requestAnimationFrame(t.updateModel)})),(0,p.Z)((0,u.Z)(t),"planeGeometryTriangulation",(function(){var e,n=t.layer.getLayerConfig(),r=n.center,i=void 0===r?[120,30]:r,o=n.spriteCount,a=void 0===o?100:o,s=n.spriteRadius,u=void 0===s?10:s,l=(e=t).initSprite.apply(e,[u,a].concat((0,Q.Z)(i))),c=l.indices,h=l.positions;return t.positions=h,t.indices=c,{vertices:h,indices:c,size:5}})),t}return(0,s.Z)(g,[{key:"initSprite",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:120,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,i=[],o=[],a=this.mapService,s=this.spriteAnimate===te.UP?-this.spriteTop:this.spriteTop,u=0;u<e;u++){var l=Math.random()*s;o.push.apply(o,(0,Q.Z)(h(l)))}for(var c=0;c<e;c++)i.push(c);function h(e){var i=t*Math.random(),o=t*Math.random(),s=-t/2+i,u=-t/2+o;if(a.version===M.G["GAODE2.x"]){var l=a.lngLatToCoord([s+n,-u+r]),c=(0,A.Z)(l,2);return[c[0],c[1],e,0,0]}return[s+n,-u+r,e,0,0]}return{indices:i,positions:o}}},{key:"getUninforms",value:function(){var t,e=this.layer.getLayerConfig(),n=e.opacity,r=e.mapTexture,i=e.spriteScale,o=void 0===i?1:i;return this.mapTexture!==r&&(this.mapTexture=r,null===(t=this.texture)||void 0===t||t.destroy(),this.updateTexture(r)),{u_opacity:n||1,u_mapFlag:r?1:0,u_texture:this.texture,u_Scale:o}}},{key:"clearModels",value:function(){var t;cancelAnimationFrame(this.timer),null===(t=this.texture)||void 0===t||t.destroy()}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u,l,c,h,p=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.mapTexture,r=e.spriteTop,o=void 0===r?5e6:r,a=e.spriteUpdate,s=void 0===a?1e4:a,u=e.spriteAnimate,l=void 0===u?te.DOWN:u,this.mapTexture=n,this.spriteTop=o,this.spriteUpdate=s,this.spriteAnimate="up"===l?te.UP:te.DOWN,c=this.rendererService.createTexture2D,this.texture=c({height:0,width:0}),this.updateTexture(n),setTimeout((function(){p.updateModel()}),100),t.next=11,this.layer.buildLayerModel({moduleName:"geometrySprite",vertexShader:'precision highp float;\n\nattribute vec3 a_Position;\nattribute vec3 a_Color;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_opacity;\nuniform float u_Scale;\nvarying vec3 v_Color;\nvarying float v_d;\n\n#pragma include "projection"\nvoid main() {\n v_Color = a_Color;\n \n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n v_d = a_Position.z;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, a_Position.z, 1.0));\n }\n\n gl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale;\n}\n',fragmentShader:"\nuniform sampler2D u_texture;\nuniform float u_mapFlag;\nuniform float u_opacity;\n\nvarying vec3 v_Color;\nvarying float v_d;\n\nvoid main() {\n\n if(v_d < 0.0) {\n discard;\n }\n\n if(u_mapFlag > 0.0) {\n gl_FragColor = texture2D(u_texture, gl_PointCoord);\n gl_FragColor.a *= u_opacity;\n } else {\n gl_FragColor = vec4(v_Color, u_opacity);\n }\n}\n",triangulation:this.planeGeometryTriangulation,primitive:i.gl.POINTS,depth:{enable:!1},blend:this.getBlend()});case 11:return h=t.sent,t.abrupt("return",[h]);case 13:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"updateTexture",value:function(t){var e=this,n=this.rendererService.createTexture2D;if(t){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.texture=n({data:r,width:r.width,height:r.height,wrapS:i.gl.CLAMP_TO_EDGE,wrapT:i.gl.CLAMP_TO_EDGE}),e.layerService.reRender()},r.src=t}else this.texture=n({width:0,height:0})}},{key:"registerBuiltinAttributes",value:function(){return""}}]),g}(H),billboard:Jt};var ne=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","GeometryLayer"),(0,p.Z)((0,u.Z)(t),"defaultSourceConfig",{data:[{x:0,y:0}],options:{parser:{type:"json",x:"x",y:"y"}}}),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new ee[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getDefaultConfig",value:function(){return{plane:{},sprite:{},billboard:{}}[this.getModelType()]}},{key:"getModelType",value:function(){var t,e=this.styleAttributeService.getLayerStyleAttribute("shape"),n=null==e||null===(t=e.scale)||void 0===t?void 0:t.field;return"plane"===n?"plane":"sprite"===n?"sprite":"billboard"===n?"billboard":"plane"}}]),f}(V);var re=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig();return{u_opacity:t.opacity||1,u_coverage:t.coverage||.9,u_angle:t.angle||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"heatmapGrid",vertexShader:'precision highp float;\r\n// 多边形顶点坐标\r\nattribute vec3 a_Position;\r\n// 多边形经纬度坐标\r\nattribute vec3 a_Pos;\r\nattribute float a_Size;\r\nattribute vec4 a_Color;\r\nuniform vec2 u_radius;\r\nuniform float u_coverage: 0.9;\r\nuniform float u_angle: 0;\r\nuniform mat4 u_ModelMatrix;\r\nuniform mat4 u_Mvp;\r\nvarying vec4 v_color;\r\n\r\nuniform vec2 u_sceneCenterMercator;\r\n\r\n#pragma include "projection"\r\n#pragma include "project"\r\n#pragma include "picking"\r\n\r\nvoid main() {\r\n v_color = a_Color;\r\n\r\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r\n vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r\n // vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n // gl_Position = project_common_position_to_clipspace(project_pos);\r\n\r\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // 将经纬度转换为高德2.0需要的平面坐标\r\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r\n gl_Position = u_Mvp * (project_pos);\r\n } else {\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n gl_Position = project_common_position_to_clipspace(project_pos);\r\n }\r\n\r\n setPickingColor(a_PickingColor);\r\n}\r\n',fragmentShader:'precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include "picking"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Vt,primitive:i.gl.TRIANGLES,depth:{enable:!1}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:i.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t){var e="GAODE2.x"===t.version?t.originCoordinates:t.coordinates;return[e[0],e[1],0]}}})}}]),f}(H);var ie,oe=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig();return{u_opacity:t.opacity||1,u_coverage:t.coverage||1,u_angle:t.angle||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"heatmapGrid3d",vertexShader:'precision highp float;\n// 多边形顶点坐标\nattribute vec3 a_Position;\n// 多边形经纬度坐标\nattribute vec3 a_Pos;\n\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform vec2 u_sceneCenterMercator;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "light"\n#pragma include "picking"\n\n\nvoid main() {\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n \n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // 经纬度\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // 将经纬度转换为高德2.0需要的平面坐标\n vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0));\n\n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0);\n } else {\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // 实际的经纬度\n vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n \n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = project_common_position_to_clipspace(project_pos);\n }\n\n\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include "picking"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Lt,primitive:i.gl.TRIANGLES,depth:{enable:!0}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size;return Array.isArray(e)?[e[0]]:[e]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:i.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t){var e="GAODE2.x"===t.version?t.originCoordinates:t.coordinates;return[e[0],e[1],0]}}})}}]),f}(H),ae=n(7745);n(171);var se=(0,ae.b2)()(ie=function(t){(0,l.Z)(m,t);var e,n,r,u,p,f=(u=m,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(u);if(p){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function m(){return(0,a.Z)(this,m),f.apply(this,arguments)}return(0,s.Z)(m,[{key:"render",value:function(t){var e=this,n=this.rendererService,r=n.clear,i=n.useFramebuffer,o=this.layer.getLayerConfig().rampColors;i(this.heatmapFramerBuffer,(function(){r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:e.heatmapFramerBuffer}),e.drawIntensityMode()})),(0,S.isEqual)(this.preRampColors,o)||this.updateColorTexture(),"heatmap"===this.shapeType?this.drawColorMode(t):this.draw3DHeatMap(t)}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:(r=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u,l,c,h;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.rendererService,r=n.createFramebuffer,o=n.getViewportSize,a=n.createTexture2D,s=this.styleAttributeService.getLayerStyleAttribute("shape"),u=(null==s||null===(e=s.scale)||void 0===e?void 0:e.field)||"heatmap",this.shapeType=u,t.next=6,this.buildHeatMapIntensity();case 6:return this.intensityModel=t.sent,this.colorModel="heatmap"===u?this.buildHeatmapColor():this.build3dHeatMap(),l=o(),c=l.width,h=l.height,this.heatmapFramerBuffer=r({color:a({width:Math.floor(c/4),height:Math.floor(h/4),wrapS:i.gl.CLAMP_TO_EDGE,wrapT:i.gl.CLAMP_TO_EDGE,min:i.gl.LINEAR,mag:i.gl.LINEAR}),depth:!1}),this.updateColorTexture(),t.abrupt("return",[this.intensityModel,this.colorModel]);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"buildModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"dir",type:i.AttributeType.Attribute,descriptor:{name:"a_Dir",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size;return[void 0===e?1:e]}}})}},{key:"buildHeatMapIntensity",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layer.triangulation=Wt,t.next=3,this.layer.buildLayerModel({moduleName:"heatmapIntensity",vertexShader:'precision highp float;\nattribute vec3 a_Position;\nattribute float a_Size;\nattribute vec2 a_Dir;\nuniform float u_intensity;\nuniform float u_radius;\nvarying vec2 v_extrude;\nvarying float v_weight;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#define GAUSS_COEF 0.3989422804014327\n\n#pragma include "projection"\n\nvoid main(){\n v_weight = a_Size;\n float ZERO = 1.0 / 255.0 / 16.0;\n float extrude_x = a_Dir.x * 2.0 -1.0;\n float extrude_y = a_Dir.y * 2.0 -1.0;\n vec2 extrude_dir = normalize(vec2(extrude_x,extrude_y));\n float S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 2.5;\n v_extrude = extrude_dir * S;\n\n vec2 offset = project_pixel(v_extrude * u_radius);\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, 0.0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n }\n}\n',fragmentShader:"precision highp float;\nuniform float u_intensity;\nvarying float v_weight;\nvarying vec2 v_extrude;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(){\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = v_weight * u_intensity * GAUSS_COEF * exp(d);\n gl_FragColor = vec4(val, 1., 1., 1.);\n}\n",triangulation:Wt,depth:{enable:!1},cull:{enable:!0,face:(0,x.getCullFace)(this.mapService.version)}});case 3:return e=t.sent,t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"buildHeatmapColor",value:function(){this.shaderModuleService.registerModule("heatmapColor",{vs:"precision highp float;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvoid main() {\n v_texCoord = a_Uv;\n\n gl_Position = vec4(a_Position.xy, 0, 1.);\n}\n",fs:"uniform sampler2D u_texture; // 热力强度图\nuniform sampler2D u_colorTexture; // 根据强度分布的色带\nuniform float u_opacity;\nvarying vec2 v_texCoord;\n\nuniform vec2 u_ViewportSize;\n\nfloat getBlurIndusty() {\n float vW = 2.0/u_ViewportSize.x;\n float vH = 2.0/u_ViewportSize.y;\n vec2 vUv = v_texCoord;\n float i11 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y + 1.0 * vH) ).r;\n float i12 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y + 1.0 * vH) ).r;\n float i13 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y + 1.0 * vH) ).r;\n\n float i21 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y) ).r;\n float i22 = texture2D( u_texture, vec2( vUv.x , vUv.y) ).r;\n float i23 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y) ).r;\n\n float i31 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y-1.0*vH) ).r;\n float i32 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y-1.0*vH) ).r;\n float i33 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y-1.0*vH) ).r;\n\n return(\n i11 + \n i12 + \n i13 + \n i21 + \n i21 + \n i22 + \n i23 + \n i31 + \n i32 + \n i33\n )/9.0;\n}\n\n\nvoid main(){\n // float intensity = texture2D(u_texture, v_texCoord).r;\n float intensity = getBlurIndusty();\n vec4 color = texture2D(u_colorTexture, vec2(intensity, 0.0));\n\n gl_FragColor =color;\n gl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;\n\n}\n"});var t=this.shaderModuleService.getModule("heatmapColor"),e=t.vs,n=t.fs,r=t.uniforms,o=this.rendererService,a=o.createAttribute,s=o.createElements,u=o.createBuffer;return(0,o.createModel)({vs:e,fs:n,attributes:{a_Position:a({buffer:u({data:[-1,1,0,1,1,0,-1,-1,0,1,-1,0],type:i.gl.FLOAT}),size:3}),a_Uv:a({buffer:u({data:[0,1,1,1,0,0,1,0],type:i.gl.FLOAT}),size:2})},uniforms:(0,g.Z)({},r),depth:{enable:!1},elements:s({data:[0,2,1,2,3,1],type:i.gl.UNSIGNED_INT,count:6})})}},{key:"drawIntensityMode",value:function(){var t,e=this.layer.getLayerConfig(),n=e.opacity,r=e.intensity,o=void 0===r?10:r,a=e.radius,s=void 0===a?5:a;this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),null===(t=this.intensityModel)||void 0===t||t.draw({uniforms:{u_opacity:n||1,u_radius:s,u_intensity:o},blend:{enable:!0,func:{srcRGB:i.gl.ONE,srcAlpha:1,dstRGB:i.gl.ONE,dstAlpha:1}},stencil:{enable:!1,mask:255,func:{cmp:514,ref:1,mask:255}}}),this.layer.hooks.afterRender.call()}},{key:"drawColorMode",value:function(t){var e,n=this.layer.getLayerConfig().opacity;null===(e=this.colorModel)||void 0===e||e.draw({uniforms:{u_opacity:n||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer},blend:this.getBlend(),stencil:this.getStencil(t)})}},{key:"draw3DHeatMap",value:function(t){var e,n=this.layer.getLayerConfig().opacity,r=nt.create();nt.invert(r,this.cameraService.getViewProjectionMatrixUncentered()),null===(e=this.colorModel)||void 0===e||e.draw({uniforms:{u_opacity:n||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer,u_ViewProjectionMatrixUncentered:this.cameraService.getViewProjectionMatrixUncentered(),u_InverseViewProjectionMatrix:(0,Q.Z)(r)},blend:{enable:!0,func:{srcRGB:i.gl.SRC_ALPHA,srcAlpha:1,dstRGB:i.gl.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},stencil:this.getStencil(t)})}},{key:"build3dHeatMap",value:function(){var t=(0,this.rendererService.getViewportSize)(),e=function(t,e){for(var n=[],r=[],i=[],o=t+1,a=e+1,s=t/2,u=e/2,l=0;l<a;l++)for(var c=l-u,h=0;h<o;h++){var p=h-s;r.push(p/s,-c/u,0),i.push(h/t),i.push(1-l/e)}for(var f=0;f<e;f++)for(var d=0;d<t;d++){var m=d+o*f,g=d+o*(f+1),y=d+1+o*(f+1),v=d+1+o*f;n.push(m,g,v),n.push(g,y,v)}return{vertices:r,indices:n,uvs:i}}(t.width/4,t.height/4);this.shaderModuleService.registerModule("heatmap3dColor",{vs:'precision highp float;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_InverseViewProjectionMatrix;\nuniform mat4 u_ViewProjectionMatrixUncentered;\nvarying float v_intensity;\n\n\nvec2 toBezier(float t, vec2 P0, vec2 P1, vec2 P2, vec2 P3) {\n float t2 = t * t;\n float one_minus_t = 1.0 - t;\n float one_minus_t2 = one_minus_t * one_minus_t;\n return (P0 * one_minus_t2 * one_minus_t + P1 * 3.0 * t * one_minus_t2 + P2 * 3.0 * t2 * one_minus_t + P3 * t2 * t);\n}\nvec2 toBezier(float t, vec4 p){\n return toBezier(t, vec2(0.0, 0.0), vec2(p.x, p.y), vec2(p.z, p.w), vec2(1.0, 1.0));\n}\n#pragma include "projection"\nvoid main() {\n v_texCoord = a_Uv;\n\n vec2 pos = a_Uv * vec2(2.0) - vec2(1.0); // 将原本 0 -> 1 的 uv 转换为 -1 -> 1 的标准坐标空间(NDC)\n\n vec4 p1 = vec4(pos, 0.0, 1.0); // x/y 平面上的点(z == 0)可以认为是三维上的点被投影到平面后的点\n\tvec4 p2 = vec4(pos, 1.0, 1.0); // 平行于x/y平面、z==1 的平面上的点\n\n\tvec4 inverseP1 = u_InverseViewProjectionMatrix * p1; // 根据视图投影矩阵的逆矩阵平面上的反算出三维空间中的点(p1平面上的点)\n\tvec4 inverseP2 = u_InverseViewProjectionMatrix * p2;\n\n inverseP1 = inverseP1 / inverseP1.w; // 归一化操作(归一化后为世界坐标)\n\tinverseP2 = inverseP2 / inverseP2.w;\n\n\tfloat zPos = (0.0 - inverseP1.z) / (inverseP2.z - inverseP1.z); // ??\n\tvec4 position = inverseP1 + zPos * (inverseP2 - inverseP1);\n\n vec4 b= vec4(0.5000, 0.0, 1.0, 0.5000);\n float fh;\n\n v_intensity = texture2D(u_texture, v_texCoord).r;\n fh = toBezier(v_intensity, b).y;\n gl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0);\n \n}\n',fs:"uniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_opacity;\nvarying vec2 v_texCoord;\nvarying float v_intensity;\n\nvoid main(){\n \n float intensity = texture2D(u_texture, v_texCoord).r;\n vec4 color = texture2D(u_colorTexture,vec2(intensity, 0));\n gl_FragColor = color;\n // gl_FragColor.a = color.a * smoothstep(0.1,0.2,intensity)* u_opacity;\n gl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;\n}\n"});var n=this.shaderModuleService.getModule("heatmap3dColor"),r=n.vs,o=n.fs,a=n.uniforms,s=this.rendererService,u=s.createAttribute,l=s.createElements,c=s.createBuffer;return(0,s.createModel)({vs:r,fs:o,attributes:{a_Position:u({buffer:c({data:e.vertices,type:i.gl.FLOAT}),size:3}),a_Uv:u({buffer:c({data:e.uvs,type:i.gl.FLOAT}),size:2})},primitive:i.gl.TRIANGLES,uniforms:(0,g.Z)({},a),depth:{enable:!0},blend:{enable:!0,func:{srcRGB:i.gl.SRC_ALPHA,srcAlpha:1,dstRGB:i.gl.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},elements:l({data:e.indices,type:i.gl.UNSIGNED_INT,count:e.indices.length})})}},{key:"updateStyle",value:function(){this.updateColorTexture()}},{key:"updateColorTexture",value:function(){var t=this.rendererService.createTexture2D;this.texture&&this.texture.destroy();var e=this.layer.getLayerConfig().rampColors,n=(0,x.generateColorRamp)(e);this.colorTexture=t({data:new Uint8Array(n.data),width:n.width,height:n.height,wrapS:i.gl.CLAMP_TO_EDGE,wrapT:i.gl.CLAMP_TO_EDGE,min:i.gl.NEAREST,mag:i.gl.NEAREST,flipY:!1}),this.preRampColors=e}}]),m}(H))||ie;const ue={heatmap:se,heatmap3d:se,grid:re,grid3d:oe,hexagon:function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig();return{u_opacity:t.opacity||1,u_coverage:t.coverage||.9,u_angle:t.angle||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"heatmapHexagon",vertexShader:'precision highp float;\n// 多边形顶点坐标\nattribute vec3 a_Position;\n// 多边形经纬度坐标\nattribute vec3 a_Pos;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform vec2 u_sceneCenterMercator;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nvoid main() {\n v_color = a_Color;\n \n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\n \n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xy, 0., 1.0));\n // gl_Position = u_Mvp * (vec4(a_Pos.xy + offset, 0., 1.0));\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator;\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\n gl_Position = u_Mvp * vec4(project_pos.xy, 0.0, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include "picking"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Vt,depth:{enable:!1},primitive:i.gl.TRIANGLES});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:i.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t){var e="GAODE2.x"===t.version?t.originCoordinates:t.coordinates;return[e[0],e[1],0]}}})}}]),f}(H)};var le=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","HeatMapLayer"),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new ue[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"renderModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"heatmap"===this.getModelType()?(this.layerModel&&this.layerModel.render(e),this):(this.encodeDataLength<=0&&!this.forceRender||(this.hooks.beforeRender.call(),this.models.forEach((function(n){return n.draw({uniforms:t.layerModel.getUninforms(),blend:t.layerModel.getBlend(),stencil:t.layerModel.getStencil(e)})})),this.hooks.afterRender.call()),this)}},{key:"updateModelData",value:function(t){t.attributes&&t.elements?this.models[0].updateAttributesAndElements(t.attributes,t.elements):console.warn("data error")}},{key:"getModelType",value:function(){var t,e=this.styleAttributeService.getLayerStyleAttribute("shape"),n=this.getLayerConfig().shape3d,r=this.getSource().data.type,i=(null==e||null===(t=e.scale)||void 0===t?void 0:t.field)||"heatmap";return"heatmap"===i||"heatmap3d"===i?"heatmap":"hexagon"===r?-1===(null==n?void 0:n.indexOf(i))?"hexagon":"grid3d":"grid"===r?-1===(null==n?void 0:n.indexOf(i))?"grid":"grid3d":"heatmap"}}]),f}(V);const ce={image:function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){return{u_opacity:this.layer.getLayerConfig().opacity||1,u_texture:this.texture}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.layer.getSource(),n=this.rendererService.createTexture2D,this.texture=n({height:0,width:0}),!x.isMini){t.next=11;break}r=this.layerService.sceneService.getSceneConfig().canvas,(o=r.createImage()).crossOrigin="anonymous",o.src=e.data.originData,o.onload=function(){u.texture=n({data:o,width:o.width,height:o.height}),u.layerService.reRender()},t.next=15;break;case 11:return t.next=13,e.data.images;case 13:a=t.sent,this.texture=n({data:a[0],width:a[0].width,height:a[0].height,mag:i.gl.LINEAR,min:i.gl.LINEAR});case 15:return t.next=17,this.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include "projection"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n',fragmentShader:"precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nvoid main() {\n vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\n gl_FragColor = color;\n gl_FragColor.a *= u_opacity;\n if(gl_FragColor.a < 0.01)\n discard;\n}\n",triangulation:Gt,primitive:i.gl.TRIANGLES,blend:{enable:!0},depth:{enable:!1}});case 17:return s=t.sent,t.abrupt("return",[s]);case 19:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy()}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),f}(H)};var he=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","ImageLayer"),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new ce[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getDefaultConfig",value:function(){return{image:{}}[this.getModelType()]}},{key:"getModelType",value:function(){return"image"}}]),f}(V);var pe={solid:0,dash:1},fe=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas()}),void t.layer.render();t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.NEAREST,min:i.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.sourceColor,i=t.targetColor,o=t.textureBlend,a=void 0===o?"normal":o,s=t.lineType,u=void 0===s?"solid":s,l=t.dashArray,c=void 0===l?[10,5]:l,h=t.forward,p=void 0===h||h,f=t.lineTexture,d=void 0!==f&&f,m=t.iconStep,g=void 0===m?100:m,y=t.segmentNumber,v=void 0===y?30:y,_=t.thetaOffset,b=void 0===_?.314:_;2===c.length&&c.push(0,0);var w=0,E=[0,0,0,0],M=[0,0,0,0];return r&&i&&(E=(0,x.rgb2arr)(r),M=(0,x.rgb2arr)(i),w=1),this.rendererService.getDirty()&&this.texture.bind(),{u_thetaOffset:b,u_opacity:(0,S.isNumber)(n)?n:1,u_textureBlend:"normal"===a?0:1,segmentNumber:v,u_line_type:pe[u||"solid"],u_dash_array:c,u_blur:.9,u_lineDir:p?1:-1,u_texture:this.texture,u_line_texture:d?1:0,u_icon_step:g,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:w,u_sourceColor:E,u_targetColor:M}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_animate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){var t=this.layer.getLayerConfig(),e=t.sourceColor,n=t.targetColor;return"dash"===t.lineType?{frag:'\nuniform float u_opacity;\n\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\nvarying float v_distance_ratio;\n\nuniform float segmentNumber;\n\n\n#pragma include "picking"\n\nvoid main() {\n gl_FragColor = v_color;\n\n\n float flag = 0.;\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n };\n gl_FragColor.a *=flag;\n \n gl_FragColor = filterColor(gl_FragColor);\n}',vert:'\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nvarying vec4 v_color;\n\n\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nuniform float u_lineDir: 1.0;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\n\nuniform float u_thetaOffset: 0.314;\n\nuniform float u_opacity: 1.0;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat bezier3(vec3 arr, float t) {\n float ut = 1. - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\nvec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = arcThetaOffset;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\n if(u_lineDir == 1.0) { // 正向\n return mid;\n } else { // 逆向\n // (mid + vmin)/2 = (s + t)/2\n vec2 vmid = source + target - mid;\n return vmid;\n }\n // return mid;\n}\nfloat getSegmentRatio(float index) {\n // dash: index / (segmentNumber - 1.);\n // normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n return index / (segmentNumber - 1.);\n}\nvec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n vec2 mid = midPoint(source, target, arcThetaOffset);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x ,t), bezier3(y,t));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);\n \n vec2 source = a_Instance.rg; // 起始点\n vec2 target = a_Instance.ba; // 终点\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n\n v_distance_ratio = segmentIndex / segmentNumber;\n\n vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, u_thetaOffset), 0.0, 1.0));\n vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, u_thetaOffset), 0.0, 1.0));\n \n \n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\n }\n gl_PointSize = 5.0;\n setPickingColor(a_PickingColor);\n}\n',type:"Dash"}:e&&n?{frag:'varying vec4 v_color;\n\n#pragma include "picking"\n\nvoid main() {\n// 当前顶点在弧线中所处的分段位置\n\n gl_FragColor = v_color;\n gl_FragColor = filterColor(gl_FragColor);\n}',vert:'\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nvarying vec4 v_color;\nvarying float v_segmentIndex;\n\nuniform float u_lineDir: 1.0;\nuniform float u_opacity: 1.0;\n\nuniform float u_thetaOffset: 0.314;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\n\n\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat bezier3(vec3 arr, float t) {\n float ut = 1. - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\nvec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = arcThetaOffset;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\n if(u_lineDir == 1.0) { // 正向\n return mid;\n } else { // 逆向\n // (mid + vmin)/2 = (s + t)/2\n vec2 vmid = source + target - mid;\n return vmid;\n }\n // return mid;\n}\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n}\nvec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n vec2 mid = midPoint(source, target, arcThetaOffset);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x ,t), bezier3(y,t));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nvoid main() {\n v_color = a_Color;\n\n vec2 source = a_Instance.rg; // 起始点\n vec2 target = a_Instance.ba; // 终点\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n float d_distance_ratio;\n vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, u_thetaOffset), 0.0, 1.0));\n vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, u_thetaOffset), 0.0, 1.0));\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n //unProjCustomCoord\n \n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n\n\n float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置\n\n v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n v_color.a *= u_opacity;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n',type:"Linear"}:{frag:'\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_opacity;\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\nuniform float u_line_texture;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\n\nuniform float segmentNumber;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_lineData;\n\n\n#pragma include "picking"\n\nvoid main() {\n float animateSpeed = 0.0; // 运动速度\n gl_FragColor = v_color;\n \n gl_FragColor.a *= u_opacity;\n\n if(u_animate.x == Animate && u_line_texture != LineTexture) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_lineData.b, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a *= alpha;\n }\n\n // 当存在贴图时在底色上贴上贴图\n if(u_line_texture == LineTexture) { // while load texture\n float arcRadio = smoothstep( 0.0, 1.0, (v_lineData.r / segmentNumber));\n // float arcRadio = smoothstep( 0.0, 1.0, d_distance_ratio);\n\n float count = v_lineData.g; // 贴图在弧线上重复的数量\n\n float time = 0.0;\n if(u_animate.x == Animate) {\n time = u_time / u_animate.y;\n }\n float redioCount = arcRadio * count;\n\n float u = fract(redioCount - time);\n float v = v_lineData.a; // 横向 v\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n\n vec4 pattern = texture2D(u_texture, uv);\n\n if(u_animate.x == Animate) {\n float currentPlane = floor(redioCount - time);\n float textureStep = floor(count * u_animate.z);\n float a = mod(currentPlane, textureStep);\n if(a < textureStep - 1.0) {\n pattern = vec4(0.0);\n }\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= u_opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n \n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}',vert:'#define Animate 0.0\n#define LineTexture 1.0\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n\nuniform float u_lineDir: 1.0;\n\nuniform float u_thetaOffset: 0.314;\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_lineData;\nvarying vec2 v_distance_ratio;\n\nuniform float u_opacity: 1.0;\n\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat bezier3(vec3 arr, float t) {\n float ut = 1. - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\nvec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = arcThetaOffset;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\n if(u_lineDir == 1.0) { // 正向\n return mid;\n } else { // 逆向\n // (mid + vmin)/2 = (s + t)/2\n vec2 vmid = source + target - mid;\n return vmid;\n }\n // return mid;\n}\nfloat getSegmentRatio(float index) {\n // dash: index / (segmentNumber - 1.);\n // normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n // return index / (segmentNumber - 1.);\n}\nvec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n vec2 mid = midPoint(source, target, arcThetaOffset);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x ,t), bezier3(y,t));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nvoid main() {\n v_color = a_Color;\n\n vec2 source = a_Instance.rg; // 起始点\n vec2 target = a_Instance.ba; // 终点\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n float d_distance_ratio;\n \n if(u_animate.x == Animate) {\n d_distance_ratio = segmentIndex / segmentNumber;\n if(u_lineDir != 1.0) {\n d_distance_ratio = 1.0 - d_distance_ratio;\n }\n }\n\n v_lineData.b = d_distance_ratio;\n\n vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, u_thetaOffset), 0.0, 1.0));\n vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, u_thetaOffset), 0.0, 1.0));\n\n \n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n\n\n float d_segmentIndex = a_Position.x + 1.0; // 当前顶点在弧线中所处的分段位置\n v_lineData.r = d_segmentIndex;\n\n if(LineTexture == u_line_texture) { // 开启贴图模式\n\n float arcDistrance = length(source - target); // 起始点和终点的距离\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap\n arcDistrance *= 1000000.0;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox\n // arcDistrance *= 8.0;\n arcDistrance = project_pixel_allmap(arcDistrance);\n }\n v_iconMapUV = a_iconMapUV;\n\n float pixelLen = project_pixel_texture(u_icon_step); // 贴图沿弧线方向的长度 - 随地图缩放改变\n float texCount = floor(arcDistrance/pixelLen); // 贴图在弧线上重复的数量\n v_lineData.g = texCount;\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // 线横向偏移的距离\n float linePixelSize = project_pixel(a_Size); // 定点位置偏移\n v_lineData.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值\n }\n \n\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0));\n gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n',type:""}}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a,s,u;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.segmentNumber,r=void 0===n?30:n,i=this.getShaders(),o=i.frag,a=i.vert,s=i.type,t.next=4,this.layer.buildLayerModel({moduleName:"lineArc2d"+s,vertexShader:a,fragmentShader:o,triangulation:Ht,depth:{enable:!1},segmentNumber:r});case 4:return u=t.sent,t.abrupt("return",[u]);case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:i.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:4,update:function(t,e,n){return[n[3],n[4],n[5],n[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.texture]||{x:0,y:0};return[n.x,n.y]}}})}}]),g}(H);var de={solid:0,dash:1},me=function(t){(0,l.Z)(y,t);var e,n,r,f,m=(r=y,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function y(){var t;(0,a.Z)(this,y);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas()}),void t.layer.render();t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.NEAREST,min:i.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128})})),t}return(0,s.Z)(y,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.sourceColor,n=t.targetColor,r=t.textureBlend,i=void 0===r?"normal":r,o=t.lineType,a=void 0===o?"solid":o,s=t.dashArray,u=void 0===s?[10,5]:s,l=t.lineTexture,c=void 0!==l&&l,h=t.iconStep,p=void 0===h?100:h,f=t.segmentNumber,d=void 0===f?30:f,m=t.globalArcHeight,y=void 0===m?10:m;2===u.length&&u.push(0,0);var v=0,_=[0,0,0,0],b=[0,0,0,0];return e&&n&&(_=(0,x.rgb2arr)(e),b=(0,x.rgb2arr)(n),v=1),this.rendererService.getDirty()&&this.texture.bind(),(0,g.Z)({u_globel:"GLOBEL"===this.mapService.version?1:0,u_globel_radius:it,u_global_height:y,u_textureBlend:"normal"===i?0:1,segmentNumber:d,u_line_type:de[a]||0,u_dash_array:u,u_texture:this.texture,u_line_texture:c?1:0,u_icon_step:p,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:v,u_sourceColor:_,u_targetColor:b},this.getStyleAttribute())}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_animate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){var t=this.layer.getLayerConfig(),e=t.sourceColor,n=t.targetColor;return e&&n?{frag:'\n#define Animate 0.0\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_Color;\n\nvarying float v_distance_ratio;\n#pragma include "picking"\n\nvoid main() {\n\n float animateSpeed = 0.0; // 运动速度\n gl_FragColor = v_Color;\n\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a *= alpha;\n\n // u_animate \n // x enable\n // y duration\n // z interval\n // w trailLength\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\nattribute vec2 a_iconMapUV;\n\nuniform float u_globel;\nuniform float u_globel_radius;\nuniform float u_global_height: 10;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\nvarying float v_distance_ratio;\n\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_Color;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nfloat torad(float deg) {\n return (deg / 180.0) * acos(-1.0);\n}\n\nvec3 lglt2xyz(vec2 lnglat) {\n float pi = 3.1415926;\n // + Math.PI/2 是为了对齐坐标\n float lng = torad(lnglat.x) + pi / 2.0;\n float lat = torad(lnglat.y);\n\n // 手动增加一些偏移,减轻面的冲突\n float radius = u_globel_radius;\n\n float z = radius * cos(lat) * cos(lng);\n float x = radius * cos(lat) * sin(lng);\n float y = radius * sin(lat);\n return vec3(x, y, z);\n}\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n\n v_color = a_Color;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n float d_distance_ratio;\n if(u_line_type == LineTypeDash) {\n d_distance_ratio = segmentIndex / segmentNumber;\n // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_animate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n\n float animateSpeed = 0.0; // 运动速度\n v_Color = mix(u_sourceColor, u_targetColor, a_Position.x/segmentNumber);\n\n v_Color.a *= opacity;\n\n\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n }\n\n // 地球模式\n if(u_globel > 0.0) {\n vec3 startLngLat = lglt2xyz(a_Instance.rg);\n vec3 endLngLat = lglt2xyz(a_Instance.ba);\n float globalRadius = length(startLngLat);\n\n vec3 lineDir = normalize(endLngLat - startLngLat);\n vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);\n\n // 线的偏移\n vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;\n // 计算起始点和终止点的距离\n float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;\n // 计算飞线各个节点相应的高度\n float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;\n // 地球点位\n vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;\n \n gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);\n }\n \n\n setPickingColor(a_PickingColor);\n}\n',type:"Linear"}:{frag:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\nvarying vec4 v_line_data;\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nvarying float v_segmentIndex;\nuniform float segmentNumber;\nuniform float u_opacity;\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\n\n#pragma include "picking"\n\nvoid main() {\n float opacity = u_opacity;\n float animateSpeed = 0.0; // 运动速度\n float d_distance_ratio = v_line_data.g; // 当前点位距离占线总长的比例\n gl_FragColor = v_color;\n\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n }\n\n if(u_animate.x == Animate && u_line_texture != LineTexture) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a *= alpha;\n\n // u_animate \n // x enable\n // y duration\n // z interval\n // w trailLength\n }\n\n if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture\n // float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));\n float arcRadio = v_segmentIndex / (segmentNumber - 1.0);\n float count = v_line_data.b; // // 贴图在弧线上重复的数量\n\n float time = 0.0;\n if(u_animate.x == Animate) {\n time = u_time / u_animate.y;\n }\n float redioCount = arcRadio * count;\n\n float u = fract(redioCount - time);\n\n float v = v_line_data.a; // 线图层贴图部分的 v 坐标值\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n\n if(u_animate.x == Animate) {\n float currentPlane = floor(redioCount - time);\n float textureStep = floor(count * u_animate.z);\n float a = mod(currentPlane, textureStep);\n if(a < textureStep - 1.0) {\n pattern = vec4(0.0);\n }\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n discard;\n } else {\n gl_FragColor = filterColor(pattern);\n }\n }\n\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n',vert:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\n\nuniform float u_globel;\nuniform float u_globel_radius;\nuniform float u_global_height: 10;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\nvarying float v_segmentIndex;\n\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_line_data;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nfloat torad(float deg) {\n return (deg / 180.0) * acos(-1.0);\n}\n\nvec3 lglt2xyz(vec2 lnglat) {\n float pi = 3.1415926;\n // + Math.PI/2 是为了对齐坐标\n float lng = torad(lnglat.x) + pi / 2.0;\n float lat = torad(lnglat.y);\n\n // 手动增加一些偏移,减轻面的冲突\n float radius = u_globel_radius;\n\n float z = radius * cos(lat) * cos(lng);\n float x = radius * cos(lat) * sin(lng);\n float y = radius * sin(lat);\n return vec3(x, y, z);\n}\n\nvoid main() {\n\n v_color = a_Color;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n float d_distance_ratio;\n if(u_line_type == LineTypeDash) {\n d_distance_ratio = segmentIndex / segmentNumber;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_animate.x == Animate) {\n d_distance_ratio = segmentIndex / segmentNumber;\n }\n v_line_data.g = d_distance_ratio; // 当前点位距离占线总长的比例\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n\n\n v_segmentIndex = a_Position.x;\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式 \n\n float arcDistrance = length(source - target);\n float pixelLen = project_pixel_texture(u_icon_step);\n v_line_data.b = floor(arcDistrance/pixelLen); // 贴图在弧线上重复的数量\n\n vec2 projectOffset = project_pixel(offset);\n float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // 线横向偏移的距离\n float linePixelSize = project_pixel(a_Size); // 定点位置偏移,按地图等级缩放后的距离\n v_line_data.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值\n\n v_iconMapUV = a_iconMapUV;\n }\n \n\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n }\n\n // 地球模式\n if(u_globel > 0.0) {\n vec3 startLngLat = lglt2xyz(a_Instance.rg);\n vec3 endLngLat = lglt2xyz(a_Instance.ba);\n float globalRadius = length(startLngLat);\n\n vec3 lineDir = normalize(endLngLat - startLngLat);\n vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);\n\n // 线的偏移\n vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;\n // 计算起始点和终止点的距离\n float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;\n // 计算飞线各个节点相应的高度\n float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;\n // 地球点位\n vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;\n \n gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);\n }\n \n\n setPickingColor(a_PickingColor);\n}\n',type:""}}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a,s,u;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.segmentNumber,r=void 0===n?30:n,i=this.getShaders(),o=i.frag,a=i.vert,s=i.type,t.next=4,this.layer.buildLayerModel({moduleName:"lineArc3d"+s,vertexShader:a,fragmentShader:o,inject:this.getInject(),triangulation:Ht,segmentNumber:r});case 4:return u=t.sent,t.abrupt("return",[u]);case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:i.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:4,update:function(t,e,n){return[n[3],n[4],n[5],n[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.texture]||{x:0,y:0};return[n.x,n.y]}}})}}]),y}(H);var ge={solid:0,dash:1},ye=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas()}),void t.layer.render();t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.NEAREST,min:i.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.sourceColor,i=t.targetColor,o=t.textureBlend,a=void 0===o?"normal":o,s=t.lineType,u=void 0===s?"solid":s,l=t.dashArray,c=void 0===l?[10,5]:l,h=t.lineTexture,p=void 0!==h&&h,f=t.iconStep,d=void 0===f?100:f,m=t.segmentNumber,g=void 0===m?30:m,y=t.globalArcHeight,v=void 0===y?10:y;2===c.length&&c.push(0,0);var _=0,b=[0,0,0,0],w=[0,0,0,0];return r&&i&&(b=(0,x.rgb2arr)(r),w=(0,x.rgb2arr)(i),_=1),this.rendererService.getDirty()&&this.texture.bind(),{u_globel:1,u_globel_radius:it,u_global_height:v,u_opacity:n,u_textureBlend:"normal"===a?0:1,segmentNumber:g,u_line_type:ge[u]||0,u_dash_array:c,u_texture:this.texture,u_line_texture:p?1:0,u_icon_step:d,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:_,u_sourceColor:b,u_targetColor:w}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_animate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){var t=this.layer.getLayerConfig(),e=t.sourceColor,n=t.targetColor;return e&&n?{frag:'\n#define Animate 0.0\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_Color;\n\nvarying float v_distance_ratio;\n#pragma include "picking"\n\nvoid main() {\n\n float animateSpeed = 0.0; // 运动速度\n gl_FragColor = v_Color;\n\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a *= alpha;\n\n // u_animate \n // x enable\n // y duration\n // z interval\n // w trailLength\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\nattribute vec2 a_iconMapUV;\n\nuniform float u_globel;\nuniform float u_globel_radius;\nuniform float u_global_height: 10;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\nvarying float v_distance_ratio;\n\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_Color;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nfloat torad(float deg) {\n return (deg / 180.0) * acos(-1.0);\n}\n\nvec3 lglt2xyz(vec2 lnglat) {\n float pi = 3.1415926;\n // + Math.PI/2 是为了对齐坐标\n float lng = torad(lnglat.x) + pi / 2.0;\n float lat = torad(lnglat.y);\n\n // 手动增加一些偏移,减轻面的冲突\n float radius = u_globel_radius;\n\n float z = radius * cos(lat) * cos(lng);\n float x = radius * cos(lat) * sin(lng);\n float y = radius * sin(lat);\n return vec3(x, y, z);\n}\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n\n v_color = a_Color;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n float d_distance_ratio;\n if(u_line_type == LineTypeDash) {\n d_distance_ratio = segmentIndex / segmentNumber;\n // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_animate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n\n float animateSpeed = 0.0; // 运动速度\n v_Color = mix(u_sourceColor, u_targetColor, a_Position.x/segmentNumber);\n\n v_Color.a *= opacity;\n\n\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n }\n\n // 地球模式\n if(u_globel > 0.0) {\n vec3 startLngLat = lglt2xyz(a_Instance.rg);\n vec3 endLngLat = lglt2xyz(a_Instance.ba);\n float globalRadius = length(startLngLat);\n\n vec3 lineDir = normalize(endLngLat - startLngLat);\n vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);\n\n // 线的偏移\n vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;\n // 计算起始点和终止点的距离\n float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;\n // 计算飞线各个节点相应的高度\n float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;\n // 地球点位\n vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;\n \n gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);\n }\n \n\n setPickingColor(a_PickingColor);\n}\n',type:"Linear"}:{frag:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying vec4 v_color;\nvarying vec4 v_line_data;\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nvarying float v_segmentIndex;\nuniform float segmentNumber;\nuniform float u_opacity;\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\n\n#pragma include "picking"\n\nvoid main() {\n float opacity = u_opacity;\n float animateSpeed = 0.0; // 运动速度\n float d_distance_ratio = v_line_data.g; // 当前点位距离占线总长的比例\n gl_FragColor = v_color;\n\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n }\n\n if(u_animate.x == Animate && u_line_texture != LineTexture) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n // alpha = smoothstep(0., 1., alpha);\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a *= alpha;\n\n // u_animate \n // x enable\n // y duration\n // z interval\n // w trailLength\n }\n\n if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture\n // float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));\n float arcRadio = v_segmentIndex / (segmentNumber - 1.0);\n float count = v_line_data.b; // // 贴图在弧线上重复的数量\n\n float time = 0.0;\n if(u_animate.x == Animate) {\n time = u_time / u_animate.y;\n }\n float redioCount = arcRadio * count;\n\n float u = fract(redioCount - time);\n\n float v = v_line_data.a; // 线图层贴图部分的 v 坐标值\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n\n if(u_animate.x == Animate) {\n float currentPlane = floor(redioCount - time);\n float textureStep = floor(count * u_animate.z);\n float a = mod(currentPlane, textureStep);\n if(a < textureStep - 1.0) {\n pattern = vec4(0.0);\n }\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n discard;\n } else {\n gl_FragColor = filterColor(pattern);\n }\n }\n\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n',vert:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\n\nuniform float u_globel;\nuniform float u_globel_radius;\nuniform float u_global_height: 10;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\nvarying float v_segmentIndex;\n\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_line_data;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nfloat torad(float deg) {\n return (deg / 180.0) * acos(-1.0);\n}\n\nvec3 lglt2xyz(vec2 lnglat) {\n float pi = 3.1415926;\n // + Math.PI/2 是为了对齐坐标\n float lng = torad(lnglat.x) + pi / 2.0;\n float lat = torad(lnglat.y);\n\n // 手动增加一些偏移,减轻面的冲突\n float radius = u_globel_radius;\n\n float z = radius * cos(lat) * cos(lng);\n float x = radius * cos(lat) * sin(lng);\n float y = radius * sin(lat);\n return vec3(x, y, z);\n}\n\nvoid main() {\n\n v_color = a_Color;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n float d_distance_ratio;\n if(u_line_type == LineTypeDash) {\n d_distance_ratio = segmentIndex / segmentNumber;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_animate.x == Animate) {\n d_distance_ratio = segmentIndex / segmentNumber;\n }\n v_line_data.g = d_distance_ratio; // 当前点位距离占线总长的比例\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n\n\n v_segmentIndex = a_Position.x;\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式 \n\n float arcDistrance = length(source - target);\n float pixelLen = project_pixel_texture(u_icon_step);\n v_line_data.b = floor(arcDistrance/pixelLen); // 贴图在弧线上重复的数量\n\n vec2 projectOffset = project_pixel(offset);\n float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // 线横向偏移的距离\n float linePixelSize = project_pixel(a_Size); // 定点位置偏移,按地图等级缩放后的距离\n v_line_data.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值\n\n v_iconMapUV = a_iconMapUV;\n }\n \n\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n }\n\n // 地球模式\n if(u_globel > 0.0) {\n vec3 startLngLat = lglt2xyz(a_Instance.rg);\n vec3 endLngLat = lglt2xyz(a_Instance.ba);\n float globalRadius = length(startLngLat);\n\n vec3 lineDir = normalize(endLngLat - startLngLat);\n vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);\n\n // 线的偏移\n vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;\n // 计算起始点和终止点的距离\n float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;\n // 计算飞线各个节点相应的高度\n float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;\n // 地球点位\n vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;\n \n gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);\n }\n \n\n setPickingColor(a_PickingColor);\n}\n',type:""}}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a,s,u;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.segmentNumber,r=void 0===n?30:n,i=this.getShaders(),o=i.frag,a=i.vert,s=i.type,t.next=4,this.layer.buildLayerModel({moduleName:"lineEarthArc3d"+s,vertexShader:a,fragmentShader:o,triangulation:Ht,depth:{enable:!0},segmentNumber:r});case 4:return u=t.sent,t.abrupt("return",[u]);case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:i.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:4,update:function(t,e,n){return[n[3],n[4],n[5],n[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.texture]||{x:0,y:0};return[n.x,n.y]}}})}}]),g}(H);var ve=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.gapWidth,n=void 0===e?2:e,r=t.strokeWidth,i=void 0===r?1:r,o=t.stroke,a=void 0===o?"#000":o,s=t.strokeOpacity,u=void 0===s?1:s;return(0,g.Z)({u_gap_width:n,u_stroke_width:i,u_stroke:(0,x.rgb2arr)(a),u_stroke_opacity:u},this.getStyleAttribute())}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"flow_line",vertexShader:'attribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec4 a_Instance;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include "projection"\n#pragma include "picking"\nvarying vec4 v_color;\nuniform float u_gap_width: 1.0;\nuniform float u_stroke_width: 1.0;\nuniform float u_stroke_opacity: 1.0;\n\n\nvoid main() {\n\n// #ifdef USE_ATTRIBUTE_OPACITY\n// float opacity = a_Opacity;\n// #else\n// float opacity = u_opacity;\n// #endif\n\n\n// #ifdef USE_ATTRIBUTE_OFFSETS\n// vec2 offsets = a_Offsets;\n// #else\n// vec2 offsets = u_offsets;\n// #endif\n\n // float opacity = u_opacity;\n// 透明度计算\n vec2 source = a_Instance.rg; // 起始点\n vec2 target = a_Instance.ba; // 终点\n vec2 flowlineDir = normalize(target - source);\n vec2 perpendicularDir = vec2(-flowlineDir.y, flowlineDir.x);\n\n\n vec2 position = mix(source, target, a_Position.x);\n\n float lengthCommon = length(target - source); \n vec2 offsetDistances = a_Size.x * project_pixel(a_Position.yz);\n vec2 limitedOffsetDistances = clamp( \n offsetDistances,\n -lengthCommon*.8, lengthCommon*.8\n );\n\n float startOffsetCommon = project_pixel(offsets[0]);\n float endOffsetCommon = project_pixel(offsets[1]);\n float endpointOffset = mix(\n clamp(startOffsetCommon, 0.0, lengthCommon*.2),\n -clamp(endOffsetCommon, 0.0, lengthCommon*.2),\n a_Position.x\n );\n\n vec2 normalsCommon = u_stroke_width * project_pixel(a_Normal.xy);\n\n float gapCommon = project_pixel(u_gap_width);\n vec3 offsetCommon = vec3(\n flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) -\n perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x),\n 0.0\n );\n\n\n vec4 project_pos = project_position(vec4(position.xy, 0, 1.0));\n\n vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity);\n v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z);\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offsetCommon.xy, 0., 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0));\n }\n\n\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'#extension GL_OES_standard_derivatives : enable\n\nvarying vec4 v_color;\n\n\n// line texture\n\n#pragma include "picking"\n\nvoid main() {\ngl_FragColor = v_color;\ngl_FragColor = filterColor(gl_FragColor);\n}\n',inject:this.getInject(),triangulation:Dt,primitive:i.gl.TRIANGLES,depth:{enable:!1},pick:!1});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0],n[1]]:[n,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:i.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:4,update:function(t,e,n){return[n[3],n[4],n[5],n[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}})}}]),f}(H);var _e={solid:0,dash:1},be=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas()}),void t.layer.render();t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.NEAREST,min:i.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.sourceColor,i=t.targetColor,o=t.textureBlend,a=void 0===o?"normal":o,s=t.lineType,u=void 0===s?"solid":s,l=t.dashArray,c=void 0===l?[10,5]:l,h=t.lineTexture,p=void 0!==h&&h,f=t.iconStep,d=void 0===f?100:f,m=t.segmentNumber,g=void 0===m?30:m;2===c.length&&c.push(0,0),this.rendererService.getDirty()&&this.texture.bind();var y=0,v=[0,0,0,0],_=[0,0,0,0];return r&&i&&(v=(0,x.rgb2arr)(r),_=(0,x.rgb2arr)(i),y=1),{u_opacity:n,u_textureBlend:"normal"===a?0:1,segmentNumber:g,u_line_type:_e[u]||0,u_dash_array:c,u_texture:this.texture,u_line_texture:p?1:0,u_icon_step:d,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:y,u_sourceColor:v,u_targetColor:_}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_animate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"lineGreatCircle",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\n\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_line_data;\n\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return index / (segmentNumber - 1.);\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 midPoint(vec2 source, vec2 target) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = 0.314;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\n return mid;\n}\nfloat bezier3(vec3 arr, float t) {\n float ut = 1. - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n vec2 mid = midPoint(source, target);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x ,t), bezier3(y,t));\n }else {\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n }\n}\n\nvoid main() {\n \n\n v_color = a_Color;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n if(u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n total_Distance = total_Distance*16.0; // total_Distance*16.0 调整默认的效果\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n }\n\n if(u_animate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n\nv_line_data.g = a_Position.x; // 该顶点在弧线上的分段排序\n if(LineTexture == u_line_texture) { // 开启贴图模式 \n // float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0;\n float d_arcDistrance = length(source - target);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap\n d_arcDistrance = d_arcDistrance * 1000000.0;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox\n d_arcDistrance = project_pixel_allmap(d_arcDistrance);\n }\n float d_pixelLen = project_pixel(u_icon_step)/8.0;\nv_line_data.b = floor(d_arcDistrance/d_pixelLen); // 贴图在弧线上重复的数量\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // 线横向偏移的距离\n float linePixelSize = project_pixel(a_Size); // 定点位置偏移,按地图等级缩放后的距离\nv_line_data.a = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值\n\n v_iconMapUV = a_iconMapUV;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + offset, curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n\n',fragmentShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_opacity;\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float segmentNumber;\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nvarying vec4 v_line_data;\n\n#pragma include "picking"\n#pragma include "project"\n#pragma include "projection"\n\nvoid main() {\n float opacity = u_opacity;\n float animateSpeed = 0.0;\n float d_segmentIndex = v_line_data.g;\n \n // 设置弧线的底色\n if(u_linearColor == 1.0) { // 使用渐变颜色\n gl_FragColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n } else { // 使用 color 方法传入的颜色\n gl_FragColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n // 实线部分\n } else {\n // 虚线部分\n discard;\n };\n }\n\n // 设置弧线的动画模式\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n // 设置弧线的贴图\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { \n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = v_line_data.b; // 贴图在弧线上重复的数量\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_animate.x == Animate) {\n u = gl_FragColor.a/opacity;\n }\n\n float v = v_line_data.a; // 线图层贴图部分的 v 坐标值\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n \n // 设置贴图和底色的叠加模式\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}',triangulation:Ht,depth:{enable:!1}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:i.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:4,update:function(t,e,n){return[n[3],n[4],n[5],n[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.texture]||{x:0,y:0};return[n.x,n.y]}}})}}]),g}(H);var xe='\n#define Animate 0.0\n\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\n\nattribute vec2 a_iconMapUV;\n\n// dash line\nattribute float a_Total_Distance;\nattribute vec2 a_DistanceAndIndex;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nuniform float u_icon_step: 100;\n\nuniform float u_heightfixed: 0.0;\nuniform float u_vertexScale: 1.0;\nuniform float u_raisingHeight: 0.0;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvarying vec4 v_color;\n\n// texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)\nvarying vec2 v_iconMapUV;\n\n\nuniform float u_linearColor: 0;\nuniform float u_arrow: 0.0;\nuniform float u_arrowHeight: 3.0;\nuniform float u_arrowWidth: 2.0;\nuniform float u_tailWidth: 1.0;\n\nvarying vec4 v_texture_data;\n\nvec2 calculateArrow(vec2 offset) {\n /*\n * 在支持箭头的时候,第二、第三组顶点是额外插入用于构建顶点的\n */\n float arrowFlag = -1.0;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // 高德 2.0 的旋转角度不同\n arrowFlag = 1.0;\n }\n float pi = arrowFlag * 3.1415926/2.;\n if(a_Miter < 0.) {\n // 根据线的两侧偏移不同、旋转的方向相反\n pi = -pi;\n }\n highp float angle_sin = sin(pi);\n highp float angle_cos = cos(pi);\n // 计算垂直与线方向的旋转矩阵\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n float arrowWidth = u_arrowWidth;\n float arrowHeight = u_arrowHeight;\n\n vec2 arrowOffset = vec2(0.0);\n /*\n * a_DistanceAndIndex.y 用于标记当前顶点属于哪一组(两个顶点一组,构成线的其实是矩形,最简需要四个顶点、两组顶点构成)\n */\n if(a_DistanceAndIndex.y == 0.0) {\n // 箭头尖部\n offset = vec2(0.0);\n } else if(a_DistanceAndIndex.y == 1.0) {\n // 箭头两侧\n arrowOffset = rotation_matrix*(offset * arrowHeight);\n offset += arrowOffset; // 沿线偏移\n offset = offset * arrowWidth; // 垂直线向外偏移(是构建箭头两侧的顶点)\n } else if(a_DistanceAndIndex.y == 2.0 || a_DistanceAndIndex.y == 3.0 || a_DistanceAndIndex.y == 4.0) {\n // 偏移其余的点位(将长度让位给箭头)\n arrowOffset = rotation_matrix*(offset * arrowHeight) * arrowWidth;\n offset += arrowOffset;// 沿线偏移\n }\n\n return offset;\n}\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n \n float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放\n\n v_iconMapUV = a_iconMapUV;\n d_texPixelLen = project_float_pixel(u_icon_step);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n v_color = a_Color;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n \n vec2 offset = project_pixel(size.xy);\n\n float lineDistance = a_DistanceAndIndex.x;\n float currentLinePointRatio = lineDistance / a_Total_Distance;\n \n if(u_arrow > 0.0) {\n // 计算箭头\n offset = calculateArrow(offset);\n\n if(a_DistanceAndIndex.y > 4.0) {\n offset *= mix(1.0, u_tailWidth, currentLinePointRatio);\n }\n }\n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // 线横向偏移的距离(向两侧偏移的和)\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // 定点位置偏移,按地图等级缩放后的距离 单侧 * 2\n float texV = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值\n \n v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);\n // 设置数据集的参数\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // 线顶点的高度 - 兼容不存在第三个数值的情况 vertex height\n float lineHeight = a_Size.y; // size 第二个参数代表的高度 [linewidth, lineheight]\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n lineHeight *= 0.2; // 保持和 amap/mapbox 一致的效果\n h *= 0.2;\n if(u_heightfixed < 1.0) {\n lineHeight = project_pixel(a_Size.y);\n }\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));\n } else {\n // mapbox - amap\n \n // 兼容 mapbox 在线高度上的效果表现基本一致\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // mapbox\n // 保持高度相对不变\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n h *= mapboxZoomScale;\n h += u_raisingHeight * mapboxZoomScale;\n if(u_heightfixed > 0.0) {\n lineHeight *= mapboxZoomScale;\n }\n \n } else {\n // amap\n h += u_raisingHeight;\n // lineHeight 顶点偏移高度\n if(u_heightfixed < 1.0) {\n lineHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n',we={solid:0,dash:1},Se=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"textureEventFlag",!1),(0,p.Z)((0,u.Z)(t),"texture",t.createTexture2D({data:[0,0,0,0],mag:i.gl.NEAREST,min:i.gl.NEAREST,premultiplyAlpha:!1,width:1,height:1})),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas()}),void t.layer.render();t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.NEAREST,min:i.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.sourceColor,i=t.targetColor,o=t.textureBlend,a=void 0===o?"normal":o,s=t.lineType,u=void 0===s?"solid":s,l=t.dashArray,c=void 0===l?[10,5,0,0]:l,h=t.lineTexture,p=void 0!==h&&h,f=t.iconStep,d=void 0===f?100:f,m=t.vertexHeightScale,g=void 0===m?20:m,y=t.borderWidth,v=void 0===y?0:y,_=t.borderColor,b=void 0===_?"#ccc":_,w=t.raisingHeight,E=void 0===w?0:w,M=t.heightfixed,T=void 0!==M&&M,A=t.linearDir,C=void 0===A?q.VERTICAL:A,O=t.blur,P=void 0===O?[1,1,1]:O,k=t.arrow,L=void 0===k?{enable:!1,arrowWidth:2,arrowHeight:3,tailWidth:1}:k;2===c.length&&c.push(0,0),this.rendererService.getDirty()&&this.texture&&this.texture.bind();var I=0,R=[0,0,0,0],D=[0,0,0,0];return r&&i&&(R=(0,x.rgb2arr)(r),D=(0,x.rgb2arr)(i),I=1),{u_opacity:(0,S.isNumber)(n)?n:1,u_textureBlend:a===Y.NORMAL?0:1,u_line_type:we[u],u_dash_array:c,u_blur:P,u_texture:this.texture,u_line_texture:p?1:0,u_icon_step:d,u_textSize:[1024,this.iconService.canvasHeight||128],u_borderWidth:v,u_borderColor:(0,x.rgb2arr)(b),u_linearDir:C===q.VERTICAL?1:0,u_linearColor:I,u_sourceColor:R,u_targetColor:D,u_heightfixed:Number(T),u_vertexScale:g,u_raisingHeight:Number(E),u_arrow:Number(L.enable),u_arrowHeight:L.arrowHeight||3,u_arrowWidth:L.arrowWidth||2,u_tailWidth:void 0===L.tailWidth?1:L.tailWidth}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_animate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.textureEventFlag||(this.textureEventFlag=!0,this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture)),t.abrupt("return",this.buildModels());case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a,s,u;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.depth,r=void 0!==n&&n,i=this.getShaders(),o=i.frag,a=i.vert,s=i.type,this.layer.triangulation=x.LineTriangulation,t.next=5,this.layer.buildLayerModel({moduleName:"line"+s,vertexShader:a,fragmentShader:o,triangulation:x.LineTriangulation,depth:{enable:r}});case 5:return u=t.sent,t.abrupt("return",[u]);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getShaders",value:function(){var t=this.layer.getLayerConfig(),e=t.sourceColor,n=t.targetColor;return"dash"===t.lineType?{frag:'#define LineTypeSolid 0.0\nvarying vec4 v_color;\n\n// dash\nvarying vec4 v_dash_array;\nvarying float v_d_distance_ratio;\n\n#pragma include "picking"\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // 控制运动\n\n// [animate, duration, interval, trailLength],\nvoid main() {\n\n gl_FragColor = v_color;\n\n \n float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n // 实线部分\n } else {\n // 虚线部分\n discard;\n };\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\n\nattribute vec2 a_iconMapUV;\n\n// dash line\nattribute float a_Total_Distance;\nattribute vec2 a_DistanceAndIndex;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\n\nuniform float u_vertexScale: 1.0;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvarying vec4 v_color;\nvarying vec4 v_dash_array;\nvarying float v_d_distance_ratio;\n\nuniform float u_opacity: 1.0;\n\nvoid main() {\n\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n vec2 offset = project_pixel(size.xy);\n v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;\n\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, project_pixel(a_Size.y), 1.0));\n } else {\n float lineHeight = a_Size.y;\n \n // #define COORDINATE_SYSTEM_P20 5.0\n // #define COORDINATE_SYSTEM_P20_OFFSET 6.0\n // amap1.x\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // 保持高度相对不变\n lineHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n',type:"Dash"}:e&&n?{frag:'varying vec4 v_color;\nvarying vec4 v_texture_data;\nuniform float u_linearDir: 1.0;\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_opacity: 1.0;\n\n#pragma include "picking"\n\n\nvoid main() {\n float linearRadio = v_texture_data.r; // 当前点位距离占线总长的比例\n if(u_linearDir < 1.0) {\n linearRadio = v_texture_data.a;\n }\n\n if(u_linearColor == 1.0) { // 使用渐变颜色\n gl_FragColor = mix(u_sourceColor, u_targetColor, linearRadio);\n } else { // 使用 color 方法传入的颜色\n gl_FragColor = v_color;\n }\n\n gl_FragColor.a *= u_opacity; // 全局透明度\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:xe,type:"Linear"}:{frag:'#extension GL_OES_standard_derivatives : enable\n#define Animate 0.0\n#define LineTexture 1.0\nuniform float u_opacity : 1.0;\nuniform float u_textureBlend;\n\nuniform float u_borderWidth: 0.0;\n\nuniform vec3 u_blur;\nuniform vec4 u_borderColor;\nvarying vec4 v_color;\n\n// line texture\nuniform float u_line_texture;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nvarying vec2 v_iconMapUV;\nvarying vec4 v_texture_data;\n\n\n#pragma include "picking"\n\nuniform float u_time;\nuniform vec4 u_animate: [ 1, 2., 1.0, 0.2 ]; // 控制运动\n// [animate, duration, interval, trailLength],\nvoid main() {\n float animateSpeed = 0.0; // 运动速度\n float d_distance_ratio = v_texture_data.r; // 当前点位距离占线总长的比例\n gl_FragColor = v_color;\n // anti-alias\n // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));\n gl_FragColor.a *= u_opacity; // 全局透明度\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_texture_data.g; // 当前顶点的距离\n float d_texPixelLen = v_texture_data.b; // 贴图的像素长度,根据地图层级缩放\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_texture_data.a; // 线图层贴图部分的 v 坐标值\n\n // v = max(smoothstep(0.95, 1.0, v), v);\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor += pattern;\n } else { // replace\n pattern.a *= u_opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = pattern;\n }\n } \n\n float v = v_texture_data.a;\n float borderWidth = min(0.5, u_borderWidth);\n // 绘制 border\n if(borderWidth > 0.01) {\n float borderOuterWidth = borderWidth / 2.0;\n\n\n if(v >= 1.0 - borderWidth || v <= borderWidth) {\n if(v > borderWidth) { // 外侧\n float linear = smoothstep(0.0, 1.0, (v - (1.0 - borderWidth))/borderWidth);\n // float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, u_borderColor.rgb, linear);\n } else if(v <= borderWidth) {\n float linear = smoothstep(0.0, 1.0, v/borderWidth);\n gl_FragColor.rgb = mix(u_borderColor.rgb, gl_FragColor.rgb, linear);\n }\n }\n\n if(v < borderOuterWidth) {\n gl_FragColor.a = mix(0.0, gl_FragColor.a, v/borderOuterWidth);\n } else if(v > 1.0 - borderOuterWidth) {\n gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);\n }\n }\n\n // blur\n float blurV = v_texture_data.a;\n if(blurV < 0.5) {\n gl_FragColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);\n } else {\n gl_FragColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);\n }\n \n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:xe,type:""}}},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:i.AttributeType.Attribute,descriptor:{name:"a_DistanceAndIndex",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n,r,i,o){return void 0===o?[n[3],10]:[n[3],o]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:i.AttributeType.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0],n[1]]:[n,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:i.AttributeType.Attribute,descriptor:{name:"a_Miter",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.texture]||{x:0,y:0};return[n.x,n.y]}}})}}]),g}(H);var Ee=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;t.colorTexture&&t.colorTexture.destroy();var n=t.layer.getLayerConfig().rampColors,r=(0,x.generateColorRamp)(n);t.colorTexture=e({data:new Uint8Array(r.data),width:r.width,height:r.height,wrapS:i.gl.CLAMP_TO_EDGE,wrapT:i.gl.CLAMP_TO_EDGE,min:i.gl.NEAREST,mag:i.gl.NEAREST,flipY:!1})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.vertexHeightScale,i=void 0===r?20:r,o=t.raisingHeight,a=void 0===o?0:o,s=t.heightfixed,u=void 0!==s&&s,l=t.linearDir,c=void 0===l?q.VERTICAL:l;return this.rendererService.getDirty()&&this.colorTexture.bind(),{u_linearDir:c===q.VERTICAL?1:0,u_opacity:(0,S.isNumber)(n)?n:1,u_texture:this.colorTexture,u_heightfixed:Number(u),u_vertexScale:i,u_raisingHeight:Number(a)}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateTexture(),t.abrupt("return",this.buildModels());case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.colorTexture)||void 0===t||t.destroy()}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.depth,r=void 0!==n&&n,this.layer.triangulation=Rt,t.next=4,this.layer.buildLayerModel({moduleName:"lineRampColors",vertexShader:'\nattribute float a_Miter;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\n\n// dash line\nattribute float a_Total_Distance;\nattribute vec2 a_DistanceAndIndex;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nuniform float u_heightfixed: 0.0;\nuniform float u_vertexScale: 1.0;\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity : 1.0;\nuniform sampler2D u_texture;\nuniform float u_linearDir: 1.0;\nvarying vec4 v_Color;\n\n\n#pragma include "projection"\n#pragma include "picking"\n\n\nvoid main() {\n\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n \n vec2 offset = project_pixel(size.xy);\n\n float lineDistance = a_DistanceAndIndex.x;\n float currentLinePointRatio = lineDistance / a_Total_Distance;\n \n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // 线横向偏移的距离(向两侧偏移的和)\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // 定点位置偏移,按地图等级缩放后的距离 单侧 * 2\n float texV = lineOffsetWidth/linePixelSize; // 线图层贴图部分的 v 坐标值\n\n float linearRadio =currentLinePointRatio; // 当前点位距离占线总长的比例\n if(u_linearDir < 1.0) {\n linearRadio = texV;\n }\n\n v_Color = texture2D(u_texture, vec2(linearRadio, 0.5));\n\n v_Color.a *= u_opacity; // 全局透明度\n\n\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // 线顶点的高度 - 兼容不存在第三个数值的情况 vertex height\n float lineHeight = a_Size.y; // size 第二个参数代表的高度 [linewidth, lineheight]\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n lineHeight *= 0.2; // 保持和 amap/mapbox 一致的效果\n h *= 0.2;\n if(u_heightfixed < 1.0) {\n lineHeight = project_pixel(a_Size.y);\n }\n gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));\n } else {\n // mapbox - amap\n \n // 兼容 mapbox 在线高度上的效果表现基本一致\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // mapbox\n // 保持高度相对不变\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n h *= mapboxZoomScale;\n h += u_raisingHeight * mapboxZoomScale;\n if(u_heightfixed > 0.0) {\n lineHeight *= mapboxZoomScale;\n }\n \n } else {\n // amap\n h += u_raisingHeight;\n // lineHeight 顶点偏移高度\n if(u_heightfixed < 1.0) {\n lineHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nvarying vec4 v_Color;\n#pragma include "picking"\nvoid main() {\n\n gl_FragColor = v_Color; // 全局透明度\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Rt,depth:{enable:r}});case 4:return i=t.sent,t.abrupt("return",[i]);case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:i.AttributeType.Attribute,descriptor:{name:"a_DistanceAndIndex",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n,r,i,o){return void 0===o?[n[3],10]:[n[3],o]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:i.AttributeType.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0],n[1]]:[n,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:i.AttributeType.Attribute,descriptor:{name:"a_Miter",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[4]]}}})}}]),g}(H);var Me='attribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Position;\n\nattribute float a_Total_Distance;\nattribute float a_Distance;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nuniform float u_opacity: 1.0;\nuniform float u_vertexScale: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\n\n\n#pragma include "projection"\n\nvarying vec4 v_color;\nvarying float v_distanceScale;\n\nvoid main() {\n\n v_color = a_Color; \n v_distanceScale = a_Distance / a_Total_Distance;\n v_color = vec4(a_Color.xyz, a_Color.w * u_opacity); \n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // 线顶点的高度 - 兼容不存在第三个数值的情况\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, project_pixel(a_Size.y) + h * 0.2, 1.0));\n } else {\n float lineHeight = a_Size.y;\n // 兼容 mapbox 在线高度上的效果表现基本一致\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // 保持高度相对不变\n h *= 2.0/pow(2.0, 20.0 - u_Zoom);\n }\n\n // #define COORDINATE_SYSTEM_P20 5.0\n // #define COORDINATE_SYSTEM_P20_OFFSET 6.0\n // amap1.x\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // 保持高度相对不变\n lineHeight *= pow(2.0, 20.0 - u_Zoom);\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, lineHeight + h, 1.0));\n gl_PointSize = 10.0;\n }\n}\n',Te=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.sourceColor,i=t.targetColor,o=t.vertexHeightScale,a=void 0===o?20:o,s=0,u=[0,0,0,0],l=[0,0,0,0];return r&&i&&(u=(0,x.rgb2arr)(r),l=(0,x.rgb2arr)(i),s=1),{u_opacity:(0,S.isNumber)(n)?n:1,u_linearColor:s,u_sourceColor:u,u_targetColor:l,u_vertexScale:a}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getShaders",value:function(){var t=this.layer.getLayerConfig(),e=t.sourceColor,n=t.targetColor;return e&&n?{frag:"uniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float opacity;\nvoid main() {\n gl_FragColor = mix(u_sourceColor, u_targetColor, v_distanceScale);\n gl_FragColor.a *= opacity; // 全局透明度\n}\n",vert:Me,type:"lineSimpleLinear"}:{frag:"\nvarying vec4 v_color;\nvoid main() {\n gl_FragColor = v_color;\n\n}\n",vert:Me,type:"lineSimpleNormal"}}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,o,a;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getShaders(),n=e.frag,r=e.vert,o=e.type,t.next=3,this.layer.buildLayerModel({moduleName:o,vertexShader:r,fragmentShader:n,triangulation:Nt,primitive:i.gl.LINES,depth:{enable:!1},pick:!1});case 3:return a=t.sent,t.abrupt("return",[a]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"distance",type:i.AttributeType.Attribute,descriptor:{name:"a_Distance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:i.AttributeType.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0],n[1]]:[n,0]}}})}}]),f}(H);const Ae={arc:fe,arc3d:me,greatcircle:be,wall:function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas()}),void t.layer.render();t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.NEAREST,min:i.gl.NEAREST,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.sourceColor,i=t.targetColor,o=t.textureBlend,a=void 0===o?"normal":o,s=t.heightfixed,u=void 0!==s&&s,l=t.lineTexture,c=void 0!==l&&l,h=t.iconStep,p=void 0===h?100:h,f=t.iconStepCount,d=void 0===f?1:f;this.rendererService.getDirty()&&this.texture.bind();var m=0,g=[0,0,0,0],y=[0,0,0,0];return r&&i&&(g=(0,x.rgb2arr)(r),y=(0,x.rgb2arr)(i),m=1),{u_heightfixed:Number(u),u_opacity:(0,S.isNumber)(n)?n:1,u_textureBlend:"normal"===a?0:1,u_texture:this.texture,u_line_texture:c?1:0,u_iconStepCount:d,u_icon_step:p,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:m,u_sourceColor:g,u_targetColor:y}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_animate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"lineWall",vertexShader:'#define Animate 0.0\n\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\nattribute vec2 a_iconMapUV;\nattribute float a_Total_Distance;\nattribute float a_Distance;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\nuniform float u_icon_step: 100;\nuniform float u_heightfixed;\nuniform float u_linearColor: 0;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\n// texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)\nvarying vec2 v_iconMapUV;\nvarying vec4 v_color;\nvarying float v_blur;\nvarying float v_radio;\nvarying vec4 v_dataset;\n\nvoid main() {\n\n\n float d_distance_ratio; // 当前点位距离占线总长的比例\n float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放\n\n v_iconMapUV = a_iconMapUV;\n if(u_heightfixed < 1.0) { // 高度随 zoom 调整\n d_texPixelLen = project_pixel(u_icon_step);\n } else {\n d_texPixelLen = u_icon_step;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n d_texPixelLen *= 10.0;\n }\n\n if(u_animate.x == Animate || u_linearColor == 1.0) {\n d_distance_ratio = a_Distance / a_Total_Distance;\n }\n\n float miter = (a_Miter + 1.0)/2.0;\n // 设置数据集的参数\n v_dataset[0] = d_distance_ratio; // 当前点位距离占线总长的比例\n v_dataset[1] = a_Distance; // 当前顶点的距离\n v_dataset[2] = d_texPixelLen; // 贴图的像素长度,根据地图层级缩放\n v_dataset[3] = miter; // 线图层贴图部分的 v 坐标值 0 - 1\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n\n float originSize = a_Size.x; // 固定高度\n if(u_heightfixed < 1.0) { // 高度随 zoom 调整\n originSize = project_float_pixel(a_Size.x);\n }\n\n float wallHeight = originSize * miter;\n float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));\n\n v_blur = min(project_float_pixel(2.0) / originSize, 0.05);\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'#define Animate 0.0\n#define LineTexture 1.0\n\n// line texture\nuniform float u_line_texture;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_opacity : 1.0;\nuniform float u_textureBlend;\nuniform float u_iconStepCount;\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // 控制运动\n\nvarying vec2 v_iconMapUV;\nvarying float v_blur;\nvarying float v_radio;\nvarying vec4 v_color;\nvarying vec4 v_dataset;\n\n#pragma include "picking"\n\nvoid main() {\n float opacity = u_opacity;\n float animateSpeed = 0.0; // 运动速度\n float d_distance_ratio = v_dataset.r; // 当前点位距离占线总长的比例\n float v = v_dataset.a;\n\n if(u_linearColor == 1.0) { // 使用渐变颜色\n gl_FragColor = mix(u_sourceColor, u_targetColor, v);\n } else { // 使用 color 方法传入的颜色\n gl_FragColor = v_color;\n }\n\n gl_FragColor.a *= opacity; // 全局透明度\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_dataset.g; // 当前顶点的距离\n float d_texPixelLen = v_dataset.b; // 贴图的像素长度,根据地图层级缩放\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_dataset.a; // 线图层贴图部分的 v 坐标值\n\n // 计算纹理间隔 start\n float flag = 0.0;\n if(u > 1.0/u_iconStepCount) {\n flag = 1.0;\n }\n u = fract(u*u_iconStepCount);\n // 计算纹理间隔 end\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n\n // Tip: 判断纹理间隔\n if(flag > 0.0) {\n pattern = vec4(0.0);\n }\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n }\n \n\n // blur - AA\n if(v < v_blur) {\n gl_FragColor.a = mix(0.0, gl_FragColor.a, v/v_blur);\n } else if(v > 1.0 - v_blur) {\n gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Rt,depth:{enable:!1},blend:this.getBlend()});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"distance",type:i.AttributeType.Attribute,descriptor:{name:"a_Distance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:i.AttributeType.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0],n[1]]:[n,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:i.AttributeType.Attribute,descriptor:{name:"a_Miter",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e,n){return[n[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.texture]||{x:0,y:0};return[n.x,n.y]}}})}}]),g}(H),line:Se,simple:Te,linearline:Ee,earthArc3d:ye,flowline:ve};var Ce=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","LineLayer"),(0,p.Z)((0,u.Z)(t),"enableEncodeStyles",["opacity","offsets","stroke"]),(0,p.Z)((0,u.Z)(t),"arrowInsertCount",0),(0,p.Z)((0,u.Z)(t),"defaultSourceConfig",{data:[{lng1:100,lat1:30,lng2:130,lat2:30}],options:{parser:{type:"json",x:"lng1",y:"lat1",x1:"lng2",y1:"lat2"}}}),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new Ae[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getDefaultConfig",value:function(){return{line:{},linearline:{},simple:{},wall:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"},tileLine:{},earthArc3d:{},flowline:{}}[this.getModelType()]}},{key:"getModelType",value:function(){var t;if(this.layerType)return this.layerType;var e=this.styleAttributeService.getLayerStyleAttribute("shape");return(null==e||null===(t=e.scale)||void 0===t?void 0:t.field)||"line"}},{key:"processData",value:function(t){if("simple"!==this.getModelType())return t;var e=[];return t.map((function(t){if(Array.isArray(t.coordinates)&&Array.isArray(t.coordinates[0])&&Array.isArray(t.coordinates[0][0])){var n=(0,g.Z)({},t);t.coordinates.map((function(t){e.push((0,g.Z)((0,g.Z)({},n),{},{coordinates:t}))}))}else e.push(t)})),e}}]),f}(V);var Oe=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"raiseCount",0),(0,p.Z)((0,u.Z)(t),"raiseRepeat",0),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.animateOption,n=void 0===e?{enable:!1,speed:.01,repeat:!1}:e,r=t.opacity,i=void 0===r?1:r,o=t.sourceColor,a=t.targetColor,s=t.pickLight,u=void 0!==s&&s,l=t.heightfixed,c=void 0!==l&&l,h=t.opacityLinear,p=void 0===h?{enable:!1,dir:"up"}:h,f=t.lightEnable,d=void 0===f||f,m=0,g=[0,0,0,0],y=[0,0,0,0];if(o&&a&&(g=(0,x.rgb2arr)(o),y=(0,x.rgb2arr)(a),m=1),this.raiseCount<1&&this.raiseRepeat>0&&n.enable){var v=n.speed,_=void 0===v?.01:v;this.raiseCount+=_,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}return{u_pickLight:Number(u),u_heightfixed:Number(c),u_r:n.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:(0,S.isNumber)(i)?i:1,u_linearColor:m,u_sourceColor:g,u_targetColor:y,u_opacitylinear:Number(p.enable),u_opacitylinear_dir:"up"===p.dir?1:0,u_lightEnable:Number(d)}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.animateOption.repeat,r=void 0===n?1:n,this.raiseRepeat=r,t.next=4,this.layer.buildLayerModel({moduleName:"pointEarthExtrude",vertexShader:'precision highp float;\n\n#define pi 3.1415926535\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\nattribute vec4 a_Color;\nattribute vec3 a_Size;\nattribute vec3 a_Normal;\n\nuniform float u_heightfixed: 0.0; // 默认不固定\nuniform float u_globel;\nuniform float u_r;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform float u_lightEnable: 1;\nvarying float v_lightWeight;\nvarying float v_barLinearZ;\n// 用于将在顶点着色器中计算好的样式值传递给片元\n\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nfloat getYRadian(float x, float z) {\n if(x > 0.0 && z > 0.0) {\n return atan(x/z);\n } else if(x > 0.0 && z <= 0.0){\n return atan(-z/x) + pi/2.0;\n } else if(x <= 0.0 && z <= 0.0) {\n return pi + atan(x/z); //atan(x/z) + \n } else {\n return atan(z/-x) + pi*3.0/2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y/r);\n}\n\nvoid main() {\n\n \n float textureOffset = 0.0; // 在 cell 中取值的偏移量\n\n textureOffset = opacityAndOffset.g;\n // cal style mapping - 数据纹理映射部分的计算\n vec3 size = a_Size * a_Position;\n\n // a_Position.z 是在构建网格的时候传入的标准值 0 - 1,在插值器插值可以获取 0~1 线性渐变的值\n v_barLinearZ = a_Position.z;\n\n vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移\n if(u_heightfixed < 1.0) { // 圆柱体不固定高度\n \n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n offset = offset * pow(2.0, (19.0 - u_Zoom));\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3\n offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));\n }\n } else {// 圆柱体固定高度 ( 处理 mapbox )\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n offset *= 4.0/pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n\n vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));\n\n // u_r 控制圆柱的生长\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // 圆柱光照效果\n float lightWeight = 1.0;\n if(u_lightEnable > 0.0) { // 取消三元表达式,增强健壮性\n lightWeight = calc_lighting(pos);\n }\n v_lightWeight = lightWeight;\n // 设置圆柱的底色\n if(u_linearColor == 1.0) { // 使用渐变颜色\n v_color = mix(u_sourceColor, u_targetColor, barLinearZ);\n v_color.rgb *= lightWeight;\n } else { // 使用 color 方法传入的颜色\n v_color = a_Color;\n }\n v_color.a *= u_opacity;\n\n \n // 在地球模式下,将原本垂直于 xy 平面的圆柱调整姿态到适应圆的角度\n //旋转矩阵mx,创建绕x轴旋转矩阵\n float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);\n float xRadian = getXRadian(a_Pos.y, r);\n float xcos = cos(xRadian);//求解旋转角度余弦值\n float xsin = sin(xRadian);//求解旋转角度正弦值\n mat4 mx = mat4(\n 1,0,0,0, \n 0,xcos,-xsin,0, \n 0,xsin,xcos,0, \n 0,0,0,1);\n\n //旋转矩阵my,创建绕y轴旋转矩阵\n float yRadian = getYRadian(a_Pos.x, a_Pos.z);\n float ycos = cos(yRadian);//求解旋转角度余弦值\n float ysin = sin(yRadian);//求解旋转角度正弦值\n mat4 my = mat4(\n ycos,0,-ysin,0, \n 0,1,0,0, \n ysin,0,ycos,0, \n 0,0,0,1);\n\n gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);\n \n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'varying vec4 v_color;\nuniform float u_opacity: 1.0;\n\nuniform float u_pickLight: 0.0;\n\n#pragma include "picking"\n\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nuniform float u_opacitylinear: 0.0;\nuniform float u_opacitylinear_dir: 1.0;\nvarying float v_lightWeight;\nvarying float v_barLinearZ;\nvoid main() {\n\n gl_FragColor = v_color;\n\n // 开启透明度渐变\n if(u_opacitylinear > 0.0) {\n gl_FragColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;\n }\n\n // picking\n if(u_pickLight > 0.0) {\n gl_FragColor = filterColorAlpha(gl_FragColor, v_lightWeight);\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n',triangulation:Lt,depth:{enable:!0},cull:{enable:!0,face:(0,x.getCullFace)(this.mapService.version)},blend:this.getBlend()});case 4:return i=t.sent,t.abrupt("return",[i]);case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t){var e=t.size;if(e){var n=[];return Array.isArray(e)&&(n=2===e.length?[e[0],e[0],e[1]]:e),Array.isArray(e)||(n=[e,e,e]),n}return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:i.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t){var e=(0,x.calculateCentroid)(t.coordinates);return at([e[0],e[1]])}}})}}]),g}(H);var Pe=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.strokeOpacity,i=void 0===r?1:r,o=t.strokeWidth,a=void 0===o?0:o,s=t.stroke,u=void 0===s?"rgba(0,0,0,0)":s,l=t.blend,c=t.blur;return{u_blur:void 0===c?0:c,u_additive:"additive"===l?1:0,u_opacity:n,u_stroke_opacity:i,u_stroke_width:a,u_stroke_color:(0,x.rgb2arr)(u)}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption,e=void 0===t?{enable:!1}:t;return{u_animate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layer.triangulation=kt,t.next=3,this.layer.buildLayerModel({moduleName:"pointEarthFill",vertexShader:'attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\n\n#pragma include "projection"\n#pragma include "picking"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize 设置拾取大小\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n // TODP: /abs(extrude.x) 是为了兼容地球模式\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + u_offsets, 1.0);\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:"uniform float u_additive;\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + strokeWidth);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n if(outer_df > antialiasblur + 0.018) discard;\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(strokeWidth < 0.01) {\n gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);\n } else {\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), u_stroke_color * u_stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor.a *= opacity_t;\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n",triangulation:kt,depth:{enable:!0},blend:this.getBlend()});case 3:return e=t.sent,t.abrupt("return",[e]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"animateOption2Array",value:function(t){return[t.enable?0:1,t.speed||1,t.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:i.AttributeType.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r){var i=(0,A.Z)(n,3),o=i[0],a=i[1],s=i[2],u=rt.fromValues(0,0,1),l=rt.fromValues(o,0,s),c=o>=0?rt.angle(u,l):2*Math.PI-rt.angle(u,l),h=2*Math.PI-Math.asin(a/100),p=nt.create();nt.rotateY(p,p,c),nt.rotateX(p,p,h);var f=rt.fromValues(1,1,0);rt.transformMat4(f,f,p),rt.normalize(f,f);var d=rt.fromValues(-1,1,0);rt.transformMat4(d,d,p),rt.normalize(d,d);var m=rt.fromValues(-1,-1,0);rt.transformMat4(m,m,p),rt.normalize(m,m);var g=rt.fromValues(1,-1,0);rt.transformMat4(g,g,p),rt.normalize(g,g);var y=[].concat((0,Q.Z)(f),(0,Q.Z)(d),(0,Q.Z)(m),(0,Q.Z)(g)),v=r%4*3;return[y[v],y[v+1],y[v+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?5:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:i.AttributeType.Attribute,descriptor:{name:"a_Shape",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(e){var n=e.shape,r=void 0===n?2:n;return[t.layer.getLayerConfig().shape2d.indexOf(r)]}}})}}]),f}(H);var ke=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"raiseCount",0),(0,p.Z)((0,u.Z)(t),"raiseRepeat",0),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.animateOption,n=void 0===e?{enable:!1,speed:.01,repeat:!1}:e,r=t.opacity,i=void 0===r?1:r,o=t.sourceColor,a=t.targetColor,s=t.pickLight,u=void 0!==s&&s,l=t.heightfixed,c=void 0!==l&&l,h=t.opacityLinear,p=void 0===h?{enable:!1,dir:"up"}:h,f=t.lightEnable,d=void 0===f||f,m=0,g=[0,0,0,0],y=[0,0,0,0];if(o&&a&&(g=(0,x.rgb2arr)(o),y=(0,x.rgb2arr)(a),m=1),this.raiseCount<1&&this.raiseRepeat>0&&n.enable){var v=n.speed,_=void 0===v?.01:v;this.raiseCount+=_,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}return{u_pickLight:Number(u),u_heightfixed:Number(c),u_r:n.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:i,u_linearColor:m,u_sourceColor:g,u_targetColor:y,u_opacitylinear:Number(p.enable),u_opacitylinear_dir:"up"===p.dir?1:0,u_lightEnable:Number(d)}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.depth,r=void 0===n||n,i=e.animateOption.repeat,o=void 0===i?1:i,this.raiseRepeat=o,t.next=4,this.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:'precision highp float;\n\n#define pi 3.1415926535\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\nattribute vec4 a_Color;\nattribute vec3 a_Size;\nattribute vec3 a_Normal;\n\nuniform float u_heightfixed: 0.0; // 默认不固定\nuniform float u_r;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\nvarying float v_lightWeight;\nvarying float v_barLinearZ;\n\nuniform float u_opacity : 1;\nuniform float u_lightEnable: 1;\nuniform float u_opacitylinear: 0.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_opacitylinear_dir: 1.0;\nuniform float u_linearColor: 0.0;\n\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nfloat getYRadian(float x, float z) {\n if(x > 0.0 && z > 0.0) {\n return atan(x/z);\n } else if(x > 0.0 && z <= 0.0){\n return atan(-z/x) + pi/2.0;\n } else if(x <= 0.0 && z <= 0.0) {\n return pi + atan(x/z); //atan(x/z) + \n } else {\n return atan(z/-x) + pi*3.0/2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y/r);\n}\n\nvoid main() {\n\n\n vec3 size = a_Size * a_Position;\n\n vec3 offset = size; // 控制圆柱体的大小 - 从标准单位圆柱体进行偏移\n\n if(u_heightfixed < 1.0) { // 圆柱体不固定高度\n \n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n offset = offset * pow(2.0, (19.0 - u_Zoom));\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减3\n offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));\n }\n } else {// 圆柱体固定高度 ( 处理 mapbox )\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n offset *= 4.0/pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n\n vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));\n\n // u_r 控制圆柱的生长\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // // 圆柱光照效果\n float lightWeight = 1.0;\n\n if(u_lightEnable > 0.0) { // 取消三元表达式,增强健壮性\n lightWeight = calc_lighting(pos);\n }\n\n v_lightWeight = lightWeight;\n\n v_color = a_Color;\n\n // 设置圆柱的底色\n if(u_linearColor == 1.0) { // 使用渐变颜色\n v_color = mix(u_sourceColor, u_targetColor, a_Position.z);\n v_color.a = v_color.a * u_opacity;\n } else {\n v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * u_opacity);\n }\n\n if(u_opacitylinear > 0.0) {\n v_color.a *= u_opacitylinear_dir > 0.0 ? (1.0 - a_Position.z): a_Position.z;\n }\n\n\n // gl_Position = project_common_position_to_clipspace(pos);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * pos;\n } else {\n gl_Position = project_common_position_to_clipspace(pos);\n }\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'varying vec4 v_color;\nvarying float v_lightWeight;\nuniform float u_pickLight: 0.0;\n\n#pragma include "picking"\n\n\nvoid main() {\n\n gl_FragColor = v_color;\n // 开启透明度渐变\n // picking\n if(u_pickLight > 0.0) {\n gl_FragColor = filterColorAlpha(gl_FragColor, v_lightWeight);\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n',triangulation:Lt,cull:{enable:!0,face:(0,x.getCullFace)(this.mapService.version)},depth:{enable:r}});case 4:return a=t.sent,t.abrupt("return",[a]);case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t){var e=t.size;if(e){var n=[];return Array.isArray(e)&&(n=2===e.length?[e[0],e[0],e[1]]:e),Array.isArray(e)||(n=[e,e,e]),n}return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:i.AttributeType.Attribute,descriptor:{name:"a_Pos",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t){var e=(0,x.calculateCentroid)(t.coordinates);return[e[0],e[1],0]}}})}}]),g}(H);var Le='attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform int u_size_unit;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec4 v_stroke;\n\n// uniform float u_opacity : 1;\nuniform float u_stroke_width: 2;\nuniform vec3 u_blur_height_fixed: [0, 0, 0];\n\n\n#pragma include "projection"\n#pragma include "picking"\n\n\nvoid main() {\n // 透明度计算\n v_stroke = stroke; \n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize 设置拾取大小\n * u_meter2coord 在等面积大小的时候设置单位\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n\n\n // unpack color(vec2)\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n if(u_size_unit == 1) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);\n\n vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);\n vec3 aPosition = a_Position;\n\n offset = project_pixel(offset);\n \n // TODP: /abs(extrude.x) 是为了兼容地球模式\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n // vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n float raisingHeight = u_blur_height_fixed.y;\n\n if(u_blur_height_fixed.z < 1.0) { // false\n raisingHeight = project_pixel(u_blur_height_fixed.y);\n } else {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;\n }\n }\n \n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',Ie=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.strokeOpacity,n=void 0===e?1:e,r=t.strokeWidth,i=void 0===r?0:r,o=t.blend,a=t.blur,s=void 0===a?0:a,u=t.raisingHeight,l=void 0===u?0:u,c=t.heightfixed,h=void 0!==c&&c,p=t.unit,f=void 0===p?"pixel":p;return(0,g.Z)({u_blur_height_fixed:[s,Number(l),Number(h)],u_additive:"additive"===o?1:0,u_stroke_opacity:n,u_stroke_width:i,u_size_unit:X[f]},this.getStyleAttribute())}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption,e=void 0===t?{enable:!1}:t;return{u_animate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),x.PointFillTriangulation)}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a,s,u;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.animateOption,r=void 0===n?{enable:!1}:n,i=this.getShaders(r),o=i.frag,a=i.vert,s=i.type,this.layer.triangulation=x.PointFillTriangulation,t.next=5,this.layer.buildLayerModel({moduleName:s,vertexShader:a,fragmentShader:o,inject:this.getInject(),triangulation:x.PointFillTriangulation,depth:{enable:!1}});case 5:return u=t.sent,t.abrupt("return",[u]);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getShaders",value:function(t){return t.enable?(t.type,{frag:"\nuniform float u_additive;\n\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n \n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n gl_FragColor = v_color;\n\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);\n \n // 根据叠加模式选择效果\n if(u_additive > 0.0) {\n gl_FragColor *= intensity;\n // 优化水波点 blend additive 模式下有的拾取效果 \n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n",vert:Le,type:"pointWave"}):{frag:"uniform float u_additive;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec4 v_stroke;\n\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(u_stroke_width < 0.01) {\n gl_FragColor = v_color;\n } else {\n gl_FragColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor.a *= opacity_t;\n gl_FragColor = filterColor(gl_FragColor);\n }\n // 作为 mask 模板时需要丢弃透明的像素\n if(gl_FragColor.a < 0.01) {\n discard;\n } \n}\n",vert:Le,type:"pointFill"}}},{key:"animateOption2Array",value:function(t){return[t.enable?0:1,t.speed||1,t.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var t=this.layer.getLayerConfig().shape2d;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:i.AttributeType.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r){var i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?5:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:i.AttributeType.Attribute,descriptor:{name:"a_Shape",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(e){var n=e.shape,r=void 0===n?2:n;return[t.indexOf(r)]}}})}}]),f}(H);var Re=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"meter2coord",1),(0,p.Z)((0,u.Z)(t),"isMeter",!1),(0,p.Z)((0,u.Z)(t),"radian",0),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),void t.layerService.throttleRenderLayers();t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.LINEAR,min:i.gl.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128,mipmap:!0})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.offsets,i=void 0===r?[0,0]:r,o=t.rotation,a=t.raisingHeight,s=void 0===a?0:a,u=t.heightfixed,l=void 0!==u&&u,c=t.unit,h=void 0===c?"pixel":c;this.rendererService.getDirty()&&this.texture.bind();var p=1;return"GAODE2.x"!==this.mapService.version&&"GAODE1.x"!==this.mapService.version||(p=-1),this.radian=void 0!==o?p*Math.PI*o/180:p*Math.PI*(this.mapService.getRotation()%360)/180,{u_raisingHeight:Number(s),u_heightfixed:Number(l),u_size_unit:X[h],u_RotateMatrix:new Float32Array([Math.cos(this.radian),Math.sin(this.radian),-Math.sin(this.radian),Math.cos(this.radian)]),u_texture:this.texture,u_textSize:[1024,this.iconService.canvasHeight||128],u_opacity:n,u_offsets:i}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Pt)}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.iconService.on("imageUpdate",this.updateTexture),this.updateTexture(),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"pointFillImage",vertexShader:'attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute vec2 a_Uv;\nattribute float a_Rotate;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform mat2 u_RotateMatrix;\nuniform int u_size_unit;\n\nvarying vec2 v_uv; // 本身的 uv 坐标\nvarying vec2 v_Iconuv; // icon 贴图的 uv 坐标\n\nuniform float u_raisingHeight: 0.0;\nuniform float u_heightfixed: 0.0;\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\n\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n v_uv = (a_Extrude.xy + 1.0)/2.0;\n v_uv.y = 1.0 - v_uv.y;\n v_Iconuv = a_Uv;\n\n\n highp float angle_sin = sin(a_Rotate);\n highp float angle_cos = cos(a_Rotate);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n float newSize = a_Size;\n if(u_size_unit == 1) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n\n // vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);\n vec2 offset = (rotation_matrix * u_RotateMatrix * extrude.xy * (newSize) + u_offsets);\n vec3 aPosition = a_Position;\n\n offset = project_pixel(offset);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n float raisingHeight = u_raisingHeight;\n if(u_heightfixed < 1.0) { // height fixed\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp *vec4(project_pos.xy + offset, raisingHeight, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'uniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float u_opacity : 1;\n\n#pragma include "sdf_2d"\n#pragma include "picking"\nvarying vec2 v_uv; // 本身的 uv 坐标\nvarying vec2 v_Iconuv;\n\nvoid main() {\n\n vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;\n gl_FragColor = texture2D(u_texture, pos);\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Pt,depth:{enable:!1},cull:{enable:!0,face:(0,x.getCullFace)(this.mapService.version)}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){var t;this.iconService.off("imageUpdate",this.updateTexture),null===(t=this.texture)||void 0===t||t.destroy()}},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"rotate",type:i.AttributeType.Attribute,descriptor:{name:"a_Rotate",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.rotate,n=void 0===e?0:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.shape]||{x:-64,y:-64};return[n.x,n.y]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:i.AttributeType.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r){var i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?5:e;return Array.isArray(n)?[n[0]]:[n]}}})}}]),g}(H);var De=function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"updateTexture",(function(){var e=t.rendererService.createTexture2D;if(t.texture)return t.texture.update({data:t.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),void setTimeout((function(){t.layerService.throttleRenderLayers()}));t.texture=e({data:t.iconService.getCanvas(),mag:i.gl.LINEAR,min:i.gl.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:t.iconService.canvasHeight||128,mipmap:!0})})),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.offsets,i=void 0===r?[0,0]:r,o=t.raisingHeight,a=void 0===o?0:o,s=t.heightfixed,u=void 0!==s&&s;return this.rendererService.getDirty()&&this.texture.bind(),{u_raisingHeight:Number(a),u_heightfixed:Number(u),u_texture:this.texture,u_textSize:[1024,this.iconService.canvasHeight||128],u_opacity:n,u_offsets:i}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.iconService.on("imageUpdate",this.updateTexture),this.updateTexture(),t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"pointImage",vertexShader:'precision highp float;\nattribute vec3 a_Position;\nattribute vec4 a_Color;\nattribute vec2 a_Uv;\nattribute float a_Size;\nvarying vec4 v_color;\nvarying vec2 v_uv;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec2 u_offsets;\n\nuniform float u_opacity : 1;\nuniform float u_raisingHeight: 0.0;\nuniform float u_heightfixed: 0.0;\n\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n\n // cal style mapping - 数据纹理映射部分的计算\n v_color = a_Color;\n v_uv = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n \n vec2 offset = project_pixel(u_offsets);\n\n float raisingHeight = u_raisingHeight;\n if(u_heightfixed < 1.0) { // false\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, raisingHeight, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nuniform sampler2D u_texture;\nvarying vec4 v_color;\nvarying vec2 v_uv;\nuniform vec2 u_textSize;\nuniform float u_opacity : 1;\n\n#pragma include "picking"\n\nvoid main(){\n vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;\n vec4 textureColor;\n\n // Y = 0.299R + 0.587G + 0.114B // 亮度提取\n \n textureColor = texture2D(u_texture, pos);\n\n // Tip: 去除边缘部分 mipmap 导致的混合变暗\n float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);\n if(fragmengTocenter >= 0.5) {\n float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;\n textureColor.a *= luma;\n }\n \n \n\n if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){\n gl_FragColor= textureColor;\n }else {\n gl_FragColor= step(0.01, textureColor.z) * v_color;\n }\n\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n \n if (gl_FragColor.a < 0.01) {\n discard;\n }\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:It,depth:{enable:!1},primitive:i.gl.POINTS});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){var t=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?5:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(e){var n=t.iconService.getIconMap()[e.shape]||{x:-64,y:-64};return[n.x,n.y]}}})}}]),g}(H);function Ne(t){var e=t.coordinates;return{vertices:(0,Q.Z)(e),indices:[0],size:e.length}}var Fe=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig().opacity,e=void 0===t?1:t;return{u_opacity:(0,S.isNumber)(e)?e:1}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layer.triangulation=Ne,t.next=3,this.layer.buildLayerModel({moduleName:"pointNormal",vertexShader:'\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform float u_opacity : 1;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\n\nvarying vec4 v_color;\n\n#pragma include "projection"\n#pragma include "project"\n\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(a_Position.xy, a_Position.z, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n}\n',fragmentShader:"varying vec4 v_color;\nvoid main() {\n gl_FragColor = v_color;\n}\n",triangulation:Ne,depth:{enable:!1},primitive:i.gl.POINTS,pick:!1});case 3:return e=t.sent,t.abrupt("return",[e]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}})}}]),f}(H);var ze=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.blend,i=t.speed,o=void 0===i?1:i,a=t.unit;return{u_size_unit:X[void 0===a?"pixel":a],u_speed:o,u_additive:"additive"===r?1:0,u_opacity:n}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption,e=void 0===t?{enable:!1}:t;return{u_animate:this.animateOption2Array(e),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Pt)}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:'attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nuniform float u_speed: 1.0;\nuniform float u_time;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform int u_size_unit;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float newSize = setPickingSize(a_Size);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2( \n cos(time), sin(time), \n -sin(time), cos(time)\n );\n v_exteude = rotateMatrix * a_Extrude.xy;\n\n // unpack color(vec2)\n v_color = a_Color;\n\n\n\n // anti-alias\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n if(u_size_unit == 1) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n // radius(16-bit)\n v_radius = newSize;\n\n vec2 offset = (extrude.xy * (newSize));\n vec3 aPosition = a_Position;\n \n // 不以米为实际单位\n offset = project_pixel(offset);\n \n v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp *vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nuniform float u_additive;\nuniform float u_opacity: 1.0;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n#pragma include "sdf_2d"\n#pragma include "picking"\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n } else {\n gl_FragColor.a *= opacity_t;\n }\n\n if(gl_FragColor.a > 0.0) {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n vec2 extrude = v_exteude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n // full circle\n // float rades = dot(dir, baseDir);\n // float flag = sign(dir.y);\n // float radar_v = (flag - 1.0) * -0.5 + flag * acos(rades)/pi/2.0;\n \n // half circle\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n gl_FragColor.a *= radar_v;\n}\n',triangulation:Pt,depth:{enable:!1}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"animateOption2Array",value:function(t){return[t.enable?0:1,t.speed||1,t.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:i.AttributeType.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r){var i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?5:e;return Array.isArray(n)?[n[0]]:[n]}}})}}]),f}(H);function Be(t){var e=t.coordinates;return{vertices:(0,Q.Z)(e),indices:[0],size:e.length}}var je=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.offsets,i=void 0===r?[0,0]:r,o=t.blend,a=t.strokeOpacity,s=void 0===a?1:a,u=t.strokeWidth,l=void 0===u?0:u,c=t.stroke,h=void 0===c?"#fff":c;return{u_additive:"additive"===o?1:0,u_opacity:n,u_offsets:i,u_stroke_opacity:s,u_stroke_width:l,u_stroke_color:(0,x.rgb2arr)(h)}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layer.triangulation=Be,t.next=3,this.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:'\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\nuniform float u_stroke_width;\n\nvarying float v_blur;\nvarying float v_innerRadius;\n\n\n\n#pragma include "projection"\n#pragma include "picking"\n#pragma include "project"\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);\n v_blur = 1.0 - max(2.0/a_Size, 0.05);\n v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);\n \n vec2 offset = project_pixel(u_offsets);\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);\n } else { // else\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'\nuniform float u_additive;\nuniform float u_stroke_opacity : 1;\n\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n\nvarying vec4 v_color;\nvarying float v_blur;\nvarying float v_innerRadius;\n\n#pragma include "picking"\nvoid main() {\n vec2 center = vec2(0.5);\n\n // Tip: 片元到中心点的距离 0 - 1\n float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;\n // Tip: 片元的剪切成圆形\n float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);\n\n\n if(v_innerRadius < 0.99) {\n // 当存在 stroke 且 stroke > 0.01\n float blurWidth = (1.0 - v_blur)/2.0;\n vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);\n if(fragmengTocenter > v_innerRadius + blurWidth) {\n gl_FragColor = stroke;\n } else if(fragmengTocenter > v_innerRadius - blurWidth){\n float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);\n gl_FragColor = mix(v_color, stroke, mixR);\n } else {\n gl_FragColor = v_color;\n }\n } else {\n // 当不存在 stroke 或 stroke <= 0.01\n gl_FragColor = v_color;\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n \n if(u_additive > 0.0) {\n gl_FragColor *= circleClipOpacity;\n } else {\n gl_FragColor.a *= circleClipOpacity;\n }\n\n}\n',triangulation:Be,depth:{enable:!1},primitive:i.gl.POINTS});case 3:return e=t.sent,t.abrupt("return",[e]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}})}}]),f}(H),Ue=n(5512);function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}const Ve=function(){function t(e,n,r){(0,a.Z)(this,t),(0,p.Z)(this,"boxCells",[]);var i=this.boxCells;this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(n/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]);this.boxKeys=[],this.bboxes=[],this.width=e,this.height=n,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/n,this.boxUid=0}return(0,s.Z)(t,[{key:"insert",value:function(t,e,n,r,i){this.forEachCell(e,n,r,i,this.insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}},{key:"query",value:function(t,e,n,r,i){return this.queryHitTest(t,e,n,r,!1,i)}},{key:"hitTest",value:function(t,e,n,r,i){return this.queryHitTest(t,e,n,r,!0,i)}},{key:"insertBoxCell",value:function(t,e,n,r,i,o){this.boxCells[i].push(o)}},{key:"queryHitTest",value:function(t,e,n,r,i,o){if(n<0||t>this.width||r<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)a.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]});return o?a.filter(o):a}var u={hitTest:i,seenUids:{box:{},circle:{}}};return this.forEachCell(t,e,n,r,this.queryCell,a,u,o),i?a.length>0:a}},{key:"queryCell",value:function(t,e,n,r,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l){var c,h=this.bboxes,p=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(l);try{for(p.s();!(c=p.n()).done;){var f=c.value;if(!u.box[f]){u.box[f]=!0;var d=4*f;if(t<=h[d+2]&&e<=h[d+3]&&n>=h[d+0]&&r>=h[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:h[d],y1:h[d+1],x2:h[d+2],y2:h[d+3]})}}}}catch(t){p.e(t)}finally{p.f()}}return!1}},{key:"forEachCell",value:function(t,e,n,r,i,o,a,s){for(var u=this.convertToXCellCoord(t),l=this.convertToYCellCoord(e),c=this.convertToXCellCoord(n),h=this.convertToYCellCoord(r),p=u;p<=c;p++)for(var f=l;f<=h;f++){var d=this.xCellCount*f+p;if(i.call(this,t,e,n,r,d,o,a,s))return}}},{key:"convertToXCellCoord",value:function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}},{key:"convertToYCellCoord",value:function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}}]),t}();var Ge=function(){function t(e,n){(0,a.Z)(this,t),(0,p.Z)(this,"viewportPadding",100),this.width=e,this.height=n,this.viewportPadding=Math.max(e,n),this.grid=new Ve(e+this.viewportPadding,n+this.viewportPadding,25),this.screenRightBoundary=e+this.viewportPadding,this.screenBottomBoundary=n+this.viewportPadding,this.gridRightBoundary=e+2*this.viewportPadding,this.gridBottomBoundary=n+2*this.viewportPadding}return(0,s.Z)(t,[{key:"placeCollisionBox",value:function(t){var e=t.x1+t.anchorPointX+this.viewportPadding,n=t.y1+t.anchorPointY+this.viewportPadding,r=t.x2+t.anchorPointX+this.viewportPadding,i=t.y2+t.anchorPointY+this.viewportPadding;return!this.isInsideGrid(e,n,r,i)||this.grid.hitTest(e,n,r,i)?{box:[]}:{box:[e,n,r,i]}}},{key:"insertCollisionBox",value:function(t,e){var n={featureIndex:e};this.grid.insert(n,t[0],t[1],t[2],t[3])}},{key:"project",value:function(t,e,n){var r=Ue.al(e,n,0,1),i=Ue.Ue(),o=nt.fromValues.apply(nt,(0,Q.Z)(t));return Ue.fF(i,r,o),{x:(i[0]/i[3]+1)/2*this.width+this.viewportPadding,y:(-i[1]/i[3]+1)/2*this.height+this.viewportPadding}}},{key:"isInsideGrid",value:function(t,e,n,r){return n>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary}}]),t}();function He(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return We(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?We(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function We(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qe(t){var e=.5,n=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;break;default:e=.5}switch(t){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0;break;default:n=.5}return{horizontalAlign:e,verticalAlign:n}}function Ye(t,e,n,r,i){if(i){var o=t[r],a=o.glyph;if(a)for(var s=e[a].advance*o.scale,u=(t[r].x+s)*i,l=n;l<=r;l++)t[l].x-=u}}function Xe(t,e,n,r,i,o,a){var s,u=(e-n)*i,l=(-r*a+.5)*o,c=He(t);try{for(c.s();!(s=c.n()).done;){var h=s.value;h.x+=u,h.y+=l}}catch(t){c.e(t)}finally{c.f()}}function $e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ke='#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\nuniform sampler2D u_sdf_map;\nuniform float u_gamma_scale : 0.5;\nuniform float u_stroke_width : 2.0;\nuniform float u_halo_blur : 0.5;\nuniform float u_DevicePixelRatio;\n\nvarying vec4 v_color;\nvarying vec4 v_stroke_color;\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying float v_fontScale;\n\n\n#pragma include "picking"\nvoid main() {\n // get style data mapping\n\n // get sdf from atlas\n float dist = texture2D(u_sdf_map, v_uv).a;\n\n lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));\n\n gl_FragColor.a *= alpha;\n // 作为 mask 模板时需要丢弃透明的像素\n if (gl_FragColor.a < 0.01) {\n discard;\n }\n gl_FragColor = filterColor(gl_FragColor);\n}\n',Je='#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\nattribute vec3 a_Position;\nattribute vec2 a_tex;\nattribute vec2 a_textOffsets;\nattribute vec4 a_Color;\nattribute float a_Size;\nattribute float a_Rotate;\n\nuniform vec2 u_sdf_map_size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_raisingHeight: 0.0;\n\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying vec4 v_color;\nvarying vec4 v_stroke_color;\nvarying float v_fontScale;\n// uniform float u_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n \n v_uv = a_tex / u_sdf_map_size;\n\n\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);\n\n // 文本缩放比例\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n highp float angle_sin = sin(a_Rotate);\n highp float angle_cos = cos(a_Rotate);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n \n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n projected_position = u_Mvp *(vec4(a_Position.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n } else { // else\n projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n }\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n';function Qe(t){var e=this,n=t.id,r=[],i=[];if(!e.glyphInfoMap||!e.glyphInfoMap[n])return{vertices:[],indices:[],size:7};var o=e.glyphInfoMap[n].centroid,a=2===o.length?[o[0],o[1],0]:o;return e.glyphInfoMap[n].glyphQuads.forEach((function(t,e){r.push.apply(r,(0,Q.Z)(a).concat([t.tex.x,t.tex.y+t.tex.height,t.tl.x,t.tl.y],(0,Q.Z)(a),[t.tex.x+t.tex.width,t.tex.y+t.tex.height,t.tr.x,t.tr.y],(0,Q.Z)(a),[t.tex.x+t.tex.width,t.tex.y,t.br.x,t.br.y],(0,Q.Z)(a),[t.tex.x,t.tex.y,t.bl.x,t.bl.y])),i.push(0+4*e,1+4*e,2+4*e,2+4*e,3+4*e,0+4*e)})),{vertices:r,indices:i,size:7}}var tn=function(t){(0,l.Z)(_,t);var e,n,r,f,m,y,v=(m=_,y=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(m);if(y){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function _(){var t;(0,a.Z)(this,_);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=v.call.apply(v,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"glyphInfoMap",{}),(0,p.Z)((0,u.Z)(t),"currentZoom",-1),(0,p.Z)((0,u.Z)(t),"textureHeight",0),(0,p.Z)((0,u.Z)(t),"textCount",0),(0,p.Z)((0,u.Z)(t),"preTextStyle",{}),(0,p.Z)((0,u.Z)(t),"mapping",(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.initGlyph(),t.updateTexture(),e.next=4,t.reBuildModel();case 4:case"end":return e.stop()}}),e)})))),t}return(0,s.Z)(_,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=(t.opacity,t.stroke),n=void 0===e?"#fff":e,r=t.strokeWidth,i=void 0===r?0:r,o=t.halo,a=void 0===o?.5:o,s=t.gamma,u=void 0===s?2:s,l=t.raisingHeight,c=void 0===l?0:l,h=this.getFontServiceMapping(),p=this.getFontServiceCanvas();return h&&Object.keys(h).length!==this.textCount&&p&&(this.updateTexture(),this.textCount=Object.keys(h).length),this.preTextStyle=this.getTextStyle(),(0,g.Z)({u_raisingHeight:Number(c),u_stroke_width:i,u_stroke_color:(0,x.rgb2arr)(n),u_sdf_map:this.texture,u_halo_blur:a,u_gamma_scale:u,u_sdf_map_size:[(null==p?void 0:p.width)||1,(null==p?void 0:p.height)||1]},this.getStyleAttribute())}},{key:"initModels",value:(f=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.bindEvent(),this.extent=this.textExtent(),this.rawEncodeData=this.layer.getEncodedData(),this.preTextStyle=this.getTextStyle(),t.abrupt("return",this.buildModels());case 5:case"end":return t.stop()}}),t,this)}))),function(){return f.apply(this,arguments)})},{key:"buildModels",value:(r=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),n=e.textAllowOverlap,r=void 0!==n&&n,this.initGlyph(),this.updateTexture(),r||this.filterGlyphs(),t.next=6,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:Je,fragmentShader:Ke,inject:this.getInject(),triangulation:Qe.bind(this),depth:{enable:!1}});case 6:return i=t.sent,t.abrupt("return",[i]);case 8:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"needUpdate",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a,s,u,l,c,h,p;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.getTextStyle(),n=e.textAllowOverlap,r=void 0!==n&&n,i=e.textAnchor,o=void 0===i?"center":i,a=e.textOffset,s=e.padding,u=e.fontFamily,l=e.fontWeight,(0,S.isEqual)(s,this.preTextStyle.padding)&&(0,S.isEqual)(a,this.preTextStyle.textOffset)&&(0,S.isEqual)(o,this.preTextStyle.textAnchor)&&(0,S.isEqual)(u,this.preTextStyle.fontFamily)&&(0,S.isEqual)(l,this.preTextStyle.fontWeight)){t.next=5;break}return t.next=4,this.mapping();case 4:case 13:return t.abrupt("return",!0);case 5:if(!r){t.next=7;break}return t.abrupt("return",!1);case 7:if(c=this.mapService.getZoom(),h=this.mapService.getBounds(),p=(0,x.boundsContains)(this.extent,h),!(Math.abs(this.currentZoom-c)>.5)&&p&&r===this.preTextStyle.textAllowOverlap){t.next=14;break}return t.next=13,this.reBuildModel();case 14:return t.abrupt("return",!1);case 15:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy(),this.layer.off("remapping",this.mapping)}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"rotate",type:i.AttributeType.Attribute,descriptor:{name:"a_Rotate",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.rotate,n=void 0===e?0:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:i.AttributeType.Attribute,descriptor:{name:"a_textOffsets",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[5],n[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?12:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:i.AttributeType.Attribute,descriptor:{name:"a_tex",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}},{key:"bindEvent",value:function(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}},{key:"textExtent",value:function(){var t=this.mapService.getBounds();return(0,x.padBounds)(t,.5)}},{key:"initTextFont",value:function(){var t=this.getTextStyle(),e=t.fontWeight,n=t.fontFamily,r=this.rawEncodeData,i=[];r.forEach((function(t){var e,n=t.shape,r=void 0===n?"":n,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $e(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$e(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(r=r.toString());try{for(o.s();!(e=o.n()).done;){var a=e.value;-1===i.indexOf(a)&&i.push(a)}}catch(t){o.e(t)}finally{o.f()}})),this.fontService.setFontOptions({characterSet:i,fontWeight:e,fontFamily:n,iconfont:!1})}},{key:"initIconFontTex",value:function(){var t=this.getTextStyle(),e=t.fontWeight,n=t.fontFamily,r=this.rawEncodeData,i=[];r.forEach((function(t){var e=t.shape,n=void 0===e?"":e;n="".concat(n),-1===i.indexOf(n)&&i.push(n)})),this.fontService.setFontOptions({characterSet:i,fontWeight:e,fontFamily:n,iconfont:!0})}},{key:"getTextStyle",value:function(){var t=this.layer.getLayerConfig(),e=t.fontWeight,n=void 0===e?"400":e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.textAllowOverlap,a=void 0!==o&&o,s=t.padding,u=void 0===s?[0,0]:s,l=t.textAnchor,c=void 0===l?"center":l,h=t.textOffset,p=void 0===h?[0,0]:h,f=t.opacity,d=void 0===f?1:f,m=t.strokeOpacity,g=void 0===m?1:m,y=t.strokeWidth,v=void 0===y?0:y,_=t.stroke;return{fontWeight:n,fontFamily:i,textAllowOverlap:a,padding:u,textAnchor:c,textOffset:p,opacity:d,strokeOpacity:g,strokeWidth:v,stroke:void 0===_?"#000":_}}},{key:"generateGlyphLayout",value:function(t){var e=this,n=this.getFontServiceMapping(),r=this.layer.getLayerConfig(),i=r.spacing,o=void 0===i?2:i,a=r.textAnchor,s=void 0===a?"center":a,u=r.textOffset,l=this.rawEncodeData;this.glyphInfo=l.map((function(r){var i=r.shape,a=void 0===i?"":i,l=r.id,c=r.size,h=void 0===c?1:c,p=function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[0,0],s=arguments.length>7?arguments[7]:void 0,u=t.split("\n"),l=[],c={positionedGlyphs:l,top:a[1],bottom:a[1],left:a[0],right:a[0],lineCount:u.length,text:t};return s?function(t,e,n,r,i,o,a){var s=0,u=-8,l=0,c=t.positionedGlyphs,h="right"===o?1:"left"===o?0:.5,p=c.length;n.forEach((function(t){var n=e[t];if(n&&(c.push({glyph:t,x:n.advance/2,y:u+0,vertical:!1,scale:1,metrics:n}),s+=n.advance+a),c.length!==p){var i=s-a;l=Math.max(i,l),Ye(c,e,p,c.length-1,h)}s=0,u-=r+5}));var f=qe(i),d=f.horizontalAlign,m=f.verticalAlign;Xe(c,h,d,m,l,r,n.length);var g=u- -8;t.top+=-m*g,t.bottom=t.top-g,t.left+=-d*l,t.right=t.left+l}(c,e,u,n,r,i,o):function(t,e,n,r,i,o,a){var s=0,u=-8,l=0,c=t.positionedGlyphs,h="right"===o?1:"left"===o?0:.5,p=c.length;n.forEach((function(t){if(t.split("").forEach((function(t){var n=e[t];n&&(c.push({glyph:t,x:s,y:u+0,vertical:!1,scale:1,metrics:n}),s+=n.advance+a)})),c.length!==p){var n=s-a;l=Math.max(n,l),Ye(c,e,p,c.length-1,h)}s=0,u-=r+5}));var f=qe(i),d=f.horizontalAlign,m=f.verticalAlign;Xe(c,h,d,m,l,r,n.length);var g=u- -8;t.top+=-m*g,t.bottom=t.top-g,t.left+=-d*l,t.right=t.left+l}(c,e,u,n,r,i,o),!!l.length&&c}(a.toString(),n,h,s,"left",o,u,t),f=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0],r=arguments.length>2?arguments[2]:void 0,i=t.positionedGlyphs,o=[],a=He(void 0===i?[]:i);try{for(a.s();!(e=a.n()).done;){var s=e.value,u=s.metrics,l=u.advance*s.scale/2,c=r?[s.x+l,s.y]:[0,0],h=r?[0,0]:[s.x+l+n[0],s.y+n[1]],p=-4*s.scale-l+h[0],f=-4*s.scale+h[1],d=p+u.width*s.scale,m=f+u.height*s.scale,g={x:p,y:f},y={x:d,y:f},v={x:p,y:m},_={x:d,y:m};o.push({tl:g,tr:y,bl:v,br:_,tex:u,glyphOffset:c})}}catch(t){a.e(t)}finally{a.f()}return o}(p,u,!1);return r.shaping=p,r.glyphQuads=f,r.centroid=(0,x.calculateCentroid)(r.coordinates),r.originCentroid="GAODE2.x"===r.version?(0,x.calculateCentroid)(r.originCoordinates):r.originCentroid=r.centroid,e.glyphInfoMap[l]={shaping:p,glyphQuads:f,centroid:(0,x.calculateCentroid)(r.coordinates)},r}))}},{key:"getFontServiceMapping",value:function(){var t=this.layer.getLayerConfig(),e=t.fontWeight,n=void 0===e?"400":e,r=t.fontFamily,i=void 0===r?"sans-serif":r;return this.fontService.getMappingByKey("".concat(i,"_").concat(n))}},{key:"getFontServiceCanvas",value:function(){var t=this.layer.getLayerConfig(),e=t.fontWeight,n=void 0===e?"400":e,r=t.fontFamily,i=void 0===r?"sans-serif":r;return this.fontService.getCanvasByKey("".concat(i,"_").concat(n))}},{key:"filterGlyphs",value:function(){var t=this,e=this.layer.getLayerConfig(),n=e.padding,r=void 0===n?[0,0]:n,i=e.textAllowOverlap;if(void 0===i||!i){this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();var o=this.rendererService.getViewportSize(),a=o.width,s=o.height,u=new Ge(a,s);this.glyphInfo.filter((function(e){var n=e.shaping,i=e.id,o=void 0===i?0:i,a="GAODE2.x"===e.version?e.originCentroid:e.centroid,s=e.size/16,l=t.mapService.lngLatToContainer(a),c=u.placeCollisionBox({x1:n.left*s-r[0],x2:n.right*s+r[0],y1:n.top*s-r[1],y2:n.bottom*s+r[1],anchorPointX:l.x,anchorPointY:l.y}).box;return!(!c||!c.length||(u.insertCollisionBox(c,o),0))})).forEach((function(e){t.glyphInfoMap[e.id]=e}))}}},{key:"initGlyph",value:function(){var t=this.layer.getLayerConfig().iconfont,e=void 0!==t&&t;e?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(e)}},{key:"updateTexture",value:function(){var t=this.rendererService.createTexture2D,e=this.getFontServiceCanvas();this.textureHeight=e.height,this.texture&&this.texture.destroy(),this.texture=t({data:e,mag:i.gl.LINEAR,min:i.gl.LINEAR,width:e.width,height:e.height})}},{key:"reBuildModel",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.filterGlyphs(),t.next=3,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:Je,fragmentShader:Ke,triangulation:Qe.bind(this),inject:this.getInject(),depth:{enable:!1}});case 3:e=t.sent,this.layer.models=[e];case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),_}(H);const en={fillImage:Re,fill:Ie,radar:ze,image:De,normal:Fe,simplePoint:je,extrude:ke,text:tn,earthFill:Pe,earthExtrude:Oe};function nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var rn=function(t){(0,l.Z)(m,t);var e,n,r,i,f=(r=m,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(i){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function m(){var t;(0,a.Z)(this,m);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=f.call.apply(f,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","PointLayer"),(0,p.Z)((0,u.Z)(t),"enableEncodeStyles",["opacity","offsets","stroke"]),(0,p.Z)((0,u.Z)(t),"defaultSourceConfig",{data:[],options:{parser:{type:"json",x:"lng",y:"lat"}}}),t}return(0,s.Z)(m,[{key:"buildModels",value:(n=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel&&this.layerModel.clearModels(),this.layerModel=new en[e](this),t.next=5,this.initLayerModels();case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"rebuildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.buildModels();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getModelTypeWillEmptyData",value:function(){if(this.shapeOption){var t=this.shapeOption,e=t.field,n=t.values,r=this.getLayerConfig().shape2d,i=this.iconService.getIconMap();if(e&&-1!==(null==r?void 0:r.indexOf(e)))return"fill";if("text"===n)return"text";if(n&&n instanceof Array){var o,a=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(n);try{for(a.s();!(o=a.n()).done;){var s=o.value;if("string"==typeof s&&i.hasOwnProperty(s))return"image"}}catch(t){a.e(t)}finally{a.f()}}}return"normal"}},{key:"getDefaultConfig",value:function(){return{fillImage:{},normal:{blend:"additive"},radar:{},simplePoint:{},fill:{blend:"normal"},extrude:{},image:{},text:{blend:"normal"},tile:{},tileText:{},earthFill:{},earthExtrude:{}}[this.getModelType()]}},{key:"getModelType",value:function(){var t=this.getEncodedData(),e=this.getLayerConfig(),n=e.shape2d,r=e.shape3d,i=this.iconService.getIconMap(),o=t.find((function(t){return t.hasOwnProperty("shape")}));if(o){var a=o.shape;return"dot"===a?"normal":"simple"===a?"simplePoint":"radar"===a?"radar":"fillImage"===this.layerType?"fillImage":-1!==(null==n?void 0:n.indexOf(a))?"GLOBEL"===this.mapService.version?"earthFill":"fill":-1!==(null==r?void 0:r.indexOf(a))?"GLOBEL"===this.mapService.version?"earthExtrude":"extrude":i.hasOwnProperty(a)?"image":"text"}return this.getModelTypeWillEmptyData()}}]),m}(V);var on=function(t){(0,l.Z)(m,t);var e,n,r,u,p,f=(u=m,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(u);if(p){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function m(){return(0,a.Z)(this,m),f.apply(this,arguments)}return(0,s.Z)(m,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.heightfixed,n=void 0!==e&&e,r=t.raisingHeight,i=void 0===r?0:r,o=t.topsurface,a=void 0===o||o,s=t.sidesurface,u=void 0===s||s,l=t.sourceColor,c=t.targetColor,h=0,p=[1,1,1,1],f=[1,1,1,1];return l&&c&&(p=(0,x.rgb2arr)(l),f=(0,x.rgb2arr)(c),h=1),(0,g.Z)({u_topsurface:Number(a),u_sidesurface:Number(u),u_heightfixed:Number(n),u_raisingHeight:Number(i),u_linearColor:h,u_sourceColor:p,u_targetColor:f,u_texture:this.texture},this.getStyleAttribute())}},{key:"initModels",value:(r=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.loadTexture();case 2:return t.abrupt("return",this.buildModels());case 3:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"buildModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,i,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getShaders(),n=e.frag,r=e.vert,i=e.type,t.next=3,this.layer.buildLayerModel({moduleName:i,vertexShader:r,fragmentShader:n,inject:this.getInject(),triangulation:Zt});case 3:return o=t.sent,t.abrupt("return",[o]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getShaders",value:function(){var t=this.layer.getLayerConfig(),e=t.pickLight;return t.mapTexture?{frag:'uniform sampler2D u_texture;\nuniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying vec3 v_uvs;\nvarying vec2 v_texture_data;\n\n\n#pragma include "picking"\n\nvoid main() {\n float opacity = u_opacity;\n float isSide = v_texture_data.x;\n float lightWeight = v_texture_data.y;\n float topU = v_uvs[0];\n float topV = 1.0 - v_uvs[1];\n float sidey = v_uvs[2];\n // Tip: 部分机型 GPU 计算精度兼容\n if(isSide < 0.999) {// 是否是边缘\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n gl_FragColor = v_Color;\n }\n } else {\n\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = texture2D(u_texture, vec2(topU, topV));\n // gl_FragColor = vec4(1.0, 0., 0., 1.0);\n }\n \n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:'precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform sampler2D u_texture;\n\n\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // 默认不固定\nuniform float u_raisingHeight: 0.0;\nuniform float u_linearColor: 0.0;\n\nvarying vec2 v_texture_data;\nvarying vec3 v_uvs;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n \n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n float lightWeight = calc_lighting(pos);\n vec4 project_pos = project_position(pos);\n v_uvs = a_uvs;\n\n v_texture_data = vec2(a_Position.z, lightWeight);\n\n if(u_heightfixed > 0.0) { // 判断几何体是否固定高度\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n\n\n\n setPickingColor(a_PickingColor);\n}\n',type:"polygonExtrudeTexture"}:e?{frag:'uniform float u_opacity: 1.0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nvarying vec3 v_uvs;\nvarying vec2 v_texture_data;\n\n#pragma include "picking"\n\nvoid main() {\n float opacity = u_opacity;\n float isSide = v_texture_data.x;\n float sidey = v_uvs[2];\n float lightWeight = v_texture_data.y;\n\n // Tip: 部分机型 GPU 计算精度兼容\n if(isSide < 0.999) {\n // side face\n if(u_sidesurface < 1.0) {\n discard;\n }\n \n if( u_linearColor == 1.0) {\n // side use linear\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n gl_FragColor = linearColor;\n } else {\n // side notuse linear\n gl_FragColor = v_Color;\n }\n } else {\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n gl_FragColor = v_Color;\n }\n\n gl_FragColor.a *= opacity;\n gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);\n}\n',vert:'precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nuniform float u_heightfixed: 0.0; // 默认不固定\nuniform float u_raisingHeight: 0.0;\n\nvarying vec2 v_texture_data;\nvarying vec3 v_uvs;\nvarying vec4 v_Color;\n\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n\n\n v_uvs = a_uvs;\n // cal style mapping - 数据纹理映射部分的计算\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // 判断几何体是否固定高度\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n v_texture_data = vec2(a_Position.z,lightWeight);\n\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n',type:"polygonExtrudePickLight"}:{frag:'uniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\n\n#pragma include "picking"\n\nvoid main() {\n\n\n // top face\n if(u_topsurface < 1.0) {\n discard;\n }\n\n gl_FragColor = v_Color;\n \n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:'precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec3 a_uvs;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\nuniform float u_linearColor: 0;\n\nuniform float u_topsurface: 1.0;\nuniform float u_sidesurface: 1.0;\n\nvarying vec4 v_Color;\nuniform float u_heightfixed: 0.0; // 默认不固定\nuniform float u_raisingHeight: 0.0;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n \n float isSide = a_Position.z;\n float topU = a_uvs[0];\n float topV = 1.0 - a_uvs[1];\n float sidey = a_uvs[2];\n\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n float lightWeight = calc_lighting(pos);\n\n vec4 project_pos = project_position(pos);\n\n if(u_heightfixed > 0.0) { // 判断几何体是否固定高度\n project_pos.z = a_Position.z * a_Size;\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n }\n\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n // Tip: 部分机型 GPU 计算精度兼容\n if(isSide < 0.999) {\n // side face\n // if(u_sidesurface < 1.0) {\n // discard;\n // }\n\n if(u_linearColor == 1.0) {\n vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);\n linearColor.rgb *= lightWeight;\n v_Color = linearColor;\n } else {\n v_Color = a_Color;\n }\n\n } else {\n v_Color = a_Color;\n }\n\n v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);\n\n\n setPickingColor(a_PickingColor);\n}\n',type:"polygonExtrude"}}},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy()}},{key:"registerBuiltinAttributes",value:function(){var t=this.layer.getSource().extent,e=t,n=this.layer.coordCenter||this.layer.getSource().center,r=e[2]-e[0],o=e[3]-e[1];if("GAODE2.x"===this.mapService.version){var a=this.mapService.coordToAMap2RelativeCoordinates([t[0],t[1]],n),s=(0,A.Z)(a,2),u=s[0],l=s[1],c=this.mapService.coordToAMap2RelativeCoordinates([t[2],t[3]],n),h=(0,A.Z)(c,2),p=h[0],f=h[1];r=p-u,o=f-l,e=[u,l,p,f]}this.styleAttributeService.registerStyleAttribute({name:"uvs",type:i.AttributeType.Attribute,descriptor:{name:"a_uvs",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,n,i){var a=i[0],s=i[1];return[(a-e[0])/r,(s-e[1])/o,i[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?10:e;return Array.isArray(n)?[n[0]]:[n]}}})}},{key:"loadTexture",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,o=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.layer.getLayerConfig(),n=e.mapTexture,r=this.rendererService.createTexture2D,this.texture=r({height:0,width:0}),!n){t.next=5;break}return t.abrupt("return",new Promise((function(t,e){var a=new Image;a.crossOrigin="anonymous",a.src=n,a.onload=function(){return o.texture=r({data:a,width:a.width,height:a.height,wrapS:i.gl.CLAMP_TO_EDGE,wrapT:i.gl.CLAMP_TO_EDGE,min:i.gl.LINEAR,mag:i.gl.LINEAR}),t(null)},a.onerror=function(){e(new Error("image load error"))}})));case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),m}(H);var an=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.raisingHeight,n=void 0===e?0:e,r=t.opacityLinear,i=void 0===r?{enable:!1,dir:"in"}:r;return(0,g.Z)({u_raisingHeight:Number(n),u_opacitylinear:Number(i.enable),u_dir:"in"===i.dir?1:0},this.getStyleAttribute())}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u,l,c,h;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelParams(),n=e.frag,r=e.vert,o=e.triangulation,a=e.type,s=this.layer.getLayerConfig(),u=s.workerEnabled,l=void 0!==u&&u,c=s.enablePicking,this.layer.triangulation=o,t.next=5,this.layer.buildLayerModel({moduleName:a,vertexShader:r,fragmentShader:n,inject:this.getInject(),triangulation:o,primitive:i.gl.TRIANGLES,depth:{enable:!1},workerEnabled:l,workerOptions:{modelType:a,enablePicking:c}});case 5:return h=t.sent,t.abrupt("return",[h]);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){var t=this.layer.getLayerConfig().opacityLinear;(void 0===t?{enable:!1,dir:"in"}:t).enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:i.AttributeType.Attribute,descriptor:{name:"a_linear",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n){return[n[3],n[4],n[5]]}}})}},{key:"getModelParams",value:function(){var t=this.layer.getLayerConfig().opacityLinear;return(void 0===t?{enable:!1}:t).enable?{frag:'#pragma include "picking"\nuniform float u_opacitylinear: 0.0;\nuniform float u_dir: 1.0;\nvarying vec3 v_linear;\nvarying vec2 v_pos;\nvarying vec4 v_Color;\n\n\nvoid main() {\n gl_FragColor = v_Color;\n if(u_opacitylinear > 0.0) {\n gl_FragColor.a *= u_dir == 1.0 ? 1.0 - length(v_pos - v_linear.xy)/v_linear.z : length(v_pos - v_linear.xy)/v_linear.z;\n }\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:'attribute vec4 a_Color;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_raisingHeight: 0.0;\n\nvarying vec4 v_Color;\n\n\n#pragma include "projection"\n#pragma include "picking"\n\nuniform float u_opacitylinear: 0.0;\n\nattribute vec3 a_linear;\nvarying vec3 v_linear;\nvarying vec2 v_pos;\n\nvoid main() {\n if(u_opacitylinear > 0.0) {\n v_linear = a_linear;\n v_pos = a_Position.xy;\n }\n v_Color = vec4(a_Color.xyz, a_Color.w * opacity);\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}',type:"polygonLinear",triangulation:jt}:{frag:'varying vec4 v_color;\n#pragma include "picking"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor = filterColor(gl_FragColor);\n}\n',vert:'attribute vec4 a_Color;\nattribute vec3 a_Position;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nuniform float u_raisingHeight: 0.0;\n\nvarying vec4 v_color;\n\n\n#pragma include "projection"\n#pragma include "picking"\n\nvoid main() {\n // cal style mapping - 数据纹理映射部分的计算\n\n // cal style mapping - 数据纹理映射部分的计算\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n project_pos.z += u_raisingHeight;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n project_pos.z *= mapboxZoomScale;\n project_pos.z += u_raisingHeight * mapboxZoomScale;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n\n',type:"polygonFill",triangulation:x.polygonFillTriangulation}}}]),f}(H);var sn=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.watercolor,i=void 0===r?"#6D99A8":r,o=t.watercolor2,a=void 0===o?"#0F121C":o;return{u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3,u_watercolor:(0,x.rgb2arr)(i),u_watercolor2:(0,x.rgb2arr)(a),u_opacity:(0,S.isNumber)(n)?n:1}}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loadTexture(),t.abrupt("return",this.buildModels());case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:'attribute vec2 a_uv;\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec2 v_uv;\n\n#pragma include "projection"\n\nvoid main() {\n v_uv = a_uv;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n}\n\n',fragmentShader:"\nuniform float u_time: 0.0;\nuniform float u_opacity: 1.0;\n\nvarying vec2 v_uv;\n\nfloat coast2water_fadedepth = 0.10;\nfloat large_waveheight = .750; // change to adjust the \"heavy\" waves\nfloat large_wavesize = 3.4; // factor to adjust the large wave size\nfloat small_waveheight = 0.6; // change to adjust the small random waves\nfloat small_wavesize = 0.5; // factor to ajust the small wave size\nfloat water_softlight_fact = 15.; // range [1..200] (should be << smaller than glossy-fact)\nfloat water_glossylight_fact= 120.; // range [1..200]\nfloat particle_amount = 70.;\n// vec3 watercolor = vec3(0.43, 0.60, 0.66); // 'transparent' low-water color (RGB)\n// vec3 watercolor2 = vec3(0.06, 0.07, 0.11); // deep-water color (RGB, should be darker than the low-water color)\nuniform vec4 u_watercolor;\nuniform vec4 u_watercolor2;\nvec3 water_specularcolor = vec3(1.3, 1.3, 0.9); // specular Color (RGB) of the water-highlights\n#define light vec3(-0., sin(u_time*0.5)*.5 + .35, 2.8) // position of the sun\n\nuniform sampler2D u_texture1;\nuniform sampler2D u_texture2;\nuniform sampler2D u_texture3;\n\n \n\nfloat hash( float n ) {\n return fract(sin(n)*43758.5453123);\n}\n\n// 2d noise function\nfloat noise1( in vec2 x ) {\n vec2 p = floor(x);\n vec2 f = smoothstep(0.0, 1.0, fract(x));\n float n = p.x + p.y*57.0;\n return mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),\n mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y);\n}\n\nfloat noise(vec2 p) {\n return texture2D(u_texture2,p*vec2(1./256.)).x;\n}\n\nvec4 highness(vec2 p) {\n vec4 t = texture2D(u_texture1,fract(p));\n float clipped = -2.0-smoothstep(3.,10.,t.a)*6.9-smoothstep(10.,100.,t.a)*89.9-smoothstep(0.,10000.,t.a)*10000.0;\n return clamp(t, 0.0,3.0)+clamp(t/3.0-1.0, 0.0,1.0)+clamp(t/16.0-1.0, 0.0,1.0);\n}\n\nfloat height_map( vec2 p ) {\n vec4 height=highness(p);\n /*\n height = -0.5+\n 0.5*smoothstep(-100.,0.,-height)+\n 2.75*smoothstep(0.,2.,height)+\n 1.75*smoothstep(2.,4.,height)+\n 2.75*smoothstep(4.,16.,height)+\n 1.5*smoothstep(16.,1000.,height);\n */\n\n mat2 m = mat2( 0.9563*1.4, -0.2924*1.4, 0.2924*1.4, 0.9563*1.4 );\n //p = p*6.;\n float f = 0.6000*noise1( p ); p = m*p*1.1*6.;\n f += 0.2500*noise( p ); p = m*p*1.32;\n f += 0.1666*noise( p ); p = m*p*1.11;\n f += 0.0834*noise( p ); p = m*p*1.12;\n f += 0.0634*noise( p ); p = m*p*1.13;\n f += 0.0444*noise( p ); p = m*p*1.14;\n f += 0.0274*noise( p ); p = m*p*1.15;\n f += 0.0134*noise( p ); p = m*p*1.16;\n f += 0.0104*noise( p ); p = m*p*1.17;\n f += 0.0084*noise( p );\n f = .25*f+dot(height,vec4(-.03125,-.125,.25,.25))*.5;\n const float FLAT_LEVEL = 0.92525;\n //f = f*0.25+height*0.75;\n if (f<FLAT_LEVEL)\n f = f;\n else\n f = pow((f-FLAT_LEVEL)/(1.-FLAT_LEVEL), 2.)*(1.-FLAT_LEVEL)*2.0+FLAT_LEVEL; // makes a smooth coast-increase\n return clamp(f, 0., 10.);\n}\n\nvec3 plasma_quintic( float x ) {\n x = clamp( x, 0.0, 1.0);\n vec4 x1 = vec4( 1.0, x, x * x, x * x * x ); // 1 x x2 x3\n vec4 x2 = x1 * x1.w * x; // x4 x5 x6 x7\n return vec3(\n dot( x1.xyzw, vec4( +0.063861086, +1.992659096, -1.023901152, -0.490832805 ) ) + dot( x2.xy, vec2( +1.308442123, -0.914547012 ) ),\n dot( x1.xyzw, vec4( +0.049718590, -0.791144343, +2.892305078, +0.811726816 ) ) + dot( x2.xy, vec2( -4.686502417, +2.717794514 ) ),\n dot( x1.xyzw, vec4( +0.513275779, +1.580255060, -5.164414457, +4.559573646 ) ) + dot( x2.xy, vec2( -1.916810682, +0.570638854 ) ) );\n}\n\nvec4 color(vec2 p){\n vec4 c1 = vec4(1.7,1.6,.9,1);\n vec4 c2 = vec4(.2,.94,.1,1);\n vec4 c3 = vec4(.3,.2,.0,1);\n vec4 c4 = vec4(.99,.99,1.6,1);\n vec4 v = highness(p);\n float los = smoothstep(0.1,1.1,v.b);\n float his = smoothstep(3.5,6.5,v.b);\n float ces = smoothstep(1.,5.,v.a);\n vec4 lo = mix(c1,c2,los);\n vec4 hi = mix(c3,c4,his);\n vec4 ce = mix(lo,hi,ces);\n\n return vec4(plasma_quintic(ces),1).ragb;\n}\n\nvec3 terrain_map( vec2 p )\n{\n return color(p).rgb*0.75+0.25*vec3(0.7, .55, .4)+texture2D(u_texture3, fract(p*5.)).rgb*.5; // test-terrain is simply 'sandstone'\n}\n\nconst mat2 m = mat2( 0.72, -1.60, 1.60, 0.72 );\n\nfloat water_map( vec2 p, float height ) {\n vec2 p2 = p*large_wavesize;\n vec2 shift1 = 0.001*vec2( u_time*160.0*2.0, u_time*120.0*2.0 );\n vec2 shift2 = 0.001*vec2( u_time*190.0*2.0, -u_time*130.0*2.0 );\n\n // coarse crossing 'ocean' waves...\n float f = 0.6000*noise( p );\n f += 0.2500*noise( p*m );\n f += 0.1666*noise( p*m*m );\n float wave = sin(p2.x*0.622+p2.y*0.622+shift2.x*4.269)*large_waveheight*f*height*height ;\n\n p *= small_wavesize;\n f = 0.;\n float amp = 1.0, s = .5;\n for (int i=0; i<9; i++)\n { p = m*p*.947; f -= amp*abs(sin((noise( p+shift1*s )-.5)*2.)); amp = amp*.59; s*=-1.329; }\n \n return wave+f*small_waveheight;\n}\n\nfloat nautic(vec2 p) {\n p *= 18.;\n float f = 0.;\n float amp = 1.0, s = .5;\n for (int i=0; i<3; i++)\n { p = m*p*1.2; f += amp*abs(smoothstep(0., 1., noise( p+u_time*s ))-.5); amp = amp*.5; s*=-1.227; }\n return pow(1.-f, 5.);\n}\n\nfloat particles(vec2 p) {\n p *= 200.;\n float f = 0.;\n float amp = 1.0, s = 1.5;\n for (int i=0; i<3; i++)\n { p = m*p*1.2; f += amp*noise( p+u_time*s ); amp = amp*.5; s*=-1.227; }\n return pow(f*.35, 7.)*particle_amount;\n}\n\nfloat test_shadow( vec2 xy, float height) {\n vec3 r0 = vec3(xy, height);\n vec3 rd = normalize( light - r0 );\n \n float hit = 1.0;\n float t = 0.001;\n for (int j=1; j<25; j++)\n {\n vec3 p = r0 + t*rd;\n float h = height_map( p.xy );\n float height_diff = p.z - h;\n if (height_diff<0.0)\n {\n return 0.0;\n }\n t += 0.01+height_diff*.02;\n hit = min(hit, 2.*height_diff/t); // soft shaddow \n }\n return hit;\n}\n\nvec3 CalcTerrain(vec2 uv, float height) {\n vec3 col = terrain_map( uv );\n vec2 iResolution = vec2(512.);\n float h1 = height_map(uv-vec2(0., 0.5)/ iResolution.xy);\n float h2 = height_map(uv+vec2(0., 0.5)/ iResolution.xy);\n float h3 = height_map(uv-vec2(0.5, 0.)/ iResolution.xy);\n float h4 = height_map(uv+vec2(0.5, 0.)/ iResolution.xy);\n vec3 norm = normalize(vec3(h3-h4, h1-h2, 1.));\n vec3 r0 = vec3(uv, height);\n vec3 rd = normalize( light - r0 );\n float grad = dot(norm, rd);\n col *= grad+pow(grad, 8.);\n float terrainshade = test_shadow( uv, height );\n col = mix(col*.25, col, terrainshade);\n return col;\n}\n\n\nvoid main() {\n vec3 watercolor = u_watercolor.rgb;\n vec3 watercolor2 = u_watercolor2.rgb;\n vec2 uv = v_uv;\n float WATER_LEVEL = 0.84; // Water level (range: 0.0 - 2.0)\n float deepwater_fadedepth = 0.4 + coast2water_fadedepth;\n float height = height_map( uv );\n vec3 col;\n\n float waveheight = clamp(WATER_LEVEL*3.-1.5, 0., 1.);\n float level = WATER_LEVEL + .2*water_map(uv*15. + vec2(u_time*.1), waveheight);\n if (height > level)\n {\n col = CalcTerrain(uv, height);\n }\n if (height <= level)\n {\n vec2 dif = vec2(.0, .01);\n vec2 pos = uv*15. + vec2(u_time*.01);\n float h1 = water_map(pos-dif,waveheight);\n float h2 = water_map(pos+dif,waveheight);\n float h3 = water_map(pos-dif.yx,waveheight);\n float h4 = water_map(pos+dif.yx,waveheight);\n vec3 normwater = normalize(vec3(h3-h4, h1-h2, .125)); // norm-vector of the 'bumpy' water-plane\n uv += normwater.xy*.002*(level-height);\n \n col = CalcTerrain(uv, height);\n\n float coastfade = clamp((level-height)/coast2water_fadedepth, 0., 1.);\n float coastfade2= clamp((level-height)/deepwater_fadedepth, 0., 1.);\n float intensity = col.r*.2126+col.g*.7152+col.b*.0722;\n watercolor = mix(watercolor*intensity, watercolor2, smoothstep(0., 1., coastfade2));\n\n vec3 r0 = vec3(uv, WATER_LEVEL);\n vec3 rd = normalize( light - r0 ); // ray-direction to the light from water-position\n float grad = dot(normwater, rd); // dot-product of norm-vector and light-direction\n float specular = pow(grad, water_softlight_fact); // used for soft highlights \n float specular2= pow(grad, water_glossylight_fact); // used for glossy highlights\n float gradpos = dot(vec3(0., 0., 1.), rd);\n float specular1= smoothstep(0., 1., pow(gradpos, 5.)); // used for diffusity (some darker corona around light's specular reflections...) \n float watershade = test_shadow( uv, level );\n watercolor *= 2.2+watershade;\n watercolor += (.2+.8*watershade) * ((grad-1.0)*.5+specular) * .25;\n watercolor /= (1.+specular1*1.25);\n watercolor += watershade*specular2*water_specularcolor;\n watercolor += watershade*coastfade*(1.-coastfade2)*(vec3(.5, .6, .7)*nautic(uv)+vec3(1., 1., 1.)*particles(uv));\n \n col = mix(col, watercolor, coastfade);\n }\n \n\n float opacity = u_opacity;\n gl_FragColor = vec4(col, opacity); \n}\n",triangulation:Bt,primitive:i.gl.TRIANGLES,depth:{enable:!1}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){var t,e,n;null===(t=this.texture1)||void 0===t||t.destroy(),null===(e=this.texture2)||void 0===e||e.destroy(),null===(n=this.texture3)||void 0===n||n.destroy()}},{key:"registerBuiltinAttributes",value:function(){var t=this.layer.getSource().extent,e=(0,A.Z)(t,4),n=e[0],r=e[1],o=e[2],a=e[3],s=o-n,u=a-r;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:i.AttributeType.Attribute,descriptor:{name:"a_uv",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,i,o){var a=t.version===M.G["GAODE2.x"]?t.originCoordinates[0][o]:i,l=(0,A.Z)(a,2),c=l[0],h=l[1];return[(c-n)/s,(h-r)/u]}}})}},{key:"loadTexture",value:function(){var t,e,n,r=this,o=this.rendererService.createTexture2D,a={height:0,width:0};function s(t){return o({data:t,width:t.width,height:t.height,wrapS:i.gl.MIRRORED_REPEAT,wrapT:i.gl.MIRRORED_REPEAT,min:i.gl.LINEAR,mag:i.gl.LINEAR})}this.texture1=o(a),this.texture2=o(a),this.texture3=o(a),t=function(t){r.texture1=s(t[0]),r.texture2=s(t[1]),r.texture3=s(t[2]),r.layerService.reRender()},e=0,n=[],["https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*MJ22QbpuCzIAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-z2HSIVDsHIAAAAAAAAAAAAAARQnAQ"].map((function(r){var i=new Image;i.crossOrigin="",i.src=r,n.push(i),i.onload=function(){3==++e&&t(n)}}))}}]),f}(H);const un={fill:an,line:Se,extrude:on,text:tn,point_fill:Ie,point_image:De,point_normal:Fe,point_extrude:ke,water:function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.speed,i=void 0===r?.5:r;return{u_texture:this.texture,u_speed:i,u_opacity:(0,S.isNumber)(n)?n:1}}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loadTexture(),t.abrupt("return",this.buildModels());case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:'attribute vec4 a_Color;\nattribute vec2 a_uv;\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_Color;\nvarying vec2 v_uv;\nuniform float u_opacity: 1.0;\n\n\n#pragma include "projection"\n\nvoid main() {\n v_uv = a_uv;\n\n v_Color = a_Color;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n}\n\n',fragmentShader:"uniform sampler2D u_texture;\nuniform float u_time: 0.0;\nuniform float u_speed: 1.0;\nuniform float u_opacity: 1.0;\n\nvarying vec4 v_Color;\nvarying vec2 v_uv;\n\nfloat rand(vec2 n) { return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); }\n\nfloat water(vec3 p) {\n float t = u_time * u_speed;\n p.z += t * 2.; p.x += t * 2.;\n vec3 c1 = texture2D(u_texture, p.xz / 30.).xyz;\n p.z += t * 3.; p.x += t * 0.52;\n vec3 c2 = texture2D(u_texture, p.xz / 30.).xyz;\n p.z += t * 4.; p.x += t * 0.8;\n vec3 c3 = texture2D(u_texture, p.xz / 30.).xyz;\n c1 += c2 - c3;\n float z = (c1.x + c1.y + c1.z) / 3.;\n return p.y + z / 4.;\n}\n\nfloat map(vec3 p) {\n float d = 100.0;\n d = water(p);\n return d;\n}\n\nfloat intersect(vec3 ro, vec3 rd) {\n float d = 0.0;\n for (int i = 0; i <= 100; i++) {\n float h = map(ro + rd * d);\n if (h < 0.1) return d;\n d += h;\n }\n return 0.0;\n}\n\nvec3 norm(vec3 p) {\n float eps = .1;\n return normalize(vec3(\n map(p + vec3(eps, 0, 0)) - map(p + vec3(-eps, 0, 0)),\n map(p + vec3(0, eps, 0)) - map(p + vec3(0, -eps, 0)),\n map(p + vec3(0, 0, eps)) - map(p + vec3(0, 0, -eps))\n ));\n} \n\nfloat calSpc() {\n vec3 l1 = normalize(vec3(1, 1, 1));\n vec3 ro = vec3(-3, 20, -8);\n vec3 rc = vec3(0, 0, 0);\n vec3 ww = normalize(rc - ro);\n vec3 uu = normalize(cross(vec3(0,1,0), ww));\n vec3 vv = normalize(cross(rc - ro, uu));\n vec3 rd = normalize(uu * v_uv.x + vv * v_uv.y + ww);\n float d = intersect(ro, rd);\n vec3 p = ro + rd * d;\n vec3 n = norm(p);\n float spc = pow(max(0.0, dot(reflect(l1, n), rd)), 30.0);\n return spc;\n}\n\nvoid main() {\n float opacity = u_opacity;\n gl_FragColor = v_Color;\n gl_FragColor.a *= opacity;\n\n float spc = calSpc();\n gl_FragColor += spc * 0.4;\n}\n",triangulation:Bt,primitive:i.gl.TRIANGLES,depth:{enable:!1}});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy()}},{key:"registerBuiltinAttributes",value:function(){var t=this.layer.getSource().extent,e=(0,A.Z)(t,4),n=e[0],r=e[1],o=e[2],a=e[3],s=o-n,u=a-r;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:i.AttributeType.Attribute,descriptor:{name:"a_uv",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,i,o){var a=t.version===M.G["GAODE2.x"]?t.originCoordinates[0][o]:i,l=(0,A.Z)(a,2),c=l[0],h=l[1];return[(c-n)/s,(h-r)/u]}}})}},{key:"loadTexture",value:function(){var t=this,e=this.layer.getLayerConfig().waterTexture,n=this.rendererService.createTexture2D;this.texture=n({height:0,width:0});var r=new Image;r.crossOrigin="",e?(console.warn("L7 recommend:https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ"),r.src=e):r.src="https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ",r.onload=function(){t.texture=n({data:r,width:r.width,height:r.height,wrapS:i.gl.MIRRORED_REPEAT,wrapT:i.gl.MIRRORED_REPEAT,min:i.gl.LINEAR,mag:i.gl.LINEAR}),t.layerService.reRender()}}}]),f}(H),ocean:sn};var ln=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","PolygonLayer"),(0,p.Z)((0,u.Z)(t),"enableEncodeStyles",["opacity"]),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new un[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getModelType",value:function(){var t,e=this.styleAttributeService.getLayerStyleAttribute("shape"),n=null==e||null===(t=e.scale)||void 0===t?void 0:t.field;return"fill"!==n&&n?"extrude"===n?"extrude":"water"===n?"water":"ocean"===n?"ocean":"line"===n?"line":this.getPointModelType():"fill"}},{key:"getPointModelType",value:function(){var t=this.getEncodedData(),e=this.getLayerConfig(),n=e.shape2d,r=e.shape3d,i=this.iconService.getIconMap(),o=t.find((function(t){return t.hasOwnProperty("shape")}));if(o){var a=o.shape;return"dot"===a?"point_normal":-1!==(null==n?void 0:n.indexOf(a))?"point_fill":-1!==(null==r?void 0:r.indexOf(a))?"point_extrude":i.hasOwnProperty(a)?"point_image":"text"}return"fill"}}]),f}(V);var cn=function(t){(0,l.Z)(m,t);var e,n,r,u,p,f=(u=m,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(u);if(p){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function m(){return(0,a.Z)(this,m),f.apply(this,arguments)}return(0,s.Z)(m,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.clampLow,i=void 0===r||r,o=t.clampHigh,a=void 0===o||o,s=t.noDataValue,u=void 0===s?-9999999:s,l=t.domain,c=t.rampColors,h=l||(0,x.getDefaultDomain)(c);return this.colorTexture=this.layer.textureService.getColorTexture(c,h),{u_opacity:n||1,u_texture:this.texture,u_domain:h,u_clampLow:i,u_clampHigh:void 0!==a?a:i,u_noDataValue:u,u_colorTexture:this.colorTexture}}},{key:"getRasterData",value:(r=(0,o.Z)(d().mark((function t(e){var n,r,i,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Array.isArray(e.data)){t.next=4;break}return t.abrupt("return",{data:e.data,width:e.width,height:e.height});case 4:return t.next=6,e.data;case 6:return n=t.sent,r=n.rasterData,i=n.width,o=n.height,t.abrupt("return",{data:Array.from(r),width:i,height:o});case 11:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u,l;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getSource(),n=this.rendererService.createTexture2D,r=e.data.dataArray[0],t.next=5,this.getRasterData(r);case 5:return o=t.sent,a=o.data,s=o.width,u=o.height,this.texture=n({data:a,width:s,height:u,format:i.gl.LUMINANCE,type:i.gl.FLOAT}),t.next=12,this.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include "projection"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n',fragmentShader:"precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_min;\nuniform float u_max;\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nvarying vec2 v_texCoord;\nbool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }\n\n\nvoid main() {\n\n float value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r;\n if (value == u_noDataValue || isnan_emu(value))\n discard;\n else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1]))\n discard;\n else {\n float normalisedValue =(value - u_domain[0]) / (u_domain[1] -u_domain[0]);\n vec4 color = texture2D(u_colorTexture,vec2(normalisedValue, 0));\n \n gl_FragColor = color;\n gl_FragColor.a = gl_FragColor.a * u_opacity ;\n if(gl_FragColor.a < 0.01)\n discard;\n \n }\n}\n",triangulation:Gt,primitive:i.gl.TRIANGLES,depth:{enable:!1}});case 12:return l=t.sent,t.abrupt("return",[l]);case 14:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){var t,e;null===(t=this.texture)||void 0===t||t.destroy(),null===(e=this.colorTexture)||void 0===e||e.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),m}(H),hn=["data"],pn=["rasterData"];var fn=function(t){(0,l.Z)(_,t);var e,n,r,f,y,v=(f=_,y=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(f);if(y){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function _(){var t;(0,a.Z)(this,_);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=v.call.apply(v,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"dataOption",{}),t}return(0,s.Z)(_,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.noDataValue,i=void 0===r?0:r,o=this.dataOption,a=o.rMinMax,s=o.gMinMax,u=o.bMinMax;return{u_opacity:n||1,u_texture:this.texture,u_noDataValue:i,u_rminmax:a,u_gminmax:s,u_bminmax:u}}},{key:"getRasterData",value:(r=(0,o.Z)(d().mark((function t(e){var n,r,i,o,a;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Array.isArray(e.data)){t.next=4;break}return n=e.data,r=(0,m.Z)(e,hn),this.dataOption=r,t.abrupt("return",(0,g.Z)({data:n},r));case 4:return t.next=6,e.data;case 6:if(i=t.sent,o=i.rasterData,a=(0,m.Z)(i,pn),this.dataOption=a,!Array.isArray(o)){t.next=14;break}return t.abrupt("return",(0,g.Z)({data:o},a));case 14:return t.abrupt("return",(0,g.Z)({data:Array.from(o)},a));case 15:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u,l;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getSource(),n=this.rendererService.createTexture2D,r=e.data.dataArray[0],t.next=5,this.getRasterData(r);case 5:return o=t.sent,a=o.data,s=o.width,u=o.height,this.texture=n({data:a,width:s,height:u,format:i.gl.RGB,type:i.gl.FLOAT}),t.next=12,this.layer.buildLayerModel({moduleName:"rasterImageDataRGBA",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include "projection"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n',fragmentShader:"precision mediump float;\nuniform vec2 u_rminmax: vec2(0,255); \nuniform vec2 u_gminmax: vec2(0,255);\nuniform vec2 u_bminmax: vec2(0,255);\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform float u_noDataValue : 0.0;\nvarying vec2 v_texCoord;\n\nvoid main() {\n vec3 rgb = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).rgb;\n if(rgb == vec3(u_noDataValue)) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else {\n gl_FragColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity);\n }\n if(gl_FragColor.a < 0.01)\n discard;\n \n}",triangulation:Gt,primitive:i.gl.TRIANGLES,depth:{enable:!1}});case 12:return l=t.sent,t.abrupt("return",[l]);case 14:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),_}(H);const dn={raster:cn,rasterRgb:fn,raster3d:cn,rasterTerrainRgb:function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=t.clampLow,r=void 0===n||n,i=t.clampHigh,o=void 0===i||i,a=t.noDataValue,s=void 0===a?-9999999:a,u=t.domain,l=t.rampColors,c=t.colorTexture,h=t.rScaler,p=void 0===h?6553.6:h,f=t.gScaler,d=void 0===f?25.6:f,m=t.bScaler,g=void 0===m?.1:m,y=t.offset,v=void 0===y?1e4:y,_=u||(0,x.getDefaultDomain)(l),b=c;return c?this.layer.textureService.setColorTexture(c,l,_):b=this.layer.textureService.getColorTexture(l,_),{u_opacity:e||1,u_texture:this.texture,u_domain:_,u_clampLow:r,u_clampHigh:void 0!==o?o:r,u_noDataValue:s,u_unpack:[p,d,g,v],u_colorTexture:b}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getSource(),n=this.rendererService.createTexture2D,t.next=4,e.data.images;case 4:return r=t.sent,this.texture=n({data:r[0],width:r[0].width,height:r[0].height,min:i.gl.LINEAR,mag:i.gl.LINEAR}),t.next=8,this.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include "projection"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n',fragmentShader:"precision mediump float;\nuniform float u_opacity: 1.0;\n\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\n\nvarying vec2 v_texCoord;\n\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nuniform vec4 u_unpack;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_texture, coord,bias) * 255.0;\n data.a = -1.0;\n return dot(data, u_unpack);\n}\n\nvec4 getColor(float value) {\n float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]);\n vec2 coord = vec2(normalisedValue, 0);\n return texture2D(u_colorTexture, coord);\n}\n\nvoid main() {\n float value = getElevation(v_texCoord,0.0);\n if (value == u_noDataValue) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1])) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else {\n \n gl_FragColor = getColor(value);\n gl_FragColor.a = gl_FragColor.a * u_opacity ;\n if(gl_FragColor.a < 0.01)\n discard;\n }\n}\n",triangulation:Gt,primitive:i.gl.TRIANGLES,depth:{enable:!1}});case 8:return o=t.sent,t.abrupt("return",[o]);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){var t;null===(t=this.texture)||void 0===t||t.destroy()}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),f}(H)};var mn=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","RasterLayer"),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new dn[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getDefaultConfig",value:function(){return{raster:{},rasterRgb:{},raster3d:{},rasterTerrainRgb:{}}[this.getModelType()]}},{key:"getModelType",value:function(){switch(this.layerSource.getParserType()){case"raster":default:return"raster";case"rasterRgb":return"rasterRgb";case"image":return"rasterTerrainRgb"}}}]),f}(V);var gn=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","TileDebugLayer"),(0,p.Z)((0,u.Z)(t),"zIndex",1e4),(0,p.Z)((0,u.Z)(t),"defaultSourceConfig",{data:[],options:{parser:{type:"testTile"}}}),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return");case 1:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})}]),f}(V);var yn=function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig().opacity,e=void 0===t?1:t;return{u_opacity:(0,S.isNumber)(e)?e:1}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){return""}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layer.zIndex=-997,t.next=3,this.layer.buildLayerModel({moduleName:"earthAtmoSphere",vertexShader:"\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nvarying float v_CamreaDistance;\n\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\nvarying float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n",fragmentShader:"\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // 去除背面\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n",triangulation:Yt,depth:{enable:!1},blend:this.getBlend()});case 3:return e=t.sent,t.abrupt("return",[e]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),f}(H);var vn={base:function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"earthTime",3.4),(0,p.Z)((0,u.Z)(t),"sunX",1e3),(0,p.Z)((0,u.Z)(t),"sunY",1e3),(0,p.Z)((0,u.Z)(t),"sunZ",1e3),(0,p.Z)((0,u.Z)(t),"sunRadius",Math.sqrt(t.sunX*t.sunX+t.sunY*t.sunY+t.sunZ*t.sunZ)),t}return(0,s.Z)(g,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.animateOption,n=t.globalOptions;return null!=e&&e.enable&&(this.mapService.rotateY({reg:.002}),this.earthTime+=.02,this.sunY=10,this.sunX=Math.cos(this.earthTime)*(this.sunRadius-this.sunY),this.sunZ=Math.sin(this.earthTime)*(this.sunRadius-this.sunY)),{u_ambientRatio:(null==n?void 0:n.ambientRatio)||.6,u_diffuseRatio:(null==n?void 0:n.diffuseRatio)||.4,u_specularRatio:(null==n?void 0:n.specularRatio)||.1,u_sunLight:[this.sunX,this.sunY,this.sunZ],u_texture:this.texture}}},{key:"setEarthTime",value:function(t){this.earthTime=t,this.sunY=10,this.sunX=Math.cos(this.earthTime)*(this.sunRadius-this.sunY),this.sunZ=Math.sin(this.earthTime)*(this.sunRadius-this.sunY),this.layerService.throttleRenderLayers()}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,i,o=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.layer.getLayerConfig(),void 0!==(null==(n=e.globalOptions)?void 0:n.earthTime)&&this.setEarthTime(n.earthTime),r=this.layer.getSource(),i=this.rendererService.createTexture2D,this.texture=i({height:0,width:0}),r.data.images.then((function(t){o.texture=i({data:t[0],width:t[0].width,height:t[0].height}),o.layerService.reRender()})),t.abrupt("return",this.buildModels());case 7:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){return""}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layer.zIndex=-998,t.next=3,this.layer.buildLayerModel({moduleName:"earthBase",vertexShader:"// attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\n// attribute vec2 a_Extrude;\n// attribute float a_Size;\n// attribute float a_Shape;\n\nuniform vec3 u_CameraPosition;\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform float u_ambientRatio : 0.5;\nuniform float u_diffuseRatio : 0.3;\nuniform float u_specularRatio : 0.2;\nuniform vec3 u_sunLight: [1.0, -10.5, 12.0];\n\n\n\nfloat calc_lighting(vec4 pos) {\n\n vec3 worldPos = vec3(pos * u_ModelMatrix);\n\n vec3 worldNormal = a_Normal;\n\n // cal light weight\n vec3 viewDir = normalize(u_CameraPosition - worldPos);\n\n vec3 lightDir = normalize(u_sunLight);\n\n vec3 halfDir = normalize(viewDir+lightDir);\n // lambert\n float lambert = dot(worldNormal, lightDir);\n // specular\n float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\n //sum to light weight\n float lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular;\n\n return lightWeight;\n}\n\nvarying float v_lightWeight;\nvoid main() {\n\n v_texCoord = a_Uv;\n\n float lightWeight = calc_lighting(vec4(a_Position, 1.0));\n v_lightWeight = lightWeight;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n",fragmentShader:"\nuniform sampler2D u_texture;\n\nvarying vec2 v_texCoord;\nvarying float v_lightWeight;\n\n\nvoid main() {\n\n vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\n color.xyz = color.xyz * v_lightWeight;\n gl_FragColor = color;\n}\n",triangulation:Yt,depth:{enable:!0},blend:this.getBlend()});case 3:return e=t.sent,t.abrupt("return",[e]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),g}(H),atomSphere:yn,bloomSphere:function(t){(0,l.Z)(f,t);var e,n,r,u,p=(r=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(u){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){return(0,a.Z)(this,f),p.apply(this,arguments)}return(0,s.Z)(f,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig().opacity,e=void 0===t?1:t;return{u_opacity:(0,S.isNumber)(e)?e:1}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"clearModels",value:function(){return""}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.layer.zIndex=-999,t.next=3,this.layer.buildLayerModel({moduleName:"earthBloom",vertexShader:"\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\n\nvoid main() {\n v_Color = a_Color;\n\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n",fragmentShader:"\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n // 去除背面\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n",triangulation:Xt,depth:{enable:!1},blend:this.getBlend()});case 3:return e=t.sent,t.abrupt("return",[e]);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:i.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0]]:[n]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:i.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:i.gl.STATIC_DRAW,data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n,r,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}}]),f}(H)},_n=["base","atomSphere","bloomSphere"],bn=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","EarthLayer"),(0,p.Z)((0,u.Z)(t),"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new vn[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"setEarthTime",value:function(t){this.layerModel&&this.layerModel.setEarthTime?this.layerModel.setEarthTime(t):console.warn("请在 scene loaded 之后执行该方法!")}},{key:"getModelType",value:function(){var t,e=this.styleAttributeService.getLayerStyleAttribute("shape"),n=(null==e||null===(t=e.scale)||void 0===t?void 0:t.field)||"base";return _n.indexOf(n)<0&&(n="base"),n}}]),f}(V);const xn={fill:function(t){(0,l.Z)(p,t);var e,n,r,i,u=(r=p,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(i){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function p(){return(0,a.Z)(this,p),u.apply(this,arguments)}return(0,s.Z)(p,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,n=void 0===e?1:e,r=t.color,i=void 0===r?"#000":r;return{u_opacity:(0,S.isNumber)(n)?n:0,u_color:(0,x.rgb2arr)(i)}}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.buildModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layer.buildLayerModel({moduleName:"mask",vertexShader:'attribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#pragma include "projection"\n\nvoid main() {\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n}\n\n',fragmentShader:"uniform float u_opacity : 1.0;\nuniform vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n gl_FragColor.a *= u_opacity;\n}\n",triangulation:Bt,depth:{enable:!1},pick:!1});case 2:return e=t.sent,t.abrupt("return",[e]);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.layerService.clear()}},{key:"registerBuiltinAttributes",value:function(){return""}}]),p}(H)};var wn=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","MaskLayer"),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new xn[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getModelType",value:function(){return"fill"}}]),f}(V);function Sn(t,e,n){var r=En(t,t.VERTEX_SHADER,e),i=En(t,t.FRAGMENT_SHADER,n);if(!r||!i)return null;var o=t.createProgram();if(!o)return null;if(t.attachShader(o,r),t.attachShader(o,i),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var a=t.getProgramInfoLog(o);return console.warn("Failed to link program: "+a),t.deleteProgram(o),t.deleteShader(i),t.deleteShader(r),null}for(var s=t.getProgramParameter(o,t.ACTIVE_ATTRIBUTES),u=0;u<s;u++){var l=t.getActiveAttrib(o,u);o[l.name]=t.getAttribLocation(o,l.name)}for(var c=t.getProgramParameter(o,t.ACTIVE_UNIFORMS),h=0;h<c;h++){var p=t.getActiveUniform(o,h);o[p.name]=t.getUniformLocation(o,p.name)}return o.vertexShader=r,o.fragmentShader=i,o}function En(t,e,n){var r=t.createShader(e);if(null==r)return console.warn("unable to create shader"),null;if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(r);return console.warn("Failed to compile shader: "+i),t.deleteShader(r),null}return r}function Mn(t,e,n,r,i){var o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,r,i,0,t.RGBA,t.UNSIGNED_BYTE,n),t.bindTexture(t.TEXTURE_2D,null),o}function Tn(t,e,n){t.activeTexture(t.TEXTURE0+n),t.bindTexture(t.TEXTURE_2D,e)}function An(t,e){var n=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),n}function Cn(t){var e=document.createElement("canvas"),n=e.getContext("2d");e.width=256,e.height=1;for(var r=n.createLinearGradient(0,0,256,0),i=0,o=Object.keys(t);i<o.length;i++){var a=o[i];r.addColorStop(+a,t[+a])}return n.fillStyle=r,n.fillRect(0,0,256,1),e=null,new Uint8Array(n.getImageData(0,0,256,1).data)}function On(t,e,n,r){t.bindBuffer(t.ARRAY_BUFFER,e),t.enableVertexAttribArray(n),t.vertexAttribPointer(n,r,t.FLOAT,!1,0,0)}function Pn(t,e,n){t.bindFramebuffer(t.FRAMEBUFFER,e),n&&t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}var kn=function(){function t(e){(0,a.Z)(this,t),(0,p.Z)(this,"width",512),(0,p.Z)(this,"height",512),(0,p.Z)(this,"numParticles",65536),this.gl=e.glContext,this.width=e.imageWidth,this.height=e.imageHeight,this.fadeOpacity=e.fadeOpacity,this.speedFactor=e.speedFactor,this.dropRate=e.dropRate,this.dropRateBump=e.dropRateBump,this.rampColors=e.rampColors,this.init()}return(0,s.Z)(t,[{key:"init",value:function(){var t=this.gl;this.fadeOpacity=.996,this.speedFactor=.25,this.dropRate=.003,this.dropRateBump=.01,this.drawProgram=Sn(t,"\n precision mediump float;\n\n attribute float a_index;\n\n uniform sampler2D u_particles;\n uniform float u_particles_res;\n\n varying vec2 v_particle_pos;\n\n void main() {\n vec4 color = texture2D(u_particles, vec2(\n fract(a_index / u_particles_res),\n floor(a_index / u_particles_res) / u_particles_res)\n );\n\n // decode current particle position from the pixel's RGBA value\n v_particle_pos = vec2( color.r / 255.0 + color.b, color.g / 255.0 + color.a);\n\n gl_PointSize = 1.0;\n gl_Position = vec4(2.0 * v_particle_pos.x - 1.0, 1.0 - 2.0 * v_particle_pos.y, 0, 1);\n }","\n precision mediump float;\n\n uniform sampler2D u_wind;\n uniform vec2 u_wind_min;\n uniform vec2 u_wind_max;\n uniform sampler2D u_color_ramp;\n\n varying vec2 v_particle_pos;\n\n void main() {\n vec2 velocity = mix(u_wind_min, u_wind_max, texture2D(u_wind, v_particle_pos).rg);\n float speed_t = length(velocity) / length(u_wind_max);\n\n // color ramp is encoded in a 16x16 texture\n vec2 ramp_pos = vec2( fract(16.0 * speed_t), floor(16.0 * speed_t) / 16.0);\n\n gl_FragColor = texture2D(u_color_ramp, ramp_pos);\n }"),this.fullScreenProgram=Sn(t,"\n precision mediump float;\n\n attribute vec2 a_pos;\n\n varying vec2 v_tex_pos;\n\n void main() {\n v_tex_pos = a_pos;\n gl_Position = vec4(1.0 - 2.0 * a_pos, 0.0, 1.0);\n gl_PointSize = 100.0;\n }","\n precision mediump float;\n\n uniform sampler2D u_screen;\n uniform float u_opacity;\n varying vec2 v_tex_pos;\n\n void main() {\n vec4 color = texture2D(u_screen, 1.0 - v_tex_pos);\n\n // a hack to guarantee opacity fade out even with a value close to 1.0\n gl_FragColor = vec4(floor(255.0 * color * u_opacity) / 255.0);\n }"),this.updateProgram=Sn(t,"\n precision mediump float;\n\n attribute vec2 a_pos;\n\n varying vec2 v_tex_pos;\n\n void main() {\n v_tex_pos = a_pos;\n gl_Position = vec4(1.0 - 2.0 * a_pos, 0, 1);\n // framebuffer 始终用铺满屏幕的 texture\n }","\n precision highp float;\n\n uniform sampler2D u_particles;\n uniform sampler2D u_wind;\n uniform vec2 u_wind_res;\n uniform vec2 u_wind_min;\n uniform vec2 u_wind_max;\n uniform float u_rand_seed;\n uniform float u_speed_factor;\n uniform float u_drop_rate;\n uniform float u_drop_rate_bump;\n\n varying vec2 v_tex_pos;\n\n // pseudo-random generator\n const vec3 rand_constants = vec3(12.9898, 78.233, 4375.85453);\n float rand(const vec2 co) {\n float t = dot(rand_constants.xy, co);\n return fract(sin(t) * (rand_constants.z + t));\n }\n\n // wind speed lookup; use manual bilinear filtering based on 4 adjacent pixels for smooth interpolation\n vec2 lookup_wind(const vec2 uv) {\n // return texture2D(u_wind, uv).rg; // lower-res hardware filtering\n vec2 px = 1.0 / u_wind_res;\n vec2 vc = (floor(uv * u_wind_res)) * px;\n vec2 f = fract(uv * u_wind_res);\n vec2 tl = texture2D(u_wind, vc).rg;\n vec2 tr = texture2D(u_wind, vc + vec2(px.x, 0)).rg;\n vec2 bl = texture2D(u_wind, vc + vec2(0, px.y)).rg;\n vec2 br = texture2D(u_wind, vc + px).rg;\n return mix(mix(tl, tr, f.x), mix(bl, br, f.x), f.y);\n }\n\n void main() {\n vec4 color = texture2D(u_particles, v_tex_pos);\n vec2 pos = vec2(\n color.r / 255.0 + color.b,\n color.g / 255.0 + color.a); // decode particle position from pixel RGBA\n vec2 velocity = mix(u_wind_min, u_wind_max, lookup_wind(pos));\n float speed_t = length(velocity) / length(u_wind_max);\n\n // take EPSG:4236 distortion into account for calculating where the particle moved\n float distortion = cos(radians(pos.y * 180.0 - 90.0));\n vec2 offset = vec2(velocity.x / distortion, -velocity.y) * 0.0001 * u_speed_factor;\n\n // update particle position, wrapping around the date line\n pos = fract(1.0 + pos + offset);\n\n // a random seed to use for the particle drop\n vec2 seed = (pos + v_tex_pos) * u_rand_seed;\n\n // drop rate is a chance a particle will restart at random position, to avoid degeneration\n float drop_rate = u_drop_rate + speed_t * u_drop_rate_bump;\n float drop = step(1.0 - drop_rate, rand(seed));\n\n vec2 random_pos = vec2(\n rand(seed + 1.3),\n rand(seed + 2.1));\n pos = mix(pos, random_pos, drop);\n\n // encode the new particle position back into RGBA\n gl_FragColor = vec4(\n fract(pos * 255.0),\n floor(pos * 255.0) / 255.0);\n }"),this.quadBuffer=An(t,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),this.framebuffer=t.createFramebuffer(),this.colorRampTexture=Mn(this.gl,this.gl.LINEAR,Cn(this.rampColors),16,16);var e=new Uint8Array(this.width*this.height*4);this.backgroundTexture=Mn(t,t.NEAREST,e,this.width,this.height),this.screenTexture=Mn(t,t.NEAREST,e,this.width,this.height);var n=this.particleStateResolution=Math.ceil(Math.sqrt(this.numParticles));this.numParticlesSize=n*n;for(var r=new Uint8Array(4*this.numParticlesSize),i=0;i<r.length;i++)r[i]=Math.floor(256*Math.random());this.particleStateTexture0=Mn(t,t.NEAREST,r,n,n),this.particleStateTexture1=Mn(t,t.NEAREST,r,n,n);for(var o=new Float32Array(this.numParticlesSize),a=0;a<this.numParticlesSize;a++)o[a]=a;this.particleIndexBuffer=An(t,o)}},{key:"setWind",value:function(t){var e,n,r,i;this.windData=t,this.windTexture=(e=this.gl,n=this.gl.LINEAR,r=t.image,i=e.createTexture(),e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r),e.bindTexture(e.TEXTURE_2D,null),i)}},{key:"updateParticelNum",value:function(t){var e=this.gl;if(t!==this.numParticles){this.numParticles=t;var n=this.particleStateResolution=Math.ceil(Math.sqrt(this.numParticles));this.numParticlesSize=n*n;for(var r=new Uint8Array(4*this.numParticlesSize),i=0;i<r.length;i++)r[i]=Math.floor(256*Math.random());this.particleStateTexture0=Mn(e,e.NEAREST,r,n,n),this.particleStateTexture1=Mn(e,e.NEAREST,r,n,n);for(var o=new Float32Array(this.numParticlesSize),a=0;a<this.numParticlesSize;a++)o[a]=a;this.particleIndexBuffer=An(e,o)}}},{key:"updateWindDir",value:function(t,e,n,r){this.windData.uMin=t,this.windData.uMax=e,this.windData.vMin=n,this.windData.vMax=r}},{key:"updateColorRampTexture",value:function(t){if(this.isColorChanged(t)){this.rampColors=t;var e=this.gl;e.deleteTexture(this.colorRampTexture),this.colorRampTexture=Mn(e,e.LINEAR,Cn(t),16,16)}}},{key:"isColorChanged",value:function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var r=n[e],i=Number(r);if(!this.rampColors[i])return!0;if(this.rampColors[i]&&this.rampColors[i]!==t[i])return!0}return!1}},{key:"reSize",value:function(t,e){if(t!==this.width||e!==this.height){var n=this.gl;n.deleteTexture(this.backgroundTexture),n.deleteTexture(this.screenTexture),this.width=t,this.height=e;var r=new Uint8Array(t*e*4);this.backgroundTexture=Mn(n,n.NEAREST,r,t,e),this.screenTexture=Mn(n,n.NEAREST,r,t,e)}}},{key:"draw",value:function(){var t;if(null!==(t=this.windData)&&void 0!==t&&t.image){var e=this.gl;return Tn(e,this.windTexture,0),Tn(e,this.particleStateTexture0,1),this.drawScreen(),this.updateParticles(),{d:this.pixels,w:this.width,h:this.height}}return{d:new Uint8Array([0,0,0,0]),w:1,h:1}}},{key:"drawScreen",value:function(){var t=this.gl;Pn(t,this.framebuffer,this.screenTexture),t.viewport(0,0,this.width,this.height),t.disable(t.BLEND),this.drawFullTexture(this.backgroundTexture,this.fadeOpacity),this.drawParticles(),this.pixels=new Uint8Array(4*this.width*this.height),t.readPixels(0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.pixels),Pn(t,null,null),t.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height);var e=this.backgroundTexture;this.backgroundTexture=this.screenTexture,this.screenTexture=e}},{key:"drawFullTexture",value:function(t,e){var n=this.gl,r=this.fullScreenProgram;n.useProgram(r),n.bindBuffer(n.ARRAY_BUFFER,this.quadBuffer),n.vertexAttribPointer(r.a_pos,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.a_pos),n.bindBuffer(n.ARRAY_BUFFER,null),Tn(n,t,2),n.uniform1i(r.u_screen,2),n.uniform1f(r.u_opacity,e),n.drawArrays(n.TRIANGLES,0,6)}},{key:"drawParticles",value:function(){var t=this.gl,e=this.drawProgram;t.useProgram(e),On(t,this.particleIndexBuffer,e.a_index,1),Tn(t,this.colorRampTexture,2),t.uniform1i(e.u_wind,0),t.uniform1i(e.u_particles,1),t.uniform1i(e.u_color_ramp,2),t.uniform1f(e.u_particles_res,this.particleStateResolution),t.uniform2f(e.u_wind_min,this.windData.uMin,this.windData.vMin),t.uniform2f(e.u_wind_max,this.windData.uMax,this.windData.vMax),t.drawArrays(t.POINTS,0,this.numParticlesSize)}},{key:"updateParticles",value:function(){var t=this.gl;Pn(t,this.framebuffer,this.particleStateTexture1),t.viewport(0,0,this.particleStateResolution,this.particleStateResolution);var e=this.updateProgram;t.useProgram(e),On(t,this.quadBuffer,e.a_pos,2),t.uniform1i(e.u_wind,0),t.uniform1i(e.u_particles,1),t.uniform1f(e.u_rand_seed,Math.random()),t.uniform2f(e.u_wind_res,2*this.windData.image.width,2*this.windData.image.height),t.uniform2f(e.u_wind_min,this.windData.uMin,this.windData.vMin),t.uniform2f(e.u_wind_max,this.windData.uMax,this.windData.vMax),t.uniform1f(e.u_speed_factor,this.speedFactor),t.uniform1f(e.u_drop_rate,this.dropRate),t.uniform1f(e.u_drop_rate_bump,this.dropRateBump),t.drawArrays(t.TRIANGLES,0,6);var n=this.particleStateTexture0;this.particleStateTexture0=this.particleStateTexture1,this.particleStateTexture1=n,Pn(t,null,null)}},{key:"destroy",value:function(){this.gl.deleteBuffer(this.quadBuffer),this.gl.deleteBuffer(this.particleIndexBuffer),this.gl.deleteFramebuffer(this.framebuffer),this.gl.deleteShader(this.drawProgram.vertexShader),this.gl.deleteShader(this.drawProgram.fragmentShader),this.gl.deleteProgram(this.drawProgram),this.gl.deleteShader(this.fullScreenProgram.vertexShader),this.gl.deleteShader(this.fullScreenProgram.fragmentShader),this.gl.deleteProgram(this.fullScreenProgram),this.gl.deleteShader(this.updateProgram.vertexShader),this.gl.deleteShader(this.updateProgram.fragmentShader),this.gl.deleteProgram(this.updateProgram),this.gl.deleteTexture(this.colorRampTexture),this.gl.deleteTexture(this.backgroundTexture),this.gl.deleteTexture(this.screenTexture),this.gl.deleteTexture(this.particleStateTexture0),this.gl.deleteTexture(this.particleStateTexture1),this.gl.deleteTexture(this.windTexture)}}]),t}();var Ln={0:"#3288bd",.1:"#66c2a5",.2:"#abdda4",.3:"#e6f598",.4:"#fee08b",.5:"#fdae61",.6:"#f46d43",1:"#d53e4f"};const In={wind:function(t){(0,l.Z)(g,t);var e,n,r,f,m=(r=g,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(r);if(f){var n=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function g(){var t;(0,a.Z)(this,g);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=m.call.apply(m,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"sizeScale",.5),(0,p.Z)((0,u.Z)(t),"frequency",new x.FrequencyController(7.2)),t}return(0,s.Z)(g,[{key:"render",value:function(t){var e=this;this.drawColorMode(t),this.frequency.run((function(){e.drawWind()}))}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:(n=(0,o.Z)(d().mark((function t(){var e,n,r,o,a,s,u,l,c,h,p,f,m,g,y,v,_,b,x,w,S,E,M,T,A,C,O,P,k=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=this.layer.getLayerConfig(),a=o.uMin,s=void 0===a?-21.32:a,u=o.uMax,l=void 0===u?26.8:u,c=o.vMin,h=void 0===c?-21.57:c,p=o.vMax,f=void 0===p?21.42:p,m=o.fadeOpacity,g=void 0===m?.996:m,y=o.speedFactor,v=void 0===y?.25:y,_=o.dropRate,b=void 0===_?.003:_,x=o.dropRateBump,w=void 0===x?.01:x,S=o.rampColors,E=void 0===S?Ln:S,M=o.sizeScale,T=void 0===M?.5:M,A=this.rendererService.createTexture2D,C=this.layer.getSource(),this.texture=A({height:0,width:0}),this.cacheZoom=Math.floor(this.mapService.getZoom()),O=this.rendererService.getGLContext(),this.imageCoords=null===(e=C.data)||void 0===e?void 0:e.dataArray[0].coordinates,null===(n=C.data)||void 0===n||null===(r=n.images)||void 0===r||r.then((function(t){var e;k.sizeScale=T*k.getZoomScale();var n=k.getWindSize(),r=n.imageWidth,i=n.imageHeight,o={glContext:O,imageWidth:r,imageHeight:i,fadeOpacity:g,speedFactor:v,dropRate:b,dropRateBump:w,rampColors:E};k.wind=new kn(o),k.wind.setWind({uMin:s,uMax:l,vMin:h,vMax:f,image:t[0]}),null===(e=k.texture)||void 0===e||e.destroy(),k.texture=A({width:r,height:i}),k.layerService.reRender()})),t.next=10,this.layer.buildLayerModel({moduleName:"wind",vertexShader:'precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include "projection"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n',fragmentShader:"precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nvoid main() {\n vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\n gl_FragColor = color;\n gl_FragColor.a *= u_opacity;\n}\n",triangulation:Gt,primitive:i.gl.TRIANGLES,depth:{enable:!1}});case 10:return P=t.sent,this.colorModel=P,t.abrupt("return",[P]);case 13:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getWindSize",value:function(){var t=this.mapService.lngLatToPixel(this.imageCoords[0]),e=this.mapService.lngLatToPixel(this.imageCoords[1]);return{imageWidth:Math.min(Math.floor((e.x-t.x)*this.sizeScale),2048),imageHeight:Math.min(Math.floor((t.y-e.y)*this.sizeScale),2048)}}},{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.initModels());case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"clearModels",value:function(){var t,e;null===(t=this.texture)||void 0===t||t.destroy(),null===(e=this.wind)||void 0===e||e.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:i.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:2,update:function(t,e,n){return[n[3],n[4]]}}})}},{key:"getZoomScale",value:function(){return Math.min((this.cacheZoom+4)/30*2,2)}},{key:"drawWind",value:function(){if(this.wind){var t=this.layer.getLayerConfig(),e=t.uMin,n=void 0===e?-21.32:e,r=t.uMax,i=void 0===r?26.8:r,o=t.vMin,a=void 0===o?-21.57:o,s=t.vMax,u=void 0===s?21.42:s,l=t.numParticles,c=void 0===l?65535:l,h=t.fadeOpacity,p=void 0===h?.996:h,f=t.speedFactor,d=void 0===f?.25:f,m=t.dropRate,g=void 0===m?.003:m,y=t.dropRateBump,v=void 0===y?.01:y,_=t.rampColors,b=void 0===_?Ln:_,x=t.sizeScale,w=void 0===x?.5:x,S=c,E=Math.floor(this.mapService.getZoom());if("number"==typeof w&&w!==this.sizeScale||E!==this.cacheZoom){var M=this.getZoomScale();this.sizeScale=w,S*=M;var T=this.getWindSize(),A=T.imageWidth,C=T.imageHeight;this.wind.reSize(A,C),this.cacheZoom=E}this.wind.updateWindDir(n,i,a,u),this.wind.updateParticelNum(S),this.wind.updateColorRampTexture(b),this.wind.fadeOpacity=p,this.wind.speedFactor=d,this.wind.dropRate=g,this.wind.dropRateBump=v;var O=this.wind.draw(),P=O.d,k=O.w,L=O.h;this.rendererService.setBaseState(),this.texture.update({data:P,width:k,height:L})}}},{key:"drawColorMode",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.layer.getLayerConfig().opacity;this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),this.layerService.renderMask(this.layer.masks),null===(t=this.colorModel)||void 0===t||t.draw({uniforms:{u_opacity:n||1,u_texture:this.texture},blend:this.getBlend(),stencil:this.getStencil(e)}),this.layer.hooks.afterRender.call()}}]),g}(H)};var Rn,Dn,Nn,Fn,zn,Bn,jn,Un,Zn=function(t){(0,l.Z)(f,t);var e,n,r,i=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function f(){var t;(0,a.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,p.Z)((0,u.Z)(t),"type","WindLayer"),t}return(0,s.Z)(f,[{key:"buildModels",value:(e=(0,o.Z)(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getModelType(),this.layerModel=new In[e](this),t.next=4,this.initLayerModels();case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"renderModels",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.layerModel&&this.layerModel.render(t),this}},{key:"getDefaultConfig",value:function(){return{wind:{}}[this.getModelType()]}},{key:"getModelType",value:function(){return"wind"}}]),f}(V),Vn=(Rn=(0,ae.b2)(),Dn=(0,ae.f3)(i.TYPES.IMapService),Nn=(0,ae.f3)(i.TYPES.IFontService),Rn((zn=function(){function t(){(0,a.Z)(this,t),(0,y.Z)(this,"mapService",Bn,this),(0,y.Z)(this,"fontService",jn,this)}return(0,s.Z)(t,[{key:"apply",value:function(t,e){var n=this,r=e.styleAttributeService;t.hooks.init.tapPromise("DataMappingPlugin",(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.log(i.IDebugLog.MappingStart,i.ILayerStage.INIT),n.generateMaping(t,{styleAttributeService:r}),t.log(i.IDebugLog.MappingEnd,i.ILayerStage.INIT);case 3:case"end":return e.stop()}}),e)})))),t.hooks.beforeRenderData.tapPromise("DataMappingPlugin",function(){var e=(0,o.Z)(d().mark((function e(o){var a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return",o);case 2:return t.dataState.dataMappingNeedUpdate=!1,t.log(i.IDebugLog.MappingStart,i.ILayerStage.UPDATE),a=n.generateMaping(t,{styleAttributeService:r}),t.log(i.IDebugLog.MappingEnd,i.ILayerStage.UPDATE),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.hooks.beforeRender.tap("DataMappingPlugin",(function(){var e=t.getSource();if(!t.layerModelNeedUpdate&&e&&e.inited){var i=r.getLayerStyleAttributes()||[],o=r.getLayerStyleAttribute("filter"),a=e.data.dataArray;if(!Array.isArray(a)||0!==a.length){var s=i.filter((function(t){return t.needRemapping})),u=a;if(null!=o&&o.needRemapping&&null!=o&&o.scale&&(u=a.filter((function(t){return n.applyAttributeMapping(o,t)[0]}))),s.length){var l=n.mapping(t,s,u,t.getEncodedData());t.setEncodedData(l)}}}}))}},{key:"generateMaping",value:function(t,e){var n=this,r=e.styleAttributeService,i=r.getLayerStyleAttributes()||[],o=r.getLayerStyleAttribute("filter"),a=t.getSource().data.dataArray,s=a;null!=o&&o.scale&&(s=a.filter((function(t){return n.applyAttributeMapping(o,t)[0]}))),s=t.processData(s);var u=this.mapping(t,i,s,void 0);return t.setEncodedData(u),(0!==a.length||0!==t.encodeDataLength)&&(t.emit("dataUpdate",null),!0)}},{key:"mapping",value:function(t,e,n,r){var i=this,o=t.getLayerConfig().arrow,a=void 0===o?{enable:!1}:o,s=e.filter((function(t){return void 0!==t.scale})).filter((function(t){return"filter"!==t.name})),u=n.map((function(e,n){var o=r?r[n]:{},u=(0,g.Z)({id:e._id,coordinates:e.coordinates},o);if(s.forEach((function(t){var n=i.applyAttributeMapping(t,e);"color"!==t.name&&"stroke"!==t.name||(n=n.map((function(t){return(0,x.rgb2arr)(t)}))),u[t.name]=Array.isArray(n)&&1===n.length?n[0]:n,"shape"===t.name&&(u.shape=i.fontService.getIconFontKey(u[t.name]))})),a.enable&&"line"===u.shape){var l=u.coordinates;if(t.arrowInsertCount<t.encodeDataLength){var c=i.getArrowPoints(l[0],l[1]);u.coordinates.splice(1,0,c,c),t.arrowInsertCount++}}return u}));return e.forEach((function(t){t.needRemapping=!1})),this.adjustData2Amap2Coordinates(u,t),this.adjustData2SimpleCoordinates(u),u}},{key:"adjustData2Amap2Coordinates",value:function(t,e){var n=this;if(t.length>0&&this.mapService.version===M.G["GAODE2.x"]){var r=e.coordCenter||e.getSource().center;t.filter((function(t){return!t.originCoordinates})).map((function(t){t.version=M.G["GAODE2.x"],t.originCoordinates=(0,S.cloneDeep)(t.coordinates),t.coordinates=n.mapService.coordToAMap2RelativeCoordinates(t.coordinates,r)}))}}},{key:"adjustData2SimpleCoordinates",value:function(t){var e=this;t.length>0&&this.mapService.version===M.G.SIMPLE&&t.map((function(t){t.simpleCoordinate||(t.coordinates=e.unProjectCoordinates(t.coordinates),t.simpleCoordinate=!0)}))}},{key:"unProjectCoordinates",value:function(t){var e=this;if("number"==typeof t[0])return this.mapService.simpleMapCoord.unproject(t);if(t[0]&&t[0][0]instanceof Array){var n=[];return t.map((function(t){var r=[];t.map((function(t){r.push(e.mapService.simpleMapCoord.unproject(t))})),n.push(r)})),n}var r=[];return t.map((function(t){r.push(e.mapService.simpleMapCoord.unproject(t))})),r}},{key:"applyAttributeMapping",value:function(t,e){var n;if(!t.scale)return[];var r=(null==t||null===(n=t.scale)||void 0===n?void 0:n.scalers)||[],i=[];return r.forEach((function(n){var r,o=n.field;(e.hasOwnProperty(o)||"variable"===(null===(r=t.scale)||void 0===r?void 0:r.type))&&i.push(e[o])})),t.mapping?t.mapping(i):[]}},{key:"getArrowPoints",value:function(t,e){var n=[e[0]-t[0],e[1]-t[1]],r=(0,x.normalize)(n);return[t[0]+1e-4*r[0],t[1]+1e-4*r[1]]}}]),t}(),Bn=(0,v.Z)(zn.prototype,"mapService",[Dn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jn=(0,v.Z)(zn.prototype,"fontService",[Nn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fn=zn))||Fn),Gn=(0,ae.b2)()(Un=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t){var e=this;this.mapService=t.getContainer().get(i.TYPES.IMapService),t.hooks.init.tapPromise("DataSourcePlugin",(0,o.Z)(d().mark((function n(){var r,o,a,s;return d().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.log(i.IDebugLog.SourceInitStart,i.ILayerStage.INIT),(r=t.getSource())||(o=t.sourceOption||t.defaultSourceConfig,a=o.data,s=o.options,r=new b.default(a,s),t.setSource(r)),!r.inited){n.next=8;break}e.updateClusterData(t),t.log(i.IDebugLog.SourceInitEnd,i.ILayerStage.INIT),n.next=10;break;case 8:return n.next=10,new Promise((function(n){r.on("update",(function(r){"inited"===r.type&&(e.updateClusterData(t),t.log(i.IDebugLog.SourceInitEnd,i.ILayerStage.INIT)),n(null)}))}));case 10:case"end":return n.stop()}}),n)})))),t.hooks.beforeRenderData.tapPromise("DataSourcePlugin",(0,o.Z)(d().mark((function n(){var r,i,o;return d().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.updateClusterData(t),i=t.dataState.dataSourceNeedUpdate,t.dataState.dataSourceNeedUpdate=!1,o=r||i,n.abrupt("return",o);case 5:case"end":return n.stop()}}),n)}))))}},{key:"updateClusterData",value:function(t){if(t.isTileLayer||t.tileLayer||!t.getSource())return!1;var e=t.getSource(),n=e.cluster,r=e.clusterOptions.zoom,i=void 0===r?0:r,o=this.mapService.getZoom()-1,a=t.dataState.dataSourceNeedUpdate;return n&&a&&e.updateClusterData(Math.floor(o)),!!(n&&Math.abs(t.clusterZoom-o)>=1)&&(i!==Math.floor(o)&&e.updateClusterData(Math.floor(o)),t.clusterZoom=o,!0)}}]),t}())||Un,Hn=n(937),Wn=n(4537);function qn(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Yn(t){return function(){return t}}function Xn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Yn(isNaN(t)?e:t)}const $n=function t(e){var n=function(t){return 1==(t=+t)?Xn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Yn(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=(0,Wn.B8)(t)).r,(e=(0,Wn.B8)(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Xn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Kn(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=(0,Wn.B8)(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}var Jn=Kn((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return qn((n-r/e)*e,a,i,o,s)}})),Qn=(Kn((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return qn((n-r/e)*e,i,o,a,s)}})),"$");function tr(){}function er(t,e){var n=new tr;if(t instanceof tr)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==e)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e(r=t[i],i,t),r)}else if(t)for(var a in t)n.set(a,t[a]);return n}tr.prototype=er.prototype={constructor:tr,has:function(t){return Qn+t in this},get:function(t){return this[Qn+t]},set:function(t,e){return this[Qn+t]=e,this},remove:function(t){var e=Qn+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===Qn&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===Qn&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===Qn&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===Qn&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===Qn&&++t;return t},empty:function(){for(var t in this)if(t[0]===Qn)return!1;return!0},each:function(t){for(var e in this)e[0]===Qn&&t(this[e],e.slice(1),this)}};const nr=er;function rr(){}var ir=nr.prototype;rr.prototype=function(t,e){var n=new rr;if(t instanceof rr)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}.prototype={constructor:rr,has:ir.has,add:function(t){return this[Qn+(t+="")]=t,this},remove:ir.remove,clear:ir.clear,values:ir.keys,size:ir.size,empty:ir.empty,each:ir.each};var or=Array.prototype,ar=or.map,sr=or.slice;function ur(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function lr(t,e){switch(arguments.length){case 0:break;case 1:this.interpolator(t);break;default:this.interpolator(e).domain(t)}return this}var cr={name:"implicit"};function hr(){var t=nr(),e=[],n=[],r=cr;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==cr)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=nr();for(var r,o,a=-1,s=n.length;++a<s;)t.has(o=(r=n[a])+"")||t.set(o,e.push(r));return i},i.range=function(t){return arguments.length?(n=sr.call(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return hr(e,n).unknown(r)},ur.apply(i,arguments),i}function pr(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=br(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}function fr(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function dr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function mr(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=br(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var gr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yr=new RegExp(gr.source,"g");function vr(t,e){var n,r,i,o=gr.lastIndex=yr.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=gr.exec(t))&&(r=yr.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:dr(n,r)})),o=yr.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})}function _r(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function br(t,e){var n,r,i=typeof e;return null==e||"boolean"===i?Yn(e):("number"===i?dr:"string"===i?(n=(0,Wn.ZP)(e))?(e=n,$n):vr:e instanceof Wn.ZP?$n:e instanceof Date?fr:(r=e,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(e)?pr:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?mr:dr:_r))(t,e)}function xr(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function wr(t){return+t}var Sr=[0,1];function Er(t){return t}function Mr(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Tr(t){var e,n=t[0],r=t[t.length-1];return n>r&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function Ar(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Mr(i,r),o=n(a,o)):(r=Mr(r,i),o=n(o,a)),function(t){return o(r(t))}}function Cr(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Mr(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=(0,Hn.b4)(t,e,1,r)-1;return o[n](i[n](e))}}function Or(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Pr(){var t,e,n,r,i,o,a=Sr,s=Sr,u=br,l=Er;function c(){return r=Math.min(a.length,s.length)>2?Cr:Ar,i=o=null,h}function h(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(l(e)))}return h.invert=function(n){return l(e((o||(o=r(s,a.map(t),dr)))(n)))},h.domain=function(t){return arguments.length?(a=ar.call(t,wr),l===Er||(l=Tr(a)),c()):a.slice()},h.range=function(t){return arguments.length?(s=sr.call(t),c()):s.slice()},h.rangeRound=function(t){return s=sr.call(t),u=xr,c()},h.clamp=function(t){return arguments.length?(l=t?Tr(a):Er,h):l!==Er},h.interpolate=function(t){return arguments.length?(u=t,c()):u},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,c()}}function kr(t,e){return Pr()(t,e)}var Lr,Ir=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rr(t){if(!(e=Ir.exec(t)))throw new Error("invalid format: "+t);var e;return new Dr({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 Dr(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 Nr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Fr(t){return(t=Nr(Math.abs(t)))?t[1]:NaN}function zr(t,e){var n=Nr(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Rr.prototype=Dr.prototype,Dr.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};const Br={"%":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 zr(100*t,e)},r:zr,s:function(t,e){var n=Nr(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Lr=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Nr(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function jr(t){return t}var Ur,Zr,Vr,Gr=Array.prototype.map,Hr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Wr(t){var e=t.domain;return t.ticks=function(t){var n=e();return(0,Hn.sd)(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return function(t,e,n,r){var i,o=(0,Hn.ly)(t,e,n);switch((r=Rr(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Fr(e)/3)))-Fr(Math.abs(t)))}(o,a))||(r.precision=i),Vr(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Fr(e)-Fr(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-Fr(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return Zr(r)}(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),o=0,a=i.length-1,s=i[o],u=i[a];return u<s&&(r=s,s=u,u=r,r=o,o=a,a=r),(r=(0,Hn.G9)(s,u,n))>0?(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,r=(0,Hn.G9)(s,u,n)):r<0&&(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,r=(0,Hn.G9)(s,u,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,e(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,e(i)),t},t}function qr(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function Yr(t){return Math.log(t)}function Xr(t){return Math.exp(t)}function $r(t){return-Math.log(-t)}function Kr(t){return-Math.exp(-t)}function Jr(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Qr(t){return function(e){return-t(-e)}}function ti(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ei(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ni(t){return t<0?-t*t:t*t}Ur=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?jr:(e=Gr.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?jr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Gr.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"-":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=Rr(t)).fill,n=t.align,h=t.sign,p=t.symbol,f=t.zero,d=t.width,m=t.comma,g=t.precision,y=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Br[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var _="$"===p?i:"#"===p&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===p?o:/[%p]/.test(v)?u:"",x=Br[v],w=/[defgprs%]/.test(v);function S(t){var i,o,u,p=_,S=b;if("c"===v)S=x(t)+S,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:x(Math.abs(t),g),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==h&&(E=!1),p=(E?"("===h?h:l:"-"===h||"("===h?"":h)+p,S=("s"===v?Hr[8+Lr/3]:"")+S+(E&&"("===h?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){S=(46===u?a+t.slice(i+1):t.slice(i))+S,t=t.slice(0,i);break}}m&&!f&&(t=r(t,1/0));var M=p.length+t.length+S.length,T=M<d?new Array(d-M+1).join(e):"";switch(m&&f&&(t=r(T+t,T.length?d-S.length:1/0),T=""),n){case"<":t=p+t+S+T;break;case"=":t=p+T+t+S;break;case"^":t=T.slice(0,M=T.length>>1)+p+t+S+T.slice(M);break;default:t=T+p+t+S}return s(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=h(((t=Rr(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Fr(e)/3))),i=Math.pow(10,-r),o=Hr[8+r/3];return function(t){return n(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Zr=Ur.format,Vr=Ur.formatPrefix;var ri=new Date,ii=new Date;function oi(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return s},i.filter=function(n){return oi((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return ri.setTime(+e),ii.setTime(+r),t(ri),t(ii),Math.floor(n(ri,ii))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var ai=oi((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()}));ai.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oi((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const si=ai;ai.range;var ui=oi((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()}));const li=ui;ui.range;var ci=1e3,hi=6e4,pi=36e5,fi=864e5,di=6048e5;function mi(t){return oi((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())*hi)/di}))}var gi=mi(0),yi=mi(1),vi=mi(2),_i=mi(3),bi=mi(4),xi=mi(5),wi=mi(6),Si=(gi.range,yi.range,vi.range,_i.range,bi.range,xi.range,wi.range,oi((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())*hi)/fi}),(function(t){return t.getDate()-1})));const Ei=Si;Si.range;var Mi=oi((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*ci-t.getMinutes()*hi)}),(function(t,e){t.setTime(+t+e*pi)}),(function(t,e){return(e-t)/pi}),(function(t){return t.getHours()}));const Ti=Mi;Mi.range;var Ai=oi((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*ci)}),(function(t,e){t.setTime(+t+e*hi)}),(function(t,e){return(e-t)/hi}),(function(t){return t.getMinutes()}));const Ci=Ai;Ai.range;var Oi=oi((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*ci)}),(function(t,e){return(e-t)/ci}),(function(t){return t.getUTCSeconds()}));const Pi=Oi;Oi.range;var ki=oi((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));ki.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?oi((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):ki:null};const Li=ki;function Ii(t){return oi((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)/di}))}ki.range;var Ri=Ii(0),Di=Ii(1),Ni=Ii(2),Fi=Ii(3),zi=Ii(4),Bi=Ii(5),ji=Ii(6),Ui=(Ri.range,Di.range,Ni.range,Fi.range,zi.range,Bi.range,ji.range,oi((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/fi}),(function(t){return t.getUTCDate()-1})));const Zi=Ui;Ui.range;var Vi=oi((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()}));Vi.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oi((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const Gi=Vi;function Hi(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 Wi(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 qi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}Vi.range;var Yi,Xi,$i={"-":"",_:" ",0:"0"},Ki=/^\s*\d+/,Ji=/^%/,Qi=/[\\^$*+?|[\]().{}]/g;function to(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function eo(t){return t.replace(Qi,"\\$&")}function no(t){return new RegExp("^(?:"+t.map(eo).join("|")+")","i")}function ro(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function io(t,e,n){var r=Ki.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function oo(t,e,n){var r=Ki.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function ao(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function so(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function uo(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function lo(t,e,n){var r=Ki.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function co(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ho(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function po(t,e,n){var r=Ki.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function fo(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function mo(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function go(t,e,n){var r=Ki.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function yo(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function vo(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function _o(t,e,n){var r=Ki.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function bo(t,e,n){var r=Ki.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function xo(t,e,n){var r=Ki.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function wo(t,e,n){var r=Ji.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function So(t,e,n){var r=Ki.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Eo(t,e,n){var r=Ki.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Mo(t,e){return to(t.getDate(),e,2)}function To(t,e){return to(t.getHours(),e,2)}function Ao(t,e){return to(t.getHours()%12||12,e,2)}function Co(t,e){return to(1+Ei.count(si(t),t),e,3)}function Oo(t,e){return to(t.getMilliseconds(),e,3)}function Po(t,e){return Oo(t,e)+"000"}function ko(t,e){return to(t.getMonth()+1,e,2)}function Lo(t,e){return to(t.getMinutes(),e,2)}function Io(t,e){return to(t.getSeconds(),e,2)}function Ro(t){var e=t.getDay();return 0===e?7:e}function Do(t,e){return to(gi.count(si(t)-1,t),e,2)}function No(t){var e=t.getDay();return e>=4||0===e?bi(t):bi.ceil(t)}function Fo(t,e){return t=No(t),to(bi.count(si(t),t)+(4===si(t).getDay()),e,2)}function zo(t){return t.getDay()}function Bo(t,e){return to(yi.count(si(t)-1,t),e,2)}function jo(t,e){return to(t.getFullYear()%100,e,2)}function Uo(t,e){return to((t=No(t)).getFullYear()%100,e,2)}function Zo(t,e){return to(t.getFullYear()%1e4,e,4)}function Vo(t,e){var n=t.getDay();return to((t=n>=4||0===n?bi(t):bi.ceil(t)).getFullYear()%1e4,e,4)}function Go(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+to(e/60|0,"0",2)+to(e%60,"0",2)}function Ho(t,e){return to(t.getUTCDate(),e,2)}function Wo(t,e){return to(t.getUTCHours(),e,2)}function qo(t,e){return to(t.getUTCHours()%12||12,e,2)}function Yo(t,e){return to(1+Zi.count(Gi(t),t),e,3)}function Xo(t,e){return to(t.getUTCMilliseconds(),e,3)}function $o(t,e){return Xo(t,e)+"000"}function Ko(t,e){return to(t.getUTCMonth()+1,e,2)}function Jo(t,e){return to(t.getUTCMinutes(),e,2)}function Qo(t,e){return to(t.getUTCSeconds(),e,2)}function ta(t){var e=t.getUTCDay();return 0===e?7:e}function ea(t,e){return to(Ri.count(Gi(t)-1,t),e,2)}function na(t){var e=t.getUTCDay();return e>=4||0===e?zi(t):zi.ceil(t)}function ra(t,e){return t=na(t),to(zi.count(Gi(t),t)+(4===Gi(t).getUTCDay()),e,2)}function ia(t){return t.getUTCDay()}function oa(t,e){return to(Di.count(Gi(t)-1,t),e,2)}function aa(t,e){return to(t.getUTCFullYear()%100,e,2)}function sa(t,e){return to((t=na(t)).getUTCFullYear()%100,e,2)}function ua(t,e){return to(t.getUTCFullYear()%1e4,e,4)}function la(t,e){var n=t.getUTCDay();return to((t=n>=4||0===n?zi(t):zi.ceil(t)).getUTCFullYear()%1e4,e,4)}function ca(){return"+0000"}function ha(){return"%"}function pa(t){return+t}function fa(t){return Math.floor(+t/1e3)}Yi=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,l=no(i),c=ro(i),h=no(o),p=ro(o),f=no(a),d=ro(a),m=no(s),g=ro(s),y=no(u),v=ro(u),_={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Mo,e:Mo,f:Po,g:Uo,G:Vo,H:To,I:Ao,j:Co,L:Oo,m:ko,M:Lo,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:pa,s:fa,S:Io,u:Ro,U:Do,V:Fo,w:zo,W:Bo,x:null,X:null,y:jo,Y:Zo,Z:Go,"%":ha},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Ho,e:Ho,f:$o,g:sa,G:la,H:Wo,I:qo,j:Yo,L:Xo,m:Ko,M:Jo,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:pa,s:fa,S:Qo,u:ta,U:ea,V:ra,w:ia,W:oa,x:null,X:null,y:aa,Y:ua,Z:ca,"%":ha},x={a:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=d[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:mo,e:mo,f:xo,g:co,G:lo,H:yo,I:yo,j:go,L:bo,m:fo,M:vo,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:po,Q:So,s:Eo,S:_o,u:oo,U:ao,V:so,w:io,W:uo,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:co,Y:lo,Z:ho,"%":wo};function w(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=$i[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function S(t,e){return function(n){var r,i,o=qi(1900,void 0,1);if(E(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Wi(qi(o.y,0,1))).getUTCDay(),r=i>4||0===i?Di.ceil(r):Di(r),r=Zi.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Hi(qi(o.y,0,1))).getDay(),r=i>4||0===i?yi.ceil(r):yi(r),r=Ei.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Wi(qi(o.y,0,1)).getUTCDay():Hi(qi(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Wi(o)):Hi(o)}}function E(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=x[i in $i?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return _.x=w(n,_),_.X=w(r,_),_.c=w(e,_),b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),{format:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=S(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=S(t+="",!0);return e.toString=function(){return t},e}}}({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"]}),Xi=Yi.format,Yi.parse,Yi.utcFormat,Yi.utcParse;var da,ma,ga=1e3,ya=6e4,va=36e5,_a=864e5,ba=2592e6,xa=31536e6;function wa(t){return new Date(t)}function Sa(t){return t instanceof Date?+t:+new Date(+t)}function Ea(t,e,n,r,i,o,a,s,u){var l=kr(Er,Er),c=l.invert,h=l.domain,p=u(".%L"),f=u(":%S"),d=u("%I:%M"),m=u("%I %p"),g=u("%a %d"),y=u("%b %d"),v=u("%B"),_=u("%Y"),b=[[a,1,ga],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,ya],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,va],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,_a],[r,2,1728e5],[n,1,6048e5],[e,1,ba],[e,3,7776e6],[t,1,xa]];function x(s){return(a(s)<s?p:o(s)<s?f:i(s)<s?d:r(s)<s?m:e(s)<s?n(s)<s?g:y:t(s)<s?v:_)(s)}function w(e,n,r,i){if(null==e&&(e=10),"number"==typeof e){var o=Math.abs(r-n)/e,a=(0,Hn.YF)((function(t){return t[2]})).right(b,o);a===b.length?(i=(0,Hn.ly)(n/xa,r/xa,e),e=t):a?(i=(a=b[o/b[a-1][2]<b[a][2]/o?a-1:a])[1],e=a[0]):(i=Math.max((0,Hn.ly)(n,r,e),1),e=s)}return null==i?e:e.every(i)}return l.invert=function(t){return new Date(c(t))},l.domain=function(t){return arguments.length?h(ar.call(t,Sa)):h().map(wa)},l.ticks=function(t,e){var n,r=h(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=w(t,i,o,e))?n.range(i,o+1):[],a?n.reverse():n},l.tickFormat=function(t,e){return null==e?x:u(e)},l.nice=function(t,e){var n=h();return(t=w(t,n[0],n[n.length-1],e))?h(qr(n,t)):l},l.copy=function(){return Or(l,Ea(t,e,n,r,i,o,a,s,u))},l}function Ma(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}var Ta,Aa,Ca=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,Oa=(da={},(0,p.Z)(da,i.ScaleTypes.LINEAR,(function t(){var e=kr(Er,Er);return e.copy=function(){return Or(e,t())},ur.apply(e,arguments),Wr(e)})),(0,p.Z)(da,i.ScaleTypes.POWER,(function t(){var e=function(t){var e=t(Er,Er),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Er,Er):.5===n?t(ei,ni):t(ti(n),ti(1/n)):n},Wr(e)}(Pr());return e.copy=function(){return Or(e,t()).exponent(e.exponent())},ur.apply(e,arguments),e})),(0,p.Z)(da,i.ScaleTypes.LOG,(function t(){var e=function(t){var e,n,r=t(Yr,Xr),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?Jr:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=Qr(e),n=Qr(n),t($r,Kr)):t(Yr,Xr),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),s=a[0],u=a[a.length-1];(r=u<s)&&(p=s,s=u,u=p);var l,c,h,p=e(s),f=e(u),d=null==t?10:+t,m=[];if(!(o%1)&&f-p<d){if(p=Math.round(p)-1,f=Math.round(f)+1,s>0){for(;p<f;++p)for(c=1,l=n(p);c<o;++c)if(!((h=l*c)<s)){if(h>u)break;m.push(h)}}else for(;p<f;++p)for(c=o-1,l=n(p);c>=1;--c)if(!((h=l*c)<s)){if(h>u)break;m.push(h)}}else m=(0,Hn.sd)(p,f,Math.min(f-p,d)).map(n);return r?m.reverse():m},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=Zr(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(qr(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}(Pr()).domain([1,10]);return e.copy=function(){return Or(e,t()).base(e.base())},ur.apply(e,arguments),e})),(0,p.Z)(da,i.ScaleTypes.IDENTITY,(function t(e){var n,r=[];function i(t){return null==t?n:t}return i.invert=i,i.domain=i.range=function(t){return t?(r=t,t):r},i.unknown=function(t){return t?(n=t,t):n},i.copy=function(){return t(e).unknown(n)},i})),(0,p.Z)(da,i.ScaleTypes.SEQUENTIAL,(function t(){var e=Wr(function(){var t,e,n,r,i,o=0,a=1,s=Er,u=!1;function l(e){return isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,u?Math.max(0,Math.min(1,e)):e))}return l.domain=function(i){return arguments.length?(t=r(o=+i[0]),e=r(a=+i[1]),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(u=!!t,l):u},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.unknown=function(t){return arguments.length?(i=t,l):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),l}}()(Er));return e.copy=function(){return Ma(e,t())},lr.apply(e,arguments)})),(0,p.Z)(da,i.ScaleTypes.TIME,(function(){return ur.apply(Ea(si,li,gi,Ei,Ti,Ci,Pi,Li,Xi).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)})),(0,p.Z)(da,i.ScaleTypes.QUANTILE,(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=(0,Hn.VR)(n,t/e);return a}function a(t){return isNaN(t=+t)?e:r[(0,Hn.b4)(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(var e,r=0,i=t.length;r<i;++r)null==(e=t[r])||isNaN(e=+e)||n.push(e);return n.sort(Hn.j2),o()},a.range=function(t){return arguments.length?(r=sr.call(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},ur.apply(a,arguments)})),(0,p.Z)(da,i.ScaleTypes.QUANTIZE,(function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function s(t){return t<=t?a[(0,Hn.b4)(o,t,0,i)]:e}function u(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return s}return s.domain=function(t){return arguments.length?(n=+t[0],r=+t[1],u()):[n,r]},s.range=function(t){return arguments.length?(i=(a=sr.call(t)).length-1,u()):a.slice()},s.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([n,r]).range(a).unknown(e)},ur.apply(Wr(s),arguments)})),(0,p.Z)(da,i.ScaleTypes.THRESHOLD,(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return t<=t?r[(0,Hn.b4)(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=sr.call(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=sr.call(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},ur.apply(o,arguments)})),(0,p.Z)(da,i.ScaleTypes.CAT,hr),(0,p.Z)(da,i.ScaleTypes.DIVERGING,(function t(){var e=Wr(function(){var t,e,n,r,i,o,a,s=0,u=.5,l=1,c=Er,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(t<e?r:i),c(h?Math.max(0,Math.min(1,t)):t))}return p.domain=function(a){return arguments.length?(t=o(s=+a[0]),e=o(u=+a[1]),n=o(l=+a[2]),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),p):[s,u,l]},p.clamp=function(t){return arguments.length?(h=!!t,p):h},p.interpolator=function(t){return arguments.length?(c=t,p):c},p.unknown=function(t){return arguments.length?(a=t,p):a},function(a){return o=a,t=a(s),e=a(u),n=a(l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),p}}()(Er));return e.copy=function(){return Ma(e,t())},lr.apply(e,arguments)})),da),Pa=(0,ae.b2)()(ma=function(){function t(){(0,a.Z)(this,t),(0,p.Z)(this,"scaleOptions",{})}return(0,s.Z)(t,[{key:"apply",value:function(t,e){var n=this,r=e.styleAttributeService;t.hooks.init.tapPromise("FeatureScalePlugin",(0,o.Z)(d().mark((function e(){var o,a,s;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.log(i.IDebugLog.ScaleInitStart,i.ILayerStage.INIT),n.scaleOptions=t.getScaleOptions(),a=r.getLayerStyleAttributes(),s=null===(o=t.getSource())||void 0===o?void 0:o.data.dataArray,!Array.isArray(s)||0!==s.length){e.next=8;break}return e.abrupt("return");case 8:n.caculateScalesForAttributes(a||[],s);case 9:t.log(i.IDebugLog.ScaleInitEnd,i.ILayerStage.INIT);case 10:case"end":return e.stop()}}),e)})))),t.hooks.beforeRenderData.tapPromise("FeatureScalePlugin",function(){var e=(0,o.Z)(d().mark((function e(o){var a,s;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return",o);case 2:if(t.log(i.IDebugLog.ScaleInitStart,i.ILayerStage.UPDATE),n.scaleOptions=t.getScaleOptions(),a=r.getLayerStyleAttributes(),s=t.getSource().data.dataArray,!Array.isArray(s)||0!==s.length){e.next=8;break}return e.abrupt("return",!0);case 8:return n.caculateScalesForAttributes(a||[],s),t.log(i.IDebugLog.ScaleInitEnd,i.ILayerStage.UPDATE),t.layerModelNeedUpdate=!0,e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.hooks.beforeRender.tap("FeatureScalePlugin",(function(){if(!t.layerModelNeedUpdate){n.scaleOptions=t.getScaleOptions();var e=r.getLayerStyleAttributes(),i=t.getSource().data.dataArray;if((!Array.isArray(i)||0!==i.length)&&e){var o=e.filter((function(t){return t.needRescale}));o.length&&n.caculateScalesForAttributes(o,i)}}}))}},{key:"isNumber",value:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},{key:"caculateScalesForAttributes",value:function(t,e){var n=this;t.forEach((function(t){if(t.scale){var r=t.scale;r.names=n.parseFields(t.scale.field||[]);var o=[];r.names.forEach((function(r){var i;o.push(n.createScale(r,t.name,null===(i=t.scale)||void 0===i?void 0:i.values,e))})),o.some((function(t){return t.type===i.StyleScaleType.VARIABLE}))?(r.type=i.StyleScaleType.VARIABLE,o.forEach((function(t){var e,n;if(!r.callback&&"text"!==r.values)switch(null===(e=t.option)||void 0===e?void 0:e.type){case i.ScaleTypes.LOG:case i.ScaleTypes.LINEAR:case i.ScaleTypes.POWER:if(r.values&&r.values.length>2){var o=t.scale.ticks(r.values.length);t.scale.domain(o)}r.values?t.scale.range(r.values):t.scale.range(t.option.domain);break;case i.ScaleTypes.QUANTILE:case i.ScaleTypes.QUANTIZE:case i.ScaleTypes.THRESHOLD:t.scale.range(r.values);break;case i.ScaleTypes.IDENTITY:break;case i.ScaleTypes.CAT:r.values?t.scale.range(r.values):t.scale.range(t.option.domain);break;case i.ScaleTypes.DIVERGING:case i.ScaleTypes.SEQUENTIAL:t.scale.interpolator(Jn(r.values))}"text"===r.values&&t.scale.range(null===(n=t.option)||void 0===n?void 0:n.domain)}))):(r.type=i.StyleScaleType.CONSTANT,r.defaultValues=o.map((function(t,e){return t.scale(r.names[e])}))),r.scalers=o.map((function(t){return{field:t.field,func:t.scale,option:t.option}})),t.needRescale=!1}}))}},{key:"parseFields",value:function(t){return Array.isArray(t)?t:(0,S.isString)(t)?t.split("*"):[t]}},{key:"createScale",value:function(t,e,n,r){var o,a,s=this.scaleOptions[e]&&(null===(o=this.scaleOptions[e])||void 0===o?void 0:o.field)===t?this.scaleOptions[e]:this.scaleOptions[t],u={field:t,scale:void 0,type:i.StyleScaleType.VARIABLE,option:s};if(!r||!r.length)return s&&s.type?u.scale=this.createDefaultScale(s):(u.scale=hr([t]),u.type=i.StyleScaleType.CONSTANT),u;var l=null===(a=r.find((function(e){return!(0,S.isNil)(e[t])})))||void 0===a?void 0:a[t];if(this.isNumber(t)||(0,S.isNil)(l)&&!s)u.scale=hr([t]),u.type=i.StyleScaleType.CONSTANT;else{var c=s&&s.type||this.getDefaultType(l);"text"===n&&(c=i.ScaleTypes.CAT);var h=this.createScaleConfig(c,t,s,r);u.scale=this.createDefaultScale(h),u.option=h}return u}},{key:"getDefaultType",value:function(t){var e=i.ScaleTypes.LINEAR;return"string"==typeof t&&(e=Ca.test(t)?i.ScaleTypes.TIME:i.ScaleTypes.CAT),e}},{key:"createScaleConfig",value:function(t,e,n,r){var o={type:t},a=(null==r?void 0:r.map((function(t){return t[e]})))||[];if(null!=n&&n.domain)o.domain=null==n?void 0:n.domain;else if(t===i.ScaleTypes.CAT||t===i.ScaleTypes.IDENTITY)o.domain=(0,S.uniq)(a);else if(t===i.ScaleTypes.QUANTILE)o.domain=a;else if(t===i.ScaleTypes.DIVERGING){var s=(0,Hn.We)(a),u=void 0!==(null==n?void 0:n.neutral)?null==n?void 0:n.neutral:(s[0]+s[1])/2;o.domain=[s[0],u,s[1]]}else o.domain=(0,Hn.We)(a);return(0,g.Z)((0,g.Z)({},o),n)}},{key:"createDefaultScale",value:function(t){var e=t.type,n=t.domain,r=t.unknown,i=t.clamp,o=t.nice,a=Oa[e]();return n&&a.domain&&a.domain(n),r&&a.unknown(r),void 0!==i&&a.clamp&&a.clamp(i),void 0!==o&&a.nice&&a.nice(o),a}}]),t}())||ma,ka=(0,ae.b2)()(Ta=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("LayerAnimateStylePlugin",(function(){t.animateStatus&&t.models.forEach((function(e){e.addUniforms((0,g.Z)({},t.layerModel.getAnimateUniforms()))}))}))}}]),t}())||Ta,La=(0,ae.b2)()(Aa=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t){t.hooks.afterInit.tap("LayerMaskPlugin",(function(){var e,n=t.getLayerConfig(),r=n.maskLayers,i=n.enableMask;!t.tileLayer&&r&&r.length>0&&((e=t.masks).push.apply(e,(0,Q.Z)(r)),t.updateLayerConfig({mask:i}))}))}}]),t}())||Aa,Ia=function(){function t(e){var n=e.rendererService,r=e.layerService,i=e.parent;(0,a.Z)(this,t),(0,p.Z)(this,"tileResource",new Map),(0,p.Z)(this,"layerTiles",[]),this.rendererService=n,this.layerService=r,this.parent=i}var e;return(0,s.Z)(t,[{key:"tiles",get:function(){return this.layerTiles}},{key:"hasTile",value:function(t){return this.layerTiles.some((function(e){return e.key===t}))}},{key:"addTile",value:function(t){this.layerTiles.push(t)}},{key:"getTile",value:function(t){return this.layerTiles.find((function(e){return e.key===t}))}},{key:"getVisibleTileBylngLat",value:function(t){return this.layerTiles.find((function(e){return e.isLoaded&&e.visible&&e.lnglatInBounds(t)}))}},{key:"removeTile",value:function(t){var e=this.layerTiles.findIndex((function(e){return e.key===t})),n=this.layerTiles.splice(e,1);n[0]&&n[0].destroy()}},{key:"updateTileVisible",value:function(t){var e=this.getTile(t.key);null==e||e.updateVisible(t.isVisible)}},{key:"isParentLoaded",value:function(t){var e=t.parent;if(!e)return!0;var n=this.getTile(null==e?void 0:e.key);return!(null==n||!n.isLoaded)}},{key:"isChildrenLoaded",value:function(t){var e=this,n=null==t?void 0:t.children;return 0===n.length||n.some((function(t){var n=e.getTile(null==t?void 0:t.key);return!1===(null==n?void 0:n.isLoaded)}))}},{key:"render",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getRenderLayers(),n=e.map(function(){var t=(0,o.Z)(d().mark((function t(e){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.layerService.renderTileLayer(e);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.next=4,Promise.all(n);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getRenderLayers",value:function(){var t=this.layerTiles.filter((function(t){return t.visible&&t.isLoaded})),e=[];return t.map((function(t){return e.push.apply(e,(0,Q.Z)(t.getLayers()))})),e}},{key:"getLayers",value:function(){var t=this.layerTiles.filter((function(t){return t.isLoaded})),e=[];return t.map((function(t){return e.push.apply(e,(0,Q.Z)(t.getLayers()))})),e}},{key:"getTiles",value:function(){return this.layerTiles}},{key:"destroy",value:function(){this.layerTiles.forEach((function(t){return t.destroy()})),this.tileResource.clear()}}]),t}(),Ra=n(3959),Da=n(9349),Na=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"getCombineFeature",value:function(t){var e=null,n=t[0];return t.map((function(t){var n=Ra.yu(t.coordinates);e=null===e?n:(0,Da.Z)(e,n)})),n&&(e.properties=(0,g.Z)({},n)),e}}]),t}(),Fa="select",za="active",Ba=function(){function t(e){var n=e.layerService,r=e.tileLayerService,i=e.parent;(0,a.Z)(this,t),(0,p.Z)(this,"tilePickID",new Map),this.layerService=n,this.tileLayerService=r,this.parent=i,this.tileSourceService=new Na}return(0,s.Z)(t,[{key:"pickRender",value:function(t){var e=this.tileLayerService.getVisibleTileBylngLat(t.lngLat);if(e){var n=e.getMainLayer();null==n||n.layerPickService.pickRender(t)}}},{key:"pick",value:function(t,e){var n=this.parent.getContainer().get(i.TYPES.IPickingService);if("RasterLayer"===t.type){var r=this.tileLayerService.getVisibleTileBylngLat(e.lngLat);if(r&&void 0!==r.getMainLayer()){var o=r.getMainLayer();return o.layerPickService.pickRasterLayer(o,e,this.parent)}return!1}return this.pickRender(e),n.pickFromPickingFBO(t,e)}},{key:"selectFeature",value:function(t){var e=(0,A.Z)(t,3),n=e[0],r=e[1],i=e[2],o=this.color2PickId(n,r,i);this.tilePickID.set(Fa,o),this.updateHighLight(n,r,i,Fa)}},{key:"highlightPickedFeature",value:function(t){var e=(0,A.Z)(t,3),n=e[0],r=e[1],i=e[2],o=this.color2PickId(n,r,i);this.tilePickID.set(za,o),this.updateHighLight(n,r,i,za)}},{key:"updateHighLight",value:function(t,e,n,r){this.tileLayerService.tiles.map((function(i){var o=i.getMainLayer();switch(r){case Fa:null==o||o.hooks.beforeSelect.call([t,e,n]);break;case za:null==o||o.hooks.beforeHighlight.call([t,e,n])}}))}},{key:"setPickState",value:function(){var t=this.tilePickID.get(Fa),e=this.tilePickID.get(za);if(t){var n=this.pickId2Color(t),r=(0,A.Z)(n,3),i=r[0],o=r[1],a=r[2];this.updateHighLight(i,o,a,Fa)}else if(e){var s=this.pickId2Color(e),u=(0,A.Z)(s,3),l=u[0],c=u[1],h=u[2];this.updateHighLight(l,c,h,za)}}},{key:"color2PickId",value:function(t,e,n){return(0,x.decodePickingColor)(new Uint8Array([t,e,n]))}},{key:"pickId2Color",value:function(t){return(0,x.encodePickingColor)(t)}},{key:"getFeatureById",value:function(t){var e=this.tileLayerService.getTiles().filter((function(t){return t.visible})),n=[];return e.forEach((function(e){n.push.apply(n,(0,Q.Z)(e.getFeatureById(t)))})),n}},{key:"pickRasterLayer",value:function(t,e,n){return!1}}]),t}(),ja=["shape","color","size","style","animate","filter","rotate","scale","setBlend","setSelect","setActive","disableMask","enableMask"],Ua=function(){function t(e,n){(0,a.Z)(this,t),(0,p.Z)(this,"visible",!0),(0,p.Z)(this,"layers",[]),(0,p.Z)(this,"isLoaded",!1),(0,p.Z)(this,"tileMaskLayers",[]),this.parent=n,this.sourceTile=e,this.x=e.x,this.y=e.y,this.z=e.z,this.key="".concat(this.x,"_").concat(this.y,"_").concat(this.z)}var e,n,r;return(0,s.Z)(t,[{key:"getLayers",value:function(){return this.layers}},{key:"styleUpdate",value:function(){}},{key:"lnglatInBounds",value:function(t){var e=(0,A.Z)(this.sourceTile.bounds,4),n=e[0],r=e[1],i=e[2],o=e[3],a=t.lng,s=t.lat;return a>=n&&a<=i&&s>=r&&s<=o}},{key:"getLayerOptions",value:function(){var t,e,n=this.parent.getLayerConfig();return(0,g.Z)((0,g.Z)({},n),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:(e=this.parent.type,-1!==["PolygonLayer","LineLayer"].indexOf(e)),mask:n.mask||0!==(null===(t=n.maskLayers)||void 0===t?void 0:t.length)&&n.enableMask})}},{key:"getMaskLayer",value:function(){var t=this,e=this.parent.getLayerConfig().maskLayers,n=[];return null==e||e.forEach((function(e){if(!e.tileLayer)return n.push(e),e;var r=e.tileLayer.getTile(t.sourceTile.key),i=null==r?void 0:r.getLayers()[0];i&&n.push(i)})),n}},{key:"addTileMask",value:(r=(0,o.Z)(d().mark((function t(){var e,n,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new ln({visible:!1,enablePicking:!1}).source({type:"FeatureCollection",features:[this.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill"),n=(0,i.createLayerContainer)(this.parent.sceneContainer),e.setContainer(n,this.parent.sceneContainer),t.next=5,e.init();case 5:return this.tileMask=e,void 0!==(r=this.getMainLayer())&&(r.tileMask=e),t.abrupt("return",e);case 9:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"addMask",value:(n=(0,o.Z)(d().mark((function t(e,n){var r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,i.createLayerContainer)(this.parent.sceneContainer),n.setContainer(r,this.parent.sceneContainer),t.next=4,n.init();case 4:e.addMask(n),this.tileMaskLayers.push(n);case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"addLayer",value:(e=(0,o.Z)(d().mark((function t(e){var n;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.isTileLayer=!0,n=(0,i.createLayerContainer)(this.parent.sceneContainer),e.setContainer(n,this.parent.sceneContainer),this.layers.push(e),t.next=6,e.init();case 6:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"updateVisible",value:function(t){this.visible=t,this.updateOptions("visible",t)}},{key:"updateOptions",value:function(t,e){this.layers.forEach((function(n){n.updateLayerConfig((0,p.Z)({},t,e))}))}},{key:"getMainLayer",value:function(){return this.layers[0]}},{key:"getFeatures",value:function(t){return[]}},{key:"getFeatureById",value:function(t){return[]}},{key:"destroy",value:function(){var t;null===(t=this.tileMask)||void 0===t||t.destroy(),this.layers.forEach((function(t){return t.destroy()}))}}]),t}();var Za=function(t){(0,l.Z)(u,t);var e,n,r,i=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function u(){return(0,a.Z)(this,u),i.apply(this,arguments)}return(0,s.Z)(u,[{key:"initTileLayer",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSourceOption(),n=e.data.features[0].properties,r=(new Ce).source(e.data,e.options).size(1).shape("line").color("red"),i=new rn({minZoom:this.z-1,maxZoom:this.z+1,textAllowOverlap:!0}).source([n],{parser:{type:"json",x:"x",y:"y"}}).size(20).color("red").shape(this.key).style({stroke:"#fff",strokeWidth:2}),t.next=6,this.addLayer(r);case 6:return t.next=8,this.addLayer(i);case 8:this.isLoaded=!0;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getSourceOption",value:function(){var t=this.parent.getSource();return{data:{type:"FeatureCollection",features:this.sourceTile.data.layers.testTile.features},options:{parser:{type:"geojson"},transforms:t.transforms}}}}]),u}(Ua);var Va=function(t){(0,l.Z)(u,t);var e,n,r,i=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function u(){return(0,a.Z)(this,u),i.apply(this,arguments)}return(0,s.Z)(u,[{key:"initTileLayer",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.parent.getLayerAttributeConfig(),n=this.getLayerOptions(),r=this.getSourceOption(),i=new he((0,g.Z)({},n)).source(r.data,r.options),e&&Object.keys(e).forEach((function(t){var n,r,o=t;i[o](null===(n=e[o])||void 0===n?void 0:n.field,null===(r=e[o])||void 0===r?void 0:r.values)})),t.next=7,this.addLayer(i);case 7:this.isLoaded=!0;case 8:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getSourceOption",value:function(){var t=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:t.transforms}}}}]),u}(Ua);var Ga=function(t){(0,l.Z)(u,t);var e,n,r,i=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function u(){return(0,a.Z)(this,u),i.apply(this,arguments)}return(0,s.Z)(u,[{key:"initTileLayer",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.parent.getLayerAttributeConfig(),n=this.getLayerOptions(),r=this.getSourceOption(),i=new wn((0,g.Z)({},n)).source(r.data,r.options),e&&Object.keys(e).forEach((function(t){var n,r,o=t;i[o](null===(n=e[o])||void 0===n?void 0:n.field,null===(r=e[o])||void 0===r?void 0:r.values)})),t.next=7,this.addLayer(i);case 7:this.isLoaded=!0;case 8:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getFeatures",value:function(t){return t?this.sourceTile.data.getTileData(t):[]}},{key:"getSourceOption",value:function(){var t=this.parent.getSource(),e=this.parent.getLayerConfig(),n=e.sourceLayer,r=e.featureId;return{data:{type:"FeatureCollection",features:this.getFeatures(n)},options:{parser:{type:"geojson",featureId:r},transforms:t.transforms}}}}]),u}(Ua),Ha=["rasterData"];var Wa=function(t){(0,l.Z)(u,t);var e,n,r,i=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function u(){return(0,a.Z)(this,u),i.apply(this,arguments)}return(0,s.Z)(u,[{key:"initTileLayer",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.parent.getLayerAttributeConfig(),n=this.getLayerOptions(),r=this.getSourceOption(),i=new mn((0,g.Z)({},n)).source(r.data,r.options),e&&Object.keys(e).forEach((function(t){var n,r,o=t;i[o](null===(n=e[o])||void 0===n?void 0:n.field,null===(r=e[o])||void 0===r?void 0:r.values)})),t.next=7,this.addLayer(i);case 7:this.isLoaded=!0;case 8:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getSourceOption",value:function(){var t=this.parent.getSource(),e=this.sourceTile.data.data,n=e.rasterData,r=(0,m.Z)(e,Ha);return{data:n,options:{parser:(0,g.Z)({type:"rasterRgb",extent:this.sourceTile.bounds},r),transforms:t.transforms}}}}]),u}(Ua);var qa=function(t){(0,l.Z)(u,t);var e,n,r,i=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function u(){return(0,a.Z)(this,u),i.apply(this,arguments)}return(0,s.Z)(u,[{key:"initTileLayer",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.parent.getLayerAttributeConfig(),n=this.getLayerOptions(),r=this.getSourceOption(),i=new mn((0,g.Z)({},n)).source(r.data,r.options),e&&Object.keys(e).forEach((function(t){var n,r,o=t;i[o](null===(n=e[o])||void 0===n?void 0:n.field,null===(r=e[o])||void 0===r?void 0:r.values)})),t.next=7,this.addLayer(i);case 7:this.isLoaded=!0;case 8:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getSourceOption",value:function(){var t=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:t.transforms}}}}]),u}(Ua),Ya=["rasterData"];var Xa={positions:[0,1],colors:["#000","#fff"]},$a=function(t){(0,l.Z)(u,t);var e,n,r,i=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function u(){return(0,a.Z)(this,u),i.apply(this,arguments)}return(0,s.Z)(u,[{key:"initTileLayer",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o,a,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.parent.getLayerAttributeConfig(),n=this.getLayerOptions(),r=this.getSourceOption(),i=this.getLayerOptions(),o=i.rampColors,a=i.domain,this.colorTexture=this.parent.textureService.getColorTexture(o,a),s=new mn((0,g.Z)((0,g.Z)({},n),{},{colorTexture:this.colorTexture})).source(r.data,r.options),e&&Object.keys(e).forEach((function(t){var n,r,i=t;s[i](null===(n=e[i])||void 0===n?void 0:n.field,null===(r=e[i])||void 0===r?void 0:r.values)})),t.next=9,this.addLayer(s);case 9:this.isLoaded=!0;case 10:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getSourceOption",value:function(){var t=this.parent.getSource(),e=this.sourceTile.data.data,n=e.rasterData,r=(0,m.Z)(e,Ya);return{data:n,options:{parser:(0,g.Z)({type:"raster",extent:this.sourceTile.bounds},r),transforms:t.transforms}}}},{key:"styleUpdate",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n,o=i.rampColors,a=void 0===o?Xa:o,s=i.domain;this.colorTexture=this.parent.textureService.getColorTexture(a,s||(0,x.getDefaultDomain)(a)),this.layers.forEach((function(e){return e.style({colorTexture:t.colorTexture})}))}},{key:"destroy",value:function(){this.layers.forEach((function(t){return t.destroy()}))}}]),u}(Ua);var Ka=function(t){(0,l.Z)(u,t);var e,n,r,i=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,h.Z)(n);if(r){var i=(0,h.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,c.Z)(this,t)});function u(){return(0,a.Z)(this,u),i.apply(this,arguments)}return(0,s.Z)(u,[{key:"initTileLayer",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r,i,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.parent.getLayerAttributeConfig(),n=this.getLayerOptions(),a=this.parent.type,r="PolygonLayer"===a?ln:"LineLayer"===a?Ce:rn,i=this.getSourceOption()){t.next=7;break}return this.isLoaded=!0,t.abrupt("return");case 7:return o=new r((0,g.Z)({},n)).source(i.data,i.options),Object.keys(e).forEach((function(t){var n,r,i=t;o[i](null===(n=e[i])||void 0===n?void 0:n.field,null===(r=e[i])||void 0===r?void 0:r.values)})),t.next=11,this.addLayer(o);case 11:if(!n.tileMask){t.next=14;break}return t.next=14,this.addTileMask();case 14:this.setLayerMinMaxZoom(o),this.isLoaded=!0;case 16:case"end":return t.stop()}var a}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getSourceOption",value:function(){var t=this.parent.getSource(),e=this.parent.getLayerConfig(),n=e.sourceLayer,r=void 0===n?"defaultLayer":n,i=e.featureId,o=void 0===i?"id":i;return{data:{type:"FeatureCollection",features:this.getFeatures(r)},options:{parser:{type:"geojson",featureId:o},transforms:t.transforms}}}},{key:"setLayerMinMaxZoom",value:function(t){"text"===t.getModelType()&&t.updateLayerConfig({maxZoom:this.z+1,minZoom:this.z-1})}},{key:"getFeatures",value:function(t){return this.sourceTile.data.getTileData(t)}},{key:"getFeatureById",value:function(t){var e=this.getMainLayer();return e?e.getSource().data.dataArray.filter((function(e){return e._id===t})):[]}}]),u}(Ua);function Ja(t){switch(t.type){case"PolygonLayer":case"LineLayer":case"PointLayer":return Ka;case"TileDebugLayer":return Za;case"MaskLayer":return Ga;case"RasterLayer":switch(t.getSource().parser.dataType){case i.RasterTileType.RGB:case i.RasterTileType.CUSTOMRGB:return Wa;case i.RasterTileType.ARRAYBUFFER:case i.RasterTileType.CUSTOMARRAYBUFFER:return $a;case i.RasterTileType.TERRAINRGB:case i.RasterTileType.CUSTOMTERRAINRGB:return qa;default:return Va}default:return Ka}}var Qa,ts,es,ns,rs,is,os,as,ss,us,ls,cs,hs,ps,fs,ds,ms,gs,ys,vs=function(){function t(e){var n=this;(0,a.Z)(this,t),(0,p.Z)(this,"initedTileset",!1),(0,p.Z)(this,"mapchange",(function(){var t,e=n.getCurrentView(),r=e.latLonBounds,i=e.zoom;if("GAODE1.x"===n.mapService.version){var o=n.parent.getLayerConfig().visible;i<2&&o?(n.parent.updateLayerConfig({visible:!1}),n.layerService.reRender()):i>=2&&!o&&(n.parent.updateLayerConfig({visible:!0}),n.layerService.reRender())}n.lastViewStates&&n.lastViewStates.zoom===i&&n.lastViewStates.latLonBounds.toString()===r.toString()||(n.lastViewStates={zoom:i,latLonBounds:r},null===(t=n.tilesetManager)||void 0===t||t.throttleUpdate(i,r))})),(0,p.Z)(this,"viewchange",(0,S.debounce)(this.mapchange,24)),this.parent=e;var r=this.parent.getContainer();this.rendererService=r.get(i.TYPES.IRendererService),this.layerService=r.get(i.TYPES.ILayerService),this.mapService=r.get(i.TYPES.IMapService),this.pickingService=r.get(i.TYPES.IPickingService),this.tileLayerService=new Ia({rendererService:this.rendererService,layerService:this.layerService,parent:e}),this.tilePickService=new Ba({tileLayerService:this.tileLayerService,layerService:this.layerService,parent:e}),this.parent.setLayerPickService(this.tilePickService),this.proxy(e),this.initTileSetManager()}var e;return(0,s.Z)(t,[{key:"initTileSetManager",value:function(){var t,e=this.parent.getSource();this.tilesetManager=e.tileset,this.initedTileset||(this.bindTilesetEvent(),this.initedTileset=!0);var n=this.getCurrentView(),r=n.latLonBounds,i=n.zoom;null===(t=this.tilesetManager)||void 0===t||t.update(i,r)}},{key:"getCurrentView",value:function(){var t=this.mapService.getBounds();return{latLonBounds:[t[0][0],t[0][1],t[1][0],t[1][1]],zoom:this.mapService.getZoom()}}},{key:"bindTilesetEvent",value:function(){var t=this;this.tilesetManager.on("tile-loaded",(function(t){})),this.tilesetManager.on("tile-unload",(function(e){t.tileUnLoad(e)})),this.tilesetManager.on("tile-error",(function(e,n){t.tileError(e)})),this.tilesetManager.on("tile-update",(function(){t.tileUpdate()})),this.mapService.on("zoomend",this.mapchange),this.mapService.on("moveend",this.viewchange)}},{key:"render",value:function(){this.tileLayerService.render()}},{key:"getLayers",value:function(){return this.tileLayerService.getLayers()}},{key:"getTiles",value:function(){return this.tileLayerService.getTiles()}},{key:"getTile",value:function(t){return this.tileLayerService.getTile(t)}},{key:"tileLoaded",value:function(t){}},{key:"tileError",value:function(t){console.warn("error:",t)}},{key:"destroy",value:function(){var t;this.mapService.off("zoomend",this.mapchange),this.mapService.off("moveend",this.viewchange),null===(t=this.tilesetManager)||void 0===t||t.destroy(),this.tileLayerService.destroy()}},{key:"reload",value:function(){var t;this.tilesetManager.clear();var e=this.getCurrentView(),n=e.latLonBounds,r=e.zoom;null===(t=this.tilesetManager)||void 0===t||t.update(r,n)}},{key:"tileUnLoad",value:function(t){this.tileLayerService.removeTile(t.key)}},{key:"tileUpdate",value:(e=(0,o.Z)(d().mark((function t(){var e,n,r=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.tilesetManager){t.next=2;break}return t.abrupt("return");case 2:return e=this.parent.getMinZoom(),n=this.parent.getMaxZoom(),t.next=6,Promise.all(this.tilesetManager.tiles.filter((function(t){return t.isLoaded})).filter((function(t){return t.isVisibleChange})).filter((function(t){return t.data})).filter((function(t){return t.z>=e&&t.z<n})).map(function(){var t=(0,o.Z)(d().mark((function t(e){var n,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.tileLayerService.hasTile(e.key)){t.next=9;break}return n=Ja(r.parent),i=new n(e,r.parent),t.next=5,i.initTileLayer();case 5:r.tilePickService.setPickState(),0!==i.getLayers().length&&(r.tileLayerService.addTile(i),r.tileLayerService.updateTileVisible(e),r.layerService.reRender()),t.next=12;break;case 9:r.tileLayerService.updateTileVisible(e),r.tilePickService.setPickState(),r.layerService.reRender();case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:this.tilesetManager.isLoaded&&this.parent.emit("tiles-loaded",this.tilesetManager.currentTiles);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"setPickState",value:function(t){}},{key:"pickRender",value:function(t){this.tilePickService.pickRender(t)}},{key:"selectFeature",value:function(t){this.tilePickService.selectFeature(t)}},{key:"highlightPickedFeature",value:function(t){this.tilePickService.highlightPickedFeature(t)}},{key:"proxy",value:function(t){var e=this;ja.forEach((function(n){var r=t[n].bind(t);t[n]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r.apply(void 0,o),e.getLayers().map((function(t){t[n].apply(t,o)})),"style"===n&&e.getTiles().forEach((function(t){return t.styleUpdate.apply(t,o)})),t}}))}}]),t}(),_s=(0,ae.b2)()(Qa=function(){function t(){(0,a.Z)(this,t)}var e,n,r;return(0,s.Z)(t,[{key:"build",value:(r=(0,o.Z)(d().mark((function t(e){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.prepareBuildModel(),t.next=3,e.buildModels();case 3:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"initLayerModel",value:(n=(0,o.Z)(d().mark((function t(e){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.build(e);case 2:e.styleNeedUpdate=!1;case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"prepareLayerModel",value:(e=(0,o.Z)(d().mark((function t(e){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.build(e);case 2:e.styleNeedUpdate=!1;case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"apply",value:function(t){var e=this;t.hooks.init.tapPromise("LayerModelPlugin",(0,o.Z)(d().mark((function n(){return d().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t.getSource().isTile){n.next=4;break}return t.prepareBuildModel(),t.tileLayer=new vs(t),n.abrupt("return");case 4:return t.log(i.IDebugLog.BuildModelStart,i.ILayerStage.INIT),n.next=7,e.initLayerModel(t);case 7:t.log(i.IDebugLog.BuildModelEnd,i.ILayerStage.INIT);case 8:case"end":return n.stop()}}),n)})))),t.hooks.beforeRenderData.tapPromise("LayerModelPlugin",function(){var n=(0,o.Z)(d().mark((function n(r){return d().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r){n.next=2;break}return n.abrupt("return",!1);case 2:if(!t.getSource().isTile){n.next=5;break}return t.tileLayer=new vs(t),n.abrupt("return",!1);case 5:return t.log(i.IDebugLog.BuildModelStart,i.ILayerStage.UPDATE),n.next=8,e.prepareLayerModel(t);case 8:return t.log(i.IDebugLog.BuildModelEnd,i.ILayerStage.UPDATE),n.abrupt("return",!0);case 10:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}()),t.hooks.beforeRender.tap("LayerModelPlugin",(function(){t.styleNeedUpdate&&e.prepareLayerModel(t).then((function(){t.styleNeedUpdate=!1,t.renderLayers()})),t.styleNeedUpdate=!1}))}}]),t}())||Qa,bs=(0,ae.b2)()(ts=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t){t.hooks.afterInit.tap("LayerStylePlugin",(function(){var e=t.getLayerConfig(),n=e.autoFit,r=e.fitBoundsOptions;n&&t.fitBounds(r)}))}}]),t}())||ts,xs=["type"],ws={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},Ss={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},Es={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},Ms={position:[0,0,0],direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],constant:1,linear:0,quadratic:0,angle:14,exponent:40,blur:5},Ts=(0,ae.b2)()(es=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("LightingPlugin",(function(){t.getLayerConfig().enableLighting&&t.models.forEach((function(t){return t.addUniforms((0,g.Z)({},(n={u_DirectionalLights:new Array(3).fill((0,g.Z)({},Es)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill((0,g.Z)({},Ms)),u_NumOfSpotLights:0},e&&e.length||(e=[Ss]),e.forEach((function(t){var e=t.type,r=void 0===e?"directional":e,i=(0,m.Z)(t,xs),o=ws[r].lights,a=ws[r].num,s=n[a];n[o][s]=(0,g.Z)((0,g.Z)({},n[o][s]),i),n[a]++})),n)));var e,n}))}))}}]),t}())||es,As=(0,ae.b2)()(ns=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t,e){var n=this,r=e.rendererService,i=e.postProcessingPassFactory,o=e.normalPassFactory;t.hooks.init.tapPromise("MultiPassRendererPlugin",(function(){var e=t.getLayerConfig(),r=e.enableMultiPassRenderer,a=e.passes,s=void 0===a?[]:a;n.enabled=!!r&&!1!==t.getLayerConfig().enableMultiPassRenderer,n.enabled&&(t.multiPassRenderer=O(t,s,i,o),t.multiPassRenderer.setRenderFlag(!0))})),t.hooks.beforeRender.tap("MultiPassRendererPlugin",(function(){if(n.enabled){var e=r.getViewportSize(),i=e.width,o=e.height;t.multiPassRenderer.resize(i,o)}}))}}]),t}())||ns,Cs=(0,ae.b2)()(rs=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t,e){var n=e.styleAttributeService;t.hooks.init.tapPromise("PixelPickingPlugin",(function(){var e=t.getLayerConfig().enablePicking;n.registerStyleAttribute({name:"pickingColor",type:i.AttributeType.Attribute,descriptor:{name:"a_PickingColor",buffer:{data:[],type:i.gl.FLOAT},size:3,update:function(t){var n=t.id;return e?(0,x.encodePickingColor)(n):[0,0,0]}}})})),t.hooks.beforePickingEncode.tap("PixelPickingPlugin",(function(){t.getLayerConfig().enablePicking&&t.isVisible()&&t.models.forEach((function(t){return t.addUniforms({u_PickingStage:1})}))})),t.hooks.afterPickingEncode.tap("PixelPickingPlugin",(function(){t.getLayerConfig().enablePicking&&t.isVisible()&&t.models.forEach((function(t){return t.addUniforms({u_PickingStage:2})}))})),t.hooks.beforeHighlight.tap("PixelPickingPlugin",(function(e){var n=t.getLayerConfig(),r=n.highlightColor,i=n.activeMix,o=void 0===i?0:i,a="string"==typeof r?(0,x.rgb2arr)(r):r||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:(0,x.decodePickingColor)(new Uint8Array(e))}),t.models.forEach((function(t){return t.addUniforms({u_PickingStage:2,u_PickingColor:e,u_HighlightColor:a.map((function(t){return 255*t})),u_activeMix:o})}))})),t.hooks.beforeSelect.tap("PixelPickingPlugin",(function(e){var n=t.getLayerConfig(),r=n.selectColor,i=n.selectMix,o=void 0===i?0:i,a="string"==typeof r?(0,x.rgb2arr)(r):r||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:(0,x.decodePickingColor)(new Uint8Array(e))}),t.models.forEach((function(t){return t.addUniforms({u_PickingStage:2,u_PickingColor:e,u_HighlightColor:a.map((function(t){return 255*t})),u_activeMix:o,u_CurrentSelectedId:e,u_SelectColor:a.map((function(t){return 255*t})),u_EnableSelect:1})}))}))}}]),t}())||rs,Os=["mvt","geojsonvt","testTile"],Ps=(0,ae.b2)()(is=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t,e){var n=this,r=e.styleAttributeService;t.hooks.init.tapPromise("RegisterStyleAttributePlugin",(function(){(function(t){var e=t.getSource();return Os.includes(e.parser.type)})(t)||n.registerBuiltinAttributes(r,t)}))}},{key:"registerBuiltinAttributes",value:function(t,e){"MaskLayer"!==e.type?(this.registerPositionAttribute(t),this.registerColorAttribute(t),this.registerVertexIdAttribute(t)):this.registerPositionAttribute(t)}},{key:"registerPositionAttribute",value:function(t){t.registerStyleAttribute({name:"position",type:i.AttributeType.Attribute,descriptor:{name:"a_Position",buffer:{data:[],type:i.gl.FLOAT},size:3,update:function(t,e,n){return 2===n.length?[n[0],n[1],0]:[n[0],n[1],n[2]]}}})}},{key:"registerFilterAttribute",value:function(t){t.registerStyleAttribute({name:"filter",type:i.AttributeType.Attribute,descriptor:{name:"filter",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t){return t.filter?[1]:[0]}}})}},{key:"registerColorAttribute",value:function(t){t.registerStyleAttribute({name:"color",type:i.AttributeType.Attribute,descriptor:{name:"a_Color",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:4,update:function(t){var e=t.color;return e&&e.length?e:[1,1,1,1]}}})}},{key:"registerVertexIdAttribute",value:function(t){t.registerStyleAttribute({name:"vertexId",type:i.AttributeType.Attribute,descriptor:{name:"a_vertexId",buffer:{usage:i.gl.DYNAMIC_DRAW,data:[],type:i.gl.FLOAT},size:1,update:function(t,e){return[e]}}})}}]),t}())||is,ks=(os=(0,ae.b2)(),as=(0,ae.f3)(i.TYPES.ICameraService),ss=(0,ae.f3)(i.TYPES.ICoordinateSystemService),us=(0,ae.f3)(i.TYPES.IRendererService),ls=(0,ae.f3)(i.TYPES.IMapService),os((hs=function(){function t(){(0,a.Z)(this,t),(0,y.Z)(this,"cameraService",ps,this),(0,y.Z)(this,"coordinateSystemService",fs,this),(0,y.Z)(this,"rendererService",ds,this),(0,y.Z)(this,"mapService",ms,this)}return(0,s.Z)(t,[{key:"apply",value:function(t){var e=this,n=this.mapService.version,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o=[0,0];t.hooks.beforeRender.tap("ShaderUniformPlugin",(function(){var a=t.getLayerConfig().tileOrigin;e.coordinateSystemService.refresh(a),"GAODE2.x"===n&&(e.setLayerCenter(t),r=e.mapService.map.customCoords.getMVPMatrix(),o=e.mapService.getCustomCoordCenter());var s=e.rendererService.getViewportSize(),u=s.width,l=s.height;t.models.forEach((function(n){var a;n.addUniforms((a={},(0,p.Z)(a,i.CameraUniform.ProjectionMatrix,e.cameraService.getProjectionMatrix()),(0,p.Z)(a,i.CameraUniform.ViewMatrix,e.cameraService.getViewMatrix()),(0,p.Z)(a,i.CameraUniform.ViewProjectionMatrix,e.cameraService.getViewProjectionMatrix()),(0,p.Z)(a,i.CameraUniform.Zoom,e.cameraService.getZoom()),(0,p.Z)(a,i.CameraUniform.ZoomScale,e.cameraService.getZoomScale()),(0,p.Z)(a,i.CameraUniform.FocalDistance,e.cameraService.getFocalDistance()),(0,p.Z)(a,i.CameraUniform.CameraPosition,e.cameraService.getCameraPosition()),(0,p.Z)(a,i.CoordinateUniform.CoordinateSystem,e.coordinateSystemService.getCoordinateSystem()),(0,p.Z)(a,i.CoordinateUniform.ViewportCenter,e.coordinateSystemService.getViewportCenter()),(0,p.Z)(a,i.CoordinateUniform.ViewportCenterProjection,e.coordinateSystemService.getViewportCenterProjection()),(0,p.Z)(a,i.CoordinateUniform.PixelsPerDegree,e.coordinateSystemService.getPixelsPerDegree()),(0,p.Z)(a,i.CoordinateUniform.PixelsPerDegree2,e.coordinateSystemService.getPixelsPerDegree2()),(0,p.Z)(a,i.CoordinateUniform.PixelsPerMeter,e.coordinateSystemService.getPixelsPerMeter()),(0,p.Z)(a,i.CoordinateUniform.Mvp,r),(0,p.Z)(a,"u_sceneCenterMercator",o),(0,p.Z)(a,"u_ViewportSize",[u,l]),(0,p.Z)(a,"u_ModelMatrix",e.cameraService.getModelMatrix()),(0,p.Z)(a,"u_DevicePixelRatio",x.$window.devicePixelRatio),(0,p.Z)(a,"u_PickingBuffer",t.getLayerConfig().pickingBuffer||0),(0,p.Z)(a,"u_shaderPick",Number(t.getShaderPickStat())),a))}))}))}},{key:"setLayerCenter",value:function(t){void 0===t.coordCenter&&(t.coordCenter=t.getSource().center),this.mapService.setCoordCenter&&this.mapService.setCoordCenter(t.coordCenter)}}]),t}(),ps=(0,v.Z)(hs.prototype,"cameraService",[as],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fs=(0,v.Z)(hs.prototype,"coordinateSystemService",[ss],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ds=(0,v.Z)(hs.prototype,"rendererService",[us],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ms=(0,v.Z)(hs.prototype,"mapService",[ls],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cs=hs))||cs),Ls=(0,ae.b2)()(gs=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("UpdateModelPlugin",(function(){t.layerModel&&t.layerModel.needUpdate().then((function(e){e&&t.renderLayers()}))})),t.hooks.afterRender.tap("UpdateModelPlugin",(function(){t.layerModelNeedUpdate=!1}))}}]),t}())||gs,Is=(0,ae.b2)()(ys=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(t,e){var n=this,r=e.styleAttributeService;t.hooks.init.tapPromise("UpdateStyleAttributePlugin",(function(){n.initStyleAttribute(t,{styleAttributeService:r})})),t.hooks.beforeRender.tap("UpdateStyleAttributePlugin",(function(){t.layerModelNeedUpdate||t.inited&&n.updateStyleAttribute(t,{styleAttributeService:r})}))}},{key:"updateStyleAttribute",value:function(t,e){var n=e.styleAttributeService,r=n.getLayerStyleAttributes()||[],i=n.getLayerStyleAttribute("filter");if(i&&i.needRegenerateVertices)return t.layerModelNeedUpdate=!0,void r.forEach((function(t){return t.needRegenerateVertices=!1}));r.filter((function(t){return t.needRegenerateVertices})).forEach((function(e){n.updateAttributeByFeatureRange(e.name,t.getEncodedData(),e.featureRange.startIndex,e.featureRange.endIndex,t),e.needRegenerateVertices=!1}))}},{key:"initStyleAttribute",value:function(t,e){var n=e.styleAttributeService;(n.getLayerStyleAttributes()||[]).filter((function(t){return t.needRegenerateVertices})).forEach((function(e){n.updateAttributeByFeatureRange(e.name,t.getEncodedData(),e.featureRange.startIndex,e.featureRange.endIndex),e.needRegenerateVertices=!1}))}}]),t}())||ys;i.container.bind(i.TYPES.ILayerPlugin).to(Gn).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(Ps).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(Pa).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(Vn).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(bs).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(La).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(Is).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(Ls).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(As).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(ks).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(ka).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(Ts).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(Cs).inRequestScope(),i.container.bind(i.TYPES.ILayerPlugin).to(_s).inRequestScope()},1813:(t,e,n)=>{"use strict";n.r(e),n.d(e,{BaseMapService:()=>ur,BaseMapWrapper:()=>m,Earth:()=>dr,GaodeMap:()=>Bt,GaodeMapV1:()=>Lt,GaodeMapV2:()=>Bt,Map:()=>_r,Mapbox:()=>Ar,Version:()=>k.G,Viewport:()=>st});var r,i,o,a=n(3192),s=n(6838),u=n(6193),l=n(9097),c=n(6875),h=n(3659),p=n(6902),f=n(7677),d=n(108),m=(r=(0,d.lazyInject)(d.TYPES.IGlobalConfigService),i=function(){function t(e){(0,a.Z)(this,t),(0,p.Z)(this,"configService",o,this),this.config=e}return(0,s.Z)(t,[{key:"setContainer",value:function(t,e,n,r){t.bind(d.TYPES.MapConfig).toConstantValue((0,h.Z)((0,h.Z)({},this.config),{},{id:e,canvas:n,hasBaseMap:r})),t.bind(d.TYPES.IMapService).to(this.getServiceConstructor()).inSingletonScope()}},{key:"getServiceConstructor",value:function(){throw new Error("Method not implemented.")}}]),t}(),o=(0,f.Z)(i.prototype,"configService",[r],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),i),g=n(5162),y=n(5927),v=n(9908),_=n(2718),b=n(800),x=n(5161),w=n(6297),S=n(1109),E=n.n(S),M=n(2401),T=n(2329),A=n(7745),C=(n(171),n(5576)),O=n.n(C),P=n(5619),k=n(5895),L=function(){function t(e){(0,a.Z)(this,t),(0,w.Z)(this,"size",1e4),this.size=e||1e4}return(0,s.Z)(t,[{key:"setSize",value:function(t){this.size=t}},{key:"getSize",value:function(){return[this.size,this.size]}},{key:"mercatorXfromLng",value:function(t){return(180+t)/360*this.size}},{key:"mercatorYfromLat",value:function(t){return(1-(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360)*this.size}},{key:"lngFromMercatorX",value:function(t){return t/this.size*360-180}},{key:"latFromMercatorY",value:function(t){var e=180-360*(1-t/this.size);return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}},{key:"project",value:function(t){return[this.mercatorXfromLng(t[0]),this.mercatorYfromLat(t[1])]}},{key:"unproject",value:function(t){return[this.lngFromMercatorX(t[0]),this.latFromMercatorY(t[1])]}}]),t}();function I(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("number"==typeof t)return{top:t,right:t,bottom:t,left:t};if(Array.isArray(t)){if(4===t.length)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(2===t.length)return{top:t[0],right:t[1],bottom:t[0],left:t[1]}}return(0,h.Z)((0,h.Z)({},{top:0,right:0,bottom:0,left:0}),t)}var R=n(5512);function D(t,e){var n=R.fF([],e,t);return R.bA(n,n,1/n[3]),n}var N=n(9341);function F(t,e){if(!t)throw new Error(e||"viewport-mercator-project: assertion failed.")}var z=Math.PI,B=z/4,j=z/180,U=180/z,Z=4003e4;function V(t){return Math.pow(2,t)}function G(t,e){var n=(0,g.Z)(t,2),r=n[0],i=n[1];F(Number.isFinite(r)&&Number.isFinite(e)),F(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");var o=i*j;return[(e*=512)*(r*j+z)/(2*z),e*(z-Math.log(Math.tan(B+.5*o)))/(2*z)]}function H(t,e){var n=(0,g.Z)(t,2),r=n[0],i=n[1],o=r/(e*=512)*(2*z)-z,a=2*(Math.atan(Math.exp(z-i/e*(2*z)))-B);return[o*U,a*U]}function W(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(0,g.Z)(t,3),i=r[0],o=r[1],a=r[2];if(F(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a))return D(e,[i,o,a,1]);var s=D(e,[i,o,0,1]),u=D(e,[i,o,1,1]),l=s[2],c=u[2],h=l===c?0:((n||0)-l)/(c-l);return N.t7([],s,u,h)}var q=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function Y(t){var e=t.width,n=t.height,r=t.bounds,i=t.minExtent,o=void 0===i?0:i,a=t.maxZoom,s=void 0===a?24:a,u=t.padding,l=void 0===u?0:u,c=t.offset,h=void 0===c?[0,0]:c,p=(0,g.Z)(r,2),f=(0,g.Z)(p[0],2),d=f[0],m=f[1],y=(0,g.Z)(p[1],2),v=y[0],_=y[1];Number.isFinite(l)?l={top:l,bottom:l,left:l,right:l}:F(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var b=new at({width:e,height:n,longitude:0,latitude:0,zoom:0}),x=b.project([d,_]),w=b.project([v,m]),S=[Math.max(Math.abs(w[0]-x[0]),o),Math.max(Math.abs(w[1]-x[1]),o)],E=[e-l.left-l.right-2*Math.abs(h[0]),n-l.top-l.bottom-2*Math.abs(h[1])];F(E[0]>0&&E[1]>0);var M=E[0]/S[0],T=E[1]/S[1],A=(l.right-l.left)/2/M,C=(l.bottom-l.top)/2/T,O=[(w[0]+x[0])/2+A,(w[1]+x[1])/2+C],P=b.unproject(O),k=b.zoom+Math.log2(Math.abs(Math.min(M,T)));return{longitude:P[0],latitude:P[1],zoom:Math.min(k,s)}}var X,$,K,J,Q,tt,et,nt,rt,it,ot,at=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,i=n.height,o=n.latitude,s=void 0===o?0:o,u=n.longitude,h=void 0===u?0:u,p=n.zoom,f=void 0===p?0:p,d=n.pitch,m=void 0===d?0:d,g=n.bearing,y=void 0===g?0:g,v=n.altitude,_=void 0===v?1.5:v,b=n.nearZMultiplier,w=n.farZMultiplier;(0,a.Z)(this,e),r=r||1,i=i||1;var S=V(f);_=Math.max(.75,_);var E=G([h,s],S);E[2]=0;var A=function(t){var e=t.width,n=t.height,r=t.pitch,i=function(t){var e=t.width,n=t.height,r=t.altitude,i=void 0===r?1.5:r,o=t.pitch,a=t.nearZMultiplier,s=void 0===a?1:a,u=t.farZMultiplier,l=void 0===u?1:u,c=(void 0===o?0:o)*j,h=Math.atan(.5/i),p=Math.sin(h)*i/Math.sin(Math.PI/2-c-h),f=Math.cos(Math.PI/2-c)*p+i;return{fov:2*Math.atan(n/2/i),aspect:e/n,focalDistance:i,near:s,far:f*l}}({width:e,height:n,altitude:t.altitude,pitch:r,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier}),o=i.fov,a=i.aspect,s=i.near,u=i.far;return M.perspective([],o,a,s,u)}({width:r,height:i,pitch:m,bearing:y,altitude:_,nearZMultiplier:b||1/i,farZMultiplier:w||1.01}),C=function(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.center,a=void 0===o?null:o,s=t.flipY,u=void 0!==s&&s,l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return M.translate(l,l,[0,0,-i]),M.scale(l,l,[1,1,1/e]),M.rotateX(l,l,-n*j),M.rotateZ(l,l,r*j),u&&M.scale(l,l,[1,-1,1]),a&&M.translate(l,l,T.negate([],a)),l}({height:i,center:E,pitch:m,bearing:y,altitude:_,flipY:!0});return(t=(0,l.Z)(this,(0,c.Z)(e).call(this,{width:r,height:i,viewMatrix:C,projectionMatrix:A}))).latitude=s,t.longitude=h,t.zoom=f,t.pitch=m,t.bearing=y,t.altitude=_,t.scale=S,t.center=E,t.pixelsPerMeter=function(t){var e=t.latitude,n=t.longitude,r=t.zoom,i=t.scale,o=t.highPrecision,a=void 0!==o&&o;i=void 0!==i?i:V(r),F(Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i));var s={},u=512*i,l=Math.cos(e*j),c=u/360,h=c/l,p=u/Z/l;if(s.pixelsPerMeter=[p,-p,p],s.metersPerPixel=[1/p,-1/p,1/p],s.pixelsPerDegree=[c,-h,p],s.degreesPerPixel=[1/c,-1/h,1/p],a){var f=j*Math.tan(e*j)/l,d=c*f/2,m=u/Z*f,g=m/h*p;s.pixelsPerDegree2=[0,-d,m],s.pixelsPerMeter2=[g,0,g]}return s}((0,x.Z)((0,x.Z)(t))).pixelsPerMeter[2],Object.freeze((0,x.Z)((0,x.Z)(t))),t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"projectFlat",value:function(t){return G(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"unprojectFlat",value:function(t){return H(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=W(t.pos,this.pixelUnprojectionMatrix),r=G(e,this.scale),i=N.IH([],r,N.tk([],n));return H(N.IH([],this.center,i),this.scale)}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=Y(Object.assign({width:r,height:i,bounds:t},n));return new e({width:r,height:i,longitude:o.longitude,latitude:o.latitude,zoom:o.zoom})}}]),e}(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,r=e.height,i=e.viewMatrix,o=void 0===i?q:i,s=e.projectionMatrix,u=void 0===s?q:s;(0,a.Z)(this,t),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];M.multiply(l,l,this.projectionMatrix),M.multiply(l,l,this.viewMatrix),this.viewProjectionMatrix=l;var c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];M.scale(c,c,[this.width/2,-this.height/2,1]),M.translate(c,c,[1,-1,0]),M.multiply(c,c,this.viewProjectionMatrix);var h=M.invert([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c);if(!h)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=c,this.pixelUnprojectionMatrix=h,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return(0,s.Z)(t,[{key:"equals",value:function(e){return e instanceof t&&e.width===this.width&&e.height===this.height&&M.equals(e.projectionMatrix,this.projectionMatrix)&&M.equals(e.viewMatrix,this.viewMatrix)}},{key:"project",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===e||e,r=function(t,e){var n=(0,g.Z)(t,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o;return F(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)),D(e,[r,i,a,1])}(this.projectPosition(t),this.pixelProjectionMatrix),i=(0,g.Z)(r,2),o=i[0],a=i[1],s=n?a:this.height-a;return 2===t.length?[o,s]:[o,s,r[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=e.targetZ,o=(0,g.Z)(t,3),a=o[0],s=o[1],u=o[2],l=r?s:this.height-s,c=i&&i*this.pixelsPerMeter,h=W([a,l,u],this.pixelUnprojectionMatrix,c),p=this.unprojectPosition(h),f=(0,g.Z)(p,3),d=f[0],m=f[1],y=f[2];return Number.isFinite(u)?[d,m,y]:Number.isFinite(i)?[d,m,i]:[d,m]}},{key:"projectPosition",value:function(t){var e=this.projectFlat(t),n=(0,g.Z)(e,2);return[n[0],n[1],(t[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(t){var e=this.unprojectFlat(t),n=(0,g.Z)(e,2);return[n[0],n[1],(t[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(t){return arguments.length>1&&void 0!==arguments[1]||this.scale,t}},{key:"unprojectFlat",value:function(t){return arguments.length>1&&void 0!==arguments[1]||this.scale,t}}]),t}()),st=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"syncWithMapCamera",value:function(t){var e=t.center,n=t.zoom,r=t.pitch,i=t.bearing,o=t.viewportHeight,a=t.viewportWidth,s=this.viewport?{width:this.viewport.width,height:this.viewport.height,longitude:this.viewport.center[0],latitude:this.viewport.center[1],zoom:this.viewport.zoom,pitch:this.viewport.pitch,bearing:this.viewport.bearing}:{};this.viewport=new at((0,h.Z)((0,h.Z)({},s),{},{width:a,height:o,longitude:e&&e[0],latitude:e&&e[1],zoom:n,pitch:r,bearing:i}))}},{key:"getZoom",value:function(){return this.viewport.zoom}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[this.viewport.longitude,this.viewport.latitude]}},{key:"getProjectionMatrix",value:function(){return this.viewport.projectionMatrix}},{key:"getModelMatrix",value:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},{key:"getViewMatrix",value:function(){return this.viewport.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.viewMatrixUncentered}},{key:"getViewProjectionMatrix",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(t,e){return this.viewport.projectFlat(t,e)}}]),t}(),ut={normal:"amap://styles/normal",light:"amap://styles/c422f5c0cfced5be9fe3a83f05f28a68?isPublic=true",dark:"amap://styles/c9f1d10cae34f8ab05e425462c5a58d7?isPublic=true",blank:"amap://styles/07c17002b38775b32a7a76c66cf90e99?isPublic=true",fresh:"amap://styles/fresh",grey:"amap://styles/grey",graffiti:"amap://styles/graffiti",macaron:"amap://styles/macaron",darkblue:"amap://styles/darkblue",wine:"amap://styles/wine"},lt=["id","style","minZoom","maxZoom","token","mapInstance","plugin"];!function(t,e){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(e||(e=document),e)){var i=e.head||e.getElementsByTagName("head")[0];if(!i){i=e.createElement("head");var o=e.body||e.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):e.documentElement.appendChild(i)}var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),i.appendChild(a)}}(".amap-logo{\n display: none !important;\n}\n");var ct={"GAODE1.x":{contextmenu:"rightclick"},"GAODE2.x":{contextmenu:"rightclick",camerachange:"viewchange"}},ht=0;window.forceWebGL=!0;var pt="15cd8a57710d40c9b7c0e3cc120f1200",ft=!1,dt=[],mt=(X=(0,A.b2)(),$=(0,A.f3)(d.TYPES.IGlobalConfigService),K=(0,A.f3)(d.TYPES.MapConfig),J=(0,A.f3)(d.TYPES.ICoordinateSystemService),Q=(0,A.f3)(d.TYPES.IEventEmitter),X((et=function(){function t(){var e=this;(0,a.Z)(this,t),(0,w.Z)(this,"version",k.G["GAODE1.x"]),(0,w.Z)(this,"simpleMapCoord",new L),(0,w.Z)(this,"bgColor","rgba(0, 0, 0, 0)"),(0,p.Z)(this,"configService",nt,this),(0,p.Z)(this,"config",rt,this),(0,p.Z)(this,"coordinateSystemService",it,this),(0,p.Z)(this,"eventEmitter",ot,this),(0,w.Z)(this,"handleCameraChanged",(function(t){var n=t.camera,r=n.fov,i=n.near,o=n.far,a=n.height,s=n.pitch,u=n.rotation,l=n.aspect,c=n.position,h=e.getCenter(),p=h.lng,f=h.lat;if(e.emit("mapchange"),e.cameraChangedCallback){e.viewport.syncWithMapCamera({aspect:l,bearing:360-u,far:o,fov:r,cameraHeight:a,near:i,pitch:s,zoom:e.map.getZoom()-1,center:[p,f],offsetOrigin:[c.x,c.y]});var m=e.config.offsetZoom,g=void 0===m?12:m;e.viewport.getZoom()>g?e.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.P20_OFFSET):e.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.P20),e.cameraChangedCallback(e.viewport)}}))}var e;return(0,s.Z)(t,[{key:"setBgColor",value:function(t){this.bgColor=t}},{key:"addMarkerContainer",value:function(){var t=this.map.getContainer();if(null!==t){var e=t.getElementsByClassName("amap-maps")[0];this.markerContainer=P.DOM.create("div","l7-marker-container",e)}}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"on",value:function(t,e){-1!==d.MapServiceEvent.indexOf(t)?this.eventEmitter.on(t,e):this.map.on(ct[this.version][t]||t,e)}},{key:"off",value:function(t,e){-1!==d.MapServiceEvent.indexOf(t)?this.eventEmitter.off(t,e):this.map.off(ct[this.version][t]||t,e)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"getMapCanvasContainer",value:function(){var t;return null===(t=this.map.getContainer())||void 0===t?void 0:t.getElementsByClassName("amap-maps")[0]}},{key:"getSize",value:function(){var t=this.map.getSize();return[t.getWidth(),t.getHeight()]}},{key:"getType",value:function(){return"amap"}},{key:"getZoom",value:function(){return this.map.getZoom()-1}},{key:"setZoom",value:function(t){return this.map.setZoom(t+1)}},{key:"getCenter",value:function(t){if(null!=t&&t.padding){var e=this.getCenter(),n=I(t.padding),r=this.lngLatToPixel([e.lng,e.lat]),i=[(n.right-n.left)/2,(n.bottom-n.top)/2];return this.pixelToLngLat([r.x-i[0],r.y-i[1]])}var o=this.map.getCenter();return{lng:o.getLng(),lat:o.getLat()}}},{key:"setCenter",value:function(t,e){if(null!=e&&e.padding){var n=I(e.padding),r=this.lngLatToPixel(t),i=[(n.right-n.left)/2,(n.bottom-n.top)/2],o=this.pixelToLngLat([r.x+i[0],r.y+i[1]]);this.map.setCenter([o.lng,o.lat])}else this.map.setCenter(t)}},{key:"getPitch",value:function(){return this.map.getPitch()}},{key:"getRotation",value:function(){return 360-this.map.getRotation()}},{key:"getBounds",value:function(){var t=this.map.getBounds().toBounds(),e=t.getNorthEast(),n=t.getSouthWest(),r=this.getCenter(),i=r.lng>e.getLng()||r.lng<n.getLng()?180-e.getLng():e.getLng();return[[r.lng<n.getLng()?n.getLng()-180:n.getLng(),n.getLat()],[i,e.getLat()]]}},{key:"getMinZoom",value:function(){return this.map.get("zooms")[0]-1}},{key:"getMaxZoom",value:function(){return this.map.get("zooms")[1]-1}},{key:"setRotation",value:function(t){return this.map.setRotation(t)}},{key:"setPitch",value:function(t){return this.map.setPitch(t)}},{key:"zoomIn",value:function(){this.map.zoomIn()}},{key:"zoomOut",value:function(){this.map.zoomOut()}},{key:"panTo",value:function(t){this.map.panTo(t)}},{key:"panBy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.map.panBy(t,e)}},{key:"fitBounds",value:function(t){this.map.setBounds(new AMap.Bounds([t[0][0],t[0][1],t[1][0],t[1][1]]))}},{key:"setZoomAndCenter",value:function(t,e){this.map.setZoomAndCenter(t+1,e)}},{key:"setMapStyle",value:function(t){this.map.setMapStyle(this.getMapStyleValue(t))}},{key:"setMapStatus",value:function(t){this.map.setStatus(t)}},{key:"getMapStyleConfig",value:function(){return ut}},{key:"getMapStyleValue",value:function(t){return this.getMapStyleConfig()[t]||t}},{key:"getMapStyle",value:function(){return this.map.getMapStyle()}},{key:"pixelToLngLat",value:function(t){var e=this.map.pixelToLngLat(new AMap.Pixel(t[0],t[1]));return{lng:e.getLng(),lat:e.getLat()}}},{key:"lngLatToPixel",value:function(t){var e=this.map.lnglatToPixel(new AMap.LngLat(t[0],t[1]));return{x:e.getX(),y:e.getY()}}},{key:"containerToLngLat",value:function(t){var e=new AMap.Pixel(t[0],t[1]),n=this.map.containerToLngLat(e);return{lng:null==n?void 0:n.getLng(),lat:null==n?void 0:n.getLat()}}},{key:"lngLatToContainer",value:function(t){var e=new AMap.LngLat(t[0],t[1]),n=this.map.lngLatToContainer(e);return{x:n.getX(),y:n.getY()}}},{key:"lngLatToCoord",value:function(t){var e=this.map.lngLatToGeodeticCoord(t);return[e.x,-e.y]}},{key:"lngLatToMercator",value:function(t,e){return{x:0,y:0,z:0}}},{key:"getModelMatrix",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=this.viewport.projectFlat(t),o=M.create();return M.translate(o,o,T.fromValues(i[0],i[1],e)),M.scale(o,o,T.fromValues(r[0],r[1],r[2])),M.rotateX(o,o,n[0]),M.rotateY(o,o,n[1]),M.rotateZ(o,o,n[2]),o}},{key:"init",value:(e=(0,b.Z)(E().mark((function t(){var e,n,r,i,o,a,s,u,l,c,p,f,d,m,g=this;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.config,n=e.id,r=e.style,i=void 0===r?"light":r,o=e.minZoom,a=void 0===o?0:o,s=e.maxZoom,u=void 0===s?18:s,l=e.token,c=void 0===l?pt:l,p=e.mapInstance,f=e.plugin,d=void 0===f?[]:f,m=(0,_.Z)(e,lt),t.next=3,new Promise((function(t){var e=function(){if(p)g.map=p,g.$mapContainer=g.map.getContainer(),setTimeout((function(){g.map.on("camerachange",g.handleCameraChanged),t()}),30);else{g.$mapContainer=g.creatMapContainer(n);var e=(0,h.Z)({mapStyle:g.getMapStyleValue(i),zooms:[a,u],viewMode:"3D"},m);e.zoom&&(e.zoom+=1);var r=new AMap.Map(g.$mapContainer,e);r.on("camerachange",g.handleCameraChanged),r.on("camerachange",(function(){setTimeout((function(){return g.handleAfterMapChange()}))})),g.map=r,setTimeout((function(){t()}),10)}};ft||p?ft&&window.AMap||p?e():dt.push(e):(c===pt&&console.warn("%c".concat(g.configService.getSceneWarninfo("MapToken"),"!"),"color: #873bf4;font-weigh:900;font-size: 16px;"),ft=!0,d.push("Map3D"),O().load({key:c,version:"1.4.15",plugins:d}).then((function(){e(),dt.length&&(dt.forEach((function(t){return t()})),dt=[])})).catch((function(t){throw new Error(t)})))}));case 3:this.viewport=new st;case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"meterToCoord",value:function(t,e){var n=AMap.GeometryUtil.distance((0,y.Z)(AMap.LngLat,(0,v.Z)(t)),(0,y.Z)(AMap.LngLat,(0,v.Z)(e))),r=this.lngLatToCoord(t),i=(0,g.Z)(r,2),o=i[0],a=i[1],s=this.lngLatToCoord(e),u=(0,g.Z)(s,2),l=u[0],c=u[1];return Math.sqrt(Math.pow(o-l,2)+Math.pow(a-c,2))/n}},{key:"updateView",value:function(t){}},{key:"getOverlayContainer",value:function(){}},{key:"exportMap",value:function(t){var e,n=null===(e=this.getContainer())||void 0===e?void 0:e.getElementsByClassName("amap-layer")[0];return"jpg"===t?null==n?void 0:n.toDataURL("image/jpeg"):null==n?void 0:n.toDataURL("image/png")}},{key:"emit",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).emit.apply(e,[t].concat(r))}},{key:"once",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).once.apply(e,[t].concat(r))}},{key:"destroy",value:function(){var t,e;null===(t=this.$mapContainer)||void 0===t||null===(e=t.parentNode)||void 0===e||e.removeChild(this.$mapContainer),delete window.initAMap;var n=document.getElementById("amap-script");n&&document.head.removeChild(n),this.map.destroy()}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"onCameraChanged",value:function(t){this.cameraChangedCallback=t}},{key:"handleAfterMapChange",value:function(){this.emit("mapAfterFrameChange")}},{key:"creatMapContainer",value:function(t){var e=t;"string"==typeof t&&(e=document.getElementById(t));var n=document.createElement("div");return n.style.cssText+="\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n ",n.id="l7_amap_div"+ht++,e.appendChild(n),n}}]),t}(),nt=(0,f.Z)(et.prototype,"configService",[$],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rt=(0,f.Z)(et.prototype,"config",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),it=(0,f.Z)(et.prototype,"coordinateSystemService",[J],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ot=(0,f.Z)(et.prototype,"eventEmitter",[Q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tt=et))||tt);if(!window)throw Error("AMap JSAPI can only be used in Browser.");var gt=function(t){return t.notload="notload",t.loading="loading",t.loaded="loaded",t.failed="failed",t}(gt||{}),yt={key:"",AMap:{version:"2.0",plugins:[]}},vt={AMap:gt.notload},_t=[],bt=function(t){if("function"==typeof t){if(vt.AMap===gt.loaded)return void t(window.AMap);_t.push(t)}},xt=function(){var t=(0,b.Z)(E().mark((function t(e){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){if(vt.AMap===gt.failed)n("");else if(vt.AMap===gt.notload){var r=e.key,i=e.version,o=e.plugins;if(!r)return void n("请填写key");window.AMap&&"lbs.amap.com"!==location.host&&n("禁止多种API加载方式混用"),yt.key=r,yt.AMap.version=i||yt.AMap.version,yt.AMap.plugins=o||yt.AMap.plugins,vt.AMap=gt.loading;var a=document.body||document.head;window._onAPILoaded=function(e){e?(vt.AMap=gt.failed,n(e)):(vt.AMap=gt.loaded,t(null))};var s=document.createElement("script");s.type="text/javascript",s.async=!1,s.src="https://webapi.amap.com/maps?callback=_onAPILoaded&v="+yt.AMap.version+"&key="+r+"&plugin="+yt.AMap.plugins.join(","),s.onerror=function(t){vt.AMap=gt.failed,n(t)},a.appendChild(s)}else if(vt.AMap===gt.loaded){if(e.key&&e.key!==yt.key)return void n("多个不一致的 key");if(e.version&&e.version!==yt.AMap.version)return void n("不允许多个版本 JSAPI 混用");var u=[];e.plugins&&e.plugins.forEach((function(t){-1===yt.AMap.plugins.indexOf(t)&&u.push(t)})),u.length&&window.AMap.plugin(u,(function(){t(window.AMap)}))}else{if(e.key&&e.key!==yt.key)return void n("多个不一致的 key");if(e.version&&e.version!==yt.AMap.version)return void n("不允许多个版本 JSAPI 混用");var l=[];e.plugins&&e.plugins.forEach((function(t){-1===yt.AMap.plugins.indexOf(t)&&l.push(t)})),bt((function(){l.length&&window.AMap.plugin(l,(function(){t(window.AMap)}))}))}})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();const wt={load:xt,reset:function(){delete window.AMap,yt={key:"",AMap:{version:"1.4.15",plugins:[]}},vt={AMap:gt.notload}}};var St,Et=Math.PI/180,Mt=function(){function t(){(0,a.Z)(this,t),(0,w.Z)(this,"projectionMatrix",M.create()),(0,w.Z)(this,"viewMatrix",M.create()),(0,w.Z)(this,"viewProjectionMatrix",M.create()),(0,w.Z)(this,"ViewProjectionMatrixUncentered",M.create()),(0,w.Z)(this,"viewUncenteredMatrix",M.create())}return(0,s.Z)(t,[{key:"syncWithMapCamera",value:function(t){var e=t.zoom,n=void 0===e?1:e,r=t.pitch,i=void 0===r?0:r,o=t.bearing,a=void 0===o?0:o,s=t.center,u=void 0===s?[0,0]:s,l=t.offsetOrigin,c=void 0===l?[0,0]:l,h=t.cameraHeight,p=void 0===h?1:h,f=t.aspect,d=void 0===f?1:f,m=t.near,g=void 0===m?.1:m,y=t.far,v=void 0===y?1e3:y,_=t.fov,b=void 0===_?0:_;this.zoom=n,this.center=u;var x=i*Et,w=(360-a)*Et;M.perspective(this.projectionMatrix,b,d,g,v);var S=T.fromValues(p*Math.sin(x)*Math.sin(w),-p*Math.sin(x)*Math.cos(w),p*Math.cos(x)),E=T.fromValues(-Math.cos(x)*Math.sin(w),Math.cos(x)*Math.cos(w),Math.sin(x));M.lookAt(this.viewMatrix,S,T.fromValues(0,0,0),E),this.viewUncenteredMatrix=M.clone(this.viewMatrix),M.translate(this.viewMatrix,this.viewMatrix,T.fromValues(-c[0],c[1],0)),M.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),M.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}},{key:"getZoom",value:function(){return this.zoom}},{key:"getZoomScale",value:function(){return 524288}},{key:"getCenter",value:function(){var t=(0,g.Z)(this.center,2);return[t[0],t[1]]}},{key:"getProjectionMatrix",value:function(){return this.projectionMatrix}},{key:"getModelMatrix",value:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},{key:"getViewMatrix",value:function(){return this.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewUncenteredMatrix}},{key:"getViewProjectionMatrix",value:function(){return this.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.ViewProjectionMatrixUncentered}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(t){var e=85.0511287798,n=Math.max(Math.min(e,t[1]),-e),r=256<<20,i=Math.PI/180,o=t[0]*i,a=n*i;return a=Math.log(Math.tan(Math.PI/4+a/2)),[o=r*(.5/Math.PI*o+.5)-215440491,a=-(r*(-.5/Math.PI*a+(i=.5))-106744817)]}}]),t}(),Tt=["id","style","minZoom","maxZoom","token","mapInstance","plugin"];window.forceWebGL=!0;var At="15cd8a57710d40c9b7c0e3cc120f1200",Ct=!1,Ot=[],Pt=(0,A.b2)()(St=function(t){(0,u.Z)(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,c.Z)(n);if(r){var i=(0,c.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,l.Z)(this,t)});function o(){var t;(0,a.Z)(this,o);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,w.Z)((0,x.Z)(t),"version",k.G["GAODE1.x"]),(0,w.Z)((0,x.Z)(t),"handleCameraChanged",(function(e){var n=e.camera,r=n.fov,i=n.near,o=n.far,a=n.height,s=n.pitch,u=n.rotation,l=n.aspect,c=n.position,h=t.getCenter(),p=h.lng,f=h.lat;if(t.emit("mapchange"),t.cameraChangedCallback){t.viewport.syncWithMapCamera({aspect:l,bearing:360-u,far:o,fov:r,cameraHeight:a,near:i,pitch:s,zoom:t.map.getZoom()-1,center:[p,f],offsetOrigin:[c.x,c.y]});var m=t.config.offsetZoom,g=void 0===m?12:m;t.viewport.getZoom()>g?t.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.P20_OFFSET):t.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.P20),t.cameraChangedCallback(t.viewport)}})),t}return(0,s.Z)(o,[{key:"getModelMatrix",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=this.viewport.projectFlat(t),o=M.create();return M.translate(o,o,T.fromValues(i[0],i[1],e)),M.scale(o,o,T.fromValues(r[0],r[1],r[2])),M.rotateX(o,o,n[0]),M.rotateY(o,o,n[1]),M.rotateZ(o,o,n[2]),o}},{key:"init",value:(e=(0,b.Z)(E().mark((function t(){var e,n,r,i,o,a,s,u,l,c,p,f,d,m,g=this;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.config,n=e.id,r=e.style,i=void 0===r?"light":r,o=e.minZoom,a=void 0===o?0:o,s=e.maxZoom,u=void 0===s?18:s,l=e.token,c=void 0===l?At:l,p=e.mapInstance,f=e.plugin,d=void 0===f?[]:f,m=(0,_.Z)(e,Tt),t.next=3,new Promise((function(t){var e=function(){if(p)g.map=p,g.$mapContainer=g.map.getContainer(),setTimeout((function(){g.map.on("camerachange",g.handleCameraChanged),t()}),30);else{g.$mapContainer=g.creatMapContainer(n);var e=(0,h.Z)({mapStyle:g.getMapStyleValue(i),zooms:[a,u],viewMode:"3D"},m);e.zoom&&(e.zoom+=1);var r=new AMap.Map(g.$mapContainer,e);r.on("camerachange",g.handleCameraChanged),r.on("camerachange",(function(){setTimeout((function(){return g.handleAfterMapChange()}))})),g.map=r,setTimeout((function(){t()}),10)}};Ct||p?Ct&&window.AMap||p?e():Ot.push(e):(c===At&&console.warn(g.configService.getSceneWarninfo("MapToken")),Ct=!0,d.push("Map3D"),wt.load({key:c,version:"1.4.15",plugins:d}).then((function(t){e(),Ot.length&&(Ot.forEach((function(t){return t()})),Ot=[])})).catch((function(t){throw new Error(t)})))}));case 3:this.viewport=new Mt;case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"meterToCoord",value:function(t,e){var n=AMap.GeometryUtil.distance((0,y.Z)(AMap.LngLat,(0,v.Z)(t)),(0,y.Z)(AMap.LngLat,(0,v.Z)(e))),r=this.lngLatToCoord(t),i=(0,g.Z)(r,2),o=i[0],a=i[1],s=this.lngLatToCoord(e),u=(0,g.Z)(s,2),l=u[0],c=u[1];return Math.sqrt(Math.pow(o-l,2)+Math.pow(a-c,2))/n}},{key:"updateView",value:function(t){}},{key:"getOverlayContainer",value:function(){}},{key:"exportMap",value:function(t){var e,n=null===(e=this.getContainer())||void 0===e?void 0:e.getElementsByClassName("amap-layer")[0];return"jpg"===t?null==n?void 0:n.toDataURL("image/jpeg"):null==n?void 0:n.toDataURL("image/png")}},{key:"onCameraChanged",value:function(t){this.cameraChangedCallback=t}}]),o}(mt))||St;var kt,Lt=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"getServiceConstructor",value:function(){return Pt}}]),i}(m),It=function(){function t(){(0,a.Z)(this,t),(0,w.Z)(this,"projectionMatrix",M.create()),(0,w.Z)(this,"viewMatrix",M.create()),(0,w.Z)(this,"viewProjectionMatrix",M.create()),(0,w.Z)(this,"ViewProjectionMatrixUncentered",M.create()),(0,w.Z)(this,"viewUncenteredMatrix",M.create())}return(0,s.Z)(t,[{key:"syncWithMapCamera",value:function(t){var e=t.zoom,n=void 0===e?1:e,r=t.center,i=void 0===r?[0,0]:r,o=t.offsetOrigin,a=void 0===o?[0,0]:o,s=t.cameraPosition,u=void 0===s?[0,0,0]:s,l=t.up,c=void 0===l?[0,1,0]:l,h=t.lookAt,p=void 0===h?[0,0,0]:h,f=t.aspect,d=void 0===f?1:f,m=t.near,g=void 0===m?.1:m,y=t.far,_=void 0===y?1e3:y,b=t.fov,x=void 0===b?45:b;this.zoom=n,this.center=i,M.perspective(this.projectionMatrix,x/180*Math.PI,d,g,_);var w=T.fromValues.apply(T,(0,v.Z)(u)),S=T.fromValues.apply(T,(0,v.Z)(p)),E=T.fromValues.apply(T,(0,v.Z)(c));M.lookAt(this.viewMatrix,w,S,E),this.viewUncenteredMatrix=M.clone(this.viewMatrix),M.translate(this.viewMatrix,this.viewMatrix,T.fromValues(-a[0],a[1],0)),M.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),M.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}},{key:"getZoom",value:function(){return this.zoom}},{key:"getZoomScale",value:function(){return 1048576}},{key:"getCenter",value:function(){var t=(0,g.Z)(this.center,2);return[t[0],t[1]]}},{key:"getProjectionMatrix",value:function(){return this.projectionMatrix}},{key:"getModelMatrix",value:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},{key:"getViewMatrix",value:function(){return this.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewUncenteredMatrix}},{key:"getViewProjectionMatrix",value:function(){return this.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.ViewProjectionMatrixUncentered}},{key:"getFocalDistance",value:function(){return 1.2}},{key:"projectFlat",value:function(t){var e=85.0511287798,n=Math.max(Math.min(e,t[1]),-e),r=256<<20,i=Math.PI/180,o=t[0]*i,a=n*i;return a=Math.log(Math.tan(Math.PI/4+a/2)),[o=r*(.5/Math.PI*o+.5)-215440491,a=-(r*(-.5/Math.PI*a+(i=.5))-106744817)]}}]),t}(),Rt=["id","style","minZoom","maxZoom","token","mapInstance","plugin","version"];!function(t,e){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(e||(e=document),e)){var i=e.head||e.getElementsByTagName("head")[0];if(!i){i=e.createElement("head");var o=e.body||e.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):e.documentElement.appendChild(i)}var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),i.appendChild(a)}}(".amap-logo{\n display: none !important;\n}\n");var Dt=[108.92361,34.54083];window.forceWebGL=!0;var Nt="ff533602d57df6f8ab3b0fea226ae52f",Ft=(0,A.b2)()(kt=function(t){(0,u.Z)(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,c.Z)(n);if(r){var i=(0,c.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,l.Z)(this,t)});function o(){var t;(0,a.Z)(this,o);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,w.Z)((0,x.Z)(t),"version",k.G["GAODE2.x"]),(0,w.Z)((0,x.Z)(t),"handleViewChanged",(function(e){var n=t.map.customCoords.getCameraParams(),r=n.fov,i=n.near,o=n.far,a=n.aspect,s=n.position,u=n.lookAt,l=n.up;t.emit("mapchange");var c=t.map.customCoords.getCenter();t.cameraChangedCallback&&(t.viewport.syncWithMapCamera({aspect:a,far:o,fov:r,cameraPosition:s,lookAt:u,up:l,near:i,zoom:t.map.getZoom()-1,center:c,offsetOrigin:[s[0],s[1]]}),t.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.P20_2),t.cameraChangedCallback(t.viewport))})),t}return(0,s.Z)(o,[{key:"setCustomCoordCenter",value:function(t){this.sceneCenter=t,this.sceneCenterMercator=P.amap2Project.apply(void 0,(0,v.Z)(t))}},{key:"getCustomCoordCenter",value:function(){return this.sceneCenterMercator}},{key:"lngLatToCoordByLayer",value:function(t,e){var n=e||this.sceneCenterMercator,r=this._sub((0,P.amap2Project)(t[0],t[1]),n);return t[2]&&r.push(t[2]),r}},{key:"coordToAMap2RelativeCoordinates",value:function(t,e){var n=this,r=(0,P.amap2Project)(e[0],e[1]);return"number"==typeof t[0]?this.lngLatToCoordByLayer(t,r):t.map((function(t){return Array.isArray(t)&&"number"==typeof t[0]?n.lngLatToCoordByLayer(t,r):t.map((function(t){return n.lngLatToCoordByLayer(t,r)}))}))}},{key:"setCoordCenter",value:function(t){this.map.customCoords.setCenter(t||Dt),this.setCustomCoordCenter(t||Dt)}},{key:"lngLatToCoord",value:function(t){return this.sceneCenter||(this.map.customCoords.setCenter(t),this.setCustomCoordCenter(t)),this._sub((0,P.amap2Project)(t[0],t[1]),this.sceneCenterMercator)}},{key:"lngLatToCoords",value:function(t){var e=this;return t.map((function(t){return"number"==typeof t[0]?e.lngLatToCoord(t):t.map((function(t){return e.lngLatToCoord(t)}))}))}},{key:"addMarkerContainer",value:function(){if(this.map){var t=this.map.getContainer();if(null!==t){var e=t.getElementsByClassName("amap-maps")[0];e.style.zIndex="auto",this.markerContainer=P.DOM.create("div","l7-marker-container2",e)}}}},{key:"updateView",value:function(t){}},{key:"getOverlayContainer",value:function(){}},{key:"getType",value:function(){return"amap2"}},{key:"getBounds",value:function(){var t=this.map.getBounds(),e=t.getNorthEast(),n=t.getSouthWest(),r=this.getCenter(),i=r.lng>e.getLng()||r.lng<n.getLng()?180-e.getLng():e.getLng();return[[r.lng<n.getLng()?n.getLng()-180:n.getLng(),n.getLat()],[i,e.getLat()]]}},{key:"getMinZoom",value:function(){return this.map.getZooms()[0]-1}},{key:"getMaxZoom",value:function(){return this.map.getZooms()[1]-1}},{key:"lngLatToContainer",value:function(t){var e=this.map.lngLatToContainer(t);return{x:e.getX(),y:e.getY()}}},{key:"lngLatToPixel",value:function(t){var e=this.map.lngLatToPixel(new AMap.LngLat(t[0],t[1]));return{x:e.getX(),y:e.getY()}}},{key:"getModelMatrix",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=this.map.customCoords.lngLatToCoord(t),o=M.create();return M.translate(o,o,T.fromValues(i[0],i[1],e)),M.scale(o,o,T.fromValues(r[0],r[1],r[2])),M.rotateX(o,o,n[0]),M.rotateY(o,o,n[1]),M.rotateZ(o,o,n[2]),o}},{key:"init",value:(e=(0,b.Z)(E().mark((function t(){var e,n,r,i,o,a,s,u,l,c,p,f,d,m,g,y,v,b,x,w;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.config,n=e.id,r=e.style,i=void 0===r?"light":r,o=e.minZoom,a=void 0===o?0:o,s=e.maxZoom,u=void 0===s?18:s,l=e.token,c=void 0===l?Nt:l,p=e.mapInstance,f=e.plugin,d=void 0===f?[]:f,e.version,m=(0,_.Z)(e,Rt),this.viewport=new It,window.AMap||p){t.next=6;break}return d.push("Map3D"),t.next=6,O().load({key:c,version:"2.0",plugins:d});case 6:p?(this.map=p,this.$mapContainer=this.map.getContainer(),y=this.map.getCenter(),null===(g=this.map.customCoords)||void 0===g||g.setCenter([y.lng,y.lat]),this.setCustomCoordCenter([y.lng,y.lat]),this.map.on("viewchange",this.handleViewChanged)):(this.$mapContainer=this.creatMapContainer(n),(b=(0,h.Z)({mapStyle:this.getMapStyleValue(i),zooms:[a,u],viewMode:"3D"},m)).zoom&&(b.zoom+=1),c===Nt&&console.warn("%c".concat(this.configService.getSceneWarninfo("MapToken"),"!"),"color: #873bf4;font-weigh:900;font-size: 16px;"),x=new AMap.Map(this.$mapContainer,b),this.map=x,w=x.getCenter(),null===(v=this.map.customCoords)||void 0===v||v.setCenter([w.lng,w.lat]),this.setCustomCoordCenter([w.lng,w.lat]),x.on("viewchange",this.handleViewChanged)),this.initViewPort();case 8:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"onCameraChanged",value:function(t){this.cameraChangedCallback=t}},{key:"initViewPort",value:function(){var t,e=null===(t=this.map.customCoords)||void 0===t?void 0:t.getCameraParams(),n=e.fov,r=e.near,i=e.far,o=e.aspect,a=e.position,s=e.lookAt,u=e.up;this.emit("mapchange");var l=this.map.customCoords.getCenter(),c=this.map.getZoom();this.cameraChangedCallback&&(this.viewport.syncWithMapCamera({aspect:o,far:i,fov:n,cameraPosition:a,lookAt:s,near:r,up:u,zoom:c-1,center:l,offsetOrigin:[a[0],a[1]]}),this.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.P20_2),this.cameraChangedCallback(this.viewport))}},{key:"_sub",value:function(t,e){var n=[0,0];return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n}}]),o}(mt))||kt;var zt,Bt=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"getServiceConstructor",value:function(){return Ft}}]),i}(m),jt=n(9479),Ut=n(1883),Zt=n(7743),Vt=n(6922),Gt=n.n(Vt);function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Wt(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i}function qt(t,e,n){return Math.min(n,Math.max(e,t))}function Yt(t,e,n){return t*(1-n)+e*n}function Xt(t,e,n,r){var i=new(Gt())(t,e,n,r);return function(t){return i.solve(t)}}var $t=Xt(.25,.1,.25,1);function Kt(){return!(P.isMini||!P.$window.matchMedia)&&(null==zt&&(zt=P.$window.matchMedia("(prefers-reduced-motion: reduce)")),zt.matches)}var Jt=P.isMini?Date.now.bind(Date):P.$window.performance&&P.$window.performance.now?P.$window.performance.now.bind(P.$window.performance):Date.now.bind(Date),Qt=P.$window.requestAnimationFrame||P.$window.mozRequestAnimationFrame||P.$window.webkitRequestAnimationFrame||P.$window.msRequestAnimationFrame,te=P.$window.cancelAnimationFrame||P.$window.mozCancelAnimationFrame||P.$window.webkitCancelAnimationFrame||P.$window.msCancelAnimationFrame;function ee(t){var e=Qt(t);return{cancel:function(){return te(e)}}}var ne=6371008.8,re=function(){function t(e,n){if((0,a.Z)(this,t),isNaN(e)||isNaN(n))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(n,")"));if(this.lng=+e,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return(0,s.Z)(t,[{key:"wrap",value:function(){return new t(Wt(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"distanceTo",value:function(t){var e=Math.PI/180,n=this.lat*e,r=t.lat*e,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return ne*Math.acos(Math.min(i,1))}}],[{key:"convert",value:function(e){if(e instanceof t)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new t(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===(0,Zt.Z)(e)&&null!==e){var n="lng"in e?e.lng:e.lon;return new t(Number(n),Number(e.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>]")}}]),t}(),ie=function(){function t(e,n){(0,a.Z)(this,t),e&&(n?this.setSouthWest(e).setNorthEast(n):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}return(0,s.Z)(t,[{key:"setNorthEast",value:function(t){return this.ne=t instanceof re?new re(t.lng,t.lat):re.convert(t),this}},{key:"setSouthWest",value:function(t){return this.sw=t instanceof re?new re(t.lng,t.lat):re.convert(t),this}},{key:"extend",value:function(e){var n,r,i=this.sw,o=this.ne;if(e instanceof re)n=e,r=e;else{if(!(e instanceof t)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(t.convert(a))}var s=e;return this.extend(re.convert(s))}return this}if(n=e.sw,r=e.ne,!n||!r)return this}return i||o?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this.sw=new re(n.lng,n.lat),this.ne=new re(r.lng,r.lat)),this}},{key:"getCenter",value:function(){return new re((this.sw.lng+this.ne.lng)/2,(this.sw.lat+this.ne.lat)/2)}},{key:"getSouthWest",value:function(){return this.sw}},{key:"getNorthEast",value:function(){return this.ne}},{key:"getNorthWest",value:function(){return new re(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new re(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this.sw.lng}},{key:"getSouth",value:function(){return this.sw.lat}},{key:"getEast",value:function(){return this.ne.lng}},{key:"getNorth",value:function(){return this.ne.lat}},{key:"toArray",value:function(){return[this.sw.toArray(),this.ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this.sw.toString(),", ").concat(this.ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this.sw&&this.ne)}},{key:"contains",value:function(t){var e=re.convert(t),n=e.lng,r=e.lat,i=this.sw.lat<=r&&r<=this.ne.lat,o=this.sw.lng<=n&&n<=this.ne.lng;return this.sw.lng>this.ne.lng&&(o=this.sw.lng>=n&&n>=this.ne.lng),i&&o}}],[{key:"convert",value:function(e){return e instanceof t?e:new t(e)}}]),t}(),oe=function(){function t(e,n){(0,a.Z)(this,t),this.x=e,this.y=n}return(0,s.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"_add",value:function(t){return this.x+=t.x,this.y+=t.y,this}},{key:"add",value:function(t){return this.clone()._add(t)}},{key:"_sub",value:function(t){return this.x-=t.x,this.y-=t.y,this}},{key:"sub",value:function(t){return this.clone()._sub(t)}},{key:"_multByPoint",value:function(t){return this.x*=t.x,this.y*=t.y,this}},{key:"multByPoint",value:function(t){return this.clone()._multByPoint(t)}},{key:"_divByPoint",value:function(t){return this.x/=t.x,this.y/=t.y,this}},{key:"divByPoint",value:function(t){return this.clone()._divByPoint(t)}},{key:"_mult",value:function(t){return this.x*=t,this.y*=t,this}},{key:"mult",value:function(t){return this.clone()._mult(t)}},{key:"_div",value:function(t){return this.x/=t,this.y/=t,this}},{key:"div",value:function(t){return this.clone()._div(t)}},{key:"_rotate",value:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this}},{key:"rotate",value:function(t){return this.clone()._rotate(t)}},{key:"_rotateAround",value:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this}},{key:"roateAround",value:function(t,e){return this.clone()._rotateAround(t,e)}},{key:"_matMult",value:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this}},{key:"matMult",value:function(t){return this.clone()._matMult(t)}},{key:"_unit",value:function(){return this.div(this.mag()),this}},{key:"unit",value:function(){return this.clone()._unit()}},{key:"_perp",value:function(){var t=this.y;return this.y=this.x,this.x=-t,this}},{key:"perp",value:function(){return this.clone()._perp()}},{key:"_round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"round",value:function(){return this.clone()._round()}},{key:"mag",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"equals",value:function(t){return this.x===t.x&&this.y===t.y}},{key:"dist",value:function(t){return Math.sqrt(this.distSqr(t))}},{key:"distSqr",value:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n}},{key:"angle",value:function(){return Math.atan2(this.y,this.x)}},{key:"angleTo",value:function(t){return Math.atan2(this.y-t.y,this.x-t.x)}},{key:"angleWith",value:function(t){return this.angleWithSep(t.x,t.y)}},{key:"angleWithSep",value:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)}}],[{key:"convert",value:function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e}}]),t}(),ae=n(4249),se=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if((0,a.Z)(this,t),isNaN(e)||e<0||isNaN(n)||n<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=n,this.left=r,this.right=i}return(0,s.Z)(t,[{key:"interpolate",value:function(t,e,n){return null!=e.top&&null!=t.top&&(this.top=Yt(t.top,e.top,n)),null!=e.bottom&&null!=t.bottom&&(this.bottom=Yt(t.bottom,e.bottom,n)),null!=e.left&&null!=t.left&&(this.left=Yt(t.left,e.left,n)),null!=e.right&&null!=t.right&&(this.right=Yt(t.right,e.right,n)),this}},{key:"getCenter",value:function(t,e){var n=qt((this.left+t-this.right)/2,0,t),r=qt((this.top+e-this.bottom)/2,0,e);return new oe(n,r)}},{key:"equals",value:function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}},{key:"clone",value:function(){return new t(this.top,this.bottom,this.left,this.right)}},{key:"toJSON",value:function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}]),t}(),ue=2*Math.PI*ne;function le(t){return ue*Math.cos(t*Math.PI/180)}function ce(t){return(180+t)/360}function he(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function pe(t,e){return t/le(e)}function fe(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var de=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,a.Z)(this,t),this.x=+e,this.y=+n,this.z=+r}return(0,s.Z)(t,[{key:"toLngLat",value:function(){return new re(360*this.x-180,fe(this.y))}},{key:"toAltitude",value:function(){return this.z*le(fe(this.y))}},{key:"meterInMercatorCoordinateUnits",value:function(){return 1/ue*(t=fe(this.y),1/Math.cos(t*Math.PI/180));var t}}],[{key:"fromLngLat",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=re.convert(e);return new t(ce(r.lng),he(r.lat),pe(n,r.lat))}}]),t}();function me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ge=function(){function t(e,n,r,i,o){(0,a.Z)(this,t),this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==r?0:r,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new re(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this.unmodified=!0,this.edgeInsets=new se,this.posMatrixCache={},this.alignedPosMatrixCache={}}return(0,s.Z)(t,[{key:"minZoom",get:function(){return this._minZoom},set:function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}},{key:"minPitch",get:function(){return this._minPitch},set:function(t){this._minPitch!==t&&(this._minPitch=t,this._pitch=Math.max(this._pitch,t))}},{key:"maxPitch",get:function(){return this._maxPitch},set:function(t){this._maxPitch!==t&&(this._maxPitch=t,this._pitch=Math.min(this._pitch,t))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies},set:function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerOffset",get:function(){return this.centerPoint._sub(this.size._div(2))}},{key:"size",get:function(){return new oe(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(t){var e,n=-Wt(t,-180,180)*Math.PI/180;this.angle!==n&&(this.unmodified=!1,this.angle=n,this.calcMatrices(),this.rotationMatrix=(e=new ae.WT(4),ae.WT!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e),function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);t[0]=r*u+o*s,t[1]=i*u+a*s,t[2]=r*-s+o*u,t[3]=i*-s+a*u}(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(t){var e=qt(t,this._minPitch,this._maxPitch)/180*Math.PI;this._pitch!==e&&(this.unmodified=!1,this._pitch=e,this.calcMatrices())}},{key:"fov",get:function(){return this._fov/Math.PI*180},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())}},{key:"zoom",get:function(){return this._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())}},{key:"center",get:function(){return this._center},set:function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this.unmodified=!1,this._center=t,this.constrain(),this.calcMatrices())}},{key:"padding",get:function(){return this.edgeInsets.toJSON()},set:function(t){this.edgeInsets.equals(t)||(this.unmodified=!1,this.edgeInsets.interpolate(this.edgeInsets,t,1),this.calcMatrices())}},{key:"centerPoint",get:function(){return this.edgeInsets.getCenter(this.width,this.height)}},{key:"point",get:function(){return this.project(this.center)}},{key:"clone",value:function(){var e=new t(this._minZoom,this._maxZoom,this._minPitch,this._maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e.center=this._center,e.zoom=this.zoom,e.angle=this.angle,e.fov=this._fov,e.pitch=this._pitch,e.unmodified=this.unmodified,e.edgeInsets=this.edgeInsets.clone(),e.calcMatrices(),e}},{key:"isPaddingEqual",value:function(t){return this.edgeInsets.equals(t)}},{key:"interpolatePadding",value:function(t,e,n){this.unmodified=!1,this.edgeInsets.interpolate(t,e,n),this.constrain(),this.calcMatrices()}},{key:"coveringZoomLevel",value:function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}},{key:"resize",value:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this.constrain(),this.calcMatrices()}},{key:"zoomScale",value:function(t){return Math.pow(2,t)}},{key:"scaleZoom",value:function(t){return Math.log(t)/Math.LN2}},{key:"project",value:function(t){var e=qt(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new oe(ce(t.lng)*this.worldSize,he(e)*this.worldSize)}},{key:"unproject",value:function(t){return new de(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}},{key:"setLocationAtPoint",value:function(t,e){var n=this.pointCoordinate(e),r=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(t),o=new de(i.x-(n.x-r.x),i.y-(n.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"pointCoordinate",value:function(t){var e=new Float64Array([t.x,t.y,0,1]),n=new Float64Array([t.x,t.y,1,1]);R.fF(e,e,this.pixelMatrixInverse),R.fF(n,n,this.pixelMatrixInverse);var r=e[3],i=n[3],o=e[0]/r,a=n[0]/i,s=e[1]/r,u=n[1]/i,l=e[2]/r,c=n[2]/i,h=l===c?0:(0-l)/(c-l);return new de(Yt(o,a,h)/this.worldSize,Yt(s,u,h)/this.worldSize)}},{key:"getBounds",value:function(){return(new ie).extend(this.pointLocation(new oe(0,0))).extend(this.pointLocation(new oe(this.width,0))).extend(this.pointLocation(new oe(this.width,this.height))).extend(this.pointLocation(new oe(0,this.height)))}},{key:"getMaxBounds",value:function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}},{key:"setMaxBounds",value:function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this.constrain()):(this.lngRange=void 0,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}},{key:"customLayerMatrix",value:function(){return this.mercatorMatrix.slice()}},{key:"maxPitchScaleFactor",value:function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new oe(0,0)),e=new Float32Array([t.x*this.worldSize,t.y*this.worldSize,0,1]);return R.fF(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance}},{key:"getCameraPoint",value:function(){var t=this._pitch,e=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new oe(0,e))}},{key:"getCameraQueryGeometry",value:function(t){var e=this.getCameraPoint();if(1===t.length)return[t[0],e];var n,r=e.x,i=e.y,o=e.x,a=e.y,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(s.s();!(n=s.n()).done;){var u=n.value;r=Math.min(r,u.x),i=Math.min(i,u.y),o=Math.max(o,u.x),a=Math.max(a,u.y)}}catch(t){s.e(t)}finally{s.f()}return[new oe(r,i),new oe(o,i),new oe(o,a),new oe(r,a),new oe(r,i)]}},{key:"coordinatePoint",value:function(t){var e=R.al(t.x*this.worldSize,t.y*this.worldSize,0,1);return R.fF(e,e,this.pixelMatrix),new oe(e[0]/e[3],e[1]/e[3])}},{key:"locationPoint",value:function(t){return this.coordinatePoint(this.locationCoordinate(t))}},{key:"pointLocation",value:function(t){return this.coordinateLocation(this.pointCoordinate(t))}},{key:"locationCoordinate",value:function(t){return de.fromLngLat(t)}},{key:"coordinateLocation",value:function(t){return t.toLngLat()}},{key:"getProjectionMatrix",value:function(){return this.projMatrix}},{key:"constrain",value:function(){if(this.center&&this.width&&this.height&&!this.constraining){this.constraining=!0;var t,e,n,r,i=-90,o=90,a=-180,s=180,u=this.size,l=this.unmodified;if(this.latRange){var c=this.latRange;i=he(c[1])*this.worldSize,t=(o=he(c[0])*this.worldSize)-i<u.y?u.y/(o-i):0}if(this.lngRange){var h=this.lngRange;a=ce(h[0])*this.worldSize,e=(s=ce(h[1])*this.worldSize)-a<u.x?u.x/(s-a):0}var p=this.point,f=Math.max(e||0,t||0);if(f)return this.center=this.unproject(new oe(e?(s+a)/2:p.x,t?(o+i)/2:p.y)),P.isMini?this.zoom=Math.max(this.zoom,Math.max(-1,this.minZoom)):this.zoom+=this.scaleZoom(f),this.unmodified=l,void(this.constraining=!1);if(this.latRange){var d=p.y,m=u.y/2;d-m<i&&(r=i+m),d+m>o&&(r=o-m)}if(this.lngRange){var g=p.x,y=u.x/2;g-y<a&&(n=a+y),g+y>s&&(n=s-y)}void 0===n&&void 0===r||(this.center=this.unproject(new oe(void 0!==n?n:p.x,void 0!==r?r:p.y))),this.unmodified=l,this.constraining=!1}}},{key:"calcMatrices",value:function(){if(this.height){var t=this._fov/2,e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,r=this._fov*(.5+e.y/this.height),i=Math.sin(r)*this.cameraToCenterDistance/Math.sin(qt(Math.PI-n-r,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);M.perspective(c,this._fov,this.width/this.height,l,u),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,M.scale(c,c,[1,-1,1]),M.translate(c,c,[0,0,-this.cameraToCenterDistance]),M.rotateX(c,c,this._pitch),M.rotateZ(c,c,this.angle),M.translate(c,c,[-a,-s,0]),this.mercatorMatrix=M.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),M.scale(c,c,[1,1,pe(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=M.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),m=a-Math.round(a)+f*h+d*p,g=s-Math.round(s)+f*p+d*h,y=new Float64Array(c);if(M.translate(y,y,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=y,c=M.create(),M.scale(c,c,[this.width/2,-this.height/2,1]),M.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=M.create(),M.scale(c,c,[1,-1,1]),M.translate(c,c,[-1,-1,0]),M.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=M.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=M.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this.posMatrixCache={},this.alignedPosMatrixCache={}}}}]),t}(),ye=n(8469),ve=n.n(ye),_e=(0,s.Z)((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.Z)(this,t),ve()(this,n),this.type=e}));var be=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t){var e;(0,a.Z)(this,i),e=r.call(this),(0,w.Z)((0,x.Z)(e),"renderFrameCallback",(function(){var t=Math.min((Jt()-e.easeStart)/e.easeOptions.duration,1);e.onEaseFrame(e.easeOptions.easing(t)),t<1?e.easeFrameId=e.requestRenderFrame(e.renderFrameCallback):e.stop()})),e.options=t;var n=t.minZoom,o=t.maxZoom,s=t.minPitch,u=t.maxPitch,l=t.renderWorldCopies;return e.moving=!1,e.zooming=!1,e.bearingSnap=t.bearingSnap,e.pitchEnabled=t.pitchEnabled,e.rotateEnabled=t.rotateEnabled,e.transform=new ge(n,o,s,u,l),e}return(0,s.Z)(i,[{key:"requestRenderFrame",value:function(t){return 0}},{key:"cancelRenderFrame",value:function(t){}},{key:"getCenter",value:function(){var t=this.transform.center,e=t.lng,n=t.lat;return new re(e,n)}},{key:"getZoom",value:function(){return this.transform.zoom}},{key:"getPitch",value:function(){return this.transform.pitch}},{key:"setCenter",value:function(t,e){return this.jumpTo({center:t},e)}},{key:"setPitch",value:function(t,e){return this.jumpTo({pitch:t},e),this}},{key:"getBearing",value:function(){return this.transform.bearing}},{key:"panTo",value:function(t,e,n){return this.easeTo((0,jt.merge)({center:t},e),n)}},{key:"panBy",value:function(t,e,n){return t=oe.convert(t).mult(-1),this.panTo(this.transform.center,function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];for(var s in a)void 0!==a[s]&&(t[s]=a[s])}return t}({offset:t},e||{}),n)}},{key:"zoomOut",value:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}},{key:"setBearing",value:function(t,e){return this.jumpTo({bearing:t},e),this}},{key:"setZoom",value:function(t,e){return this.jumpTo({zoom:t},e),this}},{key:"zoomIn",value:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}},{key:"zoomTo",value:function(t,e,n){return this.easeTo((0,jt.merge)({zoom:t},e),n)}},{key:"getPadding",value:function(){return this.transform.padding}},{key:"setPadding",value:function(t,e){return this.jumpTo({padding:t},e),this}},{key:"rotateTo",value:function(t,e,n){return this.easeTo((0,jt.merge)({bearing:t},e),n)}},{key:"resetNorth",value:function(t,e){return this.rotateTo(0,(0,jt.merge)({duration:1e3},t),e),this}},{key:"resetNorthPitch",value:function(t,e){return this.easeTo((0,jt.merge)({bearing:0,pitch:0,duration:1e3},t),e),this}},{key:"fitBounds",value:function(t,e,n){return this.fitInternal(this.cameraForBounds(t,e),e,n)}},{key:"cameraForBounds",value:function(t,e){return t=ie.convert(t),this.cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),0,e)}},{key:"snapToNorth",value:function(t,e){return Math.abs(this.getBearing())<this.bearingSnap?this.resetNorth(t,e):this}},{key:"jumpTo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;this.stop();var n=this.transform,r=!1,i=!1,o=!1;return void 0!==t.zoom&&n.zoom!==+t.zoom&&(r=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=re.convert(t.center)),void 0!==t.bearing&&n.bearing!==+t.bearing&&(i=!0,n.bearing=+t.bearing),void 0!==t.pitch&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),void 0===t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this.emit("movestart",new _e("movestart",e)),this.emit("move",new _e("move",e)),r&&(this.emit("zoomstart",new _e("zoomstart",e)),this.emit("zoom",new _e("zoom",e)),this.emit("zoomend",new _e("zoomend",e))),i&&(this.emit("rotatestart",new _e("rotatestart",e)),this.emit("rotate",new _e("rotate",e)),this.emit("rotateend",new _e("rotateend",e))),o&&(this.emit("pitchstart",new _e("pitchstart",e)),this.emit("pitch",new _e("pitch",e)),this.emit("pitchend",new _e("pitchend",e))),this.emit("moveend",new _e("moveend",e))}},{key:"easeTo",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;(!1===(e=(0,jt.merge)({offset:[0,0],duration:500,easing:$t},e)).animate||!e.essential&&Kt())&&(e.duration=0);var r=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),u=e.zoom?+e.zoom:i,l=e.bearing?this.normalizeBearing(e.bearing,o):o,c=e.pitch?+e.pitch:a,h=e.padding?e.padding:r.padding,p=oe.convert(e.offset),f=r.centerPoint.add(p),d=r.pointLocation(f),m=re.convert(e.center||d);this.normalizeCenter(m);var g,y,v=r.project(d),_=r.project(m).sub(v),b=r.zoomScale(u-i);e.around&&(g=re.convert(e.around),y=r.locationPoint(g));var x={moving:this.moving,zooming:this.zooming,rotating:this.rotating,pitching:this.pitching};return this.zooming=this.zooming||u!==i,this.rotating=this.rotating||o!==l,this.pitching=this.pitching||c!==a,this.padding=!r.isPaddingEqual(h),this.easeId=e.easeId,this.prepareEase(n,e.noMoveStart,x),clearTimeout(this.easeEndTimeoutID),this.ease((function(e){if(t.zooming&&(r.zoom=Yt(i,u,e)),t.rotating&&t.rotateEnabled&&(r.bearing=Yt(o,l,e)),t.pitching&&t.pitchEnabled&&(r.pitch=Yt(a,c,e)),t.padding&&(r.interpolatePadding(s,h,e),f=r.centerPoint.add(p)),g)r.setLocationAtPoint(g,y);else{var d=r.zoomScale(r.zoom-i),m=u>i?Math.min(2,b):Math.max(.5,b),x=Math.pow(m,1-e),w=r.unproject(v.add(_.mult(e*x)).mult(d));r.setLocationAtPoint(r.renderWorldCopies?w.wrap():w,f)}t.fireMoveEvents(n)}),(function(e){t.afterEase(n,e)}),e),this}},{key:"flyTo",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(!e.essential&&Kt()){var r=function(t,e){var n,r={},i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ht(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ht(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(["center","zoom","bearing","pitch","around"]);try{for(i.s();!(n=i.n()).done;){var o=n.value;o in t&&(r[o]=t[o])}}catch(t){i.e(t)}finally{i.f()}return r}(e);return this.jumpTo(r,n)}this.stop(),e=(0,jt.merge)({offset:[0,0],speed:1.2,curve:1.42,easing:$t},e);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),l=e.zoom?qt(+e.zoom,i.minZoom,i.maxZoom):o,c=e.bearing?this.normalizeBearing(e.bearing,a):a,h=e.pitch?+e.pitch:s,p="padding"in e?e.padding:i.padding,f=i.zoomScale(l-o),d=oe.convert(e.offset),m=i.centerPoint.add(d),g=i.pointLocation(m),y=re.convert(e.center||g);this.normalizeCenter(y);var v=i.project(g),_=i.project(y).sub(v),b=e.curve,x=Math.max(i.width,i.height),w=x/f,S=_.mag();if("minZoom"in e){var E=qt(Math.min(e.minZoom,o,l),i.minZoom,i.maxZoom),M=x/i.zoomScale(E-o);b=Math.sqrt(M/S*2)}var T=b*b;function A(t){var e=(w*w-x*x+(t?-1:1)*T*T*S*S)/(2*(t?w:x)*T*S);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function O(t){return(Math.exp(t)+Math.exp(-t))/2}var P=A(0),k=function(t){return O(P)/O(P+b*t)},L=function(t){return x*((O(P)*(C(e=P+b*t)/O(e))-C(P))/T)/S;var e},I=(A(1)-P)/b;if(Math.abs(S)<1e-6||!isFinite(I)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,n);var R=w<x?-1:1;I=Math.abs(Math.log(w/x))/b,L=function(){return 0},k=function(t){return Math.exp(R*b*t)}}if("duration"in e)e.duration=+e.duration;else{var D="screenSpeed"in e?+e.screenSpeed/b:+e.speed;e.duration=1e3*I/D}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this.zooming=!0,this.rotating=a!==c,this.pitching=h!==s,this.padding=!i.isPaddingEqual(p),this.prepareEase(n,!1),this.ease((function(e){var r=e*I,f=1/k(r);i.zoom=1===e?l:o+i.scaleZoom(f),t.rotating&&(i.bearing=Yt(a,c,e)),t.pitching&&(i.pitch=Yt(s,h,e)),t.padding&&(i.interpolatePadding(u,p,e),m=i.centerPoint.add(d));var g=1===e?y:i.unproject(v.add(_.mult(L(r))).mult(f));i.setLocationAtPoint(i.renderWorldCopies?g.wrap():g,m),t.fireMoveEvents(n)}),(function(){return t.afterEase(n)}),e),this}},{key:"fitScreenCoordinates",value:function(t,e,n,r,i){return this.fitInternal(this.cameraForBoxAndBearing(this.transform.pointLocation(oe.convert(t)),this.transform.pointLocation(oe.convert(e)),n,r),r,i)}},{key:"stop",value:function(t,e){if(this.easeFrameId&&(this.cancelRenderFrame(this.easeFrameId),delete this.easeFrameId,delete this.onEaseFrame),this.onEaseEnd){var n=this.onEaseEnd;delete this.onEaseEnd,n.call(this,e)}return this}},{key:"normalizeBearing",value:function(t,e){t=Wt(t,-180,180);var n=Math.abs(t-e);return Math.abs(t-360-e)<n&&(t-=360),Math.abs(t+360-e)<n&&(t+=360),t}},{key:"normalizeCenter",value:function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var n=t.lng-e.center.lng;t.lng+=n>180?-360:n<-180?360:0}}},{key:"fireMoveEvents",value:function(t){this.emit("move",new _e("move",t)),this.zooming&&this.emit("zoom",new _e("zoom",t)),this.rotating&&this.emit("rotate",new _e("rotate",t)),this.pitching&&this.emit("rotate",new _e("pitch",t))}},{key:"prepareEase",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.moving=!0,e||n.moving||this.emit("movestart",new _e("movestart",t)),this.zooming&&!n.zooming&&this.emit("zoomstart",new _e("zoomstart",t)),this.rotating&&!n.rotating&&this.emit("rotatestart",new _e("rotatestart",t)),this.pitching&&!n.pitching&&this.emit("pitchstart",new _e("pitchstart",t))}},{key:"afterEase",value:function(t,e){if(!this.easeId||!e||this.easeId!==e){delete this.easeId;var n=this.zooming,r=this.rotating,i=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,this.padding=!1,n&&this.emit("zoomend",new _e("zoomend",t)),r&&this.emit("rotateend",new _e("rotateend",t)),i&&this.emit("pitchend",new _e("pitchend",t)),this.emit("moveend",new _e("moveend",t))}}},{key:"ease",value:function(t,e,n){!1===n.animate||0===n.duration?(t(1),e()):(this.easeStart=Jt(),this.easeOptions=n,this.onEaseFrame=t,this.onEaseEnd=e,this.easeFrameId=this.requestRenderFrame(this.renderFrameCallback))}},{key:"cameraForBoxAndBearing",value:function(t,e,n,r){var i={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=(0,jt.merge)({padding:i,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){var o=r.padding;r.padding={top:o,bottom:o,right:o,left:o}}r.padding=(0,jt.merge)(i,r.padding);var a=this.transform,s=a.padding,u=a.project(re.convert(t)),l=a.project(re.convert(e)),c=u.rotate(-n*Math.PI/180),h=l.rotate(-n*Math.PI/180),p=new oe(Math.max(c.x,h.x),Math.max(c.y,h.y)),f=new oe(Math.min(c.x,h.x),Math.min(c.y,h.y)),d=p.sub(f),m=(a.width-(s.left+s.right+r.padding.left+r.padding.right))/d.x,g=(a.height-(s.top+s.bottom+r.padding.top+r.padding.bottom))/d.y;if(!(g<0||m<0)){var y=Math.min(a.scaleZoom(a.scale*Math.min(m,g)),r.maxZoom),v=oe.convert(r.offset),_=(r.padding.left-r.padding.right)/2,b=(r.padding.top-r.padding.bottom)/2,x=new oe(v.x+_,v.y+b).mult(a.scale/a.zoomScale(y));return{center:a.unproject(u.add(l).div(2).sub(x)),zoom:y,bearing:n}}}},{key:"fitInternal",value:function(t,e,n){return t?(delete(e=(0,jt.merge)(t,e)).padding,e.linear?this.easeTo(e,n):this.flyTo(e,n)):this}}]),i}(Ut.EventEmitter);function xe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return we(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?we(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function we(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Se={};const Ee=Se;Se.create=function(t,e,n){var r=P.$window.document.createElement(t);return void 0!==e&&(r.className=e),n&&n.appendChild(r),r},Se.createNS=function(t,e){return P.$window.document.createElementNS(t,e)};var Me=P.$window.document&&P.$window.document.documentElement.style;function Te(t){if(!Me)return t[0];var e,n=xe(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r in Me)return r}}catch(t){n.e(t)}finally{n.f()}return t[0]}var Ae,Ce=Te(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);Se.disableDrag=function(){Me&&Ce&&(Ae=Me[Ce],Me[Ce]="none")},Se.enableDrag=function(){Me&&Ce&&(Me[Ce]=Ae)};var Oe=Te(["transform","WebkitTransform"]);Se.setTransform=function(t,e){t.style[Oe]=e};var Pe=!1;try{var ke=Object.defineProperty({},"passive",{get:function(){Pe=!0}});P.$window.addEventListener("test",ke,ke),P.$window.removeEventListener("test",ke,ke)}catch(t){Pe=!1}Se.addEventListener=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};"passive"in r&&Pe?t.addEventListener(e,n,r):t.addEventListener(e,n,r.capture)},Se.removeEventListener=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};"passive"in r&&Pe?t.removeEventListener(e,n,r):t.removeEventListener(e,n,r.capture)};var Le=function t(e){e.preventDefault(),e.stopPropagation(),P.$window.removeEventListener("click",t,!0)};Se.suppressClick=function(){P.isMini||(P.$window.addEventListener("click",Le,!0),setTimeout((function(){P.$window.removeEventListener("click",Le,!0)}),0))},Se.mousePos=function(t,e){if(P.isMini)return new oe(e.clientX-t.left-0,e.clientY-t.top-0);var n=t.getBoundingClientRect();return new oe(e.clientX-n.left-t.clientLeft,e.clientY-n.top-t.clientTop)},Se.touchPos=function(t,e){if(P.isMini){var n,r=[],i=xe(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(new oe(o.clientX-t.left,o.clientY-t.top))}}catch(t){i.e(t)}finally{i.f()}return r}var a,s=t.getBoundingClientRect(),u=[],l=xe(e);try{for(l.s();!(a=l.n()).done;){var c=a.value;u.push(new oe(c.clientX-s.left-t.clientLeft,c.clientY-s.top-t.clientTop))}}catch(t){l.e(t)}finally{l.f()}return u},Se.mouseButton=function(t){return P.isMini&&void 0!==P.$window.InstallTrigger&&2===t.button&&t.ctrlKey&&P.$window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button},Se.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var Ie=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t,e,n){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(0,a.Z)(this,i);var u=Ee.mousePos(e.getCanvasContainer(),n),l=e.unproject(u);return(o=r.call(this,t,ve()({point:u,lngLat:l,originalEvent:n},s))).defaultPrevented=!1,o.target=e,o}return(0,s.Z)(i,[{key:"preventDefault",value:function(){this.defaultPrevented=!0}}]),i}(_e);var Re=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t,e,n){var o;(0,a.Z)(this,i);var s="touchend"===t?n.changedTouches:n.touches,u=Ee.touchPos(e.getCanvasContainer(),s),l=u.map((function(t){return e.unproject(t)})),c=u.reduce((function(t,e,n,r){return t.add(e.div(r.length))}),new oe(0,0)),h=e.unproject(c);return(o=r.call(this,t,{points:u,point:c,lngLats:l,lngLat:h,originalEvent:n})).defaultPrevented=!1,o}return(0,s.Z)(i,[{key:"preventDefault",value:function(){this.defaultPrevented=!0}}]),i}(_e);var De=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t,e,n){var o;return(0,a.Z)(this,i),(o=r.call(this,t,{originalEvent:n})).defaultPrevented=!1,o}return(0,s.Z)(i,[{key:"preventDefault",value:function(){this.defaultPrevented=!0}}]),i}(_e),Ne=function(){function t(e){(0,a.Z)(this,t),this.map=e}return(0,s.Z)(t,[{key:"reset",value:function(){this.delayContextMenu=!1,delete this.contextMenuEvent}},{key:"mousemove",value:function(t){this.map.emit(t.type,new Ie(t.type,this.map,t))}},{key:"mousedown",value:function(){this.delayContextMenu=!0}},{key:"mouseup",value:function(){this.delayContextMenu=!1,this.contextMenuEvent&&(this.map.emit("contextmenu",new Ie("contextmenu",this.map,this.contextMenuEvent)),delete this.contextMenuEvent)}},{key:"contextmenu",value:function(t){this.delayContextMenu?this.contextMenuEvent=t:this.map.emit(t.type,new Ie(t.type,this.map,t)),this.map.listeners("contextmenu")&&t.preventDefault()}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){return!0}},{key:"disable",value:function(){return!1}}]),t}(),Fe=function(){function t(e,n){(0,a.Z)(this,t),this.map=e,this.el=e.getCanvasContainer(),this.container=e.getContainer(),this.clickTolerance=n.clickTolerance||1}return(0,s.Z)(t,[{key:"isEnabled",value:function(){return!!this.enabled}},{key:"isActive",value:function(){return!!this.active}},{key:"enable",value:function(){this.isEnabled()||(this.enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this.enabled=!1)}},{key:"mousedown",value:function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(Ee.disableDrag(),this.startPos=this.lastPos=e,this.active=!0)}},{key:"mousemoveWindow",value:function(t,e){if(this.active){var n=e;if(!(this.lastPos.equals(n)||!this.box&&n.dist(this.startPos)<this.clickTolerance)){var r=this.startPos;this.lastPos=n,this.box||(this.box=Ee.create("div","l7-boxzoom",this.container),this.container.classList.add("l7-crosshair"),this.fireEvent("boxzoomstart",t));var i=Math.min(r.x,n.x),o=Math.max(r.x,n.x),a=Math.min(r.y,n.y),s=Math.max(r.y,n.y);Ee.setTransform(this.box,"translate(".concat(i,"px,").concat(a,"px)")),this.box&&(this.box.style.width="".concat(o-i,"px"),this.box.style.height="".concat(s-a,"px"))}}}},{key:"mouseupWindow",value:function(t,e){var n=this;if(this.active&&0===t.button){var r=this.startPos,i=e;if(this.reset(),Ee.suppressClick(),r.x!==i.x||r.y!==i.y)return this.map.emit("boxzoomend",new _e("boxzoomend",{originalEvent:t})),{cameraAnimation:function(t){return t.fitScreenCoordinates(r,i,n.map.getBearing(),{linear:!0})}};this.fireEvent("boxzoomcancel",t)}}},{key:"keydown",value:function(t){this.active&&27===t.keyCode&&(this.reset(),this.fireEvent("boxzoomcancel",t))}},{key:"reset",value:function(){this.active=!1,this.container.classList.remove("l7-crosshair"),this.box&&(Ee.remove(this.box),this.box=null),Ee.enableDrag(),delete this.startPos,delete this.lastPos}},{key:"fireEvent",value:function(t,e){return this.map.emit(t,new _e(t,{originalEvent:e}))}}]),t}();const ze=Fe;var Be=function(){function t(){(0,a.Z)(this,t),this.reset()}return(0,s.Z)(t,[{key:"reset",value:function(){this.active=!1}},{key:"dblclick",value:function(t,e){return t.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(t.shiftKey?-1:1),around:n.unproject(e)},{originalEvent:t})}}}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),t}();var je=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){var t;(0,a.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=r.call.apply(r,[this].concat(n)),(0,w.Z)((0,x.Z)(t),"type","renderFrame"),t}return(0,s.Z)(i)}(_e);function Ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ze={linearity:.3,easing:Xt(0,0,.3,1)},Ve=ve()({deceleration:2500,maxSpeed:1400},Ze),Ge=ve()({deceleration:20,maxSpeed:1400},Ze),He=ve()({deceleration:1e3,maxSpeed:360},Ze),We=ve()({deceleration:1e3,maxSpeed:90},Ze),qe=function(){function t(e){(0,a.Z)(this,t),this.map=e,this.clear()}return(0,s.Z)(t,[{key:"clear",value:function(){this.inertiaBuffer=[]}},{key:"record",value:function(t){this.drainInertiaBuffer(),this.inertiaBuffer.push({time:Jt(),settings:t})}},{key:"drainInertiaBuffer",value:function(){for(var t=this.inertiaBuffer,e=Jt();t.length>0&&e-t[0].time>160;)t.shift()}},{key:"onMoveEnd",value:function(t){if(this.drainInertiaBuffer(),!(this.inertiaBuffer.length<2)){var e,n={zoom:0,bearing:0,pitch:0,pan:new oe(0,0),pinchAround:void 0,around:void 0},r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(this.inertiaBuffer);try{for(r.s();!(e=r.n()).done;){var i=e.value.settings;n.zoom+=i.zoomDelta||0,n.bearing+=i.bearingDelta||0,n.pitch+=i.pitchDelta||0,i.panDelta&&n.pan._add(i.panDelta),i.around&&(n.around=i.around),i.pinchAround&&(n.pinchAround=i.pinchAround)}}catch(t){r.e(t)}finally{r.f()}var o=this.inertiaBuffer[this.inertiaBuffer.length-1].time-this.inertiaBuffer[0].time,a={};if(n.pan.mag()){var s=Xe(n.pan.mag(),o,ve()({},Ve,t||{}));a.offset=n.pan.mult(s.amount/n.pan.mag()),a.center=this.map.transform.center,Ye(a,s)}if(n.zoom){var u=Xe(n.zoom,o,Ge);a.zoom=this.map.transform.zoom+u.amount,Ye(a,u)}if(n.bearing){var l=Xe(n.bearing,o,He);a.bearing=this.map.transform.bearing+qt(l.amount,-179,179),Ye(a,l)}if(n.pitch){var c=Xe(n.pitch,o,We);a.pitch=this.map.transform.pitch+c.amount,Ye(a,c)}if(a.zoom||a.bearing){var h=void 0===n.pinchAround?n.around:n.pinchAround;a.around=h?this.map.unproject(h):this.map.getCenter()}return this.clear(),ve()(a,{noMoveStart:!0})}}}]),t}();function Ye(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Xe(t,e,n){var r=n.maxSpeed,i=n.linearity,o=n.deceleration,a=qt(t*i/(e/1e3),-r,r),s=Math.abs(a)/(o*i);return{easing:n.easing,duration:1e3*s,amount:a*(s/2)}}var $e={panStep:100,bearingStep:15,pitchStep:10};function Ke(t){return t*(2-t)}const Je=function(){function t(){(0,a.Z)(this,t);var e=$e;this.panStep=e.panStep,this.bearingStep=e.bearingStep,this.pitchStep=e.pitchStep}return(0,s.Z)(t,[{key:"reset",value:function(){this.active=!1}},{key:"keydown",value:function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var n=0,r=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:Ke,zoom:n?Math.round(u)+n*(t.shiftKey?2:1):u,bearing:s.getBearing()+r*e.bearingStep,pitch:s.getPitch()+i*e.pitchStep,offset:[-o*e.panStep,-a*e.panStep],center:s.getCenter()},{originalEvent:t})}}}}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),t}();var Qe,tn=function(){function t(e,n){(0,a.Z)(this,t),this.map=e,this.clickTolerance=n.clickTolerance}return(0,s.Z)(t,[{key:"reset",value:function(){delete this.mousedownPos}},{key:"wheel",value:function(t){return this.firePreventable(new De(t.type,this.map,t))}},{key:"mousedown",value:function(t,e){return this.mousedownPos=e,this.firePreventable(new Ie(t.type,this.map,t))}},{key:"mouseup",value:function(t){this.map.emit(t.type,new Ie(t.type,this.map,t))}},{key:"click",value:function(t,e){this.mousedownPos&&this.mousedownPos.dist(e)>=this.clickTolerance||this.map.emit(t.type,new Ie(t.type,this.map,t))}},{key:"dblclick",value:function(t){return this.firePreventable(new Ie(t.type,this.map,t))}},{key:"mouseover",value:function(t){this.map.emit(t.type,new Ie(t.type,this.map,t))}},{key:"mouseout",value:function(t){this.map.emit(t.type,new Ie(t.type,this.map,t))}},{key:"touchstart",value:function(t){return this.firePreventable(new Re(t.type,this.map,t))}},{key:"touchmove",value:function(t){this.map.emit(t.type,new Re(t.type,this.map,t))}},{key:"touchend",value:function(t){this.map.emit(t.type,new Re(t.type,this.map,t))}},{key:"touchcancel",value:function(t){this.map.emit(t.type,new Re(t.type,this.map,t))}},{key:"firePreventable",value:function(t){if(this.map.emit(t.type,t),t.defaultPrevented)return{}}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){return!1}},{key:"disable",value:function(){return!1}}]),t}(),en=n(9458),nn=(Qe={},(0,w.Z)(Qe,0,1),(0,w.Z)(Qe,2,2),Qe),rn=function(){function t(e){(0,a.Z)(this,t),this.reset(),this.clickTolerance=e.clickTolerance||1}return(0,s.Z)(t,[{key:"reset",value:function(){this.active=!1,this.moved=!1,delete this.lastPoint,delete this.eventButton}},{key:"mousedown",value:function(t,e){if(!this.lastPoint){var n=Ee.mouseButton(t);this.correctButton(t,n)&&(this.lastPoint=e,this.eventButton=n)}}},{key:"mousemoveWindow",value:function(t,e){var n=this.lastPoint;if(n)if(t.preventDefault(),function(t,e){var n=nn[e];return void 0===t.buttons||(t.buttons&n)!==n}(t,this.eventButton))this.reset();else if(this.moved||!(e.dist(n)<this.clickTolerance))return this.moved=!0,this.lastPoint=e,this.move(n,e)}},{key:"mouseupWindow",value:function(t){this.lastPoint&&Ee.mouseButton(t)===this.eventButton&&(this.moved&&Ee.suppressClick(),this.reset())}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}},{key:"correctButton",value:function(t,e){return!1}},{key:"move",value:function(t,e){}}]),t}();var on=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"mousedown",value:function(t,e){(0,en.Z)((0,c.Z)(i.prototype),"mousedown",this).call(this,t,e),this.lastPoint&&(this.active=!0)}},{key:"move",value:function(t,e){return{around:e,panDelta:e.sub(t)}}},{key:"correctButton",value:function(t,e){return 0===e&&!t.ctrlKey}}]),i}(rn);var an=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"correctButton",value:function(t,e){return 0===e&&t.ctrlKey||2===e}},{key:"move",value:function(t,e){var n=-.5*(e.y-t.y);if(n)return this.active=!0,{pitchDelta:n}}},{key:"contextmenu",value:function(t){t.preventDefault()}}]),i}(rn);var sn=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"contextmenu",value:function(t){t.preventDefault()}},{key:"correctButton",value:function(t,e){return 0===e&&t.ctrlKey||2===e}},{key:"move",value:function(t,e){var n=.8*(e.x-t.x);if(n)return this.active=!0,{bearingDelta:n}}}]),i}(rn),un=4.000244140625,ln=function(){function t(e,n){var r=this;(0,a.Z)(this,t),(0,w.Z)(this,"onScrollFrame",(function(){if(r.frameId&&(r.frameId=null,r.isActive())){var t=r.map.transform;if(0!==r.delta){var e="wheel"===r.type&&Math.abs(r.delta)>un?r.wheelZoomRate:r.defaultZoomRate,n=2/(1+Math.exp(-Math.abs(r.delta*e)));r.delta<0&&0!==n&&(n=1/n);var i="number"==typeof r.targetZoom?t.zoomScale(r.targetZoom):t.scale;r.targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(i*n))),"wheel"===r.type&&(r.startZoom=t.zoom,r.easing=r.smoothOutEasing(200)),r.delta=0}var o,a="number"==typeof r.targetZoom?r.targetZoom:t.zoom,s=r.startZoom,u=r.easing,l=!1;if("wheel"===r.type&&s&&u){var c=Math.min((Jt()-r.lastWheelEventTime)/200,1);o=Yt(s,a,u(c)),c<1?r.frameId||(r.frameId=!0):l=!0}else o=a,l=!0;return r.active=!0,l&&(r.active=!1,r.finishTimeout=setTimeout((function(){r.zooming=!1,r.handler.triggerRenderFrame(),delete r.targetZoom,delete r.finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!l,zoomDelta:o-t.zoom,around:r.aroundPoint,originalEvent:r.lastWheelEvent}}})),this.map=e,this.el=e.getCanvasContainer(),this.handler=n,this.delta=0,this.defaultZoomRate=.01,this.wheelZoomRate=.0022222222222222222}return(0,s.Z)(t,[{key:"setZoomRate",value:function(t){this.defaultZoomRate=t}},{key:"setWheelZoomRate",value:function(t){this.wheelZoomRate=t}},{key:"isEnabled",value:function(){return!!this.enabled}},{key:"isActive",value:function(){return!!this.active||void 0!==this.finishTimeout}},{key:"isZooming",value:function(){return!!this.zooming}},{key:"enable",value:function(t){this.isEnabled()||(this.enabled=!0,this.aroundCenter=t&&"center"===t.around)}},{key:"disable",value:function(){this.isEnabled()&&(this.enabled=!1)}},{key:"wheel",value:function(t){if(this.isEnabled()){var e=t.deltaMode===window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=Jt(),r=n-(this.lastWheelEventTime||0);this.lastWheelEventTime=n,0!==e&&e%un==0?this.type="wheel":0!==e&&Math.abs(e)<4?this.type="trackpad":r>400?(this.type=null,this.lastValue=e,this.timeout=setTimeout(this.onTimeout,40,t)):this.type||(this.type=Math.abs(r*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()}}},{key:"renderFrame",value:function(){return this.onScrollFrame()}},{key:"reset",value:function(){this.active=!1}},{key:"onTimeout",value:function(t){this.type="wheel",this.delta-=this.lastValue,!this.active&&this.start&&this.start(t)}},{key:"start",value:function(t){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 e=Ee.mousePos(this.el,t);this.around=re.convert(this.aroundCenter?this.map.getCenter():this.map.unproject(e)),this.aroundPoint=this.map.transform.locationPoint(this.around),this.frameId||(this.frameId=!0,this.handler.triggerRenderFrame())}}},{key:"smoothOutEasing",value:function(t){var e=$t;if(this.prevEase){var n=this.prevEase,r=(Jt()-n.start)/n.duration,i=n.easing(r+.01)-n.easing(r),o=.27/Math.sqrt(i*i+1e-4)*.01;e=Xt(o,Math.sqrt(.0729-o*o),.25,1)}return this.prevEase={start:Jt(),duration:t,easing:e},e}}]),t}();const cn=ln;var hn=function(){function t(e,n){(0,a.Z)(this,t),this.clickZoom=e,this.tapZoom=n}return(0,s.Z)(t,[{key:"enable",value:function(){this.clickZoom.enable(),this.tapZoom.enable()}},{key:"disable",value:function(){this.clickZoom.disable(),this.tapZoom.disable()}},{key:"isEnabled",value:function(){return this.clickZoom.isEnabled()&&this.tapZoom.isEnabled()}},{key:"isActive",value:function(){return this.clickZoom.isActive()||this.tapZoom.isActive()}}]),t}(),pn=function(){function t(e,n,r){(0,a.Z)(this,t),this.el=e,this.mousePan=n,this.touchPan=r}return(0,s.Z)(t,[{key:"enable",value:function(t){this.inertiaOptions=t||{},this.mousePan.enable(),this.touchPan.enable(),P.isMini||this.el.classList.add("l7-touch-drag-pan")}},{key:"disable",value:function(){this.mousePan.disable(),this.touchPan.disable(),P.isMini||this.el.classList.remove("l7-touch-drag-pan")}},{key:"isEnabled",value:function(){return this.mousePan.isEnabled()&&this.touchPan.isEnabled()}},{key:"isActive",value:function(){return this.mousePan.isActive()||this.touchPan.isActive()}}]),t}(),fn=function(){function t(e,n,r){(0,a.Z)(this,t),this.pitchWithRotate=e.pitchWithRotate,this.mouseRotate=n,this.mousePitch=r}return(0,s.Z)(t,[{key:"enable",value:function(){this.mouseRotate.enable(),this.pitchWithRotate&&this.mousePitch.enable()}},{key:"disable",value:function(){this.mouseRotate.disable(),this.mousePitch.disable()}},{key:"isEnabled",value:function(){return this.mouseRotate.isEnabled()&&(!this.pitchWithRotate||this.mousePitch.isEnabled())}},{key:"isActive",value:function(){return this.mouseRotate.isActive()||this.mousePitch.isActive()}}]),t}(),dn=function(){function t(e,n,r,i){(0,a.Z)(this,t),this.el=e,this.touchZoom=n,this.touchRotate=r,this.tapDragZoom=i,this.rotationDisabled=!1,this.enabled=!0}return(0,s.Z)(t,[{key:"enable",value:function(t){this.touchZoom.enable(t),this.rotationDisabled||this.touchRotate.enable(t),this.tapDragZoom.enable(),P.isMini||this.el.classList.add("l7-touch-zoom-rotate")}},{key:"disable",value:function(){this.touchZoom.disable(),this.touchRotate.disable(),this.tapDragZoom.disable(),P.isMini||this.el.classList.remove("l7-touch-zoom-rotate")}},{key:"isEnabled",value:function(){return this.touchZoom.isEnabled()&&(this.rotationDisabled||this.touchRotate.isEnabled())&&this.tapDragZoom.isEnabled()}},{key:"isActive",value:function(){return this.touchZoom.isActive()||this.touchRotate.isActive()||this.tapDragZoom.isActive()}},{key:"disableRotation",value:function(){this.rotationDisabled=!0,this.touchRotate.disable()}},{key:"enableRotation",value:function(){this.rotationDisabled=!1,this.touchZoom.isEnabled()&&this.touchRotate.enable()}}]),t}();function mn(t,e){for(var n={},r=0;r<t.length;r++)n[t[r].identifier]=e[r];return n}function gn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var yn=function(){function t(e){(0,a.Z)(this,t),this.reset(),this.numTouches=e.numTouches}return(0,s.Z)(t,[{key:"reset",value:function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}},{key:"touchstart",value:function(t,e,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){var e,n=new oe(0,0),r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return gn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n._add(i)}}catch(t){r.e(t)}finally{r.f()}return n.div(t.length)}(e),this.touches=mn(n,e)))}},{key:"touchmove",value:function(t,e,n){if(!this.aborted&&this.centroid){var r=mn(n,e);for(var i in this.touches)if(this.touches[i]){var o=this.touches[i],a=r[i];(!a||a.dist(o)>30)&&(this.aborted=!0)}}}},{key:"touchend",value:function(t,e,n){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}}}]),t}(),vn=function(){function t(e){(0,a.Z)(this,t),this.singleTap=new yn(e),this.numTaps=e.numTaps,this.reset()}return(0,s.Z)(t,[{key:"reset",value:function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}},{key:"touchstart",value:function(t,e,n){this.singleTap.touchstart(t,e,n)}},{key:"touchmove",value:function(t,e,n){this.singleTap.touchmove(t,e,n)}},{key:"touchend",value:function(t,e,n){var r=this.singleTap.touchend(t,e,n);if(r){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(r)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}]),t}(),_n=function(){function t(){(0,a.Z)(this,t),this.tap=new vn({numTouches:1,numTaps:1}),this.reset()}return(0,s.Z)(t,[{key:"reset",value:function(){this.active=!1,delete this.swipePoint,delete this.swipeTouch,delete this.tapTime,this.tap.reset()}},{key:"touchstart",value:function(t,e,n){this.swipePoint||(this.tapTime&&t.timeStamp-this.tapTime>500&&this.reset(),this.tapTime?n.length>0&&(this.swipePoint=e[0],this.swipeTouch=n[0].identifier):this.tap.touchstart(t,e,n))}},{key:"touchmove",value:function(t,e,n){if(this.tapTime){if(this.swipePoint){if(n[0].identifier!==this.swipeTouch)return;var r=e[0],i=r.y-this.swipePoint.y;return this.swipePoint=r,t.preventDefault(),this.active=!0,{zoomDelta:i/128}}}else this.tap.touchmove(t,e,n)}},{key:"touchend",value:function(t,e,n){this.tapTime?this.swipePoint&&0===n.length&&this.reset():this.tap.touchend(t,e,n)&&(this.tapTime=t.timeStamp)}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),t}(),bn=function(){function t(){(0,a.Z)(this,t),this.zoomIn=new vn({numTouches:1,numTaps:2}),this.zoomOut=new vn({numTouches:2,numTaps:1}),this.reset()}return(0,s.Z)(t,[{key:"reset",value:function(){this.active=!1,this.zoomIn.reset(),this.zoomOut.reset()}},{key:"touchstart",value:function(t,e,n){this.zoomIn.touchstart(t,e,n),this.zoomOut.touchstart(t,e,n)}},{key:"touchmove",value:function(t,e,n){this.zoomIn.touchmove(t,e,n),this.zoomOut.touchmove(t,e,n)}},{key:"touchend",value:function(t,e,n){var r=this,i=this.zoomIn.touchend(t,e,n),o=this.zoomOut.touchend(t,e,n);return i?(this.active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this.active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),t}(),xn=function(){function t(e){(0,a.Z)(this,t),this.minTouches=1,this.clickTolerance=e.clickTolerance||1,this.reset()}return(0,s.Z)(t,[{key:"reset",value:function(){this.active=!1,this.touches={},this.sum=new oe(0,0)}},{key:"touchstart",value:function(t,e,n){return this.calculateTransform(t,e,n)}},{key:"touchmove",value:function(t,e,n){if(this.active)return t.preventDefault(),this.calculateTransform(t,e,n)}},{key:"touchend",value:function(t,e,n){this.calculateTransform(t,e,n),this.active&&n.length<this.minTouches&&this.reset()}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}},{key:"calculateTransform",value:function(t,e,n){n.length>0&&(this.active=!0);var r=mn(n,e),i=new oe(0,0),o=new oe(0,0),a=0;for(var s in r)if(r[s]){var u=r[s],l=this.touches[s];l&&(i._add(u),o._add(u.sub(l)),a++,r[s]=u)}if(this.touches=r,!(a<this.minTouches)&&o.mag()){var c=o.div(a);if(this.sum._add(c),!(this.sum.mag()<this.clickTolerance))return{around:i.div(a),panDelta:c}}}}]),t}(),wn=function(){function t(){(0,a.Z)(this,t),this.reset()}return(0,s.Z)(t,[{key:"reset",value:function(){this.active=!1,delete this.firstTwoTouches}},{key:"start",value:function(t){}},{key:"move",value:function(t,e,n){}},{key:"touchstart",value:function(t,e,n){this.firstTwoTouches||n.length<2||(this.firstTwoTouches=[n[0].identifier,n[1].identifier],this.start([e[0],e[1]]))}},{key:"touchmove",value:function(t,e,n){if(this.firstTwoTouches){t.preventDefault();var r=(0,g.Z)(this.firstTwoTouches,2),i=r[0],o=r[1],a=Sn(n,e,i),s=Sn(n,e,o);if(a&&s){var u=this.aroundCenter?null:a.add(s).div(2);return this.move([a,s],u,t)}}}},{key:"touchend",value:function(t,e,n){if(this.firstTwoTouches){var r=(0,g.Z)(this.firstTwoTouches,2),i=r[0],o=r[1],a=Sn(n,e,i),s=Sn(n,e,o);a&&s||(this.active&&Ee.suppressClick(),this.reset())}}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(t){this.enabled=!0,this.aroundCenter=!!t&&"center"===t.around}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),t}();function Sn(t,e,n){for(var r=0;r<t.length;r++)if(t[r].identifier===n)return e[r]}function En(t){return Math.abs(t.y)>Math.abs(t.x)}var Mn=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"reset",value:function(){(0,en.Z)((0,c.Z)(i.prototype),"reset",this).call(this),this.valid=void 0,delete this.firstMove,delete this.lastPoints}},{key:"start",value:function(t){this.lastPoints=t,En(t[0].sub(t[1]))&&(this.valid=!1)}},{key:"move",value:function(t,e,n){var r=t[0].sub(this.lastPoints[0]),i=t[1].sub(this.lastPoints[1]);if(this.valid=this.gestureBeginsVertically(r,i,n.timeStamp),this.valid)return this.lastPoints=t,this.active=!0,{pitchDelta:(r.y+i.y)/2*-.5}}},{key:"gestureBeginsVertically",value:function(t,e,n){if(void 0!==this.valid)return this.valid;var r=t.mag()>=2,i=e.mag()>=2;if(r||i){if(!r||!i)return void 0===this.firstMove&&(this.firstMove=n),n-this.firstMove<100&&void 0;var o=t.y>0==e.y>0;return En(t)&&En(e)&&o}}}]),i}(wn);function Tn(t,e){return 180*t.angleWith(e)/Math.PI}var An=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"reset",value:function(){(0,en.Z)((0,c.Z)(i.prototype),"reset",this).call(this),delete this.minDiameter,delete this.startVector,delete this.vector}},{key:"start",value:function(t){this.startVector=this.vector=t[0].sub(t[1]),this.minDiameter=t[0].dist(t[1])}},{key:"move",value:function(t,e){var n=this.vector;if(this.vector=t[0].sub(t[1]),this.active||!this.isBelowThreshold(this.vector))return this.active=!0,{bearingDelta:Tn(this.vector,n),pinchAround:e}}},{key:"isBelowThreshold",value:function(t){this.minDiameter=Math.min(this.minDiameter,t.mag());var e=25/(Math.PI*this.minDiameter)*360,n=Tn(t,this.startVector);return Math.abs(n)<e}}]),i}(wn);function Cn(t,e){return Math.log(t/e)/Math.LN2}var On=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"reset",value:function(){(0,en.Z)((0,c.Z)(i.prototype),"reset",this).call(this),delete this.distance,delete this.startDistance}},{key:"start",value:function(t){this.startDistance=this.distance=t[0].dist(t[1])}},{key:"move",value:function(t,e){var n=this.distance;if(this.distance=t[0].dist(t[1]),this.active||!(Math.abs(Cn(this.distance,this.startDistance))<.1))return this.active=!0,{zoomDelta:Cn(this.distance,n),pinchAround:e}}}]),i}(wn);function Pn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return kn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function kn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ln=function(t){return t.zoom||t.drag||t.pitch||t.rotate};function In(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Rn=function(){function t(e,n){var r=this;(0,a.Z)(this,t),(0,w.Z)(this,"handleWindowEvent",(function(t){r.handleEvent(t,"".concat(t.type,"Window"))})),(0,w.Z)(this,"handleEvent",(function(t,e){if("blur"!==t.type){r.updatingCamera=!0;var n,i="renderFrame"===t.type?void 0:t,o={needsRenderFrame:!1},a={},s={},u=t.touches?r.getMapTouches(t.touches):void 0,l=u?Ee.touchPos(r.el,u):Ee.mousePos(r.el,t),c=Pn(r.handlers);try{for(c.s();!(n=c.n()).done;){var h=n.value,p=h.handlerName,f=h.handler,d=h.allowed;if(f.isEnabled()){var m=void 0;if(r.blockedByActive(s,d,p))f.reset();else{var g=e||t.type;f&&f[g]&&(m=f[g](t,l,u),r.mergeIHandlerResult(o,a,m,p,i),m&&m.needsRenderFrame&&r.triggerRenderFrame())}(m||f.isActive())&&(s[p]=f)}}}catch(t){c.e(t)}finally{c.f()}var y={};for(var v in r.previousActiveHandlers)s[v]||(y[v]=i);r.previousActiveHandlers=s,(Object.keys(y).length||In(o))&&(r.changes.push([o,a,y]),r.triggerRenderFrame()),(Object.keys(s).length||In(o))&&r.map.stop(!0),r.updatingCamera=!1;var _=o.cameraAnimation;_&&(r.inertia.clear(),r.fireEvents({},{}),r.changes=[],_(r.map))}else r.stop()})),this.map=e,this.el=this.map.getCanvasContainer(),this.handlers=[],this.handlersById={},this.changes=[],this.inertia=new qe(e),this.bearingSnap=n.bearingSnap,this.rotateEnabled=n.rotateEnabled,this.pitchEnabled=n.pitchEnabled,this.previousActiveHandlers={},this.eventsInProgress={},this.addDefaultHandlers(n);var i=this.el;if(this.listeners=[],P.isMini)P.$window.document.addEventListener("touchstart",(function(t){r.handleEvent(t)}),{}),P.$window.document.addEventListener("touchmove",(function(t){r.handleEvent(t)}),{}),P.$window.document.addEventListener("touchend",(function(t){r.handleEvent(t)}),{}),P.$window.document.addEventListener("touchcancel",(function(t){r.handleEvent(t)}),{});else{this.listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[window.document,"mousemove",{capture:!0}],[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],[window,"blur",void 0]];var o,s=Pn(this.listeners);try{for(s.s();!(o=s.n()).done;){var u=(0,g.Z)(o.value,3),l=u[0],c=u[1],h=u[2];Ee.addEventListener(l,c,l===window.document?this.handleWindowEvent:this.handleEvent,h)}}catch(t){s.e(t)}finally{s.f()}}}return(0,s.Z)(t,[{key:"destroy",value:function(){var t,e=Pn(this.listeners);try{for(e.s();!(t=e.n()).done;){var n=(0,g.Z)(t.value,3),r=n[0],i=n[1],o=n[2];Ee.removeEventListener(r,i,r===window.document?this.handleWindowEvent:this.handleEvent,o)}}catch(t){e.e(t)}finally{e.f()}}},{key:"stop",value:function(){if(!this.updatingCamera){var t,e=Pn(this.handlers);try{for(e.s();!(t=e.n()).done;)t.value.handler.reset()}catch(t){e.e(t)}finally{e.f()}this.inertia.clear(),this.fireEvents({},{}),this.changes=[]}}},{key:"isActive",value:function(){var t,e=Pn(this.handlers);try{for(e.s();!(t=e.n()).done;)if(t.value.handler.isActive())return!0}catch(t){e.e(t)}finally{e.f()}return!1}},{key:"isZooming",value:function(){return!!this.eventsInProgress.zoom||this.map.scrollZoom.isZooming()}},{key:"isRotating",value:function(){return!!this.eventsInProgress.rotate}},{key:"isMoving",value:function(){return Boolean(Ln(this.eventsInProgress))||this.isZooming()}},{key:"mergeIHandlerResult",value:function(t,e,n,r,i){if(n){(0,jt.merge)(t,n);var o={handlerName:r,originalEvent:n.originalEvent||i};void 0!==n.zoomDelta&&(e.zoom=o),void 0!==n.panDelta&&(e.drag=o),void 0!==n.pitchDelta&&(e.pitch=o),void 0!==n.bearingDelta&&(e.rotate=o)}}},{key:"triggerRenderFrame",value:function(){var t=this;void 0===this.frameId&&(this.frameId=this.map.requestRenderFrame((function(e){delete t.frameId,t.handleEvent(new je("renderFrame",{timeStamp:e})),t.applyChanges()})))}},{key:"addDefaultHandlers",value:function(t){var e=this.map,n=e.getCanvasContainer();this.add("mapEvent",new tn(e,t));var r=e.boxZoom=new ze(e,t);this.add("boxZoom",r);var i=new bn,o=new Be;e.doubleClickZoom=new hn(o,i),this.add("tapZoom",i),this.add("clickZoom",o);var a=new _n;this.add("tapDragZoom",a);var s=e.touchPitch=new Mn;this.add("touchPitch",s);var u=new an(t),l=new sn(t);e.dragRotate=new fn(t,u,l),this.add("mouseRotate",u,["mousePitch"]),this.add("mousePitch",l,["mouseRotate"]);var c=new on(t),h=new xn(t);e.dragPan=new pn(n,c,h),this.add("mousePan",c),this.add("touchPan",h,["touchZoom","touchRotate"]);var p=new An,f=new On;e.touchZoomRotate=new dn(n,f,p,a),this.add("touchRotate",p,["touchPan","touchZoom"]),this.add("touchZoom",f,["touchPan","touchRotate"]);var d=e.scrollZoom=new cn(e,this);this.add("scrollZoom",d,["mousePan"]);var m=e.keyboard=new Je;this.add("keyboard",m),this.add("blockableMapEvent",new Ne(e));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g++){var v=y[g];t.interactive&&t[v]&&e[v].enable(t[v])}}},{key:"add",value:function(t,e,n){this.handlers.push({handlerName:t,handler:e,allowed:n}),this.handlersById[t]=e}},{key:"blockedByActive",value:function(t,e,n){for(var r in t)if(r!==n&&(!e||e.indexOf(r)<0))return!0;return!1}},{key:"getMapTouches",value:function(t){var e,n=[],r=Pn(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=i.target;(P.isMini||this.el.contains(o))&&n.push(i)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"applyChanges",value:function(){var t,e={},n={},r={},i=Pn(this.changes);try{for(i.s();!(t=i.n()).done;){var o=(0,g.Z)(t.value,3),a=o[0],s=o[1],u=o[2];a.panDelta&&(e.panDelta=(e.panDelta||new oe(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),void 0!==a.around&&(e.around=a.around),void 0!==a.pinchAround&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),(0,jt.merge)(n,s),(0,jt.merge)(r,u)}}catch(t){i.e(t)}finally{i.f()}this.updateMapTransform(e,n,r),this.changes=[]}},{key:"updateMapTransform",value:function(t,e,n){var r=this.map,i=r.transform;if(!In(t))return this.fireEvents(e,n);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,u=t.pitchDelta,l=t.pinchAround,c=t.around;void 0!==l&&(c=l),r.stop(!0),c=c||r.transform.centerPoint;var h=i.pointLocation(o?c.sub(o):c);s&&this.rotateEnabled&&(i.bearing+=s),u&&this.pitchEnabled&&(i.pitch+=u),a&&(i.zoom+=a),i.setLocationAtPoint(h,c),this.map.update(),t.noInertia||this.inertia.record(t),this.fireEvents(e,n)}},{key:"fireEvents",value:function(t,e){var n=this,r=Ln(this.eventsInProgress),i=Ln(t),o={};for(var a in t)if(t[a]){var s=t[a].originalEvent;this.eventsInProgress[a]||(o["".concat(a,"start")]=s),this.eventsInProgress[a]=t[a]}for(var u in!r&&i&&this.fireEvent("movestart",i.originalEvent),o)o[u]&&this.fireEvent(u,o[u]);for(var l in t.rotate&&(this.bearingChanged=!0),i&&this.fireEvent("move",i.originalEvent),t)if(t[l]){var c=t[l].originalEvent;this.fireEvent(l,c)}var h,p={};for(var f in this.eventsInProgress)if(this.eventsInProgress[f]){var d=this.eventsInProgress[f],m=d.handlerName,g=d.originalEvent;this.handlersById[m].isActive()||(delete this.eventsInProgress[f],h=e[m]||g,p["".concat(f,"end")]=h)}for(var y in p)p[y]&&this.fireEvent(y,p[y]);var v=Ln(this.eventsInProgress);if((r||i)&&!v){this.updatingCamera=!0;var _=this.inertia.onMoveEnd(this.map.dragPan.inertiaOptions),b=function(t){return 0!==t&&-n.bearingSnap<t&&t<n.bearingSnap};_?(b(_.bearing||this.map.getBearing())&&(_.bearing=0),this.map.easeTo(_,{originalEvent:h})):(this.map.emit("moveend",new _e("moveend",{originalEvent:h})),b(this.map.getBearing())&&this.map.resetNorth()),this.bearingChanged=!1,this.updatingCamera=!1}}},{key:"fireEvent",value:function(t,e){this.map.emit(t,new _e(t,e?{originalEvent:e}:{}))}}]),t}();const Dn=Rn;var Nn=null,Fn=[],zn=(P.$window.performance,function(t){var e=t;if(null!=Nn){var n=e-Nn;Fn.push(n)}Nn=e});function Bn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return jn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}const Un=function(){function t(){(0,a.Z)(this,t),this.queue=[],this.id=0,this.cleared=!1,this.currentlyRunning=!1}return(0,s.Z)(t,[{key:"add",value:function(t){var e=++this.id;return this.queue.push({callback:t,id:e,cancelled:!1}),e}},{key:"remove",value:function(t){var e,n=this.currentlyRunning,r=Bn(n?this.queue.concat(n):this.queue);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.id===t)return void(i.cancelled=!0)}}catch(t){r.e(t)}finally{r.f()}}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.currentlyRunning=this.queue;this.queue=[];var n,r=Bn(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!i.cancelled&&(i.callback(t),this.cleared))break}}catch(t){r.e(t)}finally{r.f()}this.cleared=!1,this.currentlyRunning=!1}},{key:"clear",value:function(){this.currentlyRunning&&(this.cleared=!0),this.queue=[]}}]),t}();!function(t,e){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(e||(e=document),e)){var i=e.head||e.getElementsByTagName("head")[0];if(!i){i=e.createElement("head");var o=e.body||e.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):e.documentElement.appendChild(i)}var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),i.appendChild(a)}}(".l7-map {\n font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.l7-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.l7-map:-webkit-full-screen {\n width: 100%;\n height: 100%;\n}\n\n.l7-canary {\n background-color: salmon;\n}\n\n.l7-canvas-container.l7-interactive,\n.l7-ctrl-group button.l7-ctrl-compass {\n cursor: -webkit-grab;\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.l7-canvas-container.l7-interactive.l7-track-pointer {\n cursor: pointer;\n}\n\n.l7-canvas-container.l7-interactive:active,\n.l7-ctrl-group button.l7-ctrl-compass:active {\n cursor: -webkit-grabbing;\n cursor: grabbing;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate,\n.l7-canvas-container.l7-touch-zoom-rotate .l7-canvas {\n -ms-touch-action: pan-x pan-y;\n touch-action: pan-x pan-y;\n}\n\n.l7-canvas-container.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-drag-pan .l7-canvas {\n -ms-touch-action: pinch-zoom;\n touch-action: pinch-zoom;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.l7-ctrl-top-left,\n.l7-ctrl-top-right,\n.l7-ctrl-bottom-left,\n.l7-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n.l7-ctrl-top-left { top: 0; left: 0; }\n.l7-ctrl-top-right { top: 0; right: 0; }\n.l7-ctrl-bottom-left { bottom: 0; left: 0; }\n.l7-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.l7-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.l7-ctrl-top-left .l7-ctrl { margin: 10px 0 0 10px; float: left; }\n.l7-ctrl-top-right .l7-ctrl { margin: 10px 10px 0 0; float: right; }\n.l7-ctrl-bottom-left .l7-ctrl { margin: 0 0 10px 10px; float: left; }\n.l7-ctrl-bottom-right .l7-ctrl { margin: 0 10px 10px 0; float: right; }\n\n\n.l7-crosshair,\n.l7-crosshair .l7-interactive,\n.l7-crosshair .l7-interactive:active {\n cursor: crosshair;\n}\n\n.l7-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n z-index: 10;\n}\n");var Zn={hash:!1,zoom:-1,center:[112,32],pitch:0,bearing:0,interactive:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,trackResize:!0,renderWorldCopies:!0,pitchEnabled:!0,rotateEnabled:!0},Vn=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t){var e;return(0,a.Z)(this,i),e=r.call(this,(0,jt.merge)({},Zn,t)),(0,w.Z)((0,x.Z)(e),"renderTaskQueue",new Un),(0,w.Z)((0,x.Z)(e),"trackResize",!0),(0,w.Z)((0,x.Z)(e),"onWindowOnline",(function(){e.update()})),(0,w.Z)((0,x.Z)(e),"onWindowResize",(function(t){e.trackResize&&e.resize({originalEvent:t}).update()})),e.initContainer(),e.resize(),e.handlers=new Dn((0,x.Z)(e),e.options),"undefined"!=typeof window&&(window.addEventListener("online",e.onWindowOnline,!1),window.addEventListener("resize",e.onWindowResize,!1),window.addEventListener("orientationchange",e.onWindowResize,!1)),e}return(0,s.Z)(i,[{key:"resize",value:function(t){var e=this.containerDimensions(),n=e[0],r=e[1];this.transform.resize(n,r);var i=!this.moving;return i&&(this.stop(),this.emit("movestart",new Event("movestart",t)),this.emit("move",new Event("move",t))),this.emit("resize",new Event("resize",t)),i&&this.emit("moveend",new Event("moveend",t)),this}},{key:"getContainer",value:function(){return this.container}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getCanvasContainer",value:function(){return this.canvasContainer}},{key:"project",value:function(t){return this.transform.locationPoint(re.convert(t))}},{key:"unproject",value:function(t){return this.transform.pointLocation(oe.convert(t))}},{key:"getBounds",value:function(){return this.transform.getBounds()}},{key:"getMaxBounds",value:function(){return this.transform.getMaxBounds()}},{key:"setMaxBounds",value:function(t){this.transform.setMaxBounds(ie.convert(t))}},{key:"setStyle",value:function(t){}},{key:"setMinZoom",value:function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between ".concat(-2," and the current maxZoom, inclusive"))}},{key:"getMinZoom",value:function(){return this.transform.minZoom}},{key:"setMaxZoom",value:function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}},{key:"getMaxZoom",value:function(){return this.transform.maxZoom}},{key:"setMinPitch",value:function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to ".concat(0));if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between ".concat(0," and the current maxPitch, inclusive"))}},{key:"getMinPitch",value:function(){return this.transform.minPitch}},{key:"setMaxPitch",value:function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to ".concat(60));if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}},{key:"getMaxPitch",value:function(){return this.transform.maxPitch}},{key:"getRenderWorldCopies",value:function(){return this.transform.renderWorldCopies}},{key:"setRenderWorldCopies",value:function(t){this.transform.renderWorldCopies=!!t}},{key:"remove",value:function(){this.frame&&(this.frame.cancel(),this.frame=null),this.renderTaskQueue.clear()}},{key:"requestRenderFrame",value:function(t){return this.update(),this.renderTaskQueue.add(t)}},{key:"cancelRenderFrame",value:function(t){return this.renderTaskQueue.remove(t)}},{key:"triggerRepaint",value:function(){var t=this;this.frame||(this.frame=ee((function(e){zn(e),t.frame=null,t.update(e)})))}},{key:"update",value:function(t){var e=this;this.frame||(this.frame=ee((function(n){zn(n),e.frame=null,e.renderTaskQueue.run(t)})))}},{key:"initContainer",value:function(){if("string"==typeof this.options.container){if(this.container=window.document.getElementById(this.options.container),!this.container)throw new Error("Container '".concat(this.options.container,"' not found."))}else{if(!(this.options.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this.container=this.options.container}var t=this.container;t.classList.add("l7-map");var e=this.canvasContainer=P.DOM.create("div","l7-canvas-container",t);this.options.interactive&&e.classList.add("l7-interactive")}},{key:"containerDimensions",value:function(){var t=0,e=0;return this.container&&(t=this.container.clientWidth||400,e=this.container.clientHeight||300),[t,e]}},{key:"resizeCanvas",value:function(t,e){var n=P.DOM.DPR||1;this.canvas.width=n*t,this.canvas.height=n*e,this.canvas.style.width="".concat(t,"px"),this.canvas.style.height="".concat(e,"px")}}]),i}(be),Gn=function(){function t(e){var n=this;(0,a.Z)(this,t),(0,w.Z)(this,"onHashChange",(function(){var t=n.getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(+t)}))){var e=n.map.dragRotate.isEnabled()&&n.map.touchZoomRotate.isEnabled()?+(t[3]||0):n.map.getBearing();return n.map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1})),(0,w.Z)(this,"getCurrentHash",(function(){var t,e=window.location.hash.replace("#","");return n.hashName?(e.split("&").map((function(t){return t.split("=")})).forEach((function(e){e[0]===n.hashName&&(t=e)})),(t&&t[1]||"").split("/")):e.split("/")})),(0,w.Z)(this,"updateHashUnthrottled",(function(){var t=n.getHashString();try{window.history.replaceState(window.history.state,"",t)}catch(t){}})),this.hashName=e&&encodeURIComponent(e),this.updateHash=(0,jt.throttle)(this.updateHashUnthrottled,300)}return(0,s.Z)(t,[{key:"addTo",value:function(t){return this.map=t,P.$window.addEventListener("hashchange",this.onHashChange,!1),this.map.on("moveend",this.updateHash),this}},{key:"remove",value:function(){return P.$window.removeEventListener("hashchange",this.onHashChange,!1),this.map.off("moveend",this.updateHash),delete this.map,this}},{key:"getHashString",value:function(t){var e=this.map.getCenter(),n=Math.round(100*this.map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,r),o=Math.round(e.lng*i)/i,a=Math.round(e.lat*i)/i,s=this.map.getBearing(),u=this.map.getPitch(),l="";if(l+=t?"/".concat(o,"/").concat(a,"/").concat(n):"".concat(n,"/").concat(a,"/").concat(o),(s||u)&&(l+="/".concat(Math.round(10*s)/10)),u&&(l+="/".concat(Math.round(u))),this.hashName){var c=this.hashName,h=!1,p=window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===c?(h=!0,"".concat(e,"=").concat(l)):t})).filter((function(t){return t}));return h||p.push("".concat(c,"=").concat(l)),"#".concat(p.join("&"))}return"#".concat(l)}}]),t}();const Hn=Gn;!function(t,e){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(e||(e=document),e)){var i=e.head||e.getElementsByTagName("head")[0];if(!i){i=e.createElement("head");var o=e.body||e.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):e.documentElement.appendChild(i)}var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),i.appendChild(a)}}(".l7-map {\n font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.l7-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.l7-map:-webkit-full-screen {\n width: 100%;\n height: 100%;\n}\n\n.l7-canary {\n background-color: salmon;\n}\n\n.l7-canvas-container.l7-interactive,\n.l7-ctrl-group button.l7-ctrl-compass {\n cursor: -webkit-grab;\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.l7-canvas-container.l7-interactive.l7-track-pointer {\n cursor: pointer;\n}\n\n.l7-canvas-container.l7-interactive:active,\n.l7-ctrl-group button.l7-ctrl-compass:active {\n cursor: -webkit-grabbing;\n cursor: grabbing;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate,\n.l7-canvas-container.l7-touch-zoom-rotate .l7-canvas {\n -ms-touch-action: pan-x pan-y;\n touch-action: pan-x pan-y;\n}\n\n.l7-canvas-container.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-drag-pan .l7-canvas {\n -ms-touch-action: pinch-zoom;\n touch-action: pinch-zoom;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n.l7-ctrl-top-left,\n.l7-ctrl-top-right,\n.l7-ctrl-bottom-left,\n.l7-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n.l7-ctrl-top-left { top: 0; left: 0; }\n.l7-ctrl-top-right { top: 0; right: 0; }\n.l7-ctrl-bottom-left { bottom: 0; left: 0; }\n.l7-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.l7-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.l7-ctrl-top-left .l7-ctrl { margin: 10px 0 0 10px; float: left; }\n.l7-ctrl-top-right .l7-ctrl { margin: 10px 10px 0 0; float: right; }\n.l7-ctrl-bottom-left .l7-ctrl { margin: 0 0 10px 10px; float: left; }\n.l7-ctrl-bottom-right .l7-ctrl { margin: 0 10px 10px 0; float: right; }\n\n\n.l7-crosshair,\n.l7-crosshair .l7-interactive,\n.l7-crosshair .l7-interactive:active {\n cursor: crosshair;\n}\n\n.l7-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n z-index: 10;\n}\n");var Wn,qn,Yn,Xn,$n,Kn,Jn,Qn,tr,er,nr,rr,ir={hash:!1,zoom:-1,center:[112,32],pitch:0,bearing:0,interactive:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,trackResize:!0,renderWorldCopies:!0,pitchEnabled:!0,rotateEnabled:!0},or=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t){var e;if((0,a.Z)(this,i),e=r.call(this,(0,jt.merge)({},ir,t)),(0,w.Z)((0,x.Z)(e),"renderTaskQueue",new Un),(0,w.Z)((0,x.Z)(e),"trackResize",!0),(0,w.Z)((0,x.Z)(e),"onWindowOnline",(function(){e.update()})),(0,w.Z)((0,x.Z)(e),"onWindowResize",(function(t){e.trackResize&&e.resize({originalEvent:t}).update()})),P.isMini?e.initMiniContainer():e.initContainer(),e.resize(),e.handlers=new Dn((0,x.Z)(e),e.options),"undefined"!=typeof window&&(window.addEventListener("online",e.onWindowOnline,!1),window.addEventListener("resize",e.onWindowResize,!1),window.addEventListener("orientationchange",e.onWindowResize,!1)),!P.isMini){var n="string"==typeof t.hash&&t.hash||void 0;t.hash&&(e.hash=new Hn(n).addTo((0,x.Z)(e)))}return e.hash&&e.hash.onHashChange()||(e.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(e.resize(),e.fitBounds(t.bounds,(0,jt.merge)({},t.fitBoundsOptions,{duration:0})))),e}return(0,s.Z)(i,[{key:"resize",value:function(t){var e=this.containerDimensions(),n=(0,g.Z)(e,2),r=n[0],i=n[1];if(this.transform.resize(r,i),P.isMini)return this;var o=!this.moving;return o&&(this.stop(),this.emit("movestart",new P.$window.Event("movestart",t)),this.emit("move",new P.$window.Event("move",t))),this.emit("resize",new P.$window.Event("resize",t)),o&&this.emit("moveend",new P.$window.Event("moveend",t)),this}},{key:"getContainer",value:function(){return this.container}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getCanvasContainer",value:function(){return this.canvasContainer}},{key:"project",value:function(t){return this.transform.locationPoint(re.convert(t))}},{key:"unproject",value:function(t){return this.transform.pointLocation(oe.convert(t))}},{key:"getBounds",value:function(){return this.transform.getBounds()}},{key:"getMaxBounds",value:function(){return this.transform.getMaxBounds()}},{key:"setMaxBounds",value:function(t){this.transform.setMaxBounds(ie.convert(t))}},{key:"setStyle",value:function(t){}},{key:"setMinZoom",value:function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between ".concat(-2," and the current maxZoom, inclusive"))}},{key:"getMinZoom",value:function(){return this.transform.minZoom}},{key:"setMaxZoom",value:function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}},{key:"getMaxZoom",value:function(){return this.transform.maxZoom}},{key:"setMinPitch",value:function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to ".concat(0));if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between ".concat(0," and the current maxPitch, inclusive"))}},{key:"getMinPitch",value:function(){return this.transform.minPitch}},{key:"setMaxPitch",value:function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to ".concat(60));if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}},{key:"getMaxPitch",value:function(){return this.transform.maxPitch}},{key:"getRenderWorldCopies",value:function(){return this.transform.renderWorldCopies}},{key:"setRenderWorldCopies",value:function(t){this.transform.renderWorldCopies=!!t}},{key:"remove",value:function(){this.container.removeChild(this.canvasContainer),this.canvasContainer=null,this.frame&&(this.frame.cancel(),this.frame=null),this.renderTaskQueue.clear()}},{key:"requestRenderFrame",value:function(t){return this.update(),this.renderTaskQueue.add(t)}},{key:"cancelRenderFrame",value:function(t){return this.renderTaskQueue.remove(t)}},{key:"triggerRepaint",value:function(){var t=this;this.frame||(this.frame=ee((function(e){zn(e),t.frame=null,t.update(e)})))}},{key:"update",value:function(t){var e=this;this.frame||(this.frame=ee((function(n){zn(n),e.frame=null,e.renderTaskQueue.run(t)})))}},{key:"initContainer",value:function(){if("string"==typeof this.options.container){if(this.container=window.document.getElementById(this.options.container),!this.container)throw new Error("Container '".concat(this.options.container,"' not found."))}else{if(!(this.options.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this.container=this.options.container}var t=this.container;t.classList.add("l7-map");var e=this.canvasContainer=P.DOM.create("div","l7-canvas-container",t);this.options.interactive&&e.classList.add("l7-interactive")}},{key:"initMiniContainer",value:function(){this.container=this.options.canvas,this.canvasContainer=this.container}},{key:"containerDimensions",value:function(){var t=0,e=0;return this.container&&(P.isMini?(t=this.container.width/P.$window.devicePixelRatio,e=this.container.height/P.$window.devicePixelRatio):(t=0===(t=this.container.clientWidth)?400:t,e=0===(e=this.container.clientHeight)?300:e)),[t,e]}}]),i}(be),ar={light:"mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29",dark:"mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7",normal:"mapbox://styles/mapbox/streets-v11",blank:{version:8,sources:{},layers:[{id:"background",type:"background",layout:{visibility:"none"}}]}},sr={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},ur=(Wn=(0,A.b2)(),qn=(0,A.f3)(d.TYPES.MapConfig),Yn=(0,A.f3)(d.TYPES.IGlobalConfigService),Xn=(0,A.f3)(d.TYPES.ICoordinateSystemService),$n=(0,A.f3)(d.TYPES.IEventEmitter),Wn((Jn=function(){function t(){var e=this;(0,a.Z)(this,t),(0,w.Z)(this,"version",k.G.DEFUALT),(0,w.Z)(this,"simpleMapCoord",new L),(0,w.Z)(this,"bgColor","rgba(0.0, 0.0, 0.0, 0.0)"),(0,p.Z)(this,"config",Qn,this),(0,p.Z)(this,"configService",tr,this),(0,p.Z)(this,"coordinateSystemService",er,this),(0,p.Z)(this,"eventEmitter",nr,this),(0,w.Z)(this,"handleCameraChanged",(function(t){var n=e.map.getCenter(),r=n.lat,i=n.lng;e.emit("mapchange"),e.viewport.syncWithMapCamera({bearing:e.map.getBearing(),center:[i,r],viewportHeight:e.map.transform.height,pitch:e.map.getPitch(),viewportWidth:e.map.transform.width,zoom:e.map.getZoom(),cameraHeight:0}),e.updateCoordinateSystemService(),e.cameraChangedCallback(e.viewport)}))}return(0,s.Z)(t,[{key:"setBgColor",value:function(t){this.bgColor=t}},{key:"addMarkerContainer",value:function(){var t=this.map.getCanvasContainer();this.markerContainer=P.DOM.create("div","l7-marker-container",t),this.markerContainer.setAttribute("tabindex","-1")}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"getOverlayContainer",value:function(){}},{key:"on",value:function(t,e){-1!==d.MapServiceEvent.indexOf(t)?this.eventEmitter.on(t,e):this.map.on(sr[t]||t,e)}},{key:"off",value:function(t,e){this.map.off(sr[t]||t,e),this.eventEmitter.off(t,e)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"getMapCanvasContainer",value:function(){return this.map.getCanvasContainer()}},{key:"getSize",value:function(){if(this.version===k.G.SIMPLE)return this.simpleMapCoord.getSize();var t=this.map.transform;return[t.width,t.height]}},{key:"getType",value:function(){return"default"}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"setZoom",value:function(t){return this.map.setZoom(t)}},{key:"getCenter",value:function(){return this.map.getCenter()}},{key:"setCenter",value:function(t){this.map.setCenter(t)}},{key:"getPitch",value:function(){return this.map.getPitch()}},{key:"getRotation",value:function(){return this.map.getBearing()}},{key:"getBounds",value:function(){return this.map.getBounds().toArray()}},{key:"getMinZoom",value:function(){return this.map.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.map.getMaxZoom()}},{key:"setRotation",value:function(t){this.map.setBearing(t)}},{key:"zoomIn",value:function(t,e){this.map.zoomIn(t,e)}},{key:"zoomOut",value:function(t,e){this.map.zoomOut(t,e)}},{key:"setPitch",value:function(t){return this.map.setPitch(t)}},{key:"panTo",value:function(t){this.map.panTo(t)}},{key:"panBy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.map.panBy([t,e])}},{key:"fitBounds",value:function(t,e){this.map.fitBounds(t,e)}},{key:"setMaxZoom",value:function(t){this.map.setMaxZoom(t)}},{key:"setMinZoom",value:function(t){this.map.setMinZoom(t)}},{key:"setMapStatus",value:function(t){!0===t.doubleClickZoom&&this.map.doubleClickZoom.enable(),!1===t.doubleClickZoom&&this.map.doubleClickZoom.disable(),!1===t.dragEnable&&this.map.dragPan.disable(),!0===t.dragEnable&&this.map.dragPan.enable(),!1===t.rotateEnable&&this.map.dragRotate.disable(),!0===t.dragEnable&&this.map.dragRotate.enable(),!1===t.keyboardEnable&&this.map.keyboard.disable(),!0===t.keyboardEnable&&this.map.keyboard.enable(),!1===t.zoomEnable&&this.map.scrollZoom.disable(),!0===t.zoomEnable&&this.map.scrollZoom.enable()}},{key:"setZoomAndCenter",value:function(t,e){this.map.flyTo({zoom:t,center:e})}},{key:"setMapStyle",value:function(t){this.map.setStyle(this.getMapStyleValue(t))}},{key:"meterToCoord",value:function(t,e){return 1}},{key:"pixelToLngLat",value:function(t){return this.map.unproject(t)}},{key:"lngLatToPixel",value:function(t){return this.map.project(t)}},{key:"containerToLngLat",value:function(t){return this.map.unproject(t)}},{key:"lngLatToContainer",value:function(t){return this.map.project(t)}},{key:"getMapStyle",value:function(){try{var t,e=null!==(t=this.map.getStyle().sprite)&&void 0!==t?t:"";return/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(e)?null==e?void 0:e.replace(/\/\w+$/,"").replace(/sprites/,"styles"):e}catch(t){return""}}},{key:"getMapStyleConfig",value:function(){return ar}},{key:"getMapStyleValue",value:function(t){var e;return null!==(e=this.getMapStyleConfig()[t])&&void 0!==e?e:t}},{key:"destroy",value:function(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).emit.apply(e,[t].concat(r))}},{key:"once",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).once.apply(e,[t].concat(r))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"exportMap",value:function(t){var e=this.map.getCanvas();return"jpg"===t?null==e?void 0:e.toDataURL("image/jpeg"):null==e?void 0:e.toDataURL("image/png")}},{key:"onCameraChanged",value:function(t){this.cameraChangedCallback=t}},{key:"creatMapContainer",value:function(t){var e=t;return"string"==typeof t&&(e=document.getElementById(t)),e}},{key:"updateView",value:function(t){this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:t.bearing,center:t.center,viewportHeight:t.viewportHeight,pitch:t.pitch,viewportWidth:t.viewportWidth,zoom:t.zoom,cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}},{key:"updateCoordinateSystemService",value:function(){var t=this.config.offsetCoordinate,e=void 0===t||t;this.viewport.getZoom()>12&&e?this.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.LNGLAT)}}]),t}(),Qn=(0,f.Z)(Jn.prototype,"config",[qn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tr=(0,f.Z)(Jn.prototype,"configService",[Yn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),er=(0,f.Z)(Jn.prototype,"coordinateSystemService",[Xn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nr=(0,f.Z)(Jn.prototype,"eventEmitter",[$n],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kn=Jn))||Kn),lr=function(){function t(){(0,a.Z)(this,t),(0,w.Z)(this,"xzReg",.6*-Math.PI),(0,w.Z)(this,"yReg",.2*Math.PI),(0,w.Z)(this,"earthCameraRadius",200),(0,w.Z)(this,"earthCameraZoom",1),(0,w.Z)(this,"cameraPosition",T.create()),(0,w.Z)(this,"projectionMatrix",M.create()),(0,w.Z)(this,"modelMatrix",M.create()),(0,w.Z)(this,"viewMatrix",M.create()),(0,w.Z)(this,"viewProjectionMatrix",M.create()),(0,w.Z)(this,"ViewProjectionMatrixUncentered",M.create()),(0,w.Z)(this,"viewUncenteredMatrix",M.create())}return(0,s.Z)(t,[{key:"syncWithMapCamera",value:function(t){var e=t.viewportHeight,n=void 0===e?1:e,r=t.viewportWidth,i=(void 0===r?1:r)/n;M.perspective(this.projectionMatrix,20,i,.1,1e4);var o=this.earthCameraRadius*Math.cos(this.xzReg),a=this.earthCameraRadius*Math.sin(this.xzReg),s=this.earthCameraRadius*Math.sin(this.yReg);this.cameraPosition=T.fromValues(o,s,a),T.normalize(this.cameraPosition,this.cameraPosition),T.multiply(this.cameraPosition,this.cameraPosition,T.fromValues(this.earthCameraRadius,this.earthCameraRadius,this.earthCameraRadius)),T.scale(this.cameraPosition,this.cameraPosition,this.earthCameraZoom);var u=T.create();T.cross(u,this.cameraPosition,T.fromValues(0,1,0));var l=T.fromValues(0,1,0);T.cross(l,u,this.cameraPosition);var c=T.fromValues(0,0,0);M.lookAt(this.viewMatrix,this.cameraPosition,c,l),this.viewUncenteredMatrix=M.clone(this.viewMatrix),M.multiply(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),M.multiply(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}},{key:"rotateY",value:function(t){this.xzReg+=t*Math.min(this.earthCameraZoom*this.earthCameraZoom,1)}},{key:"rotateX",value:function(t){this.yReg+=t*Math.min(this.earthCameraZoom*this.earthCameraZoom,1)}},{key:"scaleZoom",value:function(t){this.earthCameraZoom+=t,this.earthCameraZoom=Math.max(this.earthCameraZoom,.6)}},{key:"getZoom",value:function(){return 4}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[0,0]}},{key:"getProjectionMatrix",value:function(){return this.projectionMatrix}},{key:"getModelMatrix",value:function(){return this.modelMatrix}},{key:"getViewMatrix",value:function(){return this.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewMatrix}},{key:"getViewProjectionMatrix",value:function(){return this.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(t,e){return this.viewport.projectFlat(t,e)}}]),t}(),cr=["id","style","rotation"];var hr={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},pr=(0,A.b2)()(rr=function(t){(0,u.Z)(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,c.Z)(n);if(r){var i=(0,c.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,l.Z)(this,t)});function o(){var t;(0,a.Z)(this,o);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,w.Z)((0,x.Z)(t),"version",k.G.GLOBEL),(0,w.Z)((0,x.Z)(t),"dragging",!1),(0,w.Z)((0,x.Z)(t),"handleCameraChanged",(function(e){t.emit("mapchange"),t.handleCameraChanging=!0,t.handleCameraTimer&&clearTimeout(t.handleCameraTimer),t.handleCameraTimer=setTimeout((function(){t.handleCameraChanging=!1}),2e3);e.type&&e.originalEvent&&("wheel"===e.originalEvent.type&&t.viewport.scaleZoom(.01*Math.sign(e.originalEvent.wheelDelta)*-1),Math.abs(e.originalEvent.movementX)>Math.abs(e.originalEvent.movementY)?e.originalEvent.movementX>0?t.viewport.rotateY(.02):e.originalEvent.movementX<0&&t.viewport.rotateY(-.02):e.originalEvent.movementY>0?t.viewport.rotateX(.02):e.originalEvent.movementY<0&&t.viewport.rotateX(-.02));var n=t.config.offsetCoordinate,r=void 0===n||n;t.viewport.syncWithMapCamera({viewportHeight:t.map.transform.height,viewportWidth:t.map.transform.width}),t.viewport.getZoom()>12&&r?t.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.LNGLAT_OFFSET):t.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.LNGLAT),t.cameraChangedCallback(t.viewport)})),t}return(0,s.Z)(o,[{key:"lngLatToMercator",value:function(t,e){throw new Error("Method not implemented.")}},{key:"getModelMatrix",value:function(t,e,n,r,i){throw new Error("Method not implemented.")}},{key:"on",value:function(t,e){-1!==d.MapServiceEvent.indexOf(t)?this.eventEmitter.on(t,e):this.map.on(hr[t]||t,e)}},{key:"off",value:function(t,e){this.map.off(hr[t]||t,e),this.eventEmitter.off(t,e)}},{key:"getMapCanvasContainer",value:function(){return this.map.getCanvasContainer()}},{key:"getSize",value:function(){var t=this.map.transform;return[t.width,t.height]}},{key:"getType",value:function(){return"earth"}},{key:"init",value:(e=(0,b.Z)(E().mark((function t(){var e,n,r,i,o,a,s,u;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.config,n=e.id,r=void 0===n?"map":n,i=e.style,o=void 0===i?"light":i,a=e.rotation,s=void 0===a?0:a,u=(0,_.Z)(e,cr),this.viewport=new lr,this.$mapContainer=this.creatMapContainer(r),this.map=new Vn((0,h.Z)({container:this.$mapContainer,style:this.getMapStyleValue(o),bearing:s},u)),this.map.on("load",this.handleCameraChanged),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged({});case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"destroy",value:function(){var t,e;null===(t=this.$mapContainer)||void 0===t||null===(e=t.parentNode)||void 0===e||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).emit.apply(e,[t].concat(r))}},{key:"once",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).once.apply(e,[t].concat(r))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"onCameraChanged",value:function(t){this.cameraChangedCallback=t}},{key:"rotateY",value:function(t){var e=t||{},n=e.force,r=void 0!==n&&n,i=e.reg,o=void 0===i?.01:i;this.handleCameraChanging&&!r||this.viewport&&(this.viewport.rotateY(o),this.viewport.syncWithMapCamera({viewportHeight:this.map.transform.height,viewportWidth:this.map.transform.width}),this.cameraChangedCallback(this.viewport))}}]),o}(ur))||rr;var fr,dr=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"getServiceConstructor",value:function(){return pr}}]),i}(m),mr=["id","style","rotation","mapInstance","version","mapSize","interactive"],gr=["id","style","rotation","mapInstance","canvas","hasBaseMap"];var yr=(0,A.b2)()(fr=function(t){(0,u.Z)(p,t);var e,n,r,i,o=(r=p,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,c.Z)(r);if(i){var n=(0,c.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,l.Z)(this,t)});function p(){var t;(0,a.Z)(this,p);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=o.call.apply(o,[this].concat(n)),(0,w.Z)((0,x.Z)(t),"version",k.G.DEFUALT),(0,w.Z)((0,x.Z)(t),"handleMiniCameraChanged",(function(e,n,r,i,o){var a=t.config.offsetCoordinate,s=void 0===a||a;t.viewport.syncWithMapCamera({bearing:i,center:[e,n],viewportHeight:t.map.transform.height,pitch:o,viewportWidth:t.map.transform.width,zoom:r,cameraHeight:0}),t.viewport.getZoom()>12&&s?t.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.LNGLAT_OFFSET):t.coordinateSystemService.setCoordinateSystem(d.CoordinateSystem.LNGLAT),t.cameraChangedCallback(t.viewport)})),t}return(0,s.Z)(p,[{key:"lngLatToCoord",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:0,y:0,z:0},n=this.lngLatToMercator(t,0),r=n.x,i=n.y;return[r-e.x,i-e.y]}},{key:"lngLatToMercator",value:function(t,e){var n=de.fromLngLat(t,e),r=n.x,i=void 0===r?0:r,o=n.y,a=void 0===o?0:o,s=n.z;return{x:i,y:a,z:void 0===s?0:s}}},{key:"getModelMatrix",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{x:0,y:0,z:0},o=de.fromLngLat(t,e),a=o.meterInMercatorCoordinateUnits(),s=M.create();return M.translate(s,s,T.fromValues(o.x-i.x,o.y-i.y,o.z||0-i.z)),M.scale(s,s,T.fromValues(a*r[0],-a*r[1],a*r[2])),M.rotateX(s,s,n[0]),M.rotateY(s,s,n[1]),M.rotateZ(s,s,n[2]),s}},{key:"init",value:(n=(0,b.Z)(E().mark((function t(){var e,n,r,i,o,a,s,u,l,c,p,f,d,m,g,y=this;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.config,n=e.id,r=void 0===n?"map":n,i=e.style,o=void 0===i?"light":i,a=e.rotation,s=void 0===a?0:a,u=e.mapInstance,l=e.version,c=void 0===l?"DEFAULTMAP":l,p=e.mapSize,f=void 0===p?1e4:p,d=e.interactive,m=void 0===d||d,g=(0,_.Z)(e,mr),this.viewport=new st,this.version=c,this.simpleMapCoord.setSize(f),c===k.G.SIMPLE&&g.center&&(g.center=this.simpleMapCoord.unproject(g.center)),u?(this.map=u,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatMapContainer(r),this.map=new or((0,h.Z)({container:this.$mapContainer,style:this.getMapStyleValue(o),bearing:s},g))),this.map.on("load",(function(){y.handleCameraChanged()})),m&&this.map.on("move",this.handleCameraChanged),setTimeout((function(){y.handleCameraChanged()}),100),this.handleCameraChanged();case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"initMiniMap",value:(e=(0,b.Z)(E().mark((function t(){var e,n,r,i,o,a,s,u,l,c,p,f=this;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(e=this.config).id,n=e.style,r=void 0===n?"light":n,i=e.rotation,o=void 0===i?0:i,e.mapInstance,a=e.canvas,s=void 0===a?null:a,u=e.hasBaseMap,l=void 0!==u&&u,c=(0,_.Z)(e,gr),this.viewport=new st,this.$mapContainer=s,this.map=new or((0,h.Z)({container:this.$mapContainer,style:this.getMapStyleValue(r),bearing:o,canvas:s},c)),l?(p=this.map.getCenter(),this.handleMiniCameraChanged(p.lng,p.lat,this.map.getZoom(),this.map.getBearing(),this.map.getPitch()),P.$window.document.addEventListener("mapCameaParams",(function(t){var e=t.e,n=e.longitude,r=e.latitude,i=e.scale,o=e.bearing,a=e.pitch;f.handleMiniCameraChanged(n,r,i-1.25,o,a)}))):(this.map.on("load",this.handleCameraChanged),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged());case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"exportMap",value:function(t){var e=this.map.getCanvas();return"jpg"===t?null==e?void 0:e.toDataURL("image/jpeg"):null==e?void 0:e.toDataURL("image/png")}}]),p}(ur))||fr;var vr,_r=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"getServiceConstructor",value:function(){return yr}}]),i}(m),br=n(2946),xr=n.n(br),wr=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"syncWithMapCamera",value:function(t){var e=t.center,n=t.zoom,r=t.pitch,i=t.bearing,o=t.viewportHeight,a=t.viewportWidth;this.viewport=new at({width:a,height:o,longitude:e&&e[0],latitude:e&&e[1],zoom:n,pitch:r,bearing:i})}},{key:"getZoom",value:function(){return this.viewport.zoom}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[this.viewport.longitude,this.viewport.latitude]}},{key:"getProjectionMatrix",value:function(){return this.viewport.projectionMatrix}},{key:"getModelMatrix",value:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},{key:"getViewMatrix",value:function(){return this.viewport.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.viewMatrixUncentered}},{key:"getViewProjectionMatrix",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(t,e){return this.viewport.projectFlat(t,e)}}]),t}(),Sr=["id","attributionControl","style","token","rotation","mapInstance"];!function(t,e){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(e||(e=document),e)){var i=e.head||e.getElementsByTagName("head")[0];if(!i){i=e.createElement("head");var o=e.body||e.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):e.documentElement.appendChild(i)}var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),i.appendChild(a)}}(".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{-ms-touch-action:pinch-zoom;touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{-ms-touch-action:none;touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;-webkit-transform:translate(0);transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 0 2px ButtonText;box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{-webkit-box-shadow:0 0 2px 2px #0096ff;box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{-webkit-box-shadow:0 0 2px 2px #0096ff;box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){-webkit-box-shadow:none;box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;-webkit-box-sizing:border-box;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:-webkit-box;display:-ms-flexbox;display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 0 3px rgba(0,0,0,.35);box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);transform:scale(3);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}"),window.mapboxgl=xr();var Er=0,Mr="101MlGsZ2AmmA&access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg",Tr=(0,A.b2)()(vr=function(t){(0,u.Z)(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,c.Z)(n);if(r){var i=(0,c.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,l.Z)(this,t)});function o(){var t;(0,a.Z)(this,o);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=i.call.apply(i,[this].concat(n)),(0,w.Z)((0,x.Z)(t),"version",k.G.MAPBOX),t}return(0,s.Z)(o,[{key:"getType",value:function(){return"mapbox"}},{key:"lngLatToCoord",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:0,y:0,z:0},n=this.lngLatToMercator(t,0),r=n.x,i=n.y;return[r-e.x,i-e.y]}},{key:"lngLatToMercator",value:function(t,e){var n=window.mapboxgl.MercatorCoordinate.fromLngLat(t,e),r=n.x,i=void 0===r?0:r,o=n.y,a=void 0===o?0:o,s=n.z;return{x:i,y:a,z:void 0===s?0:s}}},{key:"getModelMatrix",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{x:0,y:0,z:0},o=window.mapboxgl.MercatorCoordinate.fromLngLat(t,e),a=o.meterInMercatorCoordinateUnits(),s=M.create();return M.translate(s,s,T.fromValues(o.x-i.x,o.y-i.y,o.z||0-i.z)),M.scale(s,s,T.fromValues(a*r[0],-a*r[1],a*r[2])),M.rotateX(s,s,n[0]),M.rotateY(s,s,n[1]),M.rotateZ(s,s,n[2]),s}},{key:"init",value:(e=(0,b.Z)(E().mark((function t(){var e,n,r,i,o,a,s,u,l,c,p,f,d,m=this;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this.config,n=e.id,r=void 0===n?"map":n,i=e.attributionControl,o=void 0!==i&&i,a=e.style,s=void 0===a?"light":a,u=e.token,l=void 0===u?Mr:u,c=e.rotation,p=void 0===c?0:c,f=e.mapInstance,d=(0,_.Z)(e,Sr),this.viewport=new wr,f||window.mapboxgl||console.error(this.configService.getSceneWarninfo("SDK")),l!==Mr||"blank"===s||window.mapboxgl.accessToken||f||console.warn(this.configService.getSceneWarninfo("MapToken")),f||window.mapboxgl.accessToken||(window.mapboxgl.accessToken=l),f?(this.map=f,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatMapContainer(r),this.map=new window.mapboxgl.Map((0,h.Z)({container:this.$mapContainer,style:this.getMapStyleValue(s),attributionControl:o,bearing:p},d))),this.map.on("load",(function(){m.handleCameraChanged()})),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged();case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"destroy",value:function(){var t,e;null===(t=this.$mapContainer)||void 0===t||null===(e=t.parentNode)||void 0===e||e.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).emit.apply(e,[t].concat(r))}},{key:"once",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.eventEmitter).once.apply(e,[t].concat(r))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"meterToCoord",value:function(t,e){var n=new(xr().LngLat)(t[0],t[1]),r=new(xr().LngLat)(e[0],e[1]),i=n.distanceTo(r),o=xr().MercatorCoordinate.fromLngLat({lng:t[0],lat:t[1]}),a=xr().MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]}),s=o.x,u=o.y,l=a.x,c=a.y;return 4194304*Math.sqrt(Math.pow(s-l,2)+Math.pow(u-c,2))*2/i}},{key:"exportMap",value:function(t){var e=this.map.getCanvas();return"jpg"===t?null==e?void 0:e.toDataURL("image/jpeg"):null==e?void 0:e.toDataURL("image/png")}},{key:"creatMapContainer",value:function(t){var e=t;"string"==typeof t&&(e=document.getElementById(t));var n=document.createElement("div");return n.style.cssText+="\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n ",n.id="l7_mapbox_div"+Er++,e.appendChild(n),n}}]),o}(ur))||vr;!function(t,e){var n="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,r="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram);if(!n&&!r&&(e||(e=document),e)){var i=e.head||e.getElementsByTagName("head")[0];if(!i){i=e.createElement("head");var o=e.body||e.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):e.documentElement.appendChild(i)}var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),i.appendChild(a)}}(".mapboxgl-ctrl-logo {\n display: none !important;\n}\n");var Ar=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,a.Z)(this,i),r.apply(this,arguments)}return(0,s.Z)(i,[{key:"getServiceConstructor",value:function(){return Tr}}]),i}(m)},5895:(t,e,n)=>{"use strict";n.d(e,{G:()=>r});var r=function(t){return t["GAODE1.x"]="GAODE1.x",t["GAODE2.x"]="GAODE2.x",t.MAPBOX="MAPBOX",t.DEFUALT="DEFUALTMAP",t.SIMPLE="SIMPLE",t.GLOBEL="GLOBEL",t}({})},5868:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Scene:()=>lt});var r,i,o,a,s,u,l,c,h,p,f,d,m,g,y,v=n(3659),_=n(5162),b=n(800),x=n(3192),w=n(6838),S=n(1109),E=n.n(S),M=n(1522),T=n(108),A=n(1301),C=n(6297),O=n(5619),P=n(7745),k=n(5499),L=n.n(k),I=(n(171),function(){function t(e,n){(0,x.Z)(this,t);var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,s=n.size,u=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:u||0},s&&(this.attribute.size=s)}return(0,w.Z)(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}()),R=(r={},(0,C.Z)(r,T.gl.POINTS,"points"),(0,C.Z)(r,T.gl.LINES,"lines"),(0,C.Z)(r,T.gl.LINE_LOOP,"line loop"),(0,C.Z)(r,T.gl.LINE_STRIP,"line strip"),(0,C.Z)(r,T.gl.TRIANGLES,"triangles"),(0,C.Z)(r,T.gl.TRIANGLE_FAN,"triangle fan"),(0,C.Z)(r,T.gl.TRIANGLE_STRIP,"triangle strip"),r),D=(i={},(0,C.Z)(i,T.gl.STATIC_DRAW,"static"),(0,C.Z)(i,T.gl.DYNAMIC_DRAW,"dynamic"),(0,C.Z)(i,T.gl.STREAM_DRAW,"stream"),i),N=(o={},(0,C.Z)(o,T.gl.BYTE,"int8"),(0,C.Z)(o,T.gl.UNSIGNED_INT,"int16"),(0,C.Z)(o,T.gl.INT,"int32"),(0,C.Z)(o,T.gl.UNSIGNED_BYTE,"uint8"),(0,C.Z)(o,T.gl.UNSIGNED_SHORT,"uint16"),(0,C.Z)(o,T.gl.UNSIGNED_INT,"uint32"),(0,C.Z)(o,T.gl.FLOAT,"float"),o),F=(a={},(0,C.Z)(a,T.gl.ALPHA,"alpha"),(0,C.Z)(a,T.gl.LUMINANCE,"luminance"),(0,C.Z)(a,T.gl.LUMINANCE_ALPHA,"luminance alpha"),(0,C.Z)(a,T.gl.RGB,"rgb"),(0,C.Z)(a,T.gl.RGBA,"rgba"),(0,C.Z)(a,T.gl.RGBA4,"rgba4"),(0,C.Z)(a,T.gl.RGB5_A1,"rgb5 a1"),(0,C.Z)(a,T.gl.RGB565,"rgb565"),(0,C.Z)(a,T.gl.DEPTH_COMPONENT,"depth"),(0,C.Z)(a,T.gl.DEPTH_STENCIL,"depth stencil"),a),z=(s={},(0,C.Z)(s,T.gl.DONT_CARE,"dont care"),(0,C.Z)(s,T.gl.NICEST,"nice"),(0,C.Z)(s,T.gl.FASTEST,"fast"),s),B=(u={},(0,C.Z)(u,T.gl.NEAREST,"nearest"),(0,C.Z)(u,T.gl.LINEAR,"linear"),(0,C.Z)(u,T.gl.LINEAR_MIPMAP_LINEAR,"mipmap"),(0,C.Z)(u,T.gl.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),(0,C.Z)(u,T.gl.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),(0,C.Z)(u,T.gl.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),u),j=(l={},(0,C.Z)(l,T.gl.REPEAT,"repeat"),(0,C.Z)(l,T.gl.CLAMP_TO_EDGE,"clamp"),(0,C.Z)(l,T.gl.MIRRORED_REPEAT,"mirror"),l),U=(c={},(0,C.Z)(c,T.gl.NONE,"none"),(0,C.Z)(c,T.gl.BROWSER_DEFAULT_WEBGL,"browser"),c),Z=(h={},(0,C.Z)(h,T.gl.NEVER,"never"),(0,C.Z)(h,T.gl.ALWAYS,"always"),(0,C.Z)(h,T.gl.LESS,"less"),(0,C.Z)(h,T.gl.LEQUAL,"lequal"),(0,C.Z)(h,T.gl.GREATER,"greater"),(0,C.Z)(h,T.gl.GEQUAL,"gequal"),(0,C.Z)(h,T.gl.EQUAL,"equal"),(0,C.Z)(h,T.gl.NOTEQUAL,"notequal"),h),V=(p={},(0,C.Z)(p,T.gl.FUNC_ADD,"add"),(0,C.Z)(p,T.gl.MIN_EXT,"min"),(0,C.Z)(p,T.gl.MAX_EXT,"max"),(0,C.Z)(p,T.gl.FUNC_SUBTRACT,"subtract"),(0,C.Z)(p,T.gl.FUNC_REVERSE_SUBTRACT,"reverse subtract"),p),G=(f={},(0,C.Z)(f,T.gl.ZERO,"zero"),(0,C.Z)(f,T.gl.ONE,"one"),(0,C.Z)(f,T.gl.SRC_COLOR,"src color"),(0,C.Z)(f,T.gl.ONE_MINUS_SRC_COLOR,"one minus src color"),(0,C.Z)(f,T.gl.SRC_ALPHA,"src alpha"),(0,C.Z)(f,T.gl.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),(0,C.Z)(f,T.gl.DST_COLOR,"dst color"),(0,C.Z)(f,T.gl.ONE_MINUS_DST_COLOR,"one minus dst color"),(0,C.Z)(f,T.gl.DST_ALPHA,"dst alpha"),(0,C.Z)(f,T.gl.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),(0,C.Z)(f,T.gl.CONSTANT_COLOR,"constant color"),(0,C.Z)(f,T.gl.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),(0,C.Z)(f,T.gl.CONSTANT_ALPHA,"constant alpha"),(0,C.Z)(f,T.gl.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),(0,C.Z)(f,T.gl.SRC_ALPHA_SATURATE,"src alpha saturate"),f),H=(d={},(0,C.Z)(d,T.gl.NEVER,"never"),(0,C.Z)(d,T.gl.ALWAYS,"always"),(0,C.Z)(d,T.gl.LESS,"less"),(0,C.Z)(d,T.gl.LEQUAL,"lequal"),(0,C.Z)(d,T.gl.GREATER,"greater"),(0,C.Z)(d,T.gl.GEQUAL,"gequal"),(0,C.Z)(d,T.gl.EQUAL,"equal"),(0,C.Z)(d,T.gl.NOTEQUAL,"notequal"),d),W=(m={},(0,C.Z)(m,T.gl.ZERO,"zero"),(0,C.Z)(m,T.gl.KEEP,"keep"),(0,C.Z)(m,T.gl.REPLACE,"replace"),(0,C.Z)(m,T.gl.INVERT,"invert"),(0,C.Z)(m,T.gl.INCR,"increment"),(0,C.Z)(m,T.gl.DECR,"decrement"),(0,C.Z)(m,T.gl.INCR_WRAP,"increment wrap"),(0,C.Z)(m,T.gl.DECR_WRAP,"decrement wrap"),m),q=(g={},(0,C.Z)(g,T.gl.FRONT,"front"),(0,C.Z)(g,T.gl.BACK,"back"),g),Y=function(){function t(e,n){(0,x.Z)(this,t);var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:D[i||T.gl.STATIC_DRAW],type:N[o||T.gl.UNSIGNED_BYTE]})}return(0,w.Z)(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}(),X=function(){function t(e,n){(0,x.Z)(this,t);var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:D[i||T.gl.STATIC_DRAW],type:N[o||T.gl.UNSIGNED_BYTE],count:a})}return(0,w.Z)(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){}}]),t}(),$=function(){function t(e,n){(0,x.Z)(this,t);var r=n.width,i=n.height,o=n.color,a=n.colors,s={width:r,height:i};Array.isArray(a)&&(s.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(s.color=o.get()),this.framebuffer=e.framebuffer(s)}return(0,w.Z)(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}(),K=n(7743),J=n(9479),Q=function(){function t(e,n){(0,x.Z)(this,t),(0,C.Z)(this,"destroyed",!1),(0,C.Z)(this,"uniforms",{}),this.reGl=e;var r=n.vs,i=n.fs,o=n.attributes,a=n.uniforms,s=n.primitive,u=n.count,l=n.elements,c=n.depth,h=n.cull,p=n.instances,f={};this.options=n,a&&(this.uniforms=this.extractUniforms(a),Object.keys(a).forEach((function(t){f[t]=e.prop(t)})));var d={};Object.keys(o).forEach((function(t){d[t]=o[t].get()}));var m={attributes:d,frag:i,uniforms:f,vert:r,colorMask:e.prop("colorMask"),lineWidth:1,blend:{enable:e.prop("blend.enable"),func:e.prop("blend.func"),equation:e.prop("blend.equation"),color:e.prop("blend.color")},stencil:{enable:e.prop("stencil.enable"),mask:e.prop("stencil.mask"),func:e.prop("stencil.func"),opFront:e.prop("stencil.opFront"),opBack:e.prop("stencil.opBack")},primitive:R[void 0===s?T.gl.TRIANGLES:s]};p&&(m.instances=p),u?m.count=u:l&&(m.elements=l.get()),this.initDepthDrawParams({depth:c},m),this.initCullDrawParams({cull:h},m),this.drawCommand=e(m),this.drawParams=m}return(0,w.Z)(t,[{key:"updateAttributesAndElements",value:function(t,e){var n={};Object.keys(t).forEach((function(e){n[e]=t[e].get()})),this.drawParams.attributes=n,this.drawParams.elements=e.get(),this.drawCommand=this.reGl(this.drawParams)}},{key:"updateAttributes",value:function(t){var e={};Object.keys(t).forEach((function(n){e[n]=t[n].get()})),this.drawParams.attributes=e,this.drawCommand=this.reGl(this.drawParams)}},{key:"addUniforms",value:function(t){this.uniforms=(0,v.Z)((0,v.Z)({},this.uniforms),this.extractUniforms(t))}},{key:"draw",value:function(t,e){if(!this.drawParams.attributes||0!==Object.keys(this.drawParams.attributes).length){var n=(0,v.Z)((0,v.Z)({},this.uniforms),this.extractUniforms(t.uniforms||{})),r={};Object.keys(n).forEach((function(t){var e=(0,K.Z)(n[t]);"boolean"===e||"number"===e||Array.isArray(n[t])||n[t].BYTES_PER_ELEMENT?r[t]=n[t]:r[t]=n[t].get()})),r.blend=e?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(t),r.stencil=this.getStencilDrawParams(t),r.colorMask=this.getColorMaskDrawParams(t,e),this.drawCommand(r)}}},{key:"destroy",value:function(){var t,e;null===(t=this.drawParams)||void 0===t||null===(e=t.elements)||void 0===e||e.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach((function(t){null==t||t.destroy()})),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Z[n.func||T.gl.LESS],range:n.range||[0,1]})}},{key:"getBlendDrawParams",value:function(t){var e=t.blend||{},n=e.enable,r=e.func,i=e.equation,o=e.color,a=void 0===o?[0,0,0,0]:o;return{enable:!!n,func:{srcRGB:G[r&&r.srcRGB||T.gl.SRC_ALPHA],srcAlpha:G[r&&r.srcAlpha||T.gl.SRC_ALPHA],dstRGB:G[r&&r.dstRGB||T.gl.ONE_MINUS_SRC_ALPHA],dstAlpha:G[r&&r.dstAlpha||T.gl.ONE_MINUS_SRC_ALPHA]},equation:{rgb:V[i&&i.rgb||T.gl.FUNC_ADD],alpha:V[i&&i.alpha||T.gl.FUNC_ADD]},color:a}}},{key:"getStencilDrawParams",value:function(t){var e=t.stencil||{},n=e.enable,r=e.mask,i=void 0===r?-1:r,o=e.func,a=void 0===o?{cmp:T.gl.ALWAYS,ref:0,mask:-1}:o,s=e.opFront,u=void 0===s?{fail:T.gl.KEEP,zfail:T.gl.KEEP,zpass:T.gl.KEEP}:s,l=e.opBack,c=void 0===l?{fail:T.gl.KEEP,zfail:T.gl.KEEP,zpass:T.gl.KEEP}:l;return{enable:!!n,mask:i,func:(0,v.Z)((0,v.Z)({},a),{},{cmp:H[a.cmp]}),opFront:{fail:W[u.fail],zfail:W[u.zfail],zpass:W[u.zpass]},opBack:{fail:W[c.fail],zfail:W[c.zfail],zpass:W[c.zpass]}}}},{key:"getColorMaskDrawParams",value:function(t,e){var n=t.stencil;return null!=n&&n.enable&&n.opFront&&!e?[!1,!1,!1,!1]:[!0,!0,!0,!0]}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?T.gl.BACK:i;e.cull={enable:!!r,face:q[o]}}}},{key:"extractUniforms",value:function(t){var e=this,n={};return Object.keys(t).forEach((function(r){e.extractUniformsRecursively(r,t[r],n,"")})),n}},{key:"extractUniformsRecursively",value:function(t,e,n,r){var i=this;null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||(0,J.isTypedArray)(e)||""===e||"resize"in e?n["".concat(r&&r+".").concat(t)]=e:((0,J.isPlainObject)(e)&&Object.keys(e).forEach((function(o){i.extractUniformsRecursively(o,e[o],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,o){Object.keys(e).forEach((function(a){i.extractUniformsRecursively(a,e[a],n,"".concat(r&&r+".").concat(t,"[").concat(o,"]"))}))})))}}]),t}(),tt=function(){function t(e,n){(0,x.Z)(this,t),(0,C.Z)(this,"isDestroy",!1);var r=n.data,i=n.type,o=void 0===i?T.gl.UNSIGNED_BYTE:i,a=n.width,s=n.height,u=n.flipY,l=void 0!==u&&u,c=n.format,h=void 0===c?T.gl.RGBA:c,p=n.mipmap,f=void 0!==p&&p,d=n.wrapS,m=void 0===d?T.gl.CLAMP_TO_EDGE:d,g=n.wrapT,y=void 0===g?T.gl.CLAMP_TO_EDGE:g,v=n.aniso,_=void 0===v?0:v,b=n.alignment,w=void 0===b?1:b,S=n.premultiplyAlpha,E=void 0!==S&&S,M=n.mag,A=void 0===M?T.gl.NEAREST:M,O=n.min,P=void 0===O?T.gl.NEAREST:O,k=n.colorSpace,L=void 0===k?T.gl.BROWSER_DEFAULT_WEBGL:k,I=n.x,R=void 0===I?0:I,D=n.y,Z=void 0===D?0:D,V=n.copy,G=void 0!==V&&V;this.width=a,this.height=s;var H={width:a,height:s,type:N[o],format:F[h],wrapS:j[m],wrapT:j[y],mag:B[A],min:B[P],alignment:w,flipY:l,colorSpace:U[L],premultiplyAlpha:E,aniso:_,x:R,y:Z,copy:G};r&&(H.data=r),"number"==typeof f?H.mipmap=z[f]:"boolean"==typeof f&&(H.mipmap=f),this.texture=e.texture(H)}return(0,w.Z)(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.texture(t)}},{key:"bind",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"getSize",value:function(){return[this.width,this.height]}},{key:"destroy",value:function(){var t;this.isDestroy||null===(t=this.texture)||void 0===t||t.destroy(),this.isDestroy=!0}}]),t}(),et=(0,P.b2)()(y=function(){function t(){var e=this;(0,x.Z)(this,t),(0,C.Z)(this,"createModel",(function(t){return new Q(e.gl,t)})),(0,C.Z)(this,"createAttribute",(function(t){return new I(e.gl,t)})),(0,C.Z)(this,"createBuffer",(function(t){return new Y(e.gl,t)})),(0,C.Z)(this,"createElements",(function(t){return new X(e.gl,t)})),(0,C.Z)(this,"createTexture2D",(function(t){return new tt(e.gl,t)})),(0,C.Z)(this,"createFramebuffer",(function(t){return new $(e.gl,t)})),(0,C.Z)(this,"useFramebuffer",(function(t,n){e.gl({framebuffer:t?t.get():null})(n)})),(0,C.Z)(this,"clear",(function(t){var n,r=t.color,i=t.depth,o=t.stencil,a=t.framebuffer,s=void 0===a?null:a,u={color:r,depth:i,stencil:o};u.framebuffer=null===s?s:s.get(),null===(n=e.gl)||void 0===n||n.clear(u)})),(0,C.Z)(this,"viewport",(function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl._gl.viewport(n,r,i,o),e.width=i,e.height=o,e.gl._refresh()})),(0,C.Z)(this,"readPixels",(function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)})),(0,C.Z)(this,"getViewportSize",(function(){return{width:e.gl._gl.drawingBufferWidth,height:e.gl._gl.drawingBufferHeight}})),(0,C.Z)(this,"getContainer",(function(){return O.isMini?e.canvas:null===(t=e.canvas)||void 0===t?void 0:t.parentElement;var t})),(0,C.Z)(this,"getCanvas",(function(){return e.canvas})),(0,C.Z)(this,"getGLContext",(function(){return e.gl._gl})),(0,C.Z)(this,"destroy",(function(){var t,n,r;e.canvas=null,null===(t=e.gl)||void 0===t||null===(n=t._gl)||void 0===n||null===(r=n.getExtension("WEBGL_lose_context"))||void 0===r||r.loseContext(),e.gl.destroy(),e.gl=null}))}var e;return(0,w.Z)(t,[{key:"init",value:(e=(0,b.Z)(E().mark((function t(e,n,r){var i=this;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.canvas=e,!r){t.next=5;break}this.gl=r,t.next=8;break;case 5:return t.next=7,new Promise((function(t,e){L()({canvas:i.canvas,attributes:{alpha:!0,antialias:n.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:n.preserveDrawingBuffer,stencil:n.stencil},extensions:["OES_element_index_uint","OES_standard_derivatives","ANGLE_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture","WEBGL_lose_context"],profile:!0,onDone:function(n,r){!n&&r||e(n),t(r)}})}));case 7:this.gl=t.sent;case 8:this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")};case 9:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"getPointSizeRange",value:function(){return this.gl._gl.getParameter(this.gl._gl.ALIASED_POINT_SIZE_RANGE)}},{key:"testExtension",value:function(t){return!!this.getGLContext().getExtension(t)}},{key:"setState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!0,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setBaseState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setCustomLayerDefaults",value:function(){var t=this.getGLContext();t.disable(t.CULL_FACE)}},{key:"setDirty",value:function(t){this.isDirty=t}},{key:"getDirty",value:function(){return this.isDirty}}]),t}())||y,nt=n(5161),rt=n(6193),it=n(9097),ot=n(6875),at=n(1883);var st=["selectstart","selecting","selectend"],ut=function(t){(0,rt.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,ot.Z)(e);if(n){var i=(0,ot.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,it.Z)(this,t)});function i(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,x.Z)(this,i),e=r.call(this),(0,C.Z)((0,nt.Z)(e),"isEnable",!1),(0,C.Z)((0,nt.Z)(e),"onDragStart",(function(t){e.box.style.display="block",e.startEvent=e.endEvent=t,e.syncBoxBound(),e.emit("selectstart",e.getLngLatBox(),e.startEvent,e.endEvent)})),(0,C.Z)((0,nt.Z)(e),"onDragging",(function(t){e.endEvent=t,e.syncBoxBound(),e.emit("selecting",e.getLngLatBox(),e.startEvent,e.endEvent)})),(0,C.Z)((0,nt.Z)(e),"onDragEnd",(function(t){e.endEvent=t,e.box.style.display="none",e.emit("selectend",e.getLngLatBox(),e.startEvent,e.endEvent)})),e.scene=t,e.options=n,e}return(0,w.Z)(i,[{key:"container",get:function(){return this.scene.getMapService().getMarkerContainer()}},{key:"enable",value:function(){if(!this.isEnable){var t=this.options.className;if(this.scene.setMapStatus({dragEnable:!1}),this.container.style.cursor="crosshair",!this.box){var e=O.DOM.create("div",void 0,this.container);e.classList.add("l7-select-box"),t&&e.classList.add(t),e.style.display="none",this.box=e}this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.isEnable=!0}}},{key:"disable",value:function(){this.isEnable&&(this.scene.setMapStatus({dragEnable:!0}),this.container.style.cursor="auto",this.scene.off("dragstart",this.onDragStart),this.scene.off("dragging",this.onDragging),this.scene.off("dragend",this.onDragEnd),this.isEnable=!1)}},{key:"syncBoxBound",value:function(){var t=this.startEvent,e=t.x,n=t.y,r=this.endEvent,i=r.x,o=r.y,a=Math.min(e,i),s=Math.min(n,o),u=Math.abs(e-i),l=Math.abs(n-o);this.box.style.top="".concat(s,"px"),this.box.style.left="".concat(a,"px"),this.box.style.width="".concat(u,"px"),this.box.style.height="".concat(l,"px")}},{key:"getLngLatBox",value:function(){var t=this.startEvent.lngLat,e=t.lng,n=t.lat,r=this.endEvent.lngLat,i=r.lng,o=r.lat;return(0,O.getBBoxFromPoints)([[e,n],[i,o]])}}]),i}(at.EventEmitter),lt=function(){function t(e){(0,x.Z)(this,t);var n=e.id,r=e.map,i=e.canvas,o=e.hasBaseMap,a=(0,T.createSceneContainer)();this.container=a,r.setContainer(a,n,i,o),a.bind(T.TYPES.IRendererService).to(et).inSingletonScope(),this.sceneService=a.get(T.TYPES.ISceneService),this.mapService=a.get(T.TYPES.IMapService),this.iconService=a.get(T.TYPES.IIconService),this.fontService=a.get(T.TYPES.IFontService),this.controlService=a.get(T.TYPES.IControlService),this.layerService=a.get(T.TYPES.ILayerService),this.debugService=a.get(T.TYPES.IDebugService),this.debugService.setEnable(e.debug),this.markerService=a.get(T.TYPES.IMarkerService),this.interactionService=a.get(T.TYPES.IInteractionService),this.popupService=a.get(T.TYPES.IPopupService),this.boxSelect=new ut(this,{}),(0,O.setMiniScene)((null==e?void 0:e.isMini)||!1),O.isMini?this.sceneService.initMiniScene(e):(this.initComponent(n),this.sceneService.init(e),this.initControl())}var e,n,r,i,o;return(0,w.Z)(t,[{key:"map",get:function(){return this.mapService.map}},{key:"loaded",get:function(){return this.sceneService.loaded}},{key:"getServiceContainer",value:function(){return this.container}},{key:"getSize",value:function(){return this.mapService.getSize()}},{key:"getMinZoom",value:function(){return this.mapService.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.mapService.getMaxZoom()}},{key:"getType",value:function(){return this.mapService.getType()}},{key:"getMapContainer",value:function(){return this.mapService.getMapContainer()}},{key:"getMapCanvasContainer",value:function(){return this.mapService.getMapCanvasContainer()}},{key:"getMapService",value:function(){return this.mapService}},{key:"getDebugService",value:function(){return this.debugService}},{key:"exportPng",value:(o=(0,b.Z)(E().mark((function t(e){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.sceneService.exportPng(e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"exportMap",value:(i=(0,b.Z)(E().mark((function t(e){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.sceneService.exportPng(e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"registerRenderService",value:function(t){var e=this;this.sceneService.loaded?new t(this).init():this.on("loaded",(function(){new t(e).init()}))}},{key:"setBgColor",value:function(t){this.mapService.setBgColor(t)}},{key:"addLayer",value:function(t){var e=this,n=(0,T.createLayerContainer)(this.container);if(t.setContainer(n,this.container),this.sceneService.addLayer(t),t.inited){var r=this.initMask(t);this.addMask(r,t.id)}else t.on("inited",(function(){var n=e.initMask(t);e.addMask(n,t.id)}))}},{key:"initMask",value:function(t){var e=t.getLayerConfig(),n=e.mask,r=e.maskfence,i=e.maskColor,o=void 0===i?"#000":i,a=e.maskOpacity,s=void 0===a?0:a;if(n&&r)return(new A.MaskLayer).source(r).shape("fill").style({color:o,opacity:s})}},{key:"addMask",value:function(t,e){if(t){var n=this.getLayer(e);if(n){var r=(0,T.createLayerContainer)(this.container);t.setContainer(r,this.container),n.addMaskLayer(t),this.sceneService.addMask(t)}else console.warn("parent layer not find!")}}},{key:"getPickedLayer",value:function(){return this.layerService.pickedLayerId}},{key:"getLayers",value:function(){return this.layerService.getLayers()}},{key:"getLayer",value:function(t){return this.layerService.getLayer(t)}},{key:"getLayerByName",value:function(t){return this.layerService.getLayerByName(t)}},{key:"removeLayer",value:(r=(0,b.Z)(E().mark((function t(e,n){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layerService.remove(e,n);case 2:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"removeAllLayer",value:(n=(0,b.Z)(E().mark((function t(){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.layerService.removeAllLayers();case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"render",value:function(){this.sceneService.render()}},{key:"setEnableRender",value:function(t){this.layerService.setEnableRender(t)}},{key:"addIconFont",value:function(t,e){this.fontService.addIconFont(t,e)}},{key:"addIconFonts",value:function(t){var e=this;t.forEach((function(t){var n=(0,_.Z)(t,2),r=n[0],i=n[1];e.fontService.addIconFont(r,i)}))}},{key:"addFontFace",value:function(t,e){var n=this;this.fontService.once("fontloaded",(function(t){n.emit("fontloaded",t)})),this.fontService.addFontFace(t,e)}},{key:"addImage",value:(e=(0,b.Z)(E().mark((function t(e,n){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(O.isMini){t.next=5;break}return t.next=3,this.iconService.addImage(e,n);case 3:t.next=6;break;case 5:this.iconService.addImageMini(e,n,this.sceneService);case 6:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"hasImage",value:function(t){return this.iconService.hasImage(t)}},{key:"removeImage",value:function(t){this.iconService.removeImage(t)}},{key:"addIconFontGlyphs",value:function(t,e){this.fontService.addIconGlyphs(e)}},{key:"addControl",value:function(t){this.controlService.addControl(t,this.container)}},{key:"removeControl",value:function(t){this.controlService.removeControl(t)}},{key:"getControlByName",value:function(t){return this.controlService.getControlByName(t)}},{key:"addMarker",value:function(t){this.markerService.addMarker(t)}},{key:"addMarkerLayer",value:function(t){this.markerService.addMarkerLayer(t)}},{key:"removeMarkerLayer",value:function(t){this.markerService.removeMarkerLayer(t)}},{key:"removeAllMarkers",value:function(){this.markerService.removeAllMarkers()}},{key:"removeAllMakers",value:function(){console.warn("removeAllMakers 已废弃,请使用 removeAllMarkers"),this.markerService.removeAllMarkers()}},{key:"addPopup",value:function(t){this.popupService.addPopup(t)}},{key:"removePopup",value:function(t){this.popupService.removePopup(t)}},{key:"on",value:function(t,e){var n;st.includes(t)?null===(n=this.boxSelect)||void 0===n||n.on(t,e):T.SceneEventList.includes(t)?this.sceneService.on(t,e):this.mapService.on(t,e)}},{key:"once",value:function(t,e){var n;st.includes(t)?null===(n=this.boxSelect)||void 0===n||n.once(t,e):T.SceneEventList.includes(t)?this.sceneService.once(t,e):this.mapService.once(t,e)}},{key:"emit",value:function(t,e){-1===T.SceneEventList.indexOf(t)?this.mapService.on(t,e):this.sceneService.emit(t,e)}},{key:"off",value:function(t,e){var n;st.includes(t)?null===(n=this.boxSelect)||void 0===n||n.off(t,e):T.SceneEventList.includes(t)?this.sceneService.off(t,e):this.mapService.off(t,e)}},{key:"getZoom",value:function(){return this.mapService.getZoom()}},{key:"getCenter",value:function(t){return this.mapService.getCenter(t)}},{key:"setCenter",value:function(t,e){return this.mapService.setCenter(t,e)}},{key:"getPitch",value:function(){return this.mapService.getPitch()}},{key:"setPitch",value:function(t){return this.mapService.setPitch(t)}},{key:"getRotation",value:function(){return this.mapService.getRotation()}},{key:"getBounds",value:function(){return this.mapService.getBounds()}},{key:"setRotation",value:function(t){this.mapService.setRotation(t)}},{key:"zoomIn",value:function(){this.mapService.zoomIn()}},{key:"zoomOut",value:function(){this.mapService.zoomOut()}},{key:"panTo",value:function(t){this.mapService.panTo(t)}},{key:"panBy",value:function(t,e){this.mapService.panBy(t,e)}},{key:"getContainer",value:function(){return this.mapService.getContainer()}},{key:"setZoom",value:function(t){this.mapService.setZoom(t)}},{key:"fitBounds",value:function(t,e){var n=this.sceneService.getSceneConfig(),r=n.fitBoundsOptions,i=n.animate;this.mapService.fitBounds(t,e||(0,v.Z)((0,v.Z)({},r),{},{animate:i}))}},{key:"setZoomAndCenter",value:function(t,e){this.mapService.setZoomAndCenter(t,e)}},{key:"setMapStyle",value:function(t){this.mapService.setMapStyle(t)}},{key:"setMapStatus",value:function(t){this.mapService.setMapStatus(t)}},{key:"pixelToLngLat",value:function(t){return this.mapService.pixelToLngLat(t)}},{key:"lngLatToPixel",value:function(t){return this.mapService.lngLatToPixel(t)}},{key:"containerToLngLat",value:function(t){return this.mapService.containerToLngLat(t)}},{key:"lngLatToContainer",value:function(t){return this.mapService.lngLatToContainer(t)}},{key:"destroy",value:function(){this.sceneService.destroy()}},{key:"registerPostProcessingPass",value:function(t,e){this.container.bind(T.TYPES.IPostProcessingPass).to(t).whenTargetNamed(e)}},{key:"enableShaderPick",value:function(){this.layerService.enableShaderPick()}},{key:"diasbleShaderPick",value:function(){this.layerService.disableShaderPick()}},{key:"enableBoxSelect",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.boxSelect.enable(),e&&this.boxSelect.once("selectend",(function(){t.disableBoxSelect()}))}},{key:"disableBoxSelect",value:function(){this.boxSelect.disable()}},{key:"getPointSizeRange",value:function(){return this.sceneService.getPointSizeRange()}},{key:"initComponent",value:function(t){this.controlService.init({container:O.DOM.getContainer(t)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}},{key:"initControl",value:function(){var t=this.sceneService.getSceneConfig(),e=t.logoVisible,n=t.logoPosition;e&&this.addControl(new M.Logo({position:n}))}}]),t}()},8134:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VectorSource:()=>ft,default:()=>pe,getParser:()=>o,getTransform:()=>s,rasterDataTypes:()=>jt,registerParser:()=>a,registerTransform:()=>u});var r={},i={},o=function(t){return i[t]},a=function(t,e){i[t]=e},s=function(t){return r[t]},u=function(t,e){r[t]=e},l={},c={};function h(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function p(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function f(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}var d=function(t){var e=new RegExp('[",\n\r]'),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,u=o<=0,h=!1;function p(){if(u)return c;if(h)return h=!1,l;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?u=!0:10===(r=t.charCodeAt(a++))?h=!0:13===r&&(h=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))h=!0;else if(13===r)h=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return u=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=p())!==c;){for(var f=[];r!==l&&r!==c;)f.push(r),r=p();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?(i=(n=t).getUTCHours(),o=n.getUTCMinutes(),a=n.getUTCSeconds(),s=n.getUTCMilliseconds(),isNaN(n)?"Invalid Date":((r=n.getUTCFullYear())<0?"-"+f(-r,6):r>9999?"+"+f(r,6):f(r,4))+"-"+f(n.getUTCMonth()+1,2)+"-"+f(n.getUTCDate(),2)+(s?"T"+f(i,2)+":"+f(o,2)+":"+f(a,2)+"."+f(s,3)+"Z":a?"T"+f(i,2)+":"+f(o,2)+":"+f(a,2)+"Z":o||i?"T"+f(i,2)+":"+f(o,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var n,r,i,o,a,s}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=h(t);return function(r,i){return e(n(r),i,t)}}(t,e):h(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=p(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=p(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}(","),m=d.parse,g=(d.parseRows,d.format,d.formatBody,d.formatRows,d.formatRow,d.formatValue,n(9908)),y=n(3659),v=n(2576),_=n.n(v),b=n(601),x=n(8912);function w(t,e){var n=e.x,r=e.y,i=e.x1,o=e.y1,a=e.coordinates,s=e.geometry,u=[];if(!Array.isArray(t))return{dataArray:[]};if(s)return t.filter((function(t){return t[s]&&t[s].type&&t[s].coordinates&&t[s].coordinates.length>0})).forEach((function(t,e){var n=_()((0,y.Z)({},t[s]),!0);(0,x.nG)(n,(function(n){var r=(0,b.r7)(n),i=(0,y.Z)((0,y.Z)({},t),{},{_id:e,coordinates:r});u.push(i)}))})),{dataArray:u};for(var l=0;l<t.length;l++){var c=t[l],h=[];if(a){var p="Polygon";Array.isArray(a[0])||(p="Point"),Array.isArray(a[0])&&!Array.isArray(a[0][0])&&(p="LineString"),h=_()({type:p,coordinates:(0,g.Z)(c[a])},!0).coordinates}else n&&r&&i&&o?h=[[parseFloat(c[n]),parseFloat(c[r])],[parseFloat(c[i]),parseFloat(c[o])]]:n&&r&&(h=[parseFloat(c[n]),parseFloat(c[r])]);var f=(0,y.Z)((0,y.Z)({},c),{},{_id:l,coordinates:h});u.push(f)}return{dataArray:u}}var S=n(7743),E=n(800),M=n(1109),T=n.n(M);function A(t,e,n,r){for(var i,o=r,a=n-e>>1,s=n-e,u=t[e],l=t[e+1],c=t[n],h=t[n+1],p=e+3;p<n;p+=3){var f=C(t[p],t[p+1],u,l,c,h);if(f>o)i=p,o=f;else if(f===o){var d=Math.abs(p-a);d<s&&(i=p,s=d)}}o>r&&(i-e>3&&A(t,e,i,r),t[i+2]=o,n-i>3&&A(t,i,n,r))}function C(t,e,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var u=((t-n)*a+(e-r)*s)/(a*a+s*s);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=s*u)}return(a=t-n)*a+(s=e-r)*s}function O(t,e,n,r){var i={id:void 0===t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)P(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<e.length;r++)P(t,e[r]);else if("MultiPolygon"===n)for(r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)P(t,e[r][i])}(i),i}function P(t,e){for(var n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function k(t,e,n,r){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],u=e.id;if(n.promoteId?u=e.properties[n.promoteId]:n.generateId&&(u=r||0),"Point"===o)L(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)L(i[l],s);else if("LineString"===o)I(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(l=0;l<i.length;l++)s=[],I(i[l],s,a,!1),t.push(O(u,"LineString",s,e.properties));return}R(i,s,a,!1)}else if("Polygon"===o)R(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)k(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var c=[];R(i[l],c,a,!0),s.push(c)}}t.push(O(u,o,s,e.properties))}}function L(t,e){e.push(D(t[0])),e.push(N(t[1])),e.push(0)}function I(t,e,n,r){for(var i,o,a=0,s=0;s<t.length;s++){var u=D(t[s][0]),l=N(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(a+=r?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,A(e,0,c,n),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function R(t,e,n,r){for(var i=0;i<t.length;i++){var o=[];I(t[i],o,n,r),e.push(o)}}function D(t){return t/360+.5}function N(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function F(t,e,n,r,i,o,a,s){if(r/=e,o>=(n/=e)&&a<r)return t;if(a<n||o>=r)return null;for(var u=[],l=0;l<t.length;l++){var c=t[l],h=c.geometry,p=c.type,f=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(f>=n&&d<r)u.push(c);else if(!(d<n||f>=r)){var m=[];if("Point"===p||"MultiPoint"===p)z(h,m,n,r,i);else if("LineString"===p)B(h,m,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===p)U(h,m,n,r,i,!1);else if("Polygon"===p)U(h,m,n,r,i,!0);else if("MultiPolygon"===p)for(var g=0;g<h.length;g++){var y=[];U(h[g],y,n,r,i,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(g=0;g<m.length;g++)u.push(O(c.id,p,m[g],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),u.push(O(c.id,p,m,c.tags))}}}return u.length?u:null}function z(t,e,n,r,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function B(t,e,n,r,i,o,a){for(var s,u,l=j(t),c=0===i?V:G,h=t.start,p=0;p<t.length-3;p+=3){var f=t[p],d=t[p+1],m=t[p+2],g=t[p+3],y=t[p+4],v=0===i?f:d,_=0===i?g:y,b=!1;a&&(s=Math.sqrt(Math.pow(f-g,2)+Math.pow(d-y,2))),v<n?_>n&&(u=c(l,f,d,g,y,n),a&&(l.start=h+s*u)):v>r?_<r&&(u=c(l,f,d,g,y,r),a&&(l.start=h+s*u)):Z(l,f,d,m),_<n&&v>=n&&(u=c(l,f,d,g,y,n),b=!0),_>r&&v<=r&&(u=c(l,f,d,g,y,r),b=!0),!o&&b&&(a&&(l.end=h+s*u),e.push(l),l=j(t)),a&&(h+=s)}var x=t.length-3;f=t[x],d=t[x+1],m=t[x+2],(v=0===i?f:d)>=n&&v<=r&&Z(l,f,d,m),x=l.length-3,o&&x>=3&&(l[x]!==l[0]||l[x+1]!==l[1])&&Z(l,l[0],l[1],l[2]),l.length&&e.push(l)}function j(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function U(t,e,n,r,i,o){for(var a=0;a<t.length;a++)B(t[a],e,n,r,i,o,!1)}function Z(t,e,n,r){t.push(e),t.push(n),t.push(r)}function V(t,e,n,r,i,o){var a=(o-e)/(r-e);return t.push(o),t.push(n+(i-n)*a),t.push(1),a}function G(t,e,n,r,i,o){var a=(o-n)/(i-n);return t.push(e+(r-e)*a),t.push(o),t.push(1),a}function H(t,e){for(var n=[],r=0;r<t.length;r++){var i,o=t[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=W(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(W(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(W(o.geometry[s][l],e));i.push(u)}n.push(O(o.id,a,i,o.tags))}return n}function W(t,e){var n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);for(var r=0;r<t.length;r+=3)n.push(t[r]+e,t[r+1],t[r+2]);return n}function q(t,e){if(t.transformed)return t;var n,r,i,o=1<<t.z,a=t.x,s=t.y;for(n=0;n<t.features.length;n++){var u=t.features[n],l=u.geometry,c=u.type;if(u.geometry=[],1===c)for(r=0;r<l.length;r+=2)u.geometry.push(Y(l[r],l[r+1],e,o,a,s));else for(r=0;r<l.length;r++){var h=[];for(i=0;i<l[r].length;i+=2)h.push(Y(l[r][i],l[r][i+1],e,o,a,s));u.geometry.push(h)}}return t.transformed=!0,t}function Y(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function X(t,e,n,r,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,$(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,c=t[s].maxX,h=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function $(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)K(a,i,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)K(a,i[s],t,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)K(a,l[s],t,n,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var p={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(p.id=e.id),t.features.push(p)}}function K(t,e,n,r,i,o){var a=r*r;if(r>0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===r||e[u+2]>a)&&(n.numSimplified++,s.push(e[u]),s.push(e[u+1])),n.numPoints++;i&&function(t,e){for(var n=0,r=0,i=t.length,o=i-2;r<i;o=r,r+=2)n+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(n>0===e)for(r=0,i=t.length;r<i/2;r+=2){var a=t[r],s=t[r+1];t[r]=t[i-2-r],t[r+1]=t[i-1-r],t[i-2-r]=a,t[i-1-r]=s}}(s,o),t.push(s)}}function J(t,e){var n=(e=this.options=function(t,e){for(var n in e)t[n]=e[n];return t}(Object.create(this.options),e)).debug;if(n&&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 r=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)k(n,t.features[r],e,r);else"Feature"===t.type?k(n,t,e):k(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){var n=e.buffer/e.extent,r=t,i=F(t,1,-1-n,n,0,-1,2,e),o=F(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=F(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=H(i,1).concat(r)),o&&(r=r.concat(H(o,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),n&&(r.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 Q(t,e,n){return 32*((1<<t)*n+e)+t}J.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},J.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],u=this.options,l=u.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=Q(e,n,r),p=this.tiles[h];if(!p&&(l>1&&console.time("creation"),p=this.tiles[h]=X(t,e,n,r,u),this.tileCoords.push({z:e,x:n,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<<i-e;if(n!==Math.floor(o/d)||r!==Math.floor(a/d))continue}else if(e===u.indexMaxZoom||p.numPoints<=u.indexMaxPoints)continue;if(p.source=null,0!==t.length){l>1&&console.time("clipping");var m,g,y,v,_,b,x=.5*u.buffer/u.extent,w=.5-x,S=.5+x,E=1+x;m=g=y=v=null,_=F(t,c,n-x,n+S,0,p.minX,p.maxX,u),b=F(t,c,n+w,n+E,0,p.minX,p.maxX,u),t=null,_&&(m=F(_,c,r-x,r+S,1,p.minY,p.maxY,u),g=F(_,c,r+w,r+E,1,p.minY,p.maxY,u),_=null),b&&(y=F(b,c,r-x,r+S,1,p.minY,p.maxY,u),v=F(b,c,r+w,r+E,1,p.minY,p.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*n,2*r),s.push(g||[],e+1,2*n,2*r+1),s.push(y||[],e+1,2*n+1,2*r),s.push(v||[],e+1,2*n+1,2*r+1)}}},J.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug;if(t<0||t>24)return null;var a=1<<t,s=Q(t,e=(e%a+a)%a,n);if(this.tiles[s])return q(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var u,l=t,c=e,h=n;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[Q(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?q(this.tiles[s],i):null):null};var tt=n(3192),et=n(6838),nt=n(6297),rt=function(){function t(e,n,r,i){(0,tt.Z)(this,t),(0,nt.Z)(this,"vectorLayerCache",{}),this.x=n,this.y=r,this.z=i,this.vectorTile=e}return(0,et.Z)(t,[{key:"getTileData",value:function(t){return t&&this.vectorTile.layers[t]?this.vectorLayerCache[t]?this.vectorLayerCache[t]:this.vectorTile.layers[t].features:[]}},{key:"getFeatureById",value:function(){throw new Error("Method not implemented.")}}]),t}(),it={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0};function ot(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r+=((n=t[a]).x-e.x)*(e.y+n.y);return r}var at=["Unknown","Point","LineString","Polygon"];function st(t,e,n,r,i){var o,a,s=i.geometry,u=i.type,l=i.tags,c=i.id,h=t*Math.pow(2,r),p=t*e,f=t*n,d=at[u];function m(t){for(var e=0;e<t.length;e++){var n=t[e];if(n[3])break;var r=180-360*(n[1]+f)/h,i=360*(n[0]+p)/h-180,o=360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90;t[e]=[i,o,0,1]}}switch(u){case 1:var g=[];for(o=0;o<s.length;o++)g[o]=s[o][0];m(s=g);break;case 2:for(o=0;o<s.length;o++)m(s[o]);break;case 3:for(s=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=ot(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}return n&&i.push(n),i}(s),o=0;o<s.length;o++)for(a=0;a<s[o].length;a++)m(s[o][a])}return 1===s.length?s=s[0]:d="Multi"+d,{type:"Feature",geometry:{type:d,coordinates:s},properties:l,id:c,tileOrigin:[0,0],coord:""}}var ut=function(){var t=(0,E.Z)(T().mark((function t(e,n,r,i){return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var o=n.getTile(e.z,e.x,e.y),a=o?o.features.map((function(t){return st(i,r.x,r.y,r.z,t)})):[];t(new rt({layers:{defaultLayer:{features:a}}},e.x,e.y,e.z))})));case 1:case"end":return t.stop()}}),t)})));return function(e,n,r,i){return t.apply(this,arguments)}}(),lt=n(5619);var ct=n(6672),ht=n(997),pt=n.n(ht),ft=function(){function t(e,n,r,i){(0,tt.Z)(this,t),(0,nt.Z)(this,"vectorLayerCache",{}),this.x=n,this.y=r,this.z=i,this.vectorTile=new ct.VectorTile(new(pt())(e))}return(0,et.Z)(t,[{key:"getTileData",value:function(t){if(!t||!this.vectorTile.layers[t])return[];if(this.vectorLayerCache[t])return this.vectorLayerCache[t];var e=this.vectorTile.layers[t];if(Array.isArray(e.features))return this.vectorLayerCache[t]=e.features,e.features;for(var n=[],r=0;r<e.length;r++){var i=e.feature(r).toGeoJSON(this.x,this.y,this.z);n.push((0,y.Z)((0,y.Z)({},i),{},{properties:(0,y.Z)({id:i.id},i.properties)}))}return this.vectorLayerCache[t]=n,n}},{key:"getFeatureById",value:function(){throw new Error("Method not implemented.")}}]),t}(),dt={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},mt=function(){var t=(0,E.Z)(T().mark((function t(e,n,r,i,o){var a;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=(0,lt.getURLFromTemplate)(e,n),t.abrupt("return",new Promise((function(t){if(o)o({x:r.x,y:r.y,z:r.z},(function(e,n){if(e||!n)t(void 0);else{var i=new ft(n,r.x,r.y,r.z);t(i)}}));else{var e=(0,lt.getArrayBuffer)((0,y.Z)((0,y.Z)({},i),{},{url:a}),(function(e,n){if(e||!n)t(void 0);else{var i=new ft(n,r.x,r.y,r.z);t(i)}}));r.xhrCancel=function(){return e.abort()}}})));case 2:case"end":return t.stop()}}),t)})));return function(e,n,r,i,o){return t.apply(this,arguments)}}(),gt=n(5162);function yt(t,e){for(var n=e[0],r=n.width,i=n.height,o=e.map((function(t){return t.rasterData})),a=r*i,s=[],u=JSON.stringify(t),l=0;l<a;l++){var c=JSON.parse(u),h=vt(c,o,l);if("number"==typeof h)s.push(h);else{var p=_t(c);s.push(p)}}return s}function vt(t,e,n){if(2===t.length&&"band"===t[0]&&"number"==typeof t[1])try{return e[t[1]][n]}catch(t){return console.warn("Raster Data err!"),0}t.map((function(r,i){if(Array.isArray(r)&&r.length>0)if("band"===r[0])try{t[i]=e[r[1]][n]}catch(e){console.warn("Raster Data err!"),t[i]=0}else vt(r,e,n)}))}function _t(t){var e=function(t){var e=(0,gt.Z)(t,3),n=e[0],r=e[1],i=void 0===r?-1:r,o=e[2],a=void 0===o?-1:o;return void 0===n?(console.warn("Express err!"),["+",0,0]):[n.replace(/\s+/g,""),i,a]}(t),n=e[0],r=e[1],i=e[2];return Array.isArray(r)&&(r=_t(t[1])),Array.isArray(i)&&(i=_t(t[2])),function(t,e,n){switch(t){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"^":return Math.pow(e,n);case"abs":return Math.abs(e);case"floor":return Math.floor(e);case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"sin":return Math.sin(e);case"cos":return Math.cos(e);case"atan":return-1===n?Math.atan(e):Math.atan2(e,n);case"min":return Math.min(e,n);case"max":return Math.max(e,n);case"log10":return Math.log(e);case"log2":return Math.log2(e);default:return console.warn("Calculate symbol err! Return default 0"),0}}(n,r,i)}var bt={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:function(t,e){for(var n=t[0].rasterData,r=t[1].rasterData,i=t[2].rasterData,o=[],a=(null==e?void 0:e.countCut)||[2,98],s=(0,gt.Z)(a,2),u=s[0],l=s[1],c=(null==e?void 0:e.RMinMax)||xt(n,u,l),h=(null==e?void 0:e.GMinMax)||xt(r,u,l),p=(null==e?void 0:e.BMinMax)||xt(i,u,l),f=0;f<n.length;f++)o.push(Math.max(0,n[f]-c[0])),o.push(Math.max(0,r[f]-h[0])),o.push(Math.max(0,i[f]-p[0]));return{rasterData:o,rMinMax:c,gMinMax:h,bMinMax:p}}}};function xt(t,e,n){var r=t.slice().sort((function(t,e){return t-e})),i=r.length;return[r[Math.ceil(i*e/100)],r[Math.ceil(i*n/100)]]}function wt(t,e,n){return St.apply(this,arguments)}function St(){return(St=(0,E.Z)(T().mark((function t(e,n,r){var i,o,a,s,u,l;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e.length){t.next=2;break}return t.abrupt("return",{rasterData:[0],width:1,heigh:1});case 2:return t.next=4,Promise.all(e.map((function(t){var e=t.data,r=t.bands;return n(e,void 0===r?[0]:r)})));case 4:i=t.sent,o=[],i.forEach((function(t){Array.isArray(t)?o.push.apply(o,(0,g.Z)(t)):o.push(t)})),a=o[0],s=a.width,u=a.height,t.t0=(0,S.Z)(r),t.next="function"===t.t0?11:"object"===t.t0?13:15;break;case 11:return l=r(o),t.abrupt("break",16);case 13:return l=Array.isArray(r)?{rasterData:yt(r,o)}:Et(r,o),t.abrupt("break",16);case 15:l={rasterData:o[0].rasterData};case 16:return t.abrupt("return",(0,y.Z)((0,y.Z)({},l),{},{width:s,height:u}));case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Et(t,e){var n=bt[t.type];return"function"===n.type?n.method(e,null==t?void 0:t.options):"operation"===n.type?"rgb"===t.type?function(t,e){return void 0===t.r&&console.warn("Channel R lost in Operation! Use band[0] to fill!"),void 0===t.g&&console.warn("Channel G lost in Operation! Use band[0] to fill!"),void 0===t.b&&console.warn("Channel B lost in Operation! Use band[0] to fill!"),[yt(t.r||["band",0],e),yt(t.g||["band",0],e),yt(t.b||["band",0],e)]}(n.expression,e):{rasterData:yt(n.expression,e)}:void 0}function Mt(t,e,n,r){return Tt.apply(this,arguments)}function Tt(){return(Tt=(0,E.Z)(T().mark((function t(e,n,r,i){var o;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,wt(e,n,r);case 2:o=t.sent,i(null,{data:o});case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function At(t){return!!Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}var Ct=n(108),Ot=function(){var t=(0,E.Z)(T().mark((function t(e,n,r,i){return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){n({x:e.x,y:e.y,z:e.z},(function(e,n){e||0===n.length?o(e):n&&Mt([{data:n,bands:[0]}],r,i,(function(e,n){e?o(e):n&&t(n)}))}))})));case 1:case"end":return t.stop()}}),t)})));return function(e,n,r,i){return t.apply(this,arguments)}}(),Pt=function(){var t=(0,E.Z)(T().mark((function t(e,n){return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){n({x:e.x,y:e.y,z:e.z},(function(e,n){!e&&n?n instanceof ArrayBuffer?(0,lt.formatImage)(n,(function(e,n){e&&r(e),t(n)})):n instanceof HTMLImageElement?t(n):r(e):r(e)}))})));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();function kt(t,e){return Array.isArray(t)?"string"==typeof t[0]?t.map((function(t){return(0,lt.getURLFromTemplate)(t,e)})):t.map((function(t){return{url:(0,lt.getURLFromTemplate)(t.url,e),bands:t.bands||[0]}})):(0,lt.getURLFromTemplate)(t,e)}function Lt(t,e){t.xhrCancel=function(){e.map((function(t){t.abort()}))}}var It=function(){var t=(0,E.Z)(T().mark((function t(e,n,r,i,o){var a,s,u,l,c,h;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(p=n.url,!((a="string"==typeof p?[{url:p,bands:[0]}]:"string"==typeof p[0]?p.map((function(t){return{url:t,bands:[0]}})):p).length>1)){t.next=15;break}return t.next=4,Rt(a,n);case 4:if(s=t.sent,u=s.rasterFiles,l=s.xhrList,c=s.errList,Lt(e,l),!(c.length>0)){t.next=12;break}return r(c,null),t.abrupt("return");case 12:Mt(u,i,o,r),t.next=17;break;case 15:h=(0,lt.getArrayBuffer)(n,(function(t,e){t?r(t):e&&Mt([{data:e,bands:a[0].bands}],i,o,r)})),Lt(e,[h]);case 17:case"end":return t.stop()}var p}),t)})));return function(e,n,r,i,o){return t.apply(this,arguments)}}();function Rt(t,e){return Dt.apply(this,arguments)}function Dt(){return(Dt=(0,E.Z)(T().mark((function t(e,n){var r,i,o,a,s,u,l,c,h,p,f;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=[],i=[],o=[],a=0;case 4:if(!(a<e.length)){t.next=20;break}return s=e[a],u=(0,y.Z)((0,y.Z)({},n),{},{url:s.url}),l=s.bands,t.next=10,(0,lt.makeXMLHttpRequestPromise)((0,y.Z)((0,y.Z)({},u),{},{type:"arrayBuffer"}));case 10:c=t.sent,h=c.err,p=c.data,f=c.xhr,h&&o.push(h),i.push(f),r.push({data:p,bands:l});case 17:a++,t.next=4;break;case 20:return t.abrupt("return",{rasterFiles:r,xhrList:i,errList:o});case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Nt=function(){var t=(0,E.Z)(T().mark((function t(e,n,r,i,o){var a;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={url:kt(e,n)},t.abrupt("return",new Promise((function(t,e){It(r,a,(function(n,r){n?e(n):r&&t(r)}),i,o)})));case 2:case"end":return t.stop()}}),t)})));return function(e,n,r,i,o){return t.apply(this,arguments)}}(),Ft=function(){var t=(0,E.Z)(T().mark((function t(e,n,r,i){var o,a,s,u;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Array.isArray(e)?e[0]:e,i.wmtsOptions?(s=(null==i?void 0:i.getURLFromTemplate)||lt.getWMTSURLFromTemplate,o=s(a,(0,y.Z)((0,y.Z)({},n),i.wmtsOptions))):(u=(null==i?void 0:i.getURLFromTemplate)||lt.getURLFromTemplate,o=u(a,n)),t.abrupt("return",new Promise((function(t,e){var n,a=(0,lt.getImage)({url:o,type:(null==i||null===(n=i.requestParameters)||void 0===n?void 0:n.type)||"arrayBuffer"},(function(n,r){n?e(n):r&&t(r)}),i.transformResponse);r.xhrCancel=function(){return a.abort()}})));case 3:case"end":return t.stop()}}),t)})));return function(e,n,r,i){return t.apply(this,arguments)}}(),zt=function(){return{rasterData:new Uint8Array([0]),width:1,height:1}},Bt={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},jt=[Ct.RasterTileType.ARRAYBUFFER,Ct.RasterTileType.RGB],Ut=n(2718),Zt=["extent","min","max","width","height","format","operation"],Vt={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},Gt=function(){var t=(0,E.Z)(T().mark((function t(e){return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=(0,gt.Z)(e.bounds,4),r=n[0],i=n[1],o=n[2],a=n[3];t({layers:{testTile:{features:[{type:"Feature",properties:{key:e.x+"/"+e.y+"/"+e.z,x:(r+o)/2,y:(i+a)/2},geometry:{type:"LineString",coordinates:[[o,a],[o,i],[r,i],[r,i]]}}]}}})})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ht=n(5161),Wt=n(6193),qt=n(9097),Yt=n(6875),Xt=n(5048),$t=n(1883),Kt=n(9479),Jt=n(1469),Qt=n.n(Jt);function te(t,e){var n=e.radius,r=void 0===n?40:n,i=e.maxZoom,o=void 0===i?18:i,a=e.minZoom,s=void 0===a?0:a,u=e.zoom,l=void 0===u?2:u;if(t.pointIndex){var c=t.pointIndex.getClusters(t.extent,Math.floor(l));return t.dataArray=c.map((function(t,e){return(0,y.Z)({coordinates:t.geometry.coordinates,_id:e+1},t.properties)})),t}var h=new(Qt())({radius:r,minZoom:s,maxZoom:o}),p={type:"FeatureCollection",features:[]};return p.features=t.dataArray.map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:t.coordinates},properties:(0,y.Z)({},t)}})),h.load(p.features),h}function ee(t){if(0===t.length)return 0;for(var e,n=t[0],r=0,i=1;i<t.length;i++)e=n+1*t[i],Math.abs(n)>=Math.abs(t[i])?r+=n-e+t[i]:r+=t[i]-e+n,n=e;return n+1*r}var ne={min:function(t){if(0===t.length)throw new Error("min requires at least one data point");for(var e=t[0],n=1;n<t.length;n++)t[n]<e&&(e=t[n]);return e},max:function(t){if(0===t.length)throw new Error("max requires at least one data point");for(var e=t[0],n=1;n<t.length;n++)t[n]>e&&(e=t[n]);return e},mean:function(t){if(0===t.length)throw new Error("mean requires at least one data point");return ee(t)/t.length},sum:ee};function re(t,e){if(Array.isArray(e))return e}var ie=function(t){(0,Wt.Z)(u,t);var e,n,r,i,a=(r=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,Yt.Z)(r);if(i){var n=(0,Yt.Z)(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return(0,qt.Z)(this,t)});function u(t,e){var n;return(0,tt.Z)(this,u),n=a.call(this),(0,nt.Z)((0,Ht.Z)(n),"type","source"),(0,nt.Z)((0,Ht.Z)(n),"isTile",!1),(0,nt.Z)((0,Ht.Z)(n),"inited",!1),(0,nt.Z)((0,Ht.Z)(n),"hooks",{init:new Xt.ni}),(0,nt.Z)((0,Ht.Z)(n),"parser",{type:"geojson"}),(0,nt.Z)((0,Ht.Z)(n),"transforms",[]),(0,nt.Z)((0,Ht.Z)(n),"cluster",!1),(0,nt.Z)((0,Ht.Z)(n),"clusterOptions",{enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"}),(0,nt.Z)((0,Ht.Z)(n),"invalidExtent",!1),(0,nt.Z)((0,Ht.Z)(n),"dataArrayChanged",!1),(0,nt.Z)((0,Ht.Z)(n),"cfg",{autoRender:!0}),n.originData=t,n.initCfg(e),n.init().then((function(){n.inited=!0,n.emit("update",{type:"inited"})})),n}return(0,et.Z)(u,[{key:"getSourceCfg",value:function(){return this.cfg}},{key:"getClusters",value:function(t){return this.clusterIndex.getClusters(this.caculClusterExtent(2),t)}},{key:"getClustersLeaves",value:function(t){return this.clusterIndex.getLeaves(t,1/0)}},{key:"getParserType",value:function(){return this.parser.type}},{key:"updateClusterData",value:function(t){var e=this,n=this.clusterOptions,r=n.method,i=void 0===r?"sum":r,a=n.field,s=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(t));this.clusterOptions.zoom=t,s.forEach((function(t){t.id||(t.properties.point_count=1)})),(a||(0,Kt.isFunction)(i))&&(s=s.map((function(t){var n=t.id;if(n){var r,o=e.clusterIndex.getLeaves(n,1/0).map((function(t){return t.properties}));if((0,Kt.isString)(i)&&a){var s=function(t,e){return t.map((function(t){return 1*t[e]}))}(o,a);r=ne[i](s)}(0,Kt.isFunction)(i)&&(r=i(o)),t.properties.stat=r}else t.properties.point_count=1;return t}))),this.data=o("geojson")({type:"FeatureCollection",features:s}),this.executeTrans()}},{key:"getFeatureById",value:function(t){var e=this.parser,n=e.type,r=void 0===n?"geojson":n,i=e.geometry;if("geojson"!==r||this.cluster)return"json"===r&&i?this.data.dataArray.find((function(e){return e._id===t})):t<this.data.dataArray.length?this.data.dataArray[t]:"null";var o=t<this.originData.features.length?this.originData.features[t]:"null",a=(0,Kt.cloneDeep)(o);if(null!=a&&a.properties&&(0!==this.transforms.length||this.dataArrayChanged)){var s=this.data.dataArray.find((function(e){return e._id===t}));a.properties=s}return a}},{key:"updateFeaturePropertiesById",value:function(t,e){this.data.dataArray=this.data.dataArray.map((function(n){return n._id===t?(0,y.Z)((0,y.Z)({},n),e):n})),this.dataArrayChanged=!0,this.emit("update",{type:"update"})}},{key:"getFeatureId",value:function(t,e){var n=this.data.dataArray.find((function(n){return n[t]===e}));return null==n?void 0:n._id}},{key:"setData",value:function(t,e){var n=this;this.originData=t,this.dataArrayChanged=!1,this.initCfg(e),this.init().then((function(){n.emit("update",{type:"update"})}))}},{key:"reloadAllTile",value:function(){var t;null===(t=this.tileset)||void 0===t||t.reloadAll()}},{key:"reloadTilebyId",value:function(t,e,n){var r;null===(r=this.tileset)||void 0===r||r.reloadTileById(t,e,n)}},{key:"reloadTileByLnglat",value:function(t,e,n){var r;null===(r=this.tileset)||void 0===r||r.reloadTileByLnglat(t,e,n)}},{key:"getTileExtent",value:function(t,e){var n;return null===(n=this.tileset)||void 0===n?void 0:n.getTileExtent(t,e)}},{key:"getTileByZXY",value:function(t,e,n){var r;return null===(r=this.tileset)||void 0===r?void 0:r.getTileByZXY(t,e,n)}},{key:"reloadTileByExtent",value:function(t,e){var n;null===(n=this.tileset)||void 0===n||n.reloadTileByExtent(t,e)}},{key:"destroy",value:function(){var t;this.removeAllListeners(),this.originData=null,this.clusterIndex=null,this.data=null,null===(t=this.tileset)||void 0===t||t.destroy()}},{key:"processData",value:(n=(0,E.Z)(T().mark((function t(){var e=this;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){try{e.excuteParser(),e.initCluster(),e.executeTrans(),t({})}catch(t){n(t)}})));case 1:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})},{key:"initCfg",value:function(t){this.cfg=(0,Kt.mergeWith)(this.cfg,t,re);var e=this.cfg;e&&(e.parser&&(this.parser=e.parser),e.transforms&&(this.transforms=e.transforms),this.cluster=e.cluster||!1,e.clusterOptions&&(this.cluster=!0,this.clusterOptions=(0,y.Z)((0,y.Z)({},this.clusterOptions),e.clusterOptions)))}},{key:"init",value:(e=(0,E.Z)(T().mark((function t(){return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.inited=!1,t.next=3,this.processData();case 3:this.inited=!0;case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"excuteParser",value:function(){var t=this.parser,e=t.type||"geojson",n=o(e);this.data=n(this.originData,t),this.tileset=this.initTileset(),t.cancelExtent||(this.extent=(0,lt.extent)(this.data.dataArray),this.setCenter(this.extent),this.invalidExtent=this.extent[0]===this.extent[2]||this.extent[1]===this.extent[3])}},{key:"setCenter",value:function(t){this.center=[(t[0]+t[2])/2,(t[1]+t[3])/2],(isNaN(this.center[0])||isNaN(this.center[1]))&&(this.center=[108.92361111111111,34.54083333333333])}},{key:"initTileset",value:function(){var t=this.data.tilesetOptions;if(t)return this.isTile=!0,this.tileset?(this.tileset.updateOptions(t),this.tileset):new lt.TilesetManager((0,y.Z)({},t))}},{key:"executeTrans",value:function(){var t=this;this.transforms.forEach((function(e){var n=e.type,r=s(n)(t.data,e);Object.assign(t.data,r)}))}},{key:"initCluster",value:function(){if(this.cluster){var t=this.clusterOptions||{};this.clusterIndex=te(this.data,t)}}},{key:"caculClusterExtent",value:function(t){var e=[[-1/0,-1/0],[1/0,1/0]];return this.invalidExtent||(e=(0,lt.padBounds)((0,lt.bBoxToBounds)(this.extent),t)),e[0].concat(e[1])}}]),u}($t.EventEmitter);function oe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ae(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var se=6378e3,ue=Math.PI/3,le=[0,ue,2*ue,3*ue,4*ue,5*ue];function ce(t){return t[0]}function he(t){return t[1]}a("rasterTile",(function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=t,Array.isArray(e)&&0===e.length||!Array.isArray(e)&&"string"!=typeof e)throw new Error("tile server url is error");var r=(null==n?void 0:n.dataType)||Ct.RasterTileType.IMAGE;r===Ct.RasterTileType.RGB&&(r=Ct.RasterTileType.ARRAYBUFFER);var i=(0,y.Z)((0,y.Z)((0,y.Z)({},Bt),n),{},{getTileData:function(e,i){switch(r){case Ct.RasterTileType.IMAGE:return Ft(t,e,i,n);case Ct.RasterTileType.CUSTOMIMAGE:case Ct.RasterTileType.CUSTOMTERRAINRGB:return Pt(i,null==n?void 0:n.getCustomData);case Ct.RasterTileType.ARRAYBUFFER:return Nt(t,e,i,(null==n?void 0:n.format)||zt,null==n?void 0:n.operation);case Ct.RasterTileType.CUSTOMARRAYBUFFER:case Ct.RasterTileType.CUSTOMRGB:return Ot(i,null==n?void 0:n.getCustomData,(null==n?void 0:n.format)||zt,null==n?void 0:n.operation);default:return Ft(t,e,i,n)}}});return{data:t,dataArray:[],tilesetOptions:i,isTile:!0}})),a("mvt",(function(t,e){var n=Array.isArray(t)?t[0]:t,r=(0,y.Z)((0,y.Z)((0,y.Z)({},dt),e),{},{getTileData:function(t,r){return mt(n,t,r,null==e?void 0:e.requestParameters,null==e?void 0:e.getCustomData)}});return{data:n,dataArray:[],tilesetOptions:r,isTile:!0}})),a("geojsonvt",(function(t,e){var n=function(t){var e={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!0,debug:0};return void 0===t||void 0===t.geojsonvtOptions?e:(0,y.Z)((0,y.Z)({},e),t.geojsonvtOptions)}(e),r=n.extent||4096,i=function(t,e){return new J(t,e)}(t,n);return{data:t,dataArray:[],tilesetOptions:(0,y.Z)((0,y.Z)((0,y.Z)({},it),e),{},{getTileData:function(t,e){return ut(e,i,t,r)}}),isTile:!0}})),a("testTile",(function(t,e){return{data:t,dataArray:[],tilesetOptions:(0,y.Z)((0,y.Z)((0,y.Z)({},Vt),e),{},{getTileData:function(t){return Gt(t)}}),isTile:!0}})),a("geojson",(function(t,e){var n=[],r={};return t.features?(t.features=t.features.filter((function(t){var e=t.geometry;return null!=t&&e&&e.type&&e.coordinates&&e.coordinates.length>0})),_()(t,!0),0===t.features.length?{dataArray:[],featureKeys:r}:((0,x.nG)(t,(function(t,r){var i,o,a=(i=t,void 0===(o=null==e?void 0:e.featureId)?null:1*(0,S.Z)(i.properties[o])==="number"?1*i.properties[o]:i.properties&&i.properties[o]?function(t){for(var e=t.toString(),n=5381,r=e.length;r;)n=33*n^e.charCodeAt(--r);return n>>>0}(i.properties[o]+"")%1000019:null);null===a&&(a=r);var s=a,u=(0,b.r7)(t),l=(0,y.Z)((0,y.Z)({},t.properties),{},{coordinates:u,_id:s});n.push(l)})),{dataArray:n,featureKeys:r})):(t.features=[],{dataArray:[]})})),a("image",(function(t,e){var n=e.extent,r=void 0===n?[121.168,30.2828,121.384,30.4219]:n,i=new Promise((function(e){t instanceof HTMLImageElement||(0,lt.isImageBitmap)(t)?e([t]):function(t,e){var n=t,r=[];if("string"==typeof n)(0,lt.getImage)({url:n},(function(t,n){n&&(r.push(n),e(r))}));else{var i=n.length,o=0;n.forEach((function(t){(0,lt.getImage)({url:t},(function(t,n){o++,n&&r.push(n),o===i&&e(r)}))}))}}(t,(function(t){e(t)}))}));return{originData:t,images:i,_id:1,dataArray:[{_id:0,coordinates:[[r[0],r[1]],[r[2],r[3]]]}]}})),a("csv",(function(t,e){return w(m(t),e)})),a("json",w),a("raster",(function(t,e){var n,r,i,o=e.extent,a=e.width,s=e.height,u=e.min,l=e.max,c=e.format,h=e.operation;return void 0===c||At(t)?(n=Array.from(t),r=a,i=s):n=wt(Array.isArray(t)?t:[t],c,h),{_id:1,dataArray:[{_id:1,data:n,width:r,height:i,min:u,max:l,coordinates:[[o[0],o[1]],[o[2],o[3]]]}]}})),a("rasterRgb",(function(t,e){var n,r=e.extent,i=e.min,o=e.max,a=e.width,s=e.height,u=e.format,l=e.operation,c=(0,Ut.Z)(e,Zt);return n=void 0===u||At(t)?Array.from(t):wt(Array.isArray(t)?t:[t],u,l),{_id:1,dataArray:[(0,y.Z)((0,y.Z)({_id:1,data:n,width:a,height:s},c),{},{min:i,max:o,coordinates:[[r[0],r[1]],[r[2],r[3]]]})]}})),u("cluster",te),u("filter",(function(t,e){var n=e.callback;return n&&(t.dataArray=t.dataArray.filter(n)),t})),u("join",(function(t,e){var n=e.sourceField,r=e.targetField,i=e.data,o={};return i.forEach((function(t){o[t[n]]=t})),t.dataArray=t.dataArray.map((function(t){var e=t[r];return(0,y.Z)((0,y.Z)({},t),o[e])})),t})),u("map",(function(t,e){var n=e.callback;return n&&(t.dataArray=t.dataArray.map(n)),t})),u("grid",(function(t,e){var n=t.dataArray,r=e.size,i=void 0===r?10:r,o=i/(2*Math.PI*se)*(256<<20)/2,a=function(t,e){var n,r,i=1/0,o=-1/0,a=oe(t);try{for(a.s();!(r=a.n()).done;)n=r.value.coordinates[1],Number.isFinite(n)&&(i=n<i?n:i,o=n>o?n:o)}catch(t){a.e(t)}finally{a.f()}var s,u,l,c,h=(u=(i+o)/2,l=(s=e)/se*(180/Math.PI),c=function(t,e){return e/se*(180/Math.PI)/Math.cos(t*Math.PI/180)}(u,s),{yOffset:l,xOffset:c});if(h.xOffset<=0||h.yOffset<=0)return{gridHash:{},gridOffset:h};var p,f={},d=oe(t);try{for(d.s();!(p=d.n()).done;){var m=p.value,g=m.coordinates[1],y=m.coordinates[0];if(Number.isFinite(g)&&Number.isFinite(y)){var v=Math.floor((g+90)/h.yOffset),_=Math.floor((y+180)/h.xOffset),b="".concat(v,"-").concat(_);f[b]=f[b]||{count:0,points:[]},f[b].count+=1,f[b].points.push(m)}}}catch(t){d.e(t)}finally{d.f()}return{gridHash:f,gridOffset:h}}(n,i),s=function(t,e,n){return Object.keys(t).reduce((function(r,i,o){var a=i.split("-"),s=parseInt(a[0],10),u=parseInt(a[1],10),l={};if(n.field&&n.method){var c=lt.Satistics.getColumn(t[i].points,n.field);l[n.method]=lt.Satistics.statMap[n.method](c)}return Object.assign(l,{_id:o,coordinates:(0,lt.aProjectFlat)([e.xOffset*(u+.5)-180,e.yOffset*(s+.5)-90]),rawData:t[i].points,count:t[i].count}),r.push(l),r}),[])}(a.gridHash,a.gridOffset,e);return{yOffset:o,xOffset:o,radius:o,type:"grid",dataArray:s}})),u("hexagon",(function(t,e){var n=t.dataArray,r=e.size,i=void 0===r?10:r,o=e.method,a=void 0===o?"sum":o,s=i/(2*Math.PI*6378e3)*(256<<20)/2,u=n.map((function(t){var e=(0,lt.aProjectFlat)(t.coordinates),n=(0,gt.Z)(e,2),r=n[0],i=n[1];return(0,y.Z)((0,y.Z)({},t),{},{coordinates:[r,i]})})),l=function(){var t,e,n,r=0,i=0,o=1,a=1,s=ce,u=he;function l(t){var r,i={},o=[],a=t.length;for(r=0;r<a;++r)if(!isNaN(c=+s.call(null,l=t[r],r,t))&&!isNaN(h=+u.call(null,l,r,t))){var l,c,h,p=Math.round(h/=n),f=Math.round(c=c/e-(1&p)/2),d=h-p;if(3*Math.abs(d)>1){var m=c-f,g=f+(c<f?-1:1)/2,y=p+(h<p?-1:1),v=c-g,_=h-y;m*m+d*d>v*v+_*_&&(f=g+(1&p?1:-1)/2,p=y)}var b=f+"-"+p,x=i[b];x?x.push(l):(o.push(x=i[b]=[l]),x.x=(f+(1&p)/2)*e,x.y=p*n)}return o}function c(t){var e=0,n=0;return le.map((function(r){var i=Math.sin(r)*t,o=-Math.cos(r)*t,a=i-e,s=o-n;return e=i,n=o,[a,s]}))}return l.hexagon=function(e){return"m"+c(null==e?t:+e).join("l")+"z"},l.centers=function(){for(var s=[],u=Math.round(i/n),l=Math.round(r/e),c=u*n;c<a+t;c+=n,++u)for(var h=l*e+(1&u)*e/2;h<o+e/2;h+=e)s.push([h,c]);return s},l.mesh=function(){var e=c(t).slice(0,4).join("l");return l.centers().map((function(t){return"M"+t+"m"+e})).join("")},l.x=function(t){return arguments.length?(s=t,l):s},l.y=function(t){return arguments.length?(u=t,l):u},l.radius=function(r){return arguments.length?(e=2*(t=+r)*Math.sin(ue),n=1.5*t,l):t},l.size=function(t){return arguments.length?(r=i=0,o=+t[0],a=+t[1],l):[o-r,a-i]},l.extent=function(t){return arguments.length?(r=+t[0][0],i=+t[0][1],o=+t[1][0],a=+t[1][1],l):[[r,i],[o,a]]},l.radius(1)}().radius(s).x((function(t){return t.coordinates[0]})).y((function(t){return t.coordinates[1]}));return{dataArray:l(u).map((function(t,n){var r;if(e.field&&a){var i=lt.Satistics.getColumn(t,e.field);t[a]=lt.Satistics.statMap[a](i)}return r={},(0,nt.Z)(r,e.method,t[a]),(0,nt.Z)(r,"count",t.length),(0,nt.Z)(r,"rawData",t),(0,nt.Z)(r,"coordinates",[t.x,t.y]),(0,nt.Z)(r,"_id",n),r})),radius:s,xOffset:s,yOffset:s,type:"hexagon"}}));const pe=ie},5619:(t,e,n)=>{"use strict";n.r(e),n.d(e,{$XMLHttpRequest:()=>Wt,$location:()=>qt,$window:()=>Ht,AJAXError:()=>Yt,BKDRHash:()=>Vn,DOM:()=>r,FrequencyController:()=>cn,LRUCache:()=>nr,LineTriangulation:()=>Ai,LoadTileDataStatus:()=>_r,PointFillTriangulation:()=>Ci,Satistics:()=>i,SourceTile:()=>Pr,TilesetManager:()=>Rr,UpdateTileStrategy:()=>vr,WorkerSourceMap:()=>ki,aProjectFlat:()=>Mn,amap2Project:()=>An,amap2UnProject:()=>Cn,anchorTranslate:()=>ue,anchorType:()=>se,applyAnchorClass:()=>le,bBoxToBounds:()=>In,bindAll:()=>ln,boundsContains:()=>Ln,calAngle:()=>Fn,calDistance:()=>Dn,calculateCentroid:()=>jn,calculatePointsCenterAndRadius:()=>Un,decodePickingColor:()=>fe,dispatchMapCameraParams:()=>zt,dispatchMouseDown:()=>yt,dispatchMouseMove:()=>vt,dispatchMouseUp:()=>_t,dispatchPointerDown:()=>Ot,dispatchPointerMove:()=>Pt,dispatchPointerUp:()=>kt,dispatchTouchEnd:()=>Ft,dispatchTouchMove:()=>Nt,dispatchTouchStart:()=>Dt,djb2hash:()=>Gn,encodePickingColor:()=>de,executeWorkerTask:()=>ji,expandUrl:()=>Nr,extent:()=>gn,flow:()=>Bn,formatImage:()=>ae,generateCatRamp:()=>ye,generateColorRamp:()=>me,generateCustomRamp:()=>_e,generateLinearRamp:()=>ge,generateQuantizeRamp:()=>ve,getAngle:()=>zn,getArrayBuffer:()=>Qt,getBBoxFromPoints:()=>Zn,getCullFace:()=>Se,getDefaultDomain:()=>xe,getImage:()=>oe,getJSON:()=>Jt,getReferrer:()=>nn,getTileIndices:()=>Cr,getTileWarpXY:()=>Or,getURLFromTemplate:()=>Fr,getWMTSURLFromTemplate:()=>zr,guid:()=>Hn,isAndroid:()=>an,isColor:()=>he,isImageBitmap:()=>tn,isMini:()=>Vt,isMiniAli:()=>Ut,isMiniScene:()=>Bt,isPC:()=>sn,isURLTemplate:()=>Dr,isWeChatMiniProgram:()=>Zt,isWorker:()=>en,isiOS:()=>on,latitude:()=>Sn,lineAtOffset:()=>tr,lineAtOffsetAsyc:()=>er,lngLatInExtent:()=>mn,lngLatToMeters:()=>bn,lnglatDistance:()=>On,longitude:()=>wn,makeXMLHttpRequestPromise:()=>$t,metersToLngLat:()=>xn,miniWindow:()=>Gt,normalize:()=>Rn,osmLonLat2TileXY:()=>Mr,osmTileXY2LonLat:()=>Tr,padBounds:()=>kn,polygonFillTriangulation:()=>Oi,postData:()=>te,project:()=>Pn,rgb2arr:()=>pe,sameOrigin:()=>ee,setL7WorkerSource:()=>zi,setMiniScene:()=>jt,tileToBounds:()=>Ar,tranfrormCoord:()=>vn,unProjectFlat:()=>Tn,validateLngLat:()=>En});var r={};n.r(r),n.d(r,{DPR:()=>Ge,addClass:()=>Le,addStyle:()=>He,appendElementType:()=>Qe,clearChildren:()=>Ke,create:()=>Pe,css2Style:()=>Ye,empty:()=>Fe,getClass:()=>Ne,getContainer:()=>Ae,getDiffRect:()=>Xe,getStyleList:()=>We,getViewPortScale:()=>Ze,hasClass:()=>Re,printCanvas:()=>Ue,remove:()=>ke,removeClass:()=>Ie,removeStyle:()=>qe,setChecked:()=>$e,setClass:()=>De,setTransform:()=>Be,setUnDraggable:()=>Je,splitWords:()=>Oe,triggerResize:()=>je,trim:()=>Ce});var i={};n.r(i),n.d(i,{getColumn:()=>lr,getSatByColumn:()=>cr,max:()=>rr,mean:()=>ar,min:()=>ir,mode:()=>sr,statMap:()=>ur,sum:()=>or});var o=n(3659),a=n(6838),s=n(3192),u=n(6193),l=n(9097),c=n(6875),h=n(6070),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function f(t){this.message=t}function d(t){for(var e,n,r,i,o="",a=0,s=(t=String(t)).length%3;a<t.length;){if((n=t.charCodeAt(a++))>255||(r=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");o+=p.charAt((e=n<<16|r<<8|i)>>18&63)+p.charAt(e>>12&63)+p.charAt(e>>6&63)+p.charAt(63&e)}return s?o.slice(0,s-3)+"===".substring(s):o}f.prototype=new Error,f.prototype.name="InvalidCharacterError";var m,g,y=function(){function t(e,n){(0,s.Z)(this,t),this.buffers=e,this.type=n}return(0,a.Z)(t,[{key:"arraybuffer",value:function(){return Promise.resolve(this.buffers[0])}},{key:"stream",value:function(){throw new Error("not implemented")}},{key:"text",value:function(){throw new Error("not implemented")}},{key:"slice",value:function(t,e,n){throw new Error("not implemented")}}]),t}();m=m||(m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),g="undefined"==typeof window?{devicePixelRatio:1,navigator:{userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",browserLanguage:"zh-CN",language:"zh-CN",platform:""},location:"",document:{documentElement:{style:{}},createEvent:function(){return!0},getElementById:function(t){return!0},createElement:function(){return{className:"",classList:{add:function(){return""}}}},createElementNS:function(){return!0},addEventListener:function(){return!0},removeEventListener:function(){return!0},querySelector:function(){return!1}},performance:{mark:function(t){return null},clearMeasures:function(t){return null},clearMarks:function(t){return null},measure:function(t,e,n){return{duration:0}},now:function(){return(new Date).getTime()}},Blob:"",dispatchEvent:function(t){return!0},Event:function(t,e){return!0},createElement:function(){return!0},createElementNS:function(){return!0},XMLHttpRequest:function(){return!0},addEventListener:function(){return!0},removeEventListener:function(){return!0},requestAnimationFrame:function(){return!0},cancelAnimationFrame:function(){return!0},clearTimeout:function(){return!0}}:window;const v="undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM?my.getSystemInfoSync().pixelRatio:g.devicePixelRatio;var _=(0,a.Z)((function t(e,n){(0,s.Z)(this,t),this.cancelBubble=!1,this.cancelable=!1,this.target=null,this.currentTarget=null,this.preventDefault=function(){},this.stopPropagation=function(){},this.type=e,this.timeStamp=Date.now()})),b=n(5161);function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var w=new WeakMap,S=function(){function t(){(0,s.Z)(this,t),w.set(this,{})}return(0,a.Z)(t,[{key:"addEventListener",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=w.get(this);r||(r={}),r[t]||(r[t]=[]),r[t].push(e),w.set(this,r),n.capture,n.once,n.passive}},{key:"removeEventListener",value:function(t,e){var n=w.get(this);if(n){var r=n[t];if(r&&r.length>0)for(var i=r.length;i--;i>0)if(r[i]===e){r.splice(i,1);break}}}},{key:"dispatchEvent",value:function(t){var e=w.get(this)[t.type];if(e){var n,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return x(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(r.s();!(n=r.n()).done;)(0,n.value)(t)}catch(t){r.e(t)}finally{r.f()}}}}]),t}();var E=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){var t;return(0,s.Z)(this,i),(t=r.call(this)).childNodes=[],t}return(0,a.Z)(i,[{key:"appendChild",value:function(t){this.childNodes.push(t)}},{key:"cloneNode",value:function(){var t=Object.create(this);return Object.assign(t,this),t}},{key:"removeChild",value:function(t){var e=this.childNodes.findIndex((function(e){return e===t}));return e>-1?this.childNodes.splice(e,1):null}}]),i}(S);var M,T,A,C,O=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){var t;return(0,s.Z)(this,i),(t=r.call(this)).className="",t.children=[],t}return(0,a.Z)(i,[{key:"setAttribute",value:function(t,e){this[t]=e}},{key:"getAttribute",value:function(t){return this[t]}},{key:"setAttributeNS",value:function(t,e){this[t]=e}},{key:"getAttributeNS",value:function(t){return this[t]}}]),i}(E);if("undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM){var P=my.getSystemInfoSync();M=P.screenWidth,T=P.screenHeight,A=P.windowWidth,C=P.windowHeight}else{var k=g.innerWidth,L=g.innerHeight;M=k,T=L,A=k,C=L}var I={width:M,height:T,availWidth:A,availHeight:C,availLeft:0,availTop:0},R=I.availWidth,D=I.availHeight,N={style:[]};function F(t,e){var n,r;"parentNode"in t||(n=0===e?function(){return null}:1===e?function(){return N}:function(){return null},Object.defineProperty(t,"parentNode",{enumerable:!0,get:n})),"parentElement"in t||(r=0===e?function(){return null}:1===e?function(){return N}:function(){return null},Object.defineProperty(t,"parentElement",{enumerable:!0,get:r}))}function z(t){var e=function(){return!0};t.classList=[],t.classList.add=e,t.classList.remove=e,t.classList.contains=e,t.classList.toggle=e}function B(){}var j=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;return(0,s.Z)(this,i),(t=r.call(this)).className="",t.children=[],t.focus=B,t.blur=B,t.insertBefore=B,t.appendChild=B,t.removeChild=B,t.remove=B,t.innerHTML="",t.tagName=n.toUpperCase(),F((0,b.Z)(t),o),(e=(0,b.Z)(t)).style=e.style||{},Object.assign(e.style,{top:"0px",left:"0px",width:R+"px",height:D+"px",margin:"0px",padding:"0px"}),z((0,b.Z)(t)),function(t){"clientLeft"in t||(t.clientLeft=0,t.clientTop=0),"clientWidth"in t||(t.clientWidth=R,t.clientHeight=D),"getBoundingClientRect"in t||(t.getBoundingClientRect=function(){return{x:0,y:0,top:0,left:0,width:this.clientWidth,height:this.clientHeight,right:this.clientWidth,bottom:this.clientHeight}})}((0,b.Z)(t)),function(t){"offsetLeft"in t||(t.offsetLeft=0,t.offsetTop=0),"offsetWidth"in t||(t.offsetWidth=R,t.offsetHeight=D)}((0,b.Z)(t)),function(t){"scrollLeft"in t||(t.scrollLeft=0,t.scrollTop=0),"scrollWidth"in t||(t.scrollWidth=R,t.scrollHeight=D)}((0,b.Z)(t)),t}return(0,a.Z)(i)}(O);var U=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t){return(0,s.Z)(this,i),r.call(this,t)}return(0,a.Z)(i,[{key:"addTextTrack",value:function(){}},{key:"captureStream",value:function(){}},{key:"fastSeek",value:function(){}},{key:"load",value:function(){}},{key:"pause",value:function(){}},{key:"play",value:function(){}}]),i}(j);var Z=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){return(0,s.Z)(this,i),r.call(this,"video")}return(0,a.Z)(i)}(U),V={};function G(){return V}var H=(0,a.Z)((function t(){(0,s.Z)(this,t);var e=G(),n=e.createImage&&e.createImage()||{};return"tagName"in n||(n.tagName="IMG",n.__proto__=t.prototype),F(n),z(n),Object.assign(n,{addEventListener:function(t,e){n["on".concat(t)]=e.bind(n)},removeEventListener:function(t){n["on".concat(t)]=null}}),n})),W={href:"",protocol:"",host:""};function q(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.Z)(t);if(e){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.Z)(this,n)}}var Y=function(t){(0,u.Z)(n,t);var e=q(n);function n(){return(0,s.Z)(this,n),e.call(this,"body",0)}return(0,a.Z)(n,[{key:"addEventListener",value:function(t,e){}},{key:"removeEventListener",value:function(t,e,n){}},{key:"dispatchEvent",value:function(t){}}]),n}(j),X=function(t){(0,u.Z)(n,t);var e=q(n);function n(){return(0,s.Z)(this,n),e.call(this,"html",0)}return(0,a.Z)(n,[{key:"addEventListener",value:function(t,e){}},{key:"removeEventListener",value:function(t,e){}},{key:"dispatchEvent",value:function(t){}}]),n}(j),$={},K={readyState:"complete",visibilityState:"visible",hidden:!1,fullscreen:!0,scripts:[],style:{},location:W,ontouchstart:null,ontouchmove:null,ontouchend:null,onvisibilitychange:null,parentNode:null,parentElement:null,head:null,body:null,documentElement:{style:[]},createElement:function(t){return"canvas"===(t=t.toLowerCase())?my.createOffscreenCanvas(1024,128,"2d"):"img"===t?new H:"video"===t?new Z:new j(t)},createElementNS:function(t,e){return this.createElement(e)},createTextNode:function(t){return t},getElementById:function(t){return null},getElementsByTagName:function(t){return t=t.toLowerCase(),[]},getElementsByTagNameNS:function(t,e){return this.getElementsByTagName(e)},getElementsByName:function(t){return[]},querySelector:function(t){return null},querySelectorAll:function(t){return[]},addEventListener:function(t,e,n){$[t]||($[t]=[]),$[t].push(e)},removeEventListener:function(t,e){var n=$[t];if(n&&n.length>0)for(var r=n.length;r--;r>0)if(n[r]===e){n.splice(r,1);break}},dispatchEvent:function(t){var e=t.type,n=$[e];if(n)for(var r=0;r<n.length;r++)n[r](t);t.target&&"function"==typeof t.target["on"+e]&&t.target["on"+e](t)},createEvent:function(t){return new _(t)}};K.documentElement=new X,K.head=new j("head"),K.body=new Y;var J,Q,tt,et,nt=Object,rt=n(7743),it=function(){function t(){(0,s.Z)(this,t);var e=arguments.length;if(2===e){if("number"==typeof arguments[0]&&"number"==typeof arguments[1])return this._w=arguments[0],this._h=arguments[1],void(this._data=new Uint8ClampedArray(this._w*this._h*4))}else 3===e&&"object"===(0,rt.Z)(arguments[0])&&"number"==typeof arguments[1]&&"number"==typeof arguments[2]&&(this._data=arguments[0],this._w=arguments[1],this._h=arguments[2]);throw new Error("ImageData: params error")}return(0,a.Z)(t,[{key:"width",get:function(){return this._w}},{key:"height",get:function(){return this._h}},{key:"data",get:function(){return this._data}}]),t}();if("undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM){var ot=my.getSystemInfoSync();J=ot.system,Q=ot.platform,tt=ot.language}else{var at={versions:(et=g.navigator.userAgent,{trident:et.indexOf("Trident")>-1,presto:et.indexOf("Presto")>-1,webKit:et.indexOf("AppleWebKit")>-1,gecko:et.indexOf("Gecko")>-1&&-1===et.indexOf("KHTML"),mobile:!!et.match(/AppleWebKit.*Mobile.*/),ios:!!et.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:et.indexOf("Android")>-1||et.indexOf("Linux")>-1,iPhone:et.indexOf("iPhone")>-1,iPad:et.indexOf("iPad")>-1,webApp:-1===et.indexOf("Safari"),weixin:et.indexOf("MicroMessenger")>-1,qq:" qq"===et.match(/\sQQ/i)}),language:(g.navigator.browserLanguage||g.navigator.language).toLowerCase()};at.versions.android?Q="android":at.versions.trident?Q="IE":at.versions.presto?Q="Opera":at.versions.webKit?Q="webKit":at.versions.gecko?Q="Firefox":at.versions.mobile?Q="mobile":at.versions.ios?Q="ios":at.versions.iPhone?Q="iPhone":at.versions.iPad?Q="ipad":at.versions.webApp?Q="webApp":at.versions.weixin?Q="weixin":at.versions.qq&&(Q="qq"),J=g.navigator.userAgent,tt=at.language}var st=-1!==J.toLowerCase().indexOf("android")?"Android; CPU Android 6.0":"iPhone; CPU iPhone OS 10_3_1 like Mac OS X",ut="Mozilla/5.0 (".concat(st,") AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301 MicroMessenger/6.6.0 MiniGame NetType/WIFI Language/").concat(tt),lt={platform:Q,language:tt,appVersion:"5.0 (".concat(st,") AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"),userAgent:ut},ct=0,ht=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,s.Z)(this,t),0!=e.indexOf("http://")&&0!=e.indexOf("https://")?this.href=n+e:this.href=e}return(0,a.Z)(t,null,[{key:"createObjectURL",value:function(t){var e=t.buffers[0],n=t.type,r=function(t){for(var e="",n=new Uint8Array(t),r=n.byteLength,i=0;i<r;i++)e+=String.fromCharCode(n[i]);return d(e)}(e);return"data:".concat(n,";base64, ")+r}}]),t}();var pt=new Map,ft=new Map,dt=new Map,mt=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(){var t;return(0,s.Z)(this,i),(t=r.call(this)).onabort=null,t.onerror=null,t.onload=null,t.onloadstart=null,t.onprogress=null,t.ontimeout=null,t.onloadend=null,t.onreadystatechange=null,t.readyState=0,t.response=null,t.responseText=null,t._responseType="text",t.responseXML=null,t.status=0,t.statusText="",t.upload={},t.withCredentials=!1,pt.set("requestHeader",{"content-type":"application/x-www-form-urlencoded"}),t}return(0,a.Z)(i,[{key:"responseType",set:function(t){this._responseType=t}},{key:"abort",value:function(){var t=dt.get("requestTask");t&&t.abort()}},{key:"getAllResponseHeaders",value:function(){var t=ft.get("responseHeader");return Object.keys(t).map((function(e){return"".concat(e,": ").concat(t[e])})).join("\n")}},{key:"getResponseHeader",value:function(t){return ft.get("responseHeader")[t]}},{key:"open",value:function(t,e,n){this._method=t,this._url=e}},{key:"overrideMimeType",value:function(){}},{key:"send",value:function(){}},{key:"setRequestHeader",value:function(t,e){var n=pt.get("requestHeader");n[t]=e,pt.set("requestHeader",n)}},{key:"addEventListener",value:function(t,e){var n=this;"function"==typeof e&&(this["on"+t]=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.target=t.target||n,e.call(n,t)})}},{key:"removeEventListener",value:function(t,e){this["on"+t]===e&&(this["on"+t]=null)}}]),i}(S);function gt(t){return function(e){e.type=t,K.dispatchEvent(e)}}mt.UNSEND=0,mt.OPENED=1,mt.HEADERS_RECEIVED=2,mt.LOADING=3,mt.DONE=4;var yt=gt("mousedown"),vt=gt("mousemove"),_t=gt("mouseup");var bt=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),(e=r.call(this,t)).target=G(),e.currentTarget=G(),e}return(0,a.Z)(i)}(_),xt=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","pageX","pageY","timeStamp"],wt=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,0,0,0],St="touch";function Et(t,e,n){for(var r=new bt(t),i=0;i<xt.length;i++){var o=xt[i];r[o]=e[o]||wt[i]}return r.type=t,r.target=G(),r.currentTarget=G(),r.buttons=function(t){var e=0;return"touchstart"!==t&&"touchmove"!==t&&"pointerdown"!==t&&"pointermove"!==t||(e=1),e}(t),r.which=r.buttons,r.pointerId=(e.identifier||0)+2,r.bubbles=!0,r.cancelable=!0,r.button=0,r.width=2*(e.radiusX||.5),r.height=2*(e.radiusY||.5),r.pressure=e.force||.5,r.isPrimary=function(t){return Mt===t.identifier}(e),r.pointerType=St,r.altKey=n.altKey,r.ctrlKey=n.ctrlKey,r.metaKey=n.metaKey,r.shiftKey=n.shiftKey,n.preventDefault&&(r.preventDefault=function(){n.preventDefault()}),r}var Mt=null;function Tt(t){null===Mt&&(Mt=t.identifier)}function At(t){Mt===t.identifier&&(Mt=null)}function Ct(t){return function(e){for(var n=e.changedTouches,r=0;r<n.length;r++){var i=n[r];0===r&&"pointerdown"===t?Tt(i):"pointerup"!==t&&"pointercancel"!==t||At(i);var o=Et(t,i,e);K.dispatchEvent(o)}}}var Ot=Ct("pointerdown"),Pt=Ct("pointermove"),kt=Ct("pointerup");var Lt=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),(e=r.call(this,t)).touches=[],e.targetTouches=[],e.changedTouches=[],e.target=G(),e.currentTarget=G(),e}return(0,a.Z)(i)}(_);function It(t){var e=t||{},n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.clientX,s=void 0===a?0:a,u=e.clientY,l=void 0===u?0:u;-1!==Object.keys(t).indexOf("x")?(t.pageX=t.clientX=r,t.pageY=t.clientY=o):(t.x=s,t.y=l)}function Rt(t){return function(e){var n=new Lt(t);n.changedTouches=e.changedTouches,n.touches=e.touches,n.targetTouches=Array.prototype.slice.call(e.touches),n.timeStamp=e.timeStamp,n.changedTouches.forEach((function(t){return It(t)})),n.touches.forEach((function(t){return It(t)})),n.targetTouches.forEach((function(t){return It(t)})),K.dispatchEvent(n)}}var Dt=Rt("touchstart"),Nt=Rt("touchmove"),Ft=Rt("touchend"),zt=("mapCameaParams",function(t){t.type="mapCameaParams",K.dispatchEvent(t)}),Bt=!1;function jt(t){Bt=t}var Ut="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,Zt="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram),Vt=(Ut||Zt)&&Bt,Gt={atob:function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new f("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i="",o=0,a=0;r=e.charAt(a++);~r&&(n=o%4?64*n+r:r,o++%4)?i+=String.fromCharCode(255&n>>(-2*o&6)):0)r=p.indexOf(r);return i},btoa:d,devicePixelRatio:v,Blob:y,document:K,Element:O,Event:_,EventTarget:S,HTMLCanvasElement:nt,HTMLElement:j,HTMLMediaElement:U,HTMLVideoElement:Z,Image:H,ImageData:it,navigator:lt,Node:E,requestAnimationFrame:function(t){var e=G();return e.requestAnimationFrame?e.requestAnimationFrame(t):function(t){var e=Date.now(),n=Math.max(ct+23,e);return setTimeout((function(){t(ct=n)}),n-e)}(t)},cancelAnimationFrame:function(t){var e=G();return e.cancelAnimationFrame?e.cancelAnimationFrame(t):clearTimeout(t)},screen:I,XMLHttpRequest:mt,performance:{mark:function(t){return null},clearMeasures:function(t){return null},clearMarks:function(t){return null},measure:function(t,e,n){return{duration:0}},now:function(){}},URL:ht,WebGLRenderingContext:{GCCSO_SHADER_BINARY_FJ:37472,_3DC_XY_AMD:34810,_3DC_X_AMD:34809,ACTIVE_ATTRIBUTES:35721,ACTIVE_ATTRIBUTE_MAX_LENGTH:35722,ACTIVE_PROGRAM_EXT:33369,ACTIVE_TEXTURE:34016,ACTIVE_UNIFORMS:35718,ACTIVE_UNIFORM_MAX_LENGTH:35719,ALIASED_LINE_WIDTH_RANGE:33902,ALIASED_POINT_SIZE_RANGE:33901,ALL_COMPLETED_NV:34034,ALL_SHADER_BITS_EXT:4294967295,ALPHA:6406,ALPHA16F_EXT:34844,ALPHA32F_EXT:34838,ALPHA8_EXT:32828,ALPHA8_OES:32828,ALPHA_BITS:3413,ALPHA_TEST_FUNC_QCOM:3009,ALPHA_TEST_QCOM:3008,ALPHA_TEST_REF_QCOM:3010,ALREADY_SIGNALED_APPLE:37146,ALWAYS:519,AMD_compressed_3DC_texture:1,AMD_compressed_ATC_texture:1,AMD_performance_monitor:1,AMD_program_binary_Z400:1,ANGLE_depth_texture:1,ANGLE_framebuffer_blit:1,ANGLE_framebuffer_multisample:1,ANGLE_instanced_arrays:1,ANGLE_pack_reverse_row_order:1,ANGLE_program_binary:1,ANGLE_texture_compression_dxt3:1,ANGLE_texture_compression_dxt5:1,ANGLE_texture_usage:1,ANGLE_translated_shader_source:1,ANY_SAMPLES_PASSED_CONSERVATIVE_EXT:36202,ANY_SAMPLES_PASSED_EXT:35887,APPLE_copy_texture_levels:1,APPLE_framebuffer_multisample:1,APPLE_rgb_422:1,APPLE_sync:1,APPLE_texture_format_BGRA8888:1,APPLE_texture_max_level:1,ARM_mali_program_binary:1,ARM_mali_shader_binary:1,ARM_rgba8:1,ARRAY_BUFFER:34962,ARRAY_BUFFER_BINDING:34964,ATC_RGBA_EXPLICIT_ALPHA_AMD:35987,ATC_RGBA_INTERPOLATED_ALPHA_AMD:34798,ATC_RGB_AMD:35986,ATTACHED_SHADERS:35717,BACK:1029,BGRA8_EXT:37793,BGRA_EXT:32993,BGRA_IMG:32993,BINNING_CONTROL_HINT_QCOM:36784,BLEND:3042,BLEND_COLOR:32773,BLEND_DST_ALPHA:32970,BLEND_DST_RGB:32968,BLEND_EQUATION:32777,BLEND_EQUATION_ALPHA:34877,BLEND_EQUATION_RGB:32777,BLEND_SRC_ALPHA:32971,BLEND_SRC_RGB:32969,BLUE_BITS:3412,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,BUFFER:33504,BUFFER_ACCESS_OES:35003,BUFFER_MAPPED_OES:35004,BUFFER_MAP_POINTER_OES:35005,BUFFER_OBJECT_EXT:37201,BUFFER_SIZE:34660,BUFFER_USAGE:34661,BYTE:5120,CCW:2305,CLAMP_TO_BORDER_NV:33069,CLAMP_TO_EDGE:33071,COLOR_ATTACHMENT0:36064,COLOR_ATTACHMENT0_NV:36064,COLOR_ATTACHMENT10_NV:36074,COLOR_ATTACHMENT11_NV:36075,COLOR_ATTACHMENT12_NV:36076,COLOR_ATTACHMENT13_NV:36077,COLOR_ATTACHMENT14_NV:36078,COLOR_ATTACHMENT15_NV:36079,COLOR_ATTACHMENT1_NV:36065,COLOR_ATTACHMENT2_NV:36066,COLOR_ATTACHMENT3_NV:36067,COLOR_ATTACHMENT4_NV:36068,COLOR_ATTACHMENT5_NV:36069,COLOR_ATTACHMENT6_NV:36070,COLOR_ATTACHMENT7_NV:36071,COLOR_ATTACHMENT8_NV:36072,COLOR_ATTACHMENT9_NV:36073,COLOR_ATTACHMENT_EXT:37104,COLOR_BUFFER_BIT:16384,COLOR_BUFFER_BIT0_QCOM:1,COLOR_BUFFER_BIT1_QCOM:2,COLOR_BUFFER_BIT2_QCOM:4,COLOR_BUFFER_BIT3_QCOM:8,COLOR_BUFFER_BIT4_QCOM:16,COLOR_BUFFER_BIT5_QCOM:32,COLOR_BUFFER_BIT6_QCOM:64,COLOR_BUFFER_BIT7_QCOM:128,COLOR_CLEAR_VALUE:3106,COLOR_EXT:6144,COLOR_WRITEMASK:3107,COMPARE_REF_TO_TEXTURE_EXT:34894,COMPILE_STATUS:35713,COMPRESSED_RGBA_ASTC_10x10_KHR:37819,COMPRESSED_RGBA_ASTC_10x5_KHR:37816,COMPRESSED_RGBA_ASTC_10x6_KHR:37817,COMPRESSED_RGBA_ASTC_10x8_KHR:37818,COMPRESSED_RGBA_ASTC_12x10_KHR:37820,COMPRESSED_RGBA_ASTC_12x12_KHR:37821,COMPRESSED_RGBA_ASTC_4x4_KHR:37808,COMPRESSED_RGBA_ASTC_5x4_KHR:37809,COMPRESSED_RGBA_ASTC_5x5_KHR:37810,COMPRESSED_RGBA_ASTC_6x5_KHR:37811,COMPRESSED_RGBA_ASTC_6x6_KHR:37812,COMPRESSED_RGBA_ASTC_8x5_KHR:37813,COMPRESSED_RGBA_ASTC_8x6_KHR:37814,COMPRESSED_RGBA_ASTC_8x8_KHR:37815,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_PVRTC_2BPPV2_IMG:37175,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_4BPPV2_IMG:37176,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_ANGLE:33778,COMPRESSED_RGBA_S3TC_DXT5_ANGLE:33779,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:37853,COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:37847,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV:35919,COMPRESSED_SRGB_S3TC_DXT1_NV:35916,COMPRESSED_TEXTURE_FORMATS:34467,CONDITION_SATISFIED_APPLE:37148,CONSTANT_ALPHA:32771,CONSTANT_COLOR:32769,CONTEXT_FLAG_DEBUG_BIT:2,CONTEXT_ROBUST_ACCESS_EXT:37107,COUNTER_RANGE_AMD:35777,COUNTER_TYPE_AMD:35776,COVERAGE_ALL_FRAGMENTS_NV:36565,COVERAGE_ATTACHMENT_NV:36562,COVERAGE_AUTOMATIC_NV:36567,COVERAGE_BUFFERS_NV:36563,COVERAGE_BUFFER_BIT_NV:32768,COVERAGE_COMPONENT4_NV:36561,COVERAGE_COMPONENT_NV:36560,COVERAGE_EDGE_FRAGMENTS_NV:36566,COVERAGE_SAMPLES_NV:36564,CPU_OPTIMIZED_QCOM:36785,CULL_FACE:2884,CULL_FACE_MODE:2885,CURRENT_PROGRAM:35725,CURRENT_QUERY_EXT:34917,CURRENT_VERTEX_ATTRIB:34342,CW:2304,DEBUG_CALLBACK_FUNCTION:33348,DEBUG_CALLBACK_USER_PARAM:33349,DEBUG_GROUP_STACK_DEPTH:33389,DEBUG_LOGGED_MESSAGES:37189,DEBUG_NEXT_LOGGED_MESSAGE_LENGTH:33347,DEBUG_OUTPUT:37600,DEBUG_OUTPUT_SYNCHRONOUS:33346,DEBUG_SEVERITY_HIGH:37190,DEBUG_SEVERITY_LOW:37192,DEBUG_SEVERITY_MEDIUM:37191,DEBUG_SEVERITY_NOTIFICATION:33387,DEBUG_SOURCE_API:33350,DEBUG_SOURCE_APPLICATION:33354,DEBUG_SOURCE_OTHER:33355,DEBUG_SOURCE_SHADER_COMPILER:33352,DEBUG_SOURCE_THIRD_PARTY:33353,DEBUG_SOURCE_WINDOW_SYSTEM:33351,DEBUG_TYPE_DEPRECATED_BEHAVIOR:33357,DEBUG_TYPE_ERROR:33356,DEBUG_TYPE_MARKER:33384,DEBUG_TYPE_OTHER:33361,DEBUG_TYPE_PERFORMANCE:33360,DEBUG_TYPE_POP_GROUP:33386,DEBUG_TYPE_PORTABILITY:33359,DEBUG_TYPE_PUSH_GROUP:33385,DEBUG_TYPE_UNDEFINED_BEHAVIOR:33358,DECR:7683,DECR_WRAP:34056,DELETE_STATUS:35712,DEPTH24_STENCIL8_OES:35056,DEPTH_ATTACHMENT:36096,DEPTH_STENCIL_ATTACHMENT:33306,DEPTH_BITS:3414,DEPTH_BUFFER_BIT:256,DEPTH_BUFFER_BIT0_QCOM:256,DEPTH_BUFFER_BIT1_QCOM:512,DEPTH_BUFFER_BIT2_QCOM:1024,DEPTH_BUFFER_BIT3_QCOM:2048,DEPTH_BUFFER_BIT4_QCOM:4096,DEPTH_BUFFER_BIT5_QCOM:8192,DEPTH_BUFFER_BIT6_QCOM:16384,DEPTH_BUFFER_BIT7_QCOM:32768,DEPTH_CLEAR_VALUE:2931,DEPTH_COMPONENT:6402,DEPTH_COMPONENT16:33189,DEPTH_COMPONENT16_NONLINEAR_NV:36396,DEPTH_COMPONENT16_OES:33189,DEPTH_COMPONENT24_OES:33190,DEPTH_COMPONENT32_OES:33191,DEPTH_EXT:6145,DEPTH_FUNC:2932,DEPTH_RANGE:2928,DEPTH_STENCIL:34041,DEPTH_STENCIL_OES:34041,DEPTH_TEST:2929,DEPTH_WRITEMASK:2930,DITHER:3024,DMP_shader_binary:1,DONT_CARE:4352,DRAW_BUFFER0_NV:34853,DRAW_BUFFER10_NV:34863,DRAW_BUFFER11_NV:34864,DRAW_BUFFER12_NV:34865,DRAW_BUFFER13_NV:34866,DRAW_BUFFER14_NV:34867,DRAW_BUFFER15_NV:34868,DRAW_BUFFER1_NV:34854,DRAW_BUFFER2_NV:34855,DRAW_BUFFER3_NV:34856,DRAW_BUFFER4_NV:34857,DRAW_BUFFER5_NV:34858,DRAW_BUFFER6_NV:34859,DRAW_BUFFER7_NV:34860,DRAW_BUFFER8_NV:34861,DRAW_BUFFER9_NV:34862,DRAW_BUFFER_EXT:3073,DRAW_FRAMEBUFFER_ANGLE:36009,DRAW_FRAMEBUFFER_APPLE:36009,DRAW_FRAMEBUFFER_BINDING_ANGLE:36006,DRAW_FRAMEBUFFER_BINDING_APPLE:36006,DRAW_FRAMEBUFFER_BINDING_NV:36006,DRAW_FRAMEBUFFER_NV:36009,DST_ALPHA:772,DST_COLOR:774,DYNAMIC_DRAW:35048,ELEMENT_ARRAY_BUFFER:34963,ELEMENT_ARRAY_BUFFER_BINDING:34965,EQUAL:514,ES_VERSION_2_0:1,ETC1_RGB8_OES:36196,ETC1_SRGB8_NV:35054,EXTENSIONS:7939,EXT_blend_minmax:1,EXT_color_buffer_half_float:1,EXT_debug_label:1,EXT_debug_marker:1,EXT_discard_framebuffer:1,EXT_map_buffer_range:1,EXT_multi_draw_arrays:1,EXT_multisampled_render_to_texture:1,EXT_multiview_draw_buffers:1,EXT_occlusion_query_boolean:1,EXT_read_format_bgra:1,EXT_robustness:1,EXT_sRGB:1,EXT_separate_shader_objects:1,EXT_shader_framebuffer_fetch:1,EXT_shader_texture_lod:1,EXT_shadow_samplers:1,EXT_texture_compression_dxt1:1,EXT_texture_filter_anisotropic:1,EXT_texture_format_BGRA8888:1,EXT_texture_rg:1,EXT_texture_storage:1,EXT_texture_type_2_10_10_10_REV:1,EXT_unpack_subimage:1,FALSE:0,FASTEST:4353,FENCE_CONDITION_NV:34036,FENCE_STATUS_NV:34035,FIXED:5132,FJ_shader_binary_GCCSO:1,FLOAT:5126,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,FRAGMENT_SHADER:35632,FRAGMENT_SHADER_BIT_EXT:2,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT:35410,FRAMEBUFFER:36160,FRAMEBUFFER_ATTACHMENT_ANGLE:37795,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES:36052,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT:36204,FRAMEBUFFER_BINDING:36006,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE:36182,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE:36182,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:36182,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG:37172,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV:36182,FRAMEBUFFER_UNDEFINED_OES:33305,FRAMEBUFFER_UNSUPPORTED:36061,FRONT:1028,FRONT_AND_BACK:1032,FRONT_FACE:2886,FUNC_ADD:32774,FUNC_REVERSE_SUBTRACT:32779,FUNC_SUBTRACT:32778,GENERATE_MIPMAP_HINT:33170,GEQUAL:518,GPU_OPTIMIZED_QCOM:36786,GREATER:516,GREEN_BITS:3411,GUILTY_CONTEXT_RESET_EXT:33363,HALF_FLOAT_OES:36193,HIGH_FLOAT:36338,HIGH_INT:36341,IMG_multisampled_render_to_texture:1,IMG_program_binary:1,IMG_read_format:1,IMG_shader_binary:1,IMG_texture_compression_pvrtc:1,IMG_texture_compression_pvrtc2:1,IMPLEMENTATION_COLOR_READ_FORMAT:35739,IMPLEMENTATION_COLOR_READ_TYPE:35738,INCR:7682,INCR_WRAP:34055,INFO_LOG_LENGTH:35716,INNOCENT_CONTEXT_RESET_EXT:33364,INT:5124,INT_10_10_10_2_OES:36343,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,INVALID_ENUM:1280,INVALID_FRAMEBUFFER_OPERATION:1286,INVALID_OPERATION:1282,INVALID_VALUE:1281,INVERT:5386,KEEP:7680,KHR_debug:1,KHR_texture_compression_astc_ldr:1,LEFT:1030,LEQUAL:515,LESS:513,LINEAR:9729,LINEAR_MIPMAP_LINEAR:9987,LINEAR_MIPMAP_NEAREST:9985,LINES:1,LINE_LOOP:2,LINE_STRIP:3,LINE_WIDTH:2849,LINK_STATUS:35714,LOSE_CONTEXT_ON_RESET_EXT:33362,LOW_FLOAT:36336,LOW_INT:36339,LUMINANCE:6409,LUMINANCE16F_EXT:34846,LUMINANCE32F_EXT:34840,LUMINANCE4_ALPHA4_OES:32835,LUMINANCE8_ALPHA8_EXT:32837,LUMINANCE8_ALPHA8_OES:32837,LUMINANCE8_EXT:32832,LUMINANCE8_OES:32832,LUMINANCE_ALPHA:6410,LUMINANCE_ALPHA16F_EXT:34847,LUMINANCE_ALPHA32F_EXT:34841,MALI_PROGRAM_BINARY_ARM:36705,MALI_SHADER_BINARY_ARM:36704,MAP_FLUSH_EXPLICIT_BIT_EXT:16,MAP_INVALIDATE_BUFFER_BIT_EXT:8,MAP_INVALIDATE_RANGE_BIT_EXT:4,MAP_READ_BIT_EXT:1,MAP_UNSYNCHRONIZED_BIT_EXT:32,MAP_WRITE_BIT_EXT:2,MAX_3D_TEXTURE_SIZE_OES:32883,MAX_COLOR_ATTACHMENTS_NV:36063,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_CUBE_MAP_TEXTURE_SIZE:34076,MAX_DEBUG_GROUP_STACK_DEPTH:33388,MAX_DEBUG_LOGGED_MESSAGES:37188,MAX_DEBUG_MESSAGE_LENGTH:37187,MAX_DRAW_BUFFERS_NV:34852,MAX_EXT:32776,MAX_FRAGMENT_UNIFORM_VECTORS:36349,MAX_LABEL_LENGTH:33512,MAX_MULTIVIEW_BUFFERS_EXT:37106,MAX_RENDERBUFFER_SIZE:34024,MAX_SAMPLES_ANGLE:36183,MAX_SAMPLES_APPLE:36183,MAX_SAMPLES_EXT:36183,MAX_SAMPLES_IMG:37173,MAX_SAMPLES_NV:36183,MAX_SERVER_WAIT_TIMEOUT_APPLE:37137,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,MAX_TEXTURE_SIZE:3379,MAX_VARYING_VECTORS:36348,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VIEWPORT_DIMS:3386,MEDIUM_FLOAT:36337,MEDIUM_INT:36340,MIN_EXT:32775,MIRRORED_REPEAT:33648,MULTISAMPLE_BUFFER_BIT0_QCOM:16777216,MULTISAMPLE_BUFFER_BIT1_QCOM:33554432,MULTISAMPLE_BUFFER_BIT2_QCOM:67108864,MULTISAMPLE_BUFFER_BIT3_QCOM:134217728,MULTISAMPLE_BUFFER_BIT4_QCOM:268435456,MULTISAMPLE_BUFFER_BIT5_QCOM:536870912,MULTISAMPLE_BUFFER_BIT6_QCOM:1073741824,MULTISAMPLE_BUFFER_BIT7_QCOM:2147483648,MULTIVIEW_EXT:37105,NEAREST:9728,NEAREST_MIPMAP_LINEAR:9986,NEAREST_MIPMAP_NEAREST:9984,NEVER:512,NICEST:4354,NONE:0,NOTEQUAL:517,NO_ERROR:0,NO_RESET_NOTIFICATION_EXT:33377,NUM_COMPRESSED_TEXTURE_FORMATS:34466,NUM_PROGRAM_BINARY_FORMATS_OES:34814,NUM_SHADER_BINARY_FORMATS:36345,NV_coverage_sample:1,NV_depth_nonlinear:1,NV_draw_buffers:1,NV_draw_instanced:1,NV_fbo_color_attachments:1,NV_fence:1,NV_framebuffer_blit:1,NV_framebuffer_multisample:1,NV_generate_mipmap_sRGB:1,NV_instanced_arrays:1,NV_read_buffer:1,NV_read_buffer_front:1,NV_read_depth:1,NV_read_depth_stencil:1,NV_read_stencil:1,NV_sRGB_formats:1,NV_shadow_samplers_array:1,NV_shadow_samplers_cube:1,NV_texture_border_clamp:1,NV_texture_compression_s3tc_update:1,NV_texture_npot_2D_mipmap:1,OBJECT_TYPE_APPLE:37138,OES_EGL_image:1,OES_EGL_image_external:1,OES_compressed_ETC1_RGB8_texture:1,OES_compressed_paletted_texture:1,OES_depth24:1,OES_depth32:1,OES_depth_texture:1,OES_element_index_uint:1,OES_fbo_render_mipmap:1,OES_fragment_precision_high:1,OES_get_program_binary:1,OES_mapbuffer:1,OES_packed_depth_stencil:1,OES_required_internalformat:1,OES_rgb8_rgba8:1,OES_standard_derivatives:1,OES_stencil1:1,OES_stencil4:1,OES_surfaceless_context:1,OES_texture_3D:1,OES_texture_float:1,OES_texture_float_linear:1,OES_texture_half_float:1,OES_texture_half_float_linear:1,OES_texture_npot:1,OES_vertex_array_object:1,OES_vertex_half_float:1,OES_vertex_type_10_10_10_2:1,ONE:1,ONE_MINUS_CONSTANT_ALPHA:32772,ONE_MINUS_CONSTANT_COLOR:32770,ONE_MINUS_DST_ALPHA:773,ONE_MINUS_DST_COLOR:775,ONE_MINUS_SRC_ALPHA:771,ONE_MINUS_SRC_COLOR:769,OUT_OF_MEMORY:1285,PACK_ALIGNMENT:3333,PACK_REVERSE_ROW_ORDER_ANGLE:37796,PALETTE4_R5_G6_B5_OES:35730,PALETTE4_RGB5_A1_OES:35732,PALETTE4_RGB8_OES:35728,PALETTE4_RGBA4_OES:35731,PALETTE4_RGBA8_OES:35729,PALETTE8_R5_G6_B5_OES:35735,PALETTE8_RGB5_A1_OES:35737,PALETTE8_RGB8_OES:35733,PALETTE8_RGBA4_OES:35736,PALETTE8_RGBA8_OES:35734,PERCENTAGE_AMD:35779,PERFMON_GLOBAL_MODE_QCOM:36768,PERFMON_RESULT_AMD:35782,PERFMON_RESULT_AVAILABLE_AMD:35780,PERFMON_RESULT_SIZE_AMD:35781,POINTS:0,POLYGON_OFFSET_FACTOR:32824,POLYGON_OFFSET_FILL:32823,POLYGON_OFFSET_UNITS:10752,PROGRAM:33506,PROGRAM_BINARY_ANGLE:37798,PROGRAM_BINARY_FORMATS_OES:34815,PROGRAM_BINARY_LENGTH_OES:34625,PROGRAM_OBJECT_EXT:35648,PROGRAM_PIPELINE_BINDING_EXT:33370,PROGRAM_PIPELINE_OBJECT_EXT:35407,PROGRAM_SEPARABLE_EXT:33368,QCOM_alpha_test:1,QCOM_binning_control:1,QCOM_driver_control:1,QCOM_extended_get:1,QCOM_extended_get2:1,QCOM_perfmon_global_mode:1,QCOM_tiled_rendering:1,QCOM_writeonly_rendering:1,QUERY:33507,QUERY_OBJECT_EXT:37203,QUERY_RESULT_AVAILABLE_EXT:34919,QUERY_RESULT_EXT:34918,R16F_EXT:33325,R32F_EXT:33326,R8_EXT:33321,READ_BUFFER_EXT:3074,READ_BUFFER_NV:3074,READ_FRAMEBUFFER_ANGLE:36008,READ_FRAMEBUFFER_APPLE:36008,READ_FRAMEBUFFER_BINDING_ANGLE:36010,READ_FRAMEBUFFER_BINDING_APPLE:36010,READ_FRAMEBUFFER_BINDING_NV:36010,READ_FRAMEBUFFER_NV:36008,RED_BITS:3410,RED_EXT:6403,RENDERBUFFER:36161,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_BINDING:36007,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_SAMPLES_ANGLE:36011,RENDERBUFFER_SAMPLES_APPLE:36011,RENDERBUFFER_SAMPLES_EXT:36011,RENDERBUFFER_SAMPLES_IMG:37171,RENDERBUFFER_SAMPLES_NV:36011,RENDERBUFFER_STENCIL_SIZE:36181,RENDERBUFFER_WIDTH:36162,RENDERER:7937,RENDER_DIRECT_TO_FRAMEBUFFER_QCOM:36787,REPEAT:10497,REPLACE:7681,REQUIRED_TEXTURE_IMAGE_UNITS_OES:36200,RESET_NOTIFICATION_STRATEGY_EXT:33366,RG16F_EXT:33327,RG32F_EXT:33328,RG8_EXT:33323,RGB:6407,RGB10_A2_EXT:32857,RGB10_EXT:32850,RGB16F_EXT:34843,RGB32F_EXT:34837,RGB565:36194,RGB565_OES:36194,RGB5_A1:32855,RGB5_A1_OES:32855,RGB8_OES:32849,RGBA:6408,RGBA16F_EXT:34842,RGBA32F_EXT:34836,RGBA4:32854,RGBA4_OES:32854,RGBA8_OES:32856,RGB_422_APPLE:35359,RG_EXT:33319,RIGHT:1031,SAMPLER:33510,SAMPLER_2D:35678,SAMPLER_2D_ARRAY_SHADOW_NV:36292,SAMPLER_2D_SHADOW_EXT:35682,SAMPLER_3D_OES:35679,SAMPLER_CUBE:35680,SAMPLER_CUBE_SHADOW_NV:36293,SAMPLER_EXTERNAL_OES:36198,SAMPLES:32937,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_BUFFERS:32936,SAMPLE_COVERAGE:32928,SAMPLE_COVERAGE_INVERT:32939,SAMPLE_COVERAGE_VALUE:32938,SCISSOR_BOX:3088,SCISSOR_TEST:3089,SGX_BINARY_IMG:35850,SGX_PROGRAM_BINARY_IMG:37168,SHADER:33505,SHADER_BINARY_DMP:37456,SHADER_BINARY_FORMATS:36344,SHADER_BINARY_VIV:36804,SHADER_COMPILER:36346,SHADER_OBJECT_EXT:35656,SHADER_SOURCE_LENGTH:35720,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,SHORT:5122,SIGNALED_APPLE:37145,SLUMINANCE8_ALPHA8_NV:35909,SLUMINANCE8_NV:35911,SLUMINANCE_ALPHA_NV:35908,SLUMINANCE_NV:35910,SRC_ALPHA:770,SRC_ALPHA_SATURATE:776,SRC_COLOR:768,SRGB8_ALPHA8_EXT:35907,SRGB8_NV:35905,SRGB_ALPHA_EXT:35906,SRGB_EXT:35904,STACK_OVERFLOW:1283,STACK_UNDERFLOW:1284,STATE_RESTORE:35804,STATIC_DRAW:35044,STENCIL_ATTACHMENT:36128,STENCIL_BACK_FAIL:34817,STENCIL_BACK_FUNC:34816,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,STENCIL_BITS:3415,STENCIL_BUFFER_BIT:1024,STENCIL_BUFFER_BIT0_QCOM:65536,STENCIL_BUFFER_BIT1_QCOM:131072,STENCIL_BUFFER_BIT2_QCOM:262144,STENCIL_BUFFER_BIT3_QCOM:524288,STENCIL_BUFFER_BIT4_QCOM:1048576,STENCIL_BUFFER_BIT5_QCOM:2097152,STENCIL_BUFFER_BIT6_QCOM:4194304,STENCIL_BUFFER_BIT7_QCOM:8388608,STENCIL_CLEAR_VALUE:2961,STENCIL_EXT:6146,STENCIL_FAIL:2964,STENCIL_FUNC:2962,STENCIL_INDEX1_OES:36166,STENCIL_INDEX4_OES:36167,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_TEST:2960,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STREAM_DRAW:35040,SUBPIXEL_BITS:3408,SYNC_CONDITION_APPLE:37139,SYNC_FENCE_APPLE:37142,SYNC_FLAGS_APPLE:37141,SYNC_FLUSH_COMMANDS_BIT_APPLE:1,SYNC_GPU_COMMANDS_COMPLETE_APPLE:37143,SYNC_OBJECT_APPLE:35411,SYNC_STATUS_APPLE:37140,TEXTURE:5890,TEXTURE0:33984,TEXTURE1:33985,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE2:33986,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE3:33987,TEXTURE30:34014,TEXTURE31:34015,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE_2D:3553,TEXTURE_3D_OES:32879,TEXTURE_BINDING_2D:32873,TEXTURE_BINDING_3D_OES:32874,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_BINDING_EXTERNAL_OES:36199,TEXTURE_BORDER_COLOR_NV:4100,TEXTURE_COMPARE_FUNC_EXT:34893,TEXTURE_COMPARE_MODE_EXT:34892,TEXTURE_CUBE_MAP:34067,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_DEPTH_QCOM:35796,TEXTURE_EXTERNAL_OES:36197,TEXTURE_FORMAT_QCOM:35798,TEXTURE_HEIGHT_QCOM:35795,TEXTURE_IMAGE_VALID_QCOM:35800,TEXTURE_IMMUTABLE_FORMAT_EXT:37167,TEXTURE_INTERNAL_FORMAT_QCOM:35797,TEXTURE_MAG_FILTER:10240,TEXTURE_MAX_ANISOTROPY_EXT:34046,TEXTURE_MAX_LEVEL_APPLE:33085,TEXTURE_MIN_FILTER:10241,TEXTURE_NUM_LEVELS_QCOM:35801,TEXTURE_OBJECT_VALID_QCOM:35803,TEXTURE_SAMPLES_IMG:37174,TEXTURE_TARGET_QCOM:35802,TEXTURE_TYPE_QCOM:35799,TEXTURE_USAGE_ANGLE:37794,TEXTURE_WIDTH_QCOM:35794,TEXTURE_WRAP_R_OES:32882,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TIMEOUT_EXPIRED_APPLE:37147,TIMEOUT_IGNORED_APPLE:0x10000000000000000,TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE:37792,TRIANGLES:4,TRIANGLE_FAN:6,TRIANGLE_STRIP:5,TRUE:1,UNKNOWN_CONTEXT_RESET_EXT:33365,UNPACK_ALIGNMENT:3317,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_PIXELS:3316,UNPACK_SKIP_ROWS:3315,UNSIGNALED_APPLE:37144,UNSIGNED_BYTE:5121,UNSIGNED_INT:5125,UNSIGNED_INT64_AMD:35778,UNSIGNED_INT_10_10_10_2_OES:36342,UNSIGNED_INT_24_8_OES:34042,UNSIGNED_INT_2_10_10_10_REV_EXT:33640,UNSIGNED_NORMALIZED_EXT:35863,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_1_5_5_5_REV_EXT:33638,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_4_4_4_4_REV_EXT:33637,UNSIGNED_SHORT_4_4_4_4_REV_IMG:33637,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_8_8_APPLE:34234,UNSIGNED_SHORT_8_8_REV_APPLE:34235,VALIDATE_STATUS:35715,VENDOR:7936,VERSION:7938,VERTEX_ARRAY_BINDING_OES:34229,VERTEX_ARRAY_OBJECT_EXT:37204,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,VERTEX_ATTRIB_ARRAY_DIVISOR_NV:35070,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_SHADER:35633,VERTEX_SHADER_BIT_EXT:1,VIEWPORT:2978,VIV_shader_binary:1,WAIT_FAILED_APPLE:37149,WRITEONLY_RENDERING_QCOM:34851,WRITE_ONLY_OES:35001,Z400_BINARY_AMD:34624,ZERO:0,RASTERIZER_DISCARD:35977,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444},WebGL2RenderingContext:{},addEventListener:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};K.addEventListener(t,e,n)},removeEventListener:function(t,e,n){K.removeEventListener(t,e)},dispatchEvent:function(t){K.dispatchEvent(t)},innerWidth:I.availWidth,innerHeight:I.availHeight,setTimeout,clearTimeout,setInterval,clearInterval},Ht=Vt?Gt:g,Wt=Vt?mt:g.XMLHttpRequest,qt=Vt?W:g.location;var Yt=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t,e,n,o){var a;return(0,s.Z)(this,i),(a=r.call(this,"AJAXError: ".concat(e," (").concat(t,"): ").concat(n))).status=t,a.statusText=e,a.url=n,a.body=o,a}return(0,a.Z)(i)}((0,h.Z)(Error));function Xt(t,e){var n=new Wt,r=Array.isArray(t.url)?t.url[0]:t.url;for(var i in n.open(t.method||"GET",r,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer"),t.headers)t.headers.hasOwnProperty(i)&&n.setRequestHeader(i,t.headers[i]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var i=n.response;if("json"===t.type)try{i=JSON.parse(n.response)}catch(t){return e(t)}e(null,i,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"),n)}else{var o=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});e(new Yt(n.status,n.statusText,r.toString(),o))}},n.send(t.body),n}function $t(t){return new Promise((function(e,n){Xt(t,(function(t,r,i,o,a){t?n({err:t,data:null,xhr:a}):e({err:null,data:r,cacheControl:i,expires:o,xhr:a})}))}))}function Kt(t,e){return Xt(t,e)}var Jt=function(t,e){return Kt((0,o.Z)((0,o.Z)({},t),{},{type:"json"}),e)},Qt=function(t,e){return Kt((0,o.Z)((0,o.Z)({},t),{},{type:"arrayBuffer"}),e)},te=function(t,e){return Kt((0,o.Z)((0,o.Z)({},t),{},{method:"POST"}),e)};function ee(t){var e=Ht.document.createElement("a");return e.href=t,e.protocol===Ht.document.location.protocol&&e.host===Ht.document.location.host}var ne="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function re(t,e){var n=new Ht.Image,r=Ht.URL||Ht.webkitURL;n.crossOrigin="anonymous",n.onload=function(){e(null,n),r.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((function(){n.src=ne}))},n.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 i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?r.createObjectURL(i):ne}function ie(t,e){var n=new Blob([new Uint8Array(t)],{type:"image/png"});createImageBitmap(n).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of ".concat(t.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")))}))}var oe=function(t,e,n){var r=function(t,r){if(t)e(t);else if(r){var i="function"==typeof createImageBitmap,o=n?n(r):r;i?ie(o,e):re(o,e)}};return"json"===t.type?Jt(t,r):Qt(t,r)},ae=function(t,e){"function"==typeof createImageBitmap?ie(t,e):re(t,e)},se=function(t){return t.CENTER="center",t.TOP="top",t["TOP-LEFT"]="top-left",t["TOP-RIGHT"]="top-right",t.BOTTOM="bottom",t["BOTTOM-LEFT"]="bottom-left",t["BOTTOM-RIGHT"]="bottom-right",t.LEFT="left",t.RIGHT="right",t}({}),ue={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 le(t,e,n){var r=t.classList;for(var i in ue)ue.hasOwnProperty(i)&&r.remove("l7-".concat(n,"-anchor-").concat(i));r.add("l7-".concat(n,"-anchor-").concat(e))}var ce=n(4537);function he(t){return"string"==typeof t&&!!ce.ZP(t)}function pe(t){var e=ce.ZP(t),n=[0,0,0,0];return null!=e&&(n[0]=e.r/255,n[1]=e.g/255,n[2]=e.b/255,n[3]=e.opacity),n}function fe(t){return(t&&t[0])+256*(t&&t[1])+65536*(t&&t[2])-1}function de(t){return[t+1&255,t+1>>8&255,t+1>>8>>8&255]}function me(t){var e=Ht.document.createElement("canvas"),n=e.getContext("2d");e.width=256,e.height=1;for(var r=null,i=n.createLinearGradient(0,0,256,1),o=t.positions[0],a=t.positions[t.positions.length-1],s=0;s<t.colors.length;++s){var u=(t.positions[s]-o)/(a-o);i.addColorStop(u,t.colors[s])}if(n.fillStyle=i,n.fillRect(0,0,256,1),Vt)return r=new Uint8ClampedArray(n.getImageData(0,0,256,1).data),e=null,n=null,{data:r,width:256,height:1};r=n.getImageData(0,0,256,1).data;for(var l=n.createImageData(256,1),c=0;c<l.data.length;c+=4)l.data[c+0]=r[c+0],l.data[c+1]=r[c+1],l.data[c+2]=r[c+2],l.data[c+3]=r[c+3];return e=null,n=null,l}function ge(t,e){var n=Ht.document.createElement("canvas"),r=n.getContext("2d");n.width=256,n.height=1;for(var i=r.createLinearGradient(0,0,256,1),o=e[1]-e[0],a=0;a<t.colors.length;++a){var s=Math.max((t.positions[a]-e[0])/o,0);i.addColorStop(s,t.colors[a])}r.fillStyle=i,r.fillRect(0,0,256,1);var u=r.getImageData(0,0,256,1).data,l=be(r,u);return n=null,r=null,l}function ye(t){var e=Ht.document.createElement("canvas"),n=e.getContext("2d");e.width=256,e.height=1;var r=n.createImageData(256,1);return r.data.fill(0),t.positions.forEach((function(e,n){var i=pe(t.colors[n]);r.data[4*e+0]=255*i[0],r.data[4*e+1]=255*i[1],r.data[4*e+2]=255*i[2],r.data[4*e+3]=255*i[3]})),e=null,n=null,r}function ve(t){var e=Ht.document.createElement("canvas"),n=e.getContext("2d");n.globalAlpha=1,e.width=256,e.height=1;for(var r=256/t.colors.length,i=0;i<t.colors.length;i++)n.beginPath(),n.lineWidth=2,n.strokeStyle=t.colors[i],n.moveTo(i*r,0),n.lineTo((i+1)*r,0),n.stroke();var o=n.getImageData(0,0,256,1).data,a=be(n,o);return e=null,n=null,a}function _e(t,e){var n=Ht.document.createElement("canvas"),r=n.getContext("2d");r.globalAlpha=1,n.width=256,n.height=1;var i=e[1]-e[0];t.positions.length-t.colors.length!=1&&console.warn("positions 的数字个数应当比 colors 的样式多一个,poisitions 的首尾值一般为数据的最大最新值");for(var o=0;o<t.colors.length;o++)r.beginPath(),r.lineWidth=2,r.strokeStyle=t.colors[o],r.moveTo((t.positions[o]-e[0])/i*255,0),r.lineTo((t.positions[o+1]-e[0])/i*255,0),r.stroke();var a=r.getImageData(0,0,256,1).data,s=be(r,a);return n=null,r=null,s}function be(t,e){for(var n=t.createImageData(256,1),r=0;r<n.data.length;r+=4)n.data[r+0]=e[r+0],n.data[r+1]=e[r+1],n.data[r+2]=e[r+2],n.data[r+3]=e[r+3];return n}function xe(t){return"cat"===t.type?[0,255]:[0,1]}var we={BACK:1029,FRONT:1028};function Se(t){switch(t){case"GAODE1.x":case"GAODE2.x":case"GLOBEL":return we.BACK;default:return we.FRONT}}var Ee=n(9908),Me=n(5162),Te=n(9479);function Ae(t){var e=t;return"string"==typeof t&&(e=Ht.document.getElementById(t)),e}function Ce(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Oe(t){return Ce(t).split(/\s+/)}function Pe(t,e,n){var r=Ht.document.createElement(t);return e&&(r.className=e||""),n&&n.appendChild(r),r}function ke(t){var e=t.parentNode;e&&e.removeChild(t)}function Le(t,e){if(void 0!==t.classList)for(var n=Oe(e),r=0,i=n.length;r<i;r++)t.classList.add(n[r]);else if(!Re(t,e)){var o=Ne(t);De(t,(o?o+" ":"")+e)}}function Ie(t,e){void 0!==t.classList?Oe(e).forEach((function(e){t.classList.remove(e)})):De(t,Ce((" "+Ne(t)+" ").replace(" "+e+" "," ")))}function Re(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=Ne(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function De(t,e){t instanceof HTMLElement?t.className=e:t.className.baseVal=e}function Ne(t){return t instanceof SVGElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function Fe(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}var ze=function(t){var e,n,r=null==Ht||null===(e=Ht.document)||void 0===e||null===(n=e.documentElement)||void 0===n?void 0:n.style;if(!r)return t[0];for(var i in t)if(t[i]&&t[i]in r)return t[i];return t[0]}(["transform","WebkitTransform"]);function Be(t,e){t.style[ze]=e}function je(){if("function"==typeof Event)Ht.dispatchEvent(new Event("resize"));else{var t=Ht.document.createEvent("UIEvents");t.initUIEvent("resize",!0,!1,Ht,0),Ht.dispatchEvent(t)}}function Ue(t){var e=["padding: "+(t.height/2-8)+"px "+t.width/2+"px;","line-height: "+t.height+"px;","background-image: url("+t.toDataURL()+");"];console.log("%c\n",e.join(""))}function Ze(){var t,e=Ht.document.querySelector('meta[name="viewport"]');if(!e)return 1;var n=(null===(t=e.content)||void 0===t?void 0:t.split(",")).find((function(t){var e=t.split("=");return"initial-scale"===(0,Me.Z)(e,1)[0]}));return n?1*n.split("=")[1]:1}var Ve,Ge=Ze()<1?1:Ht.devicePixelRatio;function He(t,e){t.setAttribute("style","".concat(t.style.cssText).concat(e))}function We(t){return t.split(";").map((function(t){return t.trim()})).filter((function(t){return t}))}function qe(t,e){var n,r=We(null!==(n=t.getAttribute("style"))&&void 0!==n?n:""),i=We(e),o=Te.pull.apply(void 0,[r].concat((0,Ee.Z)(i)));t.setAttribute("style",o.join(";"))}function Ye(t){return Object.entries(t).map((function(t){var e=(0,Me.Z)(t,2),n=e[0],r=e[1];return"".concat(n,": ").concat(r)})).join(";")}function Xe(t,e){return{left:t.left-e.left,top:t.top-e.top,right:e.left+e.width-t.left-t.width,bottom:e.top+e.height-t.top-t.height}}function $e(t,e){t.checked=e,e?t.setAttribute("checked","true"):t.removeAttribute("checked")}function Ke(t){t.innerHTML=""}function Je(t){t.setAttribute("draggable","false")}function Qe(t,e){if("string"==typeof e){var n=document.createElement("div");for(n.innerHTML=e;n.firstChild;)t.append(n.firstChild)}else Array.isArray(e)?t.append.apply(t,(0,Ee.Z)(e)):t.append(e)}function tn(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}function en(){return"function"==typeof importScripts}var nn=en()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===window.location.protocol?window.parent:window).location.href},rn=null===(Ve=navigator)||void 0===Ve?void 0:Ve.userAgent,on=!!rn.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),an=rn.indexOf("Android")>-1||rn.indexOf("Adr")>-1;function sn(){for(var t=rn,e=!0,n=0,r=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];n<r.length;n++){var i=r[n];if(t.indexOf(i)>0){e=!1;break}}return e}var un=n(6297);function ln(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}var cn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;(0,s.Z)(this,t),(0,un.Z)(this,"duration",16),(0,un.Z)(this,"timestamp",(new Date).getTime()),this.duration=e}return(0,a.Z)(t,[{key:"run",value:function(t){var e=(new Date).getTime(),n=e-this.timestamp;this.timestamp=e,n>=this.duration&&t()}}]),t}(),hn=n(2512),pn=n(3959);function fn(t){return"number"==typeof t}var dn=2*Math.PI*6378137/2;function mn(t,e){var n=(0,Me.Z)(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return t.lng>r&&t.lng<=o&&t.lat>i&&t.lat<=a}function gn(t){var e=[1/0,1/0,-1/0,-1/0];return t.forEach((function(t){var n=t.coordinates;yn(e,n)})),e}function yn(t,e){return Array.isArray(e[0])?e.forEach((function(e){yn(t,e)})):(t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])),t}function vn(t,e){return _n(t,e)}function _n(t,e){return Array.isArray(t[0])?t.map((function(t){return _n(t,e)})):e(t)}function bn(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{enable:!0,decimal:1},n=(t=En(t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]))[0],r=t[1],i=n*dn/180,o=Math.log(Math.tan((90+r)*Math.PI/360))/(Math.PI/180);return o=o*dn/180,e.enable&&(i=Number(i.toFixed(e.decimal)),o=Number(o.toFixed(e.decimal))),3===t.length?[i,o,t[2]]:[i,o]}function xn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,n=t[0],r=t[1],i=n/dn*180,o=r/dn*180;return o=180/Math.PI*(2*Math.atan(Math.exp(o*Math.PI/180))-Math.PI/2),null!=e&&(i=Number(i.toFixed(e)),o=Number(o.toFixed(e))),3===t.length?[i,o,t[2]]:[i,o]}function wn(t){if(null==t)throw new Error("lng is required");return(t>180||t<-180)&&((t%=360)>180&&(t=-360+t),t<-180&&(t=360+t),0===t&&(t=0)),t}function Sn(t){if(null==t)throw new Error("lat is required");return(t>90||t<-90)&&((t%=180)>90&&(t=-180+t),t<-90&&(t=180+t),0===t&&(t=0)),t}function En(t,e){if(!1===e)return t;var n=wn(t[0]),r=Sn(t[1]);return r>85&&(r=85),r<-85&&(r=-85),3===t.length?[n,r,t[2]]:[n,r]}function Mn(t){var e=85.0511287798,n=Math.max(Math.min(e,t[1]),-e),r=256<<20,i=Math.PI/180,o=t[0]*i,a=n*i;return a=Math.log(Math.tan(Math.PI/4+a/2)),o=r*(.5/Math.PI*o+.5),a=r*(-.5/Math.PI*a+(i=.5)),[Math.floor(o),Math.floor(a)]}function Tn(t){var e=.5/Math.PI,n=-.5/Math.PI,r=.5,i=256<<20,o=(0,Me.Z)(t,2),a=o[0],s=o[1];return a=(a/i-.5)/e,s=(s/i-r)/n,s=2*(Math.atan(Math.pow(Math.E,s))-Math.PI/4),[a/(r=Math.PI/180),s/r]}function An(t,e){var n=85.0511287798,r=Math.PI/180,i=6378137;return e=Math.max(Math.min(n,e),-n),e*=r,[(t*=r)*i,(e=Math.log(Math.tan(Math.PI/4+e/2)))*i]}function Cn(t,e){var n=Math.PI/180,r=6378137;return[t/r/n,2*(Math.atan(Math.exp(e/r))-Math.PI/4)/n]}function On(t,e,n){var r=(0,pn.Ht)(e[1]-t[1]),i=(0,pn.Ht)(e[0]-t[0]),o=(0,pn.Ht)(t[1]),a=(0,pn.Ht)(e[1]),s=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(o)*Math.cos(a);return(0,pn.DL)(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)),"meters")}function Pn(t){var e=Math.PI/180,n=85.0511287798,r=6378137,i=Math.max(Math.min(n,t[1]),-n),o=Math.sin(i*e);return[r*t[0]*e,r*Math.log((1+o)/(1-o))/2]}function kn(t,e){var n=Math.abs(t[1][1]-t[0][1])*e,r=Math.abs(t[1][0]-t[0][0])*e;return[[t[0][0]-r,t[0][1]-n],[t[1][0]+r,t[1][1]+n]]}function Ln(t,e){return t[0][0]<=e[0][0]&&t[0][1]<=e[0][1]&&t[1][0]>=e[1][0]&&t[1][1]>=e[1][1]}function In(t){return[[t[0],t[1]],[t[2],t[3]]]}function Rn(t){var e=Dn(t,[0,0]);return[t[0]/e,t[1]/e]}function Dn(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Nn(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Fn(t,e){return 180*Math.acos(function(t,e){return t[0]*e[0]+t[1]*e[1]}(t,e)/(Nn(t)*Nn(e)))/Math.PI}function zn(t,e){return e[0]>0?e[1]>0?90-180*Math.atan(e[1]/e[0])/Math.PI:90+180*Math.atan(-e[1]/e[0])/Math.PI:e[1]<0?90-180*Math.atan(e[1]/e[0])/Math.PI+180:270+180*Math.atan(e[1]/-e[0])/Math.PI}function Bn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;if(t&&!(t.length<2)){for(var n=0,r=[],i=0;i<t.length-1;i++){var o=t[i],a=t[i+1],s=Dn(o,a);n+=s;var u=zn(0,[o[0]-a[0],o[1]-a[1]]);if(i>0){var l=r[i-1].rotation;l-u>360-l+u&&(u+=360)}r.push({start:o,end:a,dis:s,rotation:u,duration:0})}return r.map((function(t){t.duration=e*(t.dis/n)})),r}}function jn(t){if(fn(t[0]))return t;if(fn(t[0][0]))throw new Error("当前数据不支持标注");if(fn(t[0][0][0])){var e=0,n=0,r=0;return t.forEach((function(t){t.forEach((function(t){e+=t[0],n+=t[1],r++}))})),[e/r,n/r,0]}throw new Error("当前数据不支持标注")}function Un(t){for(var e=t[0],n=t[1],r=t[0],i=t[1],o=0,a=0,s=0,u=0;u<t.length;u+=2){var l=t[u],c=t[u+1];l&&c&&(e=Math.max(l,e),n=Math.max(c,n),r=Math.min(l,r),i=Math.min(c,i),o+=l,a+=c,s++)}return{center:[o/s,a/s],radius:Math.sqrt(Math.pow(e-r,2)+Math.pow(n-i,2))/2}}function Zn(t){return(0,hn.Z)((0,pn.uf)([(0,pn.Tu)(t)]))}function Vn(t){var e=0;t+="x";for(var n=Math.floor(65745979961613.07),r=0;r<t.length;r++)e>n&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(r);return e}function Gn(t){for(var e=5381,n=(t=t.toString()).length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}function Hn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}var Wn=function(t){return t["GAODE1.x"]="GAODE1.x",t["GAODE2.x"]="GAODE2.x",t.MAPBOX="MAPBOX",t.DEFAULT="DEFAUlTMAP",t.SIMPLE="SIMPLE",t.GLOBEL="GLOBEL",t}({});function qn(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:30,a=n;return(arguments.length>6?arguments[6]:void 0)&&(a=Math.round(n*(o-1))/(o-1)),function(t,e,n,r,i){if(i===Wn["GAODE2.x"]){var o=An(t[0],t[1]),a=An(e[0],e[1]),s=Xn(o,a,r),u=[o[0],s[0],a[0]],l=[o[1],s[1],a[1]];return[].concat((0,Ee.Z)(Cn(Yn(u,n),Yn(l,n))),[0])}var c=Xn(t,e,r),h=[t[0],c[0],e[0]],p=[t[1],c[1],e[1]];return[Yn(h,n),Yn(p,n),0]}(t,e,a,r||.314,i)}function Yn(t,e){var n=1-e;return(t[0]*n+t[1]*e)*n+(t[1]*n+t[2]*e)*e}function Xn(t,e,n){var r,i,o=[e[0]-t[0],e[1]-t[1]],a=(r=o,i=[0,0],Math.sqrt(Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2))),s=Math.atan2(o[1],o[0]),u=a/2/Math.cos(n),l=s+n;return[u*Math.cos(l)+t[0],u*Math.sin(l)+t[1]]}function $n(t,e,n,r,i){var o=n;return(arguments.length>6?arguments[6]:void 0)&&(o=Math.round(29*n)/29),function(t,e,n,r){var i=[(0,pn.Ht)(t[0]),(0,pn.Ht)(t[1])],o=[(0,pn.Ht)(e[0]),(0,pn.Ht)(e[1])];if("GAODE2.x"===r){var a=function(t,e){var n=[e[0]-t[0],e[1]-t[1]],r=Dn(n,[0,0]),i=Math.atan2(n[1],n[0]),o=r/2/Math.cos(.314),a=i+.314;return[o*Math.cos(a)+t[0],o*Math.sin(a)+t[1]]}(i,o),s=[i[0],a[0],o[0]],u=[i[1],a[1],o[1]];return[Kn(s,n),Kn(u,n),0]}var l=function(t,e){var n=[t[0]-e[0],t[1]-e[1]],r=[Math.sin(n[0]/2),Math.sin(n[1]/2)],i=r[1]*r[1]+Math.cos(t[1])*Math.cos(e[1])*r[0]*r[0];return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))}(i,o);if(Math.abs(l-Math.PI)<.001)return[(1-n)*i[0]+n*o[0],(1-n)*i[1]+n*o[1]];var c=Math.sin((1-n)*l)/Math.sin(l),h=Math.sin(n*l)/Math.sin(l),p=[Math.sin(i[0]),Math.sin(i[1])],f=[Math.cos(i[0]),Math.cos(i[1])],d=[Math.sin(o[0]),Math.sin(o[1])],m=[Math.cos(o[0]),Math.cos(o[1])],g=c*f[1]*f[0]+h*m[1]*m[0],y=c*f[1]*p[0]+h*m[1]*d[0],v=c*p[1]+h*d[1];return[(0,pn.vi)(Math.atan2(y,g)),(0,pn.vi)(Math.atan2(v,Math.sqrt(g*g+y*y)))]}(t,e,o,i)}function Kn(t,e){var n=1-e;return(t[0]*n+t[1]*e)*n+(t[1]*n+t[2]*e)*e}function Jn(t,e,n){return[t[0]*n+e[0]*(1-n),t[1]*n+e[1]*(1-n)]}function Qn(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function tr(t,e){var n=e.featureId,r=t.data.dataArray;return"number"==typeof n&&(r=r.filter((function(t){return t.id===n}))),r.map((function(t){var n=function(t,e){var n=e.offset,r=e.shape,i=e.thetaOffset,o=e.mapVersion,a=e.segmentNumber,s=void 0===a?30:a,u=e.autoFit,l=void 0===u||u,c=t.coordinates;if("line"===r)return function(t,e){for(var n=0,r=[],i=0;i<t.length-1;i++){var o=t[i],a=t[i+1],s=Qn(o,a),u=n;n+=s,r.push({p1:o,p2:a,totalDistance:n,distance:s,lastTotalDistance:u})}for(var l,c,h=n*e,p=0,f=r;p<f.length;p++){var d=f[p];if(d.totalDistance>h){var m=d.p1,g=Jn(d.p2,m,(h-d.lastTotalDistance)/d.distance);l=g[0],c=g[1];break}}return{lng:l,lat:c,height:0}}(c,n);var h,p=c[0],f=c[1],d="string"==typeof i?t[i]||0:i;switch(r){case"arc":default:h=qn;break;case"greatcircle":h=$n}var m=h(p,f,n,d,o,s,l),g=(0,Me.Z)(m,3);return{lng:g[0],lat:g[1],height:g[2]}}(t,e);return(0,o.Z)((0,o.Z)({},t),n)}))}function er(t,e){return new Promise((function(n){t.inited?n(tr(t,e)):t.once("update",(function(){n(tr(t,e))}))}))}var nr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,n=arguments.length>1?arguments[1]:void 0;(0,s.Z)(this,t),this.limit=e,this.destroy=n||this.defaultDestroy,this.order=[],this.clear()}return(0,a.Z)(t,[{key:"clear",value:function(){var t=this;this.order.forEach((function(e){t.delete(e)})),this.cache={},this.order=[]}},{key:"get",value:function(t){var e=this.cache[t];return e&&(this.deleteOrder(t),this.appendOrder(t)),e}},{key:"set",value:function(t,e){this.cache[t]?(this.delete(t),this.cache[t]=e,this.appendOrder(t)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[t]=e,this.appendOrder(t))}},{key:"delete",value:function(t){var e=this.cache[t];e&&(this.deleteCache(t),this.deleteOrder(t),this.destroy(e,t))}},{key:"deleteCache",value:function(t){delete this.cache[t]}},{key:"deleteOrder",value:function(t){var e=this.order.findIndex((function(e){return e===t}));e>=0&&this.order.splice(e,1)}},{key:"appendOrder",value:function(t){this.order.push(t)}},{key:"defaultDestroy",value:function(t,e){return null}}]),t}();function rr(t){if(0===t.length)throw new Error("max requires at least one data point");for(var e=t[0],n=1;n<t.length;n++)t[n]>e&&(e=t[n]);return 1*e}function ir(t){if(0===t.length)throw new Error("min requires at least one data point");for(var e=t[0],n=1;n<t.length;n++)t[n]<e&&(e=t[n]);return 1*e}function or(t){if(0===t.length)return 0;for(var e=1*t[0],n=1;n<t.length;n++)e+=1*t[n];return e}function ar(t){if(0===t.length)throw new Error("mean requires at least one data point");return or(t)/t.length}function sr(t){if(0===t.length)throw new Error("mean requires at least one data point");if(t.length<3)return t[0];t.sort();for(var e=t[0],n=NaN,r=0,i=1,o=1;o<t.length+1;o++)t[o]!==e?(i>r&&(r=i,n=e),i=1,e=t[o]):i++;return 1*n}var ur={min:ir,max:rr,mean:ar,sum:or,mode:sr};function lr(t,e){return t.map((function(t){return t[e]}))}function cr(t,e){return ur[t](e)}var hr,pr=n(800),fr=n(1109),dr=n.n(fr),mr=n(5203),gr=n(1883),yr=n.n(gr),vr=function(t){return t.Realtime="realtime",t.Overlap="overlap",t.Replace="replace",t}({}),_r=function(t){return t.Loading="Loading",t.Loaded="Loaded",t.Failure="Failure",t.Cancelled="Cancelled",t}({});function br(t){for(;t;){if(t.isLoaded)return t.properties.state|=2,!0;t=t.parent}return!1}function xr(t){t.children.forEach((function(t){t.isLoaded?t.properties.state|=2:xr(t)}))}var wr=[-1/0,-1/0,1/0,1/0],Sr=(hr={},(0,un.Z)(hr,vr.Realtime,(function(t){t.forEach((function(t){t.isCurrent&&(t.isVisible=t.isLoaded)}))})),(0,un.Z)(hr,vr.Overlap,(function(t){t.forEach((function(t){t.properties.state=0})),t.forEach((function(t){t.isCurrent&&!br(t)&&xr(t)})),t.forEach((function(t){t.isVisible=Boolean(2&t.properties.state)}))})),(0,un.Z)(hr,vr.Replace,(function(t){t.forEach((function(t){t.properties.state=0})),t.forEach((function(t){t.isCurrent&&br(t)})),t.slice().sort((function(t,e){return t.z-e.z})).forEach((function(t){t.isVisible=Boolean(2&t.properties.state),t.children.length&&(t.isVisible||1&t.properties.state)?t.children.forEach((function(t){t.properties.state=1})):t.isCurrent&&xr(t)}))})),hr),Er=function(){};function Mr(t,e,n){return[Math.floor((t+180)/360*Math.pow(2,n)),Math.floor((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*Math.pow(2,n))]}function Tr(t,e,n){var r=t/Math.pow(2,n)*360-180,i=Math.PI-2*Math.PI*e/Math.pow(2,n);return[r,180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)))]}var Ar=function(t,e,n){var r=Tr(t,e,n),i=(0,Me.Z)(r,2),o=i[0],a=i[1],s=Tr(t+1,e+1,n),u=(0,Me.Z)(s,2),l=u[0];return[o,u[1],l,a]};function Cr(t){var e=t.zoom,n=t.latLonBounds,r=t.maxZoom,i=void 0===r?1/0:r,o=t.minZoom,a=void 0===o?0:o,s=t.zoomOffset,u=void 0===s?0:s,l=t.extent,c=void 0===l?wr:l,h=Math.ceil(e)+u;if(Number.isFinite(a)&&h<a)return[];Number.isFinite(i)&&h>i&&(h=i);for(var p=(0,Me.Z)(n,4),f=p[0],d=p[1],m=p[2],g=p[3],y=[Math.max(f,c[0]),Math.max(d,c[1]),Math.min(m,c[2]),Math.min(g,c[3])],v=[],_=Mr(y[0],y[1],h),b=(0,Me.Z)(_,2),x=b[0],w=b[1],S=Mr(y[2],y[3],h),E=(0,Me.Z)(S,2),M=E[0],T=E[1],A=x;A<=M;A++)for(var C=T;C<=w;C++)v.push({x:A,y:C,z:h});var O=(M+x)/2,P=(w+T)/2,k=function(t,e){return Math.abs(t-O)+Math.abs(e-P)};return v.sort((function(t,e){return k(t.x,t.y)-k(e.x,e.y)})),v}var Or=function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=Math.pow(2,n),o=t;return r&&(o<0?o+=i:o>i-1&&(o%=i)),{warpX:o,warpY:e}};var Pr=function(t){(0,u.Z)(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,c.Z)(n);if(r){var i=(0,c.Z)(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return(0,l.Z)(this,t)});function o(t){var e;(0,s.Z)(this,o),e=i.call(this),(0,un.Z)((0,b.Z)(e),"tileSize",256),(0,un.Z)((0,b.Z)(e),"isVisible",!1),(0,un.Z)((0,b.Z)(e),"isCurrent",!1),(0,un.Z)((0,b.Z)(e),"isVisibleChange",!1),(0,un.Z)((0,b.Z)(e),"loadedLayers",0),(0,un.Z)((0,b.Z)(e),"isLayerLoaded",!1),(0,un.Z)((0,b.Z)(e),"isLoad",!1),(0,un.Z)((0,b.Z)(e),"isChildLoad",!1),(0,un.Z)((0,b.Z)(e),"parent",null),(0,un.Z)((0,b.Z)(e),"children",[]),(0,un.Z)((0,b.Z)(e),"data",null),(0,un.Z)((0,b.Z)(e),"properties",{}),(0,un.Z)((0,b.Z)(e),"loadDataId",0);var n=t.x,r=t.y,a=t.z,u=t.tileSize,l=t.warp,c=void 0===l||l;return e.x=n,e.y=r,e.z=a,e.warp=c||!0,e.tileSize=u,e}return(0,a.Z)(o,[{key:"isLoading",get:function(){return this.loadStatus===_r.Loading}},{key:"isLoaded",get:function(){return this.loadStatus===_r.Loaded}},{key:"isFailure",get:function(){return this.loadStatus===_r.Failure}},{key:"setTileLayerLoaded",value:function(){this.isLayerLoaded=!0}},{key:"isCancelled",get:function(){return this.loadStatus===_r.Cancelled}},{key:"isDone",get:function(){return[_r.Loaded,_r.Cancelled,_r.Failure].includes(this.loadStatus)}},{key:"bounds",get:function(){return Ar(this.x,this.y,this.z)}},{key:"bboxPolygon",get:function(){var t=(0,Me.Z)(this.bounds,4),e=t[0],n=t[1],r=[(t[2]-e)/2,(t[3]-n)/2];return(0,mr.Z)(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:r,meta:"\n ".concat(this.key,"\n ")}})}},{key:"key",get:function(){return"".concat(this.x,"_").concat(this.y,"_").concat(this.z)}},{key:"layerLoad",value:function(){this.loadedLayers++,this.emit("layerLoaded")}},{key:"loadData",value:(e=(0,pr.Z)(dr().mark((function t(e){var n,r,i,o,a,s,u,l,c,h,p,f,d,m,g,y,v;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.getData,r=e.onLoad,i=e.onError,this.loadDataId++,o=this.loadDataId,this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=_r.Loading,a=null,t.prev=7,u=this.x,l=this.y,c=this.z,h=this.bounds,p=this.tileSize,f=this.warp,d=Or(u,l,c,f),m=d.warpX,g=d.warpY,y=this.abortController.signal,v={x:m,y:g,z:c,bounds:h,tileSize:p,signal:y,warp:f},t.next=14,n(v,this);case 14:a=t.sent,t.next=20;break;case 17:t.prev=17,t.t0=t.catch(7),s=t.t0;case 20:if(o===this.loadDataId){t.next=22;break}return t.abrupt("return");case 22:if(!this.isCancelled||a){t.next=24;break}return t.abrupt("return");case 24:if(!s&&a){t.next=28;break}return this.loadStatus=_r.Failure,i(s,this),t.abrupt("return");case 28:this.loadStatus=_r.Loaded,this.data=a,r(this);case 31:case"end":return t.stop()}}),t,this,[[7,17]])}))),function(t){return e.apply(this,arguments)})},{key:"reloadData",value:function(t){this.isLoading&&this.abortLoad(),this.loadData(t)}},{key:"abortLoad",value:function(){this.isLoaded||this.isCancelled||(this.loadStatus=_r.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}}]),o}(gr.EventEmitter);function kr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ir=function(t){return t.TilesLoadStart="tiles-load-start",t.TileLoaded="tile-loaded",t.TileError="tile-error",t.TileUnload="tile-unload",t.TileUpdate="tile-update",t.TilesLoadFinished="tiles-load-finished",t}({}),Rr=function(t){(0,u.Z)(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return(0,l.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=r.call(this),(0,un.Z)((0,b.Z)(e),"currentTiles",[]),(0,un.Z)((0,b.Z)(e),"cacheTiles",new Map),(0,un.Z)((0,b.Z)(e),"throttleUpdate",(0,Te.throttle)((function(t,n){e.update(t,n)}),16)),(0,un.Z)((0,b.Z)(e),"onTileLoad",(function(t){e.emit(Ir.TileLoaded,t),e.updateTileVisible(),e.loadFinished()})),(0,un.Z)((0,b.Z)(e),"onTileError",(function(t,n){e.emit(Ir.TileError,{error:t,tile:n}),e.updateTileVisible(),e.loadFinished()})),(0,un.Z)((0,b.Z)(e),"onTileUnload",(function(t){e.emit(Ir.TileUnload,t),e.loadFinished()})),e.options={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,extent:wr,getTileData:Er,warp:!0,updateStrategy:vr.Overlap},e.updateOptions(t),e}return(0,a.Z)(i,[{key:"isLoaded",get:function(){return this.currentTiles.every((function(t){return t.isDone}))}},{key:"tiles",get:function(){return Array.from(this.cacheTiles.values()).sort((function(t,e){return t.z-e.z}))}},{key:"updateOptions",value:function(t){var e=void 0===t.minZoom?this.options.minZoom:Math.ceil(t.minZoom),n=void 0===t.maxZoom?this.options.maxZoom:Math.floor(t.maxZoom);this.options=(0,o.Z)((0,o.Z)((0,o.Z)({},this.options),t),{},{minZoom:e,maxZoom:n})}},{key:"update",value:function(t,e){var n=this,r=Math.max(0,Math.ceil(t));if(!this.lastViewStates||this.lastViewStates.zoom!==r||!function(t,e){return Ln(In(t),In(e))}(this.lastViewStates.latLonBoundsBuffer,e)){var i=function(t,e){var n=kn(In(t),.2),r=85.0511287798065;return[Math.max(n[0][0],-900),Math.max(n[0][1],-r),Math.min(n[1][0],900),Math.min(n[1][1],r)]}(e);this.lastViewStates={zoom:r,latLonBounds:e,latLonBoundsBuffer:i},this.currentZoom=r;var o=!1,a=this.getTileIndices(r,i).filter((function(t){return n.options.warp||t.x>=0&&t.x<Math.pow(2,r)}));this.emit(Ir.TilesLoadStart),this.currentTiles=a.map((function(t){var e,r,i=t.x,a=t.y,s=t.z,u=n.getTile(i,a,s);return u?(((null===(e=u)||void 0===e?void 0:e.isFailure)||(null===(r=u)||void 0===r?void 0:r.isCancelled))&&u.loadData({getData:n.options.getTileData,onLoad:n.onTileLoad,onError:n.onTileError}),u):(u=n.createTile(i,a,s),o=!0,u)})),o&&this.resizeCacheTiles(),this.updateTileVisible(),this.pruneRequests()}}},{key:"reloadAll",value:function(){var t,e=kr(this.cacheTiles);try{for(e.s();!(t=e.n()).done;){var n=(0,Me.Z)(t.value,2),r=n[0],i=n[1];if(!this.currentTiles.includes(i))return this.cacheTiles.delete(r),void this.onTileUnload(i);this.onTileUnload(i),i.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError})}}catch(t){e.e(t)}finally{e.f()}}},{key:"reloadTileById",value:function(t,e,n){var r=this.cacheTiles.get("".concat(e,",").concat(n,",").concat(t));r&&(this.onTileUnload(r),r.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}))}},{key:"reloadTileByLnglat",value:function(t,e,n){var r=this.getTileByLngLat(t,e,n);r&&this.reloadTileById(r.z,r.x,r.y)}},{key:"reloadTileByExtent",value:function(t,e){var n=this;this.getTileIndices(e,t).forEach((function(t){n.reloadTileById(t.z,t.x,t.y)}))}},{key:"pruneRequests",value:function(){var t,e=[],n=kr(this.cacheTiles.values());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.isLoading&&(r.isCurrent||r.isVisible||e.push(r))}}catch(t){n.e(t)}finally{n.f()}for(;e.length>0;)e.shift().abortLoad()}},{key:"getTileByLngLat",value:function(t,e,n){var r=this.options.zoomOffset,i=Math.ceil(n)+r,o=Mr(t,e,i);return this.tiles.filter((function(t){return t.key==="".concat(o[0],"_").concat(o[1],"_").concat(i)}))[0]}},{key:"getTileExtent",value:function(t,e){return this.getTileIndices(e,t)}},{key:"getTileByZXY",value:function(t,e,n){return this.tiles.filter((function(r){return r.key==="".concat(e,"_").concat(n,"_").concat(t)}))[0]}},{key:"clear",value:function(){var t,e=kr(this.cacheTiles.values());try{for(e.s();!(t=e.n()).done;){var n=t.value;n.isLoading?n.abortLoad():this.onTileUnload(n)}}catch(t){e.e(t)}finally{e.f()}this.lastViewStates=void 0,this.cacheTiles.clear(),this.currentTiles=[]}},{key:"destroy",value:function(){this.clear(),this.removeAllListeners()}},{key:"updateTileVisible",value:function(){var t,e=this.options.updateStrategy,n=new Map,r=kr(this.cacheTiles.values());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.set(i.key,i.isVisible),i.isCurrent=!1,i.isVisible=!1}}catch(t){r.e(t)}finally{r.f()}var o,a=kr(this.currentTiles);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.isCurrent=!0,s.isVisible=!0}}catch(t){a.e(t)}finally{a.f()}var u=Array.from(this.cacheTiles.values());"function"==typeof e?e(u):Sr[e](u);var l=!1;Array.from(this.cacheTiles.values()).forEach((function(t){t.isVisible!==n.get(t.key)?(t.isVisibleChange=!0,l=!0):t.isVisibleChange=!1})),l&&this.emit(Ir.TileUpdate)}},{key:"getTileIndices",value:function(t,e){var n=this.options,r=n.tileSize,i=n.extent,o=n.zoomOffset;return Cr({maxZoom:Math.floor(this.options.maxZoom),minZoom:Math.ceil(this.options.minZoom),zoomOffset:o,tileSize:r,zoom:t,latLonBounds:e,extent:i})}},{key:"getTileId",value:function(t,e,n){return"".concat(t,",").concat(e,",").concat(n)}},{key:"loadFinished",value:function(){var t=!this.currentTiles.some((function(t){return!t.isDone}));return t&&this.emit(Ir.TilesLoadFinished),t}},{key:"getTile",value:function(t,e,n){var r=this.getTileId(t,e,n);return this.cacheTiles.get(r)}},{key:"createTile",value:function(t,e,n){var r=this.getTileId(t,e,n),i=new Pr({x:t,y:e,z:n,tileSize:this.options.tileSize,warp:this.options.warp});return this.cacheTiles.set(r,i),i.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),i}},{key:"resizeCacheTiles",value:function(){var t=5*this.currentTiles.length;if(this.cacheTiles.size>t){var e,n=kr(this.cacheTiles);try{for(n.s();!(e=n.n()).done;){var r=(0,Me.Z)(e.value,2),i=r[0],o=r[1];if(o.isVisible||this.currentTiles.includes(o)||(this.cacheTiles.delete(i),this.onTileUnload(o)),this.cacheTiles.size<=t)break}}catch(t){n.e(t)}finally{n.f()}}this.rebuildTileTree()}},{key:"rebuildTileTree",value:function(){var t,e=kr(this.cacheTiles.values());try{for(e.s();!(t=e.n()).done;){var n=t.value;n.parent=null,n.children.length=0}}catch(t){e.e(t)}finally{e.f()}var r,i=kr(this.cacheTiles.values());try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this.getNearestAncestor(o.x,o.y,o.z);o.parent=a,null!=a&&a.children&&a.children.push(o)}}catch(t){i.e(t)}finally{i.f()}}},{key:"getNearestAncestor",value:function(t,e,n){for(;n>this.options.minZoom;){t=Math.floor(t/2),e=Math.floor(e/2),n-=1;var r=this.getTile(t,e,n);if(r)return r}return null}}]),i}(yr());function Dr(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function Nr(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r,i=n[1].charCodeAt(0),o=n[2].charCodeAt(0);for(r=i;r<=o;++r)e.push(t.replace(n[0],String.fromCharCode(r)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(n[2],10),s=parseInt(n[1],10);s<=a;s++)e.push(t.replace(n[0],s.toString()));return e}return e.push(t),e}function Fr(t,e){if(!t||!t.length)throw new Error("url is not allowed to be empty");var n=e.x,r=e.y,i=e.z,o=Nr(t);return o[Math.abs(n+r)%o.length].replace(/\{x\}/g,n.toString()).replace(/\{y\}/g,r.toString()).replace(/\{z\}/g,i.toString()).replace(/\{bbox\}/g,Ar(n,r,i).join(",")).replace(/\{-y\}/g,(Math.pow(2,i)-r-1).toString())}function zr(t,e){var n=e.x,r=e.y,i=e.z,o=e.layer,a=e.version,s=void 0===a?"1.0.0":a,u=e.style,l=void 0===u?"default":u,c=e.format,h=e.service,p=void 0===h?"WMTS":h,f=e.tileMatrixset;return"".concat(t,"&SERVICE=").concat(p,"&REQUEST=GetTile&VERSION=").concat(s,"&LAYER=").concat(o,"&STYLE=").concat(l,"&TILEMATRIXSET=").concat(f,"&FORMAT=").concat(c,"&TILECOL=").concat(n,"&TILEROW=").concat(r,"&TILEMATRIX=").concat(i)}function Br(t,e){if(!t)throw new Error(e||"web worker helper assertion failed.")}"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document;var jr="undefined"!=typeof window&&void 0!==window.orientation,Ur=function(){function t(t,e){var n=this;this.name=t,this.workerThread=e,this.isRunning=!0,this.resolve=function(){},this.reject=function(){},this.result=new Promise((function(t,e){n.resolve=t,n.reject=e}))}return t.prototype.postMessage=function(t,e){this.workerThread.postMessage({source:"Main thread",type:t,payload:e})},t.prototype.done=function(t){Br(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.resolve(t)},t.prototype.error=function(t){Br(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.reject(t)},t}();const Zr=Ur;var Vr=new Map;function Gr(t){var e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function Hr(t,e,n){void 0===e&&(e=!0);var r=n||new Set;if(t)if(Wr(t))r.add(t);else if(Wr(t.buffer))r.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"==typeof t)for(var i in t)Hr(t[i],e,r);return void 0===n?Array.from(r):[]}function Wr(t){return!!t&&(t instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&t instanceof MessagePort||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)}var qr=function(){};const Yr=function(){function t(t){this.terminated=!1,this.loadableURL="";var e=t.name,n=t.source,r=t.url;Br(n||r),this.name=e,this.source=n,this.url=r,this.onMessage=qr,this.onError=function(t){return console.log(t)},this.worker=this.createBrowserWorker()}return t.isSupported=function(){return"undefined"!=typeof Worker},t.prototype.destroy=function(){this.onMessage=qr,this.onError=qr,this.worker.terminate(),this.terminated=!0},Object.defineProperty(t.prototype,"isRunning",{get:function(){return Boolean(this.onMessage)},enumerable:!1,configurable:!0}),t.prototype.postMessage=function(t,e){e=e||Hr(t),this.worker.postMessage(t,e)},t.prototype.getErrorFromErrorEvent=function(t){var e="Failed to load ";return e+="worker "+this.name+" from "+this.url+". ",t.message&&(e+=t.message+" in "),t.lineno&&(e+=":"+t.lineno+":"+t.colno),new Error(e)},t.prototype.createBrowserWorker=function(){var t=this;this.loadableURL=function(t){Br(t.source&&!t.url||!t.source&&t.url);var e,n=Vr.get(t.source||t.url);return n||(t.url&&(n=(e=t.url).startsWith("http")?Gr("try {\n importScripts('"+e+"');\n} catch (error) {\n console.error(error);\n throw error;\n}"):e,Vr.set(t.url,n)),t.source&&(n=Gr(t.source),Vr.set(t.source,n))),Br(n),n}({source:this.source,url:this.url});var e=new Worker(this.loadableURL,{name:this.name});return e.onmessage=function(e){e.data?t.onMessage(e.data):t.onError(new Error("No data received"))},e.onerror=function(e){t.onError(t.getErrorFromErrorEvent(e)),t.terminated=!0},e.onmessageerror=function(e){return console.error("worker "+t.name+", message error: "+e)},e},t}();var Xr=function(){return Xr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Xr.apply(this,arguments)},$r=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Kr=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};const Jr=function(){function t(t){this.name="unnamed",this.maxConcurrency=1,this.maxMobileConcurrency=1,this.onDebug=function(){},this.reuseWorkers=!0,this.props={},this.jobQueue=[],this.idleQueue=[],this.count=0,this.isDestroyed=!1,this.source=t.source,this.url=t.url,this.setProps(t)}return t.prototype.destroy=function(){this.idleQueue.forEach((function(t){return t.destroy()})),this.isDestroyed=!0},t.prototype.setProps=function(t){this.props=Xr(Xr({},this.props),t),void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)},t.prototype.startJob=function(t,e,n){return void 0===e&&(e=function(t,e,n){return t.done(n)}),void 0===n&&(n=function(t,e){return t.error(e)}),$r(this,void 0,void 0,(function(){var r,i=this;return Kr(this,(function(o){switch(o.label){case 0:return r=new Promise((function(r){return i.jobQueue.push({name:t,onMessage:e,onError:n,onStart:r}),i})),this.startQueuedJob(),[4,r];case 1:return[2,o.sent()]}}))}))},t.prototype.startQueuedJob=function(){return $r(this,void 0,void 0,(function(){var t,e,n;return Kr(this,(function(r){switch(r.label){case 0:if(!this.jobQueue.length)return[2];if(!(t=this.getAvailableWorker()))return[2];if(!(e=this.jobQueue.shift()))return[3,4];this.onDebug({message:"Starting job",name:e.name,backlog:this.jobQueue.length,workerThread:t}),n=new Zr(e.name,t),t.onMessage=function(t){return e.onMessage(n,t.type,t.payload)},t.onError=function(t){return e.onError(n,t)},e.onStart(n),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,n.result];case 2:return r.sent(),[3,4];case 3:return this.returnWorkerToQueue(t),[7];case 4:return[2]}}))}))},t.prototype.returnWorkerToQueue=function(t){this.isDestroyed||!this.reuseWorkers||this.count>this.getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this.startQueuedJob()},t.prototype.getAvailableWorker=function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this.getMaxConcurrency()){this.count++;var t=this.name.toLowerCase()+" (#"+this.count+" of "+this.maxConcurrency+")";return new Yr({name:t,source:this.source,url:this.url})}return null},t.prototype.getMaxConcurrency=function(){return jr?this.maxMobileConcurrency:this.maxConcurrency},t}();var Qr=function(){return Qr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Qr.apply(this,arguments)},ti=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ei={maxConcurrency:3,maxMobileConcurrency:1,onDebug:function(){},reuseWorkers:!0},ni=function(){function t(t){this.workerPools=new Map,this.props=Qr({},ei),this.setProps(t),this.workerPools=new Map}return t.isSupported=function(){return Yr.isSupported()},t.getWorkerFarm=function(e){return void 0===e&&(e={}),t.workerFarm=t.workerFarm||new t({}),t.workerFarm.setProps(e),t.workerFarm},t.prototype.destroy=function(){var t,e;try{for(var n=ti(this.workerPools.values()),r=n.next();!r.done;r=n.next())r.value.destroy()}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.setProps=function(t){var e,n;this.props=Qr(Qr({},this.props),t);try{for(var r=ti(this.workerPools.values()),i=r.next();!i.done;i=r.next())i.value.setProps(this.getWorkerPoolProps())}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.getWorkerPool=function(t){var e=t.name,n=t.source,r=t.url,i=this.workerPools.get(e);return i||((i=new Jr({name:e,source:n,url:r})).setProps(this.getWorkerPoolProps()),this.workerPools.set(e,i)),i},t.prototype.getWorkerPoolProps=function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}},t}();const ri=ni;var ii=new Map,oi=function(){function t(){}return Object.defineProperty(t,"onmessage",{set:function(t){self.onmessage=function(e){if(si(e)){var n=e.data,r=n.type,i=n.payload;t(r,i)}}},enumerable:!1,configurable:!0}),t.addEventListener=function(t){var e=ii.get(t);e||(e=function(e){if(si(e)){var n=e.data,r=n.type,i=n.payload;t(r,i)}}),self.addEventListener("message",e)},t.removeEventListener=function(t){var e=ii.get(t);ii.delete(t),self.removeEventListener("message",e)},t.postMessage=function(t,e){if(self){var n={source:"Worker thread",type:t,payload:e},r=Hr(e);self.postMessage(n,r)}},t}();const ai=oi;function si(t){var e=t.type,n=t.data;return"message"===e&&n&&"string"==typeof n.source&&"Main thread"===n.source}!function(){function t(){this._values=[],this._settlers=[],this._closed=!1}t.prototype[Symbol.asyncIterator]=function(){return this},t.prototype.push=function(t){return this.enqueue(t)},t.prototype.enqueue=function(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");var e=this._settlers.shift();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.push(t)},t.prototype.close=function(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0},t.prototype.next=function(){var t=this;if(this._values.length>0){var e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((function(e,n){t._settlers.push({resolve:e,reject:n})}))}}();var ui,li=0;function ci(t,e){return void 0===e&&(e={}),new Promise((function(n,r){var i=li++,o=function(t,e){if(e.id===i)switch(t){case"done":ai.removeEventListener(o),n(e.result);break;case"error":ai.removeEventListener(o),r(e.error)}};ai.addEventListener(o);var a={id:i,input:t,options:e};ai.postMessage("process",a)}))}function hi(t){var e=t.color;return e&&e.length?e:[1,1,1,1]}function pi(t,e,n){return 2===n.length?[n[0],n[1],0]:[n[0],n[1],n[2]]}function fi(t){return t.filter?[1]:[0]}function di(t,e){return[e]}var mi=n(6319),gi=n.n(mi),yi=n(9341),vi=yi.Ue(),_i=(yi.Ue(),yi.Ue()),bi=yi.Ue(),xi=yi.Ue();function wi(t,e,n,r,i){yi.IH(t,n,r),yi.Fv(t,t),e=yi.al(-t[1],t[0]);var o=yi.al(-n[1],n[0]);return[i/yi.AK(e,o),e]}function Si(t,e){return yi.t8(t,-e[1],e[0])}function Ei(t,e,n){return yi.lu(t,e,n),yi.Fv(t,t),t}function Mi(t,e){return t[0]===e[0]&&t[1]===e[1]}var Ti=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.Z)(this,t),(0,un.Z)(this,"lastFlip",-1),(0,un.Z)(this,"miter",yi.al(0,0)),(0,un.Z)(this,"started",!1),(0,un.Z)(this,"dash",!1),(0,un.Z)(this,"totalDistance",0),(0,un.Z)(this,"currentIndex",0),this.join=e.join||"miter",this.cap=e.cap||"butt",this.miterLimit=e.miterLimit||10,this.thickness=e.thickness||1,this.dash=e.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return(0,a.Z)(t,[{key:"extrude_gaode2",value:function(t,e){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var r=t.length,i=n.startIndex,o=1;o<r;o++){var a,s,u,l=t[o-1];l.push(null!==(a=e[o-1][2])&&void 0!==a?a:0);var c=e[o-1],h=t[o];h.push(null!==(s=e[o][2])&&void 0!==s?s:0);var p=e[o],f=o<t.length-1?[].concat((0,Ee.Z)(t[o+1]),[null!==(u=e[o+1][2])&&void 0!==u?u:0]):null,d=o<e.length-1?e[o+1]:null;i+=this.segment_gaode2(n,i,l,h,f,c,p,d)}if(this.dash)for(var m=0;m<n.positions.length/6;m++)n.positions[6*m+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"simpleExtrude_gaode2",value:function(t,e){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var r=t.length,i=n.startIndex,o=1;o<r;o++){var a,s,u,l=t[o-1];l.push(null!==(a=e[o-1][2])&&void 0!==a?a:0);var c=e[o-1],h=t[o];h.push(null!==(s=e[o][2])&&void 0!==s?s:0);var p=e[o],f=o<t.length-1?[].concat((0,Ee.Z)(t[o+1]),[null!==(u=e[o+1][2])&&void 0!==u?u:0]):null,d=o<e.length-1?e[o+1]:null;i+=this.simpleSegment(n,i,l,h,f,c,p,d)}if(this.dash)for(var m=0;m<n.positions.length/6;m++)n.positions[6*m+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"extrude",value:function(t){var e=this.complex;if(t.length<=1)return e;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var n=t.length,r=e.startIndex,i=1;i<n;i++){var o=t[i-1],a=t[i],s=i<t.length-1?t[i+1]:null;r+=this.segment(e,r,o,a,s)}if(this.dash)for(var u=0;u<e.positions.length/6;u++)e.positions[6*u+5]=this.totalDistance;return e.startIndex=e.positions.length/6,e}},{key:"simpleExtrude",value:function(t){var e=this.complex;if(t.length<=1)return e;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var n=t.length,r=e.startIndex,i=1;i<n;i++){var o=t[i-1],a=t[i],s=i<t.length-1?t[i+1]:null;r+=this.simpleSegment(e,r,o,a,s)}if(this.dash)for(var u=0;u<e.positions.length/6;u++)e.positions[6*u+5]=this.totalDistance;return e.startIndex=e.positions.length/6,e}},{key:"segment_gaode2",value:function(t,e,n,r,i,o,a,s){var u=0,l=t.indices,c=t.positions,h=t.normals,p="square"===this.cap,f="bevel"===this.join,d=Mn([a[0],a[1]]),m=Mn([o[0],o[1]]);Ei(_i,r,n);var g=0;if(this.dash&&(g=this.lineSegmentDistance(d,m),this.totalDistance+=g),this.normal||(this.normal=yi.Ue(),Si(this.normal,_i)),!this.started)if(this.started=!0,p){var y=yi.Ue(),v=yi.Ue();yi.IH(y,this.normal,_i),yi.IH(v,this.normal,_i),h.push(v[0],v[1],0),h.push(y[0],y[1],0),c.push(n[0],n[1],0|n[2],this.totalDistance-g,-this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),c.push(n[0],n[1],0|n[2],this.totalDistance-g,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(c,h,n,this.normal,this.thickness,this.totalDistance-g);if(l.push(e+0,e+1,e+2),i){Mi(r,i)&&yi.IH(i,r,yi.Fv(i,yi.$X(i,r,n))),Ei(bi,i,r);var _=wi(xi,yi.Ue(),_i,bi,this.thickness),b=(0,Me.Z)(_,2),x=b[0],w=b[1],S=yi.AK(xi,this.normal)<0?-1:1,E=f;E||"miter"!==this.join||x>this.miterLimit&&(E=!0),E?(h.push(this.normal[0],this.normal[1],0),h.push(w[0],w[1],0),c.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*S,0|r[2]),this.complex.indexes.push(this.currentIndex),c.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness*S,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l.push.apply(l,(0,Ee.Z)(this.lastFlip!==-S?[e,e+2,e+3]:[e+2,e+1,e+3])),l.push(e+2,e+3,e+4),Si(vi,bi),yi.JG(this.normal,vi),h.push(this.normal[0],this.normal[1],0),c.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*S,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,u+=3):(this.extrusions(c,h,r,w,x,this.totalDistance),l.push.apply(l,(0,Ee.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),S=-1,yi.JG(this.normal,w),u+=2),this.lastFlip=S}else{if(Si(this.normal,_i),p){var M=yi.Ue(),T=yi.Ue();yi.lu(T,_i,this.normal),yi.IH(M,_i,this.normal),h.push(T[0],T[1],0),h.push(M[0],M[1],0),c.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),c.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(c,h,r,this.normal,this.thickness,this.totalDistance);l.push.apply(l,(0,Ee.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),u+=2}return u}},{key:"simpleSegment",value:function(t,e,n,r,i){var o=0,a=t.indices,s=t.positions,u=t.normals,l=Mn([r[0],r[1]]),c=Mn([n[0],n[1]]);Ei(_i,l,c);var h=0;if(this.dash&&(h=this.lineSegmentDistance(l,c),this.totalDistance+=h),this.normal||(this.normal=yi.Ue(),Si(this.normal,_i)),this.started||(this.started=!0,this.extrusions(s,u,n,this.normal,this.thickness,this.totalDistance-h)),a.push(e+0,e+1,e+2),i){var p=Mn([i[0],i[1]]);Mi(l,p)&&yi.IH(p,l,yi.Fv(p,yi.$X(p,l,c))),Ei(bi,p,l);var f=wi(xi,yi.Ue(),_i,bi,this.thickness),d=(0,Me.Z)(f,2),m=d[0],g=d[1];yi.AK(xi,this.normal),this.extrusions(s,u,r,g,m,this.totalDistance),a.push.apply(a,(0,Ee.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),yi.JG(this.normal,g),o+=2,this.lastFlip=-1}else Si(this.normal,_i),this.extrusions(s,u,r,this.normal,this.thickness,this.totalDistance),a.push.apply(a,(0,Ee.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),o+=2;return o}},{key:"segment",value:function(t,e,n,r,i){var o=0,a=t.indices,s=t.positions,u=t.normals,l="square"===this.cap,c="bevel"===this.join,h=Mn([r[0],r[1]]),p=Mn([n[0],n[1]]);Ei(_i,h,p);var f=0;if(this.dash&&(f=this.lineSegmentDistance(h,p),this.totalDistance+=f),this.normal||(this.normal=yi.Ue(),Si(this.normal,_i)),!this.started)if(this.started=!0,l){var d=yi.Ue(),m=yi.Ue();yi.IH(d,this.normal,_i),yi.IH(m,this.normal,_i),u.push(m[0],m[1],0),u.push(d[0],d[1],0),s.push(n[0],n[1],0|n[2],this.totalDistance-f,-this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),s.push(n[0],n[1],0|n[2],this.totalDistance-f,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(s,u,n,this.normal,this.thickness,this.totalDistance-f);if(a.push(e+0,e+1,e+2),i){var g=Mn([i[0],i[1]]);Mi(h,g)&&yi.IH(g,h,yi.Fv(g,yi.$X(g,h,p))),Ei(bi,g,h);var y=wi(xi,yi.Ue(),_i,bi,this.thickness),v=(0,Me.Z)(y,2),_=v[0],b=v[1],x=yi.AK(xi,this.normal)<0?-1:1,w=c;w||"miter"!==this.join||_>this.miterLimit&&(w=!0),w?(u.push(this.normal[0],this.normal[1],0),u.push(b[0],b[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*x,0|r[2]),this.complex.indexes.push(this.currentIndex),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness*x,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,a.push.apply(a,(0,Ee.Z)(this.lastFlip!==-x?[e,e+2,e+3]:[e+2,e+1,e+3])),a.push(e+2,e+3,e+4),Si(vi,bi),yi.JG(this.normal,vi),u.push(this.normal[0],this.normal[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,-this.thickness*x,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,o+=3):(this.extrusions(s,u,r,b,_,this.totalDistance),a.push.apply(a,(0,Ee.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),x=-1,yi.JG(this.normal,b),o+=2),this.lastFlip=x}else{if(Si(this.normal,_i),l){var S=yi.Ue(),E=yi.Ue();yi.lu(E,_i,this.normal),yi.IH(S,_i,this.normal),u.push(E[0],E[1],0),u.push(S[0],S[1],0),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),s.push(r[0],r[1],0|r[2],this.totalDistance,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(s,u,r,this.normal,this.thickness,this.totalDistance);a.push.apply(a,(0,Ee.Z)(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),o+=2}return o}},{key:"extrusions",value:function(t,e,n,r,i,o){e.push(r[0],r[1],0),e.push(r[0],r[1],0),t.push(n[0],n[1],0|n[2],o,-i,0|n[2]),this.complex.indexes.push(this.currentIndex),t.push(n[0],n[1],0|n[2],o,i,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}}]),t}();function Ai(t){var e=t.coordinates,n=t.originCoordinates,r=t.version,i=new Ti({dash:!0,join:"bevel"});if("GAODE2.x"===r){var o=e;Array.isArray(o[0][0])||(o=[e]);var a=n;Array.isArray(a[0][0])||(a=[n]);for(var s=0;s<o.length;s++){var u=o[s],l=a[s];i.extrude_gaode2(u,l)}}else{var c=e;c[0]&&!Array.isArray(c[0][0])&&(c=[e]),c.forEach((function(t){i.extrude(t)}))}var h=i.complex;return{vertices:h.positions,indices:h.indices,normals:h.normals,indexes:h.indexes,size:6}}function Ci(t){var e=jn(t.coordinates);return{vertices:[].concat((0,Ee.Z)(e),(0,Ee.Z)(e),(0,Ee.Z)(e),(0,Ee.Z)(e)),indices:[0,1,2,2,3,0],size:e.length}}function Oi(t){var e=t.coordinates,n=gi().flatten(e),r=n.vertices,i=n.dimensions,o=n.holes;return{indices:gi()(r,o,i),vertices:r,size:i}}var Pi=function(){var t=(0,pr.Z)(dr().mark((function t(e){var n,r,i,o,a,s,u,l,c;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.descriptors,r=e.features,i=e.enablePicking,o=e.iconMap,a={a_Color:hi,a_Position:pi,filter:fi,a_vertexId:di,a_PickingColor:function(t){var e=t.id;return i?de(e):[0,0,0]},a_DistanceAndIndex:function(t,e,n,r,i,o){return void 0===o?[n[3],10]:[n[3],o]},a_Total_Distance:function(t,e,n){return[n[5]]},a_Size:function(t){var e=t.size,n=void 0===e?1:e;return Array.isArray(n)?[n[0],n[1]]:[n,0]},a_Normal:function(t,e,n,r,i){return i},a_Miter:function(t,e,n){return[n[4]]},a_iconMapUV:function(t){var e=t.texture,n=o[e]||{x:0,y:0};return[n.x,n.y]}},s={sizePerElement:0,elements:[]},u=0,l=[],c=3,r.forEach((function(t,e){var r=Ai(t),i=r.indices,o=r.vertices,h=r.normals,p=r.size,f=r.indexes;i.forEach((function(t){l.push(t+u)})),c=p;var d=o.length/p;s.sizePerElement=c,s.elements.push({featureIdx:e,vertices:o,normals:h,offset:u}),u+=d;for(var m=function(r){var i=(null==h?void 0:h.slice(3*r,3*r+3))||[],s=o.slice(r*p,r*p+p),u=0;f&&void 0!==f[r]&&(u=f[r]),n.forEach((function(n){var o;n&&a[n.name]&&(o=n.buffer.data).push.apply(o,(0,Ee.Z)(a[n.name](t,e,s,r,i,u)))}))},g=0;g<d;g++)m(g)})),t.abrupt("return",{descriptors:n,featureLayout:s,indices:l});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ki={pointFill:function(){var t=(0,pr.Z)(dr().mark((function t(e){var n,r,i,o,a,s,u,l,c;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.descriptors,r=e.features,i=e.enablePicking,o=e.shape2d,a={a_Color:hi,a_Position:pi,filter:fi,a_vertexId:di,a_PickingColor:function(t){var e=t.id;return i?de(e):[0,0,0]},a_Shape:function(t){var e=t.shape,n=void 0===e?2:e;return[o.indexOf(n)]},a_Extrude:function(t,e,n,r){var i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],o=r%4*3;return[i[o],i[o+1],i[o+2]]},a_Size:function(t){var e=t.size,n=void 0===e?5:e;return Array.isArray(n)?[n[0]]:[n]}},s={sizePerElement:0,elements:[]},u=0,l=[],c=3,r.forEach((function(t,e){var r=Ci(t),i=r.indices,o=r.vertices,h=r.normals,p=r.size,f=r.indexes;i.forEach((function(t){l.push(t+u)})),c=p;var d=o.length/p;s.sizePerElement=c,s.elements.push({featureIdx:e,vertices:o,normals:h,offset:u}),u+=d;for(var m=function(r){var i=(null==h?void 0:h.slice(3*r,3*r+3))||[],s=o.slice(r*p,r*p+p),u=0;f&&void 0!==f[r]&&(u=f[r]),n.forEach((function(n){var o;n&&a[n.name]&&(o=n.buffer.data).push.apply(o,(0,Ee.Z)(a[n.name](t,e,s,r,i,u)))}))},g=0;g<d;g++)m(g)})),t.abrupt("return",{descriptors:n,featureLayout:s,indices:l});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),line:Pi,polygonFill:function(){var t=(0,pr.Z)(dr().mark((function t(e){var n,r,i,o,a,s,u,l;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.descriptors,r=e.features,i=e.enablePicking,o={a_Color:hi,a_Position:pi,filter:fi,a_vertexId:di,a_PickingColor:function(t){var e=t.id;return i?de(e):[0,0,0]}},a={sizePerElement:0,elements:[]},s=0,u=[],l=3,r.forEach((function(t,e){var r=Oi(t),i=r.indices,c=r.vertices,h=r.normals,p=r.size,f=r.indexes;i.forEach((function(t){u.push(t+s)})),l=p;var d=c.length/p;a.sizePerElement=l,a.elements.push({featureIdx:e,vertices:c,normals:h,offset:s}),s+=d;for(var m=function(r){var i=(null==h?void 0:h.slice(3*r,3*r+3))||[],a=c.slice(r*p,r*p+p),s=0;f&&void 0!==f[r]&&(s=f[r]),n.forEach((function(n){var u;n&&o[n.name]&&(u=n.buffer.data).push.apply(u,(0,Ee.Z)(o[n.name](t,e,a,r,i,s)))}))},g=0;g<d;g++)m(g)})),t.abrupt("return",{descriptors:n,featureLayout:a,indices:u});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},Li=(0,o.Z)({},ki);function Ii(){return(Ii=(0,pr.Z)(dr().mark((function t(e){var n,r;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.workerType,r=e.data,!Li[n]){t.next=3;break}return t.abrupt("return",Li[n](r));case 3:return t.abrupt("return",Promise.reject(new Error('Worker with type "'.concat(n,'" non-existent.'))));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}!function(t,e){var n=this;if("undefined"!=typeof self){var r={process:ci};ai.onmessage=function(e,i){return o=n,a=void 0,u=function(){var n,o,a,s,u,l,c,h,p,f;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(d){switch(d.label){case 0:switch(d.trys.push([0,19,,20]),e){case"process":return[3,1];case"process-in-batches":return[3,3];case"input-batch":return[3,16];case"input-done":return[3,17]}return[3,18];case 1:if(!t)throw new Error("Worker does not support atomic processing");return[4,t(i.input,i.options||{},r)];case 2:return n=d.sent(),ai.postMessage("done",{result:n}),[3,18];case 3:throw new Error("Worker does not support batched processing");case 4:d.trys.push([4,9,10,15]),a=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}(o),d.label=5;case 5:return[4,a.next()];case 6:if((s=d.sent()).done)return[3,8];u=s.value,ai.postMessage("output-batch",{result:u}),d.label=7;case 7:return[3,5];case 8:return[3,15];case 9:return l=d.sent(),p={error:l},[3,15];case 10:return d.trys.push([10,,13,14]),s&&!s.done&&(f=a.return)?[4,f.call(a)]:[3,12];case 11:d.sent(),d.label=12;case 12:return[3,14];case 13:if(p)throw p.error;return[7];case 14:return[7];case 15:return ai.postMessage("done",{}),[3,18];case 16:return ui.push(i.input),[3,18];case 17:return ui.close(),[3,18];case 18:return[3,20];case 19:return c=d.sent(),h=c instanceof Error?c.message:"",ai.postMessage("error",{error:h}),[3,20];case 20:return[2]}}))},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{i(u.next(t))}catch(t){e(t)}}function r(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(n,r)}i((u=u.apply(o,a||[])).next())}));var o,a,s,u}}}((function(t){return Ii.apply(this,arguments)}));var Ri=new Map,Di="l7-worker",Ni=3,Fi=!0;function zi(t){!function(t,e){Ri.set(t,e)}(Di,t)}function Bi(){var t,e=(t=Di,Ri.get(t));if(!e)throw new Error("get worker failed by workerName: ".concat(Di,"."));return e}function ji(t,e){return Ui.apply(this,arguments)}function Ui(){return(Ui=(0,pr.Z)(dr().mark((function t(e,n){var r,i,o,a,s;return dr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Bi(),i=ri.getWorkerFarm({maxConcurrency:Ni,reuseWorkers:Fi}),o=i.getWorkerPool({name:Di,source:r}),t.next=5,o.startJob(Di,(function(t,e,n){return t.done(n)}));case 5:return(a=t.sent).postMessage("process",{input:{workerType:e,data:n}}),t.next=9,a.result;case 9:return s=t.sent,t.abrupt("return",s.result);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}zi('var L7=function(t){"use strict";function e(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 r(){r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:E(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var h={};function p(){}function v(){}function d(){}var y={};c(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(k([])));m&&m!==e&&n.call(m,a)&&(y=m);var b=d.prototype=p.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var r;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return I()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=A(a,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function A(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a \'"+r+"\' method")),h;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.prototype=d,o(b,"constructor",{value:d,configurable:!0}),o(d,"constructor",{value:v,configurable:!0}),v.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(w.prototype),c(w.prototype,u,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),c(b,s,"Generator"),c(b,a,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function n(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function u(t){n(a,o,i,u,s,"next",t)}function s(t){n(a,o,i,u,s,"throw",t)}u(void 0)}))}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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,b(n.key),n)}}function u(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function h(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}function p(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f(t);if(e){var o=f(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p(this,r)}}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||g(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 y(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(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 g(t,e){if(t){if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(t,e):void 0}}function m(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 b(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(t,e){return t(e={exports:{}},e.exports),e.exports}var E,A,O=function(t){return t&&t.Math==Math&&t},S=O("object"==typeof globalThis&&globalThis)||O("object"==typeof window&&window)||O("object"==typeof self&&self)||O("object"==typeof x&&x)||function(){return this}()||x||Function("return this")(),T=Object.defineProperty,k=function(t,e){try{T(S,t,{value:e,configurable:!0,writable:!0})}catch(r){S[t]=e}return e},I=S["__core-js_shared__"]||k("__core-js_shared__",{}),j=w((function(t){(t.exports=function(t,e){return I[t]||(I[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"})})),P=function(t){try{return!!t()}catch(t){return!0}},_=!P((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),M=Function.prototype,L=M.call,R=_&&M.bind.bind(L,L),N=_?R:function(t){return function(){return L.apply(t,arguments)}},C=function(t){return null==t},D=TypeError,F=function(t){if(C(t))throw D("Can\'t call method on "+t);return t},W=Object,z=function(t){return W(F(t))},B=N({}.hasOwnProperty),U=Object.hasOwn||function(t,e){return B(z(t),e)},G=0,V=Math.random(),H=N(1..toString),q=function(t){return"Symbol("+(void 0===t?"":t)+")_"+H(++G+V,36)},Z="undefined"!=typeof navigator&&String(navigator.userAgent)||"",Y=S.process,$=S.Deno,K=Y&&Y.versions||$&&$.version,Q=K&&K.v8;Q&&(A=(E=Q.split("."))[0]>0&&E[0]<4?1:+(E[0]+E[1])),!A&&Z&&(!(E=Z.match(/Edge\\/(\\d+)/))||E[1]>=74)&&(E=Z.match(/Chrome\\/(\\d+)/))&&(A=+E[1]);var X=A,J=S.String,tt=!!Object.getOwnPropertySymbols&&!P((function(){var t=Symbol();return!J(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&X&&X<41})),et=tt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,rt=S.Symbol,nt=j("wks"),ot=et?rt.for||rt:rt&&rt.withoutSetter||q,it=function(t){return U(nt,t)||(nt[t]=tt&&U(rt,t)?rt[t]:ot("Symbol."+t)),nt[t]},at={};at[it("toStringTag")]="z";var ut="[object z]"===String(at),st="object"==typeof document&&document.all,ct={all:st,IS_HTMLDDA:void 0===st&&void 0!==st},ft=ct.all,lt=ct.IS_HTMLDDA?function(t){return"function"==typeof t||t===ft}:function(t){return"function"==typeof t},ht=!P((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),pt=ct.all,vt=ct.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:lt(t)||t===pt}:function(t){return"object"==typeof t?null!==t:lt(t)},dt=S.document,yt=vt(dt)&&vt(dt.createElement),gt=function(t){return yt?dt.createElement(t):{}},mt=!ht&&!P((function(){return 7!=Object.defineProperty(gt("div"),"a",{get:function(){return 7}}).a})),bt=ht&&P((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),xt=String,wt=TypeError,Et=function(t){if(vt(t))return t;throw wt(xt(t)+" is not an object")},At=Function.prototype.call,Ot=_?At.bind(At):function(){return At.apply(At,arguments)},St=function(t){return lt(t)?t:void 0},Tt=function(t,e){return arguments.length<2?St(S[t]):S[t]&&S[t][e]},kt=N({}.isPrototypeOf),It=Object,jt=et?function(t){return"symbol"==typeof t}:function(t){var e=Tt("Symbol");return lt(e)&&kt(e.prototype,It(t))},Pt=String,_t=function(t){try{return Pt(t)}catch(t){return"Object"}},Mt=TypeError,Lt=function(t){if(lt(t))return t;throw Mt(_t(t)+" is not a function")},Rt=function(t,e){var r=t[e];return C(r)?void 0:Lt(r)},Nt=TypeError,Ct=TypeError,Dt=it("toPrimitive"),Ft=function(t,e){if(!vt(t)||jt(t))return t;var r,n=Rt(t,Dt);if(n){if(void 0===e&&(e="default"),r=Ot(n,t,e),!vt(r)||jt(r))return r;throw Ct("Can\'t convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&<(r=t.toString)&&!vt(n=Ot(r,t)))return n;if(lt(r=t.valueOf)&&!vt(n=Ot(r,t)))return n;if("string"!==e&<(r=t.toString)&&!vt(n=Ot(r,t)))return n;throw Nt("Can\'t convert object to primitive value")}(t,e)},Wt=function(t){var e=Ft(t,"string");return jt(e)?e:e+""},zt=TypeError,Bt=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Gt={f:ht?bt?function(t,e,r){if(Et(t),e=Wt(e),Et(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=Ut(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return Bt(t,e,r)}:Bt:function(t,e,r){if(Et(t),e=Wt(e),Et(r),mt)try{return Bt(t,e,r)}catch(t){}if("get"in r||"set"in r)throw zt("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},Vt=Function.prototype,Ht=ht&&Object.getOwnPropertyDescriptor,qt=U(Vt,"name"),Zt={EXISTS:qt,PROPER:qt&&"something"===function(){}.name,CONFIGURABLE:qt&&(!ht||ht&&Ht(Vt,"name").configurable)},Yt=N(Function.toString);lt(I.inspectSource)||(I.inspectSource=function(t){return Yt(t)});var $t,Kt,Qt,Xt=I.inspectSource,Jt=S.WeakMap,te=lt(Jt)&&/native code/.test(String(Jt)),ee=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},re=ht?function(t,e,r){return Gt.f(t,e,ee(1,r))}:function(t,e,r){return t[e]=r,t},ne=j("keys"),oe=function(t){return ne[t]||(ne[t]=q(t))},ie={},ae=S.TypeError,ue=S.WeakMap;if(te||I.state){var se=I.state||(I.state=new ue);se.get=se.get,se.has=se.has,se.set=se.set,$t=function(t,e){if(se.has(t))throw ae("Object already initialized");return e.facade=t,se.set(t,e),e},Kt=function(t){return se.get(t)||{}},Qt=function(t){return se.has(t)}}else{var ce=oe("state");ie[ce]=!0,$t=function(t,e){if(U(t,ce))throw ae("Object already initialized");return e.facade=t,re(t,ce,e),e},Kt=function(t){return U(t,ce)?t[ce]:{}},Qt=function(t){return U(t,ce)}}var fe={set:$t,get:Kt,has:Qt,enforce:function(t){return Qt(t)?Kt(t):$t(t,{})},getterFor:function(t){return function(e){var r;if(!vt(e)||(r=Kt(e)).type!==t)throw ae("Incompatible receiver, "+t+" required");return r}}},le=w((function(t){var e=Zt.CONFIGURABLE,r=fe.enforce,n=fe.get,o=String,i=Object.defineProperty,a=N("".slice),u=N("".replace),s=N([].join),c=ht&&!P((function(){return 8!==i((function(){}),"length",{value:8}).length})),f=String(String).split("String"),l=t.exports=function(t,n,l){"Symbol("===a(o(n),0,7)&&(n="["+u(o(n),/^Symbol\\(([^)]*)\\)/,"$1")+"]"),l&&l.getter&&(n="get "+n),l&&l.setter&&(n="set "+n),(!U(t,"name")||e&&t.name!==n)&&(ht?i(t,"name",{value:n,configurable:!0}):t.name=n),c&&l&&U(l,"arity")&&t.length!==l.arity&&i(t,"length",{value:l.arity});try{l&&U(l,"constructor")&&l.constructor?ht&&i(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var h=r(t);return U(h,"source")||(h.source=s(f,"string"==typeof n?n:"")),t};Function.prototype.toString=l((function(){return lt(this)&&n(this).source||Xt(this)}),"toString")})),he=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(lt(r)&&le(r,i,n),n.global)o?t[e]=r:k(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:Gt.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},pe=N({}.toString),ve=N("".slice),de=function(t){return ve(pe(t),8,-1)},ye=it("toStringTag"),ge=Object,me="Arguments"==de(function(){return arguments}()),be=ut?de:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=ge(t),ye))?r:me?de(e):"Object"==(n=de(e))&<(e.callee)?"Arguments":n},xe=ut?{}.toString:function(){return"[object "+be(this)+"]"};ut||he(Object.prototype,"toString",xe,{unsafe:!0});var we={}.propertyIsEnumerable,Ee=Object.getOwnPropertyDescriptor,Ae={f:Ee&&!we.call({1:2},1)?function(t){var e=Ee(this,t);return!!e&&e.enumerable}:we},Oe=Object,Se=N("".split),Te=P((function(){return!Oe("z").propertyIsEnumerable(0)}))?function(t){return"String"==de(t)?Se(t,""):Oe(t)}:Oe,ke=function(t){return Te(F(t))},Ie=Object.getOwnPropertyDescriptor,je={f:ht?Ie:function(t,e){if(t=ke(t),e=Wt(e),mt)try{return Ie(t,e)}catch(t){}if(U(t,e))return ee(!Ot(Ae.f,t,e),t[e])}},Pe=Math.ceil,_e=Math.floor,Me=Math.trunc||function(t){var e=+t;return(e>0?_e:Pe)(e)},Le=function(t){var e=+t;return e!=e||0===e?0:Me(e)},Re=Math.max,Ne=Math.min,Ce=function(t,e){var r=Le(t);return r<0?Re(r+e,0):Ne(r,e)},De=Math.min,Fe=function(t){return t>0?De(Le(t),9007199254740991):0},We=function(t){return Fe(t.length)},ze=function(t){return function(e,r,n){var o,i=ke(e),a=We(i),u=Ce(n,a);if(t&&r!=r){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===r)return t||u||0;return!t&&-1}},Be={includes:ze(!0),indexOf:ze(!1)},Ue=Be.indexOf,Ge=N([].push),Ve=function(t,e){var r,n=ke(t),o=0,i=[];for(r in n)!U(ie,r)&&U(n,r)&&Ge(i,r);for(;e.length>o;)U(n,r=e[o++])&&(~Ue(i,r)||Ge(i,r));return i},He=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qe=He.concat("length","prototype"),Ze={f:Object.getOwnPropertyNames||function(t){return Ve(t,qe)}},Ye={f:Object.getOwnPropertySymbols},$e=N([].concat),Ke=Tt("Reflect","ownKeys")||function(t){var e=Ze.f(Et(t)),r=Ye.f;return r?$e(e,r(t)):e},Qe=function(t,e,r){for(var n=Ke(e),o=Gt.f,i=je.f,a=0;a<n.length;a++){var u=n[a];U(t,u)||r&&U(r,u)||o(t,u,i(e,u))}},Xe=/#|\\.prototype\\./,Je=function(t,e){var r=er[tr(t)];return r==nr||r!=rr&&(lt(e)?P(e):!!e)},tr=Je.normalize=function(t){return String(t).replace(Xe,".").toLowerCase()},er=Je.data={},rr=Je.NATIVE="N",nr=Je.POLYFILL="P",or=Je,ir=je.f,ar=function(t,e){var r,n,o,i,a,u=t.target,s=t.global,c=t.stat;if(r=s?S:c?S[u]||k(u,{}):(S[u]||{}).prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=ir(r,n))&&a.value:r[n],!or(s?n:u+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Qe(i,o)}(t.sham||o&&o.sham)&&re(i,"sham",!0),he(r,n,i,t)}},ur="undefined"!=typeof process&&"process"==de(process),sr=String,cr=TypeError,fr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=function(t,e,r){try{return N(Lt(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Et(r),function(t){if("object"==typeof t||lt(t))return t;throw cr("Can\'t set "+sr(t)+" as a prototype")}(n),e?t(r,n):r.__proto__=n,r}}():void 0),lr=Gt.f,hr=it("toStringTag"),pr=function(t,e,r){t&&!r&&(t=t.prototype),t&&!U(t,hr)&&lr(t,hr,{configurable:!0,value:e})},vr=function(t,e,r){return r.get&&le(r.get,e,{getter:!0}),r.set&&le(r.set,e,{setter:!0}),Gt.f(t,e,r)},dr=it("species"),yr=function(t){var e=Tt(t);ht&&e&&!e[dr]&&vr(e,dr,{configurable:!0,get:function(){return this}})},gr=TypeError,mr=function(t,e){if(kt(e,t))return t;throw gr("Incorrect invocation")},br=function(){},xr=[],wr=Tt("Reflect","construct"),Er=/^\\s*(?:class|function)\\b/,Ar=N(Er.exec),Or=!Er.exec(br),Sr=function(t){if(!lt(t))return!1;try{return wr(br,xr,t),!0}catch(t){return!1}},Tr=function(t){if(!lt(t))return!1;switch(be(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Or||!!Ar(Er,Xt(t))}catch(t){return!0}};Tr.sham=!0;var kr,Ir,jr,Pr,_r=!wr||P((function(){var t;return Sr(Sr.call)||!Sr(Object)||!Sr((function(){t=!0}))||t}))?Tr:Sr,Mr=TypeError,Lr=function(t){if(_r(t))return t;throw Mr(_t(t)+" is not a constructor")},Rr=it("species"),Nr=function(t,e){var r,n=Et(t).constructor;return void 0===n||C(r=Et(n)[Rr])?e:Lr(r)},Cr=Function.prototype,Dr=Cr.apply,Fr=Cr.call,Wr="object"==typeof Reflect&&Reflect.apply||(_?Fr.bind(Dr):function(){return Fr.apply(Dr,arguments)}),zr=function(t){if("Function"===de(t))return N(t)},Br=zr(zr.bind),Ur=function(t,e){return Lt(t),void 0===e?t:_?Br(t,e):function(){return t.apply(e,arguments)}},Gr=Tt("document","documentElement"),Vr=N([].slice),Hr=TypeError,qr=function(t,e){if(t<e)throw Hr("Not enough arguments");return t},Zr=/(?:ipad|iphone|ipod).*applewebkit/i.test(Z),Yr=S.setImmediate,$r=S.clearImmediate,Kr=S.process,Qr=S.Dispatch,Xr=S.Function,Jr=S.MessageChannel,tn=S.String,en=0,rn={};P((function(){kr=S.location}));var nn=function(t){if(U(rn,t)){var e=rn[t];delete rn[t],e()}},on=function(t){return function(){nn(t)}},an=function(t){nn(t.data)},un=function(t){S.postMessage(tn(t),kr.protocol+"//"+kr.host)};Yr&&$r||(Yr=function(t){qr(arguments.length,1);var e=lt(t)?t:Xr(t),r=Vr(arguments,1);return rn[++en]=function(){Wr(e,void 0,r)},Ir(en),en},$r=function(t){delete rn[t]},ur?Ir=function(t){Kr.nextTick(on(t))}:Qr&&Qr.now?Ir=function(t){Qr.now(on(t))}:Jr&&!Zr?(Pr=(jr=new Jr).port2,jr.port1.onmessage=an,Ir=Ur(Pr.postMessage,Pr)):S.addEventListener&<(S.postMessage)&&!S.importScripts&&kr&&"file:"!==kr.protocol&&!P(un)?(Ir=un,S.addEventListener("message",an,!1)):Ir="onreadystatechange"in gt("script")?function(t){Gr.appendChild(gt("script")).onreadystatechange=function(){Gr.removeChild(this),nn(t)}}:function(t){setTimeout(on(t),0)});var sn={set:Yr,clear:$r},cn=function(){this.head=null,this.tail=null};cn.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var fn,ln,hn,pn,vn,dn=cn,yn=/ipad|iphone|ipod/i.test(Z)&&"undefined"!=typeof Pebble,gn=/web0s(?!.*chrome)/i.test(Z),mn=je.f,bn=sn.set,xn=S.MutationObserver||S.WebKitMutationObserver,wn=S.document,En=S.process,An=S.Promise,On=mn(S,"queueMicrotask"),Sn=On&&On.value;if(!Sn){var Tn=new dn,kn=function(){var t,e;for(ur&&(t=En.domain)&&t.exit();e=Tn.get();)try{e()}catch(t){throw Tn.head&&fn(),t}t&&t.enter()};Zr||ur||gn||!xn||!wn?!yn&&An&&An.resolve?((pn=An.resolve(void 0)).constructor=An,vn=Ur(pn.then,pn),fn=function(){vn(kn)}):ur?fn=function(){En.nextTick(kn)}:(bn=Ur(bn,S),fn=function(){bn(kn)}):(ln=!0,hn=wn.createTextNode(""),new xn(kn).observe(hn,{characterData:!0}),fn=function(){hn.data=ln=!ln}),Sn=function(t){Tn.head||fn(),Tn.add(t)}}var In,jn,Pn,_n=Sn,Mn=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ln=S.Promise,Rn="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Nn=!Rn&&!ur&&"object"==typeof window&&"object"==typeof document,Cn=(Ln&&Ln.prototype,it("species")),Dn=!1,Fn=lt(S.PromiseRejectionEvent),Wn={CONSTRUCTOR:or("Promise",(function(){var t=Xt(Ln),e=t!==String(Ln);if(!e&&66===X)return!0;if(!X||X<51||!/native code/.test(t)){var r=new Ln((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[Cn]=n,!(Dn=r.then((function(){}))instanceof n))return!0}return!e&&(Nn||Rn)&&!Fn})),REJECTION_EVENT:Fn,SUBCLASSING:Dn},zn=TypeError,Bn=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw zn("Bad Promise constructor");e=t,r=n})),this.resolve=Lt(e),this.reject=Lt(r)},Un={f:function(t){return new Bn(t)}},Gn=sn.set,Vn=Wn.CONSTRUCTOR,Hn=Wn.REJECTION_EVENT,qn=Wn.SUBCLASSING,Zn=fe.getterFor("Promise"),Yn=fe.set,$n=Ln&&Ln.prototype,Kn=Ln,Qn=$n,Xn=S.TypeError,Jn=S.document,to=S.process,eo=Un.f,ro=eo,no=!!(Jn&&Jn.createEvent&&S.dispatchEvent),oo=function(t){var e;return!(!vt(t)||!lt(e=t.then))&&e},io=function(t,e){var r,n,o,i=e.value,a=1==e.state,u=a?t.ok:t.fail,s=t.resolve,c=t.reject,f=t.domain;try{u?(a||(2===e.rejection&&fo(e),e.rejection=1),!0===u?r=i:(f&&f.enter(),r=u(i),f&&(f.exit(),o=!0)),r===t.promise?c(Xn("Promise-chain cycle")):(n=oo(r))?Ot(n,r,s,c):s(r)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},ao=function(t,e){t.notified||(t.notified=!0,_n((function(){for(var r,n=t.reactions;r=n.get();)io(r,t);t.notified=!1,e&&!t.rejection&&so(t)})))},uo=function(t,e,r){var n,o;no?((n=Jn.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),S.dispatchEvent(n)):n={promise:e,reason:r},!Hn&&(o=S["on"+t])?o(n):"unhandledrejection"===t&&function(t,e){try{1==arguments.length?console.error(t):console.error(t,e)}catch(t){}}("Unhandled promise rejection",r)},so=function(t){Ot(Gn,S,(function(){var e,r=t.facade,n=t.value;if(co(t)&&(e=Mn((function(){ur?to.emit("unhandledRejection",n,r):uo("unhandledrejection",r,n)})),t.rejection=ur||co(t)?2:1,e.error))throw e.value}))},co=function(t){return 1!==t.rejection&&!t.parent},fo=function(t){Ot(Gn,S,(function(){var e=t.facade;ur?to.emit("rejectionHandled",e):uo("rejectionhandled",e,t.value)}))},lo=function(t,e,r){return function(n){t(e,n,r)}},ho=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,ao(t,!0))},po=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw Xn("Promise can\'t be resolved itself");var n=oo(e);n?_n((function(){var r={done:!1};try{Ot(n,e,lo(po,r,t),lo(ho,r,t))}catch(e){ho(r,e,t)}})):(t.value=e,t.state=1,ao(t,!1))}catch(e){ho({done:!1},e,t)}}};if(Vn&&(Qn=(Kn=function(t){mr(this,Qn),Lt(t),Ot(In,this);var e=Zn(this);try{t(lo(po,e),lo(ho,e))}catch(t){ho(e,t)}}).prototype,(In=function(t){Yn(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new dn,rejection:!1,state:0,value:void 0})}).prototype=he(Qn,"then",(function(t,e){var r=Zn(this),n=eo(Nr(this,Kn));return r.parent=!0,n.ok=!lt(t)||t,n.fail=lt(e)&&e,n.domain=ur?to.domain:void 0,0==r.state?r.reactions.add(n):_n((function(){io(n,r)})),n.promise})),jn=function(){var t=new In,e=Zn(t);this.promise=t,this.resolve=lo(po,e),this.reject=lo(ho,e)},Un.f=eo=function(t){return t===Kn||void 0===t?new jn(t):ro(t)},lt(Ln)&&$n!==Object.prototype)){Pn=$n.then,qn||he($n,"then",(function(t,e){var r=this;return new Kn((function(t,e){Ot(Pn,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete $n.constructor}catch(t){}fr&&fr($n,Qn)}ar({global:!0,constructor:!0,wrap:!0,forced:Vn},{Promise:Kn}),pr(Kn,"Promise",!1),yr("Promise");var vo={},yo=it("iterator"),go=Array.prototype,mo=function(t){return void 0!==t&&(vo.Array===t||go[yo]===t)},bo=it("iterator"),xo=function(t){if(!C(t))return Rt(t,bo)||Rt(t,"@@iterator")||vo[be(t)]},wo=TypeError,Eo=function(t,e){var r=arguments.length<2?xo(t):e;if(Lt(r))return Et(Ot(r,t));throw wo(_t(t)+" is not iterable")},Ao=function(t,e,r){var n,o;Et(t);try{if(!(n=Rt(t,"return"))){if("throw"===e)throw r;return r}n=Ot(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Et(n),r},Oo=TypeError,So=function(t,e){this.stopped=t,this.result=e},To=So.prototype,ko=function(t,e,r){var n,o,i,a,u,s,c,f=r&&r.that,l=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),p=!(!r||!r.IS_ITERATOR),v=!(!r||!r.INTERRUPTED),d=Ur(e,f),y=function(t){return n&&Ao(n,"normal",t),new So(!0,t)},g=function(t){return l?(Et(t),v?d(t[0],t[1],y):d(t[0],t[1])):v?d(t,y):d(t)};if(h)n=t.iterator;else if(p)n=t;else{if(!(o=xo(t)))throw Oo(_t(t)+" is not iterable");if(mo(o)){for(i=0,a=We(t);a>i;i++)if((u=g(t[i]))&&kt(To,u))return u;return new So(!1)}n=Eo(t,o)}for(s=h?t.next:n.next;!(c=Ot(s,n)).done;){try{u=g(c.value)}catch(t){Ao(n,"throw",t)}if("object"==typeof u&&u&&kt(To,u))return u}return new So(!1)},Io=it("iterator"),jo=!1;try{var Po=0,_o={next:function(){return{done:!!Po++}},return:function(){jo=!0}};_o[Io]=function(){return this},Array.from(_o,(function(){throw 2}))}catch(t){}var Mo=function(t,e){if(!e&&!jo)return!1;var r=!1;try{var n={};n[Io]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},Lo=Wn.CONSTRUCTOR||!Mo((function(t){Ln.all(t).then(void 0,(function(){}))}));ar({target:"Promise",stat:!0,forced:Lo},{all:function(t){var e=this,r=Un.f(e),n=r.resolve,o=r.reject,i=Mn((function(){var r=Lt(e.resolve),i=[],a=0,u=1;ko(t,(function(t){var s=a++,c=!1;u++,Ot(r,e,t).then((function(t){c||(c=!0,i[s]=t,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise}});var Ro=Wn.CONSTRUCTOR,No=Ln&&Ln.prototype;if(ar({target:"Promise",proto:!0,forced:Ro,real:!0},{catch:function(t){return this.then(void 0,t)}}),lt(Ln)){var Co=Tt("Promise").prototype.catch;No.catch!==Co&&he(No,"catch",Co,{unsafe:!0})}ar({target:"Promise",stat:!0,forced:Lo},{race:function(t){var e=this,r=Un.f(e),n=r.reject,o=Mn((function(){var o=Lt(e.resolve);ko(t,(function(t){Ot(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}}),ar({target:"Promise",stat:!0,forced:Wn.CONSTRUCTOR},{reject:function(t){var e=Un.f(this);return Ot(e.reject,void 0,t),e.promise}});var Do=Wn.CONSTRUCTOR;Tt("Promise");function Fo(t,e){if(!t)throw new Error(e||"web worker helper assertion failed.")}ar({target:"Promise",stat:!0,forced:Do},{resolve:function(t){return function(t,e){if(Et(t),vt(e)&&e.constructor===t)return e;var r=Un.f(t);return(0,r.resolve)(e),r.promise}(this,t)}});var Wo="undefined"!=typeof window&&void 0!==window.orientation,zo=function(){function t(t,e){var r=this;this.name=t,this.workerThread=e,this.isRunning=!0,this.resolve=function(){},this.reject=function(){},this.result=new Promise((function(t,e){r.resolve=t,r.reject=e}))}return t.prototype.postMessage=function(t,e){this.workerThread.postMessage({source:"Main thread",type:t,payload:e})},t.prototype.done=function(t){Fo(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.resolve(t)},t.prototype.error=function(t){Fo(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.reject(t)},t}(),Bo=new Map;function Uo(t){Fo(t.source&&!t.url||!t.source&&t.url);var e=Bo.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return Go((e=t,"try {\\n importScripts(\'"+e+"\');\\n} catch (error) {\\n console.error(error);\\n throw error;\\n}"));var e}(t.url),Bo.set(t.url,e)),t.source&&(e=Go(t.source),Bo.set(t.source,e))),Fo(e),e}function Go(t){var e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function Vo(t,e,r){void 0===e&&(e=!0);var n=r||new Set;if(t){if(Ho(t))n.add(t);else if(Ho(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"==typeof t)for(var o in t)Vo(t[o],e,n)}else;return void 0===r?Array.from(n):[]}function Ho(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var qo=function(){},Zo=function(){function t(t){this.terminated=!1,this.loadableURL="";var e=t.name,r=t.source,n=t.url;Fo(r||n),this.name=e,this.source=r,this.url=n,this.onMessage=qo,this.onError=function(t){return console.log(t)},this.worker=this.createBrowserWorker()}return t.isSupported=function(){return"undefined"!=typeof Worker},t.prototype.destroy=function(){this.onMessage=qo,this.onError=qo,this.worker.terminate(),this.terminated=!0},Object.defineProperty(t.prototype,"isRunning",{get:function(){return Boolean(this.onMessage)},enumerable:!1,configurable:!0}),t.prototype.postMessage=function(t,e){e=e||Vo(t),this.worker.postMessage(t,e)},t.prototype.getErrorFromErrorEvent=function(t){var e="Failed to load ";return e+="worker "+this.name+" from "+this.url+". ",t.message&&(e+=t.message+" in "),t.lineno&&(e+=":"+t.lineno+":"+t.colno),new Error(e)},t.prototype.createBrowserWorker=function(){var t=this;this.loadableURL=Uo({source:this.source,url:this.url});var e=new Worker(this.loadableURL,{name:this.name});return e.onmessage=function(e){e.data?t.onMessage(e.data):t.onError(new Error("No data received"))},e.onerror=function(e){t.onError(t.getErrorFromErrorEvent(e)),t.terminated=!0},e.onmessageerror=function(e){return console.error("worker "+t.name+", message error: "+e)},e},t}(),Yo=self&&self.__assign||function(){return(Yo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$o=self&&self.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},Ko=self&&self.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Qo=function(){function t(t){this.name="unnamed",this.maxConcurrency=1,this.maxMobileConcurrency=1,this.onDebug=function(){},this.reuseWorkers=!0,this.props={},this.jobQueue=[],this.idleQueue=[],this.count=0,this.isDestroyed=!1,this.source=t.source,this.url=t.url,this.setProps(t)}return t.prototype.destroy=function(){this.idleQueue.forEach((function(t){return t.destroy()})),this.isDestroyed=!0},t.prototype.setProps=function(t){this.props=Yo(Yo({},this.props),t),void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)},t.prototype.startJob=function(t,e,r){return void 0===e&&(e=function(t,e,r){return t.done(r)}),void 0===r&&(r=function(t,e){return t.error(e)}),$o(this,void 0,void 0,(function(){var n,o=this;return Ko(this,(function(i){switch(i.label){case 0:return n=new Promise((function(n){return o.jobQueue.push({name:t,onMessage:e,onError:r,onStart:n}),o})),this.startQueuedJob(),[4,n];case 1:return[2,i.sent()]}}))}))},t.prototype.startQueuedJob=function(){return $o(this,void 0,void 0,(function(){var t,e,r;return Ko(this,(function(n){switch(n.label){case 0:if(!this.jobQueue.length)return[2];if(!(t=this.getAvailableWorker()))return[2];if(!(e=this.jobQueue.shift()))return[3,4];this.onDebug({message:"Starting job",name:e.name,backlog:this.jobQueue.length,workerThread:t}),r=new zo(e.name,t),t.onMessage=function(t){return e.onMessage(r,t.type,t.payload)},t.onError=function(t){return e.onError(r,t)},e.onStart(r),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,r.result];case 2:return n.sent(),[3,4];case 3:return this.returnWorkerToQueue(t),[7];case 4:return[2]}}))}))},t.prototype.returnWorkerToQueue=function(t){this.isDestroyed||!this.reuseWorkers||this.count>this.getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this.startQueuedJob()},t.prototype.getAvailableWorker=function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this.getMaxConcurrency()){this.count++;var t=this.name.toLowerCase()+" (#"+this.count+" of "+this.maxConcurrency+")";return new Zo({name:t,source:this.source,url:this.url})}return null},t.prototype.getMaxConcurrency=function(){return Wo?this.maxMobileConcurrency:this.maxConcurrency},t}(),Xo=self&&self.__assign||function(){return(Xo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jo=self&&self.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ti={maxConcurrency:3,maxMobileConcurrency:1,onDebug:function(){},reuseWorkers:!0},ei=(function(){function t(t){this.workerPools=new Map,this.props=Xo({},ti),this.setProps(t),this.workerPools=new Map}t.isSupported=function(){return Zo.isSupported()},t.getWorkerFarm=function(e){return void 0===e&&(e={}),t.workerFarm=t.workerFarm||new t({}),t.workerFarm.setProps(e),t.workerFarm},t.prototype.destroy=function(){var t,e;try{for(var r=Jo(this.workerPools.values()),n=r.next();!n.done;n=r.next()){n.value.destroy()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.setProps=function(t){var e,r;this.props=Xo(Xo({},this.props),t);try{for(var n=Jo(this.workerPools.values()),o=n.next();!o.done;o=n.next()){o.value.setProps(this.getWorkerPoolProps())}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.getWorkerPool=function(t){var e=t.name,r=t.source,n=t.url,o=this.workerPools.get(e);return o||((o=new Qo({name:e,source:r,url:n})).setProps(this.getWorkerPoolProps()),this.workerPools.set(e,o)),o},t.prototype.getWorkerPoolProps=function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}(),new Map),ri=function(){function t(){}return Object.defineProperty(t,"onmessage",{set:function(t){self.onmessage=function(e){if(ni(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}},enumerable:!1,configurable:!0}),t.addEventListener=function(t){var e=ei.get(t);e||(e=function(e){if(ni(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}),self.addEventListener("message",e)},t.removeEventListener=function(t){var e=ei.get(t);ei.delete(t),self.removeEventListener("message",e)},t.postMessage=function(t,e){if(self){var r={source:"Worker thread",type:t,payload:e},n=Vo(e);self.postMessage(r,n)}},t}();function ni(t){var e=t.type,r=t.data;return"message"===e&&r&&"string"==typeof r.source&&"Main thread"===r.source}self&&self.__awaiter,self&&self.__generator;var oi,ii,ai=function(){function t(){this._values=[],this._settlers=[],this._closed=!1}return t.prototype[Symbol.asyncIterator]=function(){return this},t.prototype.push=function(t){return this.enqueue(t)},t.prototype.enqueue=function(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");var e=this._settlers.shift();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.push(t)},t.prototype.close=function(){for(;this._settlers.length>0;){this._settlers.shift().resolve({done:!0})}this._closed=!0},t.prototype.next=function(){var t=this;if(this._values.length>0){var e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((function(e,r){t._settlers.push({resolve:e,reject:r})}))},t}(),ui=self&&self.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},si=self&&self.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},ci=self&&self.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,o){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,o,(e=t[r](e)).done,e.value)}))}}},fi=0;function li(t,e){var r=this;if("undefined"!=typeof self){var n={process:hi};ri.onmessage=function(o,i){return ui(r,void 0,void 0,(function(){var r,a,u,s,c,f,l,h,p,v;return si(this,(function(d){switch(d.label){case 0:switch(d.trys.push([0,19,,20]),o){case"process":return[3,1];case"process-in-batches":return[3,3];case"input-batch":return[3,16];case"input-done":return[3,17]}return[3,18];case 1:if(!t)throw new Error("Worker does not support atomic processing");return[4,t(i.input,i.options||{},n)];case 2:return r=d.sent(),ri.postMessage("done",{result:r}),[3,18];case 3:if(!e)throw new Error("Worker does not support batched processing");oi=new ai,ii=i.options||{},a=e(oi,ii,n),d.label=4;case 4:d.trys.push([4,9,10,15]),u=ci(a),d.label=5;case 5:return[4,u.next()];case 6:if((s=d.sent()).done)return[3,8];c=s.value,ri.postMessage("output-batch",{result:c}),d.label=7;case 7:return[3,5];case 8:return[3,15];case 9:return f=d.sent(),p={error:f},[3,15];case 10:return d.trys.push([10,,13,14]),s&&!s.done&&(v=u.return)?[4,v.call(u)]:[3,12];case 11:d.sent(),d.label=12;case 12:return[3,14];case 13:if(p)throw p.error;return[7];case 14:return[7];case 15:return ri.postMessage("done",{}),[3,18];case 16:return oi.push(i.input),[3,18];case 17:return oi.close(),[3,18];case 18:return[3,20];case 19:return l=d.sent(),h=l instanceof Error?l.message:"",ri.postMessage("error",{error:h}),[3,20];case 20:return[2]}}))}))}}}function hi(t,e){return void 0===e&&(e={}),new Promise((function(r,n){var o=fi++,i=function(t,e){if(e.id===o)switch(t){case"done":ri.removeEventListener(i),r(e.result);break;case"error":ri.removeEventListener(i),n(e.error)}};ri.addEventListener(i);var a={id:o,input:t,options:e};ri.postMessage("process",a)}))}self&&self.__awaiter,self&&self.__generator;var pi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},vi=gt("span").classList,di=vi&&vi.constructor&&vi.constructor.prototype,yi=di===Object.prototype?void 0:di,gi=Array.isArray||function(t){return"Array"==de(t)},mi=it("species"),bi=Array,xi=function(t,e){return new(function(t){var e;return gi(t)&&(e=t.constructor,(_r(e)&&(e===bi||gi(e.prototype))||vt(e)&&null===(e=e[mi]))&&(e=void 0)),void 0===e?bi:e}(t))(0===e?0:e)},wi=N([].push),Ei=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=7==t,u=5==t||i;return function(s,c,f,l){for(var h,p,v=z(s),d=Te(v),y=Ur(c,f),g=We(d),m=0,b=l||xi,x=e?b(s,g):r||a?b(s,0):void 0;g>m;m++)if((u||m in d)&&(p=y(h=d[m],m,v),t))if(e)x[m]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return m;case 2:wi(x,h)}else switch(t){case 4:return!1;case 7:wi(x,h)}return i?-1:n||o?o:x}},Ai={forEach:Ei(0),map:Ei(1),filter:Ei(2),some:Ei(3),every:Ei(4),find:Ei(5),findIndex:Ei(6),filterReject:Ei(7)},Oi=function(t,e){var r=[][t];return!!r&&P((function(){r.call(null,e||function(){return 1},1)}))},Si=Ai.forEach,Ti=Oi("forEach")?[].forEach:function(t){return Si(this,t,arguments.length>1?arguments[1]:void 0)},ki=function(t){if(t&&t.forEach!==Ti)try{re(t,"forEach",Ti)}catch(e){t.forEach=Ti}};for(var Ii in pi)pi[Ii]&&ki(S[Ii]&&S[Ii].prototype);ki(yi);var ji=function(t,e,r){var n=Wt(e);n in t?Gt.f(t,n,ee(0,r)):t[n]=r},Pi=it("species"),_i=function(t){return X>=51||!P((function(){var e=[];return(e.constructor={})[Pi]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Mi=_i("slice"),Li=it("species"),Ri=Array,Ni=Math.max;ar({target:"Array",proto:!0,forced:!Mi},{slice:function(t,e){var r,n,o,i=ke(this),a=We(i),u=Ce(t,a),s=Ce(void 0===e?a:e,a);if(gi(i)&&(r=i.constructor,(_r(r)&&(r===Ri||gi(r.prototype))||vt(r)&&null===(r=r[Li]))&&(r=void 0),r===Ri||void 0===r))return Vr(i,u,s);for(n=new(void 0===r?Ri:r)(Ni(s-u,0)),o=0;u<s;u++,o++)u in i&&ji(n,o,i[u]);return n.length=o,n}});var Ci=Zt.EXISTS,Di=Function.prototype,Fi=N(Di.toString),Wi=/function\\b(?:\\s|\\/\\*[\\S\\s]*?\\*\\/|\\/\\/[^\\n\\r]*[\\n\\r]+)*([^\\s(/]*)/,zi=N(Wi.exec);ht&&!Ci&&vr(Di,"name",{configurable:!0,get:function(){try{return zi(Wi,Fi(this))[1]}catch(t){return""}}});var Bi,Ui=Object.keys||function(t){return Ve(t,He)},Gi={f:ht&&!bt?Object.defineProperties:function(t,e){Et(t);for(var r,n=ke(e),o=Ui(e),i=o.length,a=0;i>a;)Gt.f(t,r=o[a++],n[r]);return t}},Vi=oe("IE_PROTO"),Hi=function(){},qi=function(t){return"<script>"+t+"<\\/script>"},Zi=function(t){t.write(qi("")),t.close();var e=t.parentWindow.Object;return t=null,e},Yi=function(){try{Bi=new ActiveXObject("htmlfile")}catch(t){}var t,e;Yi="undefined"!=typeof document?document.domain&&Bi?Zi(Bi):((e=gt("iframe")).style.display="none",Gr.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(qi("document.F=Object")),t.close(),t.F):Zi(Bi);for(var r=He.length;r--;)delete Yi.prototype[He[r]];return Yi()};ie[Vi]=!0;var $i=Object.create||function(t,e){var r;return null!==t?(Hi.prototype=Et(t),r=new Hi,Hi.prototype=null,r[Vi]=t):r=Yi(),void 0===e?r:Gi.f(r,e)},Ki=Gt.f,Qi=it("unscopables"),Xi=Array.prototype;null==Xi[Qi]&&Ki(Xi,Qi,{configurable:!0,value:$i(null)});var Ji,ta,ea,ra=function(t){Xi[Qi][t]=!0},na=!P((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),oa=oe("IE_PROTO"),ia=Object,aa=ia.prototype,ua=na?ia.getPrototypeOf:function(t){var e=z(t);if(U(e,oa))return e[oa];var r=e.constructor;return lt(r)&&e instanceof r?r.prototype:e instanceof ia?aa:null},sa=it("iterator"),ca=!1;[].keys&&("next"in(ea=[].keys())?(ta=ua(ua(ea)))!==Object.prototype&&(Ji=ta):ca=!0),(!vt(Ji)||P((function(){var t={};return Ji[sa].call(t)!==t})))&&(Ji={}),lt(Ji[sa])||he(Ji,sa,(function(){return this}));var fa={IteratorPrototype:Ji,BUGGY_SAFARI_ITERATORS:ca},la=fa.IteratorPrototype,ha=function(){return this},pa=Zt.PROPER,va=Zt.CONFIGURABLE,da=fa.IteratorPrototype,ya=fa.BUGGY_SAFARI_ITERATORS,ga=it("iterator"),ma=function(){return this},ba=function(t,e,r,n,o,i,a){!function(t,e,r,n){var o=e+" Iterator";t.prototype=$i(la,{next:ee(+!n,r)}),pr(t,o,!1),vo[o]=ha}(r,e,n);var u,s,c,f=function(t){if(t===o&&d)return d;if(!ya&&t in p)return p[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",h=!1,p=t.prototype,v=p[ga]||p["@@iterator"]||o&&p[o],d=!ya&&v||f(o),y="Array"==e&&p.entries||v;if(y&&(u=ua(y.call(new t)))!==Object.prototype&&u.next&&(ua(u)!==da&&(fr?fr(u,da):lt(u[ga])||he(u,ga,ma)),pr(u,l,!0)),pa&&"values"==o&&v&&"values"!==v.name&&(va?re(p,"name","values"):(h=!0,d=function(){return Ot(v,this)})),o)if(s={values:f("values"),keys:i?d:f("keys"),entries:f("entries")},a)for(c in s)(ya||h||!(c in p))&&he(p,c,s[c]);else ar({target:e,proto:!0,forced:ya||h},s);return p[ga]!==d&&he(p,ga,d,{name:o}),vo[e]=d,s},xa=function(t,e){return{value:t,done:e}},wa=Gt.f,Ea=fe.set,Aa=fe.getterFor("Array Iterator"),Oa=ba(Array,"Array",(function(t,e){Ea(this,{type:"Array Iterator",target:ke(t),index:0,kind:e})}),(function(){var t=Aa(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,xa(void 0,!0)):xa("keys"==r?n:"values"==r?e[n]:[n,e[n]],!1)}),"values"),Sa=vo.Arguments=vo.Array;if(ra("keys"),ra("values"),ra("entries"),ht&&"values"!==Sa.name)try{wa(Sa,"name",{value:"values"})}catch(t){}var Ta,ka,Ia,ja="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Pa=fe.enforce,_a=fe.get,Ma=S.Int8Array,La=Ma&&Ma.prototype,Ra=S.Uint8ClampedArray,Na=Ra&&Ra.prototype,Ca=Ma&&ua(Ma),Da=La&&ua(La),Fa=Object.prototype,Wa=S.TypeError,za=it("toStringTag"),Ba=q("TYPED_ARRAY_TAG"),Ua=ja&&!!fr&&"Opera"!==be(S.opera),Ga=!1,Va={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Ha={BigInt64Array:8,BigUint64Array:8},qa=function(t){var e=ua(t);if(vt(e)){var r=_a(e);return r&&U(r,"TypedArrayConstructor")?r.TypedArrayConstructor:qa(e)}},Za=function(t){if(!vt(t))return!1;var e=be(t);return U(Va,e)||U(Ha,e)};for(Ta in Va)(Ia=(ka=S[Ta])&&ka.prototype)?Pa(Ia).TypedArrayConstructor=ka:Ua=!1;for(Ta in Ha)(Ia=(ka=S[Ta])&&ka.prototype)&&(Pa(Ia).TypedArrayConstructor=ka);if((!Ua||!lt(Ca)||Ca===Function.prototype)&&(Ca=function(){throw Wa("Incorrect invocation")},Ua))for(Ta in Va)S[Ta]&&fr(S[Ta],Ca);if((!Ua||!Da||Da===Fa)&&(Da=Ca.prototype,Ua))for(Ta in Va)S[Ta]&&fr(S[Ta].prototype,Da);if(Ua&&ua(Na)!==Da&&fr(Na,Da),ht&&!U(Da,za))for(Ta in Ga=!0,vr(Da,za,{configurable:!0,get:function(){return vt(this)?this[Ba]:void 0}}),Va)S[Ta]&&re(S[Ta],Ba,Ta);var Ya={NATIVE_ARRAY_BUFFER_VIEWS:Ua,TYPED_ARRAY_TAG:Ga&&Ba,aTypedArray:function(t){if(Za(t))return t;throw Wa("Target is not a typed array")},aTypedArrayConstructor:function(t){if(lt(t)&&(!fr||kt(Ca,t)))return t;throw Wa(_t(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,n){if(ht){if(r)for(var o in Va){var i=S[o];if(i&&U(i.prototype,t))try{delete i.prototype[t]}catch(r){try{i.prototype[t]=e}catch(t){}}}Da[t]&&!r||he(Da,t,r?e:Ua&&La[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,r){var n,o;if(ht){if(fr){if(r)for(n in Va)if((o=S[n])&&U(o,t))try{delete o[t]}catch(t){}if(Ca[t]&&!r)return;try{return he(Ca,t,r?e:Ua&&Ca[t]||e)}catch(t){}}for(n in Va)!(o=S[n])||o[t]&&!r||he(o,t,e)}},getTypedArrayConstructor:qa,isView:function(t){if(!vt(t))return!1;var e=be(t);return"DataView"===e||U(Va,e)||U(Ha,e)},isTypedArray:Za,TypedArray:Ca,TypedArrayPrototype:Da},$a=Ya.NATIVE_ARRAY_BUFFER_VIEWS,Ka=S.ArrayBuffer,Qa=S.Int8Array,Xa=!$a||!P((function(){Qa(1)}))||!P((function(){new Qa(-1)}))||!Mo((function(t){new Qa,new Qa(null),new Qa(1.5),new Qa(t)}),!0)||P((function(){return 1!==new Qa(new Ka(2),1,void 0).length})),Ja=function(t,e,r){for(var n in e)he(t,n,e[n],r);return t},tu=RangeError,eu=function(t){if(void 0===t)return 0;var e=Le(t),r=Fe(e);if(e!==r)throw tu("Wrong length or index");return r},ru=Array,nu=Math.abs,ou=Math.pow,iu=Math.floor,au=Math.log,uu=Math.LN2,su=function(t,e,r){var n,o,i,a=ru(r),u=8*r-e-1,s=(1<<u)-1,c=s>>1,f=23===e?ou(2,-24)-ou(2,-77):0,l=t<0||0===t&&1/t<0?1:0,h=0;for((t=nu(t))!=t||t===1/0?(o=t!=t?1:0,n=s):(n=iu(au(t)/uu),t*(i=ou(2,-n))<1&&(n--,i*=2),(t+=n+c>=1?f/i:f*ou(2,1-c))*i>=2&&(n++,i/=2),n+c>=s?(o=0,n=s):n+c>=1?(o=(t*i-1)*ou(2,e),n+=c):(o=t*ou(2,c-1)*ou(2,e),n=0));e>=8;)a[h++]=255&o,o/=256,e-=8;for(n=n<<e|o,u+=e;u>0;)a[h++]=255&n,n/=256,u-=8;return a[--h]|=128*l,a},cu=function(t,e){var r,n=t.length,o=8*n-e-1,i=(1<<o)-1,a=i>>1,u=o-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;)f=256*f+t[s--],u-=8;for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;)r=256*r+t[s--],u-=8;if(0===f)f=1-a;else{if(f===i)return r?NaN:c?-1/0:1/0;r+=ou(2,e),f-=a}return(c?-1:1)*r*ou(2,f-e)},fu=function(t){for(var e=z(this),r=We(e),n=arguments.length,o=Ce(n>1?arguments[1]:void 0,r),i=n>2?arguments[2]:void 0,a=void 0===i?r:Ce(i,r);a>o;)e[o++]=t;return e},lu=Array,hu=Math.max,pu=function(t,e,r){for(var n=We(t),o=Ce(e,n),i=Ce(void 0===r?n:r,n),a=lu(hu(i-o,0)),u=0;o<i;o++,u++)ji(a,u,t[o]);return a.length=u,a},vu=Ze.f,du=Zt.PROPER,yu=Zt.CONFIGURABLE,gu=fe.getterFor("ArrayBuffer"),mu=fe.getterFor("DataView"),bu=fe.set,xu=S.ArrayBuffer,wu=xu,Eu=wu&&wu.prototype,Au=S.DataView,Ou=Au&&Au.prototype,Su=Object.prototype,Tu=S.Array,ku=S.RangeError,Iu=N(fu),ju=N([].reverse),Pu=su,_u=cu,Mu=function(t){return[255&t]},Lu=function(t){return[255&t,t>>8&255]},Ru=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Nu=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Cu=function(t){return Pu(t,23,4)},Du=function(t){return Pu(t,52,8)},Fu=function(t,e,r){vr(t.prototype,e,{configurable:!0,get:function(){return r(this)[e]}})},Wu=function(t,e,r,n){var o=eu(r),i=mu(t);if(o+e>i.byteLength)throw ku("Wrong index");var a=i.bytes,u=o+i.byteOffset,s=pu(a,u,u+e);return n?s:ju(s)},zu=function(t,e,r,n,o,i){var a=eu(r),u=mu(t);if(a+e>u.byteLength)throw ku("Wrong index");for(var s=u.bytes,c=a+u.byteOffset,f=n(+o),l=0;l<e;l++)s[c+l]=f[i?l:e-l-1]};if(ja){var Bu=du&&"ArrayBuffer"!==xu.name;if(P((function(){xu(1)}))&&P((function(){new xu(-1)}))&&!P((function(){return new xu,new xu(1.5),new xu(NaN),1!=xu.length||Bu&&!yu})))Bu&&yu&&re(xu,"name","ArrayBuffer");else{(wu=function(t){return mr(this,Eu),new xu(eu(t))}).prototype=Eu;for(var Uu,Gu=vu(xu),Vu=0;Gu.length>Vu;)(Uu=Gu[Vu++])in wu||re(wu,Uu,xu[Uu]);Eu.constructor=wu}fr&&ua(Ou)!==Su&&fr(Ou,Su);var Hu=new Au(new wu(2)),qu=N(Ou.setInt8);Hu.setInt8(0,2147483648),Hu.setInt8(1,2147483649),!Hu.getInt8(0)&&Hu.getInt8(1)||Ja(Ou,{setInt8:function(t,e){qu(this,t,e<<24>>24)},setUint8:function(t,e){qu(this,t,e<<24>>24)}},{unsafe:!0})}else Eu=(wu=function(t){mr(this,Eu);var e=eu(t);bu(this,{type:"ArrayBuffer",bytes:Iu(Tu(e),0),byteLength:e}),ht||(this.byteLength=e,this.detached=!1)}).prototype,Ou=(Au=function(t,e,r){mr(this,Ou),mr(t,Eu);var n=gu(t),o=n.byteLength,i=Le(e);if(i<0||i>o)throw ku("Wrong offset");if(i+(r=void 0===r?o-i:Fe(r))>o)throw ku("Wrong length");bu(this,{type:"DataView",buffer:t,byteLength:r,byteOffset:i,bytes:n.bytes}),ht||(this.buffer=t,this.byteLength=r,this.byteOffset=i)}).prototype,ht&&(Fu(wu,"byteLength",gu),Fu(Au,"buffer",mu),Fu(Au,"byteLength",mu),Fu(Au,"byteOffset",mu)),Ja(Ou,{getInt8:function(t){return Wu(this,1,t)[0]<<24>>24},getUint8:function(t){return Wu(this,1,t)[0]},getInt16:function(t){var e=Wu(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Wu(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return Nu(Wu(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return Nu(Wu(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return _u(Wu(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return _u(Wu(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){zu(this,1,t,Mu,e)},setUint8:function(t,e){zu(this,1,t,Mu,e)},setInt16:function(t,e){zu(this,2,t,Lu,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){zu(this,2,t,Lu,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){zu(this,4,t,Ru,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){zu(this,4,t,Ru,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){zu(this,4,t,Cu,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){zu(this,8,t,Du,e,arguments.length>2?arguments[2]:void 0)}});pr(wu,"ArrayBuffer"),pr(Au,"DataView");var Zu={ArrayBuffer:wu,DataView:Au},Yu=Math.floor,$u=Number.isInteger||function(t){return!vt(t)&&isFinite(t)&&Yu(t)===t},Ku=RangeError,Qu=RangeError,Xu=function(t,e){var r=function(t){var e=Le(t);if(e<0)throw Ku("The argument can\'t be less than 0");return e}(t);if(r%e)throw Qu("Wrong offset");return r},Ju=function(t){var e=be(t);return"BigInt64Array"==e||"BigUint64Array"==e},ts=TypeError,es=function(t){var e=Ft(t,"number");if("number"==typeof e)throw ts("Can\'t convert number to bigint");return BigInt(e)},rs=Ya.aTypedArrayConstructor,ns=function(t){var e,r,n,o,i,a,u,s,c=Lr(this),f=z(t),l=arguments.length,h=l>1?arguments[1]:void 0,p=void 0!==h,v=xo(f);if(v&&!mo(v))for(s=(u=Eo(f,v)).next,f=[];!(a=Ot(s,u)).done;)f.push(a.value);for(p&&l>2&&(h=Ur(h,arguments[2])),r=We(f),n=new(rs(c))(r),o=Ju(n),e=0;r>e;e++)i=p?h(f[e],e):f[e],n[e]=o?es(i):+i;return n},os=function(t,e,r){var n,o;return fr&<(n=e.constructor)&&n!==r&&vt(o=n.prototype)&&o!==r.prototype&&fr(t,o),t},is=w((function(t){var e=Ze.f,r=Ai.forEach,n=fe.get,o=fe.set,i=fe.enforce,a=Gt.f,u=je.f,s=Math.round,c=S.RangeError,f=Zu.ArrayBuffer,l=f.prototype,h=Zu.DataView,p=Ya.NATIVE_ARRAY_BUFFER_VIEWS,v=Ya.TYPED_ARRAY_TAG,d=Ya.TypedArray,y=Ya.TypedArrayPrototype,g=Ya.aTypedArrayConstructor,m=Ya.isTypedArray,b=function(t,e){g(t);for(var r=0,n=e.length,o=new t(n);n>r;)o[r]=e[r++];return o},x=function(t,e){vr(t,e,{configurable:!0,get:function(){return n(this)[e]}})},w=function(t){var e;return kt(l,t)||"ArrayBuffer"==(e=be(t))||"SharedArrayBuffer"==e},E=function(t,e){return m(t)&&!jt(e)&&e in t&&$u(+e)&&e>=0},A=function(t,e){return e=Wt(e),E(t,e)?ee(2,t[e]):u(t,e)},O=function(t,e,r){return e=Wt(e),!(E(t,e)&&vt(r)&&U(r,"value"))||U(r,"get")||U(r,"set")||r.configurable||U(r,"writable")&&!r.writable||U(r,"enumerable")&&!r.enumerable?a(t,e,r):(t[e]=r.value,t)};ht?(p||(je.f=A,Gt.f=O,x(y,"buffer"),x(y,"byteOffset"),x(y,"byteLength"),x(y,"length")),ar({target:"Object",stat:!0,forced:!p},{getOwnPropertyDescriptor:A,defineProperty:O}),t.exports=function(t,u,l){var g=t.match(/\\d+/)[0]/8,x=t+(l?"Clamped":"")+"Array",E="get"+t,A="set"+t,O=S[x],T=O,k=T&&T.prototype,I={},j=function(t,e){a(t,e,{get:function(){return function(t,e){var r=n(t);return r.view[E](e*g+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,r){var o=n(t);l&&(r=(r=s(r))<0?0:r>255?255:255&r),o.view[A](e*g+o.byteOffset,r,!0)}(this,e,t)},enumerable:!0})};p?Xa&&(T=u((function(t,e,r,n){return mr(t,k),os(vt(e)?w(e)?void 0!==n?new O(e,Xu(r,g),n):void 0!==r?new O(e,Xu(r,g)):new O(e):m(e)?b(T,e):Ot(ns,T,e):new O(eu(e)),t,T)})),fr&&fr(T,d),r(e(O),(function(t){t in T||re(T,t,O[t])})),T.prototype=k):(T=u((function(t,e,r,n){mr(t,k);var i,a,u,s=0,l=0;if(vt(e)){if(!w(e))return m(e)?b(T,e):Ot(ns,T,e);i=e,l=Xu(r,g);var p=e.byteLength;if(void 0===n){if(p%g)throw c("Wrong length");if((a=p-l)<0)throw c("Wrong length")}else if((a=Fe(n)*g)+l>p)throw c("Wrong length");u=a/g}else u=eu(e),i=new f(a=u*g);for(o(t,{buffer:i,byteOffset:l,byteLength:a,length:u,view:new h(i)});s<u;)j(t,s++)})),fr&&fr(T,d),k=T.prototype=$i(y)),k.constructor!==T&&re(k,"constructor",T),i(k).TypedArrayConstructor=T,v&&re(k,v,x);var P=T!=O;I[x]=T,ar({global:!0,constructor:!0,forced:P,sham:!p},I),"BYTES_PER_ELEMENT"in T||re(T,"BYTES_PER_ELEMENT",g),"BYTES_PER_ELEMENT"in k||re(k,"BYTES_PER_ELEMENT",g),yr(x)}):t.exports=function(){}}));is("Uint8",(function(t){return function(e,r,n){return t(this,e,r,n)}}),!0);var as=TypeError,us=function(t,e){if(!delete t[e])throw as("Cannot delete property "+_t(e)+" of "+_t(t))},ss=Math.min,cs=N([].copyWithin||function(t,e){var r=z(this),n=We(r),o=Ce(t,n),i=Ce(e,n),a=arguments.length>2?arguments[2]:void 0,u=ss((void 0===a?n:Ce(a,n))-i,n-o),s=1;for(i<o&&o<i+u&&(s=-1,i+=u-1,o+=u-1);u-- >0;)i in r?r[o]=r[i]:us(r,o),o+=s,i+=s;return r}),fs=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("copyWithin",(function(t,e){return cs(fs(this),t,e,arguments.length>2?arguments[2]:void 0)}));var ls=Ai.every,hs=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("every",(function(t){return ls(hs(this),t,arguments.length>1?arguments[1]:void 0)}));var ps=Ya.aTypedArray,vs=Ya.exportTypedArrayMethod,ds=N("".slice);vs("fill",(function(t){var e=arguments.length;ps(this);var r="Big"===ds(be(this),0,3)?es(t):+t;return Ot(fu,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),P((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})));var ys=Ya.aTypedArrayConstructor,gs=Ya.getTypedArrayConstructor,ms=function(t){return ys(Nr(t,gs(t)))},bs=function(t,e){return function(t,e){for(var r=0,n=We(e),o=new t(n);n>r;)o[r]=e[r++];return o}(ms(t),e)},xs=Ai.filter,ws=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("filter",(function(t){var e=xs(ws(this),t,arguments.length>1?arguments[1]:void 0);return bs(this,e)}));var Es=Ai.find,As=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("find",(function(t){return Es(As(this),t,arguments.length>1?arguments[1]:void 0)}));var Os=Ai.findIndex,Ss=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("findIndex",(function(t){return Os(Ss(this),t,arguments.length>1?arguments[1]:void 0)}));var Ts=Ai.forEach,ks=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("forEach",(function(t){Ts(ks(this),t,arguments.length>1?arguments[1]:void 0)}));var Is=Be.includes,js=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("includes",(function(t){return Is(js(this),t,arguments.length>1?arguments[1]:void 0)}));var Ps=Be.indexOf,_s=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("indexOf",(function(t){return Ps(_s(this),t,arguments.length>1?arguments[1]:void 0)}));var Ms=it("iterator"),Ls=S.Uint8Array,Rs=N(Oa.values),Ns=N(Oa.keys),Cs=N(Oa.entries),Ds=Ya.aTypedArray,Fs=Ya.exportTypedArrayMethod,Ws=Ls&&Ls.prototype,zs=!P((function(){Ws[Ms].call([1])})),Bs=!!Ws&&Ws.values&&Ws[Ms]===Ws.values&&"values"===Ws.values.name,Us=function(){return Rs(Ds(this))};Fs("entries",(function(){return Cs(Ds(this))}),zs),Fs("keys",(function(){return Ns(Ds(this))}),zs),Fs("values",Us,zs||!Bs,{name:"values"}),Fs(Ms,Us,zs||!Bs,{name:"values"});var Gs=Ya.aTypedArray,Vs=Ya.exportTypedArrayMethod,Hs=N([].join);Vs("join",(function(t){return Hs(Gs(this),t)}));var qs=Math.min,Zs=[].lastIndexOf,Ys=!!Zs&&1/[1].lastIndexOf(1,-0)<0,$s=Oi("lastIndexOf"),Ks=Ys||!$s?function(t){if(Ys)return Wr(Zs,this,arguments)||0;var e=ke(this),r=We(e),n=r-1;for(arguments.length>1&&(n=qs(n,Le(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:Zs,Qs=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return Wr(Ks,Qs(this),e>1?[t,arguments[1]]:[t])}));var Xs=Ai.map,Js=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("map",(function(t){return Xs(Js(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(ms(t))(e)}))}));var tc=TypeError,ec=function(t){return function(e,r,n,o){Lt(r);var i=z(e),a=Te(i),u=We(i),s=t?u-1:0,c=t?-1:1;if(n<2)for(;;){if(s in a){o=a[s],s+=c;break}if(s+=c,t?s<0:u<=s)throw tc("Reduce of empty array with no initial value")}for(;t?s>=0:u>s;s+=c)s in a&&(o=r(o,a[s],s,i));return o}},rc={left:ec(!1),right:ec(!0)},nc=rc.left,oc=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return nc(oc(this),t,e,e>1?arguments[1]:void 0)}));var ic=rc.right,ac=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return ic(ac(this),t,e,e>1?arguments[1]:void 0)}));var uc=Ya.aTypedArray,sc=Ya.exportTypedArrayMethod,cc=Math.floor;sc("reverse",(function(){for(var t,e=uc(this).length,r=cc(e/2),n=0;n<r;)t=this[n],this[n++]=this[--e],this[e]=t;return this}));var fc=S.RangeError,lc=S.Int8Array,hc=lc&&lc.prototype,pc=hc&&hc.set,vc=Ya.aTypedArray,dc=Ya.exportTypedArrayMethod,yc=!P((function(){var t=new Uint8ClampedArray(2);return Ot(pc,t,{length:1,0:3},1),3!==t[1]})),gc=yc&&Ya.NATIVE_ARRAY_BUFFER_VIEWS&&P((function(){var t=new lc(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));dc("set",(function(t){vc(this);var e=Xu(arguments.length>1?arguments[1]:void 0,1),r=z(t);if(yc)return Ot(pc,this,r,e);var n=this.length,o=We(r),i=0;if(o+e>n)throw fc("Wrong length");for(;i<o;)this[e+i]=r[i++]}),!yc||gc);var mc=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("slice",(function(t,e){for(var r=Vr(mc(this),t,e),n=ms(this),o=0,i=r.length,a=new n(i);i>o;)a[o]=r[o++];return a}),P((function(){new Int8Array(1).slice()})));var bc=Ai.some,xc=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("some",(function(t){return bc(xc(this),t,arguments.length>1?arguments[1]:void 0)}));var wc=Math.floor,Ec=function(t,e){var r=t.length,n=wc(r/2);return r<8?Ac(t,e):Oc(t,Ec(pu(t,0,n),e),Ec(pu(t,n),e),e)},Ac=function(t,e){for(var r,n,o=t.length,i=1;i<o;){for(n=i,r=t[i];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==i++&&(t[n]=r)}return t},Oc=function(t,e,r,n){for(var o=e.length,i=r.length,a=0,u=0;a<o||u<i;)t[a+u]=a<o&&u<i?n(e[a],r[u])<=0?e[a++]:r[u++]:a<o?e[a++]:r[u++];return t},Sc=Ec,Tc=Z.match(/firefox\\/(\\d+)/i),kc=!!Tc&&+Tc[1],Ic=/MSIE|Trident/.test(Z),jc=Z.match(/AppleWebKit\\/(\\d+)\\./),Pc=!!jc&&+jc[1],_c=Ya.aTypedArray,Mc=Ya.exportTypedArrayMethod,Lc=S.Uint16Array,Rc=Lc&&zr(Lc.prototype.sort),Nc=!(!Rc||P((function(){Rc(new Lc(2),null)}))&&P((function(){Rc(new Lc(2),{})}))),Cc=!!Rc&&!P((function(){if(X)return X<74;if(kc)return kc<67;if(Ic)return!0;if(Pc)return Pc<602;var t,e,r=new Lc(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(Rc(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));Mc("sort",(function(t){return void 0!==t&&Lt(t),Cc?Rc(this,t):Sc(_c(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!Cc||Nc);var Dc=Ya.aTypedArray;(0,Ya.exportTypedArrayMethod)("subarray",(function(t,e){var r=Dc(this),n=r.length,o=Ce(t,n);return new(ms(r))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,Fe((void 0===e?n:Ce(e,n))-o))}));var Fc=S.Int8Array,Wc=Ya.aTypedArray,zc=Ya.exportTypedArrayMethod,Bc=[].toLocaleString,Uc=!!Fc&&P((function(){Bc.call(new Fc(1))}));zc("toLocaleString",(function(){return Wr(Bc,Uc?Vr(Wc(this)):Wc(this),Vr(arguments))}),P((function(){return[1,2].toLocaleString()!=new Fc([1,2]).toLocaleString()}))||!P((function(){Fc.prototype.toLocaleString.call([1,2])})));var Gc=Ya.exportTypedArrayMethod,Vc=S.Uint8Array,Hc=Vc&&Vc.prototype||{},qc=[].toString,Zc=N([].join);P((function(){qc.call({})}))&&(qc=function(){return Zc(this)});var Yc=Hc.toString!=qc;Gc("toString",qc,Yc),ar({target:"Array",proto:!0},{fill:fu}),ra("fill");var $c,Kc,Qc=String,Xc=function(t){if("Symbol"===be(t))throw TypeError("Cannot convert a Symbol value to a string");return Qc(t)},Jc=function(){var t=Et(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},tf=S.RegExp,ef=P((function(){var t=tf("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),rf=ef||P((function(){return!tf("a","y").sticky})),nf={BROKEN_CARET:ef||P((function(){var t=tf("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:rf,UNSUPPORTED_Y:ef},of=S.RegExp,af=P((function(){var t=of(".","s");return!(t.dotAll&&t.exec("\\n")&&"s"===t.flags)})),uf=S.RegExp,sf=P((function(){var t=uf("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),cf=fe.get,ff=j("native-string-replace",String.prototype.replace),lf=RegExp.prototype.exec,hf=lf,pf=N("".charAt),vf=N("".indexOf),df=N("".replace),yf=N("".slice),gf=(Kc=/b*/g,Ot(lf,$c=/a/,"a"),Ot(lf,Kc,"a"),0!==$c.lastIndex||0!==Kc.lastIndex),mf=nf.BROKEN_CARET,bf=void 0!==/()??/.exec("")[1];(gf||bf||mf||af||sf)&&(hf=function(t){var e,r,n,o,i,a,u,s=this,c=cf(s),f=Xc(t),l=c.raw;if(l)return l.lastIndex=s.lastIndex,e=Ot(hf,l,f),s.lastIndex=l.lastIndex,e;var h=c.groups,p=mf&&s.sticky,v=Ot(Jc,s),d=s.source,y=0,g=f;if(p&&(v=df(v,"y",""),-1===vf(v,"g")&&(v+="g"),g=yf(f,s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\\n"!==pf(f,s.lastIndex-1))&&(d="(?: "+d+")",g=" "+g,y++),r=new RegExp("^(?:"+d+")",v)),bf&&(r=new RegExp("^"+d+"$(?!\\\\s)",v)),gf&&(n=s.lastIndex),o=Ot(lf,p?r:s,g),p?o?(o.input=yf(o.input,y),o[0]=yf(o[0],y),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:gf&&o&&(s.lastIndex=s.global?o.index+o[0].length:n),bf&&o&&o.length>1&&Ot(ff,o[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&h)for(o.groups=a=$i(null),i=0;i<h.length;i++)a[(u=h[i])[0]]=o[u[1]];return o});var xf=hf;ar({target:"RegExp",proto:!0,forced:/./.exec!==xf},{exec:xf});var wf,Ef=it("species"),Af=RegExp.prototype,Of=function(t,e,r,n){var o=it(t),i=!P((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),a=i&&!P((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[Ef]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return e=!0,null},r[o](""),!e}));if(!i||!a||r){var u=zr(/./[o]),s=e(o,""[t],(function(t,e,r,n,o){var a=zr(t),s=e.exec;return s===xf||s===Af.exec?i&&!o?{done:!0,value:u(e,r,n)}:{done:!0,value:a(r,e,n)}:{done:!1}}));he(String.prototype,t,s[0]),he(Af,o,s[1])}n&&re(Af[o],"sham",!0)},Sf=N("".charAt),Tf=N("".charCodeAt),kf=N("".slice),If=function(t){return function(e,r){var n,o,i=Xc(F(e)),a=Le(r),u=i.length;return a<0||a>=u?t?"":void 0:(n=Tf(i,a))<55296||n>56319||a+1===u||(o=Tf(i,a+1))<56320||o>57343?t?Sf(i,a):n:t?kf(i,a,a+2):o-56320+(n-55296<<10)+65536}},jf={codeAt:If(!1),charAt:If(!0)},Pf=jf.charAt,_f=function(t,e,r){return e+(r?Pf(t,e).length:1)},Mf=Math.floor,Lf=N("".charAt),Rf=N("".replace),Nf=N("".slice),Cf=/\\$([$&\'`]|\\d{1,2}|<[^>]*>)/g,Df=/\\$([$&\'`]|\\d{1,2})/g,Ff=function(t,e,r,n,o,i){var a=r+t.length,u=n.length,s=Df;return void 0!==o&&(o=z(o),s=Cf),Rf(i,s,(function(i,s){var c;switch(Lf(s,0)){case"$":return"$";case"&":return t;case"`":return Nf(e,0,r);case"\'":return Nf(e,a);case"<":c=o[Nf(s,1,-1)];break;default:var f=+s;if(0===f)return i;if(f>u){var l=Mf(f/10);return 0===l?i:l<=u?void 0===n[l-1]?Lf(s,1):n[l-1]+Lf(s,1):i}c=n[f-1]}return void 0===c?"":c}))},Wf=TypeError,zf=function(t,e){var r=t.exec;if(lt(r)){var n=Ot(r,t,e);return null!==n&&Et(n),n}if("RegExp"===de(t))return Ot(xf,t,e);throw Wf("RegExp#exec called on incompatible receiver")},Bf=it("replace"),Uf=Math.max,Gf=Math.min,Vf=N([].concat),Hf=N([].push),qf=N("".indexOf),Zf=N("".slice),Yf="$0"==="a".replace(/./,"$0"),$f=!!/./[Bf]&&""===/./[Bf]("a","$0");function Kf(t){this.message=t}Of("replace",(function(t,e,r){var n=$f?"$":"$0";return[function(t,r){var n=F(this),o=C(t)?void 0:Rt(t,Bf);return o?Ot(o,t,n,r):Ot(e,Xc(n),t,r)},function(t,o){var i=Et(this),a=Xc(t);if("string"==typeof o&&-1===qf(o,n)&&-1===qf(o,"$<")){var u=r(e,i,a,o);if(u.done)return u.value}var s=lt(o);s||(o=Xc(o));var c=i.global;if(c){var f=i.unicode;i.lastIndex=0}for(var l=[];;){var h=zf(i,a);if(null===h)break;if(Hf(l,h),!c)break;""===Xc(h[0])&&(i.lastIndex=_f(a,Fe(i.lastIndex),f))}for(var p,v="",d=0,y=0;y<l.length;y++){for(var g=Xc((h=l[y])[0]),m=Uf(Gf(Le(h.index),a.length),0),b=[],x=1;x<h.length;x++)Hf(b,void 0===(p=h[x])?p:String(p));var w=h.groups;if(s){var E=Vf([g],b,m,a);void 0!==w&&Hf(E,w);var A=Xc(Wr(o,void 0,E))}else A=Ff(g,a,m,b,w,o);m>=d&&(v+=Zf(a,d,m)+A,d=m+g.length)}return v+Zf(a,d)}]}),!!P((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!Yf||$f),Kf.prototype=new Error,Kf.prototype.name="InvalidCharacterError",ar({global:!0,forced:S.globalThis!==S},{globalThis:S}),wf="undefined"==typeof window?{devicePixelRatio:1,navigator:{userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",browserLanguage:"zh-CN",language:"zh-CN",platform:""},location:"",document:{documentElement:{style:{}},createEvent:function(){return!0},getElementById:function(t){return!0},createElement:function(){return{className:"",classList:{add:function(){return""}}}},createElementNS:function(){return!0},addEventListener:function(){return!0},removeEventListener:function(){return!0},querySelector:function(){return!1}},performance:{mark:function(t){return null},clearMeasures:function(t){return null},clearMarks:function(t){return null},measure:function(t,e,r){return{duration:0}},now:function(){return(new Date).getTime()}},Blob:"",dispatchEvent:function(t){return!0},Event:function(t,e){return!0},createElement:function(){return!0},createElementNS:function(){return!0},XMLHttpRequest:function(){return!0},addEventListener:function(){return!0},removeEventListener:function(){return!0},requestAnimationFrame:function(){return!0},cancelAnimationFrame:function(){return!0},clearTimeout:function(){return!0}}:window,"undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM?my.getSystemInfoSync().pixelRatio:wf.devicePixelRatio;var Qf=TypeError,Xf=Object.getOwnPropertyDescriptor,Jf=ht&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(gi(t)&&!Xf(t,"length").writable)throw Qf("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},tl=TypeError,el=function(t){if(t>9007199254740991)throw tl("Maximum allowed index exceeded");return t},rl=_i("splice"),nl=Math.max,ol=Math.min;ar({target:"Array",proto:!0,forced:!rl},{splice:function(t,e){var r,n,o,i,a,u,s=z(this),c=We(s),f=Ce(t,c),l=arguments.length;for(0===l?r=n=0:1===l?(r=0,n=c-f):(r=l-2,n=ol(nl(Le(e),0),c-f)),el(c+r-n),o=xi(s,n),i=0;i<n;i++)(a=f+i)in s&&ji(o,i,s[a]);if(o.length=n,r<n){for(i=f;i<c-n;i++)u=i+r,(a=i+n)in s?s[u]=s[a]:us(s,u);for(i=c;i>c-n+r;i--)us(s,i-1)}else if(r>n)for(i=c-n;i>f;i--)u=i+r-1,(a=i+n-1)in s?s[u]=s[a]:us(s,u);for(i=0;i<r;i++)s[i+f]=arguments[i+2];return Jf(s,c-n+r),o}});var il=u((function t(e,r){i(this,t),s(this,"cancelBubble",void 0),s(this,"cancelable",void 0),s(this,"target",void 0),s(this,"currentTarget",void 0),s(this,"preventDefault",void 0),s(this,"stopPropagation",void 0),s(this,"type",void 0),s(this,"timeStamp",void 0),this.cancelBubble=!1,this.cancelable=!1,this.target=null,this.currentTarget=null,this.preventDefault=function(){},this.stopPropagation=function(){},this.type=e,this.timeStamp=Date.now()})),al=Object.assign,ul=Object.defineProperty,sl=N([].concat),cl=!al||P((function(){if(ht&&1!==al({b:1},al(ul({},"a",{enumerable:!0,get:function(){ul(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol();return t[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=al({},t)[r]||"abcdefghijklmnopqrst"!=Ui(al({},e)).join("")}))?function(t,e){for(var r=z(t),n=arguments.length,o=1,i=Ye.f,a=Ae.f;n>o;)for(var u,s=Te(arguments[o++]),c=i?sl(Ui(s),i(s)):Ui(s),f=c.length,l=0;f>l;)u=c[l++],ht&&!Ot(a,s,u)||(r[u]=s[u]);return r}:al;ar({target:"Object",stat:!0,arity:2,forced:Object.assign!==cl},{assign:cl});var fl=Ai.findIndex,ll=!0;"findIndex"in[]&&Array(1).findIndex((function(){ll=!1})),ar({target:"Array",proto:!0,forced:ll},{findIndex:function(t){return fl(this,t,arguments.length>1?arguments[1]:void 0)}}),ra("findIndex");var hl=jf.charAt,pl=fe.set,vl=fe.getterFor("String Iterator");ba(String,"String",(function(t){pl(this,{type:"String Iterator",string:Xc(t),index:0})}),(function(){var t,e=vl(this),r=e.string,n=e.index;return n>=r.length?xa(void 0,!0):(t=hl(r,n),e.index+=t.length,xa(t,!1))}));var dl=!P((function(){return Object.isExtensible(Object.preventExtensions({}))})),yl=Ze.f,gl="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],ml={f:function(t){return gl&&"Window"==de(t)?function(t){try{return yl(t)}catch(t){return pu(gl)}}(t):yl(ke(t))}},bl=P((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),xl=Object.isExtensible,wl=P((function(){xl(1)}))||bl?function(t){return!!vt(t)&&((!bl||"ArrayBuffer"!=de(t))&&(!xl||xl(t)))}:xl,El=w((function(t){var e=Gt.f,r=!1,n=q("meta"),o=0,i=function(t){e(t,n,{value:{objectID:"O"+o++,weakData:{}}})},a=t.exports={enable:function(){a.enable=function(){},r=!0;var t=Ze.f,e=N([].splice),o={};o[n]=1,t(o).length&&(Ze.f=function(r){for(var o=t(r),i=0,a=o.length;i<a;i++)if(o[i]===n){e(o,i,1);break}return o},ar({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:ml.f}))},fastKey:function(t,e){if(!vt(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!U(t,n)){if(!wl(t))return"F";if(!e)return"E";i(t)}return t[n].objectID},getWeakData:function(t,e){if(!U(t,n)){if(!wl(t))return!0;if(!e)return!1;i(t)}return t[n].weakData},onFreeze:function(t){return dl&&r&&wl(t)&&!U(t,n)&&i(t),t}};ie[n]=!0})),Al=(El.enable,El.fastKey,El.getWeakData,El.onFreeze,function(t,e,r){var n=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=n?"set":"add",a=S[t],u=a&&a.prototype,s=a,c={},f=function(t){var e=N(u[t]);he(u,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!vt(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return o&&!vt(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!vt(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(or(t,!lt(a)||!(o||u.forEach&&!P((function(){(new a).entries().next()})))))s=r.getConstructor(e,t,n,i),El.enable();else if(or(t,!0)){var l=new s,h=l[i](o?{}:-0,1)!=l,p=P((function(){l.has(1)})),v=Mo((function(t){new a(t)})),d=!o&&P((function(){for(var t=new a,e=5;e--;)t[i](e,e);return!t.has(-0)}));v||((s=e((function(t,e){mr(t,u);var r=os(new a,t,s);return C(e)||ko(e,r[i],{that:r,AS_ENTRIES:n}),r}))).prototype=u,u.constructor=s),(p||d)&&(f("delete"),f("has"),n&&f("get")),(d||h)&&f(i),o&&u.clear&&delete u.clear}return c[t]=s,ar({global:!0,constructor:!0,forced:s!=a},c),pr(s,t),o||r.setStrong(s,t,n),s}),Ol=El.getWeakData,Sl=fe.set,Tl=fe.getterFor,kl=Ai.find,Il=Ai.findIndex,jl=N([].splice),Pl=0,_l=function(t){return t.frozen||(t.frozen=new Ml)},Ml=function(){this.entries=[]},Ll=function(t,e){return kl(t.entries,(function(t){return t[0]===e}))};Ml.prototype={get:function(t){var e=Ll(this,t);if(e)return e[1]},has:function(t){return!!Ll(this,t)},set:function(t,e){var r=Ll(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=Il(this.entries,(function(e){return e[0]===t}));return~e&&jl(this.entries,e,1),!!~e}};var Rl,Nl={getConstructor:function(t,e,r,n){var o=t((function(t,o){mr(t,i),Sl(t,{type:e,id:Pl++,frozen:void 0}),C(o)||ko(o,t[n],{that:t,AS_ENTRIES:r})})),i=o.prototype,a=Tl(e),u=function(t,e,r){var n=a(t),o=Ol(Et(e),!0);return!0===o?_l(n).set(e,r):o[n.id]=r,t};return Ja(i,{delete:function(t){var e=a(this);if(!vt(t))return!1;var r=Ol(t);return!0===r?_l(e).delete(t):r&&U(r,e.id)&&delete r[e.id]},has:function(t){var e=a(this);if(!vt(t))return!1;var r=Ol(t);return!0===r?_l(e).has(t):r&&U(r,e.id)}}),Ja(i,r?{get:function(t){var e=a(this);if(vt(t)){var r=Ol(t);return!0===r?_l(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return u(this,t,e)}}:{add:function(t){return u(this,t,!0)}}),o}},Cl=fe.enforce,Dl=Object,Fl=Array.isArray,Wl=Dl.isExtensible,zl=Dl.isFrozen,Bl=Dl.isSealed,Ul=Dl.freeze,Gl=Dl.seal,Vl={},Hl={},ql=!S.ActiveXObject&&"ActiveXObject"in S,Zl=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Yl=Al("WeakMap",Zl,Nl),$l=Yl.prototype,Kl=N($l.set);if(te)if(ql){Rl=Nl.getConstructor(Zl,"WeakMap",!0),El.enable();var Ql=N($l.delete),Xl=N($l.has),Jl=N($l.get);Ja($l,{delete:function(t){if(vt(t)&&!Wl(t)){var e=Cl(this);return e.frozen||(e.frozen=new Rl),Ql(this,t)||e.frozen.delete(t)}return Ql(this,t)},has:function(t){if(vt(t)&&!Wl(t)){var e=Cl(this);return e.frozen||(e.frozen=new Rl),Xl(this,t)||e.frozen.has(t)}return Xl(this,t)},get:function(t){if(vt(t)&&!Wl(t)){var e=Cl(this);return e.frozen||(e.frozen=new Rl),Xl(this,t)?Jl(this,t):e.frozen.get(t)}return Jl(this,t)},set:function(t,e){if(vt(t)&&!Wl(t)){var r=Cl(this);r.frozen||(r.frozen=new Rl),Xl(this,t)?Kl(this,t,e):r.frozen.set(t,e)}else Kl(this,t,e);return this}})}else dl&&P((function(){var t=Ul([]);return Kl(new Yl,t,1),!zl(t)}))&&Ja($l,{set:function(t,e){var r;return Fl(t)&&(zl(t)?r=Vl:Bl(t)&&(r=Hl)),Kl(this,t,e),r==Vl&&Ul(t),r==Hl&&Gl(t),this}});var th=it("iterator"),eh=it("toStringTag"),rh=Oa.values,nh=function(t,e){if(t){if(t[th]!==rh)try{re(t,th,rh)}catch(e){t[th]=rh}if(t[eh]||re(t,eh,e),pi[e])for(var r in Oa)if(t[r]!==Oa[r])try{re(t,r,Oa[r])}catch(e){t[r]=Oa[r]}}};for(var oh in pi)nh(S[oh]&&S[oh].prototype,oh);nh(yi,"DOMTokenList");var ih,ah,uh,sh,ch=new WeakMap,fh=function(){function t(){i(this,t),ch.set(this,{})}return u(t,[{key:"addEventListener",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ch.get(this);n||(n={}),n[t]||(n[t]=[]),n[t].push(e),ch.set(this,n),r.capture,r.once,r.passive}},{key:"removeEventListener",value:function(t,e){var r=ch.get(this);if(r){var n=r[t];if(n&&n.length>0)for(var o=n.length;o--;o>0)if(n[o]===e){n.splice(o,1);break}}}},{key:"dispatchEvent",value:function(t){var e=ch.get(this)[t.type];if(e){var r,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=g(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(t){n.e(t)}finally{n.f()}}}}]),t}(),lh=function(t){c(r,t);var e=v(r);function r(){var t;return i(this,r),s(h(t=e.call(this)),"className",void 0),s(h(t),"children",void 0),t.className="",t.children=[],t}return u(r,[{key:"setAttribute",value:function(t,e){this[t]=e}},{key:"getAttribute",value:function(t){return this[t]}},{key:"setAttributeNS",value:function(t,e){this[t]=e}},{key:"getAttributeNS",value:function(t){return this[t]}}]),r}(function(t){c(r,t);var e=v(r);function r(){var t;return i(this,r),s(h(t=e.call(this)),"childNodes",void 0),t.childNodes=[],t}return u(r,[{key:"appendChild",value:function(t){this.childNodes.push(t)}},{key:"cloneNode",value:function(){var t=Object.create(this);return Object.assign(t,this),t}},{key:"removeChild",value:function(t){var e=this.childNodes.findIndex((function(e){return e===t}));return e>-1?this.childNodes.splice(e,1):null}}]),r}(fh));if("undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM){var hh=my.getSystemInfoSync();ih=hh.screenWidth,ah=hh.screenHeight,uh=hh.windowWidth,sh=hh.windowHeight}else{var ph=wf.innerWidth,vh=wf.innerHeight;ih=ph,ah=vh,uh=ph,sh=vh}var dh={width:ih,height:ah,availWidth:uh,availHeight:sh,availLeft:0,availTop:0},yh=dh.availWidth,gh=dh.availHeight,mh={style:[]};function bh(t,e){var r,n;"parentNode"in t||(r=0===e?function(){return null}:1===e?function(){return mh}:function(){return null},Object.defineProperty(t,"parentNode",{enumerable:!0,get:r}));"parentElement"in t||(n=0===e?function(){return null}:1===e?function(){return mh}:function(){return null},Object.defineProperty(t,"parentElement",{enumerable:!0,get:n}))}function xh(t){t.style=t.style||{},Object.assign(t.style,{top:"0px",left:"0px",width:yh+"px",height:gh+"px",margin:"0px",padding:"0px"})}function wh(t){"clientLeft"in t||(t.clientLeft=0,t.clientTop=0),"clientWidth"in t||(t.clientWidth=yh,t.clientHeight=gh),"getBoundingClientRect"in t||(t.getBoundingClientRect=function(){return{x:0,y:0,top:0,left:0,width:this.clientWidth,height:this.clientHeight,right:this.clientWidth,bottom:this.clientHeight}})}function Eh(t){"offsetLeft"in t||(t.offsetLeft=0,t.offsetTop=0),"offsetWidth"in t||(t.offsetWidth=yh,t.offsetHeight=gh)}function Ah(t){"scrollLeft"in t||(t.scrollLeft=0,t.scrollTop=0),"scrollWidth"in t||(t.scrollWidth=yh,t.scrollHeight=gh)}function Oh(t){var e=function(){return!0};t.classList=[],t.classList.add=e,t.classList.remove=e,t.classList.contains=e,t.classList.toggle=e}function Sh(){}var Th=function(t){c(r,t);var e=v(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;return i(this,r),s(h(t=e.call(this)),"className",void 0),s(h(t),"children",void 0),s(h(t),"focus",void 0),s(h(t),"blur",void 0),s(h(t),"insertBefore",void 0),s(h(t),"appendChild",void 0),s(h(t),"removeChild",void 0),s(h(t),"remove",void 0),s(h(t),"innerHTML",void 0),s(h(t),"tagName",void 0),t.className="",t.children=[],t.focus=Sh,t.blur=Sh,t.insertBefore=Sh,t.appendChild=Sh,t.removeChild=Sh,t.remove=Sh,t.innerHTML="",t.tagName=n.toUpperCase(),bh(h(t),o),xh(h(t)),Oh(h(t)),wh(h(t)),Eh(h(t)),Ah(h(t)),t}return u(r)}(lh),kh=function(t){c(r,t);var e=v(r);function r(){return i(this,r),e.call(this,"video")}return u(r)}(function(t){c(r,t);var e=v(r);function r(t){return i(this,r),e.call(this,t)}return u(r,[{key:"addTextTrack",value:function(){}},{key:"captureStream",value:function(){}},{key:"fastSeek",value:function(){}},{key:"load",value:function(){}},{key:"pause",value:function(){}},{key:"play",value:function(){}}]),r}(Th)),Ih={};function jh(){return Ih}var Ph=u((function t(){i(this,t);var e=jh(),r=e.createImage&&e.createImage()||{};return"tagName"in r||(r.tagName="IMG",r.__proto__=t.prototype),bh(r),Oh(r),Object.assign(r,{addEventListener:function(t,e){r["on".concat(t)]=e.bind(r)},removeEventListener:function(t){r["on".concat(t)]=null}}),r})),_h={href:"",protocol:"",host:""},Mh=function(t){c(r,t);var e=v(r);function r(){return i(this,r),e.call(this,"body",0)}return u(r,[{key:"addEventListener",value:function(t,e){}},{key:"removeEventListener",value:function(t,e,r){}},{key:"dispatchEvent",value:function(t){}}]),r}(Th),Lh=function(t){c(r,t);var e=v(r);function r(){return i(this,r),e.call(this,"html",0)}return u(r,[{key:"addEventListener",value:function(t,e){}},{key:"removeEventListener",value:function(t,e){}},{key:"dispatchEvent",value:function(t){}}]),r}(Th),Rh={},Nh={readyState:"complete",visibilityState:"visible",hidden:!1,fullscreen:!0,scripts:[],style:{},location:_h,ontouchstart:null,ontouchmove:null,ontouchend:null,onvisibilitychange:null,parentNode:null,parentElement:null,head:null,body:null,documentElement:{style:[]},createElement:function(t){return"canvas"===(t=t.toLowerCase())?my.createOffscreenCanvas(1024,128,"2d"):"img"===t?new Ph:"video"===t?new kh:new Th(t)},createElementNS:function(t,e){return this.createElement(e)},createTextNode:function(t){return t},getElementById:function(t){return null},getElementsByTagName:function(t){return t=t.toLowerCase(),[]},getElementsByTagNameNS:function(t,e){return this.getElementsByTagName(e)},getElementsByName:function(t){return[]},querySelector:function(t){return null},querySelectorAll:function(t){return[]},addEventListener:function(t,e,r){Rh[t]||(Rh[t]=[]),Rh[t].push(e)},removeEventListener:function(t,e){var r=Rh[t];if(r&&r.length>0)for(var n=r.length;n--;n>0)if(r[n]===e){r.splice(n,1);break}},dispatchEvent:function(t){var e=t.type,r=Rh[e];if(r)for(var n=0;n<r.length;n++)r[n](t);t.target&&"function"==typeof t.target["on"+e]&&t.target["on"+e](t)},createEvent:function(t){return new il(t)}};Nh.documentElement=new Lh,Nh.head=new Th("head"),Nh.body=new Mh,Of("match",(function(t,e,r){return[function(e){var r=F(this),n=C(e)?void 0:Rt(e,t);return n?Ot(n,e,r):new RegExp(e)[t](Xc(r))},function(t){var n=Et(this),o=Xc(t),i=r(e,n,o);if(i.done)return i.value;if(!n.global)return zf(n,o);var a=n.unicode;n.lastIndex=0;for(var u,s=[],c=0;null!==(u=zf(n,o));){var f=Xc(u[0]);s[c]=f,""===f&&(n.lastIndex=_f(o,Fe(n.lastIndex),a)),c++}return 0===c?null:s}]}));var Ch,Dh,Fh=it("isConcatSpreadable"),Wh=X>=51||!P((function(){var t=[];return t[Fh]=!1,t.concat()[0]!==t})),zh=function(t){if(!vt(t))return!1;var e=t[Fh];return void 0!==e?!!e:gi(t)},Bh=!Wh||!_i("concat");if(ar({target:"Array",proto:!0,arity:1,forced:Bh},{concat:function(t){var e,r,n,o,i,a=z(this),u=xi(a,0),s=0;for(e=-1,n=arguments.length;e<n;e++)if(zh(i=-1===e?a:arguments[e]))for(o=We(i),el(s+o),r=0;r<o;r++,s++)r in i&&ji(u,s,i[r]);else el(s+1),ji(u,s++,i);return u.length=s,u}}),"undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM){var Uh=my.getSystemInfoSync();Ch=Uh.system,Uh.platform,Uh.language}else{var Gh={versions:(Dh=wf.navigator.userAgent,{trident:Dh.indexOf("Trident")>-1,presto:Dh.indexOf("Presto")>-1,webKit:Dh.indexOf("AppleWebKit")>-1,gecko:Dh.indexOf("Gecko")>-1&&-1===Dh.indexOf("KHTML"),mobile:!!Dh.match(/AppleWebKit.*Mobile.*/),ios:!!Dh.match(/\\(i[^;]+;( U;)? CPU.+Mac OS X/),android:Dh.indexOf("Android")>-1||Dh.indexOf("Linux")>-1,iPhone:Dh.indexOf("iPhone")>-1,iPad:Dh.indexOf("iPad")>-1,webApp:-1===Dh.indexOf("Safari"),weixin:Dh.indexOf("MicroMessenger")>-1,qq:" qq"===Dh.match(/\\sQQ/i)}),language:(wf.navigator.browserLanguage||wf.navigator.language).toLowerCase()};Gh.versions.android?"android":Gh.versions.trident?"IE":Gh.versions.presto?"Opera":Gh.versions.webKit?"webKit":Gh.versions.gecko?"Firefox":Gh.versions.mobile?"mobile":Gh.versions.ios?"ios":Gh.versions.iPhone?"iPhone":Gh.versions.iPad?"ipad":Gh.versions.webApp?"webApp":Gh.versions.weixin?"weixin":Gh.versions.qq&&"qq",Ch=wf.navigator.userAgent,Gh.language}Ch.toLowerCase().indexOf("android");is("Uint8",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var Vh=El.fastKey,Hh=fe.set,qh=fe.getterFor;Al("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(t,e,r,n){var o=t((function(t,o){mr(t,i),Hh(t,{type:e,index:$i(null),first:void 0,last:void 0,size:0}),ht||(t.size=0),C(o)||ko(o,t[n],{that:t,AS_ENTRIES:r})})),i=o.prototype,a=qh(e),u=function(t,e,r){var n,o,i=a(t),u=s(t,e);return u?u.value=r:(i.last=u={index:o=Vh(e,!0),key:e,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=u),n&&(n.next=u),ht?i.size++:t.size++,"F"!==o&&(i.index[o]=u)),t},s=function(t,e){var r,n=a(t),o=Vh(e);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==e)return r};return Ja(i,{clear:function(){for(var t=a(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,ht?t.size=0:this.size=0},delete:function(t){var e=a(this),r=s(this,t);if(r){var n=r.next,o=r.previous;delete e.index[r.index],r.removed=!0,o&&(o.next=n),n&&(n.previous=o),e.first==r&&(e.first=n),e.last==r&&(e.last=o),ht?e.size--:this.size--}return!!r},forEach:function(t){for(var e,r=a(this),n=Ur(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!s(this,t)}}),Ja(i,r?{get:function(t){var e=s(this,t);return e&&e.value},set:function(t,e){return u(this,0===t?0:t,e)}}:{add:function(t){return u(this,t=0===t?0:t,t)}}),ht&&vr(i,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(t,e,r){var n=e+" Iterator",o=qh(e),i=qh(n);ba(t,e,(function(t,e){Hh(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?xa("keys"==e?r.key:"values"==e?r.value:[r.key,r.value],!1):(t.target=void 0,xa(void 0,!0))}),r?"entries":"values",!r,!0),yr(e)}});var Zh=N([].join),Yh=Te!=Object||!Oi("join",",");ar({target:"Array",proto:!0,forced:Yh},{join:function(t){return Zh(ke(this),void 0===t?",":t)}});var $h=Ai.map,Kh=_i("map");ar({target:"Array",proto:!0,forced:!Kh},{map:function(t){return $h(this,t,arguments.length>1?arguments[1]:void 0)}});var Qh=P((function(){Ui(1)}));ar({target:"Object",stat:!0,forced:Qh},{keys:function(t){return Ui(z(t))}});var Xh=new Map,Jh=new Map,tp=new Map,ep=function(t){c(r,t);var e=v(r);function r(){var t;return i(this,r),s(h(t=e.call(this)),"onabort",void 0),s(h(t),"onerror",void 0),s(h(t),"onload",void 0),s(h(t),"onloadstart",void 0),s(h(t),"onprogress",void 0),s(h(t),"ontimeout",void 0),s(h(t),"onloadend",void 0),s(h(t),"onreadystatechange",void 0),s(h(t),"readyState",void 0),s(h(t),"response",void 0),s(h(t),"responseText",void 0),s(h(t),"_responseType",void 0),s(h(t),"responseXML",void 0),s(h(t),"status",void 0),s(h(t),"statusText",void 0),s(h(t),"upload",void 0),s(h(t),"withCredentials",void 0),s(h(t),"timeout",void 0),s(h(t),"_url",void 0),s(h(t),"_method",void 0),t.onabort=null,t.onerror=null,t.onload=null,t.onloadstart=null,t.onprogress=null,t.ontimeout=null,t.onloadend=null,t.onreadystatechange=null,t.readyState=0,t.response=null,t.responseText=null,t._responseType="text",t.responseXML=null,t.status=0,t.statusText="",t.upload={},t.withCredentials=!1,Xh.set("requestHeader",{"content-type":"application/x-www-form-urlencoded"}),t}return u(r,[{key:"responseType",set:function(t){this._responseType=t}},{key:"abort",value:function(){var t=tp.get("requestTask");t&&t.abort()}},{key:"getAllResponseHeaders",value:function(){var t=Jh.get("responseHeader");return Object.keys(t).map((function(e){return"".concat(e,": ").concat(t[e])})).join("\\n")}},{key:"getResponseHeader",value:function(t){return Jh.get("responseHeader")[t]}},{key:"open",value:function(t,e,r){this._method=t,this._url=e}},{key:"overrideMimeType",value:function(){}},{key:"send",value:function(){}},{key:"setRequestHeader",value:function(t,e){var r=Xh.get("requestHeader");r[t]=e,Xh.set("requestHeader",r)}},{key:"addEventListener",value:function(t,e){var r=this;"function"==typeof e&&(this["on"+t]=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.target=t.target||r,e.call(r,t)})}},{key:"removeEventListener",value:function(t,e){this["on"+t]===e&&(this["on"+t]=null)}}]),r}(fh);s(ep,"UNSEND",void 0),s(ep,"OPENED",void 0),s(ep,"HEADERS_RECEIVED",void 0),s(ep,"LOADING",void 0),s(ep,"DONE",void 0),ep.UNSEND=0,ep.OPENED=1,ep.HEADERS_RECEIVED=2,ep.LOADING=3,ep.DONE=4;var rp="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,np="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram),op=(rp||np)&&!1;op||wf.XMLHttpRequest,op||wf.location;function ip(t){return[t+1&255,t+1>>8&255,t+1>>8>>8&255]}var ap=Ai.filter,up=_i("filter");function sp(t){var e=t.color;return e&&e.length?e:[1,1,1,1]}function cp(t,e,r){return 2===r.length?[r[0],r[1],0]:[r[0],r[1],r[2]]}function fp(t){return t.filter?[1]:[0]}function lp(t,e){return[e]}ar({target:"Array",proto:!0,forced:!up},{filter:function(t){return ap(this,t,arguments.length>1?arguments[1]:void 0)}});var hp=vp,pp=vp;function vp(t,e,r){r=r||2;var n,o,i,a,u,s,c,f=e&&e.length,l=f?e[0]*r:t.length,h=dp(t,0,l,r,!0),p=[];if(!h||h.next===h.prev)return p;if(f&&(h=function(t,e,r,n){var o,i,a,u,s,c=[];for(o=0,i=e.length;o<i;o++)a=e[o]*n,u=o<i-1?e[o+1]*n:t.length,(s=dp(t,a,u,n,!1))===s.next&&(s.steiner=!0),c.push(Tp(s));for(c.sort(Ep),o=0;o<c.length;o++)r=Ap(c[o],r);return r}(t,e,h,r)),t.length>80*r){n=i=t[0],o=a=t[1];for(var v=r;v<l;v+=r)(u=t[v])<n&&(n=u),(s=t[v+1])<o&&(o=s),u>i&&(i=u),s>a&&(a=s);c=0!==(c=Math.max(i-n,a-o))?32767/c:0}return gp(h,p,r,n,o,c,0),p}function dp(t,e,r,n,o){var i,a;if(o===Wp(t,e,r,n)>0)for(i=e;i<r;i+=n)a=Cp(i,t[i],t[i+1],a);else for(i=r-n;i>=e;i-=n)a=Cp(i,t[i],t[i+1],a);return a&&Pp(a,a.next)&&(Dp(a),a=a.next),a}function yp(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Pp(n,n.next)&&0!==jp(n.prev,n,n.next))n=n.next;else{if(Dp(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function gp(t,e,r,n,o,i,a){if(t){!a&&i&&function(t,e,r,n){var o=t;do{0===o.z&&(o.z=Sp(o.x,o.y,e,r,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,r,n,o,i,a,u,s,c=1;do{for(r=t,t=null,i=null,a=0;r;){for(a++,n=r,u=0,e=0;e<c&&(u++,n=n.nextZ);e++);for(s=c;u>0||s>0&&n;)0!==u&&(0===s||!n||r.z<=n.z)?(o=r,r=r.nextZ,u--):(o=n,n=n.nextZ,s--),i?i.nextZ=o:t=o,o.prevZ=i,i=o;r=n}i.nextZ=null,c*=2}while(a>1)}(o)}(t,n,o,i);for(var u,s,c=t;t.prev!==t.next;)if(u=t.prev,s=t.next,i?bp(t,n,o,i):mp(t))e.push(u.i/r|0),e.push(t.i/r|0),e.push(s.i/r|0),Dp(t),t=s.next,c=s.next;else if((t=s)===c){a?1===a?gp(t=xp(yp(t),e,r),e,r,n,o,i,2):2===a&&wp(t,e,r,n,o,i):gp(yp(t),e,r,n,o,i,1);break}}}function mp(t){var e=t.prev,r=t,n=t.next;if(jp(e,r,n)>=0)return!1;for(var o=e.x,i=r.x,a=n.x,u=e.y,s=r.y,c=n.y,f=o<i?o<a?o:a:i<a?i:a,l=u<s?u<c?u:c:s<c?s:c,h=o>i?o>a?o:a:i>a?i:a,p=u>s?u>c?u:c:s>c?s:c,v=n.next;v!==e;){if(v.x>=f&&v.x<=h&&v.y>=l&&v.y<=p&&kp(o,u,i,s,a,c,v.x,v.y)&&jp(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function bp(t,e,r,n){var o=t.prev,i=t,a=t.next;if(jp(o,i,a)>=0)return!1;for(var u=o.x,s=i.x,c=a.x,f=o.y,l=i.y,h=a.y,p=u<s?u<c?u:c:s<c?s:c,v=f<l?f<h?f:h:l<h?l:h,d=u>s?u>c?u:c:s>c?s:c,y=f>l?f>h?f:h:l>h?l:h,g=Sp(p,v,e,r,n),m=Sp(d,y,e,r,n),b=t.prevZ,x=t.nextZ;b&&b.z>=g&&x&&x.z<=m;){if(b.x>=p&&b.x<=d&&b.y>=v&&b.y<=y&&b!==o&&b!==a&&kp(u,f,s,l,c,h,b.x,b.y)&&jp(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,x.x>=p&&x.x<=d&&x.y>=v&&x.y<=y&&x!==o&&x!==a&&kp(u,f,s,l,c,h,x.x,x.y)&&jp(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;b&&b.z>=g;){if(b.x>=p&&b.x<=d&&b.y>=v&&b.y<=y&&b!==o&&b!==a&&kp(u,f,s,l,c,h,b.x,b.y)&&jp(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=m;){if(x.x>=p&&x.x<=d&&x.y>=v&&x.y<=y&&x!==o&&x!==a&&kp(u,f,s,l,c,h,x.x,x.y)&&jp(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xp(t,e,r){var n=t;do{var o=n.prev,i=n.next.next;!Pp(o,i)&&_p(o,n,n.next,i)&&Rp(o,i)&&Rp(i,o)&&(e.push(o.i/r|0),e.push(n.i/r|0),e.push(i.i/r|0),Dp(n),Dp(n.next),n=t=i),n=n.next}while(n!==t);return yp(n)}function wp(t,e,r,n,o,i){var a=t;do{for(var u=a.next.next;u!==a.prev;){if(a.i!==u.i&&Ip(a,u)){var s=Np(a,u);return a=yp(a,a.next),s=yp(s,s.next),gp(a,e,r,n,o,i,0),void gp(s,e,r,n,o,i,0)}u=u.next}a=a.next}while(a!==t)}function Ep(t,e){return t.x-e.x}function Ap(t,e){var r=function(t,e){var r,n=e,o=t.x,i=t.y,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var u=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=o&&u>a&&(a=u,r=n.x<n.next.x?n:n.next,u===o))return r}n=n.next}while(n!==e);if(!r)return null;var s,c=r,f=r.x,l=r.y,h=1/0;n=r;do{o>=n.x&&n.x>=f&&o!==n.x&&kp(i<l?o:a,i,f,l,i<l?a:o,i,n.x,n.y)&&(s=Math.abs(i-n.y)/(o-n.x),Rp(n,t)&&(s<h||s===h&&(n.x>r.x||n.x===r.x&&Op(r,n)))&&(r=n,h=s)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var n=Np(r,t);return yp(n,n.next),yp(r,r.next)}function Op(t,e){return jp(t.prev,t,e.prev)<0&&jp(e.next,t,t.next)<0}function Sp(t,e,r,n,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Tp(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 kp(t,e,r,n,o,i,a,u){return(o-a)*(e-u)>=(t-a)*(i-u)&&(t-a)*(n-u)>=(r-a)*(e-u)&&(r-a)*(i-u)>=(o-a)*(n-u)}function Ip(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&&_p(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Rp(t,e)&&Rp(e,t)&&function(t,e){var r=t,n=!1,o=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&o<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(jp(t.prev,t,e.prev)||jp(t,e.prev,e))||Pp(t,e)&&jp(t.prev,t,t.next)>0&&jp(e.prev,e,e.next)>0)}function jp(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Pp(t,e){return t.x===e.x&&t.y===e.y}function _p(t,e,r,n){var o=Lp(jp(t,e,r)),i=Lp(jp(t,e,n)),a=Lp(jp(r,n,t)),u=Lp(jp(r,n,e));return o!==i&&a!==u||(!(0!==o||!Mp(t,r,e))||(!(0!==i||!Mp(t,n,e))||(!(0!==a||!Mp(r,t,n))||!(0!==u||!Mp(r,e,n)))))}function Mp(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 Lp(t){return t>0?1:t<0?-1:0}function Rp(t,e){return jp(t.prev,t,t.next)<0?jp(t,e,t.next)>=0&&jp(t,t.prev,e)>=0:jp(t,e,t.prev)<0||jp(t,t.next,e)<0}function Np(t,e){var r=new Fp(t.i,t.x,t.y),n=new Fp(e.i,e.x,e.y),o=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=o,o.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function Cp(t,e,r,n){var o=new Fp(t,e,r);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function Dp(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 Fp(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 Wp(t,e,r,n){for(var o=0,i=e,a=r-n;i<r;i+=n)o+=(t[a]-t[i])*(t[i+1]+t[a+1]),a=i;return o}vp.deviation=function(t,e,r,n){var o=e&&e.length,i=o?e[0]*r:t.length,a=Math.abs(Wp(t,0,i,r));if(o)for(var u=0,s=e.length;u<s;u++){var c=e[u]*r,f=u<s-1?e[u+1]*r:t.length;a-=Math.abs(Wp(t,c,f,r))}var l=0;for(u=0;u<n.length;u+=3){var h=n[u]*r,p=n[u+1]*r,v=n[u+2]*r;l+=Math.abs((t[h]-t[v])*(t[p+1]-t[h+1])-(t[h]-t[p])*(t[v+1]-t[h+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},vp.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,o=0;o<t.length;o++){for(var i=0;i<t[o].length;i++)for(var a=0;a<e;a++)r.vertices.push(t[o][i][a]);o>0&&(n+=t[o-1].length,r.holes.push(n))}return r},hp.default=pp;var zp=S,Bp=N(1..valueOf),Up="\\t\\n\\v\\f\\r \\u2028\\u2029\\ufeff",Gp=N("".replace),Vp=RegExp("^["+Up+"]+"),Hp=RegExp("(^|[^"+Up+"])["+Up+"]+$"),qp=function(t){return function(e){var r=Xc(F(e));return 1&t&&(r=Gp(r,Vp,"")),2&t&&(r=Gp(r,Hp,"$1")),r}},Zp={start:qp(1),end:qp(2),trim:qp(3)},Yp=Ze.f,$p=je.f,Kp=Gt.f,Qp=Zp.trim,Xp=S.Number,Jp=(zp.Number,Xp.prototype),tv=S.TypeError,ev=N("".slice),rv=N("".charCodeAt),nv=function(t){var e=Ft(t,"number");return"bigint"==typeof e?e:ov(e)},ov=function(t){var e,r,n,o,i,a,u,s,c=Ft(t,"number");if(jt(c))throw tv("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=Qp(c),43===(e=rv(c,0))||45===e){if(88===(r=rv(c,2))||120===r)return NaN}else if(48===e){switch(rv(c,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+c}for(a=(i=ev(c,2)).length,u=0;u<a;u++)if((s=rv(i,u))<48||s>o)return NaN;return parseInt(i,n)}return+c},iv=or("Number",!Xp(" 0o1")||!Xp("0b1")||Xp("+0x1")),av=function(t){return kt(Jp,t)&&P((function(){Bp(t)}))},uv=function(t){var e=arguments.length<1?0:Xp(nv(t));return av(this)?os(Object(e),this,uv):e};uv.prototype=Jp,iv&&(Jp.constructor=uv),ar({global:!0,constructor:!0,wrap:!0,forced:iv},{Number:uv});iv&&function(t,e){for(var r,n=ht?Yp(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)U(e,r=n[o])&&!U(t,r)&&Kp(t,r,$p(e,r))}(zp.Number,Xp);var sv=RangeError,cv=RangeError,fv=String,lv=Math.floor,hv=N((function(t){var e=Xc(F(this)),r="",n=Le(t);if(n<0||n==1/0)throw sv("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(e+=e))1&n&&(r+=e);return r})),pv=N("".slice),vv=N(1..toFixed),dv=function(t,e,r){return 0===e?r:e%2==1?dv(t,e-1,r*t):dv(t*t,e/2,r)},yv=function(t,e,r){for(var n=-1,o=r;++n<6;)o+=e*t[n],t[n]=o%1e7,o=lv(o/1e7)},gv=function(t,e){for(var r=6,n=0;--r>=0;)n+=t[r],t[r]=lv(n/e),n=n%e*1e7},mv=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var n=fv(t[e]);r=""===r?n:r+hv("0",7-n.length)+n}return r},bv=P((function(){return"0.000"!==vv(8e-5,3)||"1"!==vv(.9,0)||"1.25"!==vv(1.255,2)||"1000000000000000128"!==vv(0xde0b6b3a7640080,0)}))||!P((function(){vv({})}));function xv(t){return"number"==typeof t}function wv(t){var e=Math.max(Math.min(85.0511287798,t[1]),-85.0511287798),r=Math.PI/180,n=t[0]*r,o=e*r;o=Math.log(Math.tan(Math.PI/4+o/2));return n=(256<<20)*(.5/Math.PI*n+.5),o=(256<<20)*(-.5/Math.PI*o+(r=.5)),[Math.floor(n),Math.floor(o)]}ar({target:"Number",proto:!0,forced:bv},{toFixed:function(t){var e,r,n,o,i=Bp(this),a=Le(t),u=[0,0,0,0,0,0],s="",c="0";if(a<0||a>20)throw cv("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return fv(i);if(i<0&&(s="-",i=-i),i>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(i*dv(2,69,1))-69)<0?i*dv(2,-e,1):i/dv(2,e,1),r*=4503599627370496,(e=52-e)>0){for(yv(u,0,r),n=a;n>=7;)yv(u,1e7,0),n-=7;for(yv(u,dv(10,n,1),0),n=e-1;n>=23;)gv(u,1<<23),n-=23;gv(u,1<<n),yv(u,1,1),gv(u,2),c=mv(u)}else yv(u,0,r),yv(u,1<<-e,0),c=mv(u)+hv("0",a);return c=a>0?s+((o=c.length)<=a?"0."+hv("0",a-o)+c:pv(c,0,o-a)+"."+pv(c,o-a)):s+c}});var Ev,Av=/"/g,Ov=N("".replace);ar({target:"String",proto:!0,forced:(Ev="sub",P((function(){var t=""[Ev](\'"\');return t!==t.toLowerCase()||t.split(\'"\').length>3})))},{sub:function(){return t="sub",e="",r="",n=Xc(F(this)),o="<"+t,""!==e&&(o+=" "+e+\'="\'+Ov(Xc(r),Av,""")+\'"\'),o+">"+n+"</"+t+">";var t,e,r,n,o}});var Sv=RegExp.prototype,Tv=Zt.PROPER,kv=RegExp.prototype.toString,Iv=P((function(){return"/a/b"!=kv.call({source:"a",flags:"b"})})),jv=Tv&&"toString"!=kv.name;(Iv||jv)&&he(RegExp.prototype,"toString",(function(){var t=Et(this);return"/"+Xc(t.source)+"/"+Xc(function(t){var e=t.flags;return void 0!==e||"flags"in Sv||U(t,"flags")||!kt(Sv,t)?e:Ot(Jc,t)}(t))}),{unsafe:!0});var Pv="undefined"!=typeof Float32Array?Float32Array:Array;function _v(){var t=new Pv(2);return Pv!=Float32Array&&(t[0]=0,t[1]=0),t}function Mv(t,e){var r=new Pv(2);return r[0]=t,r[1]=e,r}function Lv(t,e){return t[0]=e[0],t[1]=e[1],t}function Rv(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function Nv(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function Cv(t,e){var r=e[0],n=e[1],o=r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t}function Dv(t,e){return t[0]*e[0]+t[1]*e[1]}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Fv,Wv=Nv,zv=(Fv=_v(),_v()),Bv=(_v(),_v()),Uv=_v(),Gv=_v();function Vv(t,e,r,n,o){return Rv(t,r,n),Cv(t,t),[o/Dv(e=Mv(-t[1],t[0]),Mv(-r[1],r[0])),e]}function Hv(t,e){return function(t,e,r){return t[0]=e,t[1]=r,t}(t,-e[1],e[0])}function qv(t,e,r){return Wv(t,e,r),Cv(t,t),t}function Zv(t,e){return t[0]===e[0]&&t[1]===e[1]}var Yv=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),s(this,"complex",void 0),s(this,"join",void 0),s(this,"cap",void 0),s(this,"miterLimit",void 0),s(this,"thickness",void 0),s(this,"normal",void 0),s(this,"lastFlip",-1),s(this,"miter",Mv(0,0)),s(this,"started",!1),s(this,"dash",!1),s(this,"totalDistance",0),s(this,"currentIndex",0),this.join=e.join||"miter",this.cap=e.cap||"butt",this.miterLimit=e.miterLimit||10,this.thickness=e.thickness||1,this.dash=e.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return u(t,[{key:"extrude_gaode2",value:function(t,e){var r=this.complex;if(t.length<=1)return r;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var n=t.length,o=r.startIndex,i=1;i<n;i++){var a,u,s,c=t[i-1];c.push(null!==(a=e[i-1][2])&&void 0!==a?a:0);var f=e[i-1],l=t[i];l.push(null!==(u=e[i][2])&&void 0!==u?u:0);var h=e[i],p=i<t.length-1?[].concat(y(t[i+1]),[null!==(s=e[i+1][2])&&void 0!==s?s:0]):null,v=i<e.length-1?e[i+1]:null;o+=this.segment_gaode2(r,o,c,l,p,f,h,v)}if(this.dash)for(var d=0;d<r.positions.length/6;d++)r.positions[6*d+5]=this.totalDistance;return r.startIndex=r.positions.length/6,r}},{key:"simpleExtrude_gaode2",value:function(t,e){var r=this.complex;if(t.length<=1)return r;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var n=t.length,o=r.startIndex,i=1;i<n;i++){var a,u,s,c=t[i-1];c.push(null!==(a=e[i-1][2])&&void 0!==a?a:0);var f=e[i-1],l=t[i];l.push(null!==(u=e[i][2])&&void 0!==u?u:0);var h=e[i],p=i<t.length-1?[].concat(y(t[i+1]),[null!==(s=e[i+1][2])&&void 0!==s?s:0]):null,v=i<e.length-1?e[i+1]:null;o+=this.simpleSegment(r,o,c,l,p,f,h,v)}if(this.dash)for(var d=0;d<r.positions.length/6;d++)r.positions[6*d+5]=this.totalDistance;return r.startIndex=r.positions.length/6,r}},{key:"extrude",value:function(t){var e=this.complex;if(t.length<=1)return e;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var r=t.length,n=e.startIndex,o=1;o<r;o++){var i=t[o-1],a=t[o],u=o<t.length-1?t[o+1]:null;n+=this.segment(e,n,i,a,u)}if(this.dash)for(var s=0;s<e.positions.length/6;s++)e.positions[6*s+5]=this.totalDistance;return e.startIndex=e.positions.length/6,e}},{key:"simpleExtrude",value:function(t){var e=this.complex;if(t.length<=1)return e;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var r=t.length,n=e.startIndex,o=1;o<r;o++){var i=t[o-1],a=t[o],u=o<t.length-1?t[o+1]:null;n+=this.simpleSegment(e,n,i,a,u)}if(this.dash)for(var s=0;s<e.positions.length/6;s++)e.positions[6*s+5]=this.totalDistance;return e.startIndex=e.positions.length/6,e}},{key:"segment_gaode2",value:function(t,e,r,n,o,i,a,u){var s=0,c=t.indices,f=t.positions,l=t.normals,h="square"===this.cap,p="bevel"===this.join,v=wv([a[0],a[1]]),g=wv([i[0],i[1]]);qv(Bv,n,r);var m=0;if(this.dash&&(m=this.lineSegmentDistance(v,g),this.totalDistance+=m),this.normal||(this.normal=_v(),Hv(this.normal,Bv)),!this.started)if(this.started=!0,h){var b=_v(),x=_v();Rv(b,this.normal,Bv),Rv(x,this.normal,Bv),l.push(x[0],x[1],0),l.push(b[0],b[1],0),f.push(r[0],r[1],0|r[2],this.totalDistance-m,-this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),f.push(r[0],r[1],0|r[2],this.totalDistance-m,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(f,l,r,this.normal,this.thickness,this.totalDistance-m);if(c.push(e+0,e+1,e+2),o){Zv(n,o)&&Rv(o,n,Cv(o,Nv(o,n,r))),qv(Uv,o,n);var w=d(Vv(Gv,_v(),Bv,Uv,this.thickness),2),E=w[0],A=w[1],O=Dv(Gv,this.normal)<0?-1:1,S=p;if(!S&&"miter"===this.join)E>this.miterLimit&&(S=!0);S?(l.push(this.normal[0],this.normal[1],0),l.push(A[0],A[1],0),f.push(n[0],n[1],0|n[2],this.totalDistance,-this.thickness*O,0|n[2]),this.complex.indexes.push(this.currentIndex),f.push(n[0],n[1],0|n[2],this.totalDistance,this.thickness*O,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,c.push.apply(c,y(this.lastFlip!==-O?[e,e+2,e+3]:[e+2,e+1,e+3])),c.push(e+2,e+3,e+4),Hv(zv,Uv),Lv(this.normal,zv),l.push(this.normal[0],this.normal[1],0),f.push(n[0],n[1],0|n[2],this.totalDistance,-this.thickness*O,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,s+=3):(this.extrusions(f,l,n,A,E,this.totalDistance),c.push.apply(c,y(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),O=-1,Lv(this.normal,A),s+=2),this.lastFlip=O}else{if(Hv(this.normal,Bv),h){var T=_v(),k=_v();Wv(k,Bv,this.normal),Rv(T,Bv,this.normal),l.push(k[0],k[1],0),l.push(T[0],T[1],0),f.push(n[0],n[1],0|n[2],this.totalDistance,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),f.push(n[0],n[1],0|n[2],this.totalDistance,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(f,l,n,this.normal,this.thickness,this.totalDistance);c.push.apply(c,y(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),s+=2}return s}},{key:"simpleSegment",value:function(t,e,r,n,o){var i=0,a=t.indices,u=t.positions,s=t.normals,c=wv([n[0],n[1]]),f=wv([r[0],r[1]]);qv(Bv,c,f);var l=0;if(this.dash&&(l=this.lineSegmentDistance(c,f),this.totalDistance+=l),this.normal||(this.normal=_v(),Hv(this.normal,Bv)),this.started||(this.started=!0,this.extrusions(u,s,r,this.normal,this.thickness,this.totalDistance-l)),a.push(e+0,e+1,e+2),o){var h=wv([o[0],o[1]]);Zv(c,h)&&Rv(h,c,Cv(h,Nv(h,c,f))),qv(Uv,h,c);var p=d(Vv(Gv,_v(),Bv,Uv,this.thickness),2),v=p[0],g=p[1];Dv(Gv,this.normal);this.extrusions(u,s,n,g,v,this.totalDistance),a.push.apply(a,y(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),-1,Lv(this.normal,g),i+=2,this.lastFlip=-1}else Hv(this.normal,Bv),this.extrusions(u,s,n,this.normal,this.thickness,this.totalDistance),a.push.apply(a,y(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),i+=2;return i}},{key:"segment",value:function(t,e,r,n,o){var i=0,a=t.indices,u=t.positions,s=t.normals,c="square"===this.cap,f="bevel"===this.join,l=wv([n[0],n[1]]),h=wv([r[0],r[1]]);qv(Bv,l,h);var p=0;if(this.dash&&(p=this.lineSegmentDistance(l,h),this.totalDistance+=p),this.normal||(this.normal=_v(),Hv(this.normal,Bv)),!this.started)if(this.started=!0,c){var v=_v(),g=_v();Rv(v,this.normal,Bv),Rv(g,this.normal,Bv),s.push(g[0],g[1],0),s.push(v[0],v[1],0),u.push(r[0],r[1],0|r[2],this.totalDistance-p,-this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),u.push(r[0],r[1],0|r[2],this.totalDistance-p,this.thickness,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(u,s,r,this.normal,this.thickness,this.totalDistance-p);if(a.push(e+0,e+1,e+2),o){var m=wv([o[0],o[1]]);Zv(l,m)&&Rv(m,l,Cv(m,Nv(m,l,h))),qv(Uv,m,l);var b=d(Vv(Gv,_v(),Bv,Uv,this.thickness),2),x=b[0],w=b[1],E=Dv(Gv,this.normal)<0?-1:1,A=f;if(!A&&"miter"===this.join)x>this.miterLimit&&(A=!0);A?(s.push(this.normal[0],this.normal[1],0),s.push(w[0],w[1],0),u.push(n[0],n[1],0|n[2],this.totalDistance,-this.thickness*E,0|n[2]),this.complex.indexes.push(this.currentIndex),u.push(n[0],n[1],0|n[2],this.totalDistance,this.thickness*E,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,a.push.apply(a,y(this.lastFlip!==-E?[e,e+2,e+3]:[e+2,e+1,e+3])),a.push(e+2,e+3,e+4),Hv(zv,Uv),Lv(this.normal,zv),s.push(this.normal[0],this.normal[1],0),u.push(n[0],n[1],0|n[2],this.totalDistance,-this.thickness*E,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++,i+=3):(this.extrusions(u,s,n,w,x,this.totalDistance),a.push.apply(a,y(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),E=-1,Lv(this.normal,w),i+=2),this.lastFlip=E}else{if(Hv(this.normal,Bv),c){var O=_v(),S=_v();Wv(S,Bv,this.normal),Rv(O,Bv,this.normal),s.push(S[0],S[1],0),s.push(O[0],O[1],0),u.push(n[0],n[1],0|n[2],this.totalDistance,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),u.push(n[0],n[1],0|n[2],this.totalDistance,this.thickness,0|n[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(u,s,n,this.normal,this.thickness,this.totalDistance);a.push.apply(a,y(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),i+=2}return i}},{key:"extrusions",value:function(t,e,r,n,o,i){e.push(n[0],n[1],0),e.push(n[0],n[1],0),t.push(r[0],r[1],0|r[2],i,-o,0|r[2]),this.complex.indexes.push(this.currentIndex),t.push(r[0],r[1],0|r[2],i,o,0|r[2]),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}}]),t}();function $v(t){var e=t.coordinates,r=t.originCoordinates,n=t.version,o=new Yv({dash:!0,join:"bevel"});if("GAODE2.x"===n){var i=e;Array.isArray(i[0][0])||(i=[e]);var a=r;Array.isArray(a[0][0])||(a=[r]);for(var u=0;u<i.length;u++){var s=i[u],c=a[u];o.extrude_gaode2(s,c)}}else{var f=e;f[0]&&!Array.isArray(f[0][0])&&(f=[e]),f.forEach((function(t){o.extrude(t)}))}var l=o.complex;return{vertices:l.positions,indices:l.indices,normals:l.normals,indexes:l.indexes,size:6}}function Kv(t){var e=function(t){if(xv(t[0]))return t;if(xv(t[0][0]))throw new Error("当前数据不支持标注");if(xv(t[0][0][0])){var e=0,r=0,n=0;return t.forEach((function(t){t.forEach((function(t){e+=t[0],r+=t[1],n++}))})),[e/n,r/n,0]}throw new Error("当前数据不支持标注")}(t.coordinates);return{vertices:[].concat(y(e),y(e),y(e),y(e)),indices:[0,1,2,2,3,0],size:e.length}}function Qv(t){var e=t.coordinates,r=hp.flatten(e),n=r.vertices,o=r.dimensions,i=r.holes;return{indices:hp(n,i,o),vertices:n,size:o}}var Xv=function(){var t=o(r().mark((function t(e){var n,o,i,a,u,s,c,f,l;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.descriptors,o=e.features,i=e.enablePicking,a=e.iconMap,u={a_Color:sp,a_Position:cp,filter:fp,a_vertexId:lp,a_PickingColor:function(t){var e=t.id;return i?ip(e):[0,0,0]},a_DistanceAndIndex:function(t,e,r,n,o,i){return void 0===i?[r[3],10]:[r[3],i]},a_Total_Distance:function(t,e,r){return[r[5]]},a_Size:function(t){var e=t.size,r=void 0===e?1:e;return Array.isArray(r)?[r[0],r[1]]:[r,0]},a_Normal:function(t,e,r,n,o){return o},a_Miter:function(t,e,r){return[r[4]]},a_iconMapUV:function(t){var e=t.texture,r=a[e]||{x:0,y:0};return[r.x,r.y]}},s={sizePerElement:0,elements:[]},c=0,f=[],l=3,o.forEach((function(t,e){var r=$v(t),o=r.indices,i=r.vertices,a=r.normals,h=r.size,p=r.indexes;o.forEach((function(t){f.push(t+c)})),l=h;var v=i.length/h;s.sizePerElement=l,s.elements.push({featureIdx:e,vertices:i,normals:a,offset:c}),c+=v;for(var d=function(r){var o=(null==a?void 0:a.slice(3*r,3*r+3))||[],s=i.slice(r*h,r*h+h),c=0;p&&void 0!==p[r]&&(c=p[r]),n.forEach((function(n){var i;n&&u[n.name]&&(i=n.buffer.data).push.apply(i,y(u[n.name](t,e,s,r,o,c)))}))},g=0;g<v;g++)d(g)})),t.abrupt("return",{descriptors:n,featureLayout:s,indices:f});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Jv={pointFill:function(){var t=o(r().mark((function t(e){var n,o,i,a,u,s,c,f,l;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.descriptors,o=e.features,i=e.enablePicking,a=e.shape2d,u={a_Color:sp,a_Position:cp,filter:fp,a_vertexId:lp,a_PickingColor:function(t){var e=t.id;return i?ip(e):[0,0,0]},a_Shape:function(t){var e=t.shape,r=void 0===e?2:e;return[a.indexOf(r)]},a_Extrude:function(t,e,r,n){var o=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],i=n%4*3;return[o[i],o[i+1],o[i+2]]},a_Size:function(t){var e=t.size,r=void 0===e?5:e;return Array.isArray(r)?[r[0]]:[r]}},s={sizePerElement:0,elements:[]},c=0,f=[],l=3,o.forEach((function(t,e){var r=Kv(t),o=r.indices,i=r.vertices,a=r.normals,h=r.size;o.forEach((function(t){f.push(t+c)})),l=h;var p=i.length/h;s.sizePerElement=l,s.elements.push({featureIdx:e,vertices:i,normals:a,offset:c}),c+=p;for(var v=function(r){var o=[],a=i.slice(r*h,r*h+h);n.forEach((function(n){var i;n&&u[n.name]&&(i=n.buffer.data).push.apply(i,y(u[n.name](t,e,a,r,o,0)))}))},d=0;d<p;d++)v(d)})),t.abrupt("return",{descriptors:n,featureLayout:s,indices:f});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),line:Xv,polygonFill:function(){var t=o(r().mark((function t(e){var n,o,i,a,u,s,c,f;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.descriptors,o=e.features,i=e.enablePicking,a={a_Color:sp,a_Position:cp,filter:fp,a_vertexId:lp,a_PickingColor:function(t){var e=t.id;return i?ip(e):[0,0,0]}},u={sizePerElement:0,elements:[]},s=0,c=[],f=3,o.forEach((function(t,e){var r=Qv(t),o=r.indices,i=r.vertices,l=r.normals,h=r.size;o.forEach((function(t){c.push(t+s)})),f=h;var p=i.length/h;u.sizePerElement=f,u.elements.push({featureIdx:e,vertices:i,normals:l,offset:s}),s+=p;for(var v=function(r){var o=[],u=i.slice(r*h,r*h+h);n.forEach((function(n){var i;n&&a[n.name]&&(i=n.buffer.data).push.apply(i,y(a[n.name](t,e,u,r,o,0)))}))},d=0;d<p;d++)v(d)})),t.abrupt("return",{descriptors:n,featureLayout:u,indices:c});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},td=function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Jv);function ed(t){return rd.apply(this,arguments)}function rd(){return(rd=o(r().mark((function t(e){var n,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.workerType,o=e.data,!td[n]){t.next=3;break}return t.abrupt("return",td[n](o));case 3:return t.abrupt("return",Promise.reject(new Error(\'Worker with type "\'.concat(n,\'" non-existent.\'))));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return li(ed),t.WorkerSourceMap=Jv,t.createWorker=li,t.worker=ed,t}({});\n')},9714:(t,e,n)=>{"use strict";n.r(e),n.d(e,{CategoryLegend:()=>I,ContinueLegend:()=>V,Tooltip:()=>w,version:()=>r});const r="0.0.5";var i=n(7768),o=n(4859);function a(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}const s='\n "-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue",\n Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",\n SimSun, "sans-serif"';var u,l="l7plot-tooltip",c="l7plot-tooltip__title",h="l7plot-tooltip__list",p="l7plot-tooltip__list-item",f="l7plot-tooltip__name",d="l7plot-tooltip__value",m='<div class="'.concat(l,'">\n <div class="').concat(c,'"></div>\n <ul class="').concat(h,'"></ul>\n</div>'),g='<li class="'.concat(p,'" data-index={index}>\n <span class="').concat(f,'">{name}</span>\n <span class="').concat(d,'">{value}</span>\n</li>');const y=((u={})[l]={visibility:"visible",zIndex:999,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"rgb(0 0 0 / 16%) 0px 6px 12px 0px",borderRadius:"2px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:s,lineHeight:"20px",padding:"10px 10px 6px 10px"},u[c]={marginBottom:"4px"},u[h]={margin:"0px",listStyleType:"none",padding:"0px"},u[p]={listStyleType:"none",marginBottom:"4px",whiteSpace:"nowrap",display:"flex",justifyContent:"space-between"},u[f]={},u[d]={marginLeft:"30px"},u);var v=n(5483);function _(t){for(var e=t.childNodes,n=e.length-1;n>=0;n--)t.removeChild(e[n])}var b,x=function(){function t(t){this.destroyed=!1,this.options=(0,o.deepMix)({},this.getDefaultOptions(),t),this.container=this.initContainer(),this.initDom(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible(),this.render()}return t.prototype.getDefaultOptions=function(){return{name:"",containerTpl:"<div></div>",visible:!0,capture:!0,domStyles:{}}},t.prototype.getContainer=function(){return this.container},t.prototype.getParentContainer=function(){var t,e=this.options.parent;if(!e)return t;if((0,o.isString)(e)){var n=document.getElementById(e);if(!n)throw new Error("No parent id ".concat(e));t=n}else t=e;return t},t.prototype.initContainer=function(){var t=this.createDom(this.options.containerTpl),e=this.getParentContainer();return e&&e.appendChild(t),t},t.prototype.initVisible=function(){this.options.visible?this.show():this.hide()},t.prototype.initCapture=function(){this.setCapture(this.options.capture)},t.prototype.update=function(t){this.options=(0,o.deepMix)({},this.options,t),this.updateInner(t),this.afterUpdate(t)},t.prototype.updateInner=function(t){t.domStyles&&this.applyStyles()},t.prototype.afterUpdate=function(t){t.capture&&this.setCapture(t.capture)},t.prototype.setCapture=function(t){var e=t?"auto":"none";this.container.style.pointerEvents=e},t.prototype.applyStyles=function(){var t=this.options.domStyles;if(t){var e=this.container;this.applyChildrenStyles(e,t);var n,r=this.options.className;r&&(n=r,e.className.match(new RegExp("(\\s|^)".concat(n,"(\\s|$)"))))&&a(e,t[r])}},t.prototype.applyChildrenStyles=function(t,e){(0,o.each)(e,(function(e,n){var r=t.getElementsByClassName(n);(0,o.each)(r,(function(t){a(t,e)}))}))},t.prototype.applyStyle=function(t,e){var n=this.options.domStyles;n&&a(e,n[t])},t.prototype.createDom=function(t){return void 0===t&&(t="<div></div>"),(0,v.Z)(t)},t.prototype.removeDom=function(){var t=this.container;t&&t.parentNode&&t.parentNode.removeChild(t)},t.prototype.destroy=function(){this.removeEvent(),this.removeDom(),this.destroyed=!0},t}(),w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,o.deepMix)({},t.prototype.getDefaultOptions.call(this),{id:"l7plot-tooltip",name:"l7plot-tooltip",title:"",showTitle:!0,items:[],containerTpl:m,itemTpl:g,domStyles:y,className:l})},e.prototype.initContainer=function(){var e=this.options.customContent;if(e){var n=this.getHtmlContentNode(e),r=this.getParentContainer();return r&&r.appendChild(n),n}return t.prototype.initContainer.call(this)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){},e.prototype.cacheDoms=function(){var t=this.container,e=t.getElementsByClassName(c)[0],n=t.getElementsByClassName(h)[0];this.titleDom=e,this.listDom=n},e.prototype.render=function(){this.options.customContent?this.renderCustomContent(this.options.customContent):(this.resetTitle(),this.renderItems())},e.prototype.show=function(){var t=this.container;t&&!this.destroyed&&a(t,{visibility:"visible"})},e.prototype.hide=function(){var t=this.container;t&&!this.destroyed&&a(t,{visibility:"hidden"})},e.prototype.updateInner=function(e){this.options.customContent?this.renderCustomContent(this.options.customContent):(e.title&&this.resetTitle(),e.items&&this.renderItems()),t.prototype.updateInner.call(this,e)},e.prototype.renderCustomContent=function(t){var e=this.container.parentNode,n=this.getHtmlContentNode(t),r=this.container;e&&e.replaceChild(n,r),this.container=n,this.applyStyles()},e.prototype.getHtmlContentNode=function(t){var e=t(this.options.title||"",this.options.items);return(0,o.isString)(e)?this.createDom(e):e},e.prototype.resetTitle=function(){var t=this.options.title;this.options.showTitle&&t?(this.showTitle(),this.setTitle(t)):this.hideTitle()},e.prototype.showTitle=function(){var t=this.titleDom;t&&a(t,{display:"block"})},e.prototype.hideTitle=function(){var t=this.titleDom;t&&a(t,{display:"none"})},e.prototype.setTitle=function(t){var e=this.titleDom;e&&(e.innerHTML=t)},e.prototype.renderItems=function(){var t=this;this.clearItemDoms();var e=this.options.items,n=this.options.itemTpl||g,r=this.listDom;r&&(e.forEach((function(e){var a=(0,i.__assign)({},e),s=(0,o.substitute)(n,a),u=t.createDom(s);r.appendChild(u)})),this.applyChildrenStyles(r,this.options.domStyles))},e.prototype.clearItemDoms=function(){this.listDom&&_(this.listDom)},e.prototype.clear=function(){this.setTitle(""),this.clearItemDoms()},e}(x),S="l7plot-legend l7plot-legend__category",E="l7plot-legend__title",M="l7plot-legend__category-list",T="l7plot-legend__list-item",A="l7plot-legend__category-marker",C="l7plot-legend__category-value",O='<div class="'.concat(S,'">\n <div class="').concat(E,'"></div>\n <ul class="').concat(M,'"></ul>\n</div>'),P='<li class="'.concat(T,'" data-index={index}>\n <span class="').concat(A,'" style="background:{color}"></span>\n <span class="').concat(C,'">{value}</span>\n</li>');const k=((b={})[S]={visibility:"visible",zIndex:1,backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"rgb(0 0 0 / 16%) 0px 6px 12px 0px",borderRadius:"2px",color:"rgb(87, 87, 87)",fontFamily:s,padding:"10px 10px 6px 10px",lineHeight:1,fontSize:"12px"},b[E]={fontSize:"13px",lineHeight:"19px",marginBottom:"8px"},b[M]={margin:"0px",listStyleType:"none",padding:"0px"},b[T]={listStyleType:"none",display:"flex",alignItems:"center",marginBottom:"2px"},b[A]={width:"10px",height:"10px"},b[C]={paddingLeft:"8px"},b);var L,I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,o.deepMix)({},t.prototype.getDefaultOptions.call(this),{id:"l7plot-category-legend",name:"l7plot-category-legend",title:"",items:[],containerTpl:O,itemTpl:P,domStyles:k,className:S})},e.prototype.initContainer=function(){var e=this.options.customContent;if(e){var n=this.getHtmlContentNode(e),r=this.getParentContainer();return r&&r.appendChild(n),n}return t.prototype.initContainer.call(this)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){},e.prototype.cacheDoms=function(){var t=this.container,e=t.getElementsByClassName(E)[0],n=t.getElementsByClassName(M)[0];this.titleDom=e,this.listDom=n},e.prototype.render=function(){this.options.customContent?this.renderCustomContent(this.options.customContent):(this.resetTitle(),this.renderItems())},e.prototype.show=function(){var t=this.container;t&&!this.destroyed&&a(t,{visibility:"visible"})},e.prototype.hide=function(){var t=this.container;t&&!this.destroyed&&a(t,{visibility:"hidden"})},e.prototype.updateInner=function(e){this.options.customContent?this.renderCustomContent(this.options.customContent):(e.title&&this.resetTitle(),e.items&&this.renderItems()),t.prototype.updateInner.call(this,e)},e.prototype.renderCustomContent=function(t){var e=this.container.parentNode,n=this.getHtmlContentNode(t),r=this.container;e&&e.replaceChild(n,r),this.container=n,this.applyStyles()},e.prototype.getHtmlContentNode=function(t){var e=t(this.options.title||"",this.options.items);return(0,o.isString)(e)?this.createDom(e):e},e.prototype.resetTitle=function(){var t=this.options.title;t?(this.showTitle(),this.setTitle(t)):this.hideTitle()},e.prototype.showTitle=function(){var t=this.titleDom;t&&a(t,{display:"block"})},e.prototype.hideTitle=function(){var t=this.titleDom;t&&a(t,{display:"none"})},e.prototype.setTitle=function(t){var e=this.titleDom;e&&(e.innerHTML=t)},e.prototype.renderItems=function(){var t=this;this.clearItemDoms();var e=this.options.items.length>30?this.options.items.slice(0,30):this.options.items,n=this.options.itemTpl||P,r=this.listDom;r&&(e.forEach((function(e){var a=""===e.value?"—":Array.isArray(e.value)?e.value.join(" - "):e.value,s=(0,i.__assign)((0,i.__assign)({},e),{value:a}),u=(0,o.substitute)(n,s),l=t.createDom(u);r.appendChild(l)})),this.applyChildrenStyles(r,this.options.domStyles))},e.prototype.clearItemDoms=function(){this.listDom&&_(this.listDom)},e.prototype.clear=function(){this.setTitle(""),this.clearItemDoms()},e}(x),R="l7plot-legend l7plot-legend__continue",D="l7plot-legend__title",N="l7plot-legend__ribbon-container",F="l7plot-legend__ribbon",z="l7plot-legend__gradient-bar",B="l7plot-legend__value-range",j='<div class="'.concat(R,'">\n <div class="').concat(D,'"></div>\n <div class="').concat(N,'"></div>\n</div>'),U='<div class="'.concat(F,'">\n <span class="').concat(B,'">{min}</span>\n <div class="').concat(z,'" style="background-image: {backgroundImage}"></div>\n <span class="').concat(B,'">{max}</span>\n</div>');const Z=((L={})[R]={visibility:"visible",zIndex:1,backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"rgb(0 0 0 / 16%) 0px 6px 12px 0px",borderRadius:"2px",color:"rgb(87, 87, 87)",fontFamily:s,padding:"10px",lineHeight:1,fontSize:"12px"},L[D]={fontSize:"13px",lineHeight:"19px",marginBottom:"8px"},L[F]={display:"flex",alignItems:"center"},L[z]={width:"140px",height:"14px",margin:"0px 5px"},L[B]={padding:"0px"},L);var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,o.deepMix)({},t.prototype.getDefaultOptions.call(this),{id:"l7plot-continue-legend",name:"l7plot-continue-legend",title:"",containerTpl:j,ribbonTpl:U,domStyles:Z,className:R})},e.prototype.initContainer=function(){var e=this.options.customContent;if(e){var n=this.getHtmlContentNode(e),r=this.getParentContainer();return r&&r.appendChild(n),n}return t.prototype.initContainer.call(this)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){},e.prototype.cacheDoms=function(){var t=this.container,e=t.getElementsByClassName(D)[0],n=t.getElementsByClassName(N)[0];this.titleDom=e,this.ribbonContainerDom=n},e.prototype.render=function(){this.options.customContent?this.renderCustomContent(this.options.customContent):(this.resetTitle(),this.renderRibbon())},e.prototype.show=function(){var t=this.container;t&&!this.destroyed&&a(t,{visibility:"visible"})},e.prototype.hide=function(){var t=this.container;t&&!this.destroyed&&a(t,{visibility:"hidden"})},e.prototype.updateInner=function(e){this.options.customContent?this.renderCustomContent(this.options.customContent):(e.title&&this.resetTitle(),e.colors&&this.renderRibbon()),t.prototype.updateInner.call(this,e)},e.prototype.renderCustomContent=function(t){var e=this.container.parentNode,n=this.getHtmlContentNode(t),r=this.container;e&&e.replaceChild(n,r),this.container=n,this.applyStyles()},e.prototype.getHtmlContentNode=function(t){var e=t(this.options.title||"",this.options.min,this.options.max,this.options.colors);return(0,o.isString)(e)?this.createDom(e):e},e.prototype.resetTitle=function(){var t=this.options.title;t?(this.showTitle(),this.setTitle(t)):this.hideTitle()},e.prototype.showTitle=function(){var t=this.titleDom;t&&a(t,{display:"block"})},e.prototype.hideTitle=function(){var t=this.titleDom;t&&a(t,{display:"none"})},e.prototype.setTitle=function(t){var e=this.titleDom;e&&(e.innerHTML=t)},e.prototype.renderRibbon=function(){this.clearRibbonContainerDoms();var t=this.options,e=t.min,n=t.max,r=t.colors,i=t.ribbonTpl,a=void 0===i?U:i,s=this.ribbonContainerDom;if(s){var u={min:e,max:n,backgroundImage:"linear-gradient(to right, ".concat(r.join(", "),")")},l=(0,o.substitute)(a,u),c=this.createDom(l);s.appendChild(c),this.applyChildrenStyles(s,this.options.domStyles)}},e.prototype.clearRibbonContainerDoms=function(){this.ribbonContainerDom&&_(this.ribbonContainerDom)},e.prototype.clear=function(){this.setTitle(""),this.clearRibbonContainerDoms()},e}(x)},5864:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ITEM_TPL=e.CONTAINER_TPL=e.VALUE_CLASS=e.MARKER_CLASS=e.LIST_ITEM_CLASS=e.LIST_CLASS=e.TITLE_CLASS=e.CONTAINER_CLASS=void 0,e.CONTAINER_CLASS="l7plot-legend l7plot-legend__category",e.TITLE_CLASS="l7plot-legend__title",e.LIST_CLASS="l7plot-legend__category-list",e.LIST_ITEM_CLASS="l7plot-legend__list-item",e.MARKER_CLASS="l7plot-legend__category-marker",e.VALUE_CLASS="l7plot-legend__category-value",e.CONTAINER_TPL='<div class="'.concat(e.CONTAINER_CLASS,'">\n <div class="').concat(e.TITLE_CLASS,'"></div>\n <ul class="').concat(e.LIST_CLASS,'"></ul>\n</div>'),e.ITEM_TPL='<li class="'.concat(e.LIST_ITEM_CLASS,'" data-index={index}>\n <span class="').concat(e.MARKER_CLASS,'" style="background:{color}"></span>\n <span class="').concat(e.VALUE_CLASS,'">{value}</span>\n</li>')},3109:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RIBBON_TPL=e.CONTAINER_TPL=e.VALUE_RANGE_CLASS=e.GRADIENT_BAR_CLASS=e.RIBBON_CLASS=e.RIBBON_CONTAINER_CLASS=e.TITLE_CLASS=e.CONTAINER_CLASS=void 0,e.CONTAINER_CLASS="l7plot-legend l7plot-legend__continue",e.TITLE_CLASS="l7plot-legend__title",e.RIBBON_CONTAINER_CLASS="l7plot-legend__ribbon-container",e.RIBBON_CLASS="l7plot-legend__ribbon",e.GRADIENT_BAR_CLASS="l7plot-legend__gradient-bar",e.VALUE_RANGE_CLASS="l7plot-legend__value-range",e.CONTAINER_TPL='<div class="'.concat(e.CONTAINER_CLASS,'">\n <div class="').concat(e.TITLE_CLASS,'"></div>\n <div class="').concat(e.RIBBON_CONTAINER_CLASS,'"></div>\n</div>'),e.RIBBON_TPL='<div class="'.concat(e.RIBBON_CLASS,'">\n <span class="').concat(e.VALUE_RANGE_CLASS,'">{min}</span>\n <div class="').concat(e.GRADIENT_BAR_CLASS,'" style="background-image: {backgroundImage}"></div>\n <span class="').concat(e.VALUE_RANGE_CLASS,'">{max}</span>\n</div>')},1501:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ITEM_TPL=e.CONTAINER_TPL=e.VALUE_CLASS=e.NAME_CLASS=e.LIST_ITEM_CLASS=e.LIST_CLASS=e.TITLE_CLASS=e.CONTAINER_CLASS=void 0,e.CONTAINER_CLASS="l7plot-tooltip",e.TITLE_CLASS="l7plot-tooltip__title",e.LIST_CLASS="l7plot-tooltip__list",e.LIST_ITEM_CLASS="l7plot-tooltip__list-item",e.NAME_CLASS="l7plot-tooltip__name",e.VALUE_CLASS="l7plot-tooltip__value",e.CONTAINER_TPL='<div class="'.concat(e.CONTAINER_CLASS,'">\n <div class="').concat(e.TITLE_CLASS,'"></div>\n <ul class="').concat(e.LIST_CLASS,'"></ul>\n</div>'),e.ITEM_TPL='<li class="'.concat(e.LIST_ITEM_CLASS,'" data-index={index}>\n <span class="').concat(e.NAME_CLASS,'">{name}</span>\n <span class="').concat(e.VALUE_CLASS,'">{value}</span>\n</li>')},3717:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MappingLayer=e.getMappingFunction=void 0;var r=n(4859);function i(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i={};return t.forEach((function(t,e){i[t]=n[e]})),delete i[void 0],e(i)}}e.getMappingFunction=i;var o=function(){function t(){}return t.shape=function(e,n){if((0,r.isString)(n))e.shape(n);else if((0,r.isFunction)(n)){var o=[];e.shape(o.join("*"),i(o,n))}else if((0,r.isObject)(n)){var a=n.field?n.field:"";(0,r.isFunction)(n.value)?(o=(0,r.isArray)(a)?a:a.split("*"),e.shape(a,i(o,n.value))):e.shape(a,n.value),(0,r.isString)(a)&&n.scale&&t.scale(e,a,n.scale)}},t.size=function(e,n){if((0,r.isNumber)(n))e.size(n);else if((0,r.isArray)(n))e.size(n);else if((0,r.isFunction)(n)){var o=[];e.size(o.join("*"),i(o,n))}else if((0,r.isObject)(n)){var a=n.field?n.field:"";(0,r.isFunction)(n.value)?(o=(0,r.isArray)(a)?a:a.split("*"),e.size(a,i(o,n.value))):e.size(a,n.value),(0,r.isString)(a)&&n.scale&&t.scale(e,a,n.scale)}},t.color=function(e,n){if((0,r.isString)(n))e.color(n);else if((0,r.isFunction)(n)){var o=[];e.color(o.join("*"),i(o,n))}else if((0,r.isObject)(n)){var a=n.field?n.field:"";(0,r.isFunction)(n.value)?(o=(0,r.isArray)(a)?a:a.split("*"),e.color(a,i(o,n.value))):e.color(a,n.value),(0,r.isString)(a)&&n.scale&&t.scale(e,a,n.scale)}},t.style=function(t,e){e&&t.style(e)},t.state=function(t,e){var n=e.active,r=e.select;n&&t.active(n),r&&t.select(r)},t.rotate=function(t,e){(0,r.isString)(e)||(0,r.isFunction)(e)||(0,r.isObject)(e)},t.texture=function(t,e){(0,r.isString)(e)&&t.texture(e)},t.animate=function(t,e){((0,r.isBoolean)(e)||(0,r.isObject)(e))&&t.animate(e)},t.scale=function(t,e,n){t.scale(e,n)},t.filter=function(t,e){var n=e.field?e.field:"",o=(0,r.isArray)(n)?n:n.split("*");t.filter(o.join("*"),i(o,e.value))},t}();e.MappingLayer=o},5712:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MappingSource=void 0;var n=function(){function t(){}return t.aggregation=function(t,e){var n=e.type,r={type:void 0===n?"grid":n,size:e.radius,method:e.method,field:e.field};t.transforms?(t.transforms=t.transforms.filter((function(t){return t.type!==r.type})),t.transforms.push(r)):t.transforms=[r]},t}();e.MappingSource=n},5668:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Legend=void 0;var r=n(7768),i=n(1522),o=n(9714),a=function(t){function e(e){var n=t.call(this,e)||this;return n.legendComponents=[],n.options=e,n.legendComponents=n.initLegendComponents(e.items),n}return(0,r.__extends)(e,t),e.prototype.initLegendComponents=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if("category"===r.type){var i=new o.CategoryLegend({title:r.options.title,items:r.options.items,className:r.options.className,customContent:r.options.customContent,domStyles:r.options.domStyles});e.push(i)}else"continue"===r.type&&(i=new o.ContinueLegend({title:r.options.title,min:r.options.min,max:r.options.max,colors:r.options.colors,className:r.options.className,customContent:r.options.customContent,domStyles:r.options.domStyles}),e.push(i))}return e},e.prototype.getDefaultOptions=function(){return{position:"bottomleft"}},e.prototype.onAdd=function(){var t=window.document.createElement("div");return t.className="l7plot-legend-container",this.legendComponents.forEach((function(e){var n=e.getContainer();t.appendChild(n)})),t},e.prototype.onRemove=function(){this.legendComponents.forEach((function(t){t.destroy()}))},e}(i.Control);e.Legend=a},2500:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Tooltip=void 0;var r=n(7768),i=n(1522),o=(0,r.__importDefault)(n(3275)),a=n(4859),s=n(9714),u=n(8665),l=n(7039),c=n(1359),h=["mousemove","click"],p=function(t){function e(e,n,r){var o=t.call(this)||this;o.currentVisible=!1,o.interactionTriggerHander=function(t){var e=t.feature,n=t.featureId,r=o.options,i=r.title,s=r.customTitle,l=r.items,c=r.customItems,h="Feature"===e.type&&e.geometry&&e.properties?e.properties:e,p=[];if(c){var f=c(e);if(!Array.isArray(f))throw new Error("customItems return array");p=f}else l&&l.forEach((function(t){if((0,a.isString)(t)){var e=t.split(".").pop()||t;void 0!==(r=(0,u.get)(h,t))&&p.push({name:e,value:r})}else{var r,i=t.field,o=t.alias,s=t.customValue,l=o||i.split(".").pop()||i;void 0!==(r=(0,u.get)(h,i))&&p.push({name:l,value:s?s(r,h,n):r})}}));var d={title:s?s(h):i,items:p};o.updateTooltip(t,d)},o.interactionUntriggerHander=function(){o.hideTooltip()},o.scene=e,o.interactionLayers=n,o.options=(0,c.deepAssign)({},o.getDefaultOptions(),r);var l=o.options,h=l.offsets,p=l.title,f=l.showTitle,d=l.customContent,m=l.domStyles,g=l.anchor,y=l.className;return o.marker=new i.Marker({offsets:h,anchor:g,draggable:!1}),o.tooltipComponent=new s.Tooltip({title:p,showTitle:f,items:[],customContent:d,domStyles:m,className:y}),o.setComponent(),o.initInteractionEvent(),o}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return{showTitle:!0,showComponent:!0,items:[],offsets:[15,0],trigger:"mousemove",anchor:l.TooltipAnchorType["TOP-LEFT"]}},e.prototype.update=function(t){this.marker.remove(),this.currentVisible=!1,this.options=(0,c.deepAssign)({},this.options,t);var e=this.options,n=e.offsets,r=e.showTitle,o=e.customContent,a=e.domStyles,s=e.anchor,u=e.className;this.marker=new i.Marker({offsets:n,anchor:s,draggable:!1}),this.tooltipComponent.update({showTitle:r,customContent:o,domStyles:a,className:u}),this.setComponent()},e.prototype.initInteractionEvent=function(){var t=this,e=this.options.trigger||"mousemove";if(!h.includes(e))throw new Error("trigger is mousemove or click");this.interactionLayers.forEach((function(n){var r=n.layer;r.on(e,t.interactionTriggerHander),r.on("un".concat(e),t.interactionUntriggerHander)}))},e.prototype.unBindInteractionEvent=function(){var t=this,e=this.options.trigger||"mousemove";this.interactionLayers.forEach((function(n){var r=n.layer;r.off(e,t.interactionTriggerHander),r.off("un".concat(e),t.interactionUntriggerHander)}))},e.prototype.updateTooltip=function(t,e){var n=t.lngLat,r=t.x,i=t.y;if(this.options.showComponent&&(this.updateComponent(e),this.setPostion(n)),this.currentVisible){var o={type:"tooltip:change",data:e,lngLat:n,x:r,y:i};this.emit("tooltip:change",o)}else{this.showTooltip();var a={type:"tooltip:show",data:e,lngLat:n,x:r,y:i};this.emit("tooltip:show",a)}},e.prototype.showTooltip=function(){this.currentVisible||(this.options.showComponent&&this.scene.addMarker(this.marker),this.currentVisible=!0)},e.prototype.hideTooltip=function(){this.currentVisible&&(this.options.showComponent&&this.marker.remove(),this.currentVisible=!1,this.emit("tooltip:hide",{type:"tooltip:hide"}))},e.prototype.updateComponent=function(t){(0,a.isEqual)(this.lastComponentOptions,t)||(this.tooltipComponent.update(t),this.lastComponentOptions=t)},e.prototype.setComponent=function(){var t=this.tooltipComponent.getContainer(),e=window.document.createElement("div");e.style.cursor="auto",e.style.userSelect="text",e.className="l7plot-tooltip-container",["mousemove","mousedown","mouseup","click","dblclick"].forEach((function(t){e.addEventListener(t,(function(t){return t.stopPropagation()}))})),e.appendChild(t),this.marker.setElement(e)},e.prototype.setPostion=function(t){this.marker.setLnglat(t)},e.prototype.destroy=function(){this.unBindInteractionEvent(),this.off(),this.marker.remove(),this.tooltipComponent.destroy()},e}(o.default);e.Tooltip=p},6496:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LayerGroup=void 0;var r=n(7768),i=n(4859),o=function(t){function e(e,n){void 0===e&&(e=[]),void 0===n&&(n={});var r=t.call(this)||this;return r.name=n.name?n.name:(0,i.uniqueId)("layerGroup"),r.layers=e,r}return(0,r.__extends)(e,t),e.prototype.addTo=function(t){var e=this;this.scene=t;var n=0,r=this.layers.length;this.layers.forEach((function(i){i.once("inited",(function(t){n++,e.emit("inited",t),n===r&&e.emit("inited-all")})),i.addTo(t)}))},e.prototype.hasLayer=function(t){return this.layers.some((function(e){return e===t}))},e.prototype.addLayer=function(t){var e=this;this.layers.push(t),this.scene&&(t.once("inited",(function(t){return e.emit("inited",t)})),t.addTo(this.scene))},e.prototype.removeLayer=function(t){var e=this.layers.findIndex((function(e){return e===t}));return-1!==e&&(this.layers.splice(e,1),this.scene&&t.remove(this.scene),!0)},e.prototype.getLayers=function(){return this.layers},e.prototype.getInteractionLayers=function(){return this.layers.filter((function(t){return t.interaction}))},e.prototype.getLayer=function(t){return this.layers.find((function(e){return e.layer.id===t}))},e.prototype.getLayerByName=function(t){return this.layers.find((function(e){return e.name===t}))},e.prototype.removeAllLayer=function(){var t=this;this.layers.forEach((function(e){t.scene&&e.remove(t.scene)})),this.layers=[]},e.prototype.isEmpty=function(){return 0===this.layers.length},e}((0,r.__importDefault)(n(3275)).default);e.LayerGroup=o},8295:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PlotLayer=void 0;var r=n(7768),i=n(4859),o=(0,r.__importDefault)(n(8134)),a=(0,r.__importDefault)(n(3275)),s=n(6651),u=n(5712),l=n(1780),c=n(1359),h=["name","zIndex","visible","minZoom","maxZoom","pickingBuffer","autoFit","blend"],p=function(t){function e(e){var n=t.call(this)||this;return n.options=(0,c.deepAssign)({},n.getDefaultOptions(),e),n.lastOptions=n.options,n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return{}},e.prototype.pickLayerConfig=function(t){return(0,i.pick)(t,h)},e.prototype.addTo=function(t){t.addLayer(this.layer)},e.prototype.remove=function(t){t.removeLayer(this.layer)},e.prototype.update=function(t){this.updateOption(t),this.updateConfig(t)},e.prototype.updateOption=function(t){this.lastOptions=this.options,this.options=(0,c.deepAssign)({},this.options,t)},e.prototype.updateConfig=function(t){(0,i.isUndefined)(t.zIndex)||(0,i.isEqual)(this.lastOptions.zIndex,this.options.zIndex)||this.setIndex(t.zIndex),(0,i.isUndefined)(t.blend)||(0,i.isEqual)(this.lastOptions.blend,this.options.blend)||this.setBlend(t.blend),(0,i.isUndefined)(t.minZoom)||(0,i.isEqual)(this.lastOptions.minZoom,this.options.minZoom)||this.setMinZoom(t.minZoom),(0,i.isUndefined)(t.maxZoom)||(0,i.isEqual)(this.lastOptions.maxZoom,this.options.maxZoom)||this.setMinZoom(t.maxZoom),(0,i.isUndefined)(t.visible)||(0,i.isEqual)(this.lastOptions.visible,this.options.visible)||(t.visible?this.show():this.hide())},e.prototype.render=function(){this.layer.renderLayers()},e.prototype.setSource=function(t){if(t instanceof o.default)this.layer.setSource(t);else{var e=t.data,n=t.aggregation,i=(0,r.__rest)(t,["data","aggregation"]);n&&u.MappingSource.aggregation(i,n),this.layer.getSource()?this.layer.setData(e,i):this.layer.source(e,i)}},e.prototype.changeData=function(t){this.setSource(t)},e.prototype.setIndex=function(t){this.layer.setIndex(t)},e.prototype.setBlend=function(t){this.layer.setBlend(t)},e.prototype.setMinZoom=function(t){this.layer.setMinZoom(t)},e.prototype.setMaxZoom=function(t){this.layer.setMaxZoom(t)},e.prototype.show=function(){this.layer.inited&&this.layer.show()},e.prototype.hide=function(){this.layer.inited&&this.layer.hide()},e.prototype.toggleVisible=function(){this.isVisible()?this.hide():this.show()},e.prototype.isVisible=function(){return this.layer.inited?this.layer.isVisible():this.options.visible},e.prototype.fitBounds=function(t){this.layer.fitBounds(t)},e.prototype.on=function(e,n){return-1!==l.LayerEventList.indexOf(e)?this.layer.on(e,n):t.prototype.on.call(this,e,n),this},e.prototype.once=function(e,n){return-1!==l.LayerEventList.indexOf(e)?this.layer.once(e,n):t.prototype.once.call(this,e,n),this},e.prototype.off=function(e,n){return-1!==l.LayerEventList.indexOf(e)?this.layer.off(e,n):t.prototype.off.call(this,e,n),this},e.LayerType=s.LayerType,e.LayerConfigkeys=h,e}(a.default);e.PlotLayer=p},1780:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LayerEventList=e.MapEventList=e.SceneEventList=void 0,e.SceneEventList=[{original:"loaded",adaptation:"scene-loaded"},{original:"resize",adaptation:"resize"},{original:"destroy",adaptation:"destroy"},{original:"resize",adaptation:"resize"}],e.MapEventList=["mapmove","movestart","moveend","zoomchange","zoomstart","zoomend","click","dblclick","contextmenu","mousemove","mousewheel","mouseover","mouseout","mouseup","mousedown","dragstart","dragging","dragend"],e.LayerEventList=["inited","add","remove","dataUpdate","click","unclick","contextmenu","uncontextmenu","mouseenter","mousemove","unmousemove","mouseout","mouseup","unmouseup","mousedown","uncontextmenu","unpick"]},708:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Map=void 0;var r=n(7768),i=n(5868),o=n(1813),a=n(1522),s=(0,r.__importDefault)(n(3275)),u=n(4859),l=n(2500),c=n(5668),h=n(1359),p=n(7039),f=n(6496),d=n(1780),m=n(2397),g=n(8976),y=n(6444),v={map:{type:p.BaseMapType.Amap},logo:!0},_=function(t){function e(e){var n=t.call(this)||this;return n.inited=!1,n.sceneLoaded=!1,n.layersLoaded=!1,n.loaded=!1,n.layerGroup=new f.LayerGroup,n.options=(0,h.deepAssign)({},n.getDefaultOptions(),e),n.lastOptions=n.options,n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createContainer=function(t){var e=this.options,n=e.width,r=e.height,i="string"==typeof t?document.getElementById(t):t;return i.style.position||(i.style.position="relative"),n&&(i.style.width||(i.style.width="".concat(n,"px"))),r&&(i.style.height||(i.style.height="".concat(r,"px"))),i},e.prototype.createTheme=function(){return(0,u.isObject)(this.options.theme)?(0,h.deepAssign)({},(0,g.getTheme)("default"),(0,y.createTheme)(this.options.theme)):(0,g.getTheme)(this.options.theme)},e.prototype.createMap=function(){var t=this.options.map?this.options.map:v.map,e=t.type,n=(0,r.__rest)(t,["type"]),i=Object.assign({style:this.theme.mapStyle},n);return e===p.BaseMapType.Amap?new o.GaodeMap(i):new o.Mapbox(i)},e.prototype.createScene=function(){var t=this.options,e=t.logo,n=t.antialias,o=t.preserveDrawingBuffer,a=(0,u.isBoolean)(e)?{logoVisible:e}:{logoVisible:null==e?void 0:e.visible,logoPosition:null==e?void 0:e.position},s=Object.assign({antialias:n,preserveDrawingBuffer:o},a),l=this.createMap();return new i.Scene((0,r.__assign)({id:this.container,map:l},s))},e.prototype.registerResources=function(){var t=this;m.IMAGES_CACHE.size&&m.IMAGES_CACHE.forEach((function(e,n){!t.scene.hasImage(n)&&t.scene.addImage(n,e)})),m.FONT_FACE_CACHE.size&&m.FONT_FACE_CACHE.forEach((function(e,n){t.scene.addFontFace(n,e)})),m.ICON_FONT_CACHE.size&&m.ICON_FONT_CACHE.forEach((function(e,n){t.scene.addIconFont(n,e)}))},e.prototype.update=function(t){this.updateOption(t),t.map&&!(0,u.isEqual)(this.lastOptions.map,this.options.map)&&this.updateMap(t.map),this.render(),this.emit("update")},e.prototype.updateOption=function(t){this.lastOptions=this.options,this.options=(0,h.deepAssign)({},this.options,t)},e.prototype.updateMap=function(t){var e;if(this.scene){var n=t.style,r=t.center,i=t.zoom,o=t.rotation,a=t.pitch;(0,u.isUndefined)(a)||this.scene.setPitch(a),(0,u.isUndefined)(o)||this.scene.setRotation(o),n&&n!==(null===(e=this.lastOptions.map)||void 0===e?void 0:e.style)&&this.scene.setMapStyle(n),i&&r&&this.scene.setZoomAndCenter(i,r)}},e.prototype.changeSize=function(t,e){this.options.width===t&&this.options.height===e||(this.container.style.width="".concat(t,"px"),this.container.style.height="".concat(e,"px"),this.options=Object.assign(this.options,{width:t,height:e}))},e.prototype.on=function(t,e){return this.proxyEventHander("on",t,e),this},e.prototype.once=function(t,e){return this.proxyEventHander("once",t,e),this},e.prototype.off=function(t,e){return this.proxyEventHander("off",t,e),this},e.prototype.proxyEventHander=function(e,n,i){var o=d.SceneEventList.find((function(t){return t.adaptation===n}));if(o)this.scene[e](o.original,i);else if(-1!==d.MapEventList.indexOf(n))this.scene[e](n,i);else if(n.includes("Layer:")){var a=(0,r.__read)(n.split(":"),2),s=a[0],u=a[1];if(!this[s]||!this[s][e]||-1===d.LayerEventList.indexOf(u))throw new Error('No event name "'.concat(n,'"'));this[s][e](u,i)}else t.prototype[e].call(this,n,i)},e.prototype.getScene=function(){return this.scene},e.prototype.getMap=function(){var t,e;return(null===(t=this.options.map)||void 0===t?void 0:t.type)===p.BaseMapType.Amap||(null===(e=this.options.map)||void 0===e||e.type,p.BaseMapType.Mapbox),this.scene.map},e.prototype.addLayer=function(t){this.layerGroup.addLayer(t)},e.prototype.getLayes=function(){return console.warn("Replace to use getLayers()"),this.getLayers()},e.prototype.getLayers=function(){return this.layerGroup.getLayers()},e.prototype.getLayerByName=function(t){return this.layerGroup.getLayerByName(t)},e.prototype.removeLayer=function(t){return this.layerGroup.removeLayer(t)},e.prototype.removeAllLayer=function(){this.layerGroup.removeAllLayer()},e.prototype.zoomIn=function(){this.scene.zoomIn()},e.prototype.zoomOut=function(){this.scene.zoomOut()},e.prototype.setPitch=function(t){this.scene.setPitch(t)},e.prototype.fitBounds=function(t){this.scene.fitBounds(t)},e.prototype.setMapStatus=function(t){this.scene.setMapStatus(t)},e.prototype.setBgColor=function(t){this.scene.setBgColor(t)},e.prototype.initComponents=function(){this.initControls(),this.initTooltip()},e.prototype.updateComponents=function(){this.updateControls(),this.initTooltip()},e.prototype.initControls=function(){var t=this.options,e=t.zoom,n=t.scale,r=t.layerMenu,i=t.legend;n&&this.addScaleControl(n),e&&this.addZoomControl(e),r&&this.addLayerMenuControl(r),i&&this.addLegendControl(i)},e.prototype.updateControls=function(){var t=this.options,e=t.zoom,n=t.scale,r=t.layerMenu,i=t.legend;(0,u.isEqual)(this.lastOptions.zoom,e)||(e?this.updateZoomControl(e):this.removeZoomControl()),(0,u.isEqual)(this.lastOptions.scale,n)||(n?this.updateScaleControl(n):this.removeScaleControl()),(0,u.isEqual)(this.lastOptions.layerMenu,r)||(r?this.updateLayerMenuControl(r):this.removeLayerMenuControl()),(0,u.isEqual)(this.lastOptions.legend,i)||(i?this.updateLegendControl(i):this.removeLegendControl())},e.prototype.addZoomControl=function(t){this.zoomControl||(this.zoomControl=new a.Zoom(t),this.scene.addControl(this.zoomControl))},e.prototype.updateZoomControl=function(t){this.zoomControl?(this.removeZoomControl(),this.addZoomControl(t)):this.addZoomControl(t)},e.prototype.removeZoomControl=function(){this.zoomControl&&(this.zoomControl.remove(),this.zoomControl=void 0)},e.prototype.addScaleControl=function(t){this.scaleControl||(this.scaleControl=new a.Scale(t),this.scene.addControl(this.scaleControl))},e.prototype.updateScaleControl=function(t){this.scaleControl?(this.removeScaleControl(),this.addScaleControl(t)):this.addScaleControl(t)},e.prototype.removeScaleControl=function(){this.scaleControl&&(this.scaleControl.remove(),this.scaleControl=void 0)},e.prototype.addLayerMenuControl=function(t){if(!this.layerMenuControl){var e={};this.layerGroup.getLayers().forEach((function(t){var n=t.name,r=t.layer;e[n]=r})),this.layerMenuControl=new a.Layers(Object.assign({},t,{baseLayers:{},overlayers:e})),this.scene.addControl(this.layerMenuControl)}},e.prototype.updateLayerMenuControl=function(t){this.layerMenuControl?(this.removeLayerMenuControl(),this.addLayerMenuControl(t)):this.addLayerMenuControl(t)},e.prototype.removeLayerMenuControl=function(){this.layerMenuControl&&(this.layerMenuControl.remove(),this.layerMenuControl=void 0)},e.prototype.getLegendOptions=function(){return{}},e.prototype.addLegendControl=function(t){if(!this.legendControl){var e=this.theme.components.legend,n=(0,h.deepAssign)({},this.getLegendOptions(),t),i=n.type,o=n.position,a=(0,r.__rest)(n,["type","position"]),s=[];if("category"===i){var u=(0,h.deepAssign)({},{domStyles:e.category.domStyles},a);s.push({type:i,options:u})}else if("continue"===i){var l=(0,h.deepAssign)({},{domStyles:e.continue.domStyles},a);s.push({type:i,options:l})}s.length&&(this.legendControl=new c.Legend({position:o,items:s}),this.scene.addControl(this.legendControl))}},e.prototype.updateLegendControl=function(t){this.legendControl?(this.removeLegendControl(),this.addLegendControl(t)):this.addLegendControl(t)},e.prototype.removeLegendControl=function(){this.legendControl&&(this.legendControl.remove(),this.legendControl=void 0)},e.prototype.initTooltip=function(){var t=this;this.tooltip&&this.tooltip.destroy();var e=this.options.tooltip;if(e){var n=(0,h.deepAssign)({},{domStyles:this.theme.components.tooltip.domStyles},e),r=this.layerGroup.getInteractionLayers();this.tooltip=new l.Tooltip(this.scene,r,n),this.tooltip.on("*",(function(e){return t.emit(e.type,e)}))}},e.prototype.exportPng=function(t){return this.scene.exportPng(t)},e.prototype.destroy=function(){var e;t.prototype.off.call(this,"*"),this.removeScaleControl(),this.removeZoomControl(),this.removeLayerMenuControl(),this.removeLegendControl(),null===(e=this.tooltip)||void 0===e||e.destroy(),this.scene.destroy()},e.DefaultOptions=v,e}(s.default);e.Map=_},2397:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unregisterIconFont=e.registerIconFonts=e.registerIconFont=e.ICON_FONT_CACHE=e.unregisterFontFace=e.registerFontFace=e.FONT_FACE_CACHE=e.unregisterImage=e.hasImage=e.getImage=e.registerImages=e.registerImage=e.IMAGES_CACHE=void 0,e.IMAGES_CACHE=new Map,e.registerImage=function(t,n){e.IMAGES_CACHE.set(t,n)},e.registerImages=function(t){t.forEach((function(t){e.IMAGES_CACHE.set(t.id,t.image)}))},e.getImage=function(t){return e.IMAGES_CACHE.get(t)},e.hasImage=function(t){return e.IMAGES_CACHE.has(t)},e.unregisterImage=function(t){return e.IMAGES_CACHE.delete(t)},e.FONT_FACE_CACHE=new Map,e.registerFontFace=function(t,n){e.FONT_FACE_CACHE.set(t,n)},e.unregisterFontFace=function(t){return e.FONT_FACE_CACHE.delete(t)},e.ICON_FONT_CACHE=new Map,e.registerIconFont=function(t,n){e.ICON_FONT_CACHE.set(t,n)},e.registerIconFonts=function(t){t.forEach((function(t){e.ICON_FONT_CACHE.set(t.name,t.fontUnicode)}))},e.unregisterIconFont=function(t){return e.ICON_FONT_CACHE.delete(t)}},9555:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plot=void 0;var r=n(7768),i=n(708),o=n(1359),a=n(9183),s=n(7039),u=n(5712),l=n(4859),c=n(8976),h={autoFit:!1},p=function(t){function e(e,n){var r=this;if("string"==typeof e||e instanceof Element){if(void 0===n)throw new Error("options is undefined");(r=t.call(this,n)||this).container=r.createContainer(e),r.theme=r.createTheme(),r.scene=r.createScene(),r.registerResources(),r.initSource()}else r=t.call(this,e)||this;return r}return(0,r.__extends)(e,t),e.prototype.initSource=function(){this.source=this.createSource(),this.render(),this.inited=!0},e.prototype.initLayersEvent=function(){},e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createSource=function(){var t=this.options.source,e=t.data,n=t.aggregation,i=(0,r.__rest)(t,["data","aggregation"]);return n&&u.MappingSource.aggregation(i,n),new s.Source(e,i)},e.prototype.createLabelLayer=function(t,e,n){var i=n||{},o=i.visible,s=i.minZoom,u=i.maxZoom,l=i.zIndex,c=void 0===l?0:l;return new a.TextLayer((0,r.__assign)({name:"labelLayer",visible:o,minZoom:s,maxZoom:u,zIndex:c+.1,source:t},e))},e.prototype.updateLabelLayer=function(t,e,n,i){e?i?i.update((0,r.__assign)({},e)):(i=this.createLabelLayer(t,e,n),this.layerGroup.addLayer(i)):!1===e&&i&&this.layerGroup.removeLayer(i)},e.prototype.render=function(){var t=this,e=this.createLayers(this.source);this.inited?(this.layerGroup.removeAllLayer(),e.addTo(this.scene),this.layerGroup=e):(this.layerGroup=e,this.scene.sceneService.loaded?this.onSceneLoaded():this.scene.once("loaded",(function(){t.onSceneLoaded()}))),this.initLayersEvent()},e.prototype.onSceneLoaded=function(){var t=this;this.sceneLoaded=!0,this.layerGroup.isEmpty()?this.onLayersLoaded():this.layerGroup.once("inited-all",(function(){t.onLayersLoaded()})),this.layerGroup.addTo(this.scene)},e.prototype.onLayersLoaded=function(){this.layersLoaded=!0,this.initComponents(),this.loaded=!0,this.emit("loaded")},e.prototype.attachToScene=function(t,e){this.scene=t,this.theme=e||(0,c.getTheme)("default"),this.registerResources(),this.initSource()},e.prototype.unattachFromScene=function(){var t;this.removeAllLayer(),null===(t=this.tooltip)||void 0===t||t.destroy()},e.prototype.addToScene=function(t){this.attachToScene(t)},e.prototype.removeFromScene=function(){var t;this.removeAllLayer(),this.removeScaleControl(),this.removeZoomControl(),this.removeLayerMenuControl(),this.removeLegendControl(),null===(t=this.tooltip)||void 0===t||t.destroy()},e.prototype.update=function(t){if(this.updateOption(t),t.map&&!(0,l.isEqual)(this.lastOptions.map,this.options.map)&&this.updateMap(t.map),this.scene.setEnableRender(!1),t.source&&!(0,l.isEqual)(this.lastOptions.source,this.options.source)){var e=t.source,n=e.data,i=(0,r.__rest)(e,["data"]);this.changeData(n,i)}this.scene.setEnableRender(!0),this.render(),this.updateComponents(),this.emit("update")},e.prototype.changeData=function(t,e){var n=this;this.options.source=(0,o.deepAssign)({},this.options.source,(0,r.__assign)({data:t},e));var i=this.options.source,a=i.aggregation,s=(0,r.__rest)(i,["aggregation"]);a&&u.MappingSource.aggregation(s,a),this.source.setData(this.options.source.data,s);var l=this.options.legend;l&&setTimeout((function(){n.updateLegendControl(l)})),this.emit("change-data")},e.DefaultOptions=h,e.PlotType=s.PlotType,e}(i.Map);e.Plot=p},210:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Choropleth=e.Area=e.Flow=e.Path=e.Hexbin=e.Grid=e.Heatmap=e.DotDensity=e.Dot=e.PrismLayer=e.AreaLayer=e.ArcLayer=e.PathLayer=e.HexbinLayer=e.GridLayer=e.HeatmapLayer=e.TextLayer=e.DotDensityLayer=e.IconLayer=e.DotLayer=e.L7Plot=e.Plot=e.Map=e.registerTheme=e.getTheme=e.unregisterIconFont=e.registerIconFonts=e.registerIconFont=e.unregisterFontFace=e.registerFontFace=e.unregisterImage=e.registerImages=e.registerImage=e.version=void 0;var r=n(7768),i=n(1274);Object.defineProperty(e,"version",{enumerable:!0,get:function(){return(0,r.__importDefault)(i).default}});var o=n(2397);Object.defineProperty(e,"registerImage",{enumerable:!0,get:function(){return o.registerImage}}),Object.defineProperty(e,"registerImages",{enumerable:!0,get:function(){return o.registerImages}}),Object.defineProperty(e,"unregisterImage",{enumerable:!0,get:function(){return o.unregisterImage}}),Object.defineProperty(e,"registerFontFace",{enumerable:!0,get:function(){return o.registerFontFace}}),Object.defineProperty(e,"unregisterFontFace",{enumerable:!0,get:function(){return o.unregisterFontFace}}),Object.defineProperty(e,"registerIconFont",{enumerable:!0,get:function(){return o.registerIconFont}}),Object.defineProperty(e,"registerIconFonts",{enumerable:!0,get:function(){return o.registerIconFonts}}),Object.defineProperty(e,"unregisterIconFont",{enumerable:!0,get:function(){return o.unregisterIconFont}});var a=n(8976);Object.defineProperty(e,"getTheme",{enumerable:!0,get:function(){return a.getTheme}}),Object.defineProperty(e,"registerTheme",{enumerable:!0,get:function(){return a.registerTheme}}),(0,r.__exportStar)(n(7039),e);var s=n(708);Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return s.Map}});var u=n(9555);Object.defineProperty(e,"Plot",{enumerable:!0,get:function(){return u.Plot}});var l=n(2827);Object.defineProperty(e,"L7Plot",{enumerable:!0,get:function(){return l.L7Plot}});var c=n(3361);Object.defineProperty(e,"DotLayer",{enumerable:!0,get:function(){return c.DotLayer}});var h=n(3990);Object.defineProperty(e,"IconLayer",{enumerable:!0,get:function(){return h.IconLayer}});var p=n(5108);Object.defineProperty(e,"DotDensityLayer",{enumerable:!0,get:function(){return p.DotDensityLayer}});var f=n(9183);Object.defineProperty(e,"TextLayer",{enumerable:!0,get:function(){return f.TextLayer}});var d=n(7664);Object.defineProperty(e,"HeatmapLayer",{enumerable:!0,get:function(){return d.HeatmapLayer}});var m=n(4267);Object.defineProperty(e,"GridLayer",{enumerable:!0,get:function(){return m.GridLayer}});var g=n(8682);Object.defineProperty(e,"HexbinLayer",{enumerable:!0,get:function(){return g.HexbinLayer}});var y=n(518);Object.defineProperty(e,"PathLayer",{enumerable:!0,get:function(){return y.PathLayer}});var v=n(4836);Object.defineProperty(e,"ArcLayer",{enumerable:!0,get:function(){return v.ArcLayer}});var _=n(3198);Object.defineProperty(e,"AreaLayer",{enumerable:!0,get:function(){return _.AreaLayer}});var b=n(6930);Object.defineProperty(e,"PrismLayer",{enumerable:!0,get:function(){return b.PrismLayer}});var x=n(9683);Object.defineProperty(e,"Dot",{enumerable:!0,get:function(){return x.Dot}});var w=n(3586);Object.defineProperty(e,"DotDensity",{enumerable:!0,get:function(){return w.DotDensity}});var S=n(1879);Object.defineProperty(e,"Heatmap",{enumerable:!0,get:function(){return S.Heatmap}});var E=n(2596);Object.defineProperty(e,"Grid",{enumerable:!0,get:function(){return E.Grid}});var M=n(3238);Object.defineProperty(e,"Hexbin",{enumerable:!0,get:function(){return M.Hexbin}});var T=n(6770);Object.defineProperty(e,"Path",{enumerable:!0,get:function(){return T.Path}});var A=n(7744);Object.defineProperty(e,"Flow",{enumerable:!0,get:function(){return A.Flow}});var C=n(3599);Object.defineProperty(e,"Area",{enumerable:!0,get:function(){return C.Area}});var O=n(3946);Object.defineProperty(e,"Choropleth",{enumerable:!0,get:function(){return O.Choropleth}})},4836:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArcLayer=void 0;var r=n(7768),i=n(1359),o=n(8958),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.LinesLayer.LayerType.ArcLayer,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,i.deepAssign)({},o.LinesLayer.DefaultOptions,{shape:"arc"})},e}(o.LinesLayer);e.ArcLayer=a},8242:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=e.getDefaultState=void 0;var r=n(4859),i=n(3717),o="#2f54eb",a={active:{fill:!1,stroke:o,lineWidth:1.5,lineOpacity:.8},select:{fill:!1,stroke:o,lineWidth:1.5,lineOpacity:.8}};e.getDefaultState=function(t){return(0,r.isUndefined)(t)||(!1===t.active?a.active=Object.assign(a.active,{fill:!1,stroke:!1}):"object"==typeof t.active&&(!1===t.active.fill?a.active.fill=!1:"string"==typeof t.active.fill&&(a.active.fill=t.active.fill),!1===t.active.stroke?a.active.stroke=!1:"string"==typeof t.active.stroke&&(a.active.stroke=t.active.stroke),"number"==typeof t.active.lineWidth&&(a.active.lineWidth=t.active.lineWidth),"number"==typeof t.active.lineOpacity&&(a.active.lineOpacity=t.active.lineOpacity)),!1===t.select?a.select=Object.assign(a.select,{fill:!1,stroke:!1}):"object"==typeof t.select&&(!1===t.select.fill?a.select.fill=!1:"string"==typeof t.select.fill&&(a.select.fill=t.select.fill),!1===t.select.stroke?a.select.stroke=!1:"string"==typeof t.select.stroke&&(a.select.stroke=t.select.stroke),"number"==typeof t.select.lineWidth&&(a.select.lineWidth=t.select.lineWidth),"number"==typeof t.select.lineOpacity&&(a.select.lineOpacity=t.select.lineOpacity))),a},e.mappingLayer=function(t,n,r,o,a,s){var u=s.color,l=s.style,c=s.state,h=(0,e.getDefaultState)(c),p={active:!1!==h.active.fill&&{color:h.active.fill},select:!1},f={opacity:null==l?void 0:l.opacity},d=null==l?void 0:l.fillBottomColor,m=null==l?void 0:l.lineWidth,g=null==l?void 0:l.stroke,y={opacity:null==l?void 0:l.lineOpacity,dashArray:null==l?void 0:l.lineDash,lineType:null==l?void 0:l.lineType};if(i.MappingLayer.shape(t,"fill"),u&&i.MappingLayer.color(t,u),f&&i.MappingLayer.style(t,f),p&&i.MappingLayer.state(t,p),d&&t.setBottomColor(d),i.MappingLayer.shape(n,"line"),m&&i.MappingLayer.size(n,m),g&&i.MappingLayer.color(n,g),y&&i.MappingLayer.style(n,y),h.active.stroke){var v=h.active.stroke,_=h.active.lineWidth||m,b={opacity:h.active.lineOpacity};i.MappingLayer.shape(r,"line"),_&&i.MappingLayer.size(r,_),v&&i.MappingLayer.color(r,v),b&&i.MappingLayer.style(r,b)}if(h.select.fill){var x=h.select.fill;i.MappingLayer.shape(o,"fill"),x&&i.MappingLayer.color(o,x),f&&i.MappingLayer.style(o,f),i.MappingLayer.state(o,{select:!1,active:!1})}if(h.select.stroke){var w=h.select.stroke,S=(_=h.select.lineWidth||m,{opacity:h.select.lineOpacity});i.MappingLayer.shape(a,"line"),_&&i.MappingLayer.size(a,_),w&&i.MappingLayer.color(a,w),S&&i.MappingLayer.style(a,S)}}},3198:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AreaLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(8242),u=n(1993),l={visible:!0,state:{active:!1,select:!1},enabledMultiSelect:!1},c=["color","style","state","enabledMultiSelect"],h=function(t){function e(e){var n=t.call(this,e)||this;n.selectData=[],n.type=a.PlotLayer.LayerType.AreaLayer,n.interaction=!0,n.onHighlighHandle=function(t){var e=t.feature,r=t.featureId;n.setHighlightLayerSource(e,r)},n.onUnhighlighHandle=function(){n.setHighlightLayerSource()},n.onSelectHandle=function(t){var e=n.options.enabledMultiSelect,r=t.feature,o=t.featureId,a=(0,i.clone)(n.selectData),s=a.findIndex((function(t){return t.featureId===o}));if(-1===s)e?a.push({feature:r,featureId:o}):a=[{feature:r,featureId:o}],n.emit("select",r,(0,i.clone)(a));else{var u=a[s];e?a.splice(s,1):a=[],n.emit("unselect",u,(0,i.clone)(a))}n.setSelectLayerSource(a)};var u=n.options,l=u.name,c=u.source,h=u.visible,p=u.minZoom,f=u.maxZoom,d=u.zIndex,m=void 0===d?0:d,g=n.pickLayerConfig(n.options),y=(0,s.getDefaultState)(n.options.state);return n.name=l||(0,i.uniqueId)(n.type),n.layer=new o.PolygonLayer((0,r.__assign)((0,r.__assign)({},g),{name:n.name})),n.strokeLayer=new o.LineLayer({name:"strokeLayer",visible:h,zIndex:m,minZoom:p,maxZoom:f}),n.highlightLayer=new o.LineLayer({name:"highlightLayer",visible:h&&Boolean(y.active.stroke),zIndex:m+.1,minZoom:p,maxZoom:f}),n.selectFillLayer=new o.PolygonLayer({name:"selectFillLayer",visible:h&&Boolean(y.select.fill),zIndex:m+.1,minZoom:p,maxZoom:f}),n.selectStrokeLayer=new o.LineLayer({name:"selectStrokeLayer",visible:h&&Boolean(y.select.stroke),zIndex:m+.1,minZoom:p,maxZoom:f}),n.mappingLayer(n.options),n.setSource(c),n.initEvent(),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return l},e.prototype.mappingLayer=function(t){(0,s.mappingLayer)(this.layer,this.strokeLayer,this.highlightLayer,this.selectFillLayer,this.selectStrokeLayer,t)},e.prototype.setSource=function(e){t.prototype.setSource.call(this,e),this.setStrokeLayerSource(),this.setHighlightLayerSource(),this.selectFillLayer.source({type:"FeatureCollection",features:[]},{parser:{type:"geojson"}}),this.selectStrokeLayer.source({type:"FeatureCollection",features:[]},{parser:{type:"geojson"}})},e.prototype.setStrokeLayerSource=function(){var t=this.layer.getSource();if(t)this.strokeLayer.setSource(t);else{var e=this.layer.sourceOption,n=e.data,r=e.options;this.strokeLayer.source(n,r)}},e.prototype.setHighlightLayerSource=function(t,e){if(void 0===e&&(e=-999),this.highlightLayerData!==e){var n=t?[t]:[];this.highlightLayer.setData({type:"FeatureCollection",features:n},{parser:{type:"geojson"}}),this.highlightLayerData=e}},e.prototype.setSelectLayerSource=function(t){if(void 0===t&&(t=[]),this.selectData.length!==t.length||!(0,i.isEqual)(this.selectData.map((function(t){return t.featureId})),t.map((function(t){return t.featureId})))){var e=t.map((function(t){return t.feature}));this.selectFillLayer.setData({type:"FeatureCollection",features:e},{parser:{type:"geojson"}}),this.selectStrokeLayer.setData({type:"FeatureCollection",features:e},{parser:{type:"geojson"}}),this.selectData=t}},e.prototype.initEvent=function(){this.layer.off("mousemove",this.onHighlighHandle),this.layer.off("unmousemove",this.onHighlighHandle),this.layer.off("click",this.onSelectHandle),this.selectData=[],this.highlightLayerData=null,this.options.state&&(this.options.state.active&&(this.layer.on("mousemove",this.onHighlighHandle),this.layer.on("unmousemove",this.onUnhighlighHandle)),this.options.state.select&&this.layer.on("click",this.onSelectHandle))},e.prototype.addTo=function(t){t.addLayer(this.layer),t.addLayer(this.strokeLayer),t.addLayer(this.highlightLayer),t.addLayer(this.selectFillLayer),t.addLayer(this.selectStrokeLayer)},e.prototype.remove=function(t){t.removeLayer(this.layer),t.removeLayer(this.strokeLayer),t.removeLayer(this.highlightLayer),t.removeLayer(this.selectFillLayer),t.removeLayer(this.selectStrokeLayer)},e.prototype.update=function(e){if(t.prototype.update.call(this,e),this.mappingLayer(this.options),this.options.visible){(0,i.isUndefined)(e.state)||(0,i.isEqual)(this.lastOptions.state,this.options.state)||this.updateHighlightLayer();var n=(0,s.getDefaultState)(this.options.state);n.active.stroke&&this.setHighlightLayerSource(),(n.select.fill||n.select.stroke)&&this.setSelectLayerSource()}this.initEvent()},e.prototype.updateHighlightLayer=function(){var t=(0,s.getDefaultState)(this.options.state),e=(0,s.getDefaultState)(this.lastOptions.state);e.active.stroke!==t.active.stroke&&(t.active.stroke?this.highlightLayer.show():this.highlightLayer.hide()),e.select.fill!==t.select.fill&&(t.select.fill?this.selectFillLayer.show():this.selectFillLayer.hide()),e.select.stroke!==t.select.stroke&&(t.select.stroke?this.selectStrokeLayer.show():this.selectStrokeLayer.hide())},e.prototype.setIndex=function(t){this.layer.setIndex(t),this.strokeLayer.setIndex(t),this.highlightLayer.setIndex(t+.1),this.selectFillLayer.setIndex(t+.1),this.selectStrokeLayer.setIndex(t+.1)},e.prototype.setMinZoom=function(t){this.layer.setMinZoom(t),this.strokeLayer.setMinZoom(t),this.highlightLayer.setMinZoom(t),this.selectFillLayer.setMinZoom(t),this.selectStrokeLayer.setMinZoom(t)},e.prototype.setMaxZoom=function(t){this.layer.setMaxZoom(t),this.strokeLayer.setMaxZoom(t),this.highlightLayer.setMaxZoom(t),this.selectFillLayer.setMaxZoom(t),this.selectStrokeLayer.setMaxZoom(t)},e.prototype.show=function(){this.layer.inited&&(this.layer.show(),this.strokeLayer.show(),this.selectFillLayer.show(),this.selectStrokeLayer.show())},e.prototype.hide=function(){this.layer.inited&&(this.layer.hide(),this.strokeLayer.hide(),this.selectFillLayer.hide(),this.selectStrokeLayer.hide())},e.prototype.getColorLegendItems=function(){var t=this.layer.getLegendItems("color");return Array.isArray(t)&&0!==t.length?(0,u.getColorLegendItems)(t):[]},e.prototype.setActive=function(t){},e.prototype.setSelect=function(t){},e.DefaultOptions=l,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(c),e}(a.PlotLayer);e.AreaLayer=h},6895:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColumnLayer=void 0;var r=n(7768),i=n(1359),o=n(3361),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.DotLayer.LayerType.ColumnLayer,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,i.deepAssign)({},o.DotLayer.DefaultOptions,{shape:"cylinder"})},e}(o.DotLayer);e.ColumnLayer=a},5108:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DotDensityLayer=void 0;var r=n(7768),i=n(1359),o=n(3361),a=["color","size","style","state","animate"],s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.DotLayer.LayerType.DotDensity,e.interaction=!1,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,i.deepAssign)({},o.DotLayer.DefaultOptions,{shape:"dot",size:1})},e.LayerOptionsKeys=o.DotLayer.LayerConfigkeys.concat(a),e}(o.DotLayer);e.DotDensityLayer=s},599:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=void 0;var r=n(3717);e.mappingLayer=function(t,e){var n=e.shape,i=e.color,o=e.size,a=e.style,s=e.state,u=e.animate;n&&r.MappingLayer.shape(t,n),o&&r.MappingLayer.size(t,o),i&&r.MappingLayer.color(t,i),a&&r.MappingLayer.style(t,a),s&&r.MappingLayer.state(t,s),u&&r.MappingLayer.animate(t,u)}},1993:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getColorLegendItems=void 0;var r=n(7768),i=n(8665);e.getColorLegendItems=function(t){return function(t){return!Array.isArray(t[0].value)}(t)?t:t.map((function(t){return(0,r.__assign)((0,r.__assign)({},t),{value:[(0,i.round)(t.value[0],2),(0,i.round)(t.value[1],2)]})}))}},3361:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DotLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(599),u=n(1993),l={source:{data:[],parser:{type:"json",x:"x",y:"y"}},shape:"circle",size:12,color:"#5FD3A6"},c=["shape","color","size","style","state","animate"],h=function(t){function e(e){var n=t.call(this,e)||this;n.type=a.PlotLayer.LayerType.DotLayer,n.interaction=!0;var s=n.options,u=s.name,l=s.source,c=n.pickLayerConfig(n.options);return n.name=u||(0,i.uniqueId)(n.type),n.layer=new o.PointLayer((0,r.__assign)((0,r.__assign)({},c),{name:n.name})),n.mappingLayer(n.layer,n.options),n.setSource(l),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return l},e.prototype.mappingLayer=function(t,e){(0,s.mappingLayer)(t,e)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.mappingLayer(this.layer,this.options)},e.prototype.getColorLegendItems=function(){var t=this.layer.getLegendItems("color");return Array.isArray(t)&&0!==t.length?(0,u.getColorLegendItems)(t):[]},e.DefaultOptions=l,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(c),e}(a.PlotLayer);e.DotLayer=h},9745:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=void 0;var r=n(3717);e.mappingLayer=function(t,e){var n=e.shape,i=e.color,o=e.size,a=e.style,s=e.state;n&&r.MappingLayer.shape(t,n),o&&r.MappingLayer.size(t,o),i&&r.MappingLayer.color(t,i),a&&r.MappingLayer.style(t,a),s&&r.MappingLayer.state(t,s)}},4267:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GridLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(9745),u={source:{data:[],parser:{type:"json",x:"x",y:"y"},aggregation:{type:"grid",field:"",radius:15e3,method:"sum"}},shape:"square",color:"#5FD3A6",style:{coverage:.9,angle:0,opacity:1}},l=["shape","color","size","style","state"],c=function(t){function e(e){var n=t.call(this,e)||this;n.type=a.PlotLayer.LayerType.GridLayer,n.interaction=!1;var s=n.options,u=s.name,l=s.source,c=n.pickLayerConfig(n.options);return n.name=u||(0,i.uniqueId)(n.type),n.layer=new o.HeatmapLayer((0,r.__assign)((0,r.__assign)({},c),{name:n.name})),n.mappingLayer(n.layer,n.options),n.setSource(l),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return u},e.prototype.mappingLayer=function(t,e){(0,s.mappingLayer)(t,e)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.mappingLayer(this.layer,this.options)},e.DefaultOptions=u,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(l),e}(a.PlotLayer);e.GridLayer=c},7514:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=void 0;var r=n(3717);e.mappingLayer=function(t,e){var n=e.shape,i=e.size,o=e.style,a=e.state;n&&r.MappingLayer.shape(t,n),i&&r.MappingLayer.size(t,i),o&&("colorsRamp"in o&&(o.rampColors=function(t){var e=t.colorsRamp,n={colors:[],positions:[]};return e.forEach((function(t){var e=t.color,r=t.position;n.colors.push(e),n.positions.push(r)})),n}(o)),r.MappingLayer.style(t,o)),a&&r.MappingLayer.state(t,a)}},7664:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeatmapLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(7514),u={source:{data:[],parser:{type:"json",x:"x",y:"y"}},shape:"heatmap",size:{value:[0,1]},style:{intensity:3,radius:20,opacity:1,colorsRamp:[{color:"rgba(33,102,172,0.0)",position:0},{color:"rgb(103,169,207)",position:.2},{color:"rgb(209,229,240)",position:.4},{color:"rgb(253,219,199)",position:.6},{color:"rgb(239,138,98)",position:.8},{color:"rgb(178,24,43,1.0)",position:1}]}},l=["shape","color","size","style","state"],c=function(t){function e(e){var n=t.call(this,e)||this;n.type=a.PlotLayer.LayerType.HeatmapLayer,n.interaction=!1;var s=n.options,u=s.name,l=s.source,c=n.pickLayerConfig(n.options);return n.name=u||(0,i.uniqueId)(n.type),n.layer=new o.HeatmapLayer((0,r.__assign)((0,r.__assign)({},c),{name:n.name})),n.mappingLayer(n.layer,n.options),n.setSource(l),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return u},e.prototype.mappingLayer=function(t,e){(0,s.mappingLayer)(t,e)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.mappingLayer(this.layer,this.options)},e.DefaultOptions=u,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(l),e}(a.PlotLayer);e.HeatmapLayer=c},44:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=void 0;var r=n(3717);e.mappingLayer=function(t,e){var n=e.shape,i=e.color,o=e.size,a=e.style,s=e.state;n&&r.MappingLayer.shape(t,n),o&&r.MappingLayer.size(t,o),i&&r.MappingLayer.color(t,i),a&&r.MappingLayer.style(t,a),s&&r.MappingLayer.state(t,s)}},8682:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HexbinLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(44),u={source:{data:[],parser:{type:"json",x:"x",y:"y"},aggregation:{type:"hexagon",field:"",radius:15e3,method:"sum"}},shape:"hexagon",color:"#5FD3A6",style:{coverage:.9,angle:0,opacity:1}},l=["shape","color","size","style","state"],c=function(t){function e(e){var n=t.call(this,e)||this;n.type=a.PlotLayer.LayerType.HexbinLayer,n.interaction=!1;var s=n.options,u=s.name,l=s.source,c=n.pickLayerConfig(n.options);return n.name=u||(0,i.uniqueId)(n.type),n.layer=new o.HeatmapLayer((0,r.__assign)((0,r.__assign)({},c),{name:n.name})),n.mappingLayer(n.layer,n.options),n.setSource(l),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return u},e.prototype.mappingLayer=function(t,e){(0,s.mappingLayer)(t,e)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.mappingLayer(this.layer,this.options)},e.DefaultOptions=u,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(l),e}(a.PlotLayer);e.HexbinLayer=c},3990:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IconLayer=void 0;var r=n(7768),i=n(1359),o=n(3361),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.DotLayer.LayerType.IconLayer,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,i.deepAssign)({},o.DotLayer.DefaultOptions,{color:void 0})},e}(o.DotLayer);e.IconLayer=a},1088:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=void 0;var r=n(3717);e.mappingLayer=function(t,e){var n=e.shape,i=e.color,o=e.size,a=e.style,s=e.state,u=e.animate,l=e.texture;n&&r.MappingLayer.shape(t,n),o&&r.MappingLayer.size(t,o),i&&r.MappingLayer.color(t,i),a&&r.MappingLayer.style(t,a),s&&r.MappingLayer.state(t,s),u&&r.MappingLayer.animate(t,u),l&&r.MappingLayer.texture(t,l)}},8958:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinesLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(1088),u=n(1993),l={},c=["shape","color","size","style","state","animate"],h=function(t){function e(e){var n=t.call(this,e)||this;n.type=a.PlotLayer.LayerType.LinesLayer,n.interaction=!0;var s=n.options,u=s.name,l=s.source,c=n.pickLayerConfig(n.options);return n.name=u||(0,i.uniqueId)(n.type),n.layer=new o.LineLayer((0,r.__assign)((0,r.__assign)({},c),{name:n.name})),n.mappingLayer(n.layer,n.options),n.setSource(l),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return l},e.prototype.mappingLayer=function(t,e){(0,s.mappingLayer)(t,e)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.mappingLayer(this.layer,this.options)},e.prototype.getColorLegendItems=function(){var t=this.layer.getLegendItems("color");return Array.isArray(t)&&0!==t.length?(0,u.getColorLegendItems)(t):[]},e.DefaultOptions=l,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(c),e}(a.PlotLayer);e.LinesLayer=h},518:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PathLayer=void 0;var r=n(7768),i=n(1359),o=n(8958),a=["color","size","style","state","animate"],s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.LinesLayer.LayerType.PathLayer,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,i.deepAssign)({},o.LinesLayer.DefaultOptions,{shape:"line"})},e.LayerOptionsKeys=o.LinesLayer.LayerConfigkeys.concat(a),e}(o.LinesLayer);e.PathLayer=s},8197:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=void 0;var r=n(3717);e.mappingLayer=function(t,e){var n=e.color,i=e.size,o=e.style,a=e.state;r.MappingLayer.shape(t,"extrude"),i&&r.MappingLayer.size(t,i),n&&r.MappingLayer.color(t,n),o&&r.MappingLayer.style(t,o),a&&r.MappingLayer.state(t,a)}},6930:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrismLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(8197),u=n(1993),l={},c=["color","size","style","state"],h=function(t){function e(e){var n=t.call(this,e)||this;n.type=a.PlotLayer.LayerType.PrismLayer,n.interaction=!0;var s=n.options,u=s.name,l=s.source,c=n.pickLayerConfig(n.options);return n.name=u||(0,i.uniqueId)(n.type),n.layer=new o.PolygonLayer((0,r.__assign)((0,r.__assign)({},c),{name:n.name})),n.mappingLayer(n.layer,n.options),n.setSource(l),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return l},e.prototype.mappingLayer=function(t,e){(0,s.mappingLayer)(t,e)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.mappingLayer(this.layer,this.options)},e.prototype.getColorLegendItems=function(){var t=this.layer.getLegendItems("color");return Array.isArray(t)&&0!==t.length?(0,u.getColorLegendItems)(t):[]},e.DefaultOptions=l,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(c),e}(a.PlotLayer);e.PrismLayer=h},8827:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mappingLayer=void 0;var r=n(3717);e.mappingLayer=function(t,e){var n=e.field,i=e.content,o=e.style,a=void 0===o?{}:o,s=e.state,u=a.fontSize,l=a.fill,c={field:n||i||"",value:"text"};r.MappingLayer.shape(t,c),u&&r.MappingLayer.size(t,u),l&&r.MappingLayer.color(t,l),a&&r.MappingLayer.style(t,a),s&&r.MappingLayer.state(t,s)}},9183:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayer=void 0;var r=n(7768),i=n(4859),o=n(1301),a=n(8295),s=n(8827),u={style:{fontSize:12}},l=[],c=function(t){function e(e){var n=t.call(this,e)||this;n.type=a.PlotLayer.LayerType.TextLayer,n.interaction=!1;var s=n.options,u=s.name,l=s.source,c=n.pickLayerConfig(n.options);return n.name=u||(0,i.uniqueId)(n.type),n.layer=new o.PointLayer((0,r.__assign)((0,r.__assign)({},c),{name:n.name})),n.mappingLayer(n.layer,n.options),n.setSource(l),n}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return u},e.prototype.mappingLayer=function(t,e){(0,s.mappingLayer)(t,e)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.mappingLayer(this.layer,this.options)},e.DefaultOptions=u,e.LayerOptionsKeys=a.PlotLayer.LayerConfigkeys.concat(l),e}(a.PlotLayer);e.TextLayer=c},2827:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.L7Plot=void 0;var r=n(7768),i=n(4859),o=n(708),a=n(1359),s=n(6496),u=n(4303),l={},c=function(t){function e(e,n){var r=t.call(this,n)||this;return r.plots=[],r.container=r.createContainer(e),r.theme=r.createTheme(),r.scene=r.createScene(),r.registerResources(),r.render(),r.inited=!0,r}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return(0,a.deepAssign)({},o.Map.DefaultOptions,e.DefaultOptions)},e.prototype.createLayers=function(){for(var t=new s.LayerGroup([]),e=this.options.layers||[],n=0;n<e.length;n++){var r=this.createLayer(e[n]);t.addLayer(r)}return t},e.prototype.createLayer=function(t){var e=t.type,n=(0,r.__rest)(t,["type"]),o=u.LAYERS_MAP[e];if((0,i.isUndefined)(o))throw new Error("Don't exist ".concat(e," layer"));return new o(n)},e.prototype.addLayer=function(e){if(function(t){return"function"==typeof t.render}(e))t.prototype.addLayer.call(this,e);else{var n=this.createLayer(e);t.prototype.addLayer.call(this,n)}},e.prototype.removeLayerByName=function(t){var e=this.layerGroup.getLayerByName(t);return!!e&&this.layerGroup.removeLayer(e)},e.prototype.updateLayers=function(t){},e.prototype.updatePlots=function(t){},e.prototype.render=function(){var t=this,e=this.createLayers();this.inited?(this.layerGroup.removeAllLayer(),e.addTo(this.scene),this.layerGroup=e,this.updateControls()):(this.layerGroup=e,this.scene.sceneService.loaded?this.onSceneLoaded():this.scene.once("loaded",(function(){t.onSceneLoaded()})))},e.prototype.onSceneLoaded=function(){var t=this;this.sceneLoaded=!0,this.layerGroup.isEmpty()?this.onLayersLoaded():this.layerGroup.once("inited-all",(function(){t.onLayersLoaded()})),this.layerGroup.addTo(this.scene)},e.prototype.onLayersLoaded=function(){this.layersLoaded=!0,this.renderPlots(),this.initControls(),this.loaded=!0,this.emit("loaded")},e.prototype.renderPlots=function(){for(var t=this.options.plots||[],e=0;e<t.length;e++){var n=t[e],r=this.createPlot(n);this.plots.push(r)}},e.prototype.createPlot=function(t){var e=t.type,n=(t.legend,t.layerMenu,(0,r.__rest)(t,["type","legend","layerMenu"])),o=u.PLOTS_MAP[e];if((0,i.isUndefined)(o))throw new Error("Don't exist ".concat(e," plot"));var a=new o(n);return a.attachToScene(this.scene,this.theme),a},e.prototype.addPlot=function(t){var e=this.createPlot(t);this.plots.push(e)},e.prototype.getPlots=function(){return this.plots},e.prototype.getPlotByName=function(t){return this.plots.find((function(e){var n;return(null===(n=e.options)||void 0===n?void 0:n.name)===t}))},e.prototype.removePlotByName=function(t){var e=this.plots.findIndex((function(e){var n;return(null===(n=e.options)||void 0===n?void 0:n.name)===t}));return-1!==e&&((0,r.__read)(this.plots.splice(e,1),1)[0].unattachFromScene(),!0)},e.prototype.removeAllPlot=function(){this.plots.forEach((function(t){t.unattachFromScene()})),this.plots=[]},e.DefaultOptions=l,e}(o.Map);e.L7Plot=c},4303:(t,e,n)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.LAYERS_MAP=e.PLOTS_MAP=void 0;var o=n(7039),a=n(9683),s=n(3586),u=n(1879),l=n(2596),c=n(3238),h=n(6770),p=n(7744),f=n(3599),d=n(3946),m=n(9183),g=n(3361),y=n(3990),v=n(6895),_=n(5108),b=n(4267),x=n(8682),w=n(518),S=n(4836),E=n(7664),M=n(3198),T=n(6930);e.PLOTS_MAP=((r={})[o.PlotType.Dot]=a.Dot,r[o.PlotType.DotDensity]=s.DotDensity,r[o.PlotType.Heatmap]=u.Heatmap,r[o.PlotType.Grid]=l.Grid,r[o.PlotType.Hexbin]=c.Hexbin,r[o.PlotType.Path]=h.Path,r[o.PlotType.Flow]=p.Flow,r[o.PlotType.Area]=f.Area,r[o.PlotType.Choropleth]=d.Choropleth,r),e.LAYERS_MAP=((i={})[o.LayerType.TextLayer]=m.TextLayer,i[o.LayerType.DotLayer]=g.DotLayer,i[o.LayerType.IconLayer]=y.IconLayer,i[o.LayerType.DotDensity]=_.DotDensityLayer,i[o.LayerType.ColumnLayer]=v.ColumnLayer,i[o.LayerType.HeatmapLayer]=E.HeatmapLayer,i[o.LayerType.GridLayer]=b.GridLayer,i[o.LayerType.HexbinLayer]=x.HexbinLayer,i[o.LayerType.PathLayer]=w.PathLayer,i[o.LayerType.ArcLayer]=S.ArcLayer,i[o.LayerType.AreaLayer]=M.AreaLayer,i[o.LayerType.PrismLayer]=T.PrismLayer,i)},2076:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:{type:"FeatureCollection",features:[]},parser:{type:"geojson"}}})},3599:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Area=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(2076),s=n(3198),u=n(6496),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Area,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){this.areaLayer=new s.AreaLayer((0,r.__assign)({source:t},(0,i.pick)(this.options,s.AreaLayer.LayerOptionsKeys)));var e=new u.LayerGroup([this.areaLayer]);return this.options.label&&(this.labelLayer=this.createLabelLayer(t,this.options.label,this.options),e.addLayer(this.labelLayer)),e},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,s.AreaLayer.LayerOptionsKeys);this.areaLayer.update(e),this.updateLabelLayer(this.source,t.label,this.options,this.labelLayer)},e.prototype.initLayersEvent=function(){},e.prototype.getLegendOptions=function(){var t=this.areaLayer.getColorLegendItems();return 0!==t.length?{type:"category",items:t}:{}},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.Area=l},2079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unregisterCacheArea=e.hasCacheArea=e.getCacheArea=e.registerCacheAreas=e.registerCacheArea=e.AREA_CACHE=void 0,e.AREA_CACHE=new Map,e.registerCacheArea=function(t,n){e.AREA_CACHE.set(t,n)},e.registerCacheAreas=function(t){t.forEach((function(t){e.AREA_CACHE.set(t.key,t.area)}))},e.getCacheArea=function(t){return e.AREA_CACHE.get(t)},e.hasCacheArea=function(t){return e.AREA_CACHE.has(t)},e.unregisterCacheArea=function(t){return e.AREA_CACHE.delete(t)}},2490:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CHINA_BOUNDARY_STYLE=e.GEO_AREA_URL=e.GEO_DATA_URL=e.DEFAULT_AREA_GRANULARITY=e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:[],joinBy:{geoField:"adcode"}},viewLevel:{level:"country",adcode:"100000"},chinaBorder:!0}),e.DEFAULT_AREA_GRANULARITY={world:"country",country:"province",province:"city",city:"district",district:"district"},e.GEO_DATA_URL="https://gw.alipayobjects.com/os/alisis/geo-data-v0.1.2",e.GEO_AREA_URL="".concat(e.GEO_DATA_URL,"/choropleth-data"),e.CHINA_BOUNDARY_STYLE={national:{color:"red",width:1,opacity:1},dispute:{color:"red",width:1,opacity:.8,dashArray:[1,6]},coast:{color:"blue",width:.7,opacity:.8},hkm:{color:"gray",width:.7,opacity:.8}}},6742:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDrillStepDefaultConfig=e.isEqualDrillSteps=e.topojson2geojson=e.getGeoAreaConfig=void 0;var r=n(7768),i=n(4859),o=(0,r.__importStar)(n(3273)),a=n(2490);e.getGeoAreaConfig=function(t){var e={url:a.GEO_AREA_URL,type:"topojson",extension:"topo.json"};return(0,i.isUndefined)(t)||("string"==typeof t?e.url=t:(e.url=(null==t?void 0:t.url)||a.GEO_AREA_URL,e.type=t.type,e.extension="topojson"===t.type?"topo.json":"json")),e},e.topojson2geojson=function(t){try{return o.feature(t,"json")}catch(t){throw new Error('Failed convert to geojson from topojson, topojson default layer name "json"')}},e.isEqualDrillSteps=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++){var r=t[n],i=r.level,o=r.granularity;if(e[n].level!==i||e[n].granularity!==o)return!1}return!0},e.getDrillStepDefaultConfig=function(t){return(0,i.pick)(t,["source","color","style","state","label","tooltip"])}},3946:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Choropleth=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(1359),s=n(2490),u=n(3198),l=n(9183),c=n(7039),h=n(6496),p=n(6867),f=n(2079),d=n(6742),m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Choropleth,e.chinaBoundaryData={type:"FeatureCollection",features:[]},e.currentDistrictData={type:"FeatureCollection",features:[]},e.drillSteps=[],e.drillStacks=[],e.onDrillDownHander=function(t){var n,i=e.options.drill,o=i.steps,u=i.onDown,l=null===(n=t.feature)||void 0===n?void 0:n.properties,c=l.adcode;if(e.drillStacks.length!==o.length+1){var h=e.drillStacks.slice(-1)[0],p=e.drillStacks.length-1,f=e.drillSteps[p],d=f.level,m=f.granularity,g=void 0===m?s.DEFAULT_AREA_GRANULARITY[d]:m,y=(0,r.__rest)(f,["level","granularity"]),v={from:{level:h.level,adcode:h.adcode,granularity:h.granularity},to:{level:d,adcode:c,granularity:g,properties:l}},_=function(t){void 0===t&&(t={});var n={level:d,adcode:c,granularity:g},r=(0,a.deepAssign)({},y,t);e.changeView(n,r).then((function(t){t&&(e.drillStacks.push(t),e.emit("drilldown",v))}))};u?u(v.from,v.to,_):_()}},e.onDrillUpHander=function(){var t=e.options.drill.onUp;if(0!==e.drillStacks.length&&1!==e.drillStacks.length){var n=e.drillStacks.length-1,r=e.drillStacks[n],i=e.drillStacks[n-1],o={from:{level:r.level,adcode:r.adcode,granularity:r.granularity},to:{level:i.level,adcode:i.adcode,granularity:i.granularity}},s=function(t){void 0===t&&(t={});var n=o.to,r=(0,a.deepAssign)({},i.config,t);e.changeView(n,r).then((function(t){t&&(e.drillStacks.pop(),e.emit("drillup",o))}))};t?t(o.from,o.to,s):s()}},e}return(0,r.__extends)(e,t),e.prototype.initSource=function(){var t=this;this.getInitDistrictData().then((function(){t.source=t.createSource(),t.render(),t.inited=!0}))},e.prototype.render=function(){var t=this;if(console.time("l7plot choropleth render time"),this.inited)this.scene.setEnableRender(!0),this.scene.render();else{var e=this.createLayers(this.source);this.layerGroup=e,this.scene.sceneService.loaded?this.onSceneLoaded():this.scene.once("loaded",(function(){t.onSceneLoaded()})),this.initLayersEvent()}console.timeEnd("l7plot choropleth render time")},e.prototype.update=function(t){var e,n,o,a=this;if(this.updateOption(t),t.map&&!(0,i.isEqual)(this.lastOptions.map,this.options.map)&&this.updateMap(t.map),t.drill&&!1!==t.drill.enabled&&!(0,i.isEqual)(null===(e=this.lastOptions.drill)||void 0===e?void 0:e.steps,null===(n=this.options.drill)||void 0===n?void 0:n.steps)&&(this.drillReset(),this.initDrillEvent()),this.scene.setEnableRender(!1),t.viewLevel&&!(0,i.isEqual)(this.lastOptions.viewLevel,this.options.viewLevel)){var s=null===(o=t.source)||void 0===o?void 0:o.joinBy.geoData;console.time("l7plot choropleth update viewLevel time"),this.getDistrictData(s).then((function(){var e=a.options.source,n=e.data,i=(0,r.__rest)(e,["data"]);a.changeData(n,i),a.updateLayers(t),a.render(),a.updateComponents(),console.timeEnd("l7plot choropleth update viewLevel time"),a.emit("update")}))}else{if(t.source&&!(0,i.isEqual)(this.lastOptions.source,this.options.source)){var u=this.options.source,l=u.data,c=(0,r.__rest)(u,["data"]);this.changeData(l,c)}this.updateLayers(t),this.render(),this.updateComponents(),this.emit("update")}},e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.parserSourceConfig=function(t){var e=t.data,n=t.joinBy,i=(0,r.__rest)(t,["data","joinBy"]),o=n.sourceField,a=n.geoField,s=n.geoData,u={type:"join",sourceField:o,targetField:a,data:e};return i.transforms?i.transforms.push(u):i.transforms=[u],i.parser&&delete i.parser,{data:s,sourceCFG:i}},e.prototype.createSource=function(){var t=this.parserSourceConfig(this.options.source),e=t.data,n=t.sourceCFG;return new c.Source(e,n)},e.prototype.changeData=function(t,e){var n=this;console.time("l7plot choropleth update data time"),this.options.source=(0,a.deepAssign)({},this.options.source,(0,r.__assign)({data:t},e));var i=this.parserSourceConfig(this.options.source),o=i.data,s=i.sourceCFG;this.source.setData(o,s),console.timeEnd("l7plot choropleth update data time");var u=this.options.legend;u&&setTimeout((function(){n.updateLegendControl(u)})),this.emit("change-data")},e.prototype.createLayers=function(t){this.fillAreaLayer=new u.AreaLayer((0,r.__assign)({name:"fillAreaLayer",source:t},(0,i.pick)(this.options,u.AreaLayer.LayerOptionsKeys)));var e=new h.LayerGroup([this.fillAreaLayer]);if(this.options.chinaBorder){var n=this.createCountryBoundaryLayer(this.chinaBoundaryData,this.options),o=n.chinaBoundaryLayer,a=n.chinaDisputeBoundaryLayer;this.chinaBoundaryLayer=o,this.chinaDisputeBoundaryLayer=a,e.addLayer(this.chinaBoundaryLayer),e.addLayer(this.chinaDisputeBoundaryLayer)}return this.options.label&&(this.labelLayer=this.createLabelLayer(t,this.options.label),e.addLayer(this.labelLayer)),e},e.prototype.createCountryBoundaryLayer=function(t,e){var n=(0,p.createCountryBoundaryLayer)(t,e);return{chinaBoundaryLayer:n.chinaBoundaryLayer,chinaDisputeBoundaryLayer:n.chinaDisputeBoundaryLayer}},e.prototype.createLabelLayer=function(t,e){var n=this,i=t.originData.features.map((function(t){var e=t.properties;return Object.assign({},e,{centroid:e.centroid||e.center})})).filter((function(t){return t.centroid})),o=this.options,a=o.visible,s=o.minZoom,u=o.maxZoom,c=o.zIndex,h=void 0===c?0:c,p=new l.TextLayer((0,r.__assign)({name:"labelLayer",source:{data:i,parser:{type:"json",coordinates:"centroid"},transforms:t.transforms},visible:a,minZoom:s,maxZoom:u,zIndex:h+.1},e)),f=function(){var t=n.source.originData.features.map((function(t){return t.properties})).filter((function(t){return t.centroid}));p.layer.setData(t)};return t.on("update",f),p.on("remove",(function(){t.off("update",f)})),p},e.prototype.updateLayers=function(t){var e=this,n=(0,i.pick)(t,u.AreaLayer.LayerOptionsKeys);this.fillAreaLayer.update(n);var r=function(){var t=e.createCountryBoundaryLayer(e.chinaBoundaryData,e.options),n=t.chinaBoundaryLayer,r=t.chinaDisputeBoundaryLayer;e.chinaBoundaryLayer=n,e.chinaDisputeBoundaryLayer=r,e.layerGroup.addLayer(e.chinaBoundaryLayer),e.layerGroup.addLayer(e.chinaDisputeBoundaryLayer)},o=function(){e.chinaBoundaryLayer&&e.layerGroup.removeLayer(e.chinaBoundaryLayer),e.chinaDisputeBoundaryLayer&&e.layerGroup.removeLayer(e.chinaDisputeBoundaryLayer)};t.chinaBorder?this.chinaBoundaryLayer?(o(),r()):r():!1===t.chinaBorder&&o(),this.updateLabelLayer(this.source,t.label,this.options,this.labelLayer)},e.prototype.initLayersEvent=function(){this.initDrillEvent()},e.prototype.initDrillEvent=function(){if(this.lastOptions.drill){var t=this.lastOptions.drill,e=t.triggerUp,n=void 0===e?"unclick":e,r=t.triggerDown,i=void 0===r?"click":r;this.fillAreaLayer.off(n,this.onDrillUpHander),this.fillAreaLayer.off(i,this.onDrillDownHander)}if(this.options.drill&&!1!==this.options.drill.enabled){var o=this.options.drill,a=o.steps,u=o.triggerUp,l=void 0===u?"unclick":u,c=o.triggerDown,h=void 0===c?"click":c,p=a.map((function(t){return"string"==typeof t?{level:t,granularity:s.DEFAULT_AREA_GRANULARITY[t]}:(t.granularity||(t.granularity=s.DEFAULT_AREA_GRANULARITY[t.level]),t)}));if((0,d.isEqualDrillSteps)(p,this.drillSteps)||(this.drillSteps=p,this.drillStacks=[]),!this.drillStacks.length){var f=this.options.viewLevel,m=f.level,g=f.adcode,y=f.granularity,v=void 0===y?s.DEFAULT_AREA_GRANULARITY[m]:y,_=(0,d.getDrillStepDefaultConfig)(this.options);this.drillStacks=[{level:m,adcode:g,granularity:v,config:_}]}this.fillAreaLayer.on(l,this.onDrillUpHander),this.fillAreaLayer.on(h,this.onDrillDownHander)}},e.prototype.drillReset=function(){this.drillStacks=[]},e.prototype.getCurrentDrillSteps=function(){return this.drillStacks.map((function(t){return(0,i.pick)(t,["level","adcode","granularity"])}))},e.prototype.getLegendOptions=function(){var t=this.fillAreaLayer.getColorLegendItems();return 0!==t.length?{type:"category",items:t}:{}},e.prototype.fetchData=function(t,e,n){return(0,r.__awaiter)(this,void 0,void 0,(function(){var i,o,a,s,u,l,c;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return i="".concat(e,"_").concat(t,"_").concat(n),(o=(0,f.getCacheArea)(i))?[2,o]:(a=(0,d.getGeoAreaConfig)(this.options.geoArea),s=a.url,u=a.type,l=a.extension,[4,fetch("".concat(s,"/").concat(t,"/").concat(i,".").concat(l))]);case 1:return[4,r.sent().json()];case 2:return c=r.sent(),"topojson"===u&&(c=(0,d.topojson2geojson)(c)),(0,f.registerCacheArea)(i,c),[2,c]}}))}))},e.prototype.getInitDistrictData=function(){var t;return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,n,i,o;return(0,r.__generator)(this,(function(a){switch(a.label){case 0:e=this.fetchData("country","100000","boundary"),n=null===(t=this.options.source)||void 0===t?void 0:t.joinBy.geoData,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.all([e,this.getDistrictData(n)])];case 2:return o=r.__read.apply(void 0,[a.sent(),1]),this.chinaBoundaryData=o[0],[3,4];case 3:throw i=a.sent(),new Error("Failed to get china boundary data,".concat(i));case 4:return[2]}}))}))},e.prototype.getDistrictData=function(t){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,n,i,o,u,l,c,h;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:e=this.options.viewLevel,n=e.level,i=e.adcode,o=e.granularity,u=void 0===o?s.DEFAULT_AREA_GRANULARITY[n]:o,l=t?Promise.resolve(t):this.fetchData(n,i,u),r.label=1;case 1:return r.trys.push([1,3,,4]),c=this,[4,l];case 2:return c.currentDistrictData=r.sent(),this.options.source=(0,a.deepAssign)({},this.options.source,{joinBy:{geoData:this.currentDistrictData}}),[3,4];case 3:throw h=r.sent(),new Error("Failed to get district data,".concat(h));case 4:return[2]}}))}))},e.prototype.drillDown=function(t,e){var n=this;void 0===e&&(e={}),this.changeView(t,e).then((function(t){t&&n.drillStacks.push(t)}))},e.prototype.drillUp=function(t,e){void 0===t&&(t={});var n=this.drillStacks.length;if(![0,1].includes(n)){var i=e?this.drillStacks.findIndex((function(t){return t.level===e})):-1,o=-1!==i,s=o?i:n-2,u=this.drillStacks[s],l=u.config,c=(0,r.__rest)(u,["config"]),h=(0,a.deepAssign)({},l,t);this.changeView(c,h),o?this.drillStacks.splice(i+1):this.drillStacks.pop()}},e.prototype.changeView=function(t,e){return void 0===e&&(e={}),(0,r.__awaiter)(this,void 0,void 0,(function(){var n,i,o,u,l,c;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return n=t.level,i=t.adcode,o=t.granularity,u=void 0===o?s.DEFAULT_AREA_GRANULARITY[n]:o,[4,this.fetchData(n,i,u)];case 1:return(l=r.sent()).features.length?(c=(0,a.deepAssign)({},(0,d.getDrillStepDefaultConfig)(this.options),e,{viewLevel:{level:n,adcode:i,granularity:u},source:{joinBy:{geoData:l}}}),this.update(c),[2,{level:n,adcode:i,granularity:u,config:c}]):[2]}}))}))},e.DefaultOptions=s.DEFAULT_OPTIONS,e.GeoDataUrl=s.GEO_DATA_URL,e.GeoAreaUrl=s.GEO_AREA_URL,e}(o.Plot);e.Choropleth=m},6867:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCountryBoundaryLayer=void 0;var r=n(1359),i=n(518),o=n(2490);e.createCountryBoundaryLayer=function(t,e){var n=e||{},a=n.visible,s=n.minZoom,u=n.maxZoom,l=n.zIndex,c=void 0===l?0:l,h=n.chinaBorder,p="object"==typeof h?(0,r.deepAssign)({},o.CHINA_BOUNDARY_STYLE,h):o.CHINA_BOUNDARY_STYLE,f=t.features.filter((function(t){var e=t.properties;return["coast","hkm","national"].includes(null==e?void 0:e.type)})),d=t.features.filter((function(t){var e=t.properties;return"dispute"===(null==e?void 0:e.type)})),m=new i.PathLayer({name:"chinaBoundaryLayer",visible:a,minZoom:s,maxZoom:u,zIndex:c+.1,source:{data:{type:"FeatureCollection",features:f},parser:{type:"geojson"}},color:{field:"type",value:function(t){var e=t.type;return p[e].color}},size:{field:"type",value:function(t){var e=t.type;return p[e].width}},style:{opacity:["type",function(t){return p[t].opacity}]}});return{chinaBoundaryLayer:m,chinaDisputeBoundaryLayer:new i.PathLayer({name:"chinaDisputeBoundaryLayer",visible:a,minZoom:s,maxZoom:u,zIndex:c+.1,source:{data:{type:"FeatureCollection",features:d},parser:{type:"geojson"}},color:p.dispute.color,size:p.dispute.width,style:{opacity:p.dispute.opacity,lineType:"dash",dashArray:p.dispute.dashArray}})}}},2872:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:[],parser:{type:"json",x:"x",y:"y"}}})},3586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DotDensity=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(2872),s=n(6496),u=n(5108),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.DotDensity,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){return this.dotDensityLayer=new u.DotDensityLayer((0,r.__assign)({source:t},(0,i.pick)(this.options,u.DotDensityLayer.LayerOptionsKeys))),new s.LayerGroup([this.dotDensityLayer])},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,u.DotDensityLayer.LayerOptionsKeys);this.dotDensityLayer.update(e)},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.DotDensity=l},3484:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:[],parser:{type:"json",x:"x",y:"y"}}})},9683:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dot=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(3484),s=n(3361),u=n(6496),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Dot,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){this.dotLayer=new s.DotLayer((0,r.__assign)({source:t},(0,i.pick)(this.options,s.DotLayer.LayerOptionsKeys)));var e=new u.LayerGroup([this.dotLayer]);return this.options.label&&(this.labelLayer=this.createLabelLayer(t,this.options.label,this.options),e.addLayer(this.labelLayer)),e},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,s.DotLayer.LayerOptionsKeys);this.dotLayer.update(e),this.updateLabelLayer(this.source,t.label,this.options,this.labelLayer)},e.prototype.getLegendOptions=function(){var t=this.dotLayer.getColorLegendItems();return 0!==t.length?{type:"category",items:t}:{}},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.Dot=l},5046:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:[],parser:{type:"json"}},shape:"arc"})},7744:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Flow=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(5046),s=n(4836),u=n(3361),l=n(9183),c=n(6496),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Flow,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){this.flowLayer=new s.ArcLayer((0,r.__assign)({name:"flowLayer",source:t},(0,i.pick)(this.options,s.ArcLayer.LayerOptionsKeys)));var e=new c.LayerGroup([this.flowLayer]);return this.options.radiation&&(this.radiationLayer=this.createRadiationLayer(t),e.addLayer(this.radiationLayer)),this.options.label&&(this.labelLayer=this.createLabelLayer(t,this.options.label),e.addLayer(this.labelLayer)),e},e.prototype.parserPointData=function(t){var e=[];return t.data.dataArray.forEach((function(t){var n=t.coordinates,i=(0,r.__read)(n,2)[1];e.push((0,r.__assign)((0,r.__assign)({},t),{coordinates:i}))})),e},e.prototype.createRadiationLayer=function(t){var e=this,n=this.parserPointData(t),r=this.options.radiation||{},i=r.enabled,o=void 0===i||i,a=r.color,s=r.size,l=void 0===s?20:s,c=r.shape,h=void 0===c?"circle":c,p=r.animate,f=void 0===p||p,d=new u.DotLayer({name:"radiationLayer",source:{data:n,parser:{type:"json",coordinates:"coordinates"}},visible:o,color:a,size:l,shape:h,animate:f}),m=function(){var t=e.parserPointData(e.source);d.layer.setData(t)};return t.on("update",m),d.on("remove",(function(){t.off("update",m)})),d},e.prototype.createLabelLayer=function(t,e){var n=this,i=this.parserPointData(t),o=this.options,a=o.visible,s=o.minZoom,u=o.maxZoom,c=o.zIndex,h=void 0===c?0:c,p=new l.TextLayer((0,r.__assign)({name:"labelLayer",source:{data:i,parser:{type:"json",coordinates:"coordinates"}},visible:a,minZoom:s,maxZoom:u,zIndex:h+.1},e)),f=function(){var t=n.parserPointData(n.source);p.layer.setData(t)};return t.on("update",f),p.on("remove",(function(){t.off("update",f)})),p},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,s.ArcLayer.LayerOptionsKeys);if(this.flowLayer.update(e),t.radiation)if(this.radiationLayer){var n=(0,r.__assign)((0,r.__assign)({},t.radiation),{visible:t.radiation.enabled});this.radiationLayer.update(n)}else this.radiationLayer=this.createRadiationLayer(this.source),this.layerGroup.addLayer(this.radiationLayer);this.updateLabelLayer(this.source,t.label,this.options,this.labelLayer)},e.prototype.getLegendOptions=function(){var t=this.flowLayer.getColorLegendItems();return 0!==t.length?{type:"category",items:t}:{}},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.Flow=h},4121:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:[],parser:{type:"json",x:"x",y:"y"},aggregation:{type:"grid",radius:15e3,method:"sum"}}})},2596:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Grid=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(4121),s=n(4267),u=n(6496),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Grid,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){this.gridLayer=new s.GridLayer((0,r.__assign)({source:t},(0,i.pick)(this.options,s.GridLayer.LayerOptionsKeys)));var e=new u.LayerGroup([this.gridLayer]);return this.options.label&&(this.labelLayer=this.createLabelLayer(this.source,this.options.label,this.options),e.addLayer(this.labelLayer)),e},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,s.GridLayer.LayerOptionsKeys);this.gridLayer.update(e),this.updateLabelLayer(this.source,t.label,this.options,this.labelLayer)},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.Grid=l},8999:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:[],parser:{type:"json",x:"x",y:"y"}}})},1879:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Heatmap=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(8999),s=n(7664),u=n(6496),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Heatmap,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){this.heatmapLayer=new s.HeatmapLayer((0,r.__assign)({source:t},(0,i.pick)(this.options,s.HeatmapLayer.LayerOptionsKeys)));var e=new u.LayerGroup([this.heatmapLayer]);return this.options.label&&(this.labelLayer=this.createLabelLayer(this.source,this.options.label,this.options),e.addLayer(this.labelLayer)),e},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,s.HeatmapLayer.LayerOptionsKeys);this.heatmapLayer.update(e),this.updateLabelLayer(this.source,t.label,this.options,this.labelLayer)},e.prototype.getLegendOptions=function(){var t,e=this.heatmapLayer.layer.getLegendItems("size");return Array.isArray(e)&&0!==e.length?{type:"continue",min:e[0].value,max:e[e.length-1].value,colors:null===(t=this.heatmapLayer.options.style)||void 0===t?void 0:t.colorsRamp.map((function(t){return t.color}))}:{}},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.Heatmap=l},1624:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:[],parser:{type:"json",x:"x",y:"y"},aggregation:{type:"hexagon",radius:15e3,method:"sum"}}})},3238:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hexbin=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(1624),s=n(8682),u=n(6496),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Hexbin,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){this.hexbinLayer=new s.HexbinLayer((0,r.__assign)({source:t},(0,i.pick)(this.options,s.HexbinLayer.LayerOptionsKeys)));var e=new u.LayerGroup([this.hexbinLayer]);return this.options.label&&(this.labelLayer=this.createLabelLayer(this.source,this.options.label,this.options),e.addLayer(this.labelLayer)),e},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,s.HexbinLayer.LayerOptionsKeys);this.hexbinLayer.update(e),this.updateLabelLayer(this.source,t.label,this.options,this.labelLayer)},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.Hexbin=l},263:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var r=n(9555),i=n(1359);e.DEFAULT_OPTIONS=(0,i.deepAssign)({},r.Plot.DefaultOptions,{source:{data:{type:"FeatureCollection",features:[]},parser:{type:"geojson"}}})},6770:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Path=void 0;var r=n(7768),i=n(4859),o=n(9555),a=n(263),s=n(518),u=n(6496),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=o.Plot.PlotType.Path,e}return(0,r.__extends)(e,t),e.prototype.getDefaultOptions=function(){return e.DefaultOptions},e.prototype.createLayers=function(t){return this.pathLayer=new s.PathLayer((0,r.__assign)({source:t},(0,i.pick)(this.options,s.PathLayer.LayerOptionsKeys))),new u.LayerGroup([this.pathLayer])},e.prototype.updateLayers=function(t){var e=(0,i.pick)(t,s.PathLayer.LayerOptionsKeys);this.pathLayer.update(e)},e.prototype.getLegendOptions=function(){var t=this.pathLayer.getColorLegendItems();return 0!==t.length?{type:"category",items:t}:{}},e.DefaultOptions=a.DEFAULT_OPTIONS,e}(o.Plot);e.Path=l},8976:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.registerTheme=e.getTheme=void 0;var r=n(4859),i=n(6444),o=(0,i.createTheme)({}),a={default:o,light:o,dark:(0,i.createDarkTheme)({})};e.getTheme=function(t){return void 0===t&&(t="default"),(0,r.get)(a,(0,r.lowerCase)(t),a.default)},e.registerTheme=function(t,e,n){void 0===n&&(n="light"),a[(0,r.lowerCase)(t)]="light"===n?(0,i.createTheme)(e):(0,i.createDarkTheme)(e)}},9982:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dark=e.createDarkStyleSheet=void 0;var n="#FFFFFF",r="#A6A6A6",i=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],o=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#E86452","#F8D0CB","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],a=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"];e.createDarkStyleSheet=function(t){void 0===t&&(t={});var e=t.mapStyle,s=void 0===e?"dark":e,u=t.subColor,l=void 0===u?"rgba(255,255,255,0.05)":u,c=t.paletteQualitative10,h=void 0===c?i:c,p=t.paletteQualitative20,f=void 0===p?o:p,d=t.paletteSemanticRed,m=void 0===d?"#F4664A":d,g=t.paletteSemanticGreen,y=void 0===g?"#30BF78":g,v=t.paletteSemanticYellow,_=void 0===v?"#FAAD14":v,b=t.paletteSequence,x=void 0===b?a:b,w=t.fontFamily,S=void 0===w?'"-apple-system", "Segoe UI", Roboto, "Helvetica Neue", Arial,\n "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",\n "Noto Color Emoji"':w,E=t.brandColor;return{mapStyle:s,brandColor:void 0===E?h[0]:E,subColor:l,paletteQualitative10:h,paletteQualitative20:f,paletteSemanticRed:m,paletteSemanticGreen:y,paletteSemanticYellow:_,paletteSequence:x,fontFamily:S,legendContainerFillColor:"rgba(31, 31, 31, 0.85)",legendContainerShadow:"0 2px 8px 0 rgba(166, 166, 166, 0.20)",legendContainerBorderRadius:2,legendTextFillColor:r,legendTextFontSize:12,tooltipContainerFillColor:"rgba(31, 31, 31, 0.9)",tooltipContainerShadow:"0px 2px 4px rgba(0, 0, 0, 0.5)",tooltipContainerBorderRadius:2,tooltipTextFillColor:r,tooltipItemNameFillColor:r,tooltipItemValueFillColor:r,tooltipTextFontSize:12,tooltipTextLineHeight:"20px",labelFillColor:r,labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,pointFillColor:i[0],pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:"#000",pointActiveBorderColor:n,pointSelectedBorderColor:n}},e.dark=(0,e.createDarkStyleSheet)()},1095:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.light=e.createLightStyleSheet=void 0;var n="#000",r="#595959",i=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],o=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],a=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"];e.createLightStyleSheet=function(t){void 0===t&&(t={});var e=t.mapStyle,s=void 0===e?"light":e,u=t.subColor,l=void 0===u?"rgba(0,0,0,0.05)":u,c=t.paletteQualitative10,h=void 0===c?i:c,p=t.paletteQualitative20,f=void 0===p?o:p,d=t.paletteSemanticRed,m=void 0===d?"#F4664A":d,g=t.paletteSemanticGreen,y=void 0===g?"#30BF78":g,v=t.paletteSemanticYellow,_=void 0===v?"#FAAD14":v,b=t.paletteSequence,x=void 0===b?a:b,w=t.fontFamily,S=void 0===w?'"-apple-system", "Segoe UI", Roboto, "Helvetica Neue", Arial,\n "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",\n "Noto Color Emoji"':w,E=t.brandColor,M=void 0===E?h[0]:E;return{mapStyle:s,brandColor:M,subColor:l,paletteQualitative10:h,paletteQualitative20:f,paletteSemanticRed:m,paletteSemanticGreen:y,paletteSemanticYellow:_,paletteSequence:x,fontFamily:S,legendContainerFillColor:"rgba(255, 255, 255, 0.85)",legendContainerShadow:"0 2px 8px 0 rgba(166, 166, 166, 0.20)",legendContainerBorderRadius:2,legendTextFillColor:r,legendTextFontSize:12,tooltipContainerFillColor:"rgba(255, 255, 255, 0.9)",tooltipContainerShadow:"rgb(0 0 0 / 16%) 0px 6px 12px 0px",tooltipContainerBorderRadius:2,tooltipTextFillColor:r,tooltipItemNameFillColor:r,tooltipItemValueFillColor:r,tooltipTextFontSize:12,tooltipTextLineHeight:"20px",labelFillColor:r,labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,pointFillColor:M,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:"#FFFFFF",pointActiveBorderColor:n,pointSelectedBorderColor:n}},e.light=(0,e.createLightStyleSheet)()},4091:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createThemeByStyleSheet=void 0;var r=n(7768),i=(0,r.__importStar)(n(1501)),o=(0,r.__importStar)(n(5864)),a=(0,r.__importStar)(n(3109));e.createThemeByStyleSheet=function(t){var e,n,r,s={point:{default:{fill:t.pointFillColor,size:t.pointSize,stroke:t.pointBorderColor,lineWidth:t.pointBorder,fillOpacity:t.pointFillOpacity},active:{fill:t.pointActiveFillColor},selected:{fill:t.pointSelectedFillColor}}};return{mapStyle:t.mapStyle,defaultColor:t.brandColor,subColor:t.subColor,semanticRed:t.paletteSemanticRed,semanticGreen:t.paletteSemanticGreen,fontFamily:t.fontFamily,colors10:t.paletteQualitative10,colors20:t.paletteQualitative20,sequenceColors:t.paletteSequence,shapes:{point:["circle","square"],line:["line"]},sizes:[1,10],geometries:{point:{circle:{default:{style:s.point.default},active:{style:s.point.active},selected:{style:s.point.selected}}},line:{},polygon:{}},components:{legend:{category:{domStyles:(e={},e[o.CONTAINER_CLASS]={visibility:"visible",zIndex:1,backgroundColor:t.legendContainerFillColor,boxShadow:t.legendContainerShadow,borderRadius:"".concat(t.legendContainerBorderRadius,"px"),color:t.legendTextFillColor,fontFamily:t.fontFamily,padding:"10px",lineHeight:"1",fontSize:"".concat(t.legendTextFontSize,"px")},e[o.TITLE_CLASS]={fontSize:"13px",lineHeight:"19px",marginBottom:"8px"},e[o.LIST_CLASS]={margin:"0px",padding:"0px"},e[o.LIST_ITEM_CLASS]={marginBottom:"2px"},e[o.MARKER_CLASS]={width:"10px",height:"10px"},e[o.VALUE_CLASS]={paddingLeft:"8px"},e)},continue:{domStyles:(n={},n[a.CONTAINER_CLASS]={visibility:"visible",zIndex:1,backgroundColor:t.legendContainerFillColor,boxShadow:t.legendContainerShadow,borderRadius:"".concat(t.legendContainerBorderRadius,"px"),color:t.legendTextFillColor,fontFamily:t.fontFamily,padding:"10px",lineHeight:1,fontSize:"".concat(t.legendTextFontSize,"px")},n[a.TITLE_CLASS]={fontSize:"13px",lineHeight:"19px",marginBottom:"8px"},n[a.RIBBON_CLASS]={display:"flex",alignItems:"center"},n[a.GRADIENT_BAR_CLASS]={width:"140px",height:"14px",margin:"0px 5px"},n[a.VALUE_RANGE_CLASS]={padding:"0px"},n)}},tooltip:{domStyles:(r={},r[i.CONTAINER_CLASS]={visibility:"visible",zIndex:999,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:t.tooltipContainerFillColor,boxShadow:t.tooltipContainerShadow,borderRadius:"".concat(t.tooltipContainerBorderRadius,"px"),color:t.tooltipTextFillColor,fontSize:"".concat(t.tooltipTextFontSize,"px"),fontFamily:t.fontFamily,lineHeight:t.tooltipTextLineHeight},r[i.TITLE_CLASS]={marginBottom:"4px"},r[i.LIST_CLASS]={margin:"0px",padding:"0px"},r[i.LIST_ITEM_CLASS]={marginBottom:"4px"},r[i.NAME_CLASS]={color:t.tooltipItemNameFillColor},r[i.VALUE_CLASS]={color:t.tooltipItemValueFillColor,marginLeft:"30px"},r)},label:{style:{textAnchor:"center",textOffset:[0,0],fill:t.labelFillColor,fontSize:t.labelFontSize,fontFamily:t.fontFamily,fillColorDark:t.labelFillColorDark,fillColorLight:t.labelFillColorLight}}}}}},9450:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createDarkTheme=e.createTheme=void 0;var r=n(7768),i=n(4859),o=n(4091),a=n(1095),s=n(9982);e.createTheme=function(t){var e=t.styleSheet,n=void 0===e?{}:e,s=(0,r.__rest)(t,["styleSheet"]),u=(0,a.createLightStyleSheet)(n);return(0,i.deepMix)({},(0,o.createThemeByStyleSheet)(u),s)},e.createDarkTheme=function(t){var e=t.styleSheet,n=void 0===e?{}:e,a=(0,r.__rest)(t,["styleSheet"]),u=(0,s.createDarkStyleSheet)(n);return(0,i.deepMix)({},(0,o.createThemeByStyleSheet)(u),a)}},6444:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createDarkTheme=e.createTheme=void 0;var r=n(9450);Object.defineProperty(e,"createTheme",{enumerable:!0,get:function(){return r.createTheme}}),Object.defineProperty(e,"createDarkTheme",{enumerable:!0,get:function(){return r.createDarkTheme}})},2061:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6698:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BlendType=void 0;var r=n(108);Object.defineProperty(e,"BlendType",{enumerable:!0,get:function(){return r.BlendType}}),n(5868)},1246:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PositionType=void 0;var r=n(108);Object.defineProperty(e,"PositionType",{enumerable:!0,get:function(){return r.PositionType}})},7039:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7768);(0,r.__exportStar)(n(6698),e),(0,r.__exportStar)(n(2061),e),(0,r.__exportStar)(n(6651),e),(0,r.__exportStar)(n(4523),e),(0,r.__exportStar)(n(6401),e),(0,r.__exportStar)(n(5318),e),(0,r.__exportStar)(n(5183),e),(0,r.__exportStar)(n(1290),e),(0,r.__exportStar)(n(1246),e),(0,r.__exportStar)(n(3235),e),(0,r.__exportStar)(n(4814),e)},5318:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6651:(t,e)=>{"use strict";var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.LayerType=e.LineStyleType=void 0,(r=e.LineStyleType||(e.LineStyleType={}))[r.solid=0]="solid",r[r.dash=1]="dash",(n=e.LayerType||(e.LayerType={})).TextLayer="textLayer",n.DotLayer="dotLayer",n.IconLayer="iconLayer",n.DotDensity="dotDensityLayer",n.ColumnLayer="columnLayer",n.HeatmapLayer="heatmapLayer",n.GridLayer="gridLayer",n.HexbinLayer="hexbinLayer",n.LinesLayer="linesLayer",n.PathLayer="pathLayer",n.ArcLayer="arcLayer",n.AreaLayer="areaLayer",n.PrismLayer="prismLayer"},3235:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4523:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseMapType=e.Source=e.MapboxglMap=void 0;var r=n(7768),i=n(2946);Object.defineProperty(e,"MapboxglMap",{enumerable:!0,get:function(){return i.Map}});var o,a=(0,r.__importDefault)(n(8134));e.Source=a.default,(o=e.BaseMapType||(e.BaseMapType={})).Amap="amap",o.Mapbox="mapbox"},6401:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.PlotType=void 0,(n=e.PlotType||(e.PlotType={})).Dot="dot",n.DotDensity="dotDensity",n.Heatmap="heatmap",n.Grid="grid",n.Hexbin="hexbin",n.Path="path",n.Flow="flow",n.Area="area",n.Choropleth="choropleth"},1290:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5183:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TooltipAnchorType=void 0;var r=n(5619);Object.defineProperty(e,"TooltipAnchorType",{enumerable:!0,get:function(){return r.anchorType}})},6912:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.deepAssign=void 0;var n=(new Object).toString,r=function(t,e){return n.call(t)==="[object "+e+"]"},i=function(t){return r(t,"Array")},o=function(t){if(!function(t){return"object"==typeof t&&null!==t}(t)||!r(t,"Object"))return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},a=function(t,e,n,r){for(var s in n=n||0,r=r||5,e)if(Object.prototype.hasOwnProperty.call(e,s)){var u=e[s];u?o(u)?(o(t[s])||(t[s]={}),n<r?a(t[s],u,n+1,r):t[s]=e[s]):i(u)?(t[s]=[],t[s]=t[s].concat(u)):t[s]=u:t[s]=u}};e.deepAssign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)a(t,e[r]);return t}},1359:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.deepAssign=void 0;var r=n(6912);Object.defineProperty(e,"deepAssign",{enumerable:!0,get:function(){return r.deepAssign}})},1274:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="0.0.11"},4859:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Cache:()=>Ae,assign:()=>qt,augment:()=>Yt,clamp:()=>et,clearAnimationFrame:()=>Ht,clone:()=>$t,contains:()=>i,debounce:()=>Kt,deepMix:()=>te,difference:()=>a,each:()=>f,endsWith:()=>V,every:()=>G,extend:()=>ee,filter:()=>o,find:()=>v,findIndex:()=>_,firstValue:()=>b,fixedBase:()=>nt,flatten:()=>x,flattenDeep:()=>S,forIn:()=>bt,get:()=>he,getEllipsisText:()=>Te,getRange:()=>T,getType:()=>Lt,getWrapBehavior:()=>$,group:()=>X,groupBy:()=>q,groupToMap:()=>Y,has:()=>xt,hasKey:()=>wt,hasValue:()=>Et,head:()=>j,identity:()=>xe,includes:()=>i,indexOf:()=>ne,isArguments:()=>It,isArray:()=>h,isArrayLike:()=>r,isBoolean:()=>Rt,isDate:()=>Dt,isDecimal:()=>it,isElement:()=>Vt,isEmpty:()=>ie,isEqual:()=>ae,isEqualWith:()=>se,isError:()=>Nt,isEven:()=>ot,isFinite:()=>Ft,isFunction:()=>l,isInteger:()=>at,isMatch:()=>m,isNegative:()=>st,isNil:()=>c,isNull:()=>zt,isNumber:()=>rt,isNumberEqual:()=>lt,isObject:()=>p,isObjectLike:()=>g,isOdd:()=>ct,isPlainObject:()=>y,isPositive:()=>ht,isPrototype:()=>jt,isRegExp:()=>Ut,isString:()=>D,isType:()=>u,isUndefined:()=>Zt,keys:()=>d,last:()=>U,lowerCase:()=>Tt,lowerFirst:()=>At,map:()=>ue,mapValues:()=>ce,max:()=>E,maxBy:()=>pt,measureTextWidth:()=>Me,memoize:()=>Jt,min:()=>M,minBy:()=>ft,mix:()=>qt,mod:()=>dt,noop:()=>be,number2color:()=>Q,omit:()=>me,parseRadius:()=>tt,pick:()=>de,pull:()=>P,pullAt:()=>L,reduce:()=>I,remove:()=>R,requestAnimationFrame:()=>Gt,set:()=>pe,size:()=>we,some:()=>H,sortBy:()=>N,startsWith:()=>Z,substitute:()=>Ct,throttle:()=>ge,toArray:()=>ye,toDegree:()=>gt,toInteger:()=>yt,toRadian:()=>_t,toString:()=>Mt,union:()=>z,uniq:()=>F,uniqueId:()=>_e,upperCase:()=>Ot,upperFirst:()=>Pt,values:()=>St,valuesOfKey:()=>B,wrapBehavior:()=>K});const r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,e){return!!r(t)&&t.indexOf(e)>-1},o=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];e(o,i)&&n.push(o)}return n},a=function(t,e){return void 0===e&&(e=[]),o(t,(function(t){return!i(e,t)}))};var s={}.toString;const u=function(t,e){return s.call(t)==="[object "+e+"]"},l=function(t){return u(t,"Function")},c=function(t){return null==t},h=function(t){return Array.isArray?Array.isArray(t):u(t,"Array")},p=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},f=function(t,e){if(t)if(h(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(p(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break},d=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return f(t,(function(n,r){l(t)&&"prototype"===r||e.push(r)})),e},m=function(t,e){var n=d(e),r=n.length;if(c(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0},g=function(t){return"object"==typeof t&&null!==t},y=function(t){if(!g(t)||!u(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},v=function(t,e){if(!h(t))return null;var n;if(l(e)&&(n=e),y(e)&&(n=function(t){return m(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null},_=function(t,e,n){void 0===n&&(n=0);for(var r=n;r<t.length;r++)if(e(t[r],r))return r;return-1},b=function(t,e){for(var n=null,r=0;r<t.length;r++){var i=t[r][e];if(!c(i)){n=h(i)?i[0]:i;break}}return n},x=function(t){if(!h(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e};var w=function(t,e){if(void 0===e&&(e=[]),h(t))for(var n=0;n<t.length;n+=1)w(t[n],e);else e.push(t);return e};const S=w,E=function(t){if(h(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},M=function(t){if(h(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},T=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(h(t[0])){for(var n=[],r=0;r<t.length;r++)n=n.concat(t[r]);e=n}var i=E(e);return{min:M(e),max:i}};var A=Array.prototype,C=A.splice,O=A.indexOf;const P=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=-1;(o=O.call(t,i))>-1;)C.call(t,o,1);return t};var k=Array.prototype.splice;const L=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var o=void 0,a=e[n];n!==i&&a===o||(o=a,k.call(t,a,1))}return t},I=function(t,e,n){if(!h(t)&&!y(t))return t;var r=n;return f(t,(function(t,n){r=e(r,t,n)})),r},R=function(t,e){var n=[];if(!r(t))return n;for(var i=-1,o=[],a=t.length;++i<a;){var s=t[i];e(s,i,t)&&(n.push(s),o.push(i))}return L(t,o),n},D=function(t){return u(t,"String")},N=function(t,e){var n;if(l(e))n=function(t,n){return e(t)-e(n)};else{var r=[];D(e)?r.push(e):h(e)&&(r=e),n=function(t,e){for(var n=0;n<r.length;n+=1){var i=r[n];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}}return t.sort(n),t};function F(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];e.has(o)||(n.push(o),e.set(o,!0))}return n}const z=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return F([].concat.apply([],t))},B=function(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i][e];if(!c(o)){h(o)||(o=[o]);for(var a=0;a<o.length;a++){var s=o[a];r[s]||(n.push(s),r[s]=!0)}}}return n};function j(t){if(r(t))return t[0]}function U(t){if(r(t))return t[t.length-1]}const Z=function(t,e){return!(!h(t)&&!D(t))&&t[0]===e},V=function(t,e){return!(!h(t)&&!D(t))&&t[t.length-1]===e},G=function(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0},H=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n))return!0;return!1};var W=Object.prototype.hasOwnProperty;const q=function(t,e){if(!e||!h(t))return{};for(var n,r={},i=l(e)?e:function(t){return t[e]},o=0;o<t.length;o++){var a=t[o];n=i(a),W.call(r,n)?r[n].push(a):r[n]=[a]}return r};function Y(t,e){if(!e)return{0:t};if(!l(e)){var n=h(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;r<i;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return q(t,e)}const X=function(t,e){if(!e)return[t];var n=Y(t,e),r=[];for(var i in n)r.push(n[i]);return r},$=function(t,e){return t["_wrap_"+e]},K=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n};var J={};const Q=function(t){var e=J[t];if(!e){for(var n=t.toString(16),r=n.length;r<6;r++)n="0"+n;e="#"+n,J[t]=e}return e},tt=function(t){var e=0,n=0,r=0,i=0;return h(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}},et=function(t,e,n){return t<e?e:t>n?n:t},nt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},rt=function(t){return u(t,"Number")},it=function(t){return rt(t)&&t%1!=0},ot=function(t){return rt(t)&&t%2==0},at=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0},st=function(t){return rt(t)&&t<0};var ut=1e-5;function lt(t,e,n){return void 0===n&&(n=ut),Math.abs(t-e)<n}const ct=function(t){return rt(t)&&t%2!=0},ht=function(t){return rt(t)&&t>0},pt=function(t,e){if(h(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=l(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},ft=function(t,e){if(h(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=l(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},dt=function(t,e){return(t%e+e)%e};var mt=180/Math.PI;const gt=function(t){return mt*t},yt=parseInt;var vt=Math.PI/180;const _t=function(t){return vt*t},bt=f,xt=function(t,e){return t.hasOwnProperty(e)},wt=xt,St=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return f(t,(function(n,r){l(t)&&"prototype"===r||e.push(n)})),e},Et=function(t,e){return i(St(t),e)},Mt=function(t){return c(t)?"":t.toString()},Tt=function(t){return Mt(t).toLowerCase()},At=function(t){var e=Mt(t);return e.charAt(0).toLowerCase()+e.substring(1)},Ct=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},Ot=function(t){return Mt(t).toUpperCase()},Pt=function(t){var e=Mt(t);return e.charAt(0).toUpperCase()+e.substring(1)};var kt={}.toString;const Lt=function(t){return kt.call(t).replace(/^\[object /,"").replace(/]$/,"")},It=function(t){return u(t,"Arguments")},Rt=function(t){return u(t,"Boolean")},Dt=function(t){return u(t,"Date")},Nt=function(t){return u(t,"Error")};function Ft(t){return rt(t)&&isFinite(t)}const zt=function(t){return null===t};var Bt=Object.prototype;const jt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Bt)},Ut=function(t){return u(t,"RegExp")},Zt=function(t){return void 0===t},Vt=function(t){return t instanceof Element||t instanceof HTMLDocument};function Gt(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}function Ht(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}function Wt(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function qt(t,e,n,r){return e&&Wt(t,e),n&&Wt(t,n),r&&Wt(t,r),t}const Yt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t[0],r=1;r<t.length;r++){var i=t[r];l(i)&&(i=i.prototype),qt(n.prototype,i)}};var Xt=function(t){if("object"!=typeof t||null===t)return t;var e;if(h(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Xt(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Xt(t[i]):e[i]=t[i];return e};const $t=Xt,Kt=function(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}},Jt=function(t,e){if(!l(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};function Qt(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&y(o)?(y(t[i])||(t[i]={}),n<r?Qt(t[i],o,n+1,r):t[i]=e[i]):h(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}const te=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Qt(t,e[r]);return t},ee=function(t,e,n,r){l(e)||(n=e,e=t,t=function(){});var i=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},o=i(e.prototype,t);return t.prototype=qt(o,t.prototype),t.superclass=i(e.prototype,e),qt(o,n),qt(t,r),t},ne=function(t,e){if(!r(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o<t.length;o++)if(t[o]===e){i=o;break}return i};var re=Object.prototype.hasOwnProperty;const ie=function(t){if(c(t))return!0;if(r(t))return!t.length;var e=Lt(t);if("Map"===e||"Set"===e)return!t.size;if(jt(t))return!Object.keys(t).length;for(var n in t)if(re.call(t,n))return!1;return!0};var oe=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(D(t)||D(e))return!1;if(r(t)||r(e)){if(t.length!==e.length)return!1;for(var n=!0,i=0;i<t.length&&(n=oe(t[i],e[i]));i++);return n}if(g(t)||g(e)){var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(n=!0,i=0;i<o.length&&(n=oe(t[o[i]],e[o[i]]));i++);return n}return!1};const ae=oe,se=function(t,e,n){return l(n)?!!n(t,e):ae(t,e)},ue=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];n.push(e(o,i))}return n};var le=function(t){return t};const ce=function(t,e){void 0===e&&(e=le);var n={};return p(t)&&!c(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n},he=function(t,e,n){for(var r=0,i=D(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},pe=function(t,e,n){var r=t,i=D(e)?e.split("."):e;return i.forEach((function(t,e){e<i.length-1?(p(r[t])||(r[t]=rt(i[e+1])?[]:{}),r=r[t]):r[t]=n})),t};var fe=Object.prototype.hasOwnProperty;const de=function(t,e){if(null===t||!y(t))return{};var n={};return f(e,(function(e){fe.call(t,e)&&(n[e]=t[e])})),n},me=function(t,e){return I(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},ge=function(t,e,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var c=e-(l-s);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},ye=function(t){return r(t)?Array.prototype.slice.call(t):[]};var ve={};const _e=function(t){return ve[t=t||"g"]?ve[t]+=1:ve[t]=1,t+ve[t]},be=function(){},xe=function(t){return t};function we(t){return c(t)?0:r(t)?t.length:Object.keys(t).length}var Se,Ee=n(7768);const Me=Jt((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Se||(Se=document.createElement("canvas").getContext("2d")),Se.font=[o,a,i,n+"px",r].join(" "),Se.measureText(D(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),(0,Ee.__spreadArrays)([t],St(e)).join("")})),Te=function(t,e,n,r){void 0===r&&(r="...");var i,o,a=Me(r,n),s=D(t)?t:Mt(t),u=e,l=[];if(Me(t,n)<=e)return t;for(;i=s.substr(0,16),!((o=Me(i,n))+a>u&&o>u);)if(l.push(i),u-=o,!(s=s.substr(16)))return l.join("");for(;i=s.substr(0,1),!((o=Me(i,n))+a>u);)if(l.push(i),u-=o,!(s=s.substr(1)))return l.join("");return""+l.join("")+r},Ae=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},2576:t=>{function e(t,e){if(0!==t.length){n(t[0],e);for(var r=1;r<t.length;r++)n(t[r],!e)}}function n(t,e){for(var n=0,r=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),u=n+s;r+=Math.abs(n)>=Math.abs(s)?n-u+s:s-u+n,n=u}n+r>=0!=!!e&&t.reverse()}t.exports=function t(n,r){var i,o=n&&n.type;if("FeatureCollection"===o)for(i=0;i<n.features.length;i++)t(n.features[i],r);else if("GeometryCollection"===o)for(i=0;i<n.geometries.length;i++)t(n.geometries[i],r);else if("Feature"===o)t(n.geometry,r);else if("Polygon"===o)e(n.coordinates,r);else if("MultiPolygon"===o)for(i=0;i<n.coordinates.length;i++)e(n.coordinates[i],r);return n}},3585:t=>{"use strict";function e(t,e){this.x=t,this.y=e}t.exports=e,e.prototype={clone:function(){return new e(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,n=t.y-this.y;return e*e+n*n},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,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,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),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}},6922:t=>{function e(t,e,n,r){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=n,this.p2y=r}t.exports=e,e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t,e){var n,r,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?n=i:r=i,i=.5*(r-n)+n}return i},e.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},6672:(t,e,n)=>{t.exports.VectorTile=n(8403),n(3741),n(5683)},8403:(t,e,n)=>{"use strict";var r=n(5683);function i(t,e,n){if(3===t){var i=new r(n,n.readVarint()+n.pos);i.length&&(e[i.name]=i)}}t.exports=function(t,e){this.layers=t.readFields(i,{},e)}},3741:(t,e,n)=>{"use strict";var r=n(3585);function i(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(o,this,e)}function o(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){for(var n=t.readVarint()+t.pos;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function a(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r+=((n=t[a]).x-e.x)*(e.y+n.y);return r}t.exports=i,i.types=["Unknown","Point","LineString","Polygon"],i.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,i=1,o=0,a=0,s=0,u=[];t.pos<n;){if(o<=0){var l=t.readVarint();i=7&l,o=l>>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},i.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(r<=0){var c=t.readVarint();n=7&c,r=c>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,l]},i.prototype.toGeoJSON=function(t,e,n){var r,o,s=this.extent*Math.pow(2,n),u=this.extent*t,l=this.extent*e,c=this.loadGeometry(),h=i.types[this.type];function p(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+l)/s;t[e]=[360*(n.x+u)/s-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var f=[];for(r=0;r<c.length;r++)f[r]=c[r][0];p(c=f);break;case 2:for(r=0;r<c.length;r++)p(c[r]);break;case 3:for(c=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var s=a(t[o]);0!==s&&(void 0===r&&(r=s<0),r===s<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}return n&&i.push(n),i}(c),r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)p(c[r][o])}1===c.length?c=c[0]:h="Multi"+h;var d={type:"Feature",geometry:{type:h,coordinates:c},properties:this.properties};return"id"in this&&(d.id=this.id),d}},5683:(t,e,n)=>{"use strict";var r=n(3741);function i(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(o,this,e),this.length=this._features.length}function o(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){for(var e=null,n=t.readVarint()+t.pos;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}t.exports=i,i.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 r(this._pbf,e,this.extent,this._keys,this._values)}},3374:(t,e,n)=>{"use strict";var r=n(4262);function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}i.default=i,e.Z=i},3969:(t,e)=>{"use strict";function n(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function r(t,e,r){if(void 0===r&&(r={}),!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(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:t},e,r)}function i(t,e,r){void 0===r&&(r={});for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function a(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function s(t,e,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:t},e,r)}function u(t,e,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:t},e,r)}function l(t,e,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:t},e,r)}function c(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function h(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function p(t){return t%(2*Math.PI)*180/Math.PI}function f(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={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,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=n,e.geometry=function(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return r(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return i(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return s(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},e.point=r,e.points=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return r(t,e)})),n)},e.polygon=i,e.polygons=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return i(t,e)})),n)},e.lineString=o,e.lineStrings=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return o(t,e)})),n)},e.featureCollection=a,e.multiLineString=s,e.multiPoint=u,e.multiPolygon=l,e.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:t},e,r)},e.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=f,e.isObject=function(t){return!!t&&t.constructor===Object},e.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((function(t){if(!f(t))throw new Error("bbox must only contain numbers")}))},e.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")}},4262:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3969);function i(t,e,n){if(null!==t)for(var r,o,a,s,u,l,c,h,p=0,f=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,y=m?t.features.length:1,v=0;v<y;v++){u=(h=!!(c=m?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<u;_++){var b=0,x=0;if(null!==(s=h?c.geometries[_]:c)){l=s.coordinates;var w=s.type;switch(p=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,f,v,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],f,v,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-p;o++){if(!1===e(l[r][o],f,v,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(x=0,o=0;o<l[r].length;o++){for(a=0;a<l[r][o].length-p;a++){if(!1===e(l[r][o][a],f,v,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===i(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function s(t,e){var n,r,i,o,a,s,u,l,c,h,p=0,f="FeatureCollection"===t.type,d="Feature"===t.type,m=f?t.features.length:1;for(n=0;n<m;n++){for(s=f?t.features[n].geometry:d?t.geometry:t,l=f?t.features[n].properties:d?t.properties:{},c=f?t.features[n].bbox:d?t.bbox:void 0,h=f?t.features[n].id:d?t.id:void 0,a=(u=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=u?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,l,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],p,l,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,l,c,h))return!1;p++}}function u(t,e){s(t,(function(t,n,i,o,a){var s,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature(t,i,{bbox:o,id:a}),n,0)&&void 0}switch(u){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c={type:s,coordinates:t.coordinates[l]};if(!1===e(r.feature(c,i),n,l))return!1}}))}function l(t,e){u(t,(function(t,n,o){var a=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var u,l=0,c=0,h=0;return!1!==i(t,(function(i,s,p,f,d){if(void 0===u||n>l||f>c||d>h)return u=i,l=n,c=f,h=d,void(a=0);var m=r.lineString([u,i],t.properties);if(!1===e(m,n,o,d,a))return!1;a++,u=i}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(!1===e(r.lineString(a[s],t.properties),n,i,s))return!1}}}))}e.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,(function(t,r,i,a,s){o=0===r&&void 0===n?t:e(o,t,r,i,a,s)}),r),o},e.featureEach=a,e.featureReduce=function(t,e,n){var r=n;return a(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.findPoint=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||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 l=n.coordinates;switch(n.type){case"Point":return r.point(l,u,e);case"MultiPoint":return o<0&&(o=l.length+o),r.point(l[o],u,e);case"LineString":return s<0&&(s=l.length+s),r.point(l[s],u,e);case"Polygon":return a<0&&(a=l.length+a),s<0&&(s=l[a].length+s),r.point(l[a][s],u,e);case"MultiLineString":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),r.point(l[o][s],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),s<0&&(s=l[o][a].length-s),r.point(l[o][a][s],u,e)}throw new Error("geojson is invalid")},e.findSegment=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||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 l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),r.lineString([l[s],l[s+1]],u,e);case"Polygon":return a<0&&(a=l.length+a),s<0&&(s=l[a].length+s-1),r.lineString([l[a][s],l[a][s+1]],u,e);case"MultiLineString":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),r.lineString([l[o][s],l[o][s+1]],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),s<0&&(s=l[o][a].length-s-1),r.lineString([l[o][a][s],l[o][a][s+1]],u,e)}throw new Error("geojson is invalid")},e.flattenEach=u,e.flattenReduce=function(t,e,n){var r=n;return u(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r},e.geomEach=s,e.geomReduce=function(t,e,n){var r=n;return s(t,(function(t,i,o,a,s){r=0===i&&void 0===n?t:e(r,t,i,o,a,s)})),r},e.lineEach=c,e.lineReduce=function(t,e,n){var r=n;return c(t,(function(t,i,o,a){r=0===i&&void 0===n?t:e(r,t,i,o,a)})),r},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.segmentEach=l,e.segmentReduce=function(t,e,n){var r=n,i=!1;return l(t,(function(t,o,a,s,u){r=!1===i&&void 0===n?t:e(r,t,o,a,s,u),i=!0})),r}},5802:(t,e,n)=>{"undefined"!=typeof reactHotLoaderGlobal&&reactHotLoaderGlobal.default.signature,t.exports={"en-US":n(6744),"zh-CN":n(4623)}},2864:(t,e,n)=>{"use strict";var r=n(6653),i=n(5592),o=i(r("String.prototype.indexOf"));t.exports=function(t,e){var n=r(t,!!e);return"function"==typeof n&&o(t,".prototype.")>-1?i(n):n}},5592:(t,e,n)=>{"use strict";var r=n(2698),i=n(6653),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||r.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){var e=s(r,a,arguments);return u&&l&&u(e,"length").configurable&&l(e,"length",{value:1+c(0,t.length-(arguments.length-1))}),e};var h=function(){return s(r,o,arguments)};l?l(t.exports,"apply",{value:h}):t.exports.apply=h},1838:(t,e)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var n=arguments[e];if(n){var o=typeof n;if("string"===o||"number"===o)t.push(n);else if(Array.isArray(n)&&n.length){var a=i.apply(null,n);a&&t.push(a)}else if("object"===o)for(var s in n)r.call(n,s)&&n[s]&&t.push(s)}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)}()},1821:t=>{"use strict";t.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]}},7945:(t,e,n)=>{var r=n(1821),i=n(9187),o=Object.hasOwnProperty,a=Object.create(null);for(var s in r)o.call(r,s)&&(a[r[s]]=s);var u=t.exports={to:{},get:{}};function l(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=l(a[n],0,255);return a[3]=l(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},8304:(t,e,n)=>{"use strict";var r=n(8346),i=n(1048),o=n(1807),a=n(8935).orient2d;function s(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],a=0;a<t.length;a++){var s=t[a];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var u=[e,n,r,i],l=u.slice();for(a=0;a<t.length;a++)o(t[a],u)||l.push(t[a]);return function(t){t.sort(_);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&f(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&f(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(t),a=new r(16);a.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},a.compareMinX=function(t,e){return t[0]-e[0]},a.compareMinY=function(t,e){return t[1]-e[1]},a.load(t);for(var s,l=[],c=0;c<i.length;c++){var h=i[c];a.remove(h),s=m(h,s),l.push(s)}var p=new r(16);for(c=0;c<l.length;c++)p.insert(d(l[c]));for(var y=e*e,v=n*n;l.length;){var b=l.shift(),x=b.p,w=b.next.p,S=g(x,w);if(!(S<v)){var E=S/y;(h=u(a,b.prev.p,x,w,b.next.next.p,E,p))&&Math.min(g(h,x),g(h,w))<=E&&(l.push(b),l.push(m(h,b)),a.remove(h),p.remove(b),p.insert(d(b)),p.insert(d(b.next)))}}b=s;var M=[];do{M.push(b.p),b=b.next}while(b!==s);return M.push(b.p),M}function u(t,e,n,r,o,a,s){for(var u=new i([],l),h=t.data;h;){for(var f=0;f<h.children.length;f++){var d=h.children[f],m=h.leaf?y(d,n,r):c(n,r,d);m>a||u.push({node:d,dist:m})}for(;u.length&&!u.peek().node.children;){var g=u.pop(),v=g.node,_=y(v,e,n),b=y(v,r,o);if(g.dist<_&&g.dist<b&&p(n,v,s)&&p(r,v,s))return v}(h=u.pop())&&(h=h.node)}return null}function l(t,e){return t.dist-e.dist}function c(t,e,n){if(h(t,n)||h(e,n))return 0;var r=v(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=v(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=v(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var a=v(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===a?0:Math.min(r,i,o,a)}function h(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function p(t,e,n){for(var r,i,o,a,s=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),l=Math.max(t[0],e[0]),c=Math.max(t[1],e[1]),h=n.search({minX:s,minY:u,maxX:l,maxY:c}),p=0;p<h.length;p++)if(r=h[p].p,i=h[p].next.p,o=t,r!==(a=e)&&i!==o&&f(r,i,o)>0!=f(r,i,a)>0&&f(o,a,r)>0!=f(o,a,i)>0)return!1;return!0}function f(t,e,n){return a(t[0],t[1],e[0],e[1],n[0],n[1])}function d(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function m(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function g(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function y(t,e,n){var r=e[0],i=e[1],o=n[0]-r,a=n[1]-i;if(0!==o||0!==a){var s=((t[0]-r)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(r=n[0],i=n[1]):s>0&&(r+=o*s,i+=a*s)}return(o=t[0]-r)*o+(a=t[1]-i)*a}function v(t,e,n,r,i,o,a,s){var u,l,c,h,p=n-t,f=r-e,d=a-i,m=s-o,g=t-i,y=e-o,v=p*p+f*f,_=p*d+f*m,b=d*d+m*m,x=p*g+f*y,w=d*g+m*y,S=v*b-_*_,E=S,M=S;0===S?(l=0,E=1,h=w,M=b):(h=v*w-_*x,(l=_*w-b*x)<0?(l=0,h=w,M=b):l>E&&(l=E,h=w+_,M=b)),h<0?(h=0,-x<0?l=0:-x>v?l=E:(l=-x,E=v)):h>M&&(h=M,-x+_<0?l=0:-x+_>v?l=E:(l=-x+_,E=v));var T=(1-(c=0===h?0:h/M))*i+c*a-((1-(u=0===l?0:l/E))*t+u*n),A=(1-c)*o+c*s-((1-u)*e+u*r);return T*T+A*A}function _(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}i.default&&(i=i.default),t.exports=s,t.exports.default=s},937:(t,e,n)=>{"use strict";function r(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function i(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}n.d(e,{j2:()=>r,b4:()=>s,YF:()=>i,We:()=>u,TS:()=>g,VR:()=>v,G9:()=>d,ly:()=>m,sd:()=>f});var o=i(r),a=o.right;o.left;const s=a;function u(t,e){var n,r,i,o=t.length,a=-1;if(null==e){for(;++a<o;)if(null!=(n=t[a])&&n>=n)for(r=i=n;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else for(;++a<o;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=i=n;++a<o;)null!=(n=e(t[a],a,t))&&(r>n&&(r=n),i<n&&(i=n));return[r,i]}var l=Array.prototype,c=(l.slice,l.map,Math.sqrt(50)),h=Math.sqrt(10),p=Math.sqrt(2);function f(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=d(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(t-s)/a;return r&&o.reverse(),o}function d(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=c?10:o>=h?5:o>=p?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=c?10:o>=h?5:o>=p?2:1)}function m(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=c?i*=10:o>=h?i*=5:o>=p&&(i*=2),e<t?-i:i}function g(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n}function y(t){return null===t?NaN:+t}function v(t,e,n){if(null==n&&(n=y),r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}},4537:(t,e,n)=>{"use strict";function r(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function i(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function o(){}n.d(e,{ZP:()=>x,B8:()=>E});var a=.7,s=1/a,u="\\s*([+-]?\\d+)\\s*",l="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h=/^#([0-9a-f]{3,8})$/,p=new RegExp("^rgb\\("+[u,u,u]+"\\)$"),f=new RegExp("^rgb\\("+[c,c,c]+"\\)$"),d=new RegExp("^rgba\\("+[u,u,u,l]+"\\)$"),m=new RegExp("^rgba\\("+[c,c,c,l]+"\\)$"),g=new RegExp("^hsl\\("+[l,c,c]+"\\)$"),y=new RegExp("^hsla\\("+[l,c,c,l]+"\\)$"),v={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 _(){return this.rgb().formatHex()}function b(){return this.rgb().formatRgb()}function x(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=h.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?w(e):3===n?new M(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?S(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?S(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=p.exec(t))?new M(e[1],e[2],e[3],1):(e=f.exec(t))?new M(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(t))?S(e[1],e[2],e[3],e[4]):(e=m.exec(t))?S(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=g.exec(t))?O(e[1],e[2]/100,e[3]/100,1):(e=y.exec(t))?O(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?w(v[t]):"transparent"===t?new M(NaN,NaN,NaN,0):null}function w(t){return new M(t>>16&255,t>>8&255,255&t,1)}function S(t,e,n,r){return r<=0&&(t=e=n=NaN),new M(t,e,n,r)}function E(t,e,n,r){return 1===arguments.length?((i=t)instanceof o||(i=x(i)),i?new M((i=i.rgb()).r,i.g,i.b,i.opacity):new M):new M(t,e,n,null==r?1:r);var i}function M(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function T(){return"#"+C(this.r)+C(this.g)+C(this.b)}function A(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function C(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function O(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new k(t,e,n,r)}function P(t){if(t instanceof k)return new k(t.h,t.s,t.l,t.opacity);if(t instanceof o||(t=x(t)),!t)return new k;if(t instanceof k)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,u=a-i,l=(a+i)/2;return u?(s=e===a?(n-r)/u+6*(n<r):n===a?(r-e)/u+2:(e-n)/u+4,u/=l<.5?a+i:2-a-i,s*=60):u=l>0&&l<1?0:s,new k(s,u,l,t.opacity)}function k(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function L(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}r(o,x,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:_,formatHex:_,formatHsl:function(){return P(this).formatHsl()},formatRgb:b,toString:b}),r(M,E,i(o,{brighter:function(t){return t=null==t?s:Math.pow(s,t),new M(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new M(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:T,formatHex:T,formatRgb:A,toString:A})),r(k,(function(t,e,n,r){return 1===arguments.length?P(t):new k(t,e,n,null==r?1:r)}),i(o,{brighter:function(t){return t=null==t?s:Math.pow(s,t),new k(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new k(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new M(L(t>=240?t-240:t+120,i,r),L(t,i,r),L(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}))},1997:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",i="minute",o="hour",a="day",s="week",u="month",l="quarter",c="year",h="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},y={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),o=n-i<0,a=e.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:c,w:s,d:a,D:h,h:o,m:i,s:r,ms:n,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",_={};_[v]=m;var b=function(t){return t instanceof E},x=function(t,e,n){var r;if(!t)return v;if("string"==typeof t)_[t]&&(r=t),e&&(_[t]=e,r=t);else{var i=t.name;_[i]=t,r=i}return!n&&r&&(v=r),r||!n&&v},w=function(t,e){if(b(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new E(n)},S=y;S.l=x,S.i=b,S.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var E=function(){function m(t){this.$L=x(t.locale,null,!0),this.parse(t)}var g=m.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(f);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return w(t)<this.startOf(e)},g.isBefore=function(t,e){return this.endOf(e)<w(t)},g.$g=function(t,e,n){return S.u(t)?this[e]:this.set(n,t)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(t,e){var n=this,l=!!S.u(e)||e,p=S.p(t),f=function(t,e){var r=S.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return l?r:r.endOf(a)},d=function(t,e){return S.w(n.toDate()[t].apply(n.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case c:return l?f(1,0):f(31,11);case u:return l?f(1,g):f(0,g+1);case s:var _=this.$locale().weekStart||0,b=(m<_?m+7:m)-_;return f(l?y-b:y+(6-b),g);case a:case h:return d(v+"Hours",0);case o:return d(v+"Minutes",1);case i:return d(v+"Seconds",2);case r:return d(v+"Milliseconds",3);default:return this.clone()}},g.endOf=function(t){return this.startOf(t,!1)},g.$set=function(t,e){var s,l=S.p(t),p="set"+(this.$u?"UTC":""),f=(s={},s[a]=p+"Date",s[h]=p+"Date",s[u]=p+"Month",s[c]=p+"FullYear",s[o]=p+"Hours",s[i]=p+"Minutes",s[r]=p+"Seconds",s[n]=p+"Milliseconds",s)[l],d=l===a?this.$D+(e-this.$W):e;if(l===u||l===c){var m=this.clone().set(h,1);m.$d[f](d),m.init(),this.$d=m.set(h,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](d);return this.init(),this},g.set=function(t,e){return this.clone().$set(t,e)},g.get=function(t){return this[S.p(t)]()},g.add=function(n,l){var h,p=this;n=Number(n);var f=S.p(l),d=function(t){var e=w(p);return S.w(e.date(e.date()+Math.round(t*n)),p)};if(f===u)return this.set(u,this.$M+n);if(f===c)return this.set(c,this.$y+n);if(f===a)return d(1);if(f===s)return d(7);var m=(h={},h[i]=t,h[o]=e,h[r]=1e3,h)[f]||1,g=this.$d.getTime()+n*m;return S.w(g,this)},g.subtract=function(t,e){return this.add(-1*t,e)},g.format=function(t){var e=this;if(!this.isValid())return p;var n=t||"YYYY-MM-DDTHH:mm:ssZ",r=S.z(this),i=this.$locale(),o=this.$H,a=this.$m,s=this.$M,u=i.weekdays,l=i.months,c=function(t,r,i,o){return t&&(t[r]||t(e,n))||i[r].substr(0,o)},h=function(t){return S.s(o%12||12,t,"0")},f=i.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:S.s(s+1,2,"0"),MMM:c(i.monthsShort,s,l,3),MMMM:c(l,s),D:this.$D,DD:S.s(this.$D,2,"0"),d:String(this.$W),dd:c(i.weekdaysMin,this.$W,u,2),ddd:c(i.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:S.s(o,2,"0"),h:h(1),hh:h(2),a:f(o,a,!0),A:f(o,a,!1),m:String(a),mm:S.s(a,2,"0"),s:String(this.$s),ss:S.s(this.$s,2,"0"),SSS:S.s(this.$ms,3,"0"),Z:r};return n.replace(d,(function(t,e){return e||m[t]||r.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,h,p){var f,d=S.p(h),m=w(n),g=(m.utcOffset()-this.utcOffset())*t,y=this-m,v=S.m(this,m);return v=(f={},f[c]=v/12,f[u]=v,f[l]=v/3,f[s]=(y-g)/6048e5,f[a]=(y-g)/864e5,f[o]=y/e,f[i]=y/t,f[r]=y/1e3,f)[d]||y,p?v:S.a(v)},g.daysInMonth=function(){return this.endOf(u).$D},g.$locale=function(){return _[this.$L]},g.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=x(t,e,!0);return r&&(n.$L=r),n},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),M=E.prototype;return w.prototype=M,[["$ms",n],["$s",r],["$m",i],["$H",o],["$W",a],["$M",u],["$y",c],["$D",h]].forEach((function(t){M[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,E,w),t.$i=!0),w},w.locale=x,w.isDayjs=b,w.unix=function(t){return w(1e3*t)},w.en=_[v],w.Ls=_,w.p={},w}()},1374:(t,e,n)=>{var r=n(3571),i=n(9462),o=n(2641),a=n(9360),s=n(3799),u=n(3846),l=Date.prototype.getTime;function c(t){return null==t}function h(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}t.exports=function t(e,n,p){var f=p||{};return!!(f.strict?o(e,n):e===n)||(!e||!n||"object"!=typeof e&&"object"!=typeof n?f.strict?o(e,n):e==n:function(e,n,o){var p,f;if(typeof e!=typeof n)return!1;if(c(e)||c(n))return!1;if(e.prototype!==n.prototype)return!1;if(i(e)!==i(n))return!1;var d=a(e),m=a(n);if(d!==m)return!1;if(d||m)return e.source===n.source&&s(e)===s(n);if(u(e)&&u(n))return l.call(e)===l.call(n);var g=h(e),y=h(n);if(g!==y)return!1;if(g||y){if(e.length!==n.length)return!1;for(p=0;p<e.length;p++)if(e[p]!==n[p])return!1;return!0}if(typeof e!=typeof n)return!1;try{var v=r(e),_=r(n)}catch(t){return!1}if(v.length!==_.length)return!1;for(v.sort(),_.sort(),p=v.length-1;p>=0;p--)if(v[p]!=_[p])return!1;for(p=v.length-1;p>=0;p--)if(!t(e[f=v[p]],n[f],o))return!1;return!0}(e,n,f))}},6648:(t,e,n)=>{"use strict";var r=n(3571),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=n(138)(),l=s&&u,c=function(t,e,n,r){if(e in t)if(!0===r){if(t[e]===n)return}else if("function"!=typeof(i=r)||"[object Function]"!==o.call(i)||!r())return;var i;l?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n},h=function(t,e){var n=arguments.length>2?arguments[2]:{},o=r(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s<o.length;s+=1)c(t,o[s],e[o[s]],n[o[s]])};h.supportsDescriptors=!!l,t.exports=h},1338:t=>{function e(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i<this._datasetLength;i++)if(1!==this._visited[i]){this._visited[i]=1;var o=this._regionQuery(i);if(o.length<this.minPts)this.noise.push(i);else{var a=this.clusters.length;this.clusters.push([]),this._addToCluster(i,a),this._expandCluster(a,o)}}return this.clusters},e.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},e.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(1!==this._visited[r]){this._visited[r]=1;var i=this._regionQuery(r);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n<this._datasetLength;n++)this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n);return e},e.prototype._mergeArrays=function(t,e){for(var n=e.length,r=0;r<n;r++){var i=e[r];t.indexOf(i)<0&&t.push(i)}return t},e.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=e)},6731:t=>{function e(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}e.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(this.distance=n)},e.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,r=0;r<this.k;r++)this.centroids[r]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var o=0;o<this.k;o++){for(var a=new Array(c),s=0,u=0;u<c;u++)a[u]=0;for(var l=0;l<n;l++){var c=this.dataset[l].length;if(o===this.assignments[l]){for(u=0;u<c;u++)a[u]+=this.dataset[l][u];s++}}if(s>0){for(u=0;u<c;u++)a[u]/=s;this.centroids[o]=a}else this.centroids[o]=this.randomCentroid(),i=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;r<n;r++)(t=this.argmin(this.dataset[r],this.centroids,this.distance))!=this.assignments[r]&&(this.assignments[r]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)void 0===e[t=this.assignments[n]]&&(e[t]=[]),e[t].push(n);return e},e.prototype.argmin=function(t,e,n){for(var r,i=Number.MAX_VALUE,o=0,a=e.length,s=0;s<a;s++)(r=n(t,e[s]))<i&&(i=r,o=s);return o},e.prototype.distance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)},t.exports&&(t.exports=e)},6515:(t,e,n)=>{if(t.exports)var r=n(5672);function i(t,e,n,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,r)}i.prototype.run=function(t,e,n,i){this._init(t,e,n,i);for(var o=0,a=this.dataset.length;o<a;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var s=this.clusters.length-1;this._orderedList.push(o);var u=new r(null,null,"asc"),l=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,l,u),this._expandCluster(s,u))}return this.clusters},i.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var r=this._orderedList[e],i=this._reachability[r];t.push([r,i])}return t},i.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},i.prototype._updateQueue=function(t,e,n){var r=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===r._processed[e]){var i=r.distance(r.dataset[t],r.dataset[e]),o=Math.max(r._coreDistance,i);void 0===r._reachability[e]?(r._reachability[e]=o,n.insert(e,o)):o<r._reachability[e]&&(r._reachability[e]=o,n.remove(e),n.insert(e,o))}}))},i.prototype._expandCluster=function(t,e){for(var n=e.getElements(),r=0,i=n.length;r<i;r++){var o=n[r];if(void 0===this._processed[o]){var a=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,a,e),this._expandCluster(t,e))}}},i.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++)if(this._regionQuery(t,n).length>=this.minPts)return n},i.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r<i;r++)this.distance(this.dataset[t],this.dataset[r])<e&&n.push(r);return n},i.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=i)},5672:t=>{function e(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}e.prototype.insert=function(t,e){for(var n=this._queue.length,r=n;r--;){var i=this._priorities[r];"desc"===this._sorting?e>i&&(n=r):e<i&&(n=r)}this._insertAt(t,e,n)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;)if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var r=0;r<t.length;r++)this.insert(t[r],e[r])}n&&(this._sorting=n)},e.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},t.exports&&(t.exports=e)},8788:(t,e,n)=>{t.exports&&(t.exports={DBSCAN:n(1338),KMEANS:n(6731),OPTICS:n(6515),PriorityQueue:n(5672)})},6319:t=>{"use strict";function e(t,e,r){r=r||2;var o,a,s,u,h,p,d,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 o,a,s,u=[];for(o=0,a=e.length;o<a;o++)(s=n(t,e[o]*i,o<a-1?e[o+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),u.push(f(s));for(u.sort(l),o=0;o<u.length;o++)r=c(u[o],r);return r}(t,e,y,r)),t.length>80*r){o=s=t[0],a=u=t[1];for(var _=r;_<g;_+=r)(h=t[_])<o&&(o=h),(p=t[_+1])<a&&(a=p),h>s&&(s=h),p>u&&(u=p);d=0!==(d=Math.max(s-o,u-a))?32767/d:0}return i(y,v,r,o,a,d,0),v}function n(t,e,n,r,i){var o,a;if(i===T(t,e,n,r)>0)for(o=e;o<n;o+=r)a=S(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=S(o,t[o],t[o+1],a);return a&&y(a,a.next)&&(E(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!y(r,r.next)&&0!==g(r.prev,r,r.next))r=r.next;else{if(E(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function i(t,e,n,l,c,h,f){if(t){!f&&h&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=p(i.x,i.y,e,n,r)),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,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,l,c,h);for(var d,m,g=t;t.prev!==t.next;)if(d=t.prev,m=t.next,h?a(t,l,c,h):o(t))e.push(d.i/n|0),e.push(t.i/n|0),e.push(m.i/n|0),E(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?i(t=s(r(t),e,n),e,n,l,c,h,2):2===f&&u(t,e,n,l,c,h):i(r(t),e,n,l,c,h,1);break}}}function o(t){var e=t.prev,n=t,r=t.next;if(g(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,a=r.x,s=e.y,u=n.y,l=r.y,c=i<o?i<a?i:a:o<a?o:a,h=s<u?s<l?s:l:u<l?u:l,p=i>o?i>a?i:a:o>a?o:a,f=s>u?s>l?s:l:u>l?u:l,m=r.next;m!==e;){if(m.x>=c&&m.x<=p&&m.y>=h&&m.y<=f&&d(i,s,o,u,a,l,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function a(t,e,n,r){var i=t.prev,o=t,a=t.next;if(g(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,h=o.y,f=a.y,m=s<u?s<l?s:l:u<l?u:l,y=c<h?c<f?c:f:h<f?h:f,v=s>u?s>l?s:l:u>l?u:l,_=c>h?c>f?c:f:h>f?h:f,b=p(m,y,e,n,r),x=p(v,_,e,n,r),w=t.prevZ,S=t.nextZ;w&&w.z>=b&&S&&S.z<=x;){if(w.x>=m&&w.x<=v&&w.y>=y&&w.y<=_&&w!==i&&w!==a&&d(s,c,u,h,l,f,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,S.x>=m&&S.x<=v&&S.y>=y&&S.y<=_&&S!==i&&S!==a&&d(s,c,u,h,l,f,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;w&&w.z>=b;){if(w.x>=m&&w.x<=v&&w.y>=y&&w.y<=_&&w!==i&&w!==a&&d(s,c,u,h,l,f,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=x;){if(S.x>=m&&S.x<=v&&S.y>=y&&S.y<=_&&S!==i&&S!==a&&d(s,c,u,h,l,f,S.x,S.y)&&g(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function s(t,e,n){var i=t;do{var o=i.prev,a=i.next.next;!y(o,a)&&v(o,i,i.next,a)&&x(o,a)&&x(a,o)&&(e.push(o.i/n|0),e.push(i.i/n|0),e.push(a.i/n|0),E(i),E(i.next),i=t=a),i=i.next}while(i!==t);return r(i)}function u(t,e,n,o,a,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&m(u,l)){var c=w(u,l);return u=r(u,u.next),c=r(c,c.next),i(u,e,n,o,a,s,0),void i(c,e,n,o,a,s,0)}l=l.next}u=u.next}while(u!==t)}function l(t,e){return t.x-e.x}function c(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==e);if(!n)return null;var u,l=n,c=n.x,p=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&d(o<p?i:a,o,c,p,o<p?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),x(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&h(n,r)))&&(n=r,f=u)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var i=w(n,t);return r(i,i.next),r(n,n.next)}function h(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function p(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function d(t,e,n,r,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&v(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(x(t,e)&&x(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||y(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,n,r){var i=b(g(t,e,n)),o=b(g(t,e,r)),a=b(g(n,r,t)),s=b(g(n,r,e));return i!==o&&a!==s||!(0!==i||!_(t,n,e))||!(0!==o||!_(t,r,e))||!(0!==a||!_(n,t,r))||!(0!==s||!_(n,e,r))}function _(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function b(t){return t>0?1:t<0?-1:0}function x(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function w(t,e){var n=new M(t.i,t.x,t.y),r=new M(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function S(t,e,n,r){var i=new M(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function E(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,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}t.exports=e,t.exports.default=e,e.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(T(t,0,o,n));if(i)for(var s=0,u=e.length;s<u;s++){var l=e[s]*n,c=s<u-1?e[s+1]*n:t.length;a-=Math.abs(T(t,l,c,n))}var h=0;for(s=0;s<r.length;s+=3){var p=r[s]*n,f=r[s+1]*n,d=r[s+2]*n;h+=Math.abs((t[p]-t[d])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[d+1]-t[p+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},e.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}},1154:t=>{function e(t){var e=t.target||t.srcElement;e.__resizeRAF__&&cancelAnimationFrame(e.__resizeRAF__),e.__resizeRAF__=requestAnimationFrame((function(){var n=e.__resizeTrigger__,r=n&&n.__resizeListeners__;r&&r.forEach((function(e){e.call(n,t)}))}))}var n=function(t,n){var r,i=this.document,o=i.attachEvent;if("undefined"!=typeof navigator&&(r=navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/)),!t.__resizeListeners__)if(t.__resizeListeners__=[],o)t.__resizeTrigger__=t,t.attachEvent("onresize",e);else{"static"===getComputedStyle(t).position&&(t.style.position="relative");var a=t.__resizeTrigger__=i.createElement("object");a.setAttribute("style","position: absolute; top: 0; left: 0; height: 100%; width: 100%; pointer-events: none; z-index: -1; opacity: 0;"),a.setAttribute("class","resize-sensor"),a.setAttribute("tabindex","-1"),a.setAttribute("title",""),a.__resizeElement__=t,a.onload=function(){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__,this.contentDocument.defaultView.addEventListener("resize",e)},a.type="text/html",r&&t.appendChild(a),a.data="about:blank",r||t.appendChild(a)}t.__resizeListeners__.push(n)};t.exports="undefined"==typeof window?n:n.bind(window),t.exports.unbind=function(t,n){var r=document.attachEvent,i=t.__resizeListeners__||[];if(n){var o=i.indexOf(n);-1!==o&&i.splice(o,1)}else i=t.__resizeListeners__=[];if(!i.length){if(r)t.detachEvent("onresize",e);else if(t.__resizeTrigger__){var a=t.__resizeTrigger__.contentDocument,s=a&&a.defaultView;s&&(s.removeEventListener("resize",e),delete s.__resizeTrigger__),t.__resizeTrigger__=!t.removeChild(t.__resizeTrigger__)}delete t.__resizeListeners__}}},1883:t=>{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,o),!0;case 6:return c.fn.call(c.context,e,r,i,o,a),!0}for(l=1,u=new Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var p,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(p=1,u=new Array(h-1);p<h;p++)u[p-1]=arguments[p];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,l=[],c=s.length;u<c;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s},413:t=>{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,o),!0;case 6:return c.fn.call(c.context,e,r,i,o,a),!0}for(l=1,u=new Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var p,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(p=1,u=new Array(h-1);p<h;p++)u[p-1]=arguments[p];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,l=[],c=s.length;u<c;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s},9748:t=>{"use strict";var e=Array.prototype.slice,n=Object.prototype.toString;t.exports=function(t){var r=this;if("function"!=typeof r||"[object Function]"!==n.call(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var i,o=e.call(arguments,1),a=Math.max(0,r.length-o.length),s=[],u=0;u<a;u++)s.push("$"+u);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var n=r.apply(this,o.concat(e.call(arguments)));return Object(n)===n?n:this}return r.apply(t,o.concat(e.call(arguments)))})),r.prototype){var l=function(){};l.prototype=r.prototype,i.prototype=new l,l.prototype=null}return i}},2698:(t,e,n)=>{"use strict";var r=n(9748);t.exports=Function.prototype.bind||r},9879:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch(t){n=null}e.functionsHaveConfigurableNames=function(){if(!e()||!n)return!1;var t=n((function(){}),"name");return!!t&&!!t.configurable};var r=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof r&&""!==function(){}.bind().name},t.exports=e},2950:(t,e,n)=>{var r=n(1374),i=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:s};function o(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function a(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function s(t,e){return r(t,e,{strict:!0})}i.prototype.compare=function(t,e){if(t.type!==e.type||!a(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=o(t),i=o(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),i)}}return!1},i.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},i.prototype.compareLine=function(t,e,n,r){if(!a(t,e))return!1;var i=this.pseudoNode?t:this.removePseudo(t),o=this.pseudoNode?e:this.removePseudo(e);if(!r||this.compareCoord(i[0],o[0])||(o=this.fixStartIndex(o,i))){var s=this.compareCoord(i[n],o[n]);return this.direction||s?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},i.prototype.fixStartIndex=function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},i.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},i.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},i.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},i.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},i.prototype.removePseudo=function(t){return t},t.exports=i},2399:(t,e,n)=>{var r=n(8346),i=n(3969),o=n(4262),a=n(3374).Z,s=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function l(t){var e=new r(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),r.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.remove.call(this,t,e)},e.clear=function(){return r.prototype.clear.call(this)},e.search=function(t){var e=r.prototype.search.call(this,this.toBBox(t));return u(e)},e.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=r.prototype.all.call(this);return u(t)},e.toJSON=function(){return r.prototype.toJSON.call(this)},e.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=l,t.exports.default=l},6653:(t,e,n)=>{"use strict";var r,i=SyntaxError,o=Function,a=TypeError,s=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var l=function(){throw new a},c=u?function(){try{return l}catch(t){try{return u(arguments,"callee").get}catch(t){return l}}}():l,h=n(2770)(),p=n(7877)(),f=Object.getPrototypeOf||(p?function(t){return t.__proto__}:null),d={},m="undefined"!=typeof Uint8Array&&f?f(Uint8Array):r,g={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":h&&f?f([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&f?f(f([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h&&f?f((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h&&f?f((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&f?f(""[Symbol.iterator]()):r,"%Symbol%":h?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":m,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(f)try{null.error}catch(t){var y=f(f(t));g["%Error.prototype%"]=y}var v=function t(e){var n;if("%AsyncFunction%"===e)n=s("async function () {}");else if("%GeneratorFunction%"===e)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=s("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&f&&(n=f(i.prototype))}return g[e]=n,n},_={"%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"]},b=n(2698),x=n(2786),w=b.call(Function.call,Array.prototype.concat),S=b.call(Function.apply,Array.prototype.splice),E=b.call(Function.call,String.prototype.replace),M=b.call(Function.call,String.prototype.slice),T=b.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,O=function(t,e){var n,r=t;if(x(_,r)&&(r="%"+(n=_[r])[0]+"%"),x(g,r)){var o=g[r];if(o===d&&(o=v(r)),void 0===o&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(t){var e=M(t,0,1),n=M(t,-1);if("%"===e&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return E(t,A,(function(t,e,n,i){r[r.length]=n?E(i,C,"$1"):e||t})),r}(t),r=n.length>0?n[0]:"",o=O("%"+r+"%",e),s=o.name,l=o.value,c=!1,h=o.alias;h&&(r=h[0],S(n,w([0,1],h)));for(var p=1,f=!0;p<n.length;p+=1){var d=n[p],m=M(d,0,1),y=M(d,-1);if(('"'===m||"'"===m||"`"===m||'"'===y||"'"===y||"`"===y)&&m!==y)throw new i("property names with quotes must have matching quotes");if("constructor"!==d&&f||(c=!0),x(g,s="%"+(r+="."+d)+"%"))l=g[s];else if(null!=l){if(!(d in l)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&p+1>=n.length){var v=u(l,d);l=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[d]}else f=x(l,d),l=l[d];f&&!c&&(g[s]=l)}}return l}},4249:(t,e,n)=>{"use strict";n.d(e,{FD:()=>o,Ib:()=>r,WT:()=>i});var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},2401:(t,e,n)=>{"use strict";n.r(e),n.d(e,{add:()=>q,adjoint:()=>p,clone:()=>o,copy:()=>a,create:()=>i,determinant:()=>f,equals:()=>J,exactEquals:()=>K,frob:()=>W,fromQuat:()=>R,fromQuat2:()=>C,fromRotation:()=>S,fromRotationTranslation:()=>A,fromRotationTranslationScale:()=>L,fromRotationTranslationScaleOrigin:()=>I,fromScaling:()=>w,fromTranslation:()=>x,fromValues:()=>s,fromXRotation:()=>E,fromYRotation:()=>M,fromZRotation:()=>T,frustum:()=>D,getRotation:()=>k,getScaling:()=>P,getTranslation:()=>O,identity:()=>l,invert:()=>h,lookAt:()=>V,mul:()=>Q,multiply:()=>d,multiplyScalar:()=>X,multiplyScalarAndAdd:()=>$,ortho:()=>U,orthoNO:()=>j,orthoZO:()=>Z,perspective:()=>F,perspectiveFromFieldOfView:()=>B,perspectiveNO:()=>N,perspectiveZO:()=>z,rotate:()=>y,rotateX:()=>v,rotateY:()=>_,rotateZ:()=>b,scale:()=>g,set:()=>u,str:()=>H,sub:()=>tt,subtract:()=>Y,targetTo:()=>G,translate:()=>m,transpose:()=>c});var r=n(4249);function i(){var t=new r.WT(16);return r.WT!=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}function o(t){var e=new r.WT(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}function a(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}function s(t,e,n,i,o,a,s,u,l,c,h,p,f,d,m,g){var y=new r.WT(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=i,y[4]=o,y[5]=a,y[6]=s,y[7]=u,y[8]=l,y[9]=c,y[10]=h,y[11]=p,y[12]=f,y[13]=d,y[14]=m,y[15]=g,y}function u(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=m,t[15]=g,t}function l(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 c(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,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}function h(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=n*s-r*a,_=n*u-i*a,b=n*l-o*a,x=r*u-i*s,w=r*l-o*s,S=i*l-o*u,E=c*m-h*d,M=c*g-p*d,T=c*y-f*d,A=h*g-p*m,C=h*y-f*m,O=p*y-f*g,P=v*O-_*C+b*A+x*T-w*M+S*E;return P?(P=1/P,t[0]=(s*O-u*C+l*A)*P,t[1]=(i*C-r*O-o*A)*P,t[2]=(m*S-g*w+y*x)*P,t[3]=(p*w-h*S-f*x)*P,t[4]=(u*T-a*O-l*M)*P,t[5]=(n*O-i*T+o*M)*P,t[6]=(g*b-d*S-y*_)*P,t[7]=(c*S-p*b+f*_)*P,t[8]=(a*C-s*T+l*E)*P,t[9]=(r*T-n*C-o*E)*P,t[10]=(d*w-m*b+y*v)*P,t[11]=(h*b-c*w-f*v)*P,t[12]=(s*M-a*A-u*E)*P,t[13]=(n*A-r*M+i*E)*P,t[14]=(m*_-d*x-g*v)*P,t[15]=(c*x-h*_+p*v)*P,t):null}function p(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15];return t[0]=s*(p*y-f*g)-h*(u*y-l*g)+m*(u*f-l*p),t[1]=-(r*(p*y-f*g)-h*(i*y-o*g)+m*(i*f-o*p)),t[2]=r*(u*y-l*g)-s*(i*y-o*g)+m*(i*l-o*u),t[3]=-(r*(u*f-l*p)-s*(i*f-o*p)+h*(i*l-o*u)),t[4]=-(a*(p*y-f*g)-c*(u*y-l*g)+d*(u*f-l*p)),t[5]=n*(p*y-f*g)-c*(i*y-o*g)+d*(i*f-o*p),t[6]=-(n*(u*y-l*g)-a*(i*y-o*g)+d*(i*l-o*u)),t[7]=n*(u*f-l*p)-a*(i*f-o*p)+c*(i*l-o*u),t[8]=a*(h*y-f*m)-c*(s*y-l*m)+d*(s*f-l*h),t[9]=-(n*(h*y-f*m)-c*(r*y-o*m)+d*(r*f-o*h)),t[10]=n*(s*y-l*m)-a*(r*y-o*m)+d*(r*l-o*s),t[11]=-(n*(s*f-l*h)-a*(r*f-o*h)+c*(r*l-o*s)),t[12]=-(a*(h*g-p*m)-c*(s*g-u*m)+d*(s*p-u*h)),t[13]=n*(h*g-p*m)-c*(r*g-i*m)+d*(r*p-i*h),t[14]=-(n*(s*g-u*m)-a*(r*g-i*m)+d*(r*u-i*s)),t[15]=n*(s*p-u*h)-a*(r*p-i*h)+c*(r*u-i*s),t}function f(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],p=t[11],f=t[12],d=t[13],m=t[14],g=t[15];return(e*a-n*o)*(h*g-p*m)-(e*s-r*o)*(c*g-p*d)+(e*u-i*o)*(c*m-h*d)+(n*s-r*a)*(l*g-p*f)-(n*u-i*a)*(l*m-h*f)+(r*u-i*s)*(l*d-c*f)}function d(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=n[0],b=n[1],x=n[2],w=n[3];return t[0]=_*r+b*s+x*h+w*m,t[1]=_*i+b*u+x*p+w*g,t[2]=_*o+b*l+x*f+w*y,t[3]=_*a+b*c+x*d+w*v,_=n[4],b=n[5],x=n[6],w=n[7],t[4]=_*r+b*s+x*h+w*m,t[5]=_*i+b*u+x*p+w*g,t[6]=_*o+b*l+x*f+w*y,t[7]=_*a+b*c+x*d+w*v,_=n[8],b=n[9],x=n[10],w=n[11],t[8]=_*r+b*s+x*h+w*m,t[9]=_*i+b*u+x*p+w*g,t[10]=_*o+b*l+x*f+w*y,t[11]=_*a+b*c+x*d+w*v,_=n[12],b=n[13],x=n[14],w=n[15],t[12]=_*r+b*s+x*h+w*m,t[13]=_*i+b*u+x*p+w*g,t[14]=_*o+b*l+x*f+w*y,t[15]=_*a+b*c+x*d+w*v,t}function m(t,e,n){var r,i,o,a,s,u,l,c,h,p,f,d,m=n[0],g=n[1],y=n[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]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*m+s*g+h*y+e[12],t[13]=i*m+u*g+p*y+e[13],t[14]=o*m+l*g+f*y+e[14],t[15]=a*m+c*g+d*y+e[15]),t}function g(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function y(t,e,n,i){var o,a,s,u,l,c,h,p,f,d,m,g,y,v,_,b,x,w,S,E,M,T,A,C,O=i[0],P=i[1],k=i[2],L=Math.hypot(O,P,k);return L<r.Ib?null:(O*=L=1/L,P*=L,k*=L,o=Math.sin(n),s=1-(a=Math.cos(n)),u=e[0],l=e[1],c=e[2],h=e[3],p=e[4],f=e[5],d=e[6],m=e[7],g=e[8],y=e[9],v=e[10],_=e[11],b=O*O*s+a,x=P*O*s+k*o,w=k*O*s-P*o,S=O*P*s-k*o,E=P*P*s+a,M=k*P*s+O*o,T=O*k*s+P*o,A=P*k*s-O*o,C=k*k*s+a,t[0]=u*b+p*x+g*w,t[1]=l*b+f*x+y*w,t[2]=c*b+d*x+v*w,t[3]=h*b+m*x+_*w,t[4]=u*S+p*E+g*M,t[5]=l*S+f*E+y*M,t[6]=c*S+d*E+v*M,t[7]=h*S+m*E+_*M,t[8]=u*T+p*A+g*C,t[9]=l*T+f*A+y*C,t[10]=c*T+d*A+v*C,t[11]=h*T+m*A+_*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function v(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],p=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]=o*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}function _(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],p=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]=o*i-l*r,t[1]=a*i-c*r,t[2]=s*i-h*r,t[3]=u*i-p*r,t[8]=o*r+l*i,t[9]=a*r+c*i,t[10]=s*r+h*i,t[11]=u*r+p*i,t}function b(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],p=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]=o*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t}function x(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}function w(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}function S(t,e,n){var i,o,a,s=n[0],u=n[1],l=n[2],c=Math.hypot(s,u,l);return c<r.Ib?null:(s*=c=1/c,u*=c,l*=c,i=Math.sin(e),a=1-(o=Math.cos(e)),t[0]=s*s*a+o,t[1]=u*s*a+l*i,t[2]=l*s*a-u*i,t[3]=0,t[4]=s*u*a-l*i,t[5]=u*u*a+o,t[6]=l*u*a+s*i,t[7]=0,t[8]=s*l*a+u*i,t[9]=u*l*a-s*i,t[10]=l*l*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function E(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function M(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function T(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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 A(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,l=o+o,c=r*s,h=r*u,p=r*l,f=i*u,d=i*l,m=o*l,g=a*s,y=a*u,v=a*l;return t[0]=1-(f+m),t[1]=h+v,t[2]=p-y,t[3]=0,t[4]=h-v,t[5]=1-(c+m),t[6]=d+g,t[7]=0,t[8]=p+y,t[9]=d-g,t[10]=1-(c+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function C(t,e){var n=new r.WT(3),i=-e[0],o=-e[1],a=-e[2],s=e[3],u=e[4],l=e[5],c=e[6],h=e[7],p=i*i+o*o+a*a+s*s;return p>0?(n[0]=2*(u*s+h*i+l*a-c*o)/p,n[1]=2*(l*s+h*o+c*i-u*a)/p,n[2]=2*(c*s+h*a+u*o-l*i)/p):(n[0]=2*(u*s+h*i+l*a-c*o),n[1]=2*(l*s+h*o+c*i-u*a),n[2]=2*(c*s+h*a+u*o-l*i)),A(t,e,n),t}function O(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function P(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,l,c),t}function k(t,e){var n=new r.WT(3);P(n,e);var i=1/n[0],o=1/n[1],a=1/n[2],s=e[0]*i,u=e[1]*o,l=e[2]*a,c=e[4]*i,h=e[5]*o,p=e[6]*a,f=e[8]*i,d=e[9]*o,m=e[10]*a,g=s+h+m,y=0;return g>0?(y=2*Math.sqrt(g+1),t[3]=.25*y,t[0]=(p-d)/y,t[1]=(f-l)/y,t[2]=(u-c)/y):s>h&&s>m?(y=2*Math.sqrt(1+s-h-m),t[3]=(p-d)/y,t[0]=.25*y,t[1]=(u+c)/y,t[2]=(f+l)/y):h>m?(y=2*Math.sqrt(1+h-s-m),t[3]=(f-l)/y,t[0]=(u+c)/y,t[1]=.25*y,t[2]=(p+d)/y):(y=2*Math.sqrt(1+m-s-h),t[3]=(u-c)/y,t[0]=(f+l)/y,t[1]=(p+d)/y,t[2]=.25*y),t}function L(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,l=o+o,c=a+a,h=i*u,p=i*l,f=i*c,d=o*l,m=o*c,g=a*c,y=s*u,v=s*l,_=s*c,b=r[0],x=r[1],w=r[2];return t[0]=(1-(d+g))*b,t[1]=(p+_)*b,t[2]=(f-v)*b,t[3]=0,t[4]=(p-_)*x,t[5]=(1-(h+g))*x,t[6]=(m+y)*x,t[7]=0,t[8]=(f+v)*w,t[9]=(m-y)*w,t[10]=(1-(h+d))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function I(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],l=o+o,c=a+a,h=s+s,p=o*l,f=o*c,d=o*h,m=a*c,g=a*h,y=s*h,v=u*l,_=u*c,b=u*h,x=r[0],w=r[1],S=r[2],E=i[0],M=i[1],T=i[2],A=(1-(m+y))*x,C=(f+b)*x,O=(d-_)*x,P=(f-b)*w,k=(1-(p+y))*w,L=(g+v)*w,I=(d+_)*S,R=(g-v)*S,D=(1-(p+m))*S;return t[0]=A,t[1]=C,t[2]=O,t[3]=0,t[4]=P,t[5]=k,t[6]=L,t[7]=0,t[8]=I,t[9]=R,t[10]=D,t[11]=0,t[12]=n[0]+E-(A*E+P*M+I*T),t[13]=n[1]+M-(C*E+k*M+R*T),t[14]=n[2]+T-(O*E+L*M+D*T),t[15]=1,t}function R(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,h=r*s,p=i*a,f=i*s,d=i*u,m=o*a,g=o*s,y=o*u;return t[0]=1-h-d,t[1]=c+y,t[2]=p-g,t[3]=0,t[4]=c-y,t[5]=1-l-d,t[6]=f+m,t[7]=0,t[8]=p+g,t[9]=f-m,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function D(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}function N(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,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[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var F=N;function z(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,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[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function B(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),l=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function j(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=1,t}var U=j;function Z(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*l,t[15]=1,t}function V(t,e,n,i){var o,a,s,u,c,h,p,f,d,m,g=e[0],y=e[1],v=e[2],_=i[0],b=i[1],x=i[2],w=n[0],S=n[1],E=n[2];return Math.abs(g-w)<r.Ib&&Math.abs(y-S)<r.Ib&&Math.abs(v-E)<r.Ib?l(t):(p=g-w,f=y-S,d=v-E,o=b*(d*=m=1/Math.hypot(p,f,d))-x*(f*=m),a=x*(p*=m)-_*d,s=_*f-b*p,(m=Math.hypot(o,a,s))?(o*=m=1/m,a*=m,s*=m):(o=0,a=0,s=0),u=f*s-d*a,c=d*o-p*s,h=p*a-f*o,(m=Math.hypot(u,c,h))?(u*=m=1/m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=p,t[3]=0,t[4]=a,t[5]=c,t[6]=f,t[7]=0,t[8]=s,t[9]=h,t[10]=d,t[11]=0,t[12]=-(o*g+a*y+s*v),t[13]=-(u*g+c*y+h*v),t[14]=-(p*g+f*y+d*v),t[15]=1,t)}function G(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=o-n[1],p=a-n[2],f=c*c+h*h+p*p;f>0&&(c*=f=1/Math.sqrt(f),h*=f,p*=f);var d=u*p-l*h,m=l*c-s*p,g=s*h-u*c;return(f=d*d+m*m+g*g)>0&&(d*=f=1/Math.sqrt(f),m*=f,g*=f),t[0]=d,t[1]=m,t[2]=g,t[3]=0,t[4]=h*g-p*m,t[5]=p*d-c*g,t[6]=c*m-h*d,t[7]=0,t[8]=c,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function H(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]+")"}function W(t){return Math.hypot(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])}function q(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Y(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function X(t,e,n){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]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function $(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function K(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]}function J(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],h=t[8],p=t[9],f=t[10],d=t[11],m=t[12],g=t[13],y=t[14],v=t[15],_=e[0],b=e[1],x=e[2],w=e[3],S=e[4],E=e[5],M=e[6],T=e[7],A=e[8],C=e[9],O=e[10],P=e[11],k=e[12],L=e[13],I=e[14],R=e[15];return Math.abs(n-_)<=r.Ib*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(i-b)<=r.Ib*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(o-x)<=r.Ib*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-w)<=r.Ib*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-S)<=r.Ib*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(u-E)<=r.Ib*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(l-M)<=r.Ib*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(c-T)<=r.Ib*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-A)<=r.Ib*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(p-C)<=r.Ib*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(f-O)<=r.Ib*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(d-P)<=r.Ib*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(m-k)<=r.Ib*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(g-L)<=r.Ib*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(y-I)<=r.Ib*Math.max(1,Math.abs(y),Math.abs(I))&&Math.abs(v-R)<=r.Ib*Math.max(1,Math.abs(v),Math.abs(R))}var Q=d,tt=Y},9341:(t,e,n)=>{"use strict";n.d(e,{$X:()=>l,AK:()=>p,Fv:()=>h,I6:()=>d,IH:()=>u,JG:()=>a,Ue:()=>i,al:()=>o,lu:()=>m,t7:()=>f,t8:()=>s,tk:()=>c});var r=n(4249);function i(){var t=new r.WT(2);return r.WT!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t,e){var n=new r.WT(2);return n[0]=t,n[1]=e,n}function a(t,e){return t[0]=e[0],t[1]=e[1],t}function s(t,e,n){return t[0]=e,t[1]=n,t}function u(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function l(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function c(t,e){return t[0]=-e[0],t[1]=-e[1],t}function h(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function p(t,e){return t[0]*e[0]+t[1]*e[1]}function f(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function d(t,e){return t[0]===e[0]&&t[1]===e[1]}var m=l;i()},2329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{add:()=>c,angle:()=>B,bezier:()=>k,ceil:()=>d,clone:()=>o,copy:()=>u,create:()=>i,cross:()=>C,dist:()=>Y,distance:()=>x,div:()=>q,divide:()=>f,dot:()=>A,equals:()=>V,exactEquals:()=>Z,floor:()=>m,forEach:()=>J,fromValues:()=>s,hermite:()=>P,inverse:()=>M,len:()=>$,length:()=>a,lerp:()=>O,max:()=>y,min:()=>g,mul:()=>W,multiply:()=>p,negate:()=>E,normalize:()=>T,random:()=>L,rotateX:()=>N,rotateY:()=>F,rotateZ:()=>z,round:()=>v,scale:()=>_,scaleAndAdd:()=>b,set:()=>l,sqrDist:()=>X,sqrLen:()=>K,squaredDistance:()=>w,squaredLength:()=>S,str:()=>U,sub:()=>H,subtract:()=>h,transformMat3:()=>R,transformMat4:()=>I,transformQuat:()=>D,zero:()=>j});var r=n(4249);function i(){var t=new r.WT(3);return r.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=new r.WT(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function s(t,e,n){var i=new r.WT(3);return i[0]=t,i[1]=e,i[2]=n,i}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function l(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function p(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function f(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function m(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function y(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function _(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function S(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function T(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function C(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function O(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function P(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,l=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*l+i[0]*c,t[1]=e[1]*s+n[1]*u+r[1]*l+i[1]*c,t[2]=e[2]*s+n[2]*u+r[2]*l+i[2]*c,t}function k(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,l=s*a,c=3*o*s,h=3*u*a,p=u*o;return t[0]=e[0]*l+n[0]*c+r[0]*h+i[0]*p,t[1]=e[1]*l+n[1]*c+r[1]*h+i[1]*p,t[2]=e[2]*l+n[2]*c+r[2]*h+i[2]*p,t}function L(t,e){e=e||1;var n=2*r.FD()*Math.PI,i=2*r.FD()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t}function I(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function R(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function D(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],l=e[2],c=i*l-o*u,h=o*s-r*l,p=r*u-i*s,f=i*p-o*h,d=o*c-r*p,m=r*h-i*c,g=2*a;return c*=g,h*=g,p*=g,f*=2,d*=2,m*=2,t[0]=s+c+f,t[1]=u+h+d,t[2]=l+p+m,t}function N(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function F(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function z(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),l=u&&A(t,e)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function j(t){return t[0]=0,t[1]=0,t[2]=0,t}function U(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=r.Ib*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.Ib*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=r.Ib*Math.max(1,Math.abs(o),Math.abs(u))}var G,H=h,W=p,q=f,Y=x,X=w,$=a,K=S,J=(G=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)G[0]=t[a],G[1]=t[a+1],G[2]=t[a+2],i(G,G,o),t[a]=G[0],t[a+1]=G[1],t[a+2]=G[2];return t})},5512:(t,e,n)=>{"use strict";n.d(e,{AK:()=>d,Fv:()=>f,I6:()=>y,IH:()=>l,JG:()=>s,Ue:()=>i,al:()=>a,bA:()=>c,d9:()=>o,fF:()=>g,fS:()=>v,kE:()=>h,t7:()=>m,t8:()=>u,we:()=>p});var r=n(4249);function i(){var t=new r.WT(4);return r.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function o(t){var e=new r.WT(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function a(t,e,n,i){var o=new r.WT(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function u(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function l(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function c(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function p(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function f(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function d(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function m(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function g(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function y(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function v(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=e[0],u=e[1],l=e[2],c=e[3];return Math.abs(n-s)<=r.Ib*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=r.Ib*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-l)<=r.Ib*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(a-c)<=r.Ib*Math.max(1,Math.abs(a),Math.abs(c))}i()},138:(t,e,n)=>{"use strict";var r=n(6653)("%Object.defineProperty%",!0),i=function(){if(r)try{return r({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},7877:t=>{"use strict";var e={foo:{}},n=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof n)}},2770:(t,e,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,i=n(9578);t.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&i()}},9578:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},3342:(t,e,n)=>{"use strict";var r=n(9578);t.exports=function(){return r()&&!!Symbol.toStringTag}},2786:(t,e,n)=>{"use strict";var r=n(2698);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},7164:(t,e)=>{e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,h=n?i-1:0,p=n?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+f]=255&a,f+=d,a/=256,l-=8);t[n+f-d]|=128*m}},6486:(t,e,n)=>{"use strict";(e=t.exports=n(6656).default).default=e},6656:(t,e)=>{"use strict";e.default=function(){function t(e,n,r,i){this.message=e,this.expected=n,this.found=r,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(t,Error),{SyntaxError:t,parse:function(e){var n,r=arguments.length>1?arguments[1]:{},i={},o={start:Ot},a=Ot,s=function(t){return{type:"messageFormatPattern",elements:t,location:Mt()}},u=function(t){var e,n,r,i,o,a="";for(e=0,r=t.length;e<r;e+=1)for(n=0,o=(i=t[e]).length;n<o;n+=1)a+=i[n];return a},l=function(t){return{type:"messageTextElement",value:t,location:Mt()}},c=/^[^ \t\n\r,.+={}#]/,h={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},p="{",f={type:"literal",value:"{",description:'"{"'},d=",",m={type:"literal",value:",",description:'","'},g="}",y={type:"literal",value:"}",description:'"}"'},v=function(t,e){return{type:"argumentElement",id:t,format:e&&e[2],location:Mt()}},_="number",b={type:"literal",value:"number",description:'"number"'},x="date",w={type:"literal",value:"date",description:'"date"'},S="time",E={type:"literal",value:"time",description:'"time"'},M=function(t,e){return{type:t+"Format",style:e&&e[2],location:Mt()}},T="plural",A={type:"literal",value:"plural",description:'"plural"'},C=function(t){return{type:t.type,ordinal:!1,offset:t.offset||0,options:t.options,location:Mt()}},O="selectordinal",P={type:"literal",value:"selectordinal",description:'"selectordinal"'},k=function(t){return{type:t.type,ordinal:!0,offset:t.offset||0,options:t.options,location:Mt()}},L="select",I={type:"literal",value:"select",description:'"select"'},R=function(t){return{type:"selectFormat",options:t,location:Mt()}},D="=",N={type:"literal",value:"=",description:'"="'},F=function(t,e){return{type:"optionalFormatPattern",selector:t,value:e,location:Mt()}},z="offset:",B={type:"literal",value:"offset:",description:'"offset:"'},j=function(t){return t},U=function(t,e){return{type:"pluralFormat",offset:t,options:e,location:Mt()}},Z={type:"other",description:"whitespace"},V=/^[ \t\n\r]/,G={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},H={type:"other",description:"optionalWhitespace"},W=/^[0-9]/,q={type:"class",value:"[0-9]",description:"[0-9]"},Y=/^[0-9a-f]/i,X={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},$="0",K={type:"literal",value:"0",description:'"0"'},J=/^[1-9]/,Q={type:"class",value:"[1-9]",description:"[1-9]"},tt=function(t){return parseInt(t,10)},et=/^[^{}\\\0-\x1F \t\n\r]/,nt={type:"class",value:"[^{}\\\\\\0-\\x1F\\x7f \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F\\x7f \\t\\n\\r]"},rt="\\\\",it={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},ot=function(){return"\\"},at="\\#",st={type:"literal",value:"\\#",description:'"\\\\#"'},ut=function(){return"\\#"},lt="\\{",ct={type:"literal",value:"\\{",description:'"\\\\{"'},ht=function(){return"{"},pt="\\}",ft={type:"literal",value:"\\}",description:'"\\\\}"'},dt=function(){return"}"},mt="\\u",gt={type:"literal",value:"\\u",description:'"\\\\u"'},yt=function(t){return String.fromCharCode(parseInt(t,16))},vt=function(t){return t.join("")},_t=0,bt=0,xt=[{line:1,column:1,seenCR:!1}],wt=0,St=[],Et=0;if("startRule"in r){if(!(r.startRule in o))throw new Error("Can't start parsing from rule \""+r.startRule+'".');a=o[r.startRule]}function Mt(){return At(bt,_t)}function Tt(t){var n,r,i=xt[t];if(i)return i;for(n=t-1;!xt[n];)n--;for(i={line:(i=xt[n]).line,column:i.column,seenCR:i.seenCR};n<t;)"\n"===(r=e.charAt(n))?(i.seenCR||i.line++,i.column=1,i.seenCR=!1):"\r"===r||"\u2028"===r||"\u2029"===r?(i.line++,i.column=1,i.seenCR=!0):(i.column++,i.seenCR=!1),n++;return xt[t]=i,i}function At(t,e){var n=Tt(t),r=Tt(e);return{start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:r.line,column:r.column}}}function Ct(t){_t<wt||(_t>wt&&(wt=_t,St=[]),St.push(t))}function Ot(){return Pt()}function Pt(){var t,e,n;for(t=_t,e=[],n=kt();n!==i;)e.push(n),n=kt();return e!==i&&(bt=t,e=s(e)),e}function kt(){var t;return(t=function(){var t,n;return t=_t,n=function(){var t,n,r,o,a,s;if(t=_t,n=[],r=_t,(o=Dt())!==i&&(a=jt())!==i&&(s=Dt())!==i?r=o=[o,a,s]:(_t=r,r=i),r!==i)for(;r!==i;)n.push(r),r=_t,(o=Dt())!==i&&(a=jt())!==i&&(s=Dt())!==i?r=o=[o,a,s]:(_t=r,r=i);else n=i;return n!==i&&(bt=t,n=u(n)),(t=n)===i&&(t=_t,t=(n=Rt())!==i?e.substring(t,_t):n),t}(),n!==i&&(bt=t,n=l(n)),t=n}())===i&&(t=function(){var t,n,r,o,a,s,u;return t=_t,123===e.charCodeAt(_t)?(n=p,_t++):(n=i,0===Et&&Ct(f)),n!==i&&Dt()!==i?(r=function(){var t,n,r;if((t=zt())===i){if(t=_t,n=[],c.test(e.charAt(_t))?(r=e.charAt(_t),_t++):(r=i,0===Et&&Ct(h)),r!==i)for(;r!==i;)n.push(r),c.test(e.charAt(_t))?(r=e.charAt(_t),_t++):(r=i,0===Et&&Ct(h));else n=i;t=n!==i?e.substring(t,_t):n}return t}(),r!==i&&Dt()!==i?(o=_t,44===e.charCodeAt(_t)?(a=d,_t++):(a=i,0===Et&&Ct(m)),a!==i&&(s=Dt())!==i?(u=function(){var t;return t=function(){var t,n,r,o,a,s;return t=_t,e.substr(_t,6)===_?(n=_,_t+=6):(n=i,0===Et&&Ct(b)),n===i&&(e.substr(_t,4)===x?(n=x,_t+=4):(n=i,0===Et&&Ct(w)),n===i&&(e.substr(_t,4)===S?(n=S,_t+=4):(n=i,0===Et&&Ct(E)))),n!==i&&Dt()!==i?(r=_t,44===e.charCodeAt(_t)?(o=d,_t++):(o=i,0===Et&&Ct(m)),o!==i&&(a=Dt())!==i&&(s=jt())!==i?r=o=[o,a,s]:(_t=r,r=i),r===i&&(r=null),r!==i?(bt=t,t=n=M(n,r)):(_t=t,t=i)):(_t=t,t=i),t}(),t===i&&(t=function(){var t,n,r,o;return t=_t,e.substr(_t,6)===T?(n=T,_t+=6):(n=i,0===Et&&Ct(A)),n!==i&&Dt()!==i?(44===e.charCodeAt(_t)?(r=d,_t++):(r=i,0===Et&&Ct(m)),r!==i&&Dt()!==i&&(o=It())!==i?(bt=t,t=n=C(o)):(_t=t,t=i)):(_t=t,t=i),t}(),t===i&&(t=function(){var t,n,r,o;return t=_t,e.substr(_t,13)===O?(n=O,_t+=13):(n=i,0===Et&&Ct(P)),n!==i&&Dt()!==i?(44===e.charCodeAt(_t)?(r=d,_t++):(r=i,0===Et&&Ct(m)),r!==i&&Dt()!==i&&(o=It())!==i?(bt=t,t=n=k(o)):(_t=t,t=i)):(_t=t,t=i),t}(),t===i&&(t=function(){var t,n,r,o,a;if(t=_t,e.substr(_t,6)===L?(n=L,_t+=6):(n=i,0===Et&&Ct(I)),n!==i)if(Dt()!==i)if(44===e.charCodeAt(_t)?(r=d,_t++):(r=i,0===Et&&Ct(m)),r!==i)if(Dt()!==i){if(o=[],(a=Lt())!==i)for(;a!==i;)o.push(a),a=Lt();else o=i;o!==i?(bt=t,t=n=R(o)):(_t=t,t=i)}else _t=t,t=i;else _t=t,t=i;else _t=t,t=i;else _t=t,t=i;return t}()))),t}(),u!==i?o=a=[a,s,u]:(_t=o,o=i)):(_t=o,o=i),o===i&&(o=null),o!==i&&(a=Dt())!==i?(125===e.charCodeAt(_t)?(s=g,_t++):(s=i,0===Et&&Ct(y)),s!==i?(bt=t,t=n=v(r,o)):(_t=t,t=i)):(_t=t,t=i)):(_t=t,t=i)):(_t=t,t=i),t}()),t}function Lt(){var t,n,r,o,a;return t=_t,Dt()!==i?(n=function(){var t,n,r,o;return t=_t,n=_t,61===e.charCodeAt(_t)?(r=D,_t++):(r=i,0===Et&&Ct(N)),r!==i&&(o=zt())!==i?n=r=[r,o]:(_t=n,n=i),(t=n!==i?e.substring(t,_t):n)===i&&(t=jt()),t}(),n!==i&&Dt()!==i?(123===e.charCodeAt(_t)?(r=p,_t++):(r=i,0===Et&&Ct(f)),r!==i&&Dt()!==i&&(o=Pt())!==i&&Dt()!==i?(125===e.charCodeAt(_t)?(a=g,_t++):(a=i,0===Et&&Ct(y)),a!==i?(bt=t,t=F(n,o)):(_t=t,t=i)):(_t=t,t=i)):(_t=t,t=i)):(_t=t,t=i),t}function It(){var t,n,r,o;if(t=_t,n=function(){var t,n,r;return t=_t,e.substr(_t,7)===z?(n=z,_t+=7):(n=i,0===Et&&Ct(B)),n!==i&&Dt()!==i&&(r=zt())!==i?(bt=t,t=n=j(r)):(_t=t,t=i),t}(),n===i&&(n=null),n!==i)if(Dt()!==i){if(r=[],(o=Lt())!==i)for(;o!==i;)r.push(o),o=Lt();else r=i;r!==i?(bt=t,t=n=U(n,r)):(_t=t,t=i)}else _t=t,t=i;else _t=t,t=i;return t}function Rt(){var t,n;if(Et++,t=[],V.test(e.charAt(_t))?(n=e.charAt(_t),_t++):(n=i,0===Et&&Ct(G)),n!==i)for(;n!==i;)t.push(n),V.test(e.charAt(_t))?(n=e.charAt(_t),_t++):(n=i,0===Et&&Ct(G));else t=i;return Et--,t===i&&(n=i,0===Et&&Ct(Z)),t}function Dt(){var t,n,r;for(Et++,t=_t,n=[],r=Rt();r!==i;)n.push(r),r=Rt();return t=n!==i?e.substring(t,_t):n,Et--,t===i&&(n=i,0===Et&&Ct(H)),t}function Nt(){var t;return W.test(e.charAt(_t))?(t=e.charAt(_t),_t++):(t=i,0===Et&&Ct(q)),t}function Ft(){var t;return Y.test(e.charAt(_t))?(t=e.charAt(_t),_t++):(t=i,0===Et&&Ct(X)),t}function zt(){var t,n,r,o,a,s;if(t=_t,48===e.charCodeAt(_t)?(n=$,_t++):(n=i,0===Et&&Ct(K)),n===i){if(n=_t,r=_t,J.test(e.charAt(_t))?(o=e.charAt(_t),_t++):(o=i,0===Et&&Ct(Q)),o!==i){for(a=[],s=Nt();s!==i;)a.push(s),s=Nt();a!==i?r=o=[o,a]:(_t=r,r=i)}else _t=r,r=i;n=r!==i?e.substring(n,_t):r}return n!==i&&(bt=t,n=tt(n)),n}function Bt(){var t,n,r,o,a,s,u,l;return et.test(e.charAt(_t))?(t=e.charAt(_t),_t++):(t=i,0===Et&&Ct(nt)),t===i&&(t=_t,e.substr(_t,2)===rt?(n=rt,_t+=2):(n=i,0===Et&&Ct(it)),n!==i&&(bt=t,n=ot()),(t=n)===i&&(t=_t,e.substr(_t,2)===at?(n=at,_t+=2):(n=i,0===Et&&Ct(st)),n!==i&&(bt=t,n=ut()),(t=n)===i&&(t=_t,e.substr(_t,2)===lt?(n=lt,_t+=2):(n=i,0===Et&&Ct(ct)),n!==i&&(bt=t,n=ht()),(t=n)===i&&(t=_t,e.substr(_t,2)===pt?(n=pt,_t+=2):(n=i,0===Et&&Ct(ft)),n!==i&&(bt=t,n=dt()),(t=n)===i&&(t=_t,e.substr(_t,2)===mt?(n=mt,_t+=2):(n=i,0===Et&&Ct(gt)),n!==i?(r=_t,o=_t,(a=Ft())!==i&&(s=Ft())!==i&&(u=Ft())!==i&&(l=Ft())!==i?o=a=[a,s,u,l]:(_t=o,o=i),(r=o!==i?e.substring(r,_t):o)!==i?(bt=t,t=n=yt(r)):(_t=t,t=i)):(_t=t,t=i)))))),t}function jt(){var t,e,n;if(t=_t,e=[],(n=Bt())!==i)for(;n!==i;)e.push(n),n=Bt();else e=i;return e!==i&&(bt=t,e=vt(e)),e}if((n=a())!==i&&_t===e.length)return n;throw n!==i&&_t<e.length&&Ct({type:"end",description:"end of input"}),function(e,n,r,i){return null!==n&&function(t){var e=1;for(t.sort((function(t,e){return t.description<e.description?-1:t.description>e.description?1:0}));e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}(n),new t(null!==e?e:function(t,e){var n,r=new Array(t.length);for(n=0;n<t.length;n++)r[n]=t[n].description;return"Expected "+(t.length>1?r.slice(0,-1).join(", ")+" or "+r[t.length-1]:r[0])+" but "+(e?'"'+function(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(t){return"\\x0"+e(t)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(t){return"\\x"+e(t)})).replace(/[\u0100-\u0FFF]/g,(function(t){return"\\u0"+e(t)})).replace(/[\u1000-\uFFFF]/g,(function(t){return"\\u"+e(t)}))}(e)+'"':"end of input")+" found."}(n,r),n,r,i)}(null,St,wt<e.length?e.charAt(wt):null,wt<e.length?At(wt,wt+1):At(wt,wt))}}}()},2462:(t,e,n)=>{"use strict";var r=n(5478).Z;n(3321),(e=t.exports=r).default=e},4419:(t,e)=>{"use strict";function n(t,e,n){this.locales=t,this.formats=e,this.pluralFn=n}function r(t){this.id=t}function i(t,e,n,r,i){this.id=t,this.useOrdinal=e,this.offset=n,this.options=r,this.pluralFn=i}function o(t,e,n,r){this.id=t,this.offset=e,this.numberFormat=n,this.string=r}function a(t,e){this.id=t,this.options=e}e.default=n,n.prototype.compile=function(t){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(t)},n.prototype.compileMessage=function(t){if(!t||"messageFormatPattern"!==t.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var e,n,r,i=t.elements,o=[];for(e=0,n=i.length;e<n;e+=1)switch((r=i[e]).type){case"messageTextElement":o.push(this.compileMessageText(r));break;case"argumentElement":o.push(this.compileArgument(r));break;default:throw new Error("Message element does not have a valid type")}return o},n.prototype.compileMessageText=function(t){return this.currentPlural&&/(^|[^\\])#/g.test(t.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new o(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,t.value)):t.value.replace(/\\#/g,"#")},n.prototype.compileArgument=function(t){var e=t.format;if(!e)return new r(t.id);var n,o=this.formats,s=this.locales,u=this.pluralFn;switch(e.type){case"numberFormat":return n=o.number[e.style],{id:t.id,format:new Intl.NumberFormat(s,n).format};case"dateFormat":return n=o.date[e.style],{id:t.id,format:new Intl.DateTimeFormat(s,n).format};case"timeFormat":return n=o.time[e.style],{id:t.id,format:new Intl.DateTimeFormat(s,n).format};case"pluralFormat":return n=this.compileOptions(t),new i(t.id,e.ordinal,e.offset,n,u);case"selectFormat":return n=this.compileOptions(t),new a(t.id,n);default:throw new Error("Message element does not have a valid format type")}},n.prototype.compileOptions=function(t){var e,n,r,i=t.format,o=i.options,a={};for(this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===i.type?t:null,e=0,n=o.length;e<n;e+=1)a[(r=o[e]).selector]=this.compileMessage(r.value);return this.currentPlural=this.pluralStack.pop(),a},r.prototype.format=function(t){return t||"number"==typeof t?"string"==typeof t?t:String(t):""},i.prototype.getOption=function(t){var e=this.options;return e["="+t]||e[this.pluralFn(t-this.offset,this.useOrdinal)]||e.other},o.prototype.format=function(t){var e=this.numberFormat.format(t-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+e).replace(/\\#/g,"#")},a.prototype.getOption=function(t){var e=this.options;return e[t]||e.other}},2873:(t,e,n)=>{"use strict";var r=n(5303),i=n(4996),o=n(4419),a=n(6486);function s(t,e,n){var r="string"==typeof t?s.__parse(t):t;if(!r||"messageFormatPattern"!==r.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(s.formats,n),i.defineProperty(this,"_locale",{value:this._resolveLocale(e)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(r,e,n,o),u=this;this.format=function(e){try{return u._format(a,e)}catch(e){throw e.variableId?new Error("The intl string context variable '"+e.variableId+"' was not provided to the string '"+t+"'"):e}}}e.default=s,i.defineProperty(s,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),i.defineProperty(s,"__localeData__",{value:i.objCreate(null)}),i.defineProperty(s,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");s.__localeData__[t.locale.toLowerCase()]=t}}),i.defineProperty(s,"__parse",{value:a.default.parse}),i.defineProperty(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),s.prototype.resolvedOptions=function(){return{locale:this._locale}},s.prototype._compilePattern=function(t,e,n,r){return new o.default(e,n,r).compile(t)},s.prototype._findPluralRuleFunction=function(t){for(var e=s.__localeData__,n=e[t.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&e[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+t)},s.prototype._format=function(t,e){var n,i,o,a,s,u,l="";for(n=0,i=t.length;n<i;n+=1)if("string"!=typeof(o=t[n])){if(a=o.id,!e||!r.hop.call(e,a))throw(u=new Error("A value must be provided for: "+a)).variableId=a,u;s=e[a],o.options?l+=this._format(o.getOption(s),e):l+=o.format(s)}else l+=o;return l},s.prototype._mergeFormats=function(t,e){var n,o,a={};for(n in t)r.hop.call(t,n)&&(a[n]=o=i.objCreate(t[n]),e&&r.hop.call(e,n)&&r.extend(o,e[n]));return a},s.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(s.defaultLocale);var e,n,r,i,o=s.__localeData__;for(e=0,n=t.length;e<n;e+=1)for(r=t[e].toLowerCase().split("-");r.length;){if(i=o[r.join("-")])return i.locale;r.pop()}var a=t.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+t.join(", ")+", or the default locale: "+a)}},9531:(t,e)=>{"use strict";e.default={locale:"en",pluralRuleFunction:function(t,e){var n=String(t).split("."),r=!n[1],i=Number(n[0])==t,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return e?1==o&&11!=a?"one":2==o&&12!=a?"two":3==o&&13!=a?"few":"other":1==t&&r?"one":"other"}}},4996:(t,e,n)=>{"use strict";var r=n(5303),i=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),o=(!i&&Object.prototype.__defineGetter__,i?Object.defineProperty:function(t,e,n){"get"in n&&t.__defineGetter__?t.__defineGetter__(e,n.get):r.hop.call(t,e)&&!("value"in n)||(t[e]=n.value)}),a=Object.create||function(t,e){var n,i;function a(){}for(i in a.prototype=t,n=new a,e)r.hop.call(e,i)&&o(n,i,e[i]);return n};e.defineProperty=o,e.objCreate=a},5478:(t,e,n)=>{"use strict";var r=n(2873),i=n(9531);r.default.__addLocaleData(i.default),r.default.defaultLocale="en",e.Z=r.default},5303:(t,e)=>{"use strict";e.extend=function(t){var e,r,i,o,a=Array.prototype.slice.call(arguments,1);for(e=0,r=a.length;e<r;e+=1)if(i=a[e])for(o in i)n.call(i,o)&&(t[o]=i[o]);return t};var n=Object.prototype.hasOwnProperty;e.hop=n},9953:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Symbol.for("INJECTION");function r(t,e,r,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(n,this,e)&&Reflect.defineMetadata(n,r(),this,e),Reflect.hasMetadata(n,this,e)?Reflect.getMetadata(n,this,e):r()},set:function(t){Reflect.defineMetadata(n,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,i){return function(o,a){r(o,a,(function(){return t.getNamed(n,i)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,i,o){return function(a,s){r(a,s,(function(){return t.getTagged(n,i,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.getAll(n)}),e)}}}},719:(t,e,n)=>{"use strict";var r=n(9953);e.Z=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},5976:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(4172),i=n(8465);function o(t,e,n,i,o){var a={},s="number"==typeof o,u=void 0!==o&&s?o.toString():n;if(s&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var l=a[u];if(Array.isArray(l))for(var c=0,h=l;c<h.length;c++){var p=h[c];if(p.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+p.key.toString())}else l=[];l.push(i),a[u]=l,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function s(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([s(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},5700:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(4172),i=n(8465),o=n(4543),a=n(5976),s=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=s,e.inject=function(t){return function(e,n,s){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var u=new o.Metadata(i.INJECT_TAG,t);"number"==typeof s?a.tagParameter(e,n,s,u):a.tagProperty(e,n,u)}}},6047:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(4172),i=n(8465);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},49:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(8465),i=n(4543),o=n(5976);e.multiInject=function(t){return function(e,n,a){var s=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},5893:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(8465),i=n(4543),o=n(5976);e.named=function(t){return function(e,n,a){var s=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},339:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(8465),i=n(4543),o=n(5976);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},2622:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(4172),i=n(8465),o=n(4543);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},1277:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(4543),i=n(5976);e.tagged=function(t,e){return function(n,o,a){var s=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,s):i.tagProperty(n,o,s)}}},5898:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(8465),i=n(4543),o=n(5976);e.targetName=function(t){return function(e,n,a){var s=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},1637:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(8465),i=n(4543),o=n(5976);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},3383:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(4453),i=n(9022),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===r.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},6925:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},4172:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]},e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},4453:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0,e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"},e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},8465:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]},3357:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var a=n(3383),s=n(4172),u=n(4453),l=n(8465),c=n(4272),h=n(6144),p=n(4379),f=n(9774),d=n(9022),m=n(1062),g=n(2421),y=n(9643),v=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+s.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=u.BindingScopeEnum.Transient;else if(e.defaultScope!==u.BindingScopeEnum.Singleton&&e.defaultScope!==u.BindingScopeEnum.Transient&&e.defaultScope!==u.BindingScopeEnum.Request)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=d.id(),this._bindingDictionary=new y.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new c.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var a=new t,s=o([e,n],r).map((function(t){return h.getBindingDictionary(t)})),u=h.getBindingDictionary(a);return s.forEach((function(t){var e;e=u,t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),a},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return n<r.length?(o=r[n],a=e(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){var n,r=(n=e.id,function(t){return t.moduleId===n});t._bindingDictionary.removeByCondition(r)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||u.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new f.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(s.CANNOT_UNBIND+" "+m.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new y.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,l.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=h.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(g.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(s.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,u.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,u.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,l.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,u.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,u.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,l.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,u={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(u)))throw new Error(s.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(u);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=h.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),p.resolve(n)}},t}();e.Container=v},5427:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(9022);e.ContainerModule=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=r.id(),this.registry=t}},2421:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n},9643:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(4172),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},7745:(t,e,n)=>{"use strict";e.GW=e.zY=e.f3=e.b2=e.W2=void 0,n(8465);var r=n(3357);Object.defineProperty(e,"W2",{enumerable:!0,get:function(){return r.Container}});n(4453),n(5427);var i=n(6047);Object.defineProperty(e,"b2",{enumerable:!0,get:function(){return i.injectable}});n(1277),n(5893);var o=n(5700);Object.defineProperty(e,"f3",{enumerable:!0,get:function(){return o.inject}});n(339),n(1637),n(49),n(5898);var a=n(2622);Object.defineProperty(e,"zY",{enumerable:!0,get:function(){return a.postConstruct}});n(4272),n(9022);var s=n(5976);Object.defineProperty(e,"GW",{enumerable:!0,get:function(){return s.decorate}});n(1565),n(1062),n(4362)},3802:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(9022),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},4543:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(8465),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},4272:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(8465),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},2402:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}},6144:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(6925),i=n(4172),o=n(4453),a=n(8465),s=n(5017),u=n(1062),l=n(3802),c=n(4543),h=n(2402),p=n(4844),f=n(8506),d=n(804);function m(t){return t._bindingDictionary}function g(t,e,n,o,a){var s,l=v(n.container,a.serviceIdentifier);return l.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),l=v(n.container,a.serviceIdentifier)),s=e?l:l.filter((function(t){var e=new f.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=u.getServiceIdentifierAsString(t),s=i.NOT_REGISTERED;throw s+=u.listMetadataForTarget(a,n),s+=u.listRegisteredBindingsForServiceIdentifier(o,a,v),new Error(s);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;throw a=u.getServiceIdentifierAsString(t),s=i.AMBIGUOUS_MATCH+" "+a,s+=u.listRegisteredBindingsForServiceIdentifier(o,a,v),new Error(s)}}(a.serviceIdentifier,s,a,n.container),s}function y(t,e,n,r,a,s){var u,l;if(null===a){u=g(t,e,r,null,s),l=new f.Request(n,r,null,u,s);var c=new h.Plan(r,l);r.addPlan(c)}else u=g(t,e,r,a,s),l=a.addChildRequest(s.serviceIdentifier,u,s);u.forEach((function(e){var n=null;if(s.isArray())n=l.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;n=l}if(e.type===o.BindingTypeEnum.Instance&&null!==e.implementationType){var a=p.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks){var u=p.getBaseClassDependencyCount(t,e.implementationType);if(a.length<u){var c=i.ARGUMENTS_LENGTH_MISMATCH(p.getFunctionName(e.implementationType));throw new Error(c)}}a.forEach((function(e){y(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function v(t,e){var n=[],r=m(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=v(t.parent,e)),n}e.getBindingDictionary=m,e.plan=function(t,e,n,r,i,o,h,p){void 0===p&&(p=!1);var f=new l.Context(e),m=function(t,e,n,r,i,o){var s=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,u=new c.Metadata(s,n),l=new d.Target(e,"",n,u);if(void 0!==i){var h=new c.Metadata(i,o);l.metadata.push(h)}return l}(n,r,i,0,o,h);try{return y(t,p,i,f,null,m),f}catch(t){throw s.isStackOverflowExeption(t)&&f.plan&&u.circularDependencyToException(f.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new d.Target(o.TargetTypeEnum.Variable,"",e,new c.Metadata(n,r)),a=new l.Context(t);return new f.Request(e,a,null,[],i)}},1195:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n},4844:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0;var i=n(5700),o=n(4172),a=n(4453),s=n(8465),u=n(1062);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return u.getFunctionName}});var l=n(804);function c(t,e,n,i){var a=t.getConstructorMetadata(n),s=a.compilerGeneratedMetadata;if(void 0===s){var u=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(u)}var l=a.userGeneratedMetadata,c=Object.keys(l),f=0===n.length&&c.length>0,d=c.length>n.length,m=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var s=h(a,t,e,n,r);null!==s&&o.push(s)}return o}(i,e,s,l,f||d?c.length:n.length),g=p(t,n);return r(r([],m),g)}function h(t,e,n,r,s){var u=s[t.toString()]||[],c=f(u),h=!0!==c.unmanaged,p=r[t];if((p=c.inject||c.multiInject||p)instanceof i.LazyServiceIdentifer&&(p=p.unwrap()),h){if(!e&&(p===Object||p===Function||void 0===p)){var d=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(d)}var m=new l.Target(a.TargetTypeEnum.ConstructorArgument,c.targetName,p);return m.metadata=u,m}return null}function p(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,s=Object.keys(n);o<s.length;o++){var u=s[o],c=n[u],h=f(n[u]),d=h.targetName||u,m=h.inject||h.multiInject,g=new l.Target(a.TargetTypeEnum.ClassProperty,d,m);g.metadata=c,i.push(g)}var y=Object.getPrototypeOf(e.prototype).constructor;if(y!==Object){var v=p(t,y);i=r(r([],i),v)}return i}function f(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[s.INJECT_TAG],multiInject:e[s.MULTI_INJECT_TAG],targetName:e[s.NAME_TAG],unmanaged:e[s.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return c(t,u.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=c(e,u.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===s.UNMANAGED_TAG}))})),a=[].concat.apply([],o).length,l=i.length-a;return l>0?l:t(e,r)}return 0}},8506:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(9022),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},804:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(8465),i=n(9022),o=n(4543),a=n(1195),s=function(){function t(t,e,n,s){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var u=null;"string"==typeof s?u=new o.Metadata(r.NAMED_TAG,s):s instanceof o.Metadata&&(u=s),null!==u&&this.metadata.push(u)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++)if(n[e].key===t)return!0;return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=s},2682:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0;var i=n(4172),o=n(4453),a=n(8465);e.resolveInstance=function(t,e,n){var s,u,l=null;e.length>0?(u=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n),l=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(l=new((s=t).bind.apply(s,r([void 0],u))),e,n)):l=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,l),l}},4379:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(4172),i=n(4453),o=n(5017),a=n(1062),s=n(2682),u=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},l=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,c=e.target&&e.target.isArray(),h=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(c&&h)return o.map((function(e){return l(t)(e)}));var p=null;if(!e.target.isOptional()||0!==n.length){var f=n[0],d=f.scope===i.BindingScopeEnum.Singleton,m=f.scope===i.BindingScopeEnum.Request;if(d&&f.activated)return f.cache;if(m&&null!==t&&t.has(f.id))return t.get(f.id);if(f.type===i.BindingTypeEnum.ConstantValue)p=f.cache,f.activated=!0;else if(f.type===i.BindingTypeEnum.Function)p=f.cache,f.activated=!0;else if(f.type===i.BindingTypeEnum.Constructor)p=f.implementationType;else if(f.type===i.BindingTypeEnum.DynamicValue&&null!==f.dynamicValue)p=u("toDynamicValue",f.serviceIdentifier,(function(){return f.dynamicValue(e.parentContext)}));else if(f.type===i.BindingTypeEnum.Factory&&null!==f.factory)p=u("toFactory",f.serviceIdentifier,(function(){return f.factory(e.parentContext)}));else if(f.type===i.BindingTypeEnum.Provider&&null!==f.provider)p=u("toProvider",f.serviceIdentifier,(function(){return f.provider(e.parentContext)}));else{if(f.type!==i.BindingTypeEnum.Instance||null===f.implementationType){var g=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+g)}p=s.resolveInstance(f.implementationType,o,l(t))}return"function"==typeof f.onActivation&&(p=f.onActivation(e.parentContext,p)),d&&(f.cache=p,f.activated=!0),m&&null!==t&&!t.has(f.id)&&t.set(f.id,p),p}}};e.resolve=function(t){return l(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},1180:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(4453),i=n(1843),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},6308:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(1180),i=n(4079),o=n(6775),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},4079:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(6775),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},9774:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(4172),i=n(4453),o=n(6308),a=n(1843),s=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=s},1843:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(4079),i=n(6775),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},6775:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(4079),i=n(1565),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},1565:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(8465),i=n(4543),o=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||o(n,e))};e.traverseAncerstors=o;var a=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=a;var s=a(r.NAMED_TAG);e.namedConstraint=s,e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},4362:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0,e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},5017:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(4172);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},9022:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},1062:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0;var r=n(4172);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||o(t.parentRequest,e))}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=i,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(o(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=i(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=a},9462:(t,e,n)=>{"use strict";var r=n(3342)(),i=n(2864)("Object.prototype.toString"),o=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},2086:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},3846:(t,e,n)=>{"use strict";var r=Date.prototype.getDay,i=Object.prototype.toString,o=n(3342)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},9360:(t,e,n)=>{"use strict";var r,i,o,a,s=n(2864),u=n(3342)();if(u){r=s("Object.prototype.hasOwnProperty"),i=s("RegExp.prototype.exec"),o={};var l=function(){throw o};a={toString:l,valueOf:l},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=l)}var c=s("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!r(e,"value"))return!1;try{i(t,a)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===c(t)}},9361:t=>{"use strict";t.exports=n,t.exports.default=n;var e=1e20;function n(t,e,n,r,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var a=this.size=this.fontSize+2*this.buffer,s=a+2*this.buffer,u="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM;u?this.canvas=my.createOffscreenCanvas(a,a,"2d"):(this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0}),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.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),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=u?Math.round(a/2*1):Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function r(t,e,n,r,o,a){for(var s=0;s<e;s++)i(t,s,e,n,r,o,a);for(var u=0;u<n;u++)i(t,u*e,1,e,r,o,a)}function i(t,n,r,i,o,a,s){var u,l,c,h;for(a[0]=0,s[0]=-e,s[1]=e,u=0;u<i;u++)o[u]=t[n+u*r];for(u=1,l=0,c=0;u<i;u++){do{h=a[l],c=(o[u]-o[h]+u*u-h*h)/(u-h)/2}while(c<=s[l]&&--l>-1);a[++l]=u,s[l]=c,s[l+1]=e}for(u=0,l=0;u<i;u++){for(;s[l+1]<u;)l++;h=a[l],t[n+u*r]=o[h]+(u-h)*(u-h)}}n.prototype._draw=function(t,n){var i,o,a,s,u,l,c,h,p,f=this.ctx.measureText(t),d=f.width,m=2*this.buffer;n&&this.useMetrics?(u=Math.floor(f.actualBoundingBoxAscent),h=this.buffer+Math.ceil(f.actualBoundingBoxAscent),l=this.buffer,c=this.buffer,i=(o=Math.min(this.size,Math.ceil(f.actualBoundingBoxRight-f.actualBoundingBoxLeft)))+m,a=(s=Math.min(this.size-l,Math.ceil(f.actualBoundingBoxAscent+f.actualBoundingBoxDescent)))+m,this.ctx.textBaseline="alphabetic"):(i=o=this.size,a=s=this.size,u=19*this.fontSize/24,l=c=0,h=this.middle,this.ctx.textBaseline="middle"),o&&s&&(this.ctx.clearRect(c,l,o,s),this.ctx.fillText(t,this.buffer,h),p=this.ctx.getImageData(c,l,o,s));var g=new Uint8ClampedArray(i*a);return function(t,n,r,i,o,a,s){a.fill(e,0,n*r),s.fill(0,0,n*r);for(var u=(n-i)/2,l=0;l<o;l++)for(var c=0;c<i;c++){var h=(l+u)*n+c+u,p=t.data[4*(l*i+c)+3]/255;if(1===p)a[h]=0,s[h]=e;else if(0===p)a[h]=e,s[h]=0;else{var f=Math.max(0,.5-p),d=Math.max(0,p-.5);a[h]=f*f,s[h]=d*d}}}(p,i,a,o,s,this.gridOuter,this.gridInner),r(this.gridOuter,i,a,this.f,this.v,this.z),r(this.gridInner,i,a,this.f,this.v,this.z),function(t,e,n,r,i,o,a){for(var s=0;s<e*n;s++){var u=Math.sqrt(r[s])-Math.sqrt(i[s]);t[s]=Math.round(255-255*(u/o+a))}}(g,i,a,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:g,metrics:{width:o,height:s,sdfWidth:i,sdfHeight:a,top:u,left:0,advance:d}}},n.prototype.draw=function(t){return this._draw(t,!1).data},n.prototype.drawWithMetrics=function(t){return this._draw(t,!0)}},9946:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Function:()=>we,Interpreter:()=>me,default:()=>Se,evaluate:()=>xe,vm:()=>r});var r={};n.r(r),n.d(r,{Script:()=>be,compileFunction:()=>ye,createContext:()=>ge,runInContext:()=>ve,runInNewContext:()=>_e});var i={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},o="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",a={5:o,"5module":o+" export import",6:o+" const class extends export import super"},s=/^in(stanceof)?$/,u="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",l="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",c=new RegExp("["+u+"]"),h=new RegExp("["+u+l+"]");u=l=null;var p=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],f=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function d(t,e){for(var n=65536,r=0;r<e.length;r+=2){if((n+=e[r])>t)return!1;if((n+=e[r+1])>=t)return!0}}function m(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&c.test(String.fromCharCode(t)):!1!==e&&d(t,p)))}function g(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&h.test(String.fromCharCode(t)):!1!==e&&(d(t,p)||d(t,f)))))}var y=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function v(t,e){return new y(t,{beforeExpr:!0,binop:e})}var _={beforeExpr:!0},b={startsExpr:!0},x={};function w(t,e){return void 0===e&&(e={}),e.keyword=t,x[t]=new y(t,e)}var S={num:new y("num",b),regexp:new y("regexp",b),string:new y("string",b),name:new y("name",b),eof:new y("eof"),bracketL:new y("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new y("]"),braceL:new y("{",{beforeExpr:!0,startsExpr:!0}),braceR:new y("}"),parenL:new y("(",{beforeExpr:!0,startsExpr:!0}),parenR:new y(")"),comma:new y(",",_),semi:new y(";",_),colon:new y(":",_),dot:new y("."),question:new y("?",_),questionDot:new y("?."),arrow:new y("=>",_),template:new y("template"),invalidTemplate:new y("invalidTemplate"),ellipsis:new y("...",_),backQuote:new y("`",b),dollarBraceL:new y("${",{beforeExpr:!0,startsExpr:!0}),eq:new y("=",{beforeExpr:!0,isAssign:!0}),assign:new y("_=",{beforeExpr:!0,isAssign:!0}),incDec:new y("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new y("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:v("||",1),logicalAND:v("&&",2),bitwiseOR:v("|",3),bitwiseXOR:v("^",4),bitwiseAND:v("&",5),equality:v("==/!=/===/!==",6),relational:v("</>/<=/>=",7),bitShift:v("<</>>/>>>",8),plusMin:new y("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new y("**",{beforeExpr:!0}),coalesce:v("??",1),_break:w("break"),_case:w("case",_),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",_),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",_),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",b),_if:w("if"),_return:w("return",_),_switch:w("switch"),_throw:w("throw",_),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",b),_super:w("super",b),_class:w("class",b),_extends:w("extends",_),_export:w("export"),_import:w("import",b),_null:w("null",b),_true:w("true",b),_false:w("false",b),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},E=/\r\n?|\n|\u2028|\u2029/,M=new RegExp(E.source,"g");function T(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var A=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,C=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,O=Object.prototype,P=O.hasOwnProperty,k=O.toString;function L(t,e){return P.call(t,e)}var I=Array.isArray||function(t){return"[object Array]"===k.call(t)};function R(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var D=function(t,e){this.line=t,this.column=e};D.prototype.offset=function(t){return new D(this.line,this.column+t)};var N=function(t,e,n){this.start=e,this.end=n,null!==t.sourceFile&&(this.source=t.sourceFile)};function F(t,e){for(var n=1,r=0;;){M.lastIndex=r;var i=M.exec(t);if(!(i&&i.index<e))return new D(n,e-r);++n,r=i.index+i[0].length}}var z={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function B(t,e){return 2|(t?4:0)|(e?8:0)}var j=function(t,e,n){this.options=t=function(t){var e={};for(var n in z)e[n]=t&&L(t,n)?t[n]:z[n];if(e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),I(e.onToken)){var r=e.onToken;e.onToken=function(t){return r.push(t)}}return I(e.onComment)&&(e.onComment=function(t,e){return function(n,r,i,o,a,s){var u={type:n?"Block":"Line",value:r,start:i,end:o};t.locations&&(u.loc=new N(this,a,s)),t.ranges&&(u.range=[i,o]),e.push(u)}}(e,e.onComment)),e}(t),this.sourceFile=t.sourceFile,this.keywords=R(a[t.ecmaVersion>=6?6:"module"===t.sourceType?"5module":5]);var r="";if(!0!==t.allowReserved){for(var o=t.ecmaVersion;!(r=i[o]);o--);"module"===t.sourceType&&(r+=" await")}this.reservedWords=R(r);var s=(r?r+" ":"")+i.strict;this.reservedWordsStrict=R(s),this.reservedWordsStrictBind=R(s+" "+i.strictBind),this.input=String(e),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(E).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=S.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},U={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};j.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},U.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},U.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},U.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},U.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},U.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},U.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},j.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},j.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var n=this,r=0;r<t.length;r++)n=t[r](n);return n},j.parse=function(t,e){return new this(e,t).parse()},j.parseExpressionAt=function(t,e,n){var r=new this(n,t,e);return r.nextToken(),r.parseExpression()},j.tokenizer=function(t,e){return new this(e,t)},Object.defineProperties(j.prototype,U);var Z=j.prototype,V=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function G(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}Z.strictDirective=function(t){for(;;){C.lastIndex=t,t+=C.exec(this.input)[0].length;var e=V.exec(this.input.slice(t));if(!e)return!1;if("use strict"===(e[1]||e[2])){C.lastIndex=t+e[0].length;var n=C.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return";"===i||"}"===i||E.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(r+1))}t+=e[0].length,C.lastIndex=t,t+=C.exec(this.input)[0].length,";"===this.input[t]&&t++}},Z.eat=function(t){return this.type===t&&(this.next(),!0)},Z.isContextual=function(t){return this.type===S.name&&this.value===t&&!this.containsEsc},Z.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},Z.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},Z.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||E.test(this.input.slice(this.lastTokEnd,this.start))},Z.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Z.semicolon=function(){this.eat(S.semi)||this.insertSemicolon()||this.unexpected()},Z.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},Z.expect=function(t){this.eat(t)||this.unexpected()},Z.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},Z.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var n=e?t.parenthesizedAssign:t.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},Z.checkExpressionErrors=function(t,e){if(!t)return!1;var n=t.shorthandAssign,r=t.doubleProto;if(!e)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},Z.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Z.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};var H=j.prototype;H.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==S.eof;){var n=this.parseStatement(null,!0,e);t.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var o=i[r];this.raiseRecoverable(this.undefinedExports[o].start,"Export '"+o+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")};var W={kind:"loop"},q={kind:"switch"};H.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;C.lastIndex=this.pos;var e=C.exec(this.input),n=this.pos+e[0].length,r=this.input.charCodeAt(n);if(91===r)return!0;if(t)return!1;if(123===r)return!0;if(m(r,!0)){for(var i=n+1;g(this.input.charCodeAt(i),!0);)++i;var o=this.input.slice(n,i);if(!s.test(o))return!0}return!1},H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;C.lastIndex=this.pos;var t=C.exec(this.input),e=this.pos+t[0].length;return!(E.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!==this.input.length&&g(this.input.charAt(e+8)))},H.parseStatement=function(t,e,n){var r,i=this.type,o=this.startNode();switch(this.isLet(t)&&(i=S._var,r="let"),i){case S._break:case S._continue:return this.parseBreakContinueStatement(o,i.keyword);case S._debugger:return this.parseDebuggerStatement(o);case S._do:return this.parseDoStatement(o);case S._for:return this.parseForStatement(o);case S._function:return t&&(this.strict||"if"!==t&&"label"!==t)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1,!t);case S._class:return t&&this.unexpected(),this.parseClass(o,!0);case S._if:return this.parseIfStatement(o);case S._return:return this.parseReturnStatement(o);case S._switch:return this.parseSwitchStatement(o);case S._throw:return this.parseThrowStatement(o);case S._try:return this.parseTryStatement(o);case S._const:case S._var:return r=r||this.value,t&&"var"!==r&&this.unexpected(),this.parseVarStatement(o,r);case S._while:return this.parseWhileStatement(o);case S._with:return this.parseWithStatement(o);case S.braceL:return this.parseBlock(!0,o);case S.semi:return this.parseEmptyStatement(o);case S._export:case S._import:if(this.options.ecmaVersion>10&&i===S._import){C.lastIndex=this.pos;var a=C.exec(this.input),s=this.pos+a[0].length,u=this.input.charCodeAt(s);if(40===u||46===u)return this.parseExpressionStatement(o,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===S._import?this.parseImport(o):this.parseExport(o,n);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(o,!0,!t);var l=this.value,c=this.parseExpression();return i===S.name&&"Identifier"===c.type&&this.eat(S.colon)?this.parseLabeledStatement(o,l,c,t):this.parseExpressionStatement(o,c)}},H.parseBreakContinueStatement=function(t,e){var n="break"===e;this.next(),this.eat(S.semi)||this.insertSemicolon()?t.label=null:this.type!==S.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if(null==t.label||i.name===t.label.name){if(null!=i.kind&&(n||"loop"===i.kind))break;if(t.label&&n)break}}return r===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,n?"BreakStatement":"ContinueStatement")},H.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},H.parseDoStatement=function(t){return this.next(),this.labels.push(W),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(S._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(S.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},H.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(W),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var n=this.isLet();if(this.type===S._var||this.type===S._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===r.declarations.length?(this.options.ecmaVersion>=9&&(this.type===S._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,r)):(e>-1&&this.unexpected(e),this.parseFor(t,r))}var o=new G,a=this.parseExpression(!0,o);return this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===S._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(a,!1,o),this.checkLVal(a),this.parseForIn(t,a)):(this.checkExpressionErrors(o,!0),e>-1&&this.unexpected(e),this.parseFor(t,a))},H.parseFunctionStatement=function(t,e,n){return this.next(),this.parseFunction(t,X|(n?0:$),!1,e)},H.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(S._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},H.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(S.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},H.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(S.braceL),this.labels.push(q),this.enterScope(0);for(var n=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var r=this.type===S._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),r?e.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,e.test=null),this.expect(S.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},H.parseThrowStatement=function(t){return this.next(),E.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Y=[];H.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===S._catch){var e=this.startNode();if(this.next(),this.eat(S.parenL)){e.param=this.parseBindingAtom();var n="Identifier"===e.param.type;this.enterScope(n?32:0),this.checkLVal(e.param,n?4:2),this.expect(S.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(S._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},H.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},H.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(W),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},H.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},H.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},H.parseLabeledStatement=function(t,e,n,r){for(var i=0,o=this.labels;i<o.length;i+=1)o[i].name===e&&this.raise(n.start,"Label '"+e+"' is already declared");for(var a=this.type.isLoop?"loop":this.type===S._switch?"switch":null,s=this.labels.length-1;s>=0;s--){var u=this.labels[s];if(u.statementStart!==t.start)break;u.statementStart=this.start,u.kind=a}return this.labels.push({name:e,kind:a,statementStart:this.start}),t.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.labels.pop(),t.label=n,this.finishNode(t,"LabeledStatement")},H.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},H.parseBlock=function(t,e,n){for(void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),e.body=[],this.expect(S.braceL),t&&this.enterScope(0);this.type!==S.braceR;){var r=this.parseStatement(null);e.body.push(r)}return n&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")},H.parseFor=function(t,e){return t.init=e,this.expect(S.semi),t.test=this.type===S.semi?null:this.parseExpression(),this.expect(S.semi),t.update=this.type===S.parenR?null:this.parseExpression(),this.expect(S.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},H.parseForIn=function(t,e){var n=this.type===S._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)?this.raise(e.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===e.type&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,n?"ForInStatement":"ForOfStatement")},H.parseVar=function(t,e,n){for(t.declarations=[],t.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(S.eq)?r.init=this.parseMaybeAssign(e):"const"!==n||this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===r.id.type||e&&(this.type===S._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(S.comma))break}return t},H.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,"var"===e?1:2,!1)};var X=1,$=2;H.parseFunction=function(t,e,n,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===S.star&&e&$&&this.unexpected(),t.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(t.async=!!r),e&X&&(t.id=4&e&&this.type!==S.name?null:this.parseIdent(),!t.id||e&$||this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var i=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(B(t.async,t.generator)),e&X||(t.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,n,!1),this.yieldPos=i,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(t,e&X?"FunctionDeclaration":"FunctionExpression")},H.parseFunctionParams=function(t){this.expect(S.parenL),t.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},H.parseClass=function(t,e){this.next();var n=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var r=this.startNode(),i=!1;for(r.body=[],this.expect(S.braceL);this.type!==S.braceR;){var o=this.parseClassElement(null!==t.superClass);o&&(r.body.push(o),"MethodDefinition"===o.type&&"constructor"===o.kind&&(i&&this.raise(o.start,"Duplicate constructor in the same class"),i=!0))}return this.strict=n,this.next(),t.body=this.finishNode(r,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},H.parseClassElement=function(t){var e=this;if(this.eat(S.semi))return null;var n=this.startNode(),r=function(t,r){void 0===r&&(r=!1);var i=e.start,o=e.startLoc;return!(!e.eatContextual(t)||(e.type===S.parenL||r&&e.canInsertSemicolon())&&(n.key&&e.unexpected(),n.computed=!1,n.key=e.startNodeAt(i,o),n.key.name=t,e.finishNode(n.key,"Identifier"),1))};n.kind="method",n.static=r("static");var i=this.eat(S.star),o=!1;i||(this.options.ecmaVersion>=8&&r("async",!0)?(o=!0,i=this.options.ecmaVersion>=9&&this.eat(S.star)):r("get")?n.kind="get":r("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var a=n.key,s=!1;return n.computed||n.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?n.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),i&&this.raise(a.start,"Constructor can't be a generator"),o&&this.raise(a.start,"Constructor can't be an async method"),n.kind="constructor",s=t),this.parseClassMethod(n,i,o,s),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},H.parseClassMethod=function(t,e,n,r){return t.value=this.parseMethod(e,n,r),this.finishNode(t,"MethodDefinition")},H.parseClassId=function(t,e){this.type===S.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},H.parseClassSuper=function(t){t.superClass=this.eat(S._extends)?this.parseExprSubscripts():null},H.parseExport=function(t,e){if(this.next(),this.eat(S.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseIdent(!0),this.checkExport(e,t.exported.name,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==S.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(S._default)){var n;if(this.checkExport(e,"default",this.lastTokStart),this.type===S._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),t.declaration=this.parseFunction(r,4|X,!1,n)}else if(this.type===S._class){var i=this.startNode();t.declaration=this.parseClass(i,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var o=0,a=t.specifiers;o<a.length;o+=1){var s=a[o];this.checkUnreserved(s.local),this.checkLocalExport(s.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},H.checkExport=function(t,e,n){t&&(L(t,e)&&this.raiseRecoverable(n,"Duplicate export '"+e+"'"),t[e]=!0)},H.checkPatternExport=function(t,e){var n=e.type;if("Identifier"===n)this.checkExport(t,e.name,e.start);else if("ObjectPattern"===n)for(var r=0,i=e.properties;r<i.length;r+=1){var o=i[r];this.checkPatternExport(t,o)}else if("ArrayPattern"===n)for(var a=0,s=e.elements;a<s.length;a+=1){var u=s[a];u&&this.checkPatternExport(t,u)}else"Property"===n?this.checkPatternExport(t,e.value):"AssignmentPattern"===n?this.checkPatternExport(t,e.left):"RestElement"===n?this.checkPatternExport(t,e.argument):"ParenthesizedExpression"===n&&this.checkPatternExport(t,e.expression)},H.checkVariableExport=function(t,e){if(t)for(var n=0,r=e;n<r.length;n+=1){var i=r[n];this.checkPatternExport(t,i.id)}},H.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},H.parseExportSpecifiers=function(t){var e=[],n=!0;for(this.expect(S.braceL);!this.eat(S.braceR);){if(n)n=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var r=this.startNode();r.local=this.parseIdent(!0),r.exported=this.eatContextual("as")?this.parseIdent(!0):r.local,this.checkExport(t,r.exported.name,r.exported.start),e.push(this.finishNode(r,"ExportSpecifier"))}return e},H.parseImport=function(t){return this.next(),this.type===S.string?(t.specifiers=Y,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===S.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},H.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===S.name){var n=this.startNode();if(n.local=this.parseIdent(),this.checkLVal(n.local,2),t.push(this.finishNode(n,"ImportDefaultSpecifier")),!this.eat(S.comma))return t}if(this.type===S.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLVal(r.local,2),t.push(this.finishNode(r,"ImportNamespaceSpecifier")),t}for(this.expect(S.braceL);!this.eat(S.braceR);){if(e)e=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var i=this.startNode();i.imported=this.parseIdent(!0),this.eatContextual("as")?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLVal(i.local,2),t.push(this.finishNode(i,"ImportSpecifier"))}return t},H.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},H.isDirectiveCandidate=function(t){return"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])};var K=j.prototype;K.toAssignable=function(t,e,n){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=t.properties;r<i.length;r+=1){var o=i[r];this.toAssignable(o,e),"RestElement"!==o.type||"ArrayPattern"!==o.argument.type&&"ObjectPattern"!==o.argument.type||this.raise(o.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",n&&this.checkPatternErrors(n,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,n);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else n&&this.checkPatternErrors(n,!0);return t},K.toAssignableList=function(t,e){for(var n=t.length,r=0;r<n;r++){var i=t[r];i&&this.toAssignable(i,e)}if(n){var o=t[n-1];6===this.options.ecmaVersion&&e&&o&&"RestElement"===o.type&&"Identifier"!==o.argument.type&&this.unexpected(o.argument.start)}return t},K.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},K.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==S.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},K.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case S.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(S.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case S.braceL:return this.parseObj(!0)}return this.parseIdent()},K.parseBindingList=function(t,e,n){for(var r=[],i=!0;!this.eat(t);)if(i?i=!1:this.expect(S.comma),e&&this.type===S.comma)r.push(null);else{if(n&&this.afterTrailingComma(t))break;if(this.type===S.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),r.push(o),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),r.push(a)}return r},K.parseBindingListItem=function(t){return t},K.parseMaybeDefault=function(t,e,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(S.eq))return n;var r=this.startNodeAt(t,e);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},K.checkLVal=function(t,e,n){switch(void 0===e&&(e=0),t.type){case"Identifier":2===e&&"let"===t.name&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),n&&(L(n,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),n[t.name]=!0),0!==e&&5!==e&&this.declareName(t.name,e,t.start);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var r=0,i=t.properties;r<i.length;r+=1){var o=i[r];this.checkLVal(o,e,n)}break;case"Property":this.checkLVal(t.value,e,n);break;case"ArrayPattern":for(var a=0,s=t.elements;a<s.length;a+=1){var u=s[a];u&&this.checkLVal(u,e,n)}break;case"AssignmentPattern":this.checkLVal(t.left,e,n);break;case"RestElement":this.checkLVal(t.argument,e,n);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,n);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}};var J=j.prototype;J.checkPropClash=function(t,e,n){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var r,i=t.key;switch(i.type){case"Identifier":r=i.name;break;case"Literal":r=String(i.value);break;default:return}var o=t.kind;if(this.options.ecmaVersion>=6)"__proto__"===r&&"init"===o&&(e.proto&&(n?n.doubleProto<0&&(n.doubleProto=i.start):this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),e.proto=!0);else{var a=e[r="$"+r];a?("init"===o?this.strict&&a.init||a.get||a.set:a.init||a[o])&&this.raiseRecoverable(i.start,"Redefinition of property"):a=e[r]={init:!1,get:!1,set:!1},a[o]=!0}}},J.parseExpression=function(t,e){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(t,e);if(this.type===S.comma){var o=this.startNodeAt(n,r);for(o.expressions=[i];this.eat(S.comma);)o.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(o,"SequenceExpression")}return i},J.parseMaybeAssign=function(t,e,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var r=!1,i=-1,o=-1;e?(i=e.parenthesizedAssign,o=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new G,r=!0);var a=this.start,s=this.startLoc;this.type!==S.parenL&&this.type!==S.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(t,e);if(n&&(u=n.call(this,u,a,s)),this.type.isAssign){var l=this.startNodeAt(a,s);return l.operator=this.value,l.left=this.type===S.eq?this.toAssignable(u,!1,e):u,r||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=l.left.start&&(e.shorthandAssign=-1),this.checkLVal(u),this.next(),l.right=this.parseMaybeAssign(t),this.finishNode(l,"AssignmentExpression")}return r&&this.checkExpressionErrors(e,!0),i>-1&&(e.parenthesizedAssign=i),o>-1&&(e.trailingComma=o),u},J.parseMaybeConditional=function(t,e){var n=this.start,r=this.startLoc,i=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return i;if(this.eat(S.question)){var o=this.startNodeAt(n,r);return o.test=i,o.consequent=this.parseMaybeAssign(),this.expect(S.colon),o.alternate=this.parseMaybeAssign(t),this.finishNode(o,"ConditionalExpression")}return i},J.parseExprOps=function(t,e){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)||i.start===n&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,n,r,-1,t)},J.parseExprOp=function(t,e,n,r,i){var o=this.type.binop;if(null!=o&&(!i||this.type!==S._in)&&o>r){var a=this.type===S.logicalOR||this.type===S.logicalAND,s=this.type===S.coalesce;s&&(o=S.logicalAND.binop);var u=this.value;this.next();var l=this.start,c=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1),l,c,o,i),p=this.buildBinary(e,n,t,h,u,a||s);return(a&&this.type===S.coalesce||s&&(this.type===S.logicalOR||this.type===S.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,e,n,r,i)}return t},J.buildBinary=function(t,e,n,r,i,o){var a=this.startNodeAt(t,e);return a.left=n,a.operator=i,a.right=r,this.finishNode(a,o?"LogicalExpression":"BinaryExpression")},J.parseMaybeUnary=function(t,e){var n,r=this.start,i=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))n=this.parseAwait(),e=!0;else if(this.type.prefix){var o=this.startNode(),a=this.type===S.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),a?this.checkLVal(o.argument):this.strict&&"delete"===o.operator&&"Identifier"===o.argument.type?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):e=!0,n=this.finishNode(o,a?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var s=this.startNodeAt(r,i);s.operator=this.value,s.prefix=!1,s.argument=n,this.checkLVal(n),this.next(),n=this.finishNode(s,"UpdateExpression")}}return!e&&this.eat(S.starstar)?this.buildBinary(r,i,n,this.parseMaybeUnary(null,!1),"**",!1):n},J.parseExprSubscripts=function(t){var e=this.start,n=this.startLoc,r=this.parseExprAtom(t);if("ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return r;var i=this.parseSubscripts(r,e,n);return t&&"MemberExpression"===i.type&&(t.parenthesizedAssign>=i.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=i.start&&(t.parenthesizedBind=-1)),i},J.parseSubscripts=function(t,e,n,r){for(var i=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&this.potentialArrowAt===t.start,o=!1;;){var a=this.parseSubscript(t,e,n,r,i,o);if(a.optional&&(o=!0),a===t||"ArrowFunctionExpression"===a.type){if(o){var s=this.startNodeAt(e,n);s.expression=a,a=this.finishNode(s,"ChainExpression")}return a}t=a}},J.parseSubscript=function(t,e,n,r,i,o){var a=this.options.ecmaVersion>=11,s=a&&this.eat(S.questionDot);r&&s&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var u=this.eat(S.bracketL);if(u||s&&this.type!==S.parenL&&this.type!==S.backQuote||this.eat(S.dot)){var l=this.startNodeAt(e,n);l.object=t,l.property=u?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),l.computed=!!u,u&&this.expect(S.bracketR),a&&(l.optional=s),t=this.finishNode(l,"MemberExpression")}else if(!r&&this.eat(S.parenL)){var c=new G,h=this.yieldPos,p=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var d=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1,c);if(i&&!s&&!this.canInsertSemicolon()&&this.eat(S.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=h,this.awaitPos=p,this.awaitIdentPos=f,this.parseArrowExpression(this.startNodeAt(e,n),d,!0);this.checkExpressionErrors(c,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;var m=this.startNodeAt(e,n);m.callee=t,m.arguments=d,a&&(m.optional=s),t=this.finishNode(m,"CallExpression")}else if(this.type===S.backQuote){(s||o)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(e,n);g.tag=t,g.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(g,"TaggedTemplateExpression")}return t},J.parseExprAtom=function(t){this.type===S.slash&&this.readRegexp();var e,n=this.potentialArrowAt===this.start;switch(this.type){case S._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),e=this.startNode(),this.next(),this.type!==S.parenL||this.allowDirectSuper||this.raise(e.start,"super() call outside constructor of a subclass"),this.type!==S.dot&&this.type!==S.bracketL&&this.type!==S.parenL&&this.unexpected(),this.finishNode(e,"Super");case S._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case S.name:var r=this.start,i=this.startLoc,o=this.containsEsc,a=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(S._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===S.name&&!o)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(S.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[a],!0)}return a;case S.regexp:var s=this.value;return(e=this.parseLiteral(s.value)).regex={pattern:s.pattern,flags:s.flags},e;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return(e=this.startNode()).value=this.type===S._null?null:this.type===S._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case S.parenL:var u=this.start,l=this.parseParenAndDistinguishExpression(n);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(t.parenthesizedAssign=u),t.parenthesizedBind<0&&(t.parenthesizedBind=u)),l;case S.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(S.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case S.braceL:return this.parseObj(!1,t);case S._function:return e=this.startNode(),this.next(),this.parseFunction(e,0);case S._class:return this.parseClass(this.startNode(),!1);case S._new:return this.parseNew();case S.backQuote:return this.parseTemplate();case S._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},J.parseExprImport=function(){var t=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var e=this.parseIdent(!0);switch(this.type){case S.parenL:return this.parseDynamicImport(t);case S.dot:return t.meta=e,this.parseImportMeta(t);default:this.unexpected()}},J.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(S.parenR)){var e=this.start;this.eat(S.comma)&&this.eat(S.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")},J.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")},J.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},J.parseParenExpression=function(){this.expect(S.parenL);var t=this.parseExpression();return this.expect(S.parenR),t},J.parseParenAndDistinguishExpression=function(t){var e,n=this.start,r=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a=this.start,s=this.startLoc,u=[],l=!0,c=!1,h=new G,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;){if(l?l=!1:this.expect(S.comma),i&&this.afterTrailingComma(S.parenR,!0)){c=!0;break}if(this.type===S.ellipsis){o=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(!1,h,this.parseParenItem))}var d=this.start,m=this.startLoc;if(this.expect(S.parenR),t&&!this.canInsertSemicolon()&&this.eat(S.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(n,r,u);u.length&&!c||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,u.length>1?((e=this.startNodeAt(a,s)).expressions=u,this.finishNodeAt(e,"SequenceExpression",d,m)):e=u[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,r);return g.expression=e,this.finishNode(g,"ParenthesizedExpression")}return e},J.parseParenItem=function(t){return t},J.parseParenArrowList=function(t,e,n){return this.parseArrowExpression(this.startNodeAt(t,e),n)};var Q=[];J.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(S.dot)){t.meta=e;var n=this.containsEsc;return t.property=this.parseIdent(!0),"target"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(t.start,"'new.target' can only be used in functions"),this.finishNode(t,"MetaProperty")}var r=this.start,i=this.startLoc,o=this.type===S._import;return t.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),o&&"ImportExpression"===t.callee.type&&this.raise(r,"Cannot use new with import()"),this.eat(S.parenL)?t.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1):t.arguments=Q,this.finishNode(t,"NewExpression")},J.parseTemplateElement=function(t){var e=t.isTagged,n=this.startNode();return this.type===S.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===S.backQuote,this.finishNode(n,"TemplateElement")},J.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:e});for(n.quasis=[r];!r.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(S.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(n,"TemplateLiteral")},J.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===S.name||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===S.star)&&!E.test(this.input.slice(this.lastTokEnd,this.start))},J.parseObj=function(t,e){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(S.braceR);){if(r)r=!1;else if(this.expect(S.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(S.braceR))break;var o=this.parseProperty(t,e);t||this.checkPropClash(o,i,e),n.properties.push(o)}return this.finishNode(n,t?"ObjectPattern":"ObjectExpression")},J.parseProperty=function(t,e){var n,r,i,o,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return t?(a.argument=this.parseIdent(!1),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===S.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,e),this.type===S.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(t||e)&&(i=this.start,o=this.startLoc),t||(n=this.eat(S.star)));var s=this.containsEsc;return this.parsePropertyName(a),!t&&!s&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(a)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(a,e)):r=!1,this.parsePropertyValue(a,t,n,r,i,o,e,s),this.finishNode(a,"Property")},J.parsePropertyValue=function(t,e,n,r,i,o,a,s){if((n||r)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===S.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(n,r);else if(e||s||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===S.comma||this.type===S.braceR||this.type===S.eq)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?((n||r)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),t.kind="init",e?t.value=this.parseMaybeDefault(i,o,t.key):this.type===S.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(i,o,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(n||r)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var u="get"===t.kind?0:1;if(t.value.params.length!==u){var l=t.value.start;"get"===t.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},J.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(S.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(S.bracketR),t.key;t.computed=!1}return t.key=this.type===S.num||this.type===S.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},J.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},J.parseMethod=function(t,e,n){var r=this.startNode(),i=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=t),this.options.ecmaVersion>=8&&(r.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|B(e,r.generator)|(n?128:0)),this.expect(S.parenL),r.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")},J.parseArrowExpression=function(t,e,n){var r=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(16|B(n,!1)),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(t,"ArrowFunctionExpression")},J.parseFunctionBody=function(t,e,n){var r=e&&this.type!==S.braceL,i=this.strict,o=!1;if(r)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);i&&!a||(o=this.strictDirective(this.end))&&a&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var s=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(t,!i&&!o&&!e&&!n&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLVal(t.id,5),t.body=this.parseBlock(!1,void 0,o&&!i),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=s}this.exitScope()},J.isSimpleParamList=function(t){for(var e=0,n=t;e<n.length;e+=1)if("Identifier"!==n[e].type)return!1;return!0},J.checkParams=function(t,e){for(var n={},r=0,i=t.params;r<i.length;r+=1){var o=i[r];this.checkLVal(o,1,e?null:n)}},J.parseExprList=function(t,e,n,r){for(var i=[],o=!0;!this.eat(t);){if(o)o=!1;else if(this.expect(S.comma),e&&this.afterTrailingComma(t))break;var a=void 0;n&&this.type===S.comma?a=null:this.type===S.ellipsis?(a=this.parseSpread(r),r&&this.type===S.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),i.push(a)}return i},J.checkUnreserved=function(t){var e=t.start,n=t.end,r=t.name;this.inGenerator&&"yield"===r&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===r&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(r)&&this.raise(e,"Unexpected keyword '"+r+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(e,n).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(this.inAsync||"await"!==r||this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+r+"' is reserved"))},J.parseIdent=function(t,e){var n=this.startNode();return this.type===S.name?n.name=this.value:this.type.keyword?(n.name=this.type.keyword,"class"!==n.name&&"function"!==n.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!t),this.finishNode(n,"Identifier"),t||(this.checkUnreserved(n),"await"!==n.name||this.awaitIdentPos||(this.awaitIdentPos=n.start)),n},J.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===S.semi||this.canInsertSemicolon()||this.type!==S.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(S.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")},J.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!1),this.finishNode(t,"AwaitExpression")};var tt=j.prototype;tt.raise=function(t,e){var n=F(this.input,t);e+=" ("+n.line+":"+n.column+")";var r=new SyntaxError(e);throw r.pos=t,r.loc=n,r.raisedAt=this.pos,r},tt.raiseRecoverable=tt.raise,tt.curPosition=function(){if(this.options.locations)return new D(this.curLine,this.pos-this.lineStart)};var et=j.prototype,nt=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};et.enterScope=function(t){this.scopeStack.push(new nt(t))},et.exitScope=function(){this.scopeStack.pop()},et.treatFunctionsAsVarInScope=function(t){return 2&t.flags||!this.inModule&&1&t.flags},et.declareName=function(t,e,n){var r=!1;if(2===e){var i=this.currentScope();r=i.lexical.indexOf(t)>-1||i.functions.indexOf(t)>-1||i.var.indexOf(t)>-1,i.lexical.push(t),this.inModule&&1&i.flags&&delete this.undefinedExports[t]}else if(4===e)this.currentScope().lexical.push(t);else if(3===e){var o=this.currentScope();r=this.treatFunctionsAsVar?o.lexical.indexOf(t)>-1:o.lexical.indexOf(t)>-1||o.var.indexOf(t)>-1,o.functions.push(t)}else for(var a=this.scopeStack.length-1;a>=0;--a){var s=this.scopeStack[a];if(s.lexical.indexOf(t)>-1&&!(32&s.flags&&s.lexical[0]===t)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(t)>-1){r=!0;break}if(s.var.push(t),this.inModule&&1&s.flags&&delete this.undefinedExports[t],3&s.flags)break}r&&this.raiseRecoverable(n,"Identifier '"+t+"' has already been declared")},et.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},et.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},et.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags)return e}},et.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags&&!(16&e.flags))return e}};var rt=function(t,e,n){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new N(t,n)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},it=j.prototype;function ot(t,e,n,r){return t.type=e,t.end=n,this.options.locations&&(t.loc.end=r),this.options.ranges&&(t.range[1]=n),t}it.startNode=function(){return new rt(this,this.start,this.startLoc)},it.startNodeAt=function(t,e){return new rt(this,t,e)},it.finishNode=function(t,e){return ot.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)},it.finishNodeAt=function(t,e,n,r){return ot.call(this,t,e,n,r)};var at=function(t,e,n,r,i){this.token=t,this.isExpr=!!e,this.preserveSpace=!!n,this.override=r,this.generator=!!i},st={b_stat:new at("{",!1),b_expr:new at("{",!0),b_tmpl:new at("${",!1),p_stat:new at("(",!1),p_expr:new at("(",!0),q_tmpl:new at("`",!0,!0,(function(t){return t.tryReadTemplateToken()})),f_stat:new at("function",!1),f_expr:new at("function",!0),f_expr_gen:new at("function",!0,!1,null,!0),f_gen:new at("function",!1,!1,null,!0)},ut=j.prototype;ut.initialContext=function(){return[st.b_stat]},ut.braceIsBlock=function(t){var e=this.curContext();return e===st.f_expr||e===st.f_stat||(t!==S.colon||e!==st.b_stat&&e!==st.b_expr?t===S._return||t===S.name&&this.exprAllowed?E.test(this.input.slice(this.lastTokEnd,this.start)):t===S._else||t===S.semi||t===S.eof||t===S.parenR||t===S.arrow||(t===S.braceL?e===st.b_stat:t!==S._var&&t!==S._const&&t!==S.name&&!this.exprAllowed):!e.isExpr)},ut.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},ut.updateContext=function(t){var e,n=this.type;n.keyword&&t===S.dot?this.exprAllowed=!1:(e=n.updateContext)?e.call(this,t):this.exprAllowed=n.beforeExpr},S.parenR.updateContext=S.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===st.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},S.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?st.b_stat:st.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(st.b_tmpl),this.exprAllowed=!0},S.parenL.updateContext=function(t){var e=t===S._if||t===S._for||t===S._with||t===S._while;this.context.push(e?st.p_stat:st.p_expr),this.exprAllowed=!0},S.incDec.updateContext=function(){},S._function.updateContext=S._class.updateContext=function(t){!t.beforeExpr||t===S.semi||t===S._else||t===S._return&&E.test(this.input.slice(this.lastTokEnd,this.start))||(t===S.colon||t===S.braceL)&&this.curContext()===st.b_stat?this.context.push(st.f_stat):this.context.push(st.f_expr),this.exprAllowed=!1},S.backQuote.updateContext=function(){this.curContext()===st.q_tmpl?this.context.pop():this.context.push(st.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(t){if(t===S._function){var e=this.context.length-1;this.context[e]===st.f_expr?this.context[e]=st.f_expr_gen:this.context[e]=st.f_gen}this.exprAllowed=!0},S.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==S.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var lt="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ct=lt+" Extended_Pictographic",ht={9:lt,10:ct,11:ct},pt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ft="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",dt=ft+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",mt={9:ft,10:dt,11:dt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},gt={};function yt(t){var e=gt[t]={binary:R(ht[t]+" "+pt),nonBinary:{General_Category:R(pt),Script:R(mt[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}yt(9),yt(10),yt(11);var vt=j.prototype,_t=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),this.unicodeProperties=gt[t.options.ecmaVersion>=11?11:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function bt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function xt(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function wt(t){return t>=65&&t<=90||t>=97&&t<=122}function St(t){return wt(t)||95===t}function Et(t){return St(t)||Mt(t)}function Mt(t){return t>=48&&t<=57}function Tt(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function At(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function Ct(t){return t>=48&&t<=55}_t.prototype.reset=function(t,e,n){var r=-1!==n.indexOf("u");this.start=0|t,this.source=e+"",this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},_t.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},_t.prototype.at=function(t,e){void 0===e&&(e=!1);var n=this.source,r=n.length;if(t>=r)return-1;var i=n.charCodeAt(t);if(!e&&!this.switchU||i<=55295||i>=57344||t+1>=r)return i;var o=n.charCodeAt(t+1);return o>=56320&&o<=57343?(i<<10)+o-56613888:i},_t.prototype.nextIndex=function(t,e){void 0===e&&(e=!1);var n=this.source,r=n.length;if(t>=r)return r;var i,o=n.charCodeAt(t);return!e&&!this.switchU||o<=55295||o>=57344||t+1>=r||(i=n.charCodeAt(t+1))<56320||i>57343?t+1:t+2},_t.prototype.current=function(t){return void 0===t&&(t=!1),this.at(this.pos,t)},_t.prototype.lookahead=function(t){return void 0===t&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},_t.prototype.advance=function(t){void 0===t&&(t=!1),this.pos=this.nextIndex(this.pos,t)},_t.prototype.eat=function(t,e){return void 0===e&&(e=!1),this.current(e)===t&&(this.advance(e),!0)},vt.validateRegExpFlags=function(t){for(var e=t.validFlags,n=t.flags,r=0;r<n.length;r++){var i=n.charAt(r);-1===e.indexOf(i)&&this.raise(t.start,"Invalid regular expression flag"),n.indexOf(i,r+1)>-1&&this.raise(t.start,"Duplicate regular expression flag")}},vt.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},vt.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,n=t.backReferenceNames;e<n.length;e+=1){var r=n[e];-1===t.groupNames.indexOf(r)&&t.raise("Invalid named capture referenced")}},vt.regexp_disjunction=function(t){for(this.regexp_alternative(t);t.eat(124);)this.regexp_alternative(t);this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")},vt.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););},vt.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):!!(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))&&(this.regexp_eatQuantifier(t),!0)},vt.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!n,!0}return t.pos=e,!1},vt.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},vt.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},vt.regexp_eatBracedQuantifier=function(t,e){var n=t.pos;if(t.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(i=t.lastIntValue),t.eat(125)))return-1!==i&&i<r&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=n}return!1},vt.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)},vt.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1},vt.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)&&t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}t.pos=e}return!1},vt.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},vt.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},vt.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},vt.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!xt(e)&&(t.lastIntValue=e,t.advance(),!0)},vt.regexp_eatPatternCharacters=function(t){for(var e=t.pos,n=0;-1!==(n=t.current())&&!xt(n);)t.advance();return t.pos!==e},vt.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e||(t.advance(),0))},vt.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},vt.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},vt.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=bt(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=bt(t.lastIntValue);return!0}return!1},vt.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,n=this.options.ecmaVersion>=11,r=t.current(n);return t.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t,n)&&(r=t.lastIntValue),function(t){return m(t,!0)||36===t||95===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},vt.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,n=this.options.ecmaVersion>=11,r=t.current(n);return t.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t,n)&&(r=t.lastIntValue),function(t){return g(t,!0)||36===t||95===t||8204===t||8205===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},vt.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},vt.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var n=t.lastIntValue;if(t.switchU)return n>t.maxBackReference&&(t.maxBackReference=n),!0;if(n<=t.numCapturingParens)return!0;t.pos=e}return!1},vt.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},vt.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},vt.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},vt.regexp_eatZero=function(t){return 48===t.current()&&!Mt(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},vt.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},vt.regexp_eatControlLetter=function(t){var e=t.current();return!!wt(e)&&(t.lastIntValue=e%32,t.advance(),!0)},vt.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){void 0===e&&(e=!1);var n,r=t.pos,i=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(i&&o>=55296&&o<=56319){var a=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var s=t.lastIntValue;if(s>=56320&&s<=57343)return t.lastIntValue=1024*(o-55296)+(s-56320)+65536,!0}t.pos=a,t.lastIntValue=o}return!0}if(i&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&(n=t.lastIntValue)>=0&&n<=1114111)return!0;i&&t.raise("Invalid unicode escape"),t.pos=r}return!1},vt.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e||(t.lastIntValue=e,t.advance(),0))},vt.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},vt.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},vt.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var n=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var r=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,n,r),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,i),!0}return!1},vt.regexp_validateUnicodePropertyNameAndValue=function(t,e,n){L(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(n)||t.raise("Invalid property value")},vt.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")},vt.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";St(e=t.current());)t.lastStringValue+=bt(e),t.advance();return""!==t.lastStringValue},vt.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Et(e=t.current());)t.lastStringValue+=bt(e),t.advance();return""!==t.lastStringValue},vt.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},vt.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},vt.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var n=t.lastIntValue;!t.switchU||-1!==e&&-1!==n||t.raise("Invalid character class"),-1!==e&&-1!==n&&e>n&&t.raise("Range out of order in character class")}}},vt.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var n=t.current();(99===n||Ct(n))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var r=t.current();return 93!==r&&(t.lastIntValue=r,t.advance(),!0)},vt.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},vt.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!Mt(e)&&95!==e||(t.lastIntValue=e%32,t.advance(),0))},vt.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},vt.regexp_eatDecimalDigits=function(t){var e=t.pos,n=0;for(t.lastIntValue=0;Mt(n=t.current());)t.lastIntValue=10*t.lastIntValue+(n-48),t.advance();return t.pos!==e},vt.regexp_eatHexDigits=function(t){var e=t.pos,n=0;for(t.lastIntValue=0;Tt(n=t.current());)t.lastIntValue=16*t.lastIntValue+At(n),t.advance();return t.pos!==e},vt.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var n=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*n+t.lastIntValue:t.lastIntValue=8*e+n}else t.lastIntValue=e;return!0}return!1},vt.regexp_eatOctalDigit=function(t){var e=t.current();return Ct(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},vt.regexp_eatFixedHexDigits=function(t,e){var n=t.pos;t.lastIntValue=0;for(var r=0;r<e;++r){var i=t.current();if(!Tt(i))return t.pos=n,!1;t.lastIntValue=16*t.lastIntValue+At(i),t.advance()}return!0};var Ot=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new N(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},Pt=j.prototype;function kt(t){return"function"!=typeof BigInt?null:BigInt(t.replace(/_/g,""))}function Lt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}Pt.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ot(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Pt.getToken=function(){return this.next(),new Ot(this)},"undefined"!=typeof Symbol&&(Pt[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===S.eof,value:e}}}}),Pt.curContext=function(){return this.context[this.context.length-1]},Pt.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(S.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},Pt.readToken=function(t){return m(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},Pt.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||t>=57344?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},Pt.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(M.lastIndex=n;(t=M.exec(this.input))&&t.index<this.pos;)++this.curLine,this.lineStart=t.index+t[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(n+2,r),n,this.pos,e,this.curPosition())},Pt.skipLineComment=function(t){for(var e=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!T(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,n,this.curPosition())},Pt.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(t>8&&t<14||t>=5760&&A.test(String.fromCharCode(t))))break t;++this.pos}}},Pt.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=t,this.value=e,this.updateContext(n)},Pt.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))},Pt.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(S.assign,2):this.finishOp(S.slash,1)},Pt.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),n=1,r=42===t?S.star:S.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++n,r=S.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(S.assign,n+1):this.finishOp(r,n)},Pt.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(S.assign,3):this.finishOp(124===t?S.logicalOR:S.logicalAND,2):61===e?this.finishOp(S.assign,2):this.finishOp(124===t?S.bitwiseOR:S.bitwiseAND,1)},Pt.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Pt.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!E.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(S.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)},Pt.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),n=1;return e===t?(n=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(S.assign,n+1):this.finishOp(S.bitShift,n)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(n=2),this.finishOp(S.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Pt.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(S.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(61===t?S.eq:S.prefix,1)},Pt.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(S.questionDot,2)}if(63===e)return t>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(S.assign,3):this.finishOp(S.coalesce,2)}return this.finishOp(S.question,1)},Pt.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(S.parenL);case 41:return++this.pos,this.finishToken(S.parenR);case 59:return++this.pos,this.finishToken(S.semi);case 44:return++this.pos,this.finishToken(S.comma);case 91:return++this.pos,this.finishToken(S.bracketL);case 93:return++this.pos,this.finishToken(S.bracketR);case 123:return++this.pos,this.finishToken(S.braceL);case 125:return++this.pos,this.finishToken(S.braceR);case 58:return++this.pos,this.finishToken(S.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(S.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(S.prefix,1)}this.raise(this.pos,"Unexpected character '"+Lt(t)+"'")},Pt.finishOp=function(t,e){var n=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,n)},Pt.readRegexp=function(){for(var t,e,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(E.test(r)&&this.raise(n,"Unterminated regular expression"),t)t=!1;else{if("["===r)e=!0;else if("]"===r&&e)e=!1;else if("/"===r&&!e)break;t="\\"===r}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var o=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(o);var s=this.regexpState||(this.regexpState=new _t(this));s.reset(n,i,a),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var u=null;try{u=new RegExp(i,a)}catch(t){}return this.finishToken(S.regexp,{pattern:i,flags:a,value:u})},Pt.readInt=function(t,e,n){for(var r=this.options.ecmaVersion>=12&&void 0===e,i=n&&48===this.input.charCodeAt(this.pos),o=this.pos,a=0,s=0,u=0,l=null==e?1/0:e;u<l;++u,++this.pos){var c=this.input.charCodeAt(this.pos),h=void 0;if(r&&95===c)i&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===s&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===u&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),s=c;else{if((h=c>=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=t)break;s=c,a=a*t+h}}return r&&95===s&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===o||null!=e&&this.pos-o!==e?null:a},Pt.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var n=this.readInt(t);return null==n&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n=kt(this.input.slice(e,this.pos)),++this.pos):m(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,n)},Pt.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10,void 0,!0)||this.raise(e,"Invalid number");var n=this.pos-e>=2&&48===this.input.charCodeAt(e);n&&this.strict&&this.raise(e,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!t&&this.options.ecmaVersion>=11&&110===r){var i=kt(this.input.slice(e,this.pos));return++this.pos,m(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,i)}n&&/[89]/.test(this.input.slice(e,this.pos))&&(n=!1),46!==r||n||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||n||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),m(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o,a=(o=this.input.slice(e,this.pos),n?parseInt(o,8):parseFloat(o.replace(/_/g,"")));return this.finishToken(S.num,a)},Pt.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},Pt.readString=function(t){for(var e="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===t)break;92===r?(e+=this.input.slice(n,this.pos),e+=this.readEscapedChar(!1),n=this.pos):(T(r,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(n,this.pos++),this.finishToken(S.string,e)};var It={};function Rt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function Dt(t){var e="function"==typeof Map?new Map:void 0;return Dt=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Nt(t,arguments,zt(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ft(r,t)},Dt(t)}function Nt(t,e,n){return Nt=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&Ft(i,n.prototype),i},Nt.apply(null,arguments)}function Ft(t,e){return Ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ft(t,e)}function zt(t){return zt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},zt(t)}Pt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==It)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pt.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw It;this.raise(t,e)},Pt.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==S.template&&this.type!==S.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(S.template,t)):36===n?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote));if(92===n)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(T(n)){switch(t+=this.input.slice(e,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},Pt.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(S.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},Pt.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Lt(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(t){var n=this.pos-1;return this.invalidStringToken(n,"Invalid escape sequence in template string"),null}default:if(e>=48&&e<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,e=this.input.charCodeAt(this.pos),"0"===r&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-r.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return T(e)?"":String.fromCharCode(e)}},Pt.readHexChar=function(t){var e=this.pos,n=this.readInt(16,t);return null===n&&this.invalidStringToken(e,"Bad character escape sequence"),n},Pt.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(g(i,r))this.pos+=i<=65535?1:2;else{if(92!==i)break;this.containsEsc=!0,t+=this.input.slice(n,this.pos);var o=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(e?m:g)(a,r)||this.invalidStringToken(o,"Invalid Unicode escape"),t+=Lt(a),n=this.pos}e=!1}return t+this.input.slice(n,this.pos)},Pt.readWord=function(){var t=this.readWord1(),e=S.name;return this.keywords.test(t)&&(e=x[t]),this.finishToken(e,t)},j.acorn={Parser:j,version:"7.4.1",defaultOptions:z,Position:D,SourceLocation:N,getLineInfo:F,Node:rt,TokenType:y,tokTypes:S,keywordTypes:x,TokContext:at,tokContexts:st,isIdentifierChar:g,isIdentifierStart:m,Token:Ot,isNewLine:T,lineBreak:E,lineBreakG:M,nonASCIIwhitespace:A};var Bt=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(Dt(Error)),jt=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(Dt(SyntaxError)),Ut=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(Dt(ReferenceError)),Zt=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(Dt(TypeError)),Vt=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(Bt),Gt=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(jt),Ht=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(Ut),Wt={UnknownError:[3001,"%0",Vt],ExecutionTimeOutError:[3002,"Script execution timed out after %0ms",Vt],NodeTypeSyntaxError:[1001,"Unknown node type: %0",Ht],BinaryOperatorSyntaxError:[1002,"Unknown binary operator: %0",Ht],LogicalOperatorSyntaxError:[1003,"Unknown logical operator: %0",Ht],UnaryOperatorSyntaxError:[1004,"Unknown unary operator: %0",Ht],UpdateOperatorSyntaxError:[1005,"Unknown update operator: %0",Ht],ObjectStructureSyntaxError:[1006,"Unknown object structure: %0",Ht],AssignmentExpressionSyntaxError:[1007,"Unknown assignment expression: %0",Ht],VariableTypeSyntaxError:[1008,"Unknown variable type: %0",Ht],ParamTypeSyntaxError:[1009,"Unknown param type: %0",Ht],AssignmentTypeSyntaxError:[1010,"Unknown assignment type: %0",Ht],FunctionUndefinedReferenceError:[2001,"%0 is not a function",Ut],VariableUndefinedReferenceError:[2002,"%0 is not defined",Ut],IsNotConstructor:[2003,"%0 is not a constructor",Zt]};function qt(t,e,n){return qt=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&Yt(i,n.prototype),i},qt.apply(null,arguments)}function Yt(t,e){return Yt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Yt(t,e)}function Xt(t,e){Object.defineProperty(t,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}var $t=Object.prototype.hasOwnProperty,Kt=Symbol("Break"),Jt=Symbol("Continue"),Qt=Symbol("DefaultCase"),te=Symbol("EmptyStatementReturn"),ee=Symbol("WithScopeName"),ne=Symbol("SuperScopeName"),re=Symbol("RootScopeName"),ie=Symbol("GlobalScopeName");function oe(t){return"function"==typeof t}var ae=function(){function t(t){this.interpreter=t}return t.prototype.generator=function(){var t=this.interpreter;return{getOptions:t.getOptions.bind(t),getCurrentScope:function(){return this.getCurrentScope()}.bind(t),getGlobalScope:function(){return this.getGlobalScope()}.bind(t),getCurrentContext:function(){return this.getCurrentContext()}.bind(t),getExecStartTime:t.getExecStartTime.bind(t)}},t}();function se(t,e,n){if(void 0===n&&(n=!0),!(t instanceof ae))throw new Error("Illegal call");if("string"!=typeof e)return e;if(e){var r=t.generator(),i={timeout:r.getOptions().timeout,_initEnv:function(){n||this.setCurrentContext(r.getCurrentContext()),this.execStartTime=r.getExecStartTime(),this.execEndTime=this.execStartTime}},o=n?r.getGlobalScope():r.getCurrentScope();return new me(o,i).evaluate(e)}}function ue(t){if(!(t instanceof ae))throw new Error("Illegal call");for(var e=t.generator(),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=r.pop(),a=new me(e.getGlobalScope(),e.getOptions()),s="\n\t\t (function anonymous("+r.join(",")+"){\n\t\t "+o+"\n\t\t });\n\t\t ";return a.evaluate(s)}Object.defineProperty(se,"__IS_EVAL_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(ue,"__IS_FUNCTION_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});var le=function(t){this.value=t},ce=function(t){this.value=t},he=function(t){this.value=t},pe=function(t,e,n){void 0===e&&(e=null),this.name=n,this.parent=e,this.data=t,this.labelStack=[]};function fe(){}var de={NaN:NaN,Infinity:1/0,undefined:void 0,Object,Array,String,Boolean,Number,Date,RegExp,Error,URIError,TypeError,RangeError,SyntaxError,ReferenceError,Float32Array,Float64Array,Uint32Array,Math,parseInt,parseFloat,isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,unescape,eval:se,Function:ue};"undefined"!=typeof JSON&&(de.JSON=JSON),"undefined"!=typeof Promise&&(de.Promise=Promise),"undefined"!=typeof Set&&(de.Set=Set),"undefined"!=typeof Map&&(de.Map=Map),"undefined"!=typeof Symbol&&(de.Symbol=Symbol),"undefined"!=typeof Proxy&&(de.Proxy=Proxy),"undefined"!=typeof WeakMap&&(de.WeakMap=WeakMap),"undefined"!=typeof WeakSet&&(de.WeakSet=WeakSet),"undefined"!=typeof Reflect&&(de.Reflect=Reflect);var me=function(){function t(e,n){void 0===e&&(e=t.global),void 0===n&&(n={}),this.sourceList=[],this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null),this.isVarDeclMode=!1,this.lastExecNode=null,this.isRunning=!1,this.options={ecmaVersion:n.ecmaVersion||t.ecmaVersion,timeout:n.timeout||0,rootContext:n.rootContext,globalContextInFunction:void 0===n.globalContextInFunction?t.globalContextInFunction:n.globalContextInFunction,_initEnv:n._initEnv},this.context=e||Object.create(null),this.callStack=[],this.initEnvironment(this.context)}var e=t.prototype;return e.initEnvironment=function(t){var e;if(t instanceof pe)e=t;else{var n=null,r=this.createSuperScope(t);this.options.rootContext&&(n=new pe(function(t){return Object.create(t)}(this.options.rootContext),r,re)),e=new pe(t,n||r,ie)}this.globalScope=e,this.currentScope=this.globalScope,this.globalContext=e.data,this.currentContext=e.data,this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null),this.execStartTime=Date.now(),this.execEndTime=this.execStartTime;var i=this.options._initEnv;i&&i.call(this)},e.getExecStartTime=function(){return this.execStartTime},e.getExecutionTime=function(){return this.execEndTime-this.execStartTime},e.setExecTimeout=function(t){void 0===t&&(t=0),this.options.timeout=t},e.getOptions=function(){return this.options},e.getGlobalScope=function(){return this.globalScope},e.getCurrentScope=function(){return this.currentScope},e.getCurrentContext=function(){return this.currentContext},e.isInterruptThrow=function(t){return t instanceof Vt||t instanceof Ht||t instanceof Gt},e.createSuperScope=function(t){var e=Object.assign({},de);return Object.keys(e).forEach((function(n){n in t&&delete e[n]})),new pe(e,null,ne)},e.setCurrentContext=function(t){this.currentContext=t},e.setCurrentScope=function(t){this.currentScope=t},e.evaluate=function(e){var n,r,i;if(void 0===e&&(e=""),e)return r=e,i={ranges:!0,locations:!0,ecmaVersion:this.options.ecmaVersion||t.ecmaVersion},n=j.parse(r,i),this.evaluateNode(n,e)},e.appendCode=function(t){return this.evaluate(t)},e.evaluateNode=function(t,e){var n=this;void 0===e&&(e=""),this.value=void 0,this.source=e,this.sourceList.push(e),this.isRunning=!0,this.execStartTime=Date.now(),this.execEndTime=this.execStartTime,this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null);var r=this.getCurrentScope(),i=this.getCurrentContext(),o=r.labelStack.concat([]),a=this.callStack.concat([]);try{var s=this.createClosure(t);this.addDeclarationsToScope(this.collectDeclVars,this.collectDeclFuncs,this.getCurrentScope()),s()}catch(t){throw t}finally{n.setCurrentScope(r),n.setCurrentContext(i),r.labelStack=o,n.callStack=a,this.execEndTime=Date.now()}return this.isRunning=!1,this.getValue()},e.createErrorMessage=function(t,e,n){var r=t[1].replace("%0",String(e));return null!==n&&(r+=this.getNodePosition(n||this.lastExecNode)),r},e.createError=function(t,e){return new e(t)},e.createThrowError=function(t,e){return this.createError(t,e)},e.createInternalThrowError=function(t,e,n){return this.createError(this.createErrorMessage(t,e,n),t[2])},e.checkTimeout=function(){if(!this.isRunning)return!1;var t=this.options.timeout||0;return Date.now()-this.execStartTime>t},e.getNodePosition=function(t){return t&&t.loc?" ["+t.loc.start.line+":"+t.loc.start.column+"]":""},e.createClosure=function(t){var e,n=this;switch(t.type){case"BinaryExpression":e=this.binaryExpressionHandler(t);break;case"LogicalExpression":e=this.logicalExpressionHandler(t);break;case"UnaryExpression":e=this.unaryExpressionHandler(t);break;case"UpdateExpression":e=this.updateExpressionHandler(t);break;case"ObjectExpression":e=this.objectExpressionHandler(t);break;case"ArrayExpression":e=this.arrayExpressionHandler(t);break;case"CallExpression":e=this.callExpressionHandler(t);break;case"NewExpression":e=this.newExpressionHandler(t);break;case"MemberExpression":e=this.memberExpressionHandler(t);break;case"ThisExpression":e=this.thisExpressionHandler(t);break;case"SequenceExpression":e=this.sequenceExpressionHandler(t);break;case"Literal":e=this.literalHandler(t);break;case"Identifier":e=this.identifierHandler(t);break;case"AssignmentExpression":e=this.assignmentExpressionHandler(t);break;case"FunctionDeclaration":e=this.functionDeclarationHandler(t);break;case"VariableDeclaration":e=this.variableDeclarationHandler(t);break;case"BlockStatement":case"Program":e=this.programHandler(t);break;case"ExpressionStatement":e=this.expressionStatementHandler(t);break;case"EmptyStatement":e=this.emptyStatementHandler(t);break;case"ReturnStatement":e=this.returnStatementHandler(t);break;case"FunctionExpression":e=this.functionExpressionHandler(t);break;case"IfStatement":e=this.ifStatementHandler(t);break;case"ConditionalExpression":e=this.conditionalExpressionHandler(t);break;case"ForStatement":e=this.forStatementHandler(t);break;case"WhileStatement":e=this.whileStatementHandler(t);break;case"DoWhileStatement":e=this.doWhileStatementHandler(t);break;case"ForInStatement":e=this.forInStatementHandler(t);break;case"WithStatement":e=this.withStatementHandler(t);break;case"ThrowStatement":e=this.throwStatementHandler(t);break;case"TryStatement":e=this.tryStatementHandler(t);break;case"ContinueStatement":e=this.continueStatementHandler(t);break;case"BreakStatement":e=this.breakStatementHandler(t);break;case"SwitchStatement":e=this.switchStatementHandler(t);break;case"LabeledStatement":e=this.labeledStatementHandler(t);break;case"DebuggerStatement":e=this.debuggerStatementHandler(t);break;default:throw this.createInternalThrowError(Wt.NodeTypeSyntaxError,t.type,t)}return function(){var r=n.options.timeout;if(r&&r>0&&n.checkTimeout())throw n.createInternalThrowError(Wt.ExecutionTimeOutError,r,null);return n.lastExecNode=t,e.apply(void 0,arguments)}},e.binaryExpressionHandler=function(t){var e=this,n=this.createClosure(t.left),r=this.createClosure(t.right);return function(){var i=n(),o=r();switch(t.operator){case"==":return i==o;case"!=":return i!=o;case"===":return i===o;case"!==":return i!==o;case"<":return i<o;case"<=":return i<=o;case">":return i>o;case">=":return i>=o;case"<<":return i<<o;case">>":return i>>o;case">>>":return i>>>o;case"+":return i+o;case"-":return i-o;case"*":return i*o;case"**":return Math.pow(i,o);case"/":return i/o;case"%":return i%o;case"|":return i|o;case"^":return i^o;case"&":return i&o;case"in":return i in o;case"instanceof":return i instanceof o;default:throw e.createInternalThrowError(Wt.BinaryOperatorSyntaxError,t.operator,t)}}},e.logicalExpressionHandler=function(t){var e=this,n=this.createClosure(t.left),r=this.createClosure(t.right);return function(){switch(t.operator){case"||":return n()||r();case"&&":return n()&&r();default:throw e.createInternalThrowError(Wt.LogicalOperatorSyntaxError,t.operator,t)}}},e.unaryExpressionHandler=function(t){var e,n=this;if("delete"===t.operator){var r=this.createObjectGetter(t.argument),i=this.createNameGetter(t.argument);return function(){return delete r()[i()]}}if("typeof"===t.operator&&"Identifier"===t.argument.type){var o=this.createObjectGetter(t.argument),a=this.createNameGetter(t.argument);e=function(){return o()[a()]}}else e=this.createClosure(t.argument);return function(){var r=e();switch(t.operator){case"-":return-r;case"+":return+r;case"!":return!r;case"~":return~r;case"void":return;case"typeof":return typeof r;default:throw n.createInternalThrowError(Wt.UnaryOperatorSyntaxError,t.operator,t)}}},e.updateExpressionHandler=function(t){var e=this,n=this.createObjectGetter(t.argument),r=this.createNameGetter(t.argument);return function(){var i=n(),o=r();switch(e.assertVariable(i,o,t),t.operator){case"++":return t.prefix?++i[o]:i[o]++;case"--":return t.prefix?--i[o]:i[o]--;default:throw e.createInternalThrowError(Wt.UpdateOperatorSyntaxError,t.operator,t)}}},e.objectExpressionHandler=function(t){var e=this,n=[],r=Object.create(null);return t.properties.forEach((function(t){var i=t.kind,o=function(t){return"Identifier"===t.type?t.name:"Literal"===t.type?t.value:this.throwError(Wt.ObjectStructureSyntaxError,t.type,t)}(t.key);r[o]&&"init"!==i||(r[o]={}),r[o][i]=e.createClosure(t.value),n.push({key:o,property:t})})),function(){for(var t={},e=n.length,i=0;i<e;i++){var o=n[i],a=o.key,s=r[a],u=s.init?s.init():void 0,l=s.get?s.get():function(){},c=s.set?s.set():function(t){};if("set"in s||"get"in s){var h={configurable:!0,enumerable:!0,get:l,set:c};Object.defineProperty(t,a,h)}else{var p=o.property,f=p.kind;"Identifier"!==p.key.type||"FunctionExpression"!==p.value.type||"init"!==f||p.value.id||Xt(u,p.key.name),t[a]=u}}return t}},e.arrayExpressionHandler=function(t){var e=this,n=t.elements.map((function(t){return t?e.createClosure(t):t}));return function(){for(var t=n.length,e=Array(t),r=0;r<t;r++){var i=n[r];i&&(e[r]=i())}return e}},e.safeObjectGet=function(t,e,n){return t[e]},e.createCallFunctionGetter=function(t){var e=this;if("MemberExpression"===t.type){var n=this.createClosure(t.object),r=this.createMemberKeyGetter(t),i=this.source;return function(){var o=n(),a=r(),s=e.safeObjectGet(o,a,t);if(!s||!oe(s)){var u=i.slice(t.start,t.end);throw e.createInternalThrowError(Wt.FunctionUndefinedReferenceError,u,t)}return s.__IS_EVAL_FUNC?function(t){return s(new ae(e),t,!0)}:s.__IS_FUNCTION_FUNC?function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return s.apply(void 0,[new ae(e)].concat(n))}:s.bind(o)}}var o=this.createClosure(t);return function(){var n="";"Identifier"===t.type&&(n=t.name);var r=o();if(!r||!oe(r))throw e.createInternalThrowError(Wt.FunctionUndefinedReferenceError,n,t);if("Identifier"===t.type&&r.__IS_EVAL_FUNC&&"eval"===n)return function(t){var i=e.getScopeFromName(n,e.getCurrentScope()),o=i.name===ne||i.name===ie||i.name===re;return r(new ae(e),t,!o)};if(r.__IS_EVAL_FUNC)return function(t){return r(new ae(e),t,!0)};if(r.__IS_FUNCTION_FUNC)return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return r.apply(void 0,[new ae(e)].concat(n))};var i=e.options.globalContextInFunction;if("Identifier"===t.type){var a=e.getIdentifierScope(t);a.name===ee&&(i=a.data)}return r.bind(i)}},e.callExpressionHandler=function(t){var e=this,n=this.createCallFunctionGetter(t.callee),r=t.arguments.map((function(t){return e.createClosure(t)}));return function(){return n().apply(void 0,r.map((function(t){return t()})))}},e.functionExpressionHandler=function(t){var e=this,n=this,r=this.source,i=this.collectDeclVars,o=this.collectDeclFuncs;this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null);var a=t.id?t.id.name:"",s=t.params.length,u=t.params.map((function(t){return e.createParamNameGetter(t)})),l=this.createClosure(t.body),c=this.collectDeclVars,h=this.collectDeclFuncs;return this.collectDeclVars=i,this.collectDeclFuncs=o,function(){var e=n.getCurrentScope(),i=function t(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];n.callStack.push(""+a);var s=n.getCurrentScope(),p=function(t,e){return void 0===t&&(t=null),new pe(Object.create(null),t,e)}(e,"FunctionScope("+a+")");n.setCurrentScope(p),n.addDeclarationsToScope(c,h,p),a&&(p.data[a]=t),p.data.arguments=arguments,u.forEach((function(t,e){p.data[t()]=i[e]}));var f=n.getCurrentContext();n.setCurrentContext(this);var d=l();if(n.setCurrentContext(f),n.setCurrentScope(s),n.callStack.pop(),d instanceof le)return d.value};return Xt(i,a),Object.defineProperty(i,"length",{value:s,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(i,"toString",{value:function(){return r.slice(t.start,t.end)},writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(i,"valueOf",{value:function(){return r.slice(t.start,t.end)},writable:!0,configurable:!0,enumerable:!1}),i}},e.newExpressionHandler=function(t){var e=this,n=this.source,r=this.createClosure(t.callee),i=t.arguments.map((function(t){return e.createClosure(t)}));return function(){var o=r();if(!oe(o)||o.__IS_EVAL_FUNC){var a=t.callee,s=n.slice(a.start,a.end);throw e.createInternalThrowError(Wt.IsNotConstructor,s,t)}return o.__IS_FUNCTION_FUNC?o.apply(void 0,[new ae(e)].concat(i.map((function(t){return t()})))):qt(o,i.map((function(t){return t()})))}},e.memberExpressionHandler=function(t){var e=this.createClosure(t.object),n=this.createMemberKeyGetter(t);return function(){return e()[n()]}},e.thisExpressionHandler=function(t){var e=this;return function(){return e.getCurrentContext()}},e.sequenceExpressionHandler=function(t){var e=this,n=t.expressions.map((function(t){return e.createClosure(t)}));return function(){for(var t,e=n.length,r=0;r<e;r++)t=(0,n[r])();return t}},e.literalHandler=function(t){return function(){return t.regex?new RegExp(t.regex.pattern,t.regex.flags):t.value}},e.identifierHandler=function(t){var e=this;return function(){var n=e.getCurrentScope(),r=e.getScopeDataFromName(t.name,n);return e.assertVariable(r,t.name,t),r[t.name]}},e.getIdentifierScope=function(t){var e=this.getCurrentScope();return this.getScopeFromName(t.name,e)},e.assignmentExpressionHandler=function(t){var e=this;"Identifier"!==t.left.type||"FunctionExpression"!==t.right.type||t.right.id||(t.right.id={type:"Identifier",name:t.left.name});var n=this.createObjectGetter(t.left),r=this.createNameGetter(t.left),i=this.createClosure(t.right);return function(){var o=n(),a=r(),s=i();switch("="!==t.operator&&e.assertVariable(o,a,t),t.operator){case"=":return o[a]=s;case"+=":return o[a]+=s;case"-=":return o[a]-=s;case"*=":return o[a]*=s;case"**=":return o[a]=Math.pow(o[a],s);case"/=":return o[a]/=s;case"%=":return o[a]%=s;case"<<=":return o[a]<<=s;case">>=":return o[a]>>=s;case">>>=":return o[a]>>>=s;case"&=":return o[a]&=s;case"^=":return o[a]^=s;case"|=":return o[a]|=s;default:throw e.createInternalThrowError(Wt.AssignmentExpressionSyntaxError,t.type,t)}}},e.functionDeclarationHandler=function(t){if(t.id){var e=this.functionExpressionHandler(t);Object.defineProperty(e,"isFunctionDeclareClosure",{value:!0,writable:!1,configurable:!1,enumerable:!1}),this.funcDeclaration(t.id.name,e)}return function(){return te}},e.getVariableName=function(t){if("Identifier"===t.type)return t.name;throw this.createInternalThrowError(Wt.VariableTypeSyntaxError,t.type,t)},e.variableDeclarationHandler=function(t){for(var e,n=this,r=[],i=0;i<t.declarations.length;i++){var o=t.declarations[i];this.varDeclaration(this.getVariableName(o.id)),o.init&&r.push({type:"AssignmentExpression",operator:"=",left:o.id,right:o.init})}return r.length&&(e=this.createClosure({type:"BlockStatement",body:r})),function(){if(e){var t=n.isVarDeclMode;n.isVarDeclMode=!0,e(),n.isVarDeclMode=t}return te}},e.assertVariable=function(t,e,n){if(t===this.globalScope.data&&!(e in t))throw this.createInternalThrowError(Wt.VariableUndefinedReferenceError,e,n)},e.programHandler=function(t){var e=this,n=t.body.map((function(t){return e.createClosure(t)}));return function(){for(var t=te,r=0;r<n.length;r++){var i=n[r],o=e.setValue(i());if(o!==te&&((t=o)instanceof le||t instanceof ce||t instanceof he||t===Kt||t===Jt))break}return t}},e.expressionStatementHandler=function(t){return this.createClosure(t.expression)},e.emptyStatementHandler=function(t){return function(){return te}},e.returnStatementHandler=function(t){var e=t.argument?this.createClosure(t.argument):fe;return function(){return new le(e())}},e.ifStatementHandler=function(t){var e=this.createClosure(t.test),n=this.createClosure(t.consequent),r=t.alternate?this.createClosure(t.alternate):function(){return te};return function(){return e()?n():r()}},e.conditionalExpressionHandler=function(t){return this.ifStatementHandler(t)},e.forStatementHandler=function(t){var e=this,n=fe,r=t.test?this.createClosure(t.test):function(){return!0},i=fe,o=this.createClosure(t.body);return"ForStatement"===t.type&&(n=t.init?this.createClosure(t.init):n,i=t.update?this.createClosure(t.update):fe),function(a){var s,u=te,l="DoWhileStatement"===t.type;for(a&&"LabeledStatement"===a.type&&(s=a.label.name),n();l||r();i()){l=!1;var c=e.setValue(o());if(c!==te&&c!==Jt){if(c===Kt)break;if((u=c)instanceof he&&u.value===s)u=te;else if(u instanceof le||u instanceof ce||u instanceof he)break}}return u}},e.whileStatementHandler=function(t){return this.forStatementHandler(t)},e.doWhileStatementHandler=function(t){return this.forStatementHandler(t)},e.forInStatementHandler=function(t){var e=this,n=t.left,r=this.createClosure(t.right),i=this.createClosure(t.body);return"VariableDeclaration"===t.left.type&&(this.createClosure(t.left)(),n=t.left.declarations[0].id),function(t){var o,a,s=te;t&&"LabeledStatement"===t.type&&(o=t.label.name);var u=r();for(a in u){e.assignmentExpressionHandler({type:"AssignmentExpression",operator:"=",left:n,right:{type:"Literal",value:a}})();var l=e.setValue(i());if(l!==te&&l!==Jt){if(l===Kt)break;if((s=l)instanceof he&&s.value===o)s=te;else if(s instanceof le||s instanceof ce||s instanceof he)break}}return s}},e.withStatementHandler=function(t){var e=this,n=this.createClosure(t.object),r=this.createClosure(t.body);return function(){var t=n(),i=e.getCurrentScope(),o=new pe(t,i,ee);e.setCurrentScope(o);var a=e.setValue(r());return e.setCurrentScope(i),a}},e.throwStatementHandler=function(t){var e=this,n=this.createClosure(t.argument);return function(){throw e.setValue(void 0),n()}},e.tryStatementHandler=function(t){var e=this,n=this.createClosure(t.block),r=t.handler?this.catchClauseHandler(t.handler):null,i=t.finalizer?this.createClosure(t.finalizer):null;return function(){var t,o,a=e.getCurrentScope(),s=e.getCurrentContext(),u=a.labelStack.concat([]),l=e.callStack.concat([]),c=te,h=function(){e.setCurrentScope(a),e.setCurrentContext(s),a.labelStack=u,e.callStack=l};try{(c=e.setValue(n()))instanceof le&&(t=c)}catch(n){if(h(),e.isInterruptThrow(n))throw n;if(r)try{(c=e.setValue(r(n)))instanceof le&&(t=c)}catch(t){if(h(),e.isInterruptThrow(t))throw t;o=t}}if(i)try{(c=i())instanceof le&&(t=c)}catch(t){if(h(),e.isInterruptThrow(t))throw t;o=t}if(o)throw o;return t||c}},e.catchClauseHandler=function(t){var e=this,n=this.createParamNameGetter(t.param),r=this.createClosure(t.body);return function(t){var i,o=e.getCurrentScope().data,a=n(),s=$t.call(o,a),u=o[a];return o[a]=t,i=r(),s?o[a]=u:delete o[a],i}},e.continueStatementHandler=function(t){return function(){return t.label?new he(t.label.name):Jt}},e.breakStatementHandler=function(t){return function(){return t.label?new ce(t.label.name):Kt}},e.switchStatementHandler=function(t){var e=this,n=this.createClosure(t.discriminant),r=t.cases.map((function(t){return e.switchCaseHandler(t)}));return function(){for(var t,i,o,a=n(),s=!1,u=0;u<r.length;u++){var l=r[u](),c=l.testClosure();if(c!==Qt){if(s||c===a){if(s=!0,(i=e.setValue(l.bodyClosure()))===te)continue;if(i===Kt)break;if((t=i)instanceof le||t instanceof ce||t instanceof he||t===Jt)break}}else o=l}return!s&&o&&((i=e.setValue(o.bodyClosure()))===te||i===Kt||i===Jt||(t=i)),t}},e.switchCaseHandler=function(t){var e=t.test?this.createClosure(t.test):function(){return Qt},n=this.createClosure({type:"BlockStatement",body:t.consequent});return function(){return{testClosure:e,bodyClosure:n}}},e.labeledStatementHandler=function(t){var e=this,n=t.label.name,r=this.createClosure(t.body);return function(){var i,o=e.getCurrentScope();return o.labelStack.push(n),(i=r(t))instanceof ce&&i.value===n&&(i=te),o.labelStack.pop(),i}},e.debuggerStatementHandler=function(t){return function(){return te}},e.createParamNameGetter=function(t){if("Identifier"===t.type)return function(){return t.name};throw this.createInternalThrowError(Wt.ParamTypeSyntaxError,t.type,t)},e.createObjectKeyGetter=function(t){var e;return e="Identifier"===t.type?function(){return t.name}:this.createClosure(t),function(){return e()}},e.createMemberKeyGetter=function(t){return t.computed?this.createClosure(t.property):this.createObjectKeyGetter(t.property)},e.createObjectGetter=function(t){var e=this;switch(t.type){case"Identifier":return function(){return e.getScopeDataFromName(t.name,e.getCurrentScope())};case"MemberExpression":return this.createClosure(t.object);default:throw this.createInternalThrowError(Wt.AssignmentTypeSyntaxError,t.type,t)}},e.createNameGetter=function(t){switch(t.type){case"Identifier":return function(){return t.name};case"MemberExpression":return this.createMemberKeyGetter(t);default:throw this.createInternalThrowError(Wt.AssignmentTypeSyntaxError,t.type,t)}},e.varDeclaration=function(t){this.collectDeclVars[t]=void 0},e.funcDeclaration=function(t,e){this.collectDeclFuncs[t]=e},e.addDeclarationsToScope=function(t,e,n){var r=n.data;for(var i in e){var o=e[i];r[i]=o?o():o}for(var a in t)a in r||(r[a]=void 0)},e.getScopeValue=function(t,e){return this.getScopeFromName(t,e).data[t]},e.getScopeDataFromName=function(t,e){return this.getScopeFromName(t,e).data},e.getScopeFromName=function(t,e){var n=e;do{if(t in n.data)return n}while(n=n.parent);return this.globalScope},e.setValue=function(t){var e=this.callStack.length;return this.isVarDeclMode||e||t===te||t===Kt||t===Jt||t instanceof ce||t instanceof he||(this.value=t instanceof le?t.value:t),t},e.getValue=function(){return this.value},t}();function ge(t){return void 0===t&&(t=Object.create(null)),t}function ye(t,e,n){void 0===e&&(e=[]),void 0===n&&(n={});var r=n.parsingContext,i=void 0===n.timeout?0:n.timeout,o="\n (function anonymous("+e.join(",")+"){\n "+t+"\n });\n ";return new me(r,{ecmaVersion:n.ecmaVersion,timeout:i,rootContext:n.rootContext,globalContextInFunction:n.globalContextInFunction}).evaluate(o)}function ve(t,e,n){return new me(e,n).evaluate(t)}me.version="0.0.3",me.eval=se,me.Function=ue,me.ecmaVersion=5,me.globalContextInFunction=void 0,me.global=Object.create(null);var _e=ve,be=function(){function t(t){this._code=t}var e=t.prototype;return e.runInContext=function(t){return ve(this._code,t)},e.runInNewContext=function(t){return ve(this._code,t)},t}();const xe=function(t,e,n){return ve(t,e,n)};function we(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ye(e.pop()||"",e)}const Se=xe},9315:(t,e,n)=>{var r;!function(i,o,a,s){"use strict";var u,l="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM,c="undefined"!=typeof wx&&null!==wx&&(void 0!==wx.request||void 0!==wx.miniProgram),h=l||c,p=["","webkit","Moz","MS","ms","o"],f=h?"":o.createElement("div"),d="function",m=Math.round,g=Math.abs,y=Date.now;function v(t,e,n){return setTimeout(M(t,n),e)}function _(t,e,n){return!!Array.isArray(t)&&(b(t,n[e],n),!0)}function b(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==s)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function x(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}u="function"!=typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var w=x((function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&t[r[i]]===s)&&(t[r[i]]=e[r[i]]),i++;return t}),"extend","Use `assign`."),S=x((function(t,e){return w(t,e,!0)}),"merge","Use `assign`.");function E(t,e,n){var r,i=e.prototype;(r=t.prototype=Object.create(i)).constructor=t,r._super=i,n&&u(r,n)}function M(t,e){return function(){return t.apply(e,arguments)}}function T(t,e){return typeof t==d?t.apply(e&&e[0]||s,e):t}function A(t,e){return t===s?e:t}function C(t,e,n){b(L(e),(function(e){t.addEventListener(e,n,!1)}))}function O(t,e,n){b(L(e),(function(e){t.removeEventListener(e,n,!1)}))}function P(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function k(t,e){return t.indexOf(e)>-1}function L(t){return t.trim().split(/\s+/g)}function I(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function R(t){return Array.prototype.slice.call(t,0)}function D(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];I(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort((function(t,n){return t[e]>n[e]})):r.sort()),r}function N(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<p.length;){if((r=(n=p[o])?n+i:e)in t)return r;o++}return s}var F=1;function z(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}var B="ontouchstart"in i,j=N(i,"PointerEvent")!==s,U=B&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Z="touch",V="mouse",G=25,H=1,W=4,q=8,Y=1,X=2,$=4,K=8,J=16,Q=X|$,tt=K|J,et=Q|tt,nt=["x","y"],rt=["clientX","clientY"];function it(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){T(t.options.enable,[t])&&n.handler(e)},this.init()}function ot(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=e&H&&r-i==0,a=e&(W|q)&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=at(e)),i>1&&!n.firstMultiple?n.firstMultiple=at(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,u=a?a.center:o.center,l=e.center=st(r);e.timeStamp=y(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=ht(u,l),e.distance=ct(u,l),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==H&&o.eventType!==W||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=lt(e.deltaX,e.deltaY);var c,h,p=ut(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=p.x,e.overallVelocityY=p.y,e.overallVelocity=g(p.x)>g(p.y)?p.x:p.y,e.scale=a?(c=a.pointers,ct((h=r)[0],h[1],rt)/ct(c[0],c[1],rt)):1,e.rotation=a?function(t,e){return ht(e[1],e[0],rt)+ht(t[1],t[0],rt)}(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,o,a=t.lastInterval||e,u=e.timeStamp-a.timeStamp;if(e.eventType!=q&&(u>G||a.velocity===s)){var l=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,h=ut(u,l,c);r=h.x,i=h.y,n=g(h.x)>g(h.y)?h.x:h.y,o=lt(l,c),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var f=t.element;P(e.srcEvent.target,f)&&(f=e.srcEvent.target),e.target=f}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function at(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:m(t.pointers[n].clientX),clientY:m(t.pointers[n].clientY)},n++;return{timeStamp:y(),pointers:e,center:st(e),deltaX:t.deltaX,deltaY:t.deltaY}}function st(t){var e=t.length;if(1===e)return{x:m(t[0].clientX),y:m(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:m(n/e),y:m(r/e)}}function ut(t,e,n){return{x:e/t||0,y:n/t||0}}function lt(t,e){return t===e?Y:g(t)>=g(e)?t<0?X:$:e<0?K:J}function ct(t,e,n){n||(n=nt);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function ht(t,e,n){n||(n=nt);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}it.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(z(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(z(this.element),this.evWin,this.domHandler)}};var pt={mousedown:H,mousemove:2,mouseup:W},ft="mousedown",dt="mousemove mouseup";function mt(){this.evEl=ft,this.evWin=dt,this.pressed=!1,it.apply(this,arguments)}E(mt,it,{handler:function(t){var e=pt[t.type];e&H&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=W),this.pressed&&(e&W&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:V,srcEvent:t}))}});var gt={pointerdown:H,pointermove:2,pointerup:W,pointercancel:q,pointerout:q},yt={2:Z,3:"pen",4:V,5:"kinect"},vt="pointerdown",_t="pointermove pointerup pointercancel";function bt(){this.evEl=vt,this.evWin=_t,it.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}h||!i.MSPointerEvent||i.PointerEvent||(vt="MSPointerDown",_t="MSPointerMove MSPointerUp MSPointerCancel"),E(bt,it,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=gt[r],o=yt[t.pointerType]||t.pointerType,a=o==Z,s=I(e,t.pointerId,"pointerId");i&H&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):i&(W|q)&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var xt={touchstart:H,touchmove:2,touchend:W,touchcancel:q};function wt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,it.apply(this,arguments)}function St(t,e){var n=R(t.touches),r=R(t.changedTouches);return e&(W|q)&&(n=D(n.concat(r),"identifier",!0)),[n,r]}E(wt,it,{handler:function(t){var e=xt[t.type];if(e===H&&(this.started=!0),this.started){var n=St.call(this,t,e);e&(W|q)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Z,srcEvent:t})}}});var Et={touchstart:H,touchmove:2,touchend:W,touchcancel:q},Mt="touchstart touchmove touchend touchcancel";function Tt(){this.evTarget=Mt,this.targetIds={},it.apply(this,arguments)}function At(t,e){var n=R(t.touches),r=this.targetIds;if(e&(2|H)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=R(t.changedTouches),s=[],u=this.target;if(o=n.filter((function(t){return P(t.target,u)})),e===H)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),e&(W|q)&&delete r[a[i].identifier],i++;return s.length?[D(o.concat(s),"identifier",!0),s]:void 0}E(Tt,it,{handler:function(t){var e=Et[t.type],n=At.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Z,srcEvent:t})}});var Ct=2500;function Ot(){it.apply(this,arguments);var t=M(this.handler,this);this.touch=new Tt(this.manager,t),this.mouse=new mt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Pt(t,e){t&H?(this.primaryTouch=e.changedPointers[0].identifier,kt.call(this,e)):t&(W|q)&&kt.call(this,e)}function kt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)}),Ct)}}function Lt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}E(Ot,it,{handler:function(t,e,n){var r=n.pointerType==Z,i=n.pointerType==V;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)Pt.call(this,e,n);else if(i&&Lt.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var It=h?s:N(f.style,"touchAction"),Rt=It!==s,Dt="compute",Nt="auto",Ft="manipulation",zt="none",Bt="pan-x",jt="pan-y",Ut=function(){if(!Rt)return!1;var t={};if(h)return t;var e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!e||i.CSS.supports("touch-action",n)})),t}();function Zt(t,e){this.manager=t,this.set(e)}Zt.prototype={set:function(t){t==Dt&&(t=this.compute()),Rt&&this.manager.element.style&&Ut[t]&&(this.manager.element.style[It]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return b(this.manager.recognizers,(function(e){T(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(k(t,zt))return zt;var e=k(t,Bt),n=k(t,jt);return e&&n?zt:e||n?e?Bt:jt:k(t,Ft)?Ft:Nt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,i=k(r,zt)&&!Ut[zt],o=k(r,jt)&&!Ut[jt],a=k(r,Bt)&&!Ut[Bt];if(i){var s=1===t.pointers.length,u=t.distance<2,l=t.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&n&Q||a&&n&tt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Vt=1,Gt=32;function Ht(t){this.options=u({},this.defaults,t||{}),this.id=F++,this.manager=null,this.options.enable=A(this.options.enable,!0),this.state=Vt,this.simultaneous={},this.requireFail=[]}function Wt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function qt(t){return t==J?"down":t==K?"up":t==X?"left":t==$?"right":""}function Yt(t,e){var n=e.manager;return n?n.get(t):t}function Xt(){Ht.apply(this,arguments)}function $t(){Xt.apply(this,arguments),this.pX=null,this.pY=null}function Kt(){Xt.apply(this,arguments)}function Jt(){Ht.apply(this,arguments),this._timer=null,this._input=null}function Qt(){Xt.apply(this,arguments)}function te(){Xt.apply(this,arguments)}function ee(){Ht.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ne(t,e){return(e=e||{}).recognizers=A(e.recognizers,ne.defaults.preset),new re(t,e)}function re(t,e){this.options=u({},ne.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new(this.options.inputClass||(j?bt:U?Tt:B?Ot:mt))(this,ot),this.touchAction=new Zt(this,this.options.touchAction),ie(this,!0),b(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function ie(t,e){var n,r=t.element;r.style&&(b(t.options.cssProps,(function(i,o){n=N(r.style,o),e?(t.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}Ht.prototype={defaults:{},set:function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(_(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Yt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return _(t,"dropRecognizeWith",this)||(t=Yt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(_(t,"requireFailure",this))return this;var e=this.requireFail;return-1===I(e,t=Yt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(_(t,"dropRequireFailure",this))return this;t=Yt(t,this);var e=I(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+Wt(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+Wt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Gt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Gt|Vt)))return!1;t++}return!0},recognize:function(t){var e=u({},t);if(!T(this.options.enable,[this,e]))return this.reset(),void(this.state=Gt);56&this.state&&(this.state=Vt),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},E(Xt,Ht,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,r=6&e,i=this.attrTest(t);return r&&(n&q||!i)?16|e:r||i?n&W?8|e:2&e?4|e:2:Gt}}),E($t,Xt,{defaults:{event:"pan",threshold:10,pointers:1,direction:et},getTouchAction:function(){var t=this.options.direction,e=[];return t&Q&&e.push(jt),t&tt&&e.push(Bt),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(e.direction&Q?(i=0===o?Y:o<0?X:$,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?Y:a<0?K:J,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return Xt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=qt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),E(Kt,Xt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[zt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),E(Jt,Ht,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Nt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||t.eventType&(W|q)&&!i)this.reset();else if(t.eventType&H)this.reset(),this._timer=v((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&W)return 8;return Gt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&W?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=y(),this.manager.emit(this.options.event,this._input)))}}),E(Qt,Xt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[zt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),E(te,Xt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Q|tt,pointers:1},getTouchAction:function(){return $t.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Q|tt)?e=t.overallVelocity:n&Q?e=t.overallVelocityX:n&tt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&g(e)>this.options.velocity&&t.eventType&W},emit:function(t){var e=qt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),E(ee,Ht,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ft]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&H&&0===this.count)return this.failTimeout();if(r&&i&&n){if(t.eventType!=W)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||ct(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=v((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return Gt},failTimeout:function(){return this._timer=v((function(){this.state=Gt}),this.options.interval,this),Gt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ne.VERSION="2.0.7",ne.defaults={domEvents:!1,touchAction:Dt,enable:!0,inputTarget:null,inputClass:null,preset:[[Qt,{enable:!1}],[Kt,{enable:!1},["rotate"]],[te,{direction:Q}],[$t,{direction:Q},["swipe"]],[ee],[ee,{event:"doubletap",taps:2},["tap"]],[Jt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},re.prototype={set:function(t){return u(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var r=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&14&n.state&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Ht)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(_(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(_(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=I(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==s&&e!==s){var n=this.handlers;return b(L(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(t!==s){var n=this.handlers;return b(L(t),(function(t){e?n[t]&&n[t].splice(I(n[t],e),1):delete n[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){if(!h){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&ie(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},h||(u(ne,{INPUT_START:H,INPUT_MOVE:2,INPUT_END:W,INPUT_CANCEL:q,STATE_POSSIBLE:Vt,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Gt,DIRECTION_NONE:Y,DIRECTION_LEFT:X,DIRECTION_RIGHT:$,DIRECTION_UP:K,DIRECTION_DOWN:J,DIRECTION_HORIZONTAL:Q,DIRECTION_VERTICAL:tt,DIRECTION_ALL:et,Manager:re,Input:it,TouchAction:Zt,TouchInput:Tt,MouseInput:mt,PointerEventInput:bt,TouchMouseInput:Ot,SingleTouchInput:wt,Recognizer:Ht,AttrRecognizer:Xt,Tap:ee,Pan:$t,Swipe:te,Pinch:Kt,Rotate:Qt,Press:Jt,on:C,off:O,each:b,merge:S,extend:w,assign:u,inherit:E,bindFn:M,prefixed:N}),("undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Hammer=ne,(r=function(){return ne}.call(e,n,e,t))===s||(t.exports=r))}("undefined"!=typeof window?window:{console:null,MSPointerEvent:null,PointerEvent:null,CSS:null},document)},5499:function(t,e,n){t.exports=function(t){"use strict";var e=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},n=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},r="\n";function i(t){var e=new Error("(regl) "+t);throw console.error(e),e}function o(t,e){t||i(e)}function a(t){return t?": "+t:""}function s(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"==typeof t;case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"==typeof t}}function u(t,e,n){e.indexOf(t)<0&&i("invalid value"+a(n)+". must be one of: "+e)}var l=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function h(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function p(t,e){this.number=t,this.line=e,this.errors=[]}function f(t,e,n){this.file=t,this.line=e,this.message=n}function d(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function m(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function g(t,e){var n,r=t.split("\n"),i=1,o=0,a={unknown:new h,0:new h};a.unknown.name=a[0].name=e||d(),a.unknown.lines.push(new p(0,""));for(var s=0;s<r.length;++s){var u=r[s],l=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(u);if(l)switch(l[1]){case"line":var c=/(\d+)(\s+\d+)?/.exec(l[2]);c&&(i=0|c[1],c[2]&&((o=0|c[2])in a||(a[o]=new h)));break;case"define":var f=/SHADER_NAME(_B64)?\s+(.*)$/.exec(l[2]);f&&(a[o].name=f[1]?(n=f[2],"undefined"!=typeof atob?atob(n):"base64:"+n):f[2])}a[o].lines.push(new p(i++,u))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function y(t){t._commandRef=d()}function v(t,e){var n=m();i(t+" in command "+(e||d())+("unknown"===n?"":" called from "+n))}function _(t,e,n,r){s(t,e)||v("invalid parameter type"+a(n)+". expected "+e+", got "+typeof t,r||d())}var b=33071,x=32819,w=32820,S=33635,E=34042,M={};function T(t,e){return t===w||t===x||t===S?2:t===E?4:M[t]*e}function A(t){return!(t&t-1||!t)}M[5120]=M[5121]=1,M[5122]=M[5123]=M[36193]=M[S]=M[x]=M[w]=2,M[5124]=M[5125]=M[5126]=M[E]=4;var C=n(o,{optional:function(t){t()},raise:i,commandRaise:v,command:function(t,e,n){t||v(e,n||d())},parameter:function(t,e,n){t in e||i("unknown parameter ("+t+")"+a(n)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||v("unknown parameter ("+t+")"+a(n)+". possible values: "+Object.keys(e).join(),r||d())},constructor:function(t){Object.keys(t).forEach((function(t){l.indexOf(t)<0&&i('invalid regl constructor argument "'+t+'". must be one of '+l)}))},type:function(t,e,n){s(t,e)||i("invalid parameter type"+a(n)+". expected "+e+", got "+typeof t)},commandType:_,isTypedArray:function(t,n){e(t)||i("invalid parameter type"+a(n)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||i("invalid parameter type, ("+t+")"+a(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,n,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),u=i===t.FRAGMENT_SHADER?"fragment":"vertex";_(n,"string",u+" shader source must be a string",a);var l=g(n,a),h=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new f(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new f("unknown",0,t))}})),e}(s);(function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))})(l,h),Object.keys(l).forEach((function(t){var e=l[t];if(e.hasErrors){var n=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+r,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(n){var i=n.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var s=a[1];i=a[2],"assign"===s&&(s="="),e=Math.max(t.line.indexOf(s,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+r,"font-weight:bold"),o(c("| ",6)),o(i+r,"font-weight:bold")})),o(c("| ",6)+r)}else o(c(t.number,4)+"| "),o(t.line+r,"color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(i[0]=n.join("%c"),console.log.apply(console,i))}function o(t,e){n.push(t),i.push(e||"")}})),o.raise("Error compiling "+u+" shader, "+l[0].name)}},linkError:function(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var s=t.getProgramInfoLog(e),u=g(n,a),l='Error linking program with vertex shader, "'+g(i,a)[0].name+'", and fragment shader "'+u[0].name+'"';"undefined"!=typeof document?console.log("%c"+l+"\n%c"+s,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(l+r+s),o.raise(l)}},callSite:m,saveCommandRef:y,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}y(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,n.static),o(s,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,n){var r,i=e.width,a=e.height,s=e.channels;o(i>0&&i<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),t.wrapS===b&&t.wrapT===b||o(A(i)&&A(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==i&&1!==a&&o(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(o(A(i)&&A(a),"texture must be a square power of 2 to support mipmapping"),o(e.mipmask===(i<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&o(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),o(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(r=0;r<16;++r)if(u[r]){var l=i>>r,c=a>>r;o(e.mipmask&1<<r,"missing mipmap data");var h=u[r];if(o(h.width===l&&h.height===c,"invalid shape for mip images"),o(h.format===e.format&&h.internalformat===e.internalformat&&h.type===e.type,"incompatible type for mip image"),h.compressed);else if(h.data){var p=Math.ceil(T(h.type,s)*l/h.unpackAlignment)*h.unpackAlignment;o(h.data.byteLength===p*c,"invalid data for image, buffer size is inconsistent with image format")}else h.element||h.copy}else t.genMipmaps||o(0==(e.mipmask&1<<r),"extra mipmap data");e.compressed&&o(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,r){var i=t.width,a=t.height,s=t.channels;o(i>0&&i<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),o(i===a,"cube map must be square"),o(e.wrapS===b&&e.wrapT===b,"wrap mode not supported by cube map");for(var u=0;u<n.length;++u){var l=n[u];o(l.width===i&&l.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(o(!l.compressed,"can not generate mipmap for compressed textures"),o(1===l.mipmask,"can not specify mipmaps and generate mipmaps"));for(var c=l.images,h=0;h<16;++h){var p=c[h];if(p){var f=i>>h,d=a>>h;o(l.mipmask&1<<h,"missing mipmap data"),o(p.width===f&&p.height===d,"invalid shape for mip images"),o(p.format===t.format&&p.internalformat===t.internalformat&&p.type===t.type,"incompatible type for mip image"),p.compressed||(p.data?o(p.data.byteLength===f*d*Math.max(T(p.type,s),p.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):p.element||p.copy)}}}}}),O=0;function P(t,e){this.id=O++,this.type=t,this.data=e}function k(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function L(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+k(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return L(t.substr(0,r.index)).concat(L(r[1])).concat(L(t.substr(r.index+r[0].length)));var i=t.split(".");if(1===i.length)return['"'+k(t)+'"'];for(var o=[],a=0;a<i.length;++a)o=o.concat(L(i[a]));return o}function I(t){return"["+L(t).join("][")+"]"}var R={DynamicVariable:P,define:function(t,e){return new P(t,I(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof P},unbox:function t(e,n){return"function"==typeof e?new P(0,e):"number"==typeof e||"boolean"==typeof e?new P(5,e):Array.isArray(e)?new P(6,e.map((function(e,r){return t(e,n+"["+r+"]")}))):e instanceof P?e:void C(!1,"invalid option type in uniform "+n)},accessor:I},D={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},N="undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM?function(){return+new Date}:"undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function F(t){return"string"==typeof t?t.split():(C(Array.isArray(t),"invalid extension array"),t)}function z(t){return"string"==typeof t?(C("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function B(t){var e,r,i,o,a,s=t||{},u={},l=[],c=[],h="undefined"==typeof window?1:window.devicePixelRatio,p=!1,f=function(t){t&&C.raise(t)},d=function(){};if("string"==typeof s?(C("undefined"!=typeof document,"selector queries only supported in DOM environments"),e=document.querySelector(s),C(e,"invalid query string for element")):"object"==typeof s?"string"==typeof(a=s).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?e=s:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(s)?i=(o=s).canvas:(C.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=z(s.canvas):"container"in s&&(r=z(s.container)),"attributes"in s&&(u=s.attributes,C.type(u,"object","invalid context attributes")),"extensions"in s&&(l=F(s.extensions)),"optionalExtensions"in s&&(c=F(s.optionalExtensions)),"onDone"in s&&(C.type(s.onDone,"function","invalid or missing onDone callback"),f=s.onDone),"profile"in s&&(p=!!s.profile),"pixelRatio"in s&&(h=+s.pixelRatio,C(h>0,"invalid pixel ratio"))):C.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?i=e:r=e),!o){if(!i){C("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var m=function(t,e,r){var i,o=document.createElement("canvas");function a(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var i=o.getBoundingClientRect();e=i.right-i.left,n=i.bottom-i.top}o.width=r*e,o.height=r*n}return n(o.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),t.appendChild(o),t===document.body&&(o.style.position="absolute",n(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,h);if(!m)return null;i=m.canvas,d=m.onDestroy}void 0===u.premultipliedAlpha&&(u.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,u)}return o?{gl:o,canvas:i,container:r,extensions:l,optionalExtensions:c,pixelRatio:h,profile:p,onDone:f,onDestroy:d}:(d(),f("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function j(t,e){var n={};function r(e){C.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=function(e){return t.getExtension(e)?t.getExtension(e):t.getExtension(e.toLowerCase())?t.getExtension(e.toLowerCase()):null}(e)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}function U(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function Z(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function V(){var t=U(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[Z(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[Z(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var G=V();G.zero=V();var H=3553,W=6408,q=5126,Y=36160;function X(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)||e(t.data))}var $=function(t){return Object.keys(t).map((function(e){return t[e]}))},K={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||G.allocType(n,i);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var i=0,o=0;o<e;++o)for(var a=t[o],s=0;s<n;++s)r[i++]=a[s]}(t,e[0],e[1],a);break;case 3:J(t,e[0],e[1],e[2],a,0);break;default:Q(t,e,0,a,0)}return a}};function J(t,e,n,r,i,o){for(var a=o,s=0;s<e;++s)for(var u=t[s],l=0;l<n;++l)for(var c=u[l],h=0;h<r;++h)i[a++]=c[h]}function Q(t,e,n,r,i){for(var o=1,a=n+1;a<e.length;++a)o*=e[a];var s=e[n];if(e.length-n==4){var u=e[n+1],l=e[n+2],c=e[n+3];for(a=0;a<s;++a)J(t[a],u,l,c,r,i),i+=o}else for(a=0;a<s;++a)Q(t[a],e,n+1,r,i),i+=o}var tt={"[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},et={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},nt={dynamic:35048,stream:35040,static:35044},rt=K.flatten,it=K.shape,ot=35044,at=35040,st=5121,ut=5126,lt=[];function ct(t){return 0|tt[Object.prototype.toString.call(t)]}function ht(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function pt(t,e,n,r,i,o,a){for(var s=0,u=0;u<n;++u)for(var l=0;l<r;++l)t[s++]=e[i*u+o*l+a]}lt[5120]=1,lt[5122]=2,lt[5124]=4,lt[5121]=1,lt[5123]=2,lt[5125]=4,lt[5126]=4;var ft={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},dt=0,mt=1,gt=4,yt=5120,vt=5121,_t=5122,bt=5123,xt=5124,wt=5125,St=34963,Et=35040,Mt=35044;var Tt=new Float32Array(1),At=new Uint32Array(Tt.buffer),Ct=5123;function Ot(t){for(var e=G.allocType(Ct,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{Tt[0]=t[n];var r=At[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var s=-14-o;e[n]=i+(a+1024>>s)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function Pt(t){return Array.isArray(t)||e(t)}var kt=function(t){return!(t&t-1||!t)},Lt=34467,It=3553,Rt=34067,Dt=34069,Nt=6408,Ft=6406,zt=6407,Bt=6409,jt=6410,Ut=32854,Zt=32855,Vt=36194,Gt=32819,Ht=32820,Wt=33635,qt=34042,Yt=6402,Xt=34041,$t=35904,Kt=35906,Jt=36193,Qt=33776,te=33777,ee=33778,ne=33779,re=35986,ie=35987,oe=34798,ae=35840,se=35841,ue=35842,le=35843,ce=36196,he=5121,pe=5123,fe=5125,de=5126,me=10242,ge=10243,ye=10497,ve=33071,_e=33648,be=10240,xe=10241,we=9728,Se=9729,Ee=9984,Me=9985,Te=9986,Ae=9987,Ce=33170,Oe=4352,Pe=4353,ke=4354,Le=34046,Ie=3317,Re=37440,De=37441,Ne=37443,Fe=37444,ze=33984,Be=[Ee,Te,Me,Ae],je=[0,Bt,jt,zt,Nt],Ue={};function Ze(t){return"[object "+t+"]"}Ue[Bt]=Ue[Ft]=Ue[Yt]=1,Ue[Xt]=Ue[jt]=2,Ue[zt]=Ue[$t]=3,Ue[Nt]=Ue[Kt]=4;var Ve=Ze("HTMLCanvasElement"),Ge=Ze("OffscreenCanvas"),He=Ze("CanvasRenderingContext2D"),We=Ze("ImageBitmap"),qe=Ze("HTMLImageElement"),Ye=Ze("HTMLVideoElement"),Xe=Object.keys(tt).concat([Ve,Ge,He,We,qe,Ye]),$e=[];$e[he]=1,$e[de]=4,$e[Jt]=2,$e[pe]=2,$e[fe]=4;var Ke=[];function Je(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function Qe(t){return!!Array.isArray(t)&&!(0===t.length||!Pt(t[0]))}function tn(t){return Object.prototype.toString.call(t)}function en(t){return tn(t)===Ve}function nn(t){return tn(t)===Ge}function rn(t){return!!("undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM&&t&&t.getContext)}function on(t){return!!("undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM&&t&&"src"in t&&"crossOrigin"in t)}function an(t){if(!t)return!1;if(rn(t)||on(t))return!0;var e=tn(t);return Xe.indexOf(e)>=0||Je(t)||Qe(t)||X(t)}function sn(t){return 0|tt[Object.prototype.toString.call(t)]}function un(t,e){return G.allocType(t.type===Jt?de:t.type,e)}function ln(t,e){t.type===Jt?(t.data=Ot(e),G.freeType(e)):t.data=e}function cn(t,e,n,r,i,o){var a;if(a=void 0!==Ke[t]?Ke[t]:Ue[t]*$e[e],o&&(a*=6),i){for(var s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function hn(t,r,i,o,a,s,u){var l={"don't care":Oe,"dont care":Oe,nice:ke,fast:Pe},c={repeat:ye,clamp:ve,mirror:_e},h={nearest:we,linear:Se},p=n({mipmap:Ae,"nearest mipmap nearest":Ee,"linear mipmap nearest":Me,"nearest mipmap linear":Te,"linear mipmap linear":Ae},h),f={none:0,browser:Fe},d={uint8:he,rgba4:Gt,rgb565:Wt,"rgb5 a1":Ht},m={alpha:Ft,luminance:Bt,"luminance alpha":jt,rgb:zt,rgba:Nt,rgba4:Ut,"rgb5 a1":Zt,rgb565:Vt},g={};r.ext_srgb&&(m.srgb=$t,m.srgba=Kt),r.oes_texture_float&&(d.float32=d.float=de),r.oes_texture_half_float&&(d.float16=d["half float"]=Jt),r.webgl_depth_texture&&(n(m,{depth:Yt,"depth stencil":Xt}),n(d,{uint16:pe,uint32:fe,"depth stencil":qt})),r.webgl_compressed_texture_s3tc&&n(g,{"rgb s3tc dxt1":Qt,"rgba s3tc dxt1":te,"rgba s3tc dxt3":ee,"rgba s3tc dxt5":ne}),r.webgl_compressed_texture_atc&&n(g,{"rgb atc":re,"rgba atc explicit alpha":ie,"rgba atc interpolated alpha":oe}),r.webgl_compressed_texture_pvrtc&&n(g,{"rgb pvrtc 4bppv1":ae,"rgb pvrtc 2bppv1":se,"rgba pvrtc 4bppv1":ue,"rgba pvrtc 2bppv1":le}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=ce);var y=Array.prototype.slice.call(t.getParameter(Lt)||new Uint32Array(0));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(m[t]=e)}));var v=Object.keys(m);i.textureFormats=v;var _=[];Object.keys(m).forEach((function(t){var e=m[t];_[e]=t}));var b=[];Object.keys(d).forEach((function(t){var e=d[t];b[e]=t}));var x=[];Object.keys(h).forEach((function(t){var e=h[t];x[e]=t}));var w=[];Object.keys(p).forEach((function(t){var e=p[t];w[e]=t}));var S=[];Object.keys(c).forEach((function(t){var e=c[t];S[e]=t}));var E=v.reduce((function(t,e){var n=m[e];return n===Bt||n===Ft||n===Bt||n===jt||n===Yt||n===Xt||r.ext_srgb&&(n===$t||n===Kt)?t[n]=n:n===Zt||e.indexOf("rgba")>=0?t[n]=Nt:t[n]=zt,t}),{});function M(){this.internalformat=Nt,this.format=Nt,this.type=he,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Fe,this.width=0,this.height=0,this.channels=0}function T(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 A(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(C.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(C.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(C.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(C.parameter(e.colorSpace,f,"invalid colorSpace"),t.colorSpace=f[e.colorSpace]),"type"in e){var n=e.type;C(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),C(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),C(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),C.parameter(n,d,"invalid texture type"),t.type=d[n]}var o=t.width,a=t.height,s=t.channels,u=!1;"shape"in e?(C(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(s=e.shape[2],C(s>0&&s<=4,"invalid number of channels"),u=!0),C(o>=0&&o<=i.maxTextureSize,"invalid width"),C(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,C(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,C(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,C(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(s=e.channels,C(s>0&&s<=4,"invalid number of channels"),u=!0)),t.width=0|o,t.height=0|a,t.channels=0|s;var l=!1;if("format"in e){var c=e.format;C(r.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),C.parameter(c,m,"invalid texture format");var h=t.internalformat=m[c];t.format=E[h],c in d&&("type"in e||(t.type=d[c])),c in g&&(t.compressed=!0),l=!0}!u&&l?t.channels=Ue[t.format]:u&&!l?t.channels!==je[t.format]&&(t.format=t.internalformat=je[t.channels]):l&&u&&C(t.channels===Ue[t.format],"number of channels inconsistent with specified format")}}function O(e){t.pixelStorei(Re,e.flipY),t.pixelStorei(De,e.premultiplyAlpha),t.pixelStorei(Ne,e.colorSpace),t.pixelStorei(Ie,e.unpackAlignment)}function P(){M.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function k(t,n){var r=null;if(an(n)?r=n:n&&(C.type(n,"object","invalid pixel data type"),A(t,n),"x"in n&&(t.xOffset=0|n.x),"y"in n&&(t.yOffset=0|n.y),an(n.data)&&(r=n.data)),C(!t.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){C(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,s=a.viewportHeight;t.width=t.width||o-t.xOffset,t.height=t.height||s-t.yOffset,t.needsCopy=!0,C(t.xOffset>=0&&t.xOffset<o&&t.yOffset>=0&&t.yOffset<s&&t.width>0&&t.width<=o&&t.height>0&&t.height<=s,"copy texture read out of bounds")}else if(r){if(e(r))t.channels=t.channels||4,t.data=r,"type"in n||t.type!==he||(t.type=sn(r));else if(Je(r))t.channels=t.channels||4,function(t,e){var n=e.length;switch(t.type){case he:case pe:case fe:case de:var r=G.allocType(t.type,n);r.set(e),t.data=r;break;case Jt:t.data=Ot(e);break;default:C.raise("unsupported texture type, must specify a typed array")}}(t,r),t.alignment=1,t.needsFree=!0;else if(X(r)){var u=r.data;Array.isArray(u)||t.type!==he||(t.type=sn(u));var l,c,h,p,f,d,m=r.shape,g=r.stride;3===m.length?(h=m[2],d=g[2]):(C(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,d=1),l=m[0],c=m[1],p=g[0],f=g[1],t.alignment=1,t.width=l,t.height=c,t.channels=h,t.format=t.internalformat=je[h],t.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,l=un(t,a*s*u),c=0,h=0;h<s;++h)for(var p=0;p<a;++p)for(var f=0;f<u;++f)l[c++]=e[n*p+r*h+i*f+o];ln(t,l)}(t,u,p,f,d,r.offset)}else if(rn(r)||en(r)||nn(r)||tn(r)===He)rn(r)||en(r)||nn(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 tn(t)===We}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(t){return tn(t)===qe}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(on(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(t){return tn(t)===Ye}(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(Qe(r)){var y=t.width||r[0].length,v=t.height||r.length,_=t.channels;_=Pt(r[0][0])?_||r[0][0].length:_||1;for(var b=K.shape(r),x=1,w=0;w<b.length;++w)x*=b[w];var S=un(t,x);K.flatten(r,b,"",S),ln(t,S),t.alignment=1,t.width=y,t.height=v,t.channels=_,t.format=t.internalformat=je[_],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===de?C(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):t.type===Jt&&C(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function L(e,n,r){var i=e.element,a=e.data,s=e.internalformat,u=e.format,l=e.type,c=e.width,h=e.height;O(e),i?t.texImage2D(n,r,u,u,l,i):e.compressed?t.compressedTexImage2D(n,r,s,c,h,0,a):e.needsCopy?(o(),t.copyTexImage2D(n,r,u,e.xOffset,e.yOffset,c,h,0)):t.texImage2D(n,r,u,c,h,0,u,l,a||null)}function I(e,n,r,i,a){var s=e.element,u=e.data,l=e.internalformat,c=e.format,h=e.type,p=e.width,f=e.height;O(e),s?t.texSubImage2D(n,a,r,i,c,h,s):e.compressed?t.compressedTexSubImage2D(n,a,r,i,l,p,f,u):e.needsCopy?(o(),t.copyTexSubImage2D(n,a,r,i,e.xOffset,e.yOffset,p,f)):t.texSubImage2D(n,a,r,i,p,f,c,h,u)}var R=[];function D(){return R.pop()||new P}function N(t){t.needsFree&&G.freeType(t.data),P.call(t),R.push(t)}function F(){M.call(this),this.genMipmaps=!1,this.mipmapHint=Oe,this.mipmask=0,this.images=Array(16)}function z(t,e,n){var r=t.images[0]=D();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function B(t,e){var n=null;if(an(e))T(n=t.images[0]=D(),t),k(n,e),t.mipmask=1;else if(A(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)T(n=t.images[i]=D(),t),n.width>>=i,n.height>>=i,k(n,r[i]),t.mipmask|=1<<i;else T(n=t.images[0]=D(),t),k(n,e),t.mipmask=1;T(t,t.images[0]),!t.compressed||t.internalformat!==Qt&&t.internalformat!==te&&t.internalformat!==ee&&t.internalformat!==ne||C(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function j(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;L(n[r],e,r)}}var U=[];function Z(){var t=U.pop()||new F;M.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function V(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&N(e[n]),e[n]=null;U.push(t)}function H(){this.minFilter=we,this.magFilter=we,this.wrapS=ve,this.wrapT=ve,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Oe}function W(t,e){if("min"in e){var n=e.min;C.parameter(n,p),t.minFilter=p[n],Be.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;C.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(C.parameter(s,c),o=a=c[s]):Array.isArray(s)&&(C.parameter(s[0],c),C.parameter(s[1],c),o=c[s[0]],a=c[s[1]])}else{if("wrapS"in e){var u=e.wrapS;C.parameter(u,c),o=c[u]}if("wrapT"in e){var f=e.wrapT;C.parameter(f,c),a=c[f]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var d=e.anisotropic;C("number"==typeof d&&d>=1&&d<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var m=!1;switch(typeof e.mipmap){case"string":C.parameter(e.mipmap,l,"invalid mipmap hint"),t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,m=!0;break;case"boolean":m=t.genMipmaps=e.mipmap;break;case"object":C(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,m=!0;break;default:C.raise("invalid mipmap type")}m&&!("min"in e)&&(t.minFilter=Ee)}}function q(e,n){t.texParameteri(n,xe,e.minFilter),t.texParameteri(n,be,e.magFilter),t.texParameteri(n,me,e.wrapS),t.texParameteri(n,ge,e.wrapT),r.ext_texture_filter_anisotropic&&t.texParameteri(n,Le,e.anisotropic),e.genMipmaps&&(t.hint(Ce,e.mipmapHint),t.generateMipmap(n))}var Y=0,J={},Q=i.maxTextureUnits,tt=Array(Q).map((function(){return null}));function et(e){M.call(this),this.mipmask=0,this.internalformat=Nt,this.id=Y++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new H,u.profile&&(this.stats={size:0})}function nt(e){t.activeTexture(ze),t.bindTexture(e.target,e.texture)}function rt(){var e=tt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(It,null)}function it(e){var n=e.texture;C(n,"must not double destroy texture");var r=e.unit,i=e.target;r>=0&&(t.activeTexture(ze+r),t.bindTexture(i,null),tt[r]=null),t.deleteTexture(n),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete J[e.id],s.textureCount--}return n(et.prototype,{bind:function(){var e=this;e.bindCount+=1;var n=e.unit;if(n<0){for(var r=0;r<Q;++r){var i=tt[r];if(i){if(i.bindCount>0)continue;i.unit=-1}tt[r]=e,n=r;break}n>=Q&&C.raise("insufficient number of texture units"),u.profile&&s.maxTextureUnits<n+1&&(s.maxTextureUnits=n+1),e.unit=n,t.activeTexture(ze+n),t.bindTexture(e.target,e.texture)}return n},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&it(this)}}),u.profile&&(s.getTotalTextureSize=function(){var t=0;return Object.keys(J).forEach((function(e){t+=J[e].stats.size})),t}),{create2D:function(e,n){var r=new et(It);function o(t,e){var n=r.texInfo;H.call(n);var a=Z();return"number"==typeof t?z(a,0|t,"number"==typeof e?0|e:0|t):t?(C.type(t,"object","invalid arguments to regl.texture"),W(n,t),B(a,t)):z(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,T(r,a),C.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,nt(r),j(a,It),q(n,It),rt(),V(a),u.profile&&(r.stats.size=cn(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=_[r.internalformat],o.type=b[r.type],o.mag=x[n.magFilter],o.min=w[n.minFilter],o.wrapS=S[n.wrapS],o.wrapT=S[n.wrapT],o}return J[r.id]=r,s.textureCount++,o(e,n),o.subimage=function(t,e,n,i){C(!!t,"must specify image data");var a=0|e,s=0|n,u=0|i,l=D();return T(l,r),l.width=0,l.height=0,k(l,t),l.width=l.width||(r.width>>u)-a,l.height=l.height||(r.height>>u)-s,C(r.type===l.type&&r.format===l.format&&r.internalformat===l.internalformat,"incompatible format for texture.subimage"),C(a>=0&&s>=0&&a+l.width<=r.width&&s+l.height<=r.height,"texture.subimage write out of bounds"),C(r.mipmask&1<<u,"missing mipmap data"),C(l.data||l.element||l.needsCopy,"missing image data"),nt(r),I(l,It,a,s,u),rt(),N(l),o},o.resize=function(e,n){var i=0|e,a=0|n||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,nt(r);for(var s=0;r.mipmask>>s;++s){var l=i>>s,c=a>>s;if(!l||!c)break;t.texImage2D(It,s,r.format,l,c,0,r.format,r.type,null)}return rt(),u.profile&&(r.stats.size=cn(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,u.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(e,n,r,o,a,l){var c=new et(Rt);J[c.id]=c,s.cubeCount++;var h=new Array(6);function p(t,e,n,r,o,a){var s,l=c.texInfo;for(H.call(l),s=0;s<6;++s)h[s]=Z();if("number"!=typeof t&&t)if("object"==typeof t)if(e)B(h[0],t),B(h[1],e),B(h[2],n),B(h[3],r),B(h[4],o),B(h[5],a);else if(W(l,t),A(c,t),"faces"in t){var f=t.faces;for(C(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),s=0;s<6;++s)C("object"==typeof f[s]&&!!f[s],"invalid input for cube map face"),T(h[s],c),B(h[s],f[s])}else for(s=0;s<6;++s)B(h[s],t);else C.raise("invalid arguments to cube map");else{var d=0|t||1;for(s=0;s<6;++s)z(h[s],d,d)}for(T(c,h[0]),C.optional((function(){i.npotTextureCube||C(kt(c.width)&&kt(c.height),"your browser does not support non power or two texture dimensions")})),l.genMipmaps?c.mipmask=(h[0].width<<1)-1:c.mipmask=h[0].mipmask,C.textureCube(c,l,h,i),c.internalformat=h[0].internalformat,p.width=h[0].width,p.height=h[0].height,nt(c),s=0;s<6;++s)j(h[s],Dt+s);for(q(l,Rt),rt(),u.profile&&(c.stats.size=cn(c.internalformat,c.type,p.width,p.height,l.genMipmaps,!0)),p.format=_[c.internalformat],p.type=b[c.type],p.mag=x[l.magFilter],p.min=w[l.minFilter],p.wrapS=S[l.wrapS],p.wrapT=S[l.wrapT],s=0;s<6;++s)V(h[s]);return p}return p(e,n,r,o,a,l),p.subimage=function(t,e,n,r,i){C(!!e,"must specify image data"),C("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=D();return T(u,c),u.width=0,u.height=0,k(u,e),u.width=u.width||(c.width>>s)-o,u.height=u.height||(c.height>>s)-a,C(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,"incompatible format for texture.subimage"),C(o>=0&&a>=0&&o+u.width<=c.width&&a+u.height<=c.height,"texture.subimage write out of bounds"),C(c.mipmask&1<<s,"missing mipmap data"),C(u.data||u.element||u.needsCopy,"missing image data"),nt(c),I(u,Dt+t,o,a,s),rt(),N(u),p},p.resize=function(e){var n=0|e;if(n!==c.width){p.width=c.width=n,p.height=c.height=n,nt(c);for(var r=0;r<6;++r)for(var i=0;c.mipmask>>i;++i)t.texImage2D(Dt+r,i,c.format,n>>i,n>>i,0,c.format,c.type,null);return rt(),u.profile&&(c.stats.size=cn(c.internalformat,c.type,p.width,p.height,!1,!0)),p}},p._reglType="textureCube",p._texture=c,u.profile&&(p.stats=c.stats),p.destroy=function(){c.decRef()},p},clear:function(){for(var e=0;e<Q;++e)t.activeTexture(ze+e),t.bindTexture(It,null),tt[e]=null;$(J).forEach(it),s.cubeCount=0,s.textureCount=0},getTexture:function(t){return null},restore:function(){for(var e=0;e<Q;++e){var n=tt[e];n&&(n.bindCount=0,n.unit=-1,tt[e]=null)}$(J).forEach((function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var n=0;n<32;++n)if(0!=(e.mipmask&1<<n))if(e.target===It)t.texImage2D(It,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);else for(var r=0;r<6;++r)t.texImage2D(Dt+r,n,e.internalformat,e.width>>n,e.height>>n,0,e.internalformat,e.type,null);q(e.texInfo,e.target)}))},refresh:function(){for(var e=0;e<Q;++e){var n=tt[e];n&&(n.bindCount=0,n.unit=-1,tt[e]=null),t.activeTexture(ze+e),t.bindTexture(It,null),t.bindTexture(Rt,null)}}}}Ke[Ut]=2,Ke[Zt]=2,Ke[Vt]=2,Ke[Xt]=4,Ke[Qt]=.5,Ke[te]=.5,Ke[ee]=1,Ke[ne]=1,Ke[re]=.5,Ke[ie]=1,Ke[oe]=1,Ke[ae]=.5,Ke[se]=.25,Ke[ue]=.5,Ke[le]=.25,Ke[ce]=.5;var pn=36161,fn=32854,dn=[];function mn(t,e,n){return dn[t]*e*n}dn[32854]=2,dn[32855]=2,dn[36194]=2,dn[33189]=2,dn[36168]=1,dn[34041]=4,dn[35907]=4,dn[34836]=16,dn[34842]=8,dn[34843]=6;var gn=36160,yn=36161,vn=3553,_n=34069,bn=36064,xn=36096,wn=36128,Sn=33306,En=36053,Mn=6402,Tn=[6407,6408],An=[];An[6408]=4,An[6407]=3;var Cn=[];Cn[5121]=1,Cn[5126]=4,Cn[36193]=2;var On=33189,Pn=36168,kn=34041,Ln=[32854,32855,36194,35907,34842,34843,34836],In={};In[En]="complete",In[36054]="incomplete attachment",In[36057]="incomplete dimensions",In[36055]="incomplete, missing attachment",In[36061]="unsupported";var Rn=5126,Dn=34962,Nn=34963,Fn=["attributes","elements","offset","count","primitive","instances"];function zn(){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=Rn,this.offset=0,this.stride=0,this.divisor=0}var Bn=35632,jn=35633,Un=35718,Zn=35721;var Vn=6408,Gn=5121,Hn=3333,Wn=5126;function qn(t,n,r,i,o,a,s){function u(u){var l;null===n.next?(C(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),l=Gn):(C(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),l=n.next.colorAttachments[0].texture._texture.type,C.optional((function(){a.oes_texture_float?(C(l===Gn||l===Wn,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),l===Wn&&C(s.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):C(l===Gn,"Reading from a framebuffer is only allowed for the type 'uint8'")})));var c=0,h=0,p=i.framebufferWidth,f=i.framebufferHeight,d=null;e(u)?d=u:u&&(C.type(u,"object","invalid arguments to regl.read()"),c=0|u.x,h=0|u.y,C(c>=0&&c<i.framebufferWidth,"invalid x offset for regl.read"),C(h>=0&&h<i.framebufferHeight,"invalid y offset for regl.read"),p=0|(u.width||i.framebufferWidth-c),f=0|(u.height||i.framebufferHeight-h),d=u.data||null),d&&(l===Gn?C(d instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):l===Wn&&C(d instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),C(p>0&&p+c<=i.framebufferWidth,"invalid width for read pixels"),C(f>0&&f+h<=i.framebufferHeight,"invalid height for read pixels"),r();var m=p*f*4;return d||(l===Gn?d=new Uint8Array(m):l===Wn&&(d=d||new Float32Array(m))),C.isTypedArray(d,"data buffer for regl.read() must be a typedarray"),C(d.byteLength>=m,"data buffer for regl.read() too small"),t.pixelStorei(Hn,4),t.readPixels(c,h,p,f,Vn,l,d),d}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=u(t)})),e}(t):u(t)}}function Yn(t){return Array.prototype.slice.call(t)}function Xn(t){return Yn(t).join("")}var $n="xyzw".split(""),Kn=5121,Jn=1,Qn=2,tr=0,er=1,nr=2,rr=3,ir=4,or=5,ar=6,sr="dither",ur="blend.enable",lr="blend.color",cr="blend.equation",hr="blend.func",pr="depth.enable",fr="depth.func",dr="depth.range",mr="depth.mask",gr="colorMask",yr="cull.enable",vr="cull.face",_r="frontFace",br="lineWidth",xr="polygonOffset.enable",wr="polygonOffset.offset",Sr="sample.alpha",Er="sample.enable",Mr="sample.coverage",Tr="stencil.enable",Ar="stencil.mask",Cr="stencil.func",Or="stencil.opFront",Pr="stencil.opBack",kr="scissor.enable",Lr="scissor.box",Ir="viewport",Rr="profile",Dr="framebuffer",Nr="vert",Fr="frag",zr="elements",Br="primitive",jr="count",Ur="offset",Zr="instances",Vr="vao",Gr="Width",Hr="Height",Wr=Dr+Gr,qr=Dr+Hr,Yr=Ir+Gr,Xr=Ir+Hr,$r="drawingBuffer",Kr=$r+Gr,Jr=$r+Hr,Qr=[hr,cr,Cr,Or,Pr,Mr,Ir,Lr,wr],ti=34962,ei=34963,ni=3553,ri=34067,ii=2884,oi=3042,ai=3024,si=2960,ui=2929,li=3089,ci=32823,hi=32926,pi=32928,fi=5126,di=35664,mi=35665,gi=35666,yi=5124,vi=35667,_i=35668,bi=35669,xi=35670,wi=35671,Si=35672,Ei=35673,Mi=35674,Ti=35675,Ai=35676,Ci=35678,Oi=35680,Pi=4,ki=1028,Li=1029,Ii=2304,Ri=2305,Di=32775,Ni=32776,Fi=519,zi=7680,Bi=0,ji=1,Ui=32774,Zi=513,Vi=36160,Gi=36064,Hi={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},Wi=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],qi={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},Yi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Xi={frag:35632,vert:35633},$i={cw:Ii,ccw:Ri};function Ki(t){return Array.isArray(t)||e(t)||X(t)}function Ji(t){return t.sort((function(t,e){return t===Ir?-1:e===Ir?1:t<e?-1:1}))}function Qi(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function to(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function eo(t){return new Qi(!1,!1,!1,t)}function no(t,e){var n=t.type;if(n===tr){var r=t.data.length;return new Qi(!0,r>=1,r>=2,e)}if(n===ir){var i=t.data;return new Qi(i.thisDep,i.contextDep,i.propDep,e)}if(n===or)return new Qi(!1,!1,!1,e);if(n===ar){for(var o=!1,a=!1,s=!1,u=0;u<t.data.length;++u){var l=t.data[u];if(l.type===er)s=!0;else if(l.type===nr)a=!0;else if(l.type===rr)o=!0;else if(l.type===tr){o=!0;var c=l.data;c>=1&&(a=!0),c>=2&&(s=!0)}else l.type===ir&&(o=o||l.data.thisDep,a=a||l.data.contextDep,s=s||l.data.propDep)}return new Qi(o,a,s,e)}return new Qi(n===rr,n===nr,n===er,e)}var ro=new Qi(!1,!1,!1,(function(){}));function io(e,r,i,o,a,s,u,l,c,h,p,f,d,m,g){var y=h.Record,v={add:32774,subtract:32778,"reverse subtract":32779};i.ext_blend_minmax&&(v.min=Di,v.max=Ni);var _=i.angle_instanced_arrays,b=i.webgl_draw_buffers,x=i.oes_vertex_array_object,w={dirty:!0,profile:g.profile},S={},E=[],M={},T={};function A(t){return t.replace(".","_")}function O(t,e,n){var r=A(t);E.push(t),S[r]=w[r]=!!n,M[r]=e}function P(t,e,n){var r=A(t);E.push(t),Array.isArray(n)?(w[r]=n.slice(),S[r]=n.slice()):w[r]=S[r]=n,T[r]=e}O(sr,ai),O(ur,oi),P(lr,"blendColor",[0,0,0,0]),P(cr,"blendEquationSeparate",[Ui,Ui]),P(hr,"blendFuncSeparate",[ji,Bi,ji,Bi]),O(pr,ui,!0),P(fr,"depthFunc",Zi),P(dr,"depthRange",[0,1]),P(mr,"depthMask",!0),P(gr,gr,[!0,!0,!0,!0]),O(yr,ii),P(vr,"cullFace",Li),P(_r,_r,Ri),P(br,br,1),O(xr,ci),P(wr,"polygonOffset",[0,0]),O(Sr,hi),O(Er,pi),P(Mr,"sampleCoverage",[1,!1]),O(Tr,si),P(Ar,"stencilMask",-1),P(Cr,"stencilFunc",[Fi,0,-1]),P(Or,"stencilOpSeparate",[ki,zi,zi,zi]),P(Pr,"stencilOpSeparate",[Li,zi,zi,zi]),O(kr,li),P(Lr,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(Ir,Ir,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var k={gl:e,context:d,strings:r,next:S,current:w,draw:f,elements:s,buffer:a,shader:p,attributes:h.state,vao:h,uniforms:c,framebuffer:l,extensions:i,timer:m,isBufferArgs:Ki},L={primTypes:ft,compareFuncs:qi,blendFuncs:Hi,blendEquations:v,stencilOps:Yi,glTypes:et,orientationType:$i};C.optional((function(){k.isArrayLike=Pt})),b&&(L.backBuffer=[Li],L.drawBuffer=U(o.maxDrawbuffers,(function(t){return 0===t?[0]:U(t,(function(t){return Gi+t}))})));var I=0;function D(){var e=function(){var e=0,r=[],i=[];function o(){var t=[],r=[];return n((function(){t.push.apply(t,Yn(arguments))}),{def:function(){var n="v"+e++;return r.push(n),arguments.length>0&&(t.push(n,"="),t.push.apply(t,Yn(arguments)),t.push(";")),n},toString:function(){return Xn([r.length>0?"var "+r.join(",")+";":"",Xn(t)])}})}function a(){var t=o(),e=o(),r=t.toString,i=e.toString;function a(n,r){e(n,r,"=",t.def(n,r),";")}return n((function(){t.apply(t,Yn(arguments))}),{def:t.def,entry:t,exit:e,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+i()}})}var s=o(),u={};return{global:s,link:function(t){for(var n=0;n<i.length;++n)if(i[n]===t)return r[n];var o="g"+e++;return r.push(o),i.push(t),o},block:o,proc:function(t,e){var r=[];function i(){var t="a"+r.length;return r.push(t),t}e=e||0;for(var o=0;o<e;++o)i();var s=a(),l=s.toString;return u[t]=n(s,{arg:i,toString:function(){return Xn(["function(",r.join(),"){",l(),"}"])}})},scope:a,cond:function(){var t=Xn(arguments),e=a(),r=a(),i=e.toString,o=r.toString;return n(e,{then:function(){return e.apply(e,Yn(arguments)),this},else:function(){return r.apply(r,Yn(arguments)),this},toString:function(){var e=o();return e&&(e="else{"+e+"}"),Xn(["if(",t,"){",i(),"}",e])}})},compile:function(){var e=['"use strict";',s,"return {"];Object.keys(u).forEach((function(t){e.push('"',t,'":',u[t].toString(),",")})),e.push("}");var n=Xn(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return("undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM?t.Function.apply(null,r.concat(n)):Function.apply(null,r.concat(n))).apply(null,i)}}}(),i=e.link,o=e.global;e.id=I++,e.batchId="0";var a=i(k),s=e.shared={props:"a0"};Object.keys(k).forEach((function(t){s[t]=o.def(a,".",t)})),C.optional((function(){e.CHECK=i(C),e.commandStr=C.guessCommand(),e.command=i(e.commandStr),e.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",i(n),",",this.command,");")},L.invalidBlendCombinations=Wi}));var u=e.next={},l=e.current={};Object.keys(T).forEach((function(t){Array.isArray(w[t])&&(u[t]=o.def(s.next,".",t),l[t]=o.def(s.current,".",t))}));var c=e.constants={};Object.keys(L).forEach((function(t){c[t]=o.def(JSON.stringify(L[t]))})),e.invoke=function(t,n){switch(n.type){case tr:var r=["this",s.context,s.props,e.batchId];return t.def(i(n.data),".call(",r.slice(0,Math.max(n.data.length+1,4)),")");case er:return t.def(s.props,n.data);case nr:return t.def(s.context,n.data);case rr:return t.def("this",n.data);case ir:return n.data.append(e,t),n.data.ref;case or:return n.data.toString();case ar:return n.data.map((function(n){return e.invoke(t,n)}))}},e.attribCache={};var p={};return e.scopeAttrib=function(t){var e=r.id(t);if(e in p)return p[e];var n=h.scope[e];return n||(n=h.scope[e]=new y),p[e]=i(n)},e}function N(t,e,n,u,c){var f=t.static,d=t.dynamic;C.optional((function(){var t=[Dr,Nr,Fr,zr,Br,Ur,jr,Zr,Rr,Vr].concat(E);function e(e){Object.keys(e).forEach((function(e){C.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',c.commandStr)}))}e(f),e(d)}));var m=function(t,e){var n=t.static;if("string"==typeof n[Fr]&&"string"==typeof n[Nr]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)C("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),g=function(t,e){var n=t.static,r=t.dynamic;if(Dr in n){var i=n[Dr];return i?(i=l.getFramebuffer(i),C.command(i,"invalid framebuffer object"),eo((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+Wr,n+".width"),e.set(o,"."+qr,n+".height"),n}))):eo((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+Wr,r+"."+Kr),e.set(r,"."+qr,r+"."+Jr),"null"}))}if(Dr in r){var o=r[Dr];return no(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");C.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var s=r.context;return e.set(s,"."+Wr,a+"?"+a+".width:"+s+"."+Kr),e.set(s,"."+qr,a+"?"+a+".height:"+s+"."+Jr),a}))}return null}(t),b=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];C.commandType(o,"object","invalid "+t,n.commandStr);var a,s,u=!0,l=0|o.x,c=0|o.y;return"width"in o?(a=0|o.width,C.command(a>=0,"invalid "+t,n.commandStr)):u=!1,"height"in o?(s=0|o.height,C.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new Qi(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",Wr,"-",l));var i=s;return"height"in o||(i=e.def(n,".",qr,"-",c)),[l,c,r,i]}))}if(t in i){var h=i[t],p=no(h,(function(e,n){var r=e.invoke(n,h);C.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",Wr,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",qr,"-",a,")");return C.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));return e&&(p.thisDep=p.thisDep||e.thisDep,p.contextDep=p.contextDep||e.contextDep,p.propDep=p.propDep||e.propDep),p}return e?new Qi(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",Wr),e.def(n,".",qr)]})):null}var a=o(Ir);if(a){var s=a;a=new Qi(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=s.append(t,e),r=t.shared.context;return e.set(r,"."+Yr,n[2]),e.set(r,"."+Xr,n[3]),n}))}return{viewport:a,scissor_box:o(Lr)}}(t,g,c),x=function(t,e){var n=t.static,r=t.dynamic,i={},o=!1,a=function(){if(Vr in n){var t=n[Vr];return null!==t&&null===h.getVAO(t)&&(t=h.createVAO(t)),o=!0,i.vao=t,eo((function(e){var n=h.getVAO(t);return n?e.link(n):"null"}))}if(Vr in r){o=!0;var e=r[Vr];return no(e,(function(t,n){var r=t.invoke(n,e);return n.def(t.shared.vao+".getVAO("+r+")")}))}return null}(),u=!1,l=function(){if(zr in n){var t=n[zr];if(i.elements=t,Ki(t)){var l=i.elements=s.create(t,!0);t=s.getElements(l),u=!0}else t&&(t=s.getElements(t),u=!0,C.command(t,"invalid elements",e.commandStr));var c=eo((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return c.value=t,c}if(zr in r){u=!0;var h=r[zr];return no(h,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,o=t.invoke(e,h),a=e.def("null"),s=e.def(r,"(",o,")"),u=t.cond(s).then(a,"=",i,".createStream(",o,");").else(a,"=",i,".getElements(",o,");");return C.optional((function(){t.assert(u.else,"!"+o+"||"+a,"invalid elements")})),e.entry(u),e.exit(t.cond(s).then(i,".destroyStream(",a,");")),t.ELEMENTS=a,a}))}return o?new Qi(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 n){var l=0|n[t];return s?i.offset=l:i.instances=l,C.command(!s||l>=0,"invalid "+t,e.commandStr),eo((function(t,e){return s&&(t.OFFSET=l),l}))}if(t in r){var c=r[t];return no(c,(function(e,n){var r=e.invoke(n,c);return s&&(e.OFFSET=r,C.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}if(s){if(u)return eo((function(t,e){return t.OFFSET=0,0}));if(o)return new Qi(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.offset:0")}))}else if(o)return new Qi(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 p=c(Ur,!0),f=function(){if(Br in n){var t=n[Br];return i.primitive=t,C.commandParameter(t,ft,"invalid primitve",e.commandStr),eo((function(e,n){return ft[t]}))}if(Br in r){var s=r[Br];return no(s,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,s);return C.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(ft))})),e.def(n,"[",r,"]")}))}return u?to(l)?l.value?eo((function(t,e){return e.def(t.ELEMENTS,".primType")})):eo((function(){return Pi})):new Qi(l.thisDep,l.contextDep,l.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",Pi)})):o?new Qi(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.primitive:"+Pi)})):null}(),d=function(){if(jr in n){var t=0|n[jr];return i.count=t,C.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),eo((function(){return t}))}if(jr in r){var s=r[jr];return no(s,(function(t,e){var n=t.invoke(e,s);return C.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(u){if(to(l)){if(l)return p?new Qi(p.thisDep,p.contextDep,p.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return C.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):eo((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var c=eo((function(){return-1}));return C.optional((function(){c.MISSING=!0})),c}var h=new Qi(l.thisDep||p.thisDep,l.contextDep||p.contextDep,l.propDep||p.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return C.optional((function(){h.DYNAMIC=!0})),h}if(o){var f=new Qi(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao,".currentVAO?",t.shared.vao,".currentVAO.count:-1")}));return f}return null}(),m=c(Zr,!1);return{elements:l,primitive:f,count:d,instances:m,offset:p,vao:a,vaoActive:o,elementsActive:u,static:i}}(t,c),w=function(t,e){var n=t.static,r=t.dynamic,i={};return E.forEach((function(t){var a=A(t);function s(e,o){if(t in n){var s=e(n[t]);i[a]=eo((function(){return s}))}else if(t in r){var u=r[t];i[a]=no(u,(function(t,e){return o(t,e,t.invoke(e,u))}))}}switch(t){case yr:case ur:case sr:case Tr:case pr:case kr:case xr:case Sr:case Er:case mr:return s((function(n){return C.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return C.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case fr:return s((function(n){return C.commandParameter(n,qi,"invalid "+t,e.commandStr),qi[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return C.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(qi))})),n.def(i,"[",r,"]")}));case dr:return s((function(t){return C.command(Pt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return C.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case hr:return s((function(t){C.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return C.commandParameter(n,Hi,a+".srcRGB",e.commandStr),C.commandParameter(r,Hi,a+".srcAlpha",e.commandStr),C.commandParameter(i,Hi,a+".dstRGB",e.commandStr),C.commandParameter(o,Hi,a+".dstAlpha",e.commandStr),C.command(-1===Wi.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Hi[n],Hi[i],Hi[r],Hi[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return C.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Hi))})),s}C.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");C.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),l=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),l,n.def(i,"[",o("dst","Alpha"),"]")]}));case cr:return s((function(n){return"string"==typeof n?(C.commandParameter(n,v,"invalid "+t,e.commandStr),[v[n],v[n]]):"object"==typeof n?(C.commandParameter(n.rgb,v,t+".rgb",e.commandStr),C.commandParameter(n.alpha,v,t+".alpha",e.commandStr),[v[n.rgb],v[n.alpha]]):void C.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),s=e.cond("typeof ",r,'==="string"');return C.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(v))}n(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case lr:return s((function(t){return C.command(Pt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),U(4,(function(e){return+t[e]}))}),(function(t,e,n){return C.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),U(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Ar:return s((function(t){return C.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return C.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case Cr:return s((function(n){C.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return C.commandParameter(r,qi,t+".cmp",e.commandStr),C.commandType(i,"number",t+".ref",e.commandStr),C.commandType(o,"number",t+".mask",e.commandStr),[qi[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return C.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",zi),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case Or:case Pr:return s((function(n){C.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return C.commandParameter(r,Yi,t+".fail",e.commandStr),C.commandParameter(i,Yi,t+".zfail",e.commandStr),C.commandParameter(o,Yi,t+".zpass",e.commandStr),[t===Pr?Li:ki,Yi[r],Yi[i],Yi[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return C.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Yi))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",zi)}return C.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===Pr?Li:ki,o("fail"),o("zfail"),o("zpass")]}));case wr:return s((function(t){C.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return C.commandType(n,"number",a+".factor",e.commandStr),C.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return C.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case vr:return s((function(t){var n=0;return"front"===t?n=ki:"back"===t&&(n=Li),C.command(!!n,a,e.commandStr),n}),(function(t,e,n){return C.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',ki,":",Li)}));case br:return s((function(t){return C.command("number"==typeof t&&t>=o.lineWidthDims[0]&&t<=o.lineWidthDims[1],"invalid line width, must be a positive number between "+o.lineWidthDims[0]+" and "+o.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return C.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+o.lineWidthDims[0]+"&&"+n+"<="+o.lineWidthDims[1],"invalid line width")})),n}));case _r:return s((function(t){return C.commandParameter(t,$i,a,e.commandStr),$i[t]}),(function(t,e,n){return C.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?'+Ii+":"+Ri)}));case gr:return s((function(t){return C.command(Pt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return C.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),U(4,(function(t){return"!!"+n+"["+t+"]"}))}));case Mr:return s((function(t){C.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return C.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return C.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),i}(t,c),S=function(t,e,n){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=r.id(i[t]);C.optional((function(){p.shader(Xi[t],e,C.guessCommand())}));var n=eo((function(){return e}));return n.id=e,n}if(t in o){var a=o[t];return no(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return C.optional((function(){n(e.shared.shader,".shader(",Xi[t],",",i,",",e.command,");")})),i}))}return null}var s,u=a(Fr),l=a(Nr),c=null;return to(u)&&to(l)?(c=p.program(l.id,u.id,null,n),s=eo((function(t,e){return t.link(c)}))):s=new Qi(u&&u.thisDep||l&&l.thisDep,u&&u.contextDep||l&&l.contextDep,u&&u.propDep||l&&l.propDep,(function(t,e){var n,r=t.shared.shader;n=u?u.append(t,e):e.def(r,".",Fr);var i=r+".program("+(l?l.append(t,e):e.def(r,".",Nr))+","+n;return C.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:u,vert:l,progVar:s,program:c}}(t,0,m);function M(t){var e=b[t];e&&(w[t]=e)}M(Ir),M(A(Lr));var T=Object.keys(w).length>0,O={framebuffer:g,draw:x,shader:S,state:w,dirty:T,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=function(t){var e,n=t.static,r=t.dynamic;if(Rr in n){var i=!!n[Rr];(e=eo((function(t,e){return i}))).enable=i}else if(Rr in r){var o=r[Rr];e=no(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),O.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=eo((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=eo((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(C.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=eo((function(t){return t.link(o.color[0])}))):C.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else Pt(o)?r=eo((function(e){return e.global.def("[",U(o.length,(function(n){return C.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):C.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=no(e,(function(t,n){return t.invoke(n,e)}))})),i}(n,c),O.drawVAO=O.scopeVAO=x.vao,!O.drawVAO&&S.program&&!m&&i.angle_instanced_arrays&&x.static.elements){var P=!0,k=S.program.attributes.map((function(t){var n=e.static[t];return P=P&&!!n,n}));if(P&&k.length>0){var L=h.getVAO(h.createVAO({attributes:k,elements:x.static.elements}));O.drawVAO=new Qi(null,null,null,(function(t,e){return t.link(L)})),O.useVAO=!0}}return m?O.useVAO=!0:O.attributes=function(t,e){var n=t.static,i=t.dynamic,o={};return Object.keys(n).forEach((function(t){var i=n[t],s=r.id(t),u=new y;if(Ki(i))u.state=Jn,u.buffer=a.getBuffer(a.create(i,ti,!1,!0)),u.type=0;else{var l=a.getBuffer(i);if(l)u.state=Jn,u.buffer=l,u.type=0;else if(C.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var c=i.constant;u.buffer="null",u.state=Qn,"number"==typeof c?u.x=c:(C.command(Pt(c)&&c.length>0&&c.length<=4,"invalid constant for attribute "+t,e.commandStr),$n.forEach((function(t,e){e<c.length&&(u[t]=c[e])})))}else{l=Ki(i.buffer)?a.getBuffer(a.create(i.buffer,ti,!1,!0)):a.getBuffer(i.buffer),C.command(!!l,'missing buffer for attribute "'+t+'"',e.commandStr);var h=0|i.offset;C.command(h>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var p=0|i.stride;C.command(p>=0&&p<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var f=0|i.size;C.command(!("size"in i)||f>0&&f<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var d=!!i.normalized,m=0;"type"in i&&(C.commandParameter(i.type,et,"invalid type for attribute "+t,e.commandStr),m=et[i.type]);var g=0|i.divisor;C.optional((function(){"divisor"in i&&(C.command(0===g||_,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),C.command(g>=0,'invalid divisor for attribute "'+t+'"',e.commandStr));var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){C.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),u.buffer=l,u.state=Jn,u.size=f,u.normalized=d,u.type=m||l.dtype,u.offset=h,u.stride=p,u.divisor=g}}o[t]=eo((function(t,e){var n=t.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(u).forEach((function(t){r[t]=u[t]})),u.buffer&&(r.buffer=t.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];o[t]=no(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;C.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var l={isStream:r.def(!1)},c=new y;c.state=Jn,Object.keys(c).forEach((function(t){l[t]=r.def(""+c[t])}));var h=l.buffer,p=l.type;function f(t){r(l[t],"=",i,".",t,"|0;")}return r("if(",s,"(",i,")){",l.isStream,"=true;",h,"=",u,".createStream(",ti,",",i,");",p,"=",h,".dtype;","}else{",h,"=",u,".getBuffer(",i,");","if(",h,"){",p,"=",h,".dtype;",'}else if("constant" in ',i,"){",l.state,"=",Qn,";","if(typeof "+i+'.constant === "number"){',l[$n[0]],"=",i,".constant;",$n.slice(1).map((function(t){return l[t]})).join("="),"=0;","}else{",$n.map((function(t,e){return l[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",h,"=",u,".createStream(",ti,",",i,".buffer);","}else{",h,"=",u,".getBuffer(",i,".buffer);","}",p,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",h,".dtype;",l.normalized,"=!!",i,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",u,".destroyStream(",h,");","}"),l}))})),o}(e,c),O.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=eo((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=no(e,(function(t,n){return t.invoke(n,e)}))})),r}(u),O}function F(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function z(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,l=t.constants,c=l.drawBuffer,h=l.backBuffer;u=n?n.append(t,e):e.def(s,".next"),r||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",Vi,",",u,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",c,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",Vi,",null);"),b&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",u,";"),r||e("}")}function B(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,u=r.next,l=t.cond(s,".dirty");E.forEach((function(e){var r,c,h=A(e);if(!(h in n.state))if(h in a){r=a[h],c=o[h];var p=U(w[h].length,(function(t){return l.def(r,"[",t,"]")}));l(t.cond(p.map((function(t,e){return t+"!=="+c+"["+e+"]"})).join("||")).then(i,".",T[h],"(",p,");",p.map((function(t,e){return c+"["+e+"]="+t})).join(";"),";"))}else{r=l.def(u,".",h);var f=t.cond(r,"!==",s,".",h);l(f),h in M?f(t.cond(r).then(i,".enable(",M[h],");").else(i,".disable(",M[h],");"),s,".",h,"=",r,";"):f(i,".",T[h],"(",r,");",s,".",h,"=",r,";")}})),0===Object.keys(n.state).length&&l(s,".dirty=false;"),e(l)}function j(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;Ji(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var l=u.append(t,e);if(M[i]){var c=M[i];to(u)?e(s,l?".enable(":".disable(",c,");"):e(t.cond(l).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(a,".",i,"=",l,";")}else if(Pt(l)){var h=o[i];e(s,".",T[i],"(",l,");",l.map((function(t,e){return h+"["+e+"]="+t})).join(";"),";")}else e(s,".",T[i],"(",l,");",a,".",i,"=",l,";")}}))}function Z(t,e){_&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function V(t,e,n,r,i){var o,a,s,u=t.shared,l=t.stats,c=u.current,h=u.timer,p=n.profile;function f(){return"undefined"!=typeof my&&my&&"function"==typeof my.showToast&&!0!==my.isFRM||"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(o=e.def(),"=",f(),";"),"string"==typeof i?t(l,".count+=",i,";"):t(l,".count++;"),m&&(r?t(a=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",l,");"))}function g(t){t(l,".cpuTime+=",f(),"-",o,";"),m&&(r?t(h,".pushScopeStats(",a,",",h,".getNumPendingQueries(),",l,");"):t(h,".endQuery();"))}function y(t){var n=e.def(c,".profile");e(c,".profile=",t,";"),e.exit(c,".profile=",n,";")}if(p){if(to(p))return void(p.enable?(d(e),g(e.exit),y("true")):y("false"));y(s=p.append(t,e))}else s=e.def(c,".profile");var v=t.block();d(v),e("if(",s,"){",v,"}");var _=t.block();g(_),e.exit("if(",s,"){",_,"}")}function G(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(ro))return;var l=t.scopeAttrib(s);C.optional((function(){t.assert(e,l+".state","missing attribute "+s)})),a={},Object.keys(new y).forEach((function(t){a[t]=e.def(l,".",t)}))}!function(n,r,i){var a=o.gl,s=e.def(n,".location"),u=e.def(o.attributes,"[",s,"]"),l=i.state,c=i.buffer,h=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];function f(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",u,".type!==",o,"||",u,".size!==",n,"||",p.map((function(t){return u+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",ti,",",c,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",p.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),_){var l=i.divisor;e("if(",u,".divisor!==",l,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,l],");",u,".divisor=",l,";}")}}function d(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",$n.map((function(t,e){return u+"."+t+"!=="+h[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",h,");",$n.map((function(t,e){return u+"."+t+"="+h[e]+";"})).join(""),"}")}l===Jn?f():l===Qn?d():(e("if(",l,"===",Jn,"){"),f(),e("}else{"),d(),e("}"))}(t.link(r),function(t){switch(t){case di:case vi:case wi:return 2;case mi:case _i:case Si:return 3;case gi:case bi:case Ei:return 4;default:return 1}}(r.info.type),a)}))}function H(t,e,n,i,o,a){for(var s,u=t.shared,l=u.gl,c=0;c<i.length;++c){var h,p=i[c],f=p.name,d=p.info.type,m=n.uniforms[f],g=t.link(p)+".location";if(m){if(!o(m))continue;if(to(m)){var y=m.value;if(C.command(null!=y,'missing uniform "'+f+'"',t.commandStr),d===Ci||d===Oi){C.command("function"==typeof y&&(d===Ci&&("texture2d"===y._reglType||"framebuffer"===y._reglType)||d===Oi&&("textureCube"===y._reglType||"framebufferCube"===y._reglType)),"invalid texture for uniform "+f,t.commandStr);var v=t.link(y._texture||y.color[0]._texture);e(l,".uniform1i(",g,",",v+".bind());"),e.exit(v,".unbind();")}else if(d===Mi||d===Ti||d===Ai){C.optional((function(){C.command(Pt(y),"invalid matrix for uniform "+f,t.commandStr),C.command(d===Mi&&4===y.length||d===Ti&&9===y.length||d===Ai&&16===y.length,"invalid length for matrix uniform "+f,t.commandStr)}));var _=t.global.def("new Float32Array(["+Array.prototype.slice.call(y)+"])"),b=2;d===Ti?b=3:d===Ai&&(b=4),e(l,".uniformMatrix",b,"fv(",g,",false,",_,");")}else{switch(d){case fi:C.commandType(y,"number","uniform "+f,t.commandStr),s="1f";break;case di:C.command(Pt(y)&&2===y.length,"uniform "+f,t.commandStr),s="2f";break;case mi:C.command(Pt(y)&&3===y.length,"uniform "+f,t.commandStr),s="3f";break;case gi:C.command(Pt(y)&&4===y.length,"uniform "+f,t.commandStr),s="4f";break;case xi:C.commandType(y,"boolean","uniform "+f,t.commandStr),s="1i";break;case yi:C.commandType(y,"number","uniform "+f,t.commandStr),s="1i";break;case wi:case vi:C.command(Pt(y)&&2===y.length,"uniform "+f,t.commandStr),s="2i";break;case Si:case _i:C.command(Pt(y)&&3===y.length,"uniform "+f,t.commandStr),s="3i";break;case Ei:case bi:C.command(Pt(y)&&4===y.length,"uniform "+f,t.commandStr),s="4i"}e(l,".uniform",s,"(",g,",",Pt(y)?Array.prototype.slice.call(y):y,");")}continue}h=m.append(t,e)}else{if(!o(ro))continue;h=e.def(u.uniforms,"[",r.id(f),"]")}d===Ci?(C(!Array.isArray(h),"must specify a scalar prop for textures"),e("if(",h,"&&",h,'._reglType==="framebuffer"){',h,"=",h,".color[0];","}")):d===Oi&&(C(!Array.isArray(h),"must specify a scalar prop for cube maps"),e("if(",h,"&&",h,'._reglType==="framebufferCube"){',h,"=",h,".color[0];","}")),C.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+f+'". '+r)}function r(t){C(!Array.isArray(h),"must not specify an array type for uniform"),n("typeof "+h+'==="'+t+'"',"invalid type, expected "+t)}function i(e,r){Array.isArray(h)?C(h.length===e,"must have length "+e):n(u.isArrayLike+"("+h+")&&"+h+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){C(!Array.isArray(h),"must not specify a value type"),n("typeof "+h+'==="function"&&'+h+'._reglType==="texture'+(e===ni?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case yi:r("number");break;case vi:i(2);break;case _i:i(3);break;case bi:i(4);break;case fi:r("number");break;case di:i(2);break;case mi:i(3);break;case gi:i(4);break;case xi:r("boolean");break;case wi:i(2);break;case Si:i(3);break;case Ei:case Mi:i(4);break;case Ti:i(9);break;case Ai:i(16);break;case Ci:o(ni);break;case Oi:o(ri)}}));var x=1;switch(d){case Ci:case Oi:var w=e.def(h,"._texture");e(l,".uniform1i(",g,",",w,".bind());"),e.exit(w,".unbind();");continue;case yi:case xi:s="1i";break;case vi:case wi:s="2i",x=2;break;case _i:case Si:s="3i",x=3;break;case bi:case Ei:s="4i",x=4;break;case fi:s="1f";break;case di:s="2f",x=2;break;case mi:s="3f",x=3;break;case gi:s="4f",x=4;break;case Mi:s="Matrix2fv";break;case Ti:s="Matrix3fv";break;case Ai:s="Matrix4fv"}if("M"===s.charAt(0)){e(l,".uniform",s,"(",g,",");var S=Math.pow(d-Mi+2,2),E=t.global.def("new Float32Array(",S,")");Array.isArray(h)?e("false,(",U(S,(function(t){return E+"["+t+"]="+h[t]})),",",E,")"):e("false,(Array.isArray(",h,")||",h," instanceof Float32Array)?",h,":(",U(S,(function(t){return E+"["+t+"]="+h+"["+t+"]"})),",",E,")"),e(");")}else if(x>1){for(var M=[],T=[],A=0;A<x;++A)Array.isArray(h)?T.push(h[A]):T.push(e.def(h+"["+A+"]")),a&&M.push(e.def());a&&e("if(!",t.batchId,"||",M.map((function(t,e){return t+"!=="+T[e]})).join("||"),"){",M.map((function(t,e){return t+"="+T[e]+";"})).join("")),e(l,".uniform",s,"(",g,",",T.join(","),");"),a&&e("}")}else{if(C(!Array.isArray(h),"uniform value must not be an array"),a){var O=e.def();e("if(!",t.batchId,"||",O,"!==",h,"){",O,"=",h,";")}e(l,".uniform",s,"(",g,",",h,");"),a&&e("}")}}}function W(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,s=r.draw;var u=function(){var u,l=s.elements,c=e;return l?((l.contextDep&&r.contextDynamic||l.propDep)&&(c=n),u=l.append(t,c),s.elementsActive&&c("if("+u+")"+o+".bindBuffer("+ei+","+u+".buffer.buffer);")):(u=c.def(),c(u,"=",a,".",zr,";","if(",u,"){",o,".bindBuffer(",ei,",",u,".buffer.buffer);}","else if(",i.vao,".currentVAO){",u,"=",t.shared.elements+".getElements("+i.vao,".currentVAO.elements);",x?"":"if("+u+")"+o+".bindBuffer("+ei+","+u+".buffer.buffer);","}")),u}();function l(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var c,h,p=l(Br),f=l(Ur),d=function(){var i,o=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),C.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",jr),C.optional((function(){t.assert(u,i+">=0","missing vertex count")}))),i}();if("number"==typeof d){if(0===d)return}else n("if(",d,"){"),n.exit("}");_&&(c=l(Zr),h=t.instancing);var m=u+".type",g=s.elements&&to(s.elements)&&!s.vaoActive;function y(){function t(){n(h,".drawElementsInstancedANGLE(",[p,d,m,f+"<<(("+m+"-"+Kn+")>>1)",c],");")}function e(){n(h,".drawArraysInstancedANGLE(",[p,f,d,c],");")}u&&"null"!==u?g?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}function v(){function t(){n(o+".drawElements("+[p,d,m,f+"<<(("+m+"-"+Kn+")>>1)"]+");")}function e(){n(o+".drawArrays("+[p,f,d]+");")}u&&"null"!==u?g?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}_&&("number"!=typeof c||c>=0)?"string"==typeof c?(n("if(",c,">0){"),y(),n("}else if(",c,"<0){"),v(),n("}")):y():v()}function q(t,e,n,r,i){var o=D(),a=o.proc("body",i);return C.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),_&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function Y(t,e,n,r){Z(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),G(t,e,n,r.attributes,(function(){return!0}))),H(t,e,n,r.uniforms,(function(){return!0}),!1),W(t,e,e,n)}function X(t,e,n,r){function i(){return!0}t.batchId="a1",Z(t,e),G(t,e,n,r.attributes,i),H(t,e,n,r.uniforms,i,!1),W(t,e,e,n)}function $(t,e,n,r){Z(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function l(t){return t.contextDep&&i||t.propDep}function c(t){return!l(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&F(t,u,n.context),n.needsFramebuffer&&z(t,u,n.framebuffer),j(t,u,n.state,l),n.profile&&l(n.profile)&&V(t,u,n,!1,!0),r)n.useVAO?n.drawVAO?l(n.drawVAO)?u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),G(t,s,n,r.attributes,c),G(t,u,n,r.attributes,l)),H(t,s,n,r.uniforms,c,!1),H(t,u,n,r.uniforms,l,!0),W(t,s,u,n);else{var h=t.global.def("{}"),p=n.shader.progVar.append(t,u),f=u.def(p,".id"),d=u.def(h,"[",f,"]");u(t.shared.gl,".useProgram(",p,".program);","if(!",d,"){",d,"=",h,"[",f,"]=",t.link((function(e){return q(X,t,n,e,2)})),"(",p,");}",d,".call(this,a0[",o,"],",o,");")}}function K(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!Pt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(R.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),a=!1,s=!1,u=!1,l=t.global.def("{}");o.forEach((function(e){var n=r[e];if(R.isDynamic(n)){"function"==typeof n&&(n=r[e]=R.unbox(n));var o=no(n,null);a=a||o.thisDep,u=u||o.propDep,s=s||o.contextDep}else{switch(i(l,".",e,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new R.DynamicVariable(ir,{thisDep:a,contextDep:s,propDep:u,ref:l,append:function(t,e){o.forEach((function(n){var i=r[n];if(R.isDynamic(i)){var o=t.invoke(e,i);e(l,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:S,current:w,procs:function(){var t=D(),e=t.proc("poll"),n=t.proc("refresh"),r=t.block();e(r),n(r);var a,s=t.shared,u=s.gl,l=s.next,c=s.current;r(c,".dirty=false;"),z(t,e),z(t,n,null,!0),_&&(a=t.link(_)),i.oes_vertex_array_object&&n(t.link(i.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var h=0;h<o.maxAttributes;++h){var p=n.def(s.attributes,"[",h,"]"),f=t.cond(p,".buffer");f.then(u,".enableVertexAttribArray(",h,");",u,".bindBuffer(",ti,",",p,".buffer.buffer);",u,".vertexAttribPointer(",h,",",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(u,".disableVertexAttribArray(",h,");",u,".vertexAttrib4f(",h,",",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;"),n(f),_&&n(a,".vertexAttribDivisorANGLE(",h,",",p,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(M).forEach((function(i){var o=M[i],a=r.def(l,".",i),s=t.block();s("if(",a,"){",u,".enable(",o,")}else{",u,".disable(",o,")}",c,".",i,"=",a,";"),n(s),e("if(",a,"!==",c,".",i,"){",s,"}")})),Object.keys(T).forEach((function(i){var o,a,s=T[i],h=w[i],p=t.block();if(p(u,".",s,"("),Pt(h)){var f=h.length;o=t.global.def(l,".",i),a=t.global.def(c,".",i),p(U(f,(function(t){return o+"["+t+"]"})),");",U(f,(function(t){return a+"["+t+"]="+o+"["+t+"];"})).join("")),e("if(",U(f,(function(t){return o+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",p,"}")}else o=r.def(l,".",i),a=r.def(c,".",i),p(o,");",c,".",i,"=",o,";"),e("if(",o,"!==",a,"){",p,"}");n(p)})),t.compile()}(),compile:function(t,e,i,o,a){var s=D();s.stats=s.link(a),Object.keys(e.static).forEach((function(t){K(s,e,t)})),Qr.forEach((function(e){K(s,t,e)}));var u=N(t,e,i,o,s);return function(t,e){var n=t.proc("draw",1);Z(t,n),F(t,n,e.context),z(t,n,e.framebuffer),B(t,n,e),j(t,n,e.state),V(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return q(Y,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;"),t.shared.vao&&n(t.shared.vao,".setVAO(null);")}(s,u),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(r){var o=e.shader[r];o&&n.set(i.shader,"."+r,o.append(t,n))}F(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),Ji(Object.keys(e.state)).forEach((function(r){var o=e.state[r].append(t,n);Pt(o)?o.forEach((function(e,i){n.set(t.next[r],"["+i+"]",e)})):n.set(i.next,"."+r,o)})),V(t,n,e,!0,!0),[zr,Ur,jr,Zr,Br].forEach((function(r){var o=e.draw[r];o&&n.set(i.draw,"."+r,""+o.append(t,n))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,n);Array.isArray(a)&&(a="["+a.join()+"]"),n.set(i.uniforms,"["+r.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(r){var i=e.attributes[r].append(t,n),o=t.scopeAttrib(r);Object.keys(new y).forEach((function(t){n.set(o,"."+t,i[t])}))})),e.scopeVAO&&n.set(i.vao,".targetVAO",e.scopeVAO.append(t,n)),a(Nr),a(Fr),Object.keys(e.state).length>0&&(n(o,".dirty=true;"),n.exit(o,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var n=t.proc("batch",2);t.batchId="0",Z(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(F(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||z(t,n,o)):z(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),B(t,n,e),j(t,n,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||V(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&r||u.propDep)$(t,n,e,null);else{var l=u.append(t,n);if(n(t.shared.gl,".useProgram(",l,".program);"),e.shader.program)$(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var c=t.global.def("{}"),h=n.def(l,".id"),p=n.def(c,"[",h,"]");n(t.cond(p).then(p,".call(this,a0,a1);").else(p,"=",c,"[",h,"]=",t.link((function(n){return q($,t,e,n,2)})),"(",l,");",p,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;"),t.shared.vao&&n(t.shared.vao,".setVAO(null);")}(s,u),n(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var oo=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(t){a.push(t)}var u=[];function l(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.push(r)}var c=[],h=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),l(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:l,update:function(){var t,n,o=i.length;if(0!==o){h.length=Math.max(h.length,o+1),c.length=Math.max(c.length,o+1),c[0]=0,h[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var l=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(l,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(l,34918),r(l)):i[t++]=l,c[n+1]=a,h[n+1]=t}for(i.length=t,t=0,n=0;n<u.length;++n){var p=u[n],f=p.startQueryIndex,d=p.endQueryIndex;p.sum+=c[d]-c[f];var m=h[f],g=h[d];g===m?(p.stats.gpuTime+=p.sum/1e6,s(p)):(p.startQueryIndex=m,p.endQueryIndex=g,u[t++]=p)}u.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}},ao="webglcontextlost",so="webglcontextrestored";function uo(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(t){var r=B(t);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),s=j(i,r);if(!s)return null;var u,l,c=(u={"":0},l=[""],{id:function(t){var e=u[t];return e||(e=u[t]=l.length,l.push(t),e)},str:function(t){return l[t]}}),h={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},p=s.extensions,f=oo(0,p),d=N(),m=i.drawingBufferWidth,g=i.drawingBufferHeight,y={tick:0,time:0,viewportWidth:m,viewportHeight:g,framebufferWidth:m,framebufferHeight:g,drawingBufferWidth:m,drawingBufferHeight:g,pixelRatio:r.pixelRatio},v={elements:null,primitive:4,count:-1,offset:0,instances:-1},_=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(H,a),t.texImage2D(H,0,W,1,1,0,W,q,null);var s=t.createFramebuffer();if(t.bindFramebuffer(Y,s),t.framebufferTexture2D(Y,36064,H,a,0),t.bindTexture(H,null),36053!==t.checkFramebufferStatus(Y))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=G.allocType(q,4);t.readPixels(0,0,1,1,W,q,u),t.getError()?o=!1:(t.deleteFramebuffer(s),t.deleteTexture(a),o=1===u[0]),G.freeType(u)}}var l=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var c=t.createTexture(),h=G.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,c),t.texImage2D(34069,0,W,3,3,0,W,5121,h),G.freeType(h),t.bindTexture(34067,null),t.deleteTexture(c),l=!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:n,maxDrawbuffers:r,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:o,npotTextureCube:l}}(i,p),b=function(t,n,r,i){var o=0,a={};function s(e){this.id=o++,this.buffer=t.createBuffer(),this.type=e,this.usage=ot,this.byteLength=0,this.dimension=1,this.dtype=st,this.persistentData=null,r.profile&&(this.stats={size:0})}s.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},s.prototype.destroy=function(){h(this)};var u=[];function l(e,n,r){e.byteLength=n.byteLength,t.bufferData(e.type,n,r)}function c(t,n,r,i,o,a){var s,u;if(t.usage=r,Array.isArray(n)){if(t.dtype=i||ut,n.length>0)if(Array.isArray(n[0])){s=it(n);for(var c=1,h=1;h<s.length;++h)c*=s[h];t.dimension=c,l(t,u=rt(n,s,t.dtype),r),a?t.persistentData=u:G.freeType(u)}else if("number"==typeof n[0]){t.dimension=o;var p=G.allocType(t.dtype,n.length);ht(p,n),l(t,p,r),a?t.persistentData=p:G.freeType(p)}else e(n[0])?(t.dimension=n[0].length,t.dtype=i||ct(n[0])||ut,l(t,u=rt(n,[n.length,n[0].length],t.dtype),r),a?t.persistentData=u:G.freeType(u)):C.raise("invalid buffer data")}else if(e(n))t.dtype=i||ct(n),t.dimension=o,l(t,n,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(X(n)){s=n.shape;var f=n.stride,d=n.offset,m=0,g=0,y=0,v=0;1===s.length?(m=s[0],g=1,y=f[0],v=0):2===s.length?(m=s[0],g=s[1],y=f[0],v=f[1]):C.raise("invalid shape"),t.dtype=i||ct(n.data)||ut,t.dimension=g;var _=G.allocType(t.dtype,m*g);pt(_,n.data,m,g,y,v,d),l(t,_,r),a?t.persistentData=_:G.freeType(_)}else n instanceof ArrayBuffer?(t.dtype=st,t.dimension=o,l(t,n,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(n)))):C.raise("invalid buffer data")}function h(e){n.bufferCount--,i(e);var r=e.buffer;C(r,"buffer must not be deleted already"),t.deleteBuffer(r),e.buffer=null,delete a[e.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(i,o,u,l){n.bufferCount++;var p=new s(o);function f(n){var i=ot,o=null,a=0,s=0,u=1;return Array.isArray(n)||e(n)||X(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(C.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(C(null===o||Array.isArray(o)||e(o)||X(o),"invalid data for buffer"),o=n.data),"usage"in n&&(C.parameter(n.usage,nt,"invalid buffer usage"),i=nt[n.usage]),"type"in n&&(C.parameter(n.type,et,"invalid buffer type"),s=et[n.type]),"dimension"in n&&(C.type(n.dimension,"number","invalid dimension"),u=0|n.dimension),"length"in n&&(C.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),p.bind(),o?c(p,o,i,s,u,l):(a&&t.bufferData(p.type,a,i),p.dtype=s||st,p.usage=i,p.dimension=u,p.byteLength=a),r.profile&&(p.stats.size=p.byteLength*lt[p.dtype]),f}function d(e,n){C(n+e.byteLength<=p.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+e.byteLength+" starting from offset "+n+" to a buffer of size "+p.byteLength),t.bufferSubData(p.type,n,e)}return a[p.id]=p,u||f(i),f._reglType="buffer",f._buffer=p,f.subdata=function(t,n){var r,i=0|(n||0);if(p.bind(),e(t)||t instanceof ArrayBuffer)d(t,i);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var o=G.allocType(p.dtype,t.length);ht(o,t),d(o,i),G.freeType(o)}else if(Array.isArray(t[0])||e(t[0])){r=it(t);var a=rt(t,r,p.dtype);d(a,i),G.freeType(a)}else C.raise("invalid buffer data")}else if(X(t)){r=t.shape;var s=t.stride,u=0,l=0,c=0,h=0;1===r.length?(u=r[0],l=1,c=s[0],h=0):2===r.length?(u=r[0],l=r[1],c=s[0],h=s[1]):C.raise("invalid shape");var m=Array.isArray(t.data)?p.dtype:ct(t.data),g=G.allocType(m,u*l);pt(g,t.data,u,l,c,h,t.offset),d(g,i),G.freeType(g)}else C.raise("invalid data for buffer subdata");return f},r.profile&&(f.stats=p.stats),f.destroy=function(){h(p)},f},createStream:function(t,e){var n=u.pop();return n||(n=new s(t)),n.bind(),c(n,e,at,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){$(a).forEach(h),u.forEach(h)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){$(a).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:c}}(i,h,r,(function(t){return w.destroyBuffer(t)})),x=function(t,n,r,i){var o={},a=0,s={uint8:vt,uint16:bt};function u(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=gt,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(s.uint32=wt),u.prototype.bind=function(){this.buffer.bind()};var l=[];function c(i,o,a,s,u,l,c){var h;if(i.buffer.bind(),o){var p=c;c||e(o)&&(!X(o)||e(o.data))||(p=n.oes_element_index_uint?wt:bt),r._initBuffer(i.buffer,o,a,p,3)}else t.bufferData(St,l,a),i.buffer.dtype=h||vt,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=l;if(h=c,!c){switch(i.buffer.dtype){case vt:case yt:h=vt;break;case bt:case _t:h=bt;break;case wt:case xt:h=wt;break;default:C.raise("unsupported type for element array")}i.buffer.dtype=h}i.type=h,C(h!==wt||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=u;f<0&&(f=i.buffer.byteLength,h===bt?f>>=1:h===wt&&(f>>=2)),i.vertCount=f;var d=s;if(s<0){d=gt;var m=i.buffer.dimension;1===m&&(d=dt),2===m&&(d=mt),3===m&&(d=gt)}i.primType=d}function h(t){i.elementsCount--,C(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,n){var o=r.create(null,St,!0),a=new u(o._buffer);function l(t){if(t)if("number"==typeof t)o(t),a.primType=gt,a.vertCount=0|t,a.type=vt;else{var n=null,r=Mt,i=-1,u=-1,h=0,p=0;Array.isArray(t)||e(t)||X(t)?n=t:(C.type(t,"object","invalid arguments for elements"),"data"in t&&(n=t.data,C(Array.isArray(n)||e(n)||X(n),"invalid data for element buffer")),"usage"in t&&(C.parameter(t.usage,nt,"invalid element buffer usage"),r=nt[t.usage]),"primitive"in t&&(C.parameter(t.primitive,ft,"invalid element buffer primitive"),i=ft[t.primitive]),"count"in t&&(C("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),u=0|t.count),"type"in t&&(C.parameter(t.type,s,"invalid buffer type"),p=s[t.type]),"length"in t?h=0|t.length:(h=u,p===bt||p===_t?h*=2:p!==wt&&p!==xt||(h*=4))),c(a,n,r,i,u,h,p)}else o(),a.primType=gt,a.vertCount=0,a.type=vt;return l}return i.elementsCount++,l(t),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return o.subdata(t,e),l},l.destroy=function(){h(a)},l},createStream:function(t){var e=l.pop();return e||(e=new u(r.create(null,St,!0,!1)._buffer)),c(e,t,Et,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){$(o).forEach(h)}}}(i,p,b,h),w=function(t,n,r,i,o,a,s){for(var u=r.maxAttributes,l=new Array(u),c=0;c<u;++c)l[c]=new zn;var h=0,p={},f={Record:zn,scope:{},state:l,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&$(p).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(t){var r=new g;function s(t){var i;if(Array.isArray(t))i=t,r.elements&&r.ownsElements&&r.elements.destroy(),r.elements=null,r.ownsElements=!1,r.offset=0,r.count=0,r.instances=-1,r.primitive=4;else{if(C("object"==typeof t,"invalid arguments for create vao"),C("attributes"in t,"must specify attributes for vao"),t.elements){var l=t.elements;r.ownsElements?"function"==typeof l&&"elements"===l._reglType?(r.elements.destroy(),r.ownsElements=!1):(r.elements(l),r.ownsElements=!1):a.getElements(t.elements)?(r.elements=t.elements,r.ownsElements=!1):(r.elements=a.create(t.elements),r.ownsElements=!0)}else r.elements=null,r.ownsElements=!1;i=t.attributes,r.offset=0,r.count=-1,r.instances=-1,r.primitive=4,r.elements&&(r.count=r.elements._elements.vertCount,r.primitive=r.elements._elements.primType),"offset"in t&&(r.offset=0|t.offset),"count"in t&&(r.count=0|t.count),"instances"in t&&(r.instances=0|t.instances),"primitive"in t&&(C(t.primitive in ft,"bad primitive type: "+t.primitive),r.primitive=ft[t.primitive]),C.optional((function(){for(var e=Object.keys(t),n=0;n<e.length;++n)C(Fn.indexOf(e[n])>=0,'invalid option for vao: "'+e[n]+'" valid options are '+Fn)})),C(Array.isArray(i),"attributes must be an array")}C(i.length<u,"too many attributes"),C(i.length>0,"must specify at least one attribute");var c={},h=r.attributes;h.length=i.length;for(var p=0;p<i.length;++p){var f,d=i[p],m=h[p]=new zn,g=d.data||d;Array.isArray(g)||e(g)||X(g)?(r.buffers[p]&&(f=r.buffers[p],e(g)&&f._buffer.byteLength>=g.byteLength?f.subdata(g):(f.destroy(),r.buffers[p]=null)),r.buffers[p]||(f=r.buffers[p]=o.create(d,Dn,!1,!0)),m.buffer=o.getBuffer(f),m.size=0|m.buffer.dimension,m.normalized=!1,m.type=m.buffer.dtype,m.offset=0,m.stride=0,m.divisor=0,m.state=1,c[p]=1):o.getBuffer(d)?(m.buffer=o.getBuffer(d),m.size=0|m.buffer.dimension,m.normalized=!1,m.type=m.buffer.dtype,m.offset=0,m.stride=0,m.divisor=0,m.state=1):o.getBuffer(d.buffer)?(m.buffer=o.getBuffer(d.buffer),m.size=0|(+d.size||m.buffer.dimension),m.normalized=!!d.normalized||!1,"type"in d?(C.parameter(d.type,et,"invalid buffer type"),m.type=et[d.type]):m.type=m.buffer.dtype,m.offset=0|(d.offset||0),m.stride=0|(d.stride||0),m.divisor=0|(d.divisor||0),m.state=1,C(m.size>=1&&m.size<=4,"size must be between 1 and 4"),C(m.offset>=0,"invalid offset"),C(m.stride>=0&&m.stride<=255,"stride must be between 0 and 255"),C(m.divisor>=0,"divisor must be positive"),C(!m.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in d?(C(p>0,"first attribute must not be a constant"),m.x=+d.x||0,m.y=+d.y||0,m.z=+d.z||0,m.w=+d.w||0,m.state=2):C(!1,"invalid attribute spec for location "+p)}for(var y=0;y<r.buffers.length;++y)!c[y]&&r.buffers[y]&&(r.buffers[y].destroy(),r.buffers[y]=null);return r.refresh(),s}return i.vaoCount+=1,s.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.ownsElements&&(r.elements.destroy(),r.elements=null,r.ownsElements=!1),r.destroy()},s._vao=r,s._reglType="vao",s(t)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(e){for(var n=0;n<l.length;++n){var r=l[n];r.buffer===e&&(t.disableVertexAttribArray(n),r.buffer=null)}},setVAO:d()?function(t){if(t!==f.currentVAO){var e=d();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),f.currentVAO=t}}:function(e){if(e!==f.currentVAO){if(e)e.bindAttrs();else{for(var n=m(),r=0;r<l.length;++r){var i=l[r];i.buffer?(t.enableVertexAttribArray(r),i.buffer.bind(),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}s.elements?t.bindBuffer(Nn,s.elements.buffer.buffer):t.bindBuffer(Nn,null)}f.currentVAO=e}},clear:d()?function(){$(p).forEach((function(t){t.destroy()}))}:function(){}};function d(){return n.oes_vertex_array_object}function m(){return n.angle_instanced_arrays}function g(){this.id=++h,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var t=d();this.vao=t?t.createVertexArrayOES():null,p[this.id]=this,this.buffers=[]}return g.prototype.bindAttrs=function(){for(var e=m(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(t.enableVertexAttribArray(r),t.bindBuffer(Dn,i.buffer.buffer),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),e&&i.divisor&&e.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<u;++o)t.disableVertexAttribArray(o);var s=a.getElements(this.elements);s?t.bindBuffer(Nn,s.buffer.buffer):t.bindBuffer(Nn,null)},g.prototype.refresh=function(){var t=d();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=null,t.bindVertexArrayOES(null))},g.prototype.destroy=function(){if(this.vao){var t=d();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),p[this.id]&&(delete p[this.id],i.vaoCount-=1)},f}(i,p,_,h,b,x,v),S=function(t,e,r,i){var o={},a={};function s(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function u(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function l(n,r,i){var s=n===Bn?o:a,u=s[r];if(!u){var l=e.str(r);u=t.createShader(n),t.shaderSource(u,l),t.compileShader(u),C.shaderError(t,u,l,n,i),s[r]=u}return u}var c={},h=[],p=0;function f(t,e){this.id=p++,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(n,r,o){var a,c,h=l(Bn,n.fragId),p=l(jn,n.vertId),f=n.program=t.createProgram();if(t.attachShader(f,h),t.attachShader(f,p),o)for(a=0;a<o.length;++a){var d=o[a];t.bindAttribLocation(f,d[0],d[1])}t.linkProgram(f),C.linkError(t,f,e.str(n.fragId),e.str(n.vertId),r);var m=t.getProgramParameter(f,Un);i.profile&&(n.stats.uniformsCount=m);var g=n.uniforms;for(a=0;a<m;++a)if(c=t.getActiveUniform(f,a))if(c.size>1)for(var y=0;y<c.size;++y){var v=c.name.replace("[0]","["+y+"]");u(g,new s(v,e.id(v),t.getUniformLocation(f,v),c))}else u(g,new s(c.name,e.id(c.name),t.getUniformLocation(f,c.name),c));var _=t.getProgramParameter(f,Zn);i.profile&&(n.stats.attributesCount=_);var b=n.attributes;for(a=0;a<_;++a)(c=t.getActiveAttrib(f,a))&&u(b,new s(c.name,e.id(c.name),t.getAttribLocation(f,c.name),c))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return h.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);$(o).forEach(e),o={},$(a).forEach(e),a={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,c={},r.shaderCount=0},program:function(e,i,s,u){C.command(e>=0,"missing vertex shader",s),C.command(i>=0,"missing fragment shader",s);var l=c[i];l||(l=c[i]={});var p=l[e];if(p&&(p.refCount++,!u))return p;var m=new f(i,e);return r.shaderCount++,d(m,s,u),p||(l[e]=m),h.push(m),n(m,{destroy:function(){if(m.refCount--,m.refCount<=0){t.deleteProgram(m.program);var e=h.indexOf(m);h.splice(e,1),r.shaderCount--}l[m.vertId].refCount<=0&&(t.deleteShader(a[m.vertId]),delete a[m.vertId],delete c[m.fragId][m.vertId]),Object.keys(c[m.fragId]).length||(t.deleteShader(o[m.fragId]),delete o[m.fragId],delete c[m.fragId])}})},restore:function(){o={},a={};for(var t=0;t<h.length;++t)d(h[t],null,h[t].attributes.map((function(t){return[t.location,t.name]})))},shader:l,frag:-1,vert:-1}}(i,c,h,r),E=hn(i,p,_,(function(){A.procs.poll()}),y,h,r),M=function(t,e,n,r,i){var o={rgba4:fn,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(t){var e=o[t];a[e]=t}));var s=0,u={};function l(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=fn,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function c(e){var n=e.renderbuffer;C(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(pn,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete u[e.id],r.renderbufferCount--}return l.prototype.decRef=function(){--this.refCount<=0&&c(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,s){var c=new l(t.createRenderbuffer());function h(e,r){var s=0,u=0,l=fn;if("object"==typeof e&&e){var p=e;if("shape"in p){var f=p.shape;C(Array.isArray(f)&&f.length>=2,"invalid renderbuffer shape"),s=0|f[0],u=0|f[1]}else"radius"in p&&(s=u=0|p.radius),"width"in p&&(s=0|p.width),"height"in p&&(u=0|p.height);"format"in p&&(C.parameter(p.format,o,"invalid renderbuffer format"),l=o[p.format])}else"number"==typeof e?(s=0|e,u="number"==typeof r?0|r:s):e?C.raise("invalid arguments to renderbuffer constructor"):s=u=1;if(C(s>0&&u>0&&s<=n.maxRenderbufferSize&&u<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==c.width||u!==c.height||l!==c.format)return h.width=c.width=s,h.height=c.height=u,c.format=l,t.bindRenderbuffer(pn,c.renderbuffer),t.renderbufferStorage(pn,l,s,u),C(0===t.getError(),"invalid render buffer format"),i.profile&&(c.stats.size=mn(c.format,c.width,c.height)),h.format=a[c.format],h}return u[c.id]=c,r.renderbufferCount++,h(e,s),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===c.width&&a===c.height||(C(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=c.width=o,h.height=c.height=a,t.bindRenderbuffer(pn,c.renderbuffer),t.renderbufferStorage(pn,c.format,o,a),C(0===t.getError(),"invalid render buffer format"),i.profile&&(c.stats.size=mn(c.format,c.width,c.height))),h},h._reglType="renderbuffer",h._renderbuffer=c,i.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){$(u).forEach(c)},restore:function(){$(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(pn,e.renderbuffer),t.renderbufferStorage(pn,e.format,e.width,e.height)})),t.bindRenderbuffer(pn,null)}}}(i,p,_,h,r),T=function(t,e,r,i,o,a){var s={cur:null,next:null,dirty:!1,setFBO:null},u=["rgba"],l=["rgba4","rgb565","rgb5 a1"];e.ext_srgb&&l.push("srgba"),e.ext_color_buffer_half_float&&l.push("rgba16f","rgb16f"),e.webgl_color_buffer_float&&l.push("rgba32f");var c=["uint8"];function h(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function p(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function f(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);C(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;C(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function d(e,n){n&&(n.texture?t.framebufferTexture2D(gn,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(gn,e,yn,n.renderbuffer._renderbuffer.renderbuffer))}function m(t){var e=vn,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),C.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,C(e===vn)):"textureCube"===o?(n=i,C(e>=_n&&e<_n+6,"invalid cube map target")):"renderbuffer"===o?(r=i,e=yn):C.raise("invalid regl object for attachment"),new h(e,n,r)}function g(t,e,n,r,a){if(n){var s=i.create2D({width:t,height:e,format:r,type:a});return s._texture.refCount=0,new h(vn,s,null)}var u=o.create({width:t,height:e,format:r});return u._renderbuffer.refCount=0,new h(yn,null,u)}function y(t){return t&&(t.texture||t.renderbuffer)}function v(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}e.oes_texture_half_float&&c.push("half float","float16"),e.oes_texture_float&&c.push("float","float32");var _=0,b={};function x(){this.id=_++,b[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function w(t){t.colorAttachments.forEach(p),p(t.depthAttachment),p(t.stencilAttachment),p(t.depthStencilAttachment)}function S(e){var n=e.framebuffer;C(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete b[e.id]}function E(e){var n;t.bindFramebuffer(gn,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)d(bn+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(gn,bn+n,vn,null,0);t.framebufferTexture2D(gn,Sn,vn,null,0),t.framebufferTexture2D(gn,xn,vn,null,0),t.framebufferTexture2D(gn,wn,vn,null,0),d(xn,e.depthAttachment),d(wn,e.stencilAttachment),d(Sn,e.depthStencilAttachment);var o=t.checkFramebufferStatus(gn);t.isContextLost()||o===En||C.raise("framebuffer configuration not supported, status = "+In[o]),t.bindFramebuffer(gn,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function M(t,i){var o=new x;function h(t,n){var i;C(s.next!==o,"can not update framebuffer which is currently in use");var a=0,p=0,d=!0,v=!0,_=null,b=!0,x="rgba",S="uint8",M=1,T=null,A=null,O=null,P=!1;if("number"==typeof t)a=0|t,p=0|n||a;else if(t){C.type(t,"object","invalid arguments for framebuffer");var k=t;if("shape"in k){var L=k.shape;C(Array.isArray(L)&&L.length>=2,"invalid shape for framebuffer"),a=L[0],p=L[1]}else"radius"in k&&(a=p=k.radius),"width"in k&&(a=k.width),"height"in k&&(p=k.height);("color"in k||"colors"in k)&&(_=k.color||k.colors,Array.isArray(_)&&C(1===_.length||e.webgl_draw_buffers,"multiple render targets not supported")),_||("colorCount"in k&&(M=0|k.colorCount,C(M>0,"invalid color buffer count")),"colorTexture"in k&&(b=!!k.colorTexture,x="rgba4"),"colorType"in k&&(S=k.colorType,b?(C(e.oes_texture_float||!("float"===S||"float32"===S),"you must enable OES_texture_float in order to use floating point framebuffer objects"),C(e.oes_texture_half_float||!("half float"===S||"float16"===S),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===S||"float16"===S?(C(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==S&&"float32"!==S||(C(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),C.oneOf(S,c,"invalid color type")),"colorFormat"in k&&(x=k.colorFormat,u.indexOf(x)>=0?b=!0:l.indexOf(x)>=0?b=!1:C.optional((function(){b?C.oneOf(k.colorFormat,u,"invalid color format for texture"):C.oneOf(k.colorFormat,l,"invalid color format for renderbuffer")})))),("depthTexture"in k||"depthStencilTexture"in k)&&(P=!(!k.depthTexture&&!k.depthStencilTexture),C(!P||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in k&&("boolean"==typeof k.depth?d=k.depth:(T=k.depth,v=!1)),"stencil"in k&&("boolean"==typeof k.stencil?v=k.stencil:(A=k.stencil,d=!1)),"depthStencil"in k&&("boolean"==typeof k.depthStencil?d=v=k.depthStencil:(O=k.depthStencil,d=!1,v=!1))}else a=p=1;var I=null,R=null,D=null,N=null;if(Array.isArray(_))I=_.map(m);else if(_)I=[m(_)];else for(I=new Array(M),i=0;i<M;++i)I[i]=g(a,p,b,x,S);C(e.webgl_draw_buffers||I.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),C(I.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||I[0].width,p=p||I[0].height,T?R=m(T):d&&!v&&(R=g(a,p,P,"depth","uint32")),A?D=m(A):v&&!d&&(D=g(a,p,!1,"stencil","uint8")),O?N=m(O):!T&&!A&&v&&d&&(N=g(a,p,P,"depth stencil","depth stencil")),C(!!T+!!A+!!O<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var F=null;for(i=0;i<I.length;++i)if(f(I[i],a,p),C(!I[i]||I[i].texture&&Tn.indexOf(I[i].texture._texture.format)>=0||I[i].renderbuffer&&Ln.indexOf(I[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),I[i]&&I[i].texture){var z=An[I[i].texture._texture.format]*Cn[I[i].texture._texture.type];null===F?F=z:C(F===z,"all color attachments much have the same number of bits per pixel.")}return f(R,a,p),C(!R||R.texture&&R.texture._texture.format===Mn||R.renderbuffer&&R.renderbuffer._renderbuffer.format===On,"invalid depth attachment for framebuffer object"),f(D,a,p),C(!D||D.renderbuffer&&D.renderbuffer._renderbuffer.format===Pn,"invalid stencil attachment for framebuffer object"),f(N,a,p),C(!N||N.texture&&N.texture._texture.format===kn||N.renderbuffer&&N.renderbuffer._renderbuffer.format===kn,"invalid depth-stencil attachment for framebuffer object"),w(o),o.width=a,o.height=p,o.colorAttachments=I,o.depthAttachment=R,o.stencilAttachment=D,o.depthStencilAttachment=N,h.color=I.map(y),h.depth=y(R),h.stencil=y(D),h.depthStencil=y(N),h.width=o.width,h.height=o.height,E(o),h}return a.framebufferCount++,h(t,i),n(h,{resize:function(t,e){C(s.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return h;for(var i=o.colorAttachments,a=0;a<i.length;++a)v(i[a],n,r);return v(o.depthAttachment,n,r),v(o.stencilAttachment,n,r),v(o.depthStencilAttachment,n,r),o.width=h.width=n,o.height=h.height=r,E(o),h},_reglType:"framebuffer",_framebuffer:o,destroy:function(){S(o),w(o)},use:function(t){s.setFBO({framebuffer:h},t)}})}return n(s,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof x)return e}return null},create:M,createCube:function(t){var o=Array(6);function a(t){var r;C(o.indexOf(s.next)<0,"can not update framebuffer which is currently in use");var l,h={color:null},p=0,f=null,d="rgba",m="uint8",g=1;if("number"==typeof t)p=0|t;else if(t){C.type(t,"object","invalid arguments for framebuffer");var y=t;if("shape"in y){var v=y.shape;C(Array.isArray(v)&&v.length>=2,"invalid shape for framebuffer"),C(v[0]===v[1],"cube framebuffer must be square"),p=v[0]}else"radius"in y&&(p=0|y.radius),"width"in y?(p=0|y.width,"height"in y&&C(y.height===p,"must be square")):"height"in y&&(p=0|y.height);("color"in y||"colors"in y)&&(f=y.color||y.colors,Array.isArray(f)&&C(1===f.length||e.webgl_draw_buffers,"multiple render targets not supported")),f||("colorCount"in y&&(g=0|y.colorCount,C(g>0,"invalid color buffer count")),"colorType"in y&&(C.oneOf(y.colorType,c,"invalid color type"),m=y.colorType),"colorFormat"in y&&(d=y.colorFormat,C.oneOf(y.colorFormat,u,"invalid color format for texture"))),"depth"in y&&(h.depth=y.depth),"stencil"in y&&(h.stencil=y.stencil),"depthStencil"in y&&(h.depthStencil=y.depthStencil)}else p=1;if(f)if(Array.isArray(f))for(l=[],r=0;r<f.length;++r)l[r]=f[r];else l=[f];else{l=Array(g);var _={radius:p,format:d,type:m};for(r=0;r<g;++r)l[r]=i.createCube(_)}for(h.color=Array(l.length),r=0;r<l.length;++r){var b=l[r];C("function"==typeof b&&"textureCube"===b._reglType,"invalid cube map"),p=p||b.width,C(b.width===p&&b.height===p,"invalid cube map shape"),h.color[r]={target:_n,data:l[r]}}for(r=0;r<6;++r){for(var x=0;x<l.length;++x)h.color[x].target=_n+r;r>0&&(h.depth=o[0].depth,h.stencil=o[0].stencil,h.depthStencil=o[0].depthStencil),o[r]?o[r](h):o[r]=M(h)}return n(a,{width:p,height:p,color:l})}return a(t),n(a,{faces:o,resize:function(t){var e,n=0|t;if(C(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){$(b).forEach(S)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,$(b).forEach((function(e){e.framebuffer=t.createFramebuffer(),E(e)}))}})}(i,p,_,E,M,h),A=io(i,c,p,_,b,x,0,T,{},w,S,v,y,f,r),O=qn(i,T,A.procs.poll,y,o,p,_),P=A.next,k=i.canvas,L=[],I=[],F=[],z=[r.onDestroy],U=null;function Z(){if(0===L.length)return f&&f.update(),void(U=null);U=D.next(Z),kt();for(var t=L.length-1;t>=0;--t){var e=L[t];e&&e(y,null,0)}i.flush(),f&&f.update()}function V(){!U&&L.length>0&&(U=D.next(Z))}function K(){U&&(D.cancel(Z),U=null)}function J(t){t.preventDefault(),a=!0,K(),I.forEach((function(t){t()}))}function Q(t){i.getError(),a=!1,s.restore(),S.restore(),b.restore(),E.restore(),M.restore(),T.restore(),w.restore(),f&&f.restore(),A.procs.refresh(),V(),F.forEach((function(t){t()}))}var tt="undefined"!=typeof my&&!!my&&"function"==typeof my.showToast&&!0!==my.isFRM;function Tt(t){function e(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(R.isDynamic(o))r[i]=R.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(R.isDynamic(o[a]))return void(r[i]=R.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}C(!!t,"invalid args to regl({...})"),C.type(t,"object","invalid args to regl({...})");var r=e(t.context||{},!0),i=e(t.uniforms||{},!0),o=e(t.attributes||{},!1),s=e(function(t){var e=n({},t);function r(t){if(t in e){var n=e[t];delete e[t],Object.keys(n).forEach((function(r){e[t+"."+r]=n[r]}))}}return delete e.uniforms,delete e.attributes,delete e.context,delete e.vao,"stencil"in e&&e.stencil.op&&(e.stencil.opBack=e.stencil.opFront=e.stencil.op,delete e.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(e.vao=t.vao),e}(t),!1),u={gpuTime:0,cpuTime:0,count:0},l=A.compile(s,o,i,r,u),c=l.draw,h=l.batch,p=l.scope,f=[];return n((function(t,e){var n;if(a&&C.raise("context lost"),"function"==typeof t)return p.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)p.call(this,null,e,n);else{if(!Array.isArray(t))return p.call(this,t,e,0);for(n=0;n<t.length;++n)p.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return h.call(this,function(t){for(;f.length<t;)f.push(null);return f}(0|t),0|t)}else{if(!Array.isArray(t))return c.call(this,t);if(t.length)return h.call(this,t,t.length)}}),{stats:u,destroy:function(){l.destroy()}})}!tt&&k&&(k.addEventListener(ao,J,!1),k.addEventListener(so,Q,!1));var At=T.setFBO=Tt({framebuffer:R.define.call(null,1,"framebuffer")});function Ct(t,e){var n=0;A.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),C(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function Ot(t){return C.type(t,"function","regl.frame() callback must be a function"),L.push(t),V(),{cancel:function(){var e=uo(L,t);C(e>=0,"cannot cancel a frame twice"),L[e]=function t(){var e=uo(L,t);L[e]=L[L.length-1],L.length-=1,L.length<=0&&K()}}}}function Pt(){var t=P.viewport,e=P.scissor_box;t[0]=t[1]=e[0]=e[1]=0,y.viewportWidth=y.framebufferWidth=y.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,y.viewportHeight=y.framebufferHeight=y.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function kt(){y.tick+=1,y.time=It(),Pt(),A.procs.poll()}function Lt(){E.refresh(),Pt(),A.procs.refresh(),f&&f.update()}function It(){return(N()-d)/1e3}Lt();var Rt=n(Tt,{clear:function(t){if(C("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;e<6;++e)At(n({framebuffer:t.framebuffer.faces[e]},t),Ct);else At(t,Ct);else Ct(0,t)},prop:R.define.bind(null,1),context:R.define.bind(null,2),this:R.define.bind(null,3),draw:Tt({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return x.create(t,!1)},texture:E.create2D,cube:E.createCube,renderbuffer:M.create,framebuffer:T.create,framebufferCube:T.createCube,vao:w.createVAO,attributes:o,frame:Ot,on:function(t,e){var n;switch(C.type(e,"function","listener callback must be a function"),t){case"frame":return Ot(e);case"lost":n=I;break;case"restore":n=F;break;case"destroy":n=z;break;default:C.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:_,hasExtension:function(t){return _.extensions.indexOf(t.toLowerCase())>=0},read:O,destroy:function(){L.length=0,K(),!tt&&k&&(k.removeEventListener(ao,J),k.removeEventListener(so,Q)),S.clear(),T.clear(),M.clear(),w.clear(),E.clear(),x.clear(),b.clear(),f&&f.clear(),z.forEach((function(t){t()}))},_gl:i,_refresh:Lt,poll:function(){kt(),f&&f.update()},now:It,stats:h});return r.onDone(null,Rt),Rt}}(n(9946))},4466:(t,e,n)=>{var r=n(5234)(n(3250),"DataView");t.exports=r},5208:(t,e,n)=>{var r=n(4440),i=n(4108),o=n(1085),a=n(7706),s=n(8636);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},1998:(t,e,n)=>{var r=n(266),i=n(2875),o=n(5828),a=n(4115),s=n(7690);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},2887:(t,e,n)=>{var r=n(5234)(n(3250),"Map");t.exports=r},5678:(t,e,n)=>{var r=n(9016),i=n(2363),o=n(4348),a=n(3062),s=n(262);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},5747:(t,e,n)=>{var r=n(5234)(n(3250),"Promise");t.exports=r},6616:(t,e,n)=>{var r=n(5234)(n(3250),"Set");t.exports=r},9549:(t,e,n)=>{var r=n(1998),i=n(3210),o=n(8603),a=n(8947),s=n(885),u=n(8938);function l(t){var e=this.__data__=new r(t);this.size=e.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,t.exports=l},861:(t,e,n)=>{var r=n(3250).Symbol;t.exports=r},3526:(t,e,n)=>{var r=n(3250).Uint8Array;t.exports=r},8001:(t,e,n)=>{var r=n(5234)(n(3250),"WeakMap");t.exports=r},2274:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},4004:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},2493:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},5825:(t,e,n)=>{var r=n(8509),i=n(9312),o=n(5589),a=n(5778),s=n(5023),u=n(922),l=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),c=!n&&i(t),h=!n&&!c&&a(t),p=!n&&!c&&!h&&u(t),f=n||c||h||p,d=f?r(t.length,String):[],m=d.length;for(var g in t)!e&&!l.call(t,g)||f&&("length"==g||h&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,m))||d.push(g);return d}},111:t=>{t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},3532:(t,e,n)=>{var r=n(7500),i=n(8260);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},5376:(t,e,n)=>{var r=n(7500),i=n(8260),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8498:(t,e,n)=>{var r=n(8260);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},4265:(t,e,n)=>{var r=n(8618),i=n(2096);t.exports=function(t,e){return t&&r(e,i(e),t)}},1629:(t,e,n)=>{var r=n(8618),i=n(9882);t.exports=function(t,e){return t&&r(e,i(e),t)}},7500:(t,e,n)=>{var r=n(5595);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},8361:(t,e,n)=>{var r=n(9549),i=n(4004),o=n(5376),a=n(4265),s=n(1629),u=n(6502),l=n(2166),c=n(7272),h=n(2066),p=n(4357),f=n(5713),d=n(7493),m=n(2865),g=n(1908),y=n(4046),v=n(5589),_=n(5778),b=n(7613),x=n(3702),w=n(693),S=n(2096),E=n(9882),M="[object Arguments]",T="[object Function]",A="[object Object]",C={};C[M]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[A]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[T]=C["[object WeakMap]"]=!1,t.exports=function t(e,n,O,P,k,L){var I,R=1&n,D=2&n,N=4&n;if(O&&(I=k?O(e,P,k,L):O(e)),void 0!==I)return I;if(!x(e))return e;var F=v(e);if(F){if(I=m(e),!R)return l(e,I)}else{var z=d(e),B=z==T||"[object GeneratorFunction]"==z;if(_(e))return u(e,R);if(z==A||z==M||B&&!k){if(I=D||B?{}:y(e),!R)return D?h(e,s(I,e)):c(e,a(I,e))}else{if(!C[z])return k?e:{};I=g(e,z,R)}}L||(L=new r);var j=L.get(e);if(j)return j;L.set(e,I),w(e)?e.forEach((function(r){I.add(t(r,n,O,r,e,L))})):b(e)&&e.forEach((function(r,i){I.set(i,t(r,n,O,i,e,L))}));var U=F?void 0:(N?D?f:p:D?E:S)(e);return i(U||e,(function(r,i){U&&(r=e[i=r]),o(I,i,t(r,n,O,i,e,L))})),I}},7890:(t,e,n)=>{var r=n(3702),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},2825:(t,e,n)=>{var r=n(111),i=n(7123);t.exports=function t(e,n,o,a,s){var u=-1,l=e.length;for(o||(o=i),s||(s=[]);++u<l;){var c=e[u];n>0&&o(c)?n>1?t(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},9943:(t,e,n)=>{var r=n(2545)();t.exports=r},4468:(t,e,n)=>{var r=n(111),i=n(5589);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},9823:(t,e,n)=>{var r=n(861),i=n(1339),o=n(5151),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},3016:(t,e,n)=>{var r=n(9823),i=n(440);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},2275:(t,e,n)=>{var r=n(7493),i=n(440);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},9817:(t,e,n)=>{var r=n(5563),i=n(8597),o=n(3702),a=n(5784),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,h=l.hasOwnProperty,p=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?p:s).test(a(t))}},7170:(t,e,n)=>{var r=n(7493),i=n(440);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},2448:(t,e,n)=>{var r=n(9823),i=n(6052),o=n(440),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},1351:(t,e,n)=>{var r=n(2840),i=n(8559),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},1309:(t,e,n)=>{var r=n(3702),i=n(2840),o=n(4866),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&n.push(s);return n}},2133:(t,e,n)=>{var r=n(9549),i=n(3532),o=n(9943),a=n(1241),s=n(3702),u=n(9882),l=n(1933);t.exports=function t(e,n,c,h,p){e!==n&&o(n,(function(o,u){if(p||(p=new r),s(o))a(e,n,u,c,t,h,p);else{var f=h?h(l(e,u),o,u+"",e,n,p):void 0;void 0===f&&(f=o),i(e,u,f)}}),u)}},1241:(t,e,n)=>{var r=n(3532),i=n(6502),o=n(1327),a=n(2166),s=n(4046),u=n(9312),l=n(5589),c=n(8268),h=n(5778),p=n(5563),f=n(3702),d=n(4256),m=n(922),g=n(1933),y=n(6222);t.exports=function(t,e,n,v,_,b,x){var w=g(t,n),S=g(e,n),E=x.get(S);if(E)r(t,n,E);else{var M=b?b(w,S,n+"",t,e,x):void 0,T=void 0===M;if(T){var A=l(S),C=!A&&h(S),O=!A&&!C&&m(S);M=S,A||C||O?l(w)?M=w:c(w)?M=a(w):C?(T=!1,M=i(S,!0)):O?(T=!1,M=o(S,!0)):M=[]:d(S)||u(S)?(M=w,u(w)?M=y(w):f(w)&&!p(w)||(M=s(S))):T=!1}T&&(x.set(S,M),_(M,S,v,b,x),x.delete(S)),r(t,n,M)}}},9735:(t,e,n)=>{var r=n(229),i=n(340),o=n(4173);t.exports=function(t,e){return o(i(t,e,r),t+"")}},6739:(t,e,n)=>{var r=n(9203),i=n(5595),o=n(229),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=a},8509:t=>{t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},1656:(t,e,n)=>{var r=n(2438),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},1525:t=>{t.exports=function(t){return function(e){return t(e)}}},2962:(t,e,n)=>{var r=n(3526);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},6502:(t,e,n)=>{t=n.nmd(t);var r=n(3250),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=s?s(n):new t.constructor(n);return t.copy(r),r}},7037:(t,e,n)=>{var r=n(2962);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},3429:t=>{var e=/\w*$/;t.exports=function(t){var n=new t.constructor(t.source,e.exec(t));return n.lastIndex=t.lastIndex,n}},4539:(t,e,n)=>{var r=n(861),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},1327:(t,e,n)=>{var r=n(2962);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},2166:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},8618:(t,e,n)=>{var r=n(5376),i=n(7500);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var s=-1,u=e.length;++s<u;){var l=e[s],c=o?o(n[l],t[l],l,n,t):void 0;void 0===c&&(c=t[l]),a?i(n,l,c):r(n,l,c)}return n}},7272:(t,e,n)=>{var r=n(8618),i=n(4450);t.exports=function(t,e){return r(t,i(t),e)}},2066:(t,e,n)=>{var r=n(8618),i=n(4969);t.exports=function(t,e){return r(t,i(t),e)}},1622:(t,e,n)=>{var r=n(3250)["__core-js_shared__"];t.exports=r},6948:(t,e,n)=>{var r=n(9735),i=n(8132);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}},2545:t=>{t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}},5595:(t,e,n)=>{var r=n(5234),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},302:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},4357:(t,e,n)=>{var r=n(4468),i=n(4450),o=n(2096);t.exports=function(t){return r(t,o,i)}},5713:(t,e,n)=>{var r=n(4468),i=n(4969),o=n(9882);t.exports=function(t){return r(t,o,i)}},7570:(t,e,n)=>{var r=n(8949);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},5234:(t,e,n)=>{var r=n(9817),i=n(7736);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},8490:(t,e,n)=>{var r=n(3540)(Object.getPrototypeOf,Object);t.exports=r},1339:(t,e,n)=>{var r=n(861),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},4450:(t,e,n)=>{var r=n(2493),i=n(4506),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},4969:(t,e,n)=>{var r=n(111),i=n(8490),o=n(4450),a=n(4506),s=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=s},7493:(t,e,n)=>{var r=n(4466),i=n(2887),o=n(5747),a=n(6616),s=n(8001),u=n(9823),l=n(5784),c="[object Map]",h="[object Promise]",p="[object Set]",f="[object WeakMap]",d="[object DataView]",m=l(r),g=l(i),y=l(o),v=l(a),_=l(s),b=u;(r&&b(new r(new ArrayBuffer(1)))!=d||i&&b(new i)!=c||o&&b(o.resolve())!=h||a&&b(new a)!=p||s&&b(new s)!=f)&&(b=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?l(n):"";if(r)switch(r){case m:return d;case g:return c;case y:return h;case v:return p;case _:return f}return e}),t.exports=b},7736:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},4440:(t,e,n)=>{var r=n(4545);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},4108:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},1085:(t,e,n)=>{var r=n(4545),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},7706:(t,e,n)=>{var r=n(4545),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},8636:(t,e,n)=>{var r=n(4545);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},2865:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t){var n=t.length,r=new t.constructor(n);return n&&"string"==typeof t[0]&&e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},1908:(t,e,n)=>{var r=n(2962),i=n(7037),o=n(3429),a=n(4539),s=n(1327);t.exports=function(t,e,n){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(t,n);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return o(t);case"[object Symbol]":return a(t)}}},4046:(t,e,n)=>{var r=n(7890),i=n(8490),o=n(2840);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},7123:(t,e,n)=>{var r=n(861),i=n(9312),o=n(5589),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},5023:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},8132:(t,e,n)=>{var r=n(8260),i=n(568),o=n(5023),a=n(3702);t.exports=function(t,e,n){if(!a(n))return!1;var s=typeof e;return!!("number"==s?i(n)&&o(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},8949:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},8597:(t,e,n)=>{var r,i=n(1622),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},2840:t=>{var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},266:t=>{t.exports=function(){this.__data__=[],this.size=0}},2875:(t,e,n)=>{var r=n(8498),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},5828:(t,e,n)=>{var r=n(8498);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},4115:(t,e,n)=>{var r=n(8498);t.exports=function(t){return r(this.__data__,t)>-1}},7690:(t,e,n)=>{var r=n(8498);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},9016:(t,e,n)=>{var r=n(5208),i=n(1998),o=n(2887);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},2363:(t,e,n)=>{var r=n(7570);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},4348:(t,e,n)=>{var r=n(7570);t.exports=function(t){return r(this,t).get(t)}},3062:(t,e,n)=>{var r=n(7570);t.exports=function(t){return r(this,t).has(t)}},262:(t,e,n)=>{var r=n(7570);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},4545:(t,e,n)=>{var r=n(5234)(Object,"create");t.exports=r},8559:(t,e,n)=>{var r=n(3540)(Object.keys,Object);t.exports=r},4866:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},8690:(t,e,n)=>{t=n.nmd(t);var r=n(302),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},5151:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},3540:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},340:(t,e,n)=>{var r=n(2274),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),u=Array(s);++a<s;)u[a]=o[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=o[a];return l[e]=n(u),r(t,this,l)}}},3250:(t,e,n)=>{var r=n(302),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},1933:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},4173:(t,e,n)=>{var r=n(6739),i=n(7357)(r);t.exports=i},7357:t=>{var e=Date.now;t.exports=function(t){var n=0,r=0;return function(){var i=e(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},3210:(t,e,n)=>{var r=n(1998);t.exports=function(){this.__data__=new r,this.size=0}},8603:t=>{t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},8947:t=>{t.exports=function(t){return this.__data__.get(t)}},885:t=>{t.exports=function(t){return this.__data__.has(t)}},8938:(t,e,n)=>{var r=n(1998),i=n(2887),o=n(5678);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},5784:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},2438:t=>{var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},7179:(t,e,n)=>{var r=n(8361);t.exports=function(t){return r(t,5)}},9203:t=>{t.exports=function(t){return function(){return t}}},7837:(t,e,n)=>{var r=n(3702),i=n(231),o=n(9153),a=Math.max,s=Math.min;t.exports=function(t,e,n){var u,l,c,h,p,f,d=0,m=!1,g=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var n=u,r=l;return u=l=void 0,d=e,h=t.apply(r,n)}function _(t){var n=t-f;return void 0===f||n>=e||n<0||g&&t-d>=c}function b(){var t=i();if(_(t))return x(t);p=setTimeout(b,function(t){var n=e-(t-f);return g?s(n,c-(t-d)):n}(t))}function x(t){return p=void 0,y&&u?v(t):(u=l=void 0,h)}function w(){var t=i(),n=_(t);if(u=arguments,l=this,f=t,n){if(void 0===p)return function(t){return d=t,p=setTimeout(b,e),m?v(t):h}(f);if(g)return clearTimeout(p),p=setTimeout(b,e),v(f)}return void 0===p&&(p=setTimeout(b,e)),h}return e=o(e)||0,r(n)&&(m=!!n.leading,c=(g="maxWait"in n)?a(o(n.maxWait)||0,e):c,y="trailing"in n?!!n.trailing:y),w.cancel=function(){void 0!==p&&clearTimeout(p),d=0,u=f=l=p=void 0},w.flush=function(){return void 0===p?h:x(i())},w}},8260:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},2923:(t,e,n)=>{var r=n(2825);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},229:t=>{t.exports=function(t){return t}},9312:(t,e,n)=>{var r=n(3016),i=n(440),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},5589:t=>{var e=Array.isArray;t.exports=e},568:(t,e,n)=>{var r=n(5563),i=n(6052);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},8268:(t,e,n)=>{var r=n(568),i=n(440);t.exports=function(t){return i(t)&&r(t)}},5778:(t,e,n)=>{t=n.nmd(t);var r=n(3250),i=n(7999),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},5563:(t,e,n)=>{var r=n(9823),i=n(3702);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},6052:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7613:(t,e,n)=>{var r=n(2275),i=n(1525),o=n(8690),a=o&&o.isMap,s=a?i(a):r;t.exports=s},3702:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},440:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},4256:(t,e,n)=>{var r=n(9823),i=n(8490),o=n(440),a=Function.prototype,s=Object.prototype,u=a.toString,l=s.hasOwnProperty,c=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==c}},693:(t,e,n)=>{var r=n(7170),i=n(1525),o=n(8690),a=o&&o.isSet,s=a?i(a):r;t.exports=s},8326:(t,e,n)=>{var r=n(9823),i=n(440);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},922:(t,e,n)=>{var r=n(2448),i=n(1525),o=n(8690),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},2096:(t,e,n)=>{var r=n(5825),i=n(1351),o=n(568);t.exports=function(t){return o(t)?r(t):i(t)}},9882:(t,e,n)=>{var r=n(5825),i=n(1309),o=n(568);t.exports=function(t){return o(t)?r(t,!0):i(t)}},8469:(t,e,n)=>{var r=n(2133),i=n(6948)((function(t,e,n){r(t,e,n)}));t.exports=i},231:(t,e,n)=>{var r=n(3250);t.exports=function(){return r.Date.now()}},4506:t=>{t.exports=function(){return[]}},7999:t=>{t.exports=function(){return!1}},4633:(t,e,n)=>{var r=n(7837),i=n(3702);t.exports=function(t,e,n){var o=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:o,maxWait:e,trailing:a})}},9153:(t,e,n)=>{var r=n(1656),i=n(3702),o=n(8326),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?l(t.slice(2),n?2:8):a.test(t)?NaN:+t}},6222:(t,e,n)=>{var r=n(8618),i=n(9882);t.exports=function(t){return r(t,i(t))}},2946:function(t){t.exports=function(){"use strict";var t,e,n;function r(r,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),n=i(a),"undefined"!=typeof window&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=i;else t=i}return r(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=r;function r(t,e,n,r){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=n,this.p2y=r}r.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},r.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},r.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},r.prototype.solveCurveX=function(t,e){var n,r,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=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,n=t.y-this.y;return e*e+n*n},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),n=Math.sin(t),r=n*this.x+e*this.y;return this.x=e*this.x-n*this.y,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=e.x+n*(this.x-e.x)-r*(this.y-e.y),this.y=i,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 a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,n){return Math.min(n,Math.max(e,t))}function h(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i}function p(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r<i.length;r+=1){var o=i[r];for(var a in o)t[a]=o[a]}return t}var f=1;function d(){return f++}function m(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function g(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 y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function v(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,n){var r={};for(var i in t)r[i]=e.call(n||this,t[i],i,t);return r}function b(t,e,n){var r={};for(var i in t)e.call(n||this,t[i],i,t)&&(r[i]=t[i]);return r}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?_(t,x):t}var w={};function S(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function E(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function M(t){for(var e=0,n=0,r=t.length,i=r-1,o=void 0,a=void 0;n<r;i=n++)e+=((a=t[i]).x-(o=t[n]).x)*(o.y+a.y);return e}function T(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function A(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,n,r,i){var o=r||i;return e[n]=!o||o.toLowerCase(),""})),e["max-age"]){var n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e}var C=null;function O(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 P(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var k,L,I,R,D=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),N=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,F=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,z={now:D,frame:function(t){var e=N(t);return{cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var n=a.document.createElement("canvas"),r=n.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return n.width=t.width,n.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return k||(k=a.document.createElement("a")),k.href=t,k.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==L&&(L=a.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},B={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},j={supported:!1,testSupport:function(t){!U&&R&&(Z?V(t):I=t)}},U=!1,Z=!1;function V(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,R),t.isContextLost())return;j.supported=!0}catch(t){}t.deleteTexture(e),U=!0}a.document&&((R=a.document.createElement("img")).onload=function(){I&&V(I),I=null,Z=!0},R.onerror=function(){U=!0,I=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",H=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function W(t){return 0===t.indexOf("mapbox:")}H.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},H.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},H.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},H.prototype.normalizeStyleURL=function(t,e){if(!W(t))return t;var n=$(t);return n.path="/styles/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeGlyphsURL=function(t,e){if(!W(t))return t;var n=$(t);return n.path="/fonts/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeSourceURL=function(t,e){if(!W(t))return t;var n=$(t);return n.path="/v4/"+n.authority+".json",n.params.push("secure"),this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeSpriteURL=function(t,e,n,r){var i=$(t);return W(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+n,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=""+e+n,K(i))},H.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!W(t))return t;var n=$(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,(z.devicePixelRatio>=2||512===e?"@2x":"")+(j.supported?".webp":"$1")),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path;var r=this._customAccessToken||function(t){for(var e=0,n=t;e<n.length;e+=1){var r=n[e].match(/^access_token=(.*)$/);if(r)return r[1]}return null}(n.params)||B.ACCESS_TOKEN;return B.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,r)},H.prototype.canonicalizeTileURL=function(t,e){var n=$(t);if(!n.path.match(/(^\/v4\/)/)||!n.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=n.path.replace("/v4/","");var i=n.params;return e&&(i=i.filter((function(t){return!t.match(/^access_token=/)}))),i.length&&(r+="?"+i.join("&")),r},H.prototype.canonicalizeTileset=function(t,e){for(var n=!!e&&W(e),r=[],i=0,o=t.tiles||[];i<o.length;i+=1){var a=o[i];Y(a)?r.push(this.canonicalizeTileURL(a,n)):r.push(a)}return r},H.prototype._makeAPIURL=function(t,e){var n="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",r=$(B.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){var i=t.params.indexOf("secure");i>=0&&t.params.splice(i,1)}if("/"!==r.path&&(t.path=""+r.path+t.path),!B.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||B.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+n);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+n);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),K(t)};var q=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Y(t){return q.test(t)}var X=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function $(t){var e=t.match(X);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function J(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var Q=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Q.prototype.getStorageKey=function(t){var e,n=J(B.ACCESS_TOKEN);return e=n&&n.u?a.btoa(encodeURIComponent(n.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):B.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},Q.prototype.fetchEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{var r=a.localStorage.getItem(e);r&&(this.eventData=JSON.parse(r));var i=a.localStorage.getItem(n);i&&(this.anonId=i)}catch(t){S("Unable to read from LocalStorage")}},Q.prototype.saveEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){S("Unable to write to LocalStorage")}},Q.prototype.processRequests=function(t){},Q.prototype.postEvent=function(t,e,n,r){var i=this;if(B.EVENTS_URL){var o=$(B.EVENTS_URL);o.params.push("access_token="+(r||B.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:G,userId:this.anonId},s=e?p(a,e):a,u={url:K(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=xt(u,(function(t){i.pendingRequest=null,n(t),i.saveEventData(),i.processRequests(r)}))}},Q.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,nt=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)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,n,r){this.skuToken=n;var i=!(!r&&!B.ACCESS_TOKEN),o=Array.isArray(t)&&t.some((function(t){return W(t)||Y(t)}));B.EVENTS_URL&&i&&o&&this.queueRequest({id:e,timestamp:Date.now()},r)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var n=this.queue.shift(),r=n.id,i=n.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),g(this.anonId)||(this.anonId=m()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||r&&(e.success[r]=!0)}),t))}},e}(Q),rt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){B.EVENTS_URL&&B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||Y(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 n=J(B.ACCESS_TOKEN),r=n?n.u:B.ACCESS_TOKEN,i=r!==this.eventData.tokenU;g(this.anonId)||(this.anonId=m(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=r)}),t)}},e}(Q)),it=rt.postTurnstileEvent.bind(rt),ot=new nt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function lt(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,pt=1/0;function ft(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var mt,gt,yt=function(t){function e(e,n,r){401===n&&Y(r)&&(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=n,this.url=r,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),vt=T()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},_t=function(t,e){if(!(/^file:/.test(n=t.url)||/^file:/.test(vt())&&!/^\w+:/.test(n))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var n,r=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:vt(),signal:r.signal}),o=!1,s=!1,u=(n=i.url).indexOf("sku=")>0&&Y(n);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(n,r,o){if(!s){if(n&&"SecurityError"!==n.message&&S(n),r&&o)return c(r);var l=Date.now();a.fetch(i).then((function(n){if(n.ok){var r=u?n.clone():null;return c(n,r,l)}return e(new yt(n.statusText,n.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(n,r,u){("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((function(t){s||(r&&u&&function(t,e,n){if(lt(),tt){var r={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return r.headers.set(e,t)}));var i=A(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&r.headers.set("Expires",new Date(n+1e3*i["max-age"]).toUTCString()),new Date(r.headers.get("Expires")).getTime()-n<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var n=new a.Response(e,r);lt(),tt&&tt.then((function(e){return e.put(ct(t.url),n)})).catch((function(t){return S(t.message)}))})))}}(i,r,u),o=!0,e(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(lt(),!tt)return e(null);var n=ct(t.url);tt.then((function(t){t.match(n).then((function(r){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),n=A(t.headers.get("Cache-Control")||"");return e>Date.now()&&!n["no-cache"]}(r);t.delete(n),i&&t.put(n,r.clone()),e(null,r,i)})).catch(e)})).catch(e)}(i,l):l(null,null),{cancel:function(){s=!0,o||r.abort()}}}(t,e);if(T()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var n;return function(t,e){var n=new a.XMLHttpRequest;for(var r in n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer"),t.headers)n.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var r=n.response;if("json"===t.type)try{r=JSON.parse(n.response)}catch(t){return e(t)}e(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else e(new yt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:function(){return n.abort()}}}(t,e)},bt=function(t,e){return _t(p(t,{type:"arrayBuffer"}),e)},xt=function(t,e){return _t(p(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";mt=[],gt=0;var St=function(t,e){if(j.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=B.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return mt.push(n),n}gt++;var r=!1,i=function(){if(!r)for(r=!0,gt--;mt.length&><B.MAX_PARALLEL_IMAGE_REQUESTS;){var t=mt.shift();t.cancelled||(t.cancel=St(t.requestParameters,t.callback).cancel)}},o=bt(t,(function(t,n,r,o){i(),t?e(t):n&&(ft()?function(t,e){var n=new a.Blob([new Uint8Array(t)],{type:"image/png"});a.createImageBitmap(n).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."))}))}(n,e):function(t,e,n,r){var i=new a.Image,o=a.URL;i.onload=function(){e(null,i),o.revokeObjectURL(i.src),i.onload=null,a.requestAnimationFrame((function(){i.src=wt}))},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 s=new a.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=n,i.expires=r,i.src=t.byteLength?o.createObjectURL(s):wt}(n,e,r,o))}));return{cancel:function(){o.cancel(),i()}}};function Et(t,e,n){n[t]&&-1!==n[t].indexOf(e)||(n[t]=n[t]||[],n[t].push(e))}function Mt(t,e,n){if(n&&n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}var Tt=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},At=function(t){function e(e,n){void 0===n&&(n={}),t.call(this,"error",p({error:e},n))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Tt),Ct=function(){};Ct.prototype.on=function(t,e){return this._listeners=this._listeners||{},Et(t,e,this._listeners),this},Ct.prototype.off=function(t,e){return Mt(t,e,this._listeners),Mt(t,e,this._oneTimeListeners),this},Ct.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Et(t,e,this._oneTimeListeners),this},Ct.prototype.fire=function(t,e){"string"==typeof t&&(t=new Tt(t,e||{}));var n=t.type;if(this.listens(n)){t.target=this;for(var r=0,i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];r<i.length;r+=1)i[r].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];o<a.length;o+=1){var s=a[o];Mt(n,s,this._oneTimeListeners),s.call(this,t)}var u=this._eventedParent;u&&(p(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t))}else t instanceof At&&console.error(t.error);return this},Ct.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)},Ct.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"}}},Pt=function(t,e,n,r){this.message=(t?t+": ":"")+n,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function kt(t){var e=t.value;return e?[new Pt(t.key,e,"constants have been deprecated as of v8")]:[]}function Lt(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r<i.length;r+=1){var o=i[r];for(var a in o)t[a]=o[a]}return t}function It(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Rt(t){if(Array.isArray(t))return t.map(Rt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var n in t)e[n]=Rt(t[n]);return e}return It(t)}var Dt=function(t){function e(e,n){t.call(this,n),this.message=n,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Nt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var n=0,r=e;n<r.length;n+=1){var i=r[n];this.bindings[i[0]]=i[1]}};Nt.prototype.concat=function(t){return new Nt(this,t)},Nt.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.")},Nt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Ft={kind:"null"},zt={kind:"number"},Bt={kind:"string"},jt={kind:"boolean"},Ut={kind:"color"},Zt={kind:"object"},Vt={kind:"value"},Gt={kind:"collator"},Ht={kind:"formatted"},Wt={kind:"resolvedImage"};function qt(t,e){return{kind:"array",itemType:t,N:e}}function Yt(t){if("array"===t.kind){var e=Yt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Xt=[Ft,zt,Bt,jt,Ut,Ht,Zt,qt(Vt),Wt];function $t(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!$t(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 n=0,r=Xt;n<r.length;n+=1)if(!$t(r[n],e))return null}return"Expected "+Yt(t)+" but found "+Yt(e)+" instead."}function Kt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Jt(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 Qt=e((function(t,e){var n={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 r(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in n)return n[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.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===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),h=s.substr(u+1,l-(u+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(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[r(255*a(y,g,f+1/3)),r(255*a(y,g,f)),r(255*a(y,g,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,n,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=n,this.a=r};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=Qt(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[1],n=t[2],r=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(n)+","+r+")"},te.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ne=function(t,e,n,r,i){this.text=t,this.image=e,this.scale=n,this.fontStack=r,this.textColor=i},re=function(t){this.sections=t};re.fromString=function(t){return new re([new ne(t,null,null,null,null)])},re.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}))},re.factory=function(t){return t instanceof re?t:re.fromString(t)},re.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},re.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var r=n[e];if(r.image)t.push(["image",r.image.name]);else{t.push(r.text);var i={};r.fontStack&&(i["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(i["font-scale"]=r.scale),r.textColor&&(i["text-color"]=["rgba"].concat(r.textColor.toArray())),t.push(i)}}return t};var ie=function(t){this.name=t.name,this.available=t.available};function oe(t,e,n,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,n,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ae(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 te)return!0;if(t instanceof ee)return!0;if(t instanceof re)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,n=t;e<n.length;e+=1)if(!ae(n[e]))return!1;return!0}if("object"==typeof t){for(var r in t)if(!ae(t[r]))return!1;return!0}return!1}function se(t){if(null===t)return Ft;if("string"==typeof t)return Bt;if("boolean"==typeof t)return jt;if("number"==typeof t)return zt;if(t instanceof te)return Ut;if(t instanceof ee)return Gt;if(t instanceof re)return Ht;if(t instanceof ie)return Wt;if(Array.isArray(t)){for(var e,n=t.length,r=0,i=t;r<i.length;r+=1){var o=se(i[r]);if(e){if(e===o)continue;e=Vt;break}e=o}return qt(e||Vt,n)}return Zt}function ue(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof te||t instanceof re||t instanceof ie?t.toString():JSON.stringify(t)}ie.prototype.toString=function(){return this.name},ie.fromString=function(t){return t?new ie({name:t,available:!1}):null},ie.prototype.serialize=function(){return["image",this.name]};var le=function(t,e){this.type=t,this.value=e};le.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ae(t[1]))return e.error("invalid value");var n=t[1],r=se(n),i=e.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new le(r,n)},le.prototype.evaluate=function(){return this.value},le.prototype.eachChild=function(){},le.prototype.outputDefined=function(){return!0},le.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof te?["rgba"].concat(this.value.toArray()):this.value instanceof re?this.value.serialize():this.value};var ce=function(t){this.name="ExpressionEvaluationError",this.message=t};ce.prototype.toJSON=function(){return this.message};var he={string:Bt,number:zt,boolean:jt,object:Zt},pe=function(t,e){this.type=t,this.args=e};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n,r=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],r++}else o=Vt;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],r++}n=qt(o,a)}else n=he[i];for(var u=[];r<t.length;r++){var l=e.parse(t[r],r,Vt);if(!l)return null;u.push(l)}return new pe(n,u)},pe.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var n=this.args[e].evaluate(t);if(!$t(this.type,se(n)))return n;if(e===this.args.length-1)throw new ce("Expected value to be of type "+Yt(this.type)+", but found "+Yt(se(n))+" instead.")}return null},pe.prototype.eachChild=function(t){this.args.forEach(t)},pe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},pe.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);var r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Ht,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");for(var r=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,zt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,qt(Bt))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Ut)))return null;var c=r[r.length-1];c.scale=s,c.font=u,c.textColor=l}else{var h=e.parse(t[o],1,Vt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:h,scale:null,font:null,textColor:null})}}return new fe(r)},fe.prototype.evaluate=function(t){return new re(this.sections.map((function(e){var n=e.content.evaluate(t);return se(n)===Wt?new ne("",n,null,null,null):new ne(ue(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,n=this.sections;e<n.length;e+=1){var r=n[e];t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var r=n[e];t.push(r.content.serialize());var i={};r.scale&&(i["font-scale"]=r.scale.serialize()),r.font&&(i["text-font"]=r.font.serialize()),r.textColor&&(i["text-color"]=r.textColor.serialize()),t.push(i)}return t};var de=function(t){this.type=Wt,this.input=t};de.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,Bt);return n?new de(n):e.error("No image name provided.")},de.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=ie.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var me={"to-boolean":jt,"to-color":Ut,"to-number":zt,"to-string":Bt},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");for(var r=me[n],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Vt);if(!a)return null;i.push(a)}return new ge(r,i)},ge.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,n,r=0,i=this.args;r<i.length;r+=1){if(n=null,(e=i[r].evaluate(t))instanceof te)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(n=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(n||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new ce("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?re.fromString(ue(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ie.fromString(ue(this.args[0].evaluate(t))):ue(this.args[0].evaluate(t))},ge.prototype.eachChild=function(t){this.args.forEach(t)},ge.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ge.prototype.serialize=function(){if("formatted"===this.type.kind)return new fe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new de(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var ye=["Unknown","Point","LineString","Polygon"],ve=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ve.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ve.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ye[this.feature.type]:this.feature.type:null},ve.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ve.prototype.canonicalID=function(){return this.canonical},ve.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ve.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=te.parse(t)),e};var _e=function(t,e,n,r){this.name=t,this.type=e,this._evaluate=n,this.args=r};_e.prototype.evaluate=function(t){return this._evaluate(t,this.args)},_e.prototype.eachChild=function(t){this.args.forEach(t)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},_e.parse=function(t,e){var n,r=t[0],i=_e.definitions[r];if(!i)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var n=e[0];return!Array.isArray(n)||n.length===t.length-1})),u=null,l=0,c=s;l<c.length;l+=1){var h=c[l],p=h[0],f=h[1];u=new Ue(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(p)?p[g-1]:p.type,_=u.parse(y,1+d.length,v);if(!_){m=!0;break}d.push(_)}if(!m)if(Array.isArray(p)&&p.length!==d.length)u.error("Expected "+p.length+" arguments, but found "+d.length+" instead.");else{for(var b=0;b<d.length;b++){var x=Array.isArray(p)?p[b]:p.type,w=d[b];u.concat(b+1).checkSubtype(x,w.type)}if(0===u.errors.length)return new _e(r,o,f,d)}}if(1===s.length)(n=e.errors).push.apply(n,u.errors);else{for(var S=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Yt).join(", ")+")":"("+Yt(e.type)+"...)"})).join(" | "),E=[],M=1;M<t.length;M++){var T=e.parse(t[M],1+E.length);if(!T)return null;E.push(Yt(T.type))}e.error("Expected arguments of type "+S+", but found ("+E.join(", ")+") instead.")}return null},_e.register=function(t,e){for(var n in _e.definitions=e,e)t[n]=_e};var be=function(t,e,n){this.type=Gt,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e};function xe(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 we(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Se(t,e){var n=(180+t[0])/360,r=(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(n*i*8192),Math.round(r*i*8192)]}function Ee(t,e,n){return e[1]>t[1]!=n[1]>t[1]&&t[0]<(n[0]-e[0])*(t[1]-e[1])/(n[1]-e[1])+e[0]}function Me(t,e){for(var n,r,i,o,a,s,u,l=!1,c=0,h=e.length;c<h;c++)for(var p=e[c],f=0,d=p.length;f<d-1;f++){if((o=(n=t)[0]-(r=p[f])[0])*(u=n[1]-(i=p[f+1])[1])-(s=n[0]-i[0])*(a=n[1]-r[1])==0&&o*s<=0&&a*u<=0)return!1;Ee(t,p[f],p[f+1])&&(l=!l)}return l}function Te(t,e){for(var n=0;n<e.length;n++)if(Me(t,e[n]))return!0;return!1}function Ae(t,e,n,r){var i=r[0]-n[0],o=r[1]-n[1],a=(t[0]-n[0])*o-i*(t[1]-n[1]),s=(e[0]-n[0])*o-i*(e[1]-n[1]);return a>0&&s<0||a<0&&s>0}function Ce(t,e,n){for(var r=0,i=n;r<i.length;r+=1)for(var o=i[r],a=0;a<o.length-1;++a)if(0!=(h=[(c=o[a+1])[0]-(l=o[a])[0],c[1]-l[1]])[0]*(p=[(u=e)[0]-(s=t)[0],u[1]-s[1]])[1]-h[1]*p[0]&&Ae(s,u,l,c)&&Ae(l,c,s,u))return!0;var s,u,l,c,h,p;return!1}function Oe(t,e){for(var n=0;n<t.length;++n)if(!Me(t[n],e))return!1;for(var r=0;r<t.length-1;++r)if(Ce(t[r],t[r+1],e))return!1;return!0}function Pe(t,e){for(var n=0;n<e.length;n++)if(Oe(t,e[n]))return!0;return!1}function ke(t,e,n){for(var r=[],i=0;i<t.length;i++){for(var o=[],a=0;a<t[i].length;a++){var s=Se(t[i][a],n);xe(e,s),o.push(s)}r.push(o)}return r}function Le(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=ke(t[i],e,n);r.push(o)}return r}function Ie(t,e,n,r){if(t[0]<n[0]||t[0]>n[2]){var i=.5*r,o=t[0]-n[0]>i?-r:n[0]-t[0]>i?r:0;0===o&&(o=t[0]-n[2]>i?-r:n[2]-t[0]>i?r:0),t[0]+=o}xe(e,t)}function Re(t,e,n,r){for(var i=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[],s=0,u=t;s<u.length;s+=1)for(var l=0,c=u[s];l<c.length;l+=1){var h=c[l],p=[h.x+o[0],h.y+o[1]];Ie(p,e,n,i),a.push(p)}return a}function De(t,e,n,r){for(var i,o=8192*Math.pow(2,r.z),a=[8192*r.x,8192*r.y],s=[],u=0,l=t;u<l.length;u+=1){for(var c=[],h=0,p=l[u];h<p.length;h+=1){var f=p[h],d=[f.x+a[0],f.y+a[1]];xe(e,d),c.push(d)}s.push(c)}if(e[2]-e[0]<=o/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var m=0,g=s;m<g.length;m+=1)for(var y=0,v=g[m];y<v.length;y+=1)Ie(v[y],e,n,o)}return s}be.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");var r=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,jt);if(!r)return null;var i=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,jt);if(!i)return null;var o=null;return n.locale&&!(o=e.parse(n.locale,1,Bt))?null:new be(r,i,o)},be.prototype.evaluate=function(t){return new ee(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},be.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},be.prototype.outputDefined=function(){return!1},be.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 Ne=function(t,e){this.type=jt,this.geojson=t,this.geometries=e};function Fe(t){if(t instanceof _e){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 Ne)return!1;var e=!0;return t.eachChild((function(t){e&&!Fe(t)&&(e=!1)})),e}function ze(t){if(t instanceof _e&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!ze(t)&&(e=!1)})),e}function Be(t,e){if(t instanceof _e&&e.indexOf(t.name)>=0)return!1;var n=!0;return t.eachChild((function(t){n&&!Be(t,e)&&(n=!1)})),n}Ne.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var n=t[1];if("FeatureCollection"===n.type)for(var r=0;r<n.features.length;++r){var i=n.features[r].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Ne(n,n.features[r].geometry)}else if("Feature"===n.type){var o=n.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Ne(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new Ne(n,n)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ne.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=ke(e.coordinates,r,i),a=Re(t.geometry(),n,r,i);if(!we(n,r))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Me(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Le(e.coordinates,r,i),c=Re(t.geometry(),n,r,i);if(!we(n,r))return!1;for(var h=0,p=c;h<p.length;h+=1)if(!Te(p[h],l))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=ke(e.coordinates,r,i),a=De(t.geometry(),n,r,i);if(!we(n,r))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Oe(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Le(e.coordinates,r,i),c=De(t.geometry(),n,r,i);if(!we(n,r))return!1;for(var h=0,p=c;h<p.length;h+=1)if(!Pe(p[h],l))return!1}return!0}(t,this.geometries)}return!1},Ne.prototype.eachChild=function(){},Ne.prototype.outputDefined=function(){return!0},Ne.prototype.serialize=function(){return["within",this.geojson]};var je=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};je.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var n=t[1];return e.scope.has(n)?new je(n,e.scope.get(n)):e.error('Unknown variable "'+n+'". Make sure "'+n+'" has been bound in an enclosing "let" expression before using it.',1)},je.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},je.prototype.eachChild=function(){},je.prototype.outputDefined=function(){return!1},je.prototype.serialize=function(){return["var",this.name]};var Ue=function(t,e,n,r,i){void 0===e&&(e=[]),void 0===r&&(r=new Nt),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=r,this.errors=i,this.expectedType=n};function Ze(t,e){for(var n,r=t.length-1,i=0,o=r,a=0;i<=o;)if((n=t[a=Math.floor((i+o)/2)])<=e){if(a===r||e<t[a+1])return a;i=a+1}else{if(!(n>e))throw new ce("Input is not a number.");o=a-1}return 0}Ue.prototype.parse=function(t,e,n,r,i){return void 0===i&&(i={}),e?this.concat(e,n,r)._parse(t,i):this._parse(t,i)},Ue.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new pe(e,[t]):"coerce"===n?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", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[r];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=n(o,a,e.typeAnnotation||"coerce");else o=n(o,a,e.typeAnnotation||"assert")}if(!(o instanceof le)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof _e&&"error"===e.name)return!1;if(e instanceof be)return!1;if(e instanceof Ne)return!1;var n=e instanceof ge||e instanceof pe,r=!0;return e.eachChild((function(e){r=n?r&&t(e):r&&e instanceof le})),!!r&&Fe(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new ve;try{o=new le(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". 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.")},Ue.prototype.concat=function(t,e,n){var r="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new Ue(this.registry,r,e||null,i,this.errors)},Ue.prototype.error=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Dt(r,t))},Ue.prototype.checkSubtype=function(t,e){var n=$t(t,e);return n&&this.error(n),n};var Ve=function(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var r=0,i=n;r<i.length;r+=1){var o=i[r],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function Ge(t,e,n){return t*(1-n)+e*n}Ve.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 n=e.parse(t[1],1,zt);if(!n)return null;var r=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+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.',u);if(r.length&&r[r.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,i);if(!c)return null;i=i||c.type,r.push([a,c])}return new Ve(i,n,r)},Ve.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;return r>=e[i-1]?n[i-1].evaluate(t):n[Ze(e,r)].evaluate(t)},Ve.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},Ve.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ve.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 He=Object.freeze({__proto__:null,number:Ge,color:function(t,e,n){return new te(Ge(t.r,e.r,n),Ge(t.g,e.g,n),Ge(t.b,e.b,n),Ge(t.a,e.a,n))},array:function(t,e,n){return t.map((function(t,r){return Ge(t,e[r],n)}))}}),We=6/29*3*(6/29),qe=Math.PI/180,Ye=180/Math.PI;function Xe(t){return t>.008856451679035631?Math.pow(t,1/3):t/We+4/29}function $e(t){return t>6/29?t*t*t:We*(t-4/29)}function Ke(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Je(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qe(t){var e=Je(t.r),n=Je(t.g),r=Je(t.b),i=Xe((.4124564*e+.3575761*n+.1804375*r)/.95047),o=Xe((.2126729*e+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Xe((.0193339*e+.119192*n+.9503041*r)/1.08883)),alpha:t.a}}function tn(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*$e(e),n=.95047*$e(n),r=1.08883*$e(r),new te(Ke(3.2404542*n-1.5371385*e-.4985314*r),Ke(-.969266*n+1.8760108*e+.041556*r),Ke(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}function en(t,e,n){var r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}var nn={forward:Qe,reverse:tn,interpolate:function(t,e,n){return{l:Ge(t.l,e.l,n),a:Ge(t.a,e.a,n),b:Ge(t.b,e.b,n),alpha:Ge(t.alpha,e.alpha,n)}}},rn={forward:function(t){var e=Qe(t),n=e.l,r=e.a,i=e.b,o=Math.atan2(i,r)*Ye;return{h:o<0?o+360:o,c:Math.sqrt(r*r+i*i),l:n,alpha:t.a}},reverse:function(t){var e=t.h*qe,n=t.c;return tn({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:en(t.h,e.h,n),c:Ge(t.c,e.c,n),l:Ge(t.l,e.l,n),alpha:Ge(t.alpha,e.alpha,n)}}},on=Object.freeze({__proto__:null,lab:nn,hcl:rn}),an=function(t,e,n,r,i){this.type=t,this.operator=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],u=s[1];this.labels.push(s[0]),this.outputs.push(u)}};function sn(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}an.interpolationFactor=function(t,e,r,i){var o=0;if("exponential"===t.name)o=sn(e,t.base,r,i);else if("linear"===t.name)o=sn(e,1,r,i);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new n(a[0],a[1],a[2],a[3]).solve(sn(e,1,r,i))}return o},an.parse=function(t,e){var n=t[0],r=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var a=r[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:a}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.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);r={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,zt)))return null;var u=[],l=null;"interpolate-hcl"===n||"interpolate-lab"===n?l=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c<o.length;c+=2){var h=o[c],p=o[c+1],f=c+3,d=c+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(p,d,l);if(!m)return null;l=l||m.type,u.push([h,m])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new an(l,n,r,i,u):e.error("Type "+Yt(l)+" is not interpolatable.")},an.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);var o=Ze(e,r),a=an.interpolationFactor(this.interpolation,r,e[o],e[o+1]),s=n[o].evaluate(t),u=n[o+1].evaluate(t);return"interpolate"===this.operator?He[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?rn.reverse(rn.interpolate(rn.forward(s),rn.forward(u),a)):nn.reverse(nn.interpolate(nn.forward(s),nn.forward(u),a))},an.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},an.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},an.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()],n=0;n<this.labels.length;n++)e.push(this.labels[n],this.outputs[n].serialize());return e};var un=function(t,e){this.type=t,this.args=e};un.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var n=null,r=e.expectedType;r&&"value"!==r.kind&&(n=r);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+i.length,n,void 0,{typeAnnotation:"omit"});if(!s)return null;n=n||s.type,i.push(s)}var u=r&&i.some((function(t){return $t(r,t.type)}));return new un(u?Vt:n,i)},un.prototype.evaluate=function(t){for(var e,n=null,r=0,i=0,o=this.args;i<o.length&&(r++,(n=o[i].evaluate(t))&&n instanceof ie&&!n.available&&(e||(e=n.name),n=null,r===this.args.length&&(n=e)),null===n);i+=1);return n},un.prototype.eachChild=function(t){this.args.forEach(t)},un.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},un.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ln=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};ln.prototype.evaluate=function(t){return this.result.evaluate(t)},ln.prototype.eachChild=function(t){for(var e=0,n=this.bindings;e<n.length;e+=1)t(n[e][1]);t(this.result)},ln.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var n=[],r=1;r<t.length-1;r+=2){var i=t[r];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",r);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);var o=e.parse(t[r+1],r+1);if(!o)return null;n.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return a?new ln(n,a):null},ln.prototype.outputDefined=function(){return this.result.outputDefined()},ln.prototype.serialize=function(){for(var t=["let"],e=0,n=this.bindings;e<n.length;e+=1){var r=n[e];t.push(r[0],r[1].serialize())}return t.push(this.result.serialize()),t};var cn=function(t,e,n){this.type=t,this.index=e,this.input=n};cn.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,zt),r=e.parse(t[2],2,qt(e.expectedType||Vt));return n&&r?new cn(r.type.itemType,n,r):null},cn.prototype.evaluate=function(t){var e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new ce("Array index out of bounds: "+e+" < 0.");if(e>=n.length)throw new ce("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return n[e]},cn.prototype.eachChild=function(t){t(this.index),t(this.input)},cn.prototype.outputDefined=function(){return!1},cn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var hn=function(t,e){this.type=jt,this.needle=t,this.haystack=e};hn.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,Vt),r=e.parse(t[2],2,Vt);return n&&r?Kt(n.type,[jt,Bt,zt,Ft,Vt])?new hn(n,r):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Yt(n.type)+" instead"):null},hn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!Jt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Yt(se(e))+" instead.");if(!Jt(n,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Yt(se(n))+" instead.");return n.indexOf(e)>=0},hn.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},hn.prototype.outputDefined=function(){return!0},hn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var pn=function(t,e,n){this.type=zt,this.needle=t,this.haystack=e,this.fromIndex=n};pn.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 n=e.parse(t[1],1,Vt),r=e.parse(t[2],2,Vt);if(!n||!r)return null;if(!Kt(n.type,[jt,Bt,zt,Ft,Vt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Yt(n.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,zt);return i?new pn(n,r,i):null}return new pn(n,r)},pn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Jt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Yt(se(e))+" instead.");if(!Jt(n,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Yt(se(n))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return n.indexOf(e,r)}return n.indexOf(e)},pn.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},pn.prototype.outputDefined=function(){return!1},pn.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 fn=function(t,e,n,r,i,o){this.inputType=t,this.type=e,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o};fn.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 n,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return l.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return l.error("Numeric branch labels must be integer values.");if(n){if(l.checkSubtype(n,se(p)))return null}else n=se(p);if(void 0!==i[String(p)])return l.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(u,a,r);if(!f)return null;r=r||f.type,o.push(f)}var d=e.parse(t[1],1,Vt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,r);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(n,d.type)?null:new fn(n,r,d,i,o,m):null},fn.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},fn.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},fn.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},fn.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],n=[],r={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(h=r[this.cases[a]])?(r[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=n;u<l.length;u+=1){var c=l[u],h=c[0],p=c[1];e.push(1===p.length?s(p[0]):p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var dn=function(t,e,n){this.type=t,this.branches=e,this.otherwise=n};dn.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 n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,jt);if(!o)return null;var a=e.parse(t[i+1],i+1,n);if(!a)return null;r.push([o,a]),n=n||a.type}var s=e.parse(t[t.length-1],t.length-1,n);return s?new dn(n,r,s):null},dn.prototype.evaluate=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[1];if(r[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},dn.prototype.eachChild=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[1];t(r[0]),t(i)}t(this.otherwise)},dn.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},dn.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var mn=function(t,e,n,r){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=r};function gn(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 yn(t,e,n,r){return 0===r.compare(e,n)}function vn(t,e,n){var r="=="!==t&&"!="!==t;return function(){function i(t,e,n){this.type=jt,this.lhs=t,this.rhs=e,this.collator=n,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 n=t[0],o=e.parse(t[1],1,Vt);if(!o)return null;if(!gn(n,o.type))return e.concat(1).error('"'+n+"\" comparisons are not supported for type '"+Yt(o.type)+"'.");var a=e.parse(t[2],2,Vt);if(!a)return null;if(!gn(n,a.type))return e.concat(2).error('"'+n+"\" comparisons are not supported for type '"+Yt(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Yt(o.type)+"' and '"+Yt(a.type)+"'.");r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new pe(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new pe(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Gt)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){var s=se(o),u=se(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ce('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var l=se(o),c=se(a);if("string"!==l.kind||"string"!==c.kind)return e(i,o,a)}return this.collator?n(i,o,a,this.collator.evaluate(i)):e(i,o,a)},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}()}mn.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 n=e.parse(t[1],1,Vt),r=e.parse(t[2],2,zt);if(!n||!r)return null;if(!Kt(n.type,[qt(Vt),Bt,Vt]))return e.error("Expected first argument to be of type array or string, but found "+Yt(n.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,zt);return i?new mn(n.type,n,r,i):null}return new mn(n.type,n,r)},mn.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!Jt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Yt(se(e))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return e.slice(n,r)}return e.slice(n)},mn.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mn.prototype.outputDefined=function(){return!1},mn.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 _n=vn("==",(function(t,e,n){return e===n}),yn),bn=vn("!=",(function(t,e,n){return e!==n}),(function(t,e,n,r){return!yn(0,e,n,r)})),xn=vn("<",(function(t,e,n){return e<n}),(function(t,e,n,r){return r.compare(e,n)<0})),wn=vn(">",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),Sn=vn("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),En=vn(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0})),Mn=function(t,e,n,r,i){this.type=Bt,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i};Mn.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,zt);if(!n)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");var i=null;if(r.locale&&!(i=e.parse(r.locale,1,Bt)))return null;var o=null;if(r.currency&&!(o=e.parse(r.currency,1,Bt)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=e.parse(r["min-fraction-digits"],1,zt)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,zt))?null:new Mn(n,i,o,a,s)},Mn.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))},Mn.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)},Mn.prototype.outputDefined=function(){return!1},Mn.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 Tn=function(t){this.type=zt,this.input=t};Tn.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error("Expected argument of type string or array, but found "+Yt(n.type)+" instead."):new Tn(n):null},Tn.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 ce("Expected value to be of type string or array, but found "+Yt(se(e))+" instead.")},Tn.prototype.eachChild=function(t){t(this.input)},Tn.prototype.outputDefined=function(){return!1},Tn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var An={"==":_n,"!=":bn,">":wn,"<":xn,">=":En,"<=":Sn,array:pe,at:cn,boolean:pe,case:dn,coalesce:un,collator:be,format:fe,image:de,in:hn,"index-of":pn,interpolate:an,"interpolate-hcl":an,"interpolate-lab":an,length:Tn,let:ln,literal:le,match:fn,number:pe,"number-format":Mn,object:pe,slice:mn,step:Ve,string:pe,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:je,within:Ne};function Cn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3];n=n.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(n,r,i,a);if(s)throw new ce(s);return new te(n/255*a,r/255*a,i/255*a,a)}function On(t,e){return t in e}function Pn(t,e){var n=e[t];return void 0===n?null:n}function kn(t){return{type:t}}function Ln(t){return{result:"success",value:t}}function In(t){return{result:"error",value:t}}function Rn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Nn(t){return!!t.expression&&t.expression.interpolated}function Fn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function zn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Bn(t){return t}function jn(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function Un(t,e,n,r,i){return jn(typeof n===i?r[n]:void 0,t.default,e.default)}function Zn(t,e,n){if("number"!==Fn(n))return jn(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];var i=Ze(t.stops.map((function(t){return t[0]})),n);return t.stops[i][1]}function Vn(t,e,n){var r=void 0!==t.base?t.base:1;if("number"!==Fn(n))return jn(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];var o=Ze(t.stops.map((function(t){return t[0]})),n),a=function(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=He[e.type]||Bn;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=on[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=s.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==r)return l(n,r,a)}}:l(s,u,a)}function Gn(t,e,n){return"color"===e.type?n=te.parse(n):"formatted"===e.type?n=re.fromString(n.toString()):"resolvedImage"===e.type?n=ie.fromString(n.toString()):Fn(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),jn(n,t.default,e.default)}_e.register(An,{error:[{kind:"error"},[Bt],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Bt,[Vt],function(t,e){return Yt(se(e[0].evaluate(t)))}],"to-rgba":[qt(zt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[zt,zt,zt],Cn],rgba:[Ut,[zt,zt,zt,zt],Cn],has:{type:jt,overloads:[[[Bt],function(t,e){return On(e[0].evaluate(t),t.properties())}],[[Bt,Zt],function(t,e){var n=e[1];return On(e[0].evaluate(t),n.evaluate(t))}]]},get:{type:Vt,overloads:[[[Bt],function(t,e){return Pn(e[0].evaluate(t),t.properties())}],[[Bt,Zt],function(t,e){var n=e[1];return Pn(e[0].evaluate(t),n.evaluate(t))}]]},"feature-state":[Vt,[Bt],function(t,e){return Pn(e[0].evaluate(t),t.featureState||{})}],properties:[Zt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[Vt,[],function(t){return t.id()}],zoom:[zt,[],function(t){return t.globals.zoom}],"heatmap-density":[zt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[zt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Vt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[zt,kn(zt),function(t,e){for(var n=0,r=0,i=e;r<i.length;r+=1)n+=i[r].evaluate(t);return n}],"*":[zt,kn(zt),function(t,e){for(var n=1,r=0,i=e;r<i.length;r+=1)n*=i[r].evaluate(t);return n}],"-":{type:zt,overloads:[[[zt,zt],function(t,e){var n=e[1];return e[0].evaluate(t)-n.evaluate(t)}],[[zt],function(t,e){return-e[0].evaluate(t)}]]},"/":[zt,[zt,zt],function(t,e){var n=e[1];return e[0].evaluate(t)/n.evaluate(t)}],"%":[zt,[zt,zt],function(t,e){var n=e[1];return e[0].evaluate(t)%n.evaluate(t)}],ln2:[zt,[],function(){return Math.LN2}],pi:[zt,[],function(){return Math.PI}],e:[zt,[],function(){return Math.E}],"^":[zt,[zt,zt],function(t,e){var n=e[1];return Math.pow(e[0].evaluate(t),n.evaluate(t))}],sqrt:[zt,[zt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[zt,[zt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[zt,[zt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[zt,[zt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[zt,[zt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[zt,[zt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[zt,[zt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[zt,[zt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[zt,[zt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[zt,[zt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[zt,kn(zt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[zt,kn(zt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[zt,[zt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[zt,[zt],function(t,e){var n=e[0].evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[zt,[zt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[zt,[zt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[jt,[Bt,Vt],function(t,e){var n=e[0],r=e[1];return t.properties()[n.value]===r.value}],"filter-id-==":[jt,[Vt],function(t,e){var n=e[0];return t.id()===n.value}],"filter-type-==":[jt,[Bt],function(t,e){var n=e[0];return t.geometryType()===n.value}],"filter-<":[jt,[Bt,Vt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<o}],"filter-id-<":[jt,[Vt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<i}],"filter->":[jt,[Bt,Vt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>o}],"filter-id->":[jt,[Vt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[jt,[Bt,Vt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[jt,[Vt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[jt,[Bt,Vt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[jt,[Vt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[jt,[Vt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[qt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[qt(Vt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Bt,qt(Vt)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[jt,[Bt,qt(Vt)],function(t,e){var n=e[0],r=e[1];return function(t,e,n,r){for(;n<=r;){var i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var n=e[1];return e[0].evaluate(t)&&n.evaluate(t)}],[kn(jt),function(t,e){for(var n=0,r=e;n<r.length;n+=1)if(!r[n].evaluate(t))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],function(t,e){var n=e[1];return e[0].evaluate(t)||n.evaluate(t)}],[kn(jt),function(t,e){for(var n=0,r=e;n<r.length;n+=1)if(r[n].evaluate(t))return!0;return!1}]]},"!":[jt,[jt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[jt,[Bt],function(t,e){var n=t.globals&&t.globals.isSupportedScript;return!n||n(e[0].evaluate(t))}],upcase:[Bt,[Bt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Bt,[Bt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Bt,kn(Vt),function(t,e){return e.map((function(e){return ue(e.evaluate(t))})).join("")}],"resolved-locale":[Bt,[Gt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Hn=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ve,this._defaultValue=e?function(t){return"color"===t.type&&zn(t.default)?new te(0,0,0,0):"color"===t.type?te.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Wn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in An}function qn(t,e){var n=new Ue(An,[],e?function(t){var e={color:Ut,string:Bt,number:zt,enum:Bt,boolean:jt,formatted:Ht,resolvedImage:Wt};return"array"===t.type?qt(e[t.value]||Vt,t.length):e[t.type]}(e):void 0),r=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?Ln(new Hn(r,e)):In(n.errors)}Hn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Hn.prototype.evaluate=function(t,e,n,r,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Yn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ze(e.expression)};Yn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)},Yn.prototype.evaluate=function(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)};var Xn=function(t,e,n,r){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ze(e.expression),this.interpolationType=r};function $n(t,e){if("error"===(t=qn(t,e)).result)return t;var n=t.value.expression,r=Fe(n);if(!r&&!Rn(e))return In([new Dt("","data expressions not supported")]);var i=Be(n,["zoom"]);if(!i&&!Dn(e))return In([new Dt("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof ln)n=t(e.result);else if(e instanceof un)for(var r=0,i=e.args;r<i.length&&!(n=t(i[r]));r+=1);else(e instanceof Ve||e instanceof an)&&e.input instanceof _e&&"zoom"===e.input.name&&(n=e);return n instanceof Dt||e.eachChild((function(e){var r=t(e);r instanceof Dt?n=r:!n&&r?n=new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&r&&n!==r&&(n=new Dt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}(n);return o||i?o instanceof Dt?In([o]):o instanceof an&&!Nn(e)?In([new Dt("",'"interpolate" expressions cannot be used with this property')]):Ln(o?new Xn(r?"camera":"composite",t.value,o.labels,o instanceof an?o.interpolation:void 0):new Yn(r?"constant":"source",t.value)):In([new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Xn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)},Xn.prototype.evaluate=function(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)},Xn.prototype.interpolationFactor=function(t,e,n){return this.interpolationType?an.interpolationFactor(this.interpolationType,t,e,n):0};var Kn=function(t,e){this._parameters=t,this._specification=e,Lt(this,function t(e,n){var r,i,o,a="color"===n.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(Nn(n)?"exponential":"interval");if(a&&((e=Lt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],te.parse(t[1])]}))),e.default=te.parse(e.default?e.default:n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!on[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)r=Vn;else if("interval"===l)r=Zn;else if("categorical"===l){r=Un,i=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var p=h[c];i[p[0]]=p[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');r=Gn}if(s){for(var f={},d=[],m=0;m<e.stops.length;m++){var g=e.stops[m],y=g[0].zoom;void 0===f[y]&&(f[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},d.push(y)),f[y].stops.push([g[0].value,g[1]])}for(var v=[],_=0,b=d;_<b.length;_+=1){var x=b[_];v.push([f[x].zoom,t(f[x],n)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:an.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(t){return t[0]})),evaluate:function(t,r){var i=t.zoom;return Vn({stops:v,base:e.base},n,i).evaluate(i,r)}}}if(u){var S="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:an.interpolationFactor.bind(void 0,S),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return r(e,n,t.zoom,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?jn(e.default,n.default):r(e,n,s,i,o)}}}(this._parameters,this._specification))};function Jn(t){var e=t.key,n=t.value,r=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Fn(n);if("object"!==u)return[new Pt(e,n,"object expected, "+u+" found")];for(var l in n){var c=l.split(".")[0],h=r[c]||r["*"],p=void 0;if(i[c])p=i[c];else if(r[c])p=Sr;else if(i["*"])p=i["*"];else{if(!r["*"]){s.push(new Pt(e,n[l],'unknown property "'+l+'"'));continue}p=Sr}s=s.concat(p({key:(e?e+".":e)+l,value:n[l],valueSpec:h,style:o,styleSpec:a,object:n,objectKey:l},n))}for(var f in r)i[f]||r[f].required&&void 0===r[f].default&&void 0===n[f]&&s.push(new Pt(e,n,'missing required property "'+f+'"'));return s}function Qn(t){var e=t.value,n=t.valueSpec,r=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Sr;if("array"!==Fn(e))return[new Pt(o,e,"array expected, "+Fn(e)+" found")];if(n.length&&e.length!==n.length)return[new Pt(o,e,"array length "+n.length+" expected, length "+e.length+" found")];if(n["min-length"]&&e.length<n["min-length"])return[new Pt(o,e,"array length at least "+n["min-length"]+" expected, length "+e.length+" found")];var s={type:n.value,values:n.values};i.$version<7&&(s.function=n.function),"object"===Fn(n.value)&&(s=n.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:r,styleSpec:i,key:o+"["+l+"]"}));return u}function tr(t){var e=t.key,n=t.value,r=t.valueSpec,i=Fn(n);return"number"===i&&n!=n&&(i="NaN"),"number"!==i?[new Pt(e,n,"number expected, "+i+" found")]:"minimum"in r&&n<r.minimum?[new Pt(e,n,n+" is less than the minimum value "+r.minimum)]:"maximum"in r&&n>r.maximum?[new Pt(e,n,n+" is greater than the maximum value "+r.maximum)]:[]}function er(t){var e,n,r,i=t.valueSpec,o=It(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Fn(t.value.stops)&&"array"===Fn(t.value.stops[0])&&"object"===Fn(t.value.stops[0][0]),c=Jn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Pt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],n=t.value;return e=e.concat(Qn({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Fn(n)&&0===n.length&&e.push(new Pt(t.key,n,"array must have at least one stop")),e},default:function(t){return Sr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new Pt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new Pt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Nn(t.valueSpec)&&c.push(new Pt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Rn(t.valueSpec)?c.push(new Pt(t.key,t.value,"property functions not supported")):s&&!Dn(t.valueSpec)&&c.push(new Pt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new Pt(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Fn(o))return[new Pt(s,o,"array expected, "+Fn(o)+" found")];if(2!==o.length)return[new Pt(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Fn(o[0]))return[new Pt(s,o,"object expected, "+Fn(o[0])+" found")];if(void 0===o[0].zoom)return[new Pt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Pt(s,o,"object stop key must have value")];if(r&&r>It(o[0].zoom))return[new Pt(s,o[0].zoom,"stop zoom values must appear in ascending order")];It(o[0].zoom)!==r&&(r=It(o[0].zoom),n=void 0,a={}),e=e.concat(Jn({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tr,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Wn(Rt(o[1]))?e.concat([new Pt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Sr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,r){var s=Fn(t.value),u=It(t.value),l=null!==t.value?t.value:r;if(e){if(s!==e)return[new Pt(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Pt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Rn(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pt(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==n&&u<n?[new Pt(t.key,l,"stop domain values must appear in ascending order")]:(n=u,"categorical"===o&&u in a?[new Pt(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new Pt(t.key,l,"integer expected, found "+u)]}}function nr(t){var e=("property"===t.expressionContext?$n:qn)(Rt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Pt(""+t.key+e.key,t.value,e.message)}));var n=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new Pt(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(n))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ze(n))return[new Pt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Be(n,["zoom","feature-state"]))return[new Pt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Fe(n))return[new Pt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rr(t){var e=t.key,n=t.value,r=t.valueSpec,i=[];return Array.isArray(r.values)?-1===r.values.indexOf(It(n))&&i.push(new Pt(e,n,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(n)+" found")):-1===Object.keys(r.values).indexOf(It(n))&&i.push(new Pt(e,n,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(n)+" found")),i}function ir(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,n=t.slice(1);e<n.length;e+=1){var r=n[e];if(!ir(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}Kn.deserialize=function(t){return new Kn(t._parameters,t._specification)},Kn.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var or={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ar(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ir(t)||(t=ur(t));var e=qn(t,or);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,n,r){return e.value.evaluate(t,n,{},r)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var n=1;n<e.length;n++)if(t(e[n]))return!0;return!1}(t)}}function sr(t,e){return t<e?-1:t>e?1:0}function ur(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?lr(t[1],t[2],"=="):"!="===n?pr(lr(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?lr(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(ur))):"all"===n?["all"].concat(t.slice(1).map(ur)):"none"===n?["all"].concat(t.slice(1).map(ur).map(pr)):"in"===n?cr(t[1],t.slice(2)):"!in"===n?pr(cr(t[1],t.slice(2))):"has"===n?hr(t[1]):"!has"===n?pr(hr(t[1])):"within"!==n||t}function lr(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function cr(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(sr)]]:["filter-in-small",t,["literal",e]]}}function hr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pr(t){return["!",t]}function fr(t){return ir(Rt(t.value))?nr(Lt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,r=e.key;if("array"!==Fn(n))return[new Pt(r,n,"array expected, "+Fn(n)+" found")];var i,o=e.styleSpec,a=[];if(n.length<1)return[new Pt(r,n,"filter array must have at least 1 element")];switch(a=a.concat(rr({key:r+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),It(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===It(n[1])&&a.push(new Pt(r,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&a.push(new Pt(r,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(i=Fn(n[1]))&&a.push(new Pt(r+"[1]",n[1],"string expected, "+i+" found"));for(var s=2;s<n.length;s++)i=Fn(n[s]),"$type"===It(n[1])?a=a.concat(rr({key:r+"["+s+"]",value:n[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new Pt(r+"["+s+"]",n[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<n.length;u++)a=a.concat(t({key:r+"["+u+"]",value:n[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Fn(n[1]),2!==n.length?a.push(new Pt(r,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new Pt(r+"[1]",n[1],"string expected, "+i+" found"));break;case"within":i=Fn(n[1]),2!==n.length?a.push(new Pt(r,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"object"!==i&&a.push(new Pt(r+"[1]",n[1],"object expected, "+i+" found"))}return a}(t)}function dr(t,e){var n=t.key,r=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return Sr({key:n,value:o,valueSpec:i.transition,style:r,styleSpec:i});var l,c=t.valueSpec||s[a];if(!c)return[new Pt(n,o,'unknown property "'+a+'"')];if("string"===Fn(o)&&Rn(c)&&!c.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Pt(n,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&r&&!r.glyphs&&h.push(new Pt(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&zn(Rt(o))&&"identity"===It(o.type)&&h.push(new Pt(n,o,'"text-font" does not support identity functions'))),h.concat(Sr({key:t.key,value:o,valueSpec:c,style:r,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function mr(t){return dr(t,"paint")}function gr(t){return dr(t,"layout")}function yr(t){var e=[],n=t.value,r=t.key,i=t.style,o=t.styleSpec;n.type||n.ref||e.push(new Pt(r,n,'either "type" or "ref" is required'));var a,s=It(n.type),u=It(n.ref);if(n.id)for(var l=It(n.id),c=0;c<t.arrayIndex;c++){var h=i.layers[c];It(h.id)===l&&e.push(new Pt(r,n.id,'duplicate layer id "'+n.id+'", previously used at line '+h.id.__line__))}if("ref"in n)["type","source","source-layer","filter","layout"].forEach((function(t){t in n&&e.push(new Pt(r,n[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){It(t.id)===u&&(a=t)})),a?a.ref?e.push(new Pt(r,n.ref,"ref cannot reference another ref layer")):s=It(a.type):e.push(new Pt(r,n.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(n.source){var p=i.sources&&i.sources[n.source],f=p&&It(p.type);p?"vector"===f&&"raster"===s?e.push(new Pt(r,n.source,'layer "'+n.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Pt(r,n.source,'layer "'+n.id+'" requires a vector source')):"vector"!==f||n["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Pt(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!n.paint||!n.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||e.push(new Pt(r,n,'layer "'+n.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Pt(r,n,'layer "'+n.id+'" must specify a "source-layer"')):e.push(new Pt(r,n.source,'source "'+n.source+'" not found'))}else e.push(new Pt(r,n,'missing required property "source"'));return e=e.concat(Jn({key:r,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Sr({key:r+".type",value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"})},filter:fr,layout:function(t){return Jn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return gr(Lt({layerType:s},t))}}})},paint:function(t){return Jn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return mr(Lt({layerType:s},t))}}})}}}))}function vr(t){var e=t.value,n=t.key,r=Fn(e);return"string"!==r?[new Pt(n,e,"string expected, "+r+" found")]:[]}var _r={promoteId:function(t){var e=t.key,n=t.value;if("string"===Fn(n))return vr({key:e,value:n});var r=[];for(var i in n)r.push.apply(r,vr({key:e+"."+i,value:n[i]}));return r}};function br(t){var e=t.value,n=t.key,r=t.styleSpec,i=t.style;if(!e.type)return[new Pt(n,e,'"type" is required')];var o,a=It(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Jn({key:n,value:e,valueSpec:r["source_"+a.replace("-","_")],style:t.style,styleSpec:r,objectElementValidators:_r});case"geojson":if(o=Jn({key:n,value:e,valueSpec:r.source_geojson,style:i,styleSpec:r,objectElementValidators:_r}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],c="string"==typeof l?[l,["accumulated"],["get",s]]:l;o.push.apply(o,nr({key:n+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),o.push.apply(o,nr({key:n+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return Jn({key:n,value:e,valueSpec:r.source_video,style:i,styleSpec:r});case"image":return Jn({key:n,value:e,valueSpec:r.source_image,style:i,styleSpec:r});case"canvas":return[new Pt(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rr({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:r})}}function xr(t){var e=t.value,n=t.styleSpec,r=n.light,i=t.style,o=[],a=Fn(e);if(void 0===e)return o;if("object"!==a)return o.concat([new Pt("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=o.concat(u&&r[u[1]]&&r[u[1]].transition?Sr({key:s,value:e[s],valueSpec:n.transition,style:i,styleSpec:n}):r[s]?Sr({key:s,value:e[s],valueSpec:r[s],style:i,styleSpec:n}):[new Pt(s,e[s],'unknown property "'+s+'"')])}return o}var wr={"*":function(){return[]},array:Qn,boolean:function(t){var e=t.value,n=t.key,r=Fn(e);return"boolean"!==r?[new Pt(n,e,"boolean expected, "+r+" found")]:[]},number:tr,color:function(t){var e=t.key,n=t.value,r=Fn(n);return"string"!==r?[new Pt(e,n,"color expected, "+r+" found")]:null===Qt(n)?[new Pt(e,n,'color expected, "'+n+'" found')]:[]},constants:kt,enum:rr,filter:fr,function:er,layer:yr,object:Jn,source:br,light:xr,string:vr,formatted:function(t){return 0===vr(t).length?[]:nr(t)},resolvedImage:function(t){return 0===vr(t).length?[]:nr(t)}};function Sr(t){var e=t.value,n=t.valueSpec,r=t.styleSpec;return n.expression&&zn(It(e))?er(t):n.expression&&Wn(Rt(e))?nr(t):n.type&&wr[n.type]?wr[n.type](t):Jn(Lt({},t,{valueSpec:n.type?r[n.type]:n}))}function Er(t){var e=t.value,n=t.key,r=vr(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new Pt(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new Pt(n,e,'"glyphs" url must include a "{range}" token'))),r}function Mr(t,e){void 0===e&&(e=Ot);var n=[];return n=n.concat(Sr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Er,"*":function(){return[]}}})),t.constants&&(n=n.concat(kt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Tr(n)}function Tr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Ar(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return Tr(t.apply(this,e))}}Mr.source=Ar(br),Mr.light=Ar(xr),Mr.layer=Ar(yr),Mr.filter=Ar(fr),Mr.paintProperty=Ar(mr),Mr.layoutProperty=Ar(gr);var Cr=Mr,Or=Cr.light,Pr=Cr.paintProperty,kr=Cr.layoutProperty;function Lr(t,e){var n=!1;if(e&&e.length)for(var r=0,i=e;r<i.length;r+=1)t.fire(new At(new Error(i[r].message))),n=!0;return n}var Ir=Rr;function Rr(t,e,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(n=i[2]);for(var o=0;o<this.d*this.d;o++){var a=i[3+o],s=i[3+o+1];r.push(a===s?null:i.subarray(a,s))}var u=i[3+r.length+1];this.keys=i.subarray(i[3+r.length],u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*n;for(var l=0;l<this.d*this.d;l++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=n,this.scale=e/t,this.uid=0;var c=n/e*t;this.min=-c,this.max=t+c}Rr.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},Rr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Rr.prototype._insertCell=function(t,e,n,r,i,o){this.cells[i].push(o)},Rr.prototype.query=function(t,e,n,r,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=n&&a<=r&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,n,r,this._queryCell,s,{},i),s},Rr.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,c=this.bboxes,h=0;h<u.length;h++){var p=u[h];if(void 0===a[p]){var f=4*p;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&e<=c[f+3]&&n>=c[f+0]&&r>=c[f+1])?(a[p]=!0,o.push(l[p])):a[p]=!1}}},Rr.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(n),h=this._convertToCellCoord(r),p=u;p<=c;p++)for(var f=l;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,n,r,d,o,a,s))return}},Rr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Rr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Rr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var i=new Int32Array(e+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),i[3+t.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var Dr=a.ImageData,Nr=a.ImageBitmap,Fr={};function zr(t,e,n){void 0===n&&(n={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Fr[t]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}for(var Br in zr("Object",Object),Ir.serialize=function(t,e){var n=t.toArrayBuffer();return e&&e.push(n),{buffer:n}},Ir.deserialize=function(t){return new Ir(t.buffer)},zr("Grid",Ir),zr("Color",te),zr("Error",Error),zr("ResolvedImage",ie),zr("StylePropertyFunction",Kn),zr("StyleExpression",Hn,{omit:["_evaluator"]}),zr("ZoomDependentExpression",Xn),zr("ZoomConstantExpression",Yn),zr("CompoundExpression",_e,{omit:["_evaluate"]}),An)An[Br]._classRegistryKey||zr("Expression_"+Br,An[Br]);function jr(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Ur(t){return Nr&&t instanceof Nr}function Zr(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(jr(t)||Ur(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var n=t;return e&&e.push(n.buffer),n}if(t instanceof Dr)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var r=[],i=0,o=t;i<o.length;i+=1)r.push(Zr(o[i],e));return r}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var u=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(Fr[s].omit.indexOf(l)>=0)){var c=t[l];u[l]=Fr[s].shallow.indexOf(l)>=0?c:Zr(c,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function Vr(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||jr(t)||Ur(t)||ArrayBuffer.isView(t)||t instanceof Dr)return t;if(Array.isArray(t))return t.map(Vr);if("object"==typeof t){var e=t.$name||"Object",n=Fr[e].klass;if(!n)throw new Error("can't deserialize unregistered class "+e);if(n.deserialize)return n.deserialize(t);for(var r=Object.create(n.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];r[a]=Fr[e].shallow.indexOf(a)>=0?s:Vr(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var Gr=function(){this.first=!0};Gr.prototype.update=function(t,e){var n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=n,!0))};var Hr={"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 Wr(t){for(var e=0,n=t;e<n.length;e+=1)if(qr(n[e].charCodeAt(0)))return!0;return!1}function qr(t){return!(746!==t&&747!==t&&(t<4352||!(Hr["Bopomofo Extended"](t)||Hr.Bopomofo(t)||Hr["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Hr["CJK Compatibility Ideographs"](t)||Hr["CJK Compatibility"](t)||Hr["CJK Radicals Supplement"](t)||Hr["CJK Strokes"](t)||!(!Hr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Hr["CJK Unified Ideographs Extension A"](t)||Hr["CJK Unified Ideographs"](t)||Hr["Enclosed CJK Letters and Months"](t)||Hr["Hangul Compatibility Jamo"](t)||Hr["Hangul Jamo Extended-A"](t)||Hr["Hangul Jamo Extended-B"](t)||Hr["Hangul Jamo"](t)||Hr["Hangul Syllables"](t)||Hr.Hiragana(t)||Hr["Ideographic Description Characters"](t)||Hr.Kanbun(t)||Hr["Kangxi Radicals"](t)||Hr["Katakana Phonetic Extensions"](t)||Hr.Katakana(t)&&12540!==t||!(!Hr["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)||!(!Hr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Hr["Unified Canadian Aboriginal Syllabics"](t)||Hr["Unified Canadian Aboriginal Syllabics Extended"](t)||Hr["Vertical Forms"](t)||Hr["Yijing Hexagram Symbols"](t)||Hr["Yi Syllables"](t)||Hr["Yi Radicals"](t))))}function Yr(t){return!(qr(t)||function(t){return!!(Hr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Hr["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)||Hr["Letterlike Symbols"](t)||Hr["Number Forms"](t)||Hr["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)||Hr["Control Pictures"](t)&&9251!==t||Hr["Optical Character Recognition"](t)||Hr["Enclosed Alphanumerics"](t)||Hr["Geometric Shapes"](t)||Hr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Hr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hr["CJK Symbols and Punctuation"](t)||Hr.Katakana(t)||Hr["Private Use Area"](t)||Hr["CJK Compatibility Forms"](t)||Hr["Small Form Variants"](t)||Hr["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 Xr(t){return t>=1424&&t<=2303||Hr["Arabic Presentation Forms-A"](t)||Hr["Arabic Presentation Forms-B"](t)}function $r(t,e){return!(!e&&Xr(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Hr.Khmer(t))}function Kr(t){for(var e=0,n=t;e<n.length;e+=1)if(Xr(n[e].charCodeAt(0)))return!0;return!1}var Jr=null,Qr="unavailable",ti=null,ei=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Qr="error"),Jr&&Jr(t)};function ni(){ri.fire(new Tt("pluginStateChange",{pluginStatus:Qr,pluginURL:ti}))}var ri=new Ct,ii=function(){return Qr},oi=function(){if("deferred"!==Qr||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Qr="loading",ni(),ti&&bt({url:ti},(function(t){t?ei(t):(Qr="loaded",ni())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Qr||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===Qr},setState:function(t){Qr=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=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 Gr,this.transition={})};si.prototype.isSupportedScript=function(t){return function(t,e){for(var n=0,r=t;n<r.length;n+=1)if(!$r(r[n].charCodeAt(0),e))return!1;return!0}(t,ai.isLoaded())},si.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},si.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),n=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*e}};var ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(zn(t))return new Kn(t,e);if(Wn(t)){var n=$n(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=te.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,n){return this.property.possiblyEvaluate(this,t,e,n)};var li=function(t){this.property=t,this.value=new ui(t,void 0)};li.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},li.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return x(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:x(e))},ci.prototype.getTransition=function(t){return x(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].transition=x(e)||void 0},ci.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i);var o=this.getTransition(r);void 0!==o&&(t[r+"-transition"]=o)}return t},ci.prototype.transitioned=function(t,e){for(var n=new pi(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var o=i[r];n._values[o]=this._values[o].transitioned(t,e._values[o])}return n},ci.prototype.untransitioned=function(){for(var t=new pi(this._properties),e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e];t._values[r]=this._values[r].untransitioned()}return t};var hi=function(t,e,n,r,i){this.property=t,this.value=e,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=n)};hi.prototype.possiblyEvaluate=function(t,e,n){var r=t.now||0,i=this.value.possiblyEvaluate(t,e,n),o=this.prior;if(o){if(r>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return o.possiblyEvaluate(t,e,n);var a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,n),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,n){for(var r=new mi(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];r._values[a]=this._values[a].possiblyEvaluate(t,e,n)}return r},pi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var fi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};fi.prototype.getValue=function(t){return x(this._values[t].value)},fi.prototype.setValue=function(t,e){this._values[t]=new ui(this._values[t].property,null===e?void 0:x(e))},fi.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i)}return t},fi.prototype.possiblyEvaluate=function(t,e,n){for(var r=new mi(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];r._values[a]=this._values[a].possiblyEvaluate(t,e,n)}return r};var di=function(t,e,n){this.property=t,this.value=e,this.parameters=n};di.prototype.isConstant=function(){return"constant"===this.value.kind},di.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},di.prototype.evaluate=function(t,e,n,r){return this.property.evaluate(this.value,this.parameters,t,e,n,r)};var mi=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};mi.prototype.get=function(t){return this._values[t]};var gi=function(t){this.specification=t};gi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},gi.prototype.interpolate=function(t,e,n){var r=He[this.specification.type];return r?r(t,e,n):t};var yi=function(t,e){this.specification=t,this.overrides=e};yi.prototype.possiblyEvaluate=function(t,e,n,r){return new di(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},n,r)}:t.expression,e)},yi.prototype.interpolate=function(t,e,n){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new di(this,{kind:"constant",value:void 0},t.parameters);var r=He[this.specification.type];return r?new di(this,{kind:"constant",value:r(t.value.value,e.value.value,n)},t.parameters):t},yi.prototype.evaluate=function(t,e,n,r,i,o){return"constant"===t.kind?t.value:t.evaluate(e,n,r,i,o)};var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,n,r){if(void 0===t.value)return new di(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},n,r),o="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,a=this._calculate(o,o,o,e);return new di(this,{kind:"constant",value:a},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 di(this,{kind:"constant",value:s},e)}return new di(this,t.expression,e)},e.prototype.evaluate=function(t,e,n,r,i,o){if("source"===t.kind){var a=t.evaluate(e,n,r,i,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},n,r),t.evaluate({zoom:Math.floor(e.zoom)},n,r),t.evaluate({zoom:Math.floor(e.zoom)+1},n,r),e):t.value},e.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},e.prototype.interpolate=function(t){return t},e}(yi),_i=function(t){this.specification=t};_i.prototype.possiblyEvaluate=function(t,e,n,r){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},n,r);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},_i.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},_i.prototype.interpolate=function(t){return t};var bi=function(t){this.specification=t};bi.prototype.possiblyEvaluate=function(t,e,n,r){return!!t.expression.evaluate(e,null,{},n,r)},bi.prototype.interpolate=function(){return!1};var xi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var n=t[e];n.specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new ui(n,void 0),i=this.defaultTransitionablePropertyValues[e]=new li(n);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};zr("DataDrivenProperty",yi),zr("DataConstantProperty",gi),zr("CrossFadedDataDrivenProperty",vi),zr("CrossFadedProperty",_i),zr("ColorRampProperty",bi);var wi=function(t){function e(e,n){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),n.layout&&(this._unevaluatedLayout=new fi(n.layout)),n.paint)){for(var r in this._transitionablePaint=new ci(n.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new mi(n.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n){void 0===n&&(n={}),null!=e&&this._validate(kr,"layers."+this.id+".layout."+t,t,e,n)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,n){if(void 0===n&&(n={}),null!=e&&this._validate(Pr,"layers."+this.id+".paint."+t,t,e,n))return!1;if(v(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var r=this._transitionablePaint._values[t],i="cross-faded-data-driven"===r.property.specification["property-type"],o=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,n){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,n,r,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Lr(this,t.call(Cr,{key:e,layerType:this.type,objectKey:n,value:r,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 di&&Rn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Ct),Si={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=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},Mi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ti(t,e){void 0===e&&(e=1);var n=0,r=0;return{members:t.map((function(t){var i=Si[t.type].BYTES_PER_ELEMENT,o=n=Ai(n,Math.max(e,i)),a=t.components||1;return r=Math.max(r,i),n+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ai(n,Math.max(r,e)),alignment:e}}function Ai(t,e){return Math.ceil(t/e)*e}Mi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Mi.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},Mi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Mi.prototype.clear=function(){this.length=0},Mi.prototype.resize=function(t){this.reserve(t),this.length=t},Mi.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)}},Mi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.int16[r+0]=e,this.int16[r+1]=n,t},e}(Mi);Ci.prototype.bytesPerElement=4,zr("StructArrayLayout2i4",Ci);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,t},e}(Mi);Oi.prototype.bytesPerElement=8,zr("StructArrayLayout4i8",Oi);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Mi);Pi.prototype.bytesPerElement=12,zr("StructArrayLayout2i4i12",Pi);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.uint8[u+4]=r,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Mi);ki.prototype.bytesPerElement=8,zr("StructArrayLayout2i4ub8",ki);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.float32[r+0]=e,this.float32[r+1]=n,t},e}(Mi);Li.prototype.bytesPerElement=8,zr("StructArrayLayout2f8",Li);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,n,r,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=n,this.uint16[h+2]=r,this.uint16[h+3]=i,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=l,this.uint16[h+9]=c,t},e}(Mi);Ii.prototype.bytesPerElement=20,zr("StructArrayLayout10ui20",Ii);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o,a,s,u,l,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,n,r,i,o,a,s,u,l,c,h)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,p){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=n,this.int16[f+2]=r,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(Mi);Ri.prototype.bytesPerElement=24,zr("StructArrayLayout4i4ui4i24",Ri);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=n,this.float32[i+2]=r,t},e}(Mi);Di.prototype.bytesPerElement=12,zr("StructArrayLayout3f12",Di);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint32[1*t+0]=e,t},e}(Mi);Ni.prototype.bytesPerElement=4,zr("StructArrayLayout1ul4",Ni);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,n,r,i,o,a,s,u)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=n,this.int16[c+2]=r,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Mi);Fi.prototype.bytesPerElement=20,zr("StructArrayLayout6i1ul2ui20",Fi);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Mi);zi.prototype.bytesPerElement=12,zr("StructArrayLayout2i2i2i12",zi);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,r,i)},e.prototype.emplace=function(t,e,n,r,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=n,this.float32[a+2]=r,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Mi);Bi.prototype.bytesPerElement=16,zr("StructArrayLayout2f1f2i16",Bi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=n,this.float32[a+1]=r,this.float32[a+2]=i,t},e}(Mi);ji.prototype.bytesPerElement=12,zr("StructArrayLayout2ub2f12",ji);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,this.uint16[i+2]=r,t},e}(Mi);Ui.prototype.bytesPerElement=6,zr("StructArrayLayout3ui6",Ui);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g,y){var v=24*t,_=12*t,b=48*t;return this.int16[v+0]=e,this.int16[v+1]=n,this.uint16[v+2]=r,this.uint16[v+3]=i,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=l,this.uint16[v+12]=c,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[b+36]=f,this.uint8[b+37]=d,this.uint8[b+38]=m,this.uint32[_+10]=g,this.int16[v+22]=y,t},e}(Mi);Zi.prototype.bytesPerElement=48,zr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Zi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g,y,v,_,b,x,w,S,E,M,T,A){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g,y,v,_,b,x,w,S,E,M,T,A)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g,y,v,_,b,x,w,S,E,M,T,A,C){var O=34*t,P=17*t;return this.int16[O+0]=e,this.int16[O+1]=n,this.int16[O+2]=r,this.int16[O+3]=i,this.int16[O+4]=o,this.int16[O+5]=a,this.int16[O+6]=s,this.int16[O+7]=u,this.uint16[O+8]=l,this.uint16[O+9]=c,this.uint16[O+10]=h,this.uint16[O+11]=p,this.uint16[O+12]=f,this.uint16[O+13]=d,this.uint16[O+14]=m,this.uint16[O+15]=g,this.uint16[O+16]=y,this.uint16[O+17]=v,this.uint16[O+18]=_,this.uint16[O+19]=b,this.uint16[O+20]=x,this.uint16[O+21]=w,this.uint16[O+22]=S,this.uint32[P+12]=E,this.float32[P+13]=M,this.float32[P+14]=T,this.float32[P+15]=A,this.float32[P+16]=C,t},e}(Mi);Vi.prototype.bytesPerElement=68,zr("StructArrayLayout8i15ui1ul4f68",Vi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.float32[1*t+0]=e,t},e}(Mi);Gi.prototype.bytesPerElement=4,zr("StructArrayLayout1f4",Gi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=n,this.int16[i+2]=r,t},e}(Mi);Hi.prototype.bytesPerElement=6,zr("StructArrayLayout3i6",Hi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=n,this.uint16[i+3]=r,t},e}(Mi);Wi.prototype.bytesPerElement=8,zr("StructArrayLayout1ul2ui8",Wi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=n,t},e}(Mi);qi.prototype.bytesPerElement=4,zr("StructArrayLayout2ui4",qi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint16[1*t+0]=e,t},e}(Mi);Yi.prototype.bytesPerElement=2,zr("StructArrayLayout1ui2",Yi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,t},e}(Mi);Xi.prototype.bytesPerElement=16,zr("StructArrayLayout4f16",Xi);var $i=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={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 n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Ei);$i.prototype.size=20;var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new $i(this,t)},e}(Fi);zr("CollisionBoxArray",Ki);var Ji=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={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 n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},n.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},n.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},n.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},n.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,n),e}(Ei);Ji.prototype.size=48;var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ji(this,t)},e}(Zi);zr("PlacedSymbolArray",Qi);var to=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={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 n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},n.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,n),e}(Ei);to.prototype.size=68;var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new to(this,t)},e}(Vi);zr("SymbolInstanceArray",eo);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Gi);zr("GlyphOffsetArray",no);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(Hi);zr("SymbolLineVertexArray",ro);var io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,n),e}(Ei);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(Wi);zr("FeatureIndexArray",oo);var ao=Ti([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,n,r){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&S("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var n=e[t];for(var r in n.vaos)n.vaos[r].destroy()}},so.simpleSegment=function(t,e,n,r){return new so([{vertexOffset:t,primitiveOffset:e,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])},so.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,zr("SegmentVector",so);var lo=Ti([{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"}]),co=e((function(t){t.exports=function(t,e){var n,r,i,o,a,s,u,l;for(r=t.length-(n=3&t.length),i=e,a=3432918353,s=461845907,l=0;l<r;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>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}})),ho=e((function(t){t.exports=function(t,e){for(var n,r=t.length,i=e^r,o=0;r>=4;)n=1540483477*(65535&(n=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),po=co,fo=ho;po.murmur3=co,po.murmur2=fo;var mo=function(){this.ids=[],this.positions=[],this.indexed=!1};mo.prototype.add=function(t,e,n,r){this.ids.push(yo(t)),this.positions.push(e,n,r)},mo.prototype.getPositions=function(t){for(var e=yo(t),n=0,r=this.ids.length-1;n<r;){var i=n+r>>1;this.ids[i]>=e?r=i:n=i+1}for(var o=[];this.ids[n]===e;)o.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return o},mo.serialize=function(t,e){var n=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,n,r,i){for(;r<i;){for(var o=e[r+i>>1],a=r-1,s=i+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;vo(e,a,s),vo(n,3*a,3*s),vo(n,3*a+1,3*s+1),vo(n,3*a+2,3*s+2)}s-r<i-s?(t(e,n,r,s),r=s+1):(t(e,n,s+1,i),i=s)}}(n,r,0,n.length-1),e&&e.push(n.buffer,r.buffer),{ids:n,positions:r}},mo.deserialize=function(t){var e=new mo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var go=Math.pow(2,53)-1;function yo(t){var e=+t;return!isNaN(e)&&e<=go?e:po(String(t))}function vo(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}zr("FeaturePositionMap",mo);var _o=function(t,e){this.gl=t.gl,this.location=e},bo=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(_o),xo=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(_o),wo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(_o),So=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(_o),Eo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(_o),Mo=function(t){function e(e,n){t.call(this,e,n),this.current=te.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(_o),To=new Float32Array(16),Ao=function(t){function e(e,n){t.call(this,e,n),this.current=To}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(_o);function Co(t){return[uo(255*t.r,255*t.g),uo(255*t.b,255*t.a)]}var Oo=function(t,e,n){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=n};Oo.prototype.setUniform=function(t,e,n){t.set(n.constantOr(this.value))},Oo.prototype.getBinding=function(t,e,n){return"color"===this.type?new Mo(t,e):new xo(t,e)};var Po=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Po.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Po.prototype.setUniform=function(t,e,n,r){var i="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null;i&&t.set(i)},Po.prototype.getBinding=function(t,e,n){return"u_pattern"===n.substr(0,9)?new Eo(t,e):new xo(t,e)};var ko=function(t,e,n,r){this.expression=t,this.type=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?2:1,offset:0}})),this.paintVertexArray=new r};ko.prototype.populatePaintArray=function(t,e,n,r,i){var o=this.paintVertexArray.length,a=this.expression.evaluate(new si(0),e,{},r,[],i);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},ko.prototype.updatePaintArray=function(t,e,n,r){var i=this.expression.evaluate({zoom:0},n,r);this._setPaintValue(t,e,i)},ko.prototype._setPaintValue=function(t,e,n){if("color"===this.type)for(var r=Co(n),i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}},ko.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))},ko.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Lo=function(t,e,n,r,i,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?4:2,offset:0}})),this.paintVertexArray=new o};Lo.prototype.populatePaintArray=function(t,e,n,r,i){var o=this.expression.evaluate(new si(this.zoom),e,{},r,[],i),a=this.expression.evaluate(new si(this.zoom+1),e,{},r,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},Lo.prototype.updatePaintArray=function(t,e,n,r){var i=this.expression.evaluate({zoom:this.zoom},n,r),o=this.expression.evaluate({zoom:this.zoom+1},n,r);this._setPaintValue(t,e,i,o)},Lo.prototype._setPaintValue=function(t,e,n,r){if("color"===this.type)for(var i=Co(n),o=Co(r),a=t;a<e;a++)this.paintVertexArray.emplace(a,i[0],i[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}},Lo.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))},Lo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Lo.prototype.setUniform=function(t,e){var n=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=c(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);t.set(r)},Lo.prototype.getBinding=function(t,e,n){return new xo(t,e)};var Io=function(t,e,n,r,i,o){this.expression=t,this.type=e,this.useIntegerZoom=n,this.zoom=r,this.layerId=o,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};Io.prototype.populatePaintArray=function(t,e,n){var r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],n)},Io.prototype.updatePaintArray=function(t,e,n,r,i){this._setPaintValues(t,e,n.patterns&&n.patterns[this.layerId],i)},Io.prototype._setPaintValues=function(t,e,n,r){if(r&&n){var i=r[n.min],o=r[n.mid],a=r[n.max];if(i&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],i.tl[0],i.tl[1],i.br[0],i.br[1],o.pixelRatio,i.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},Io.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,lo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,lo.members,this.expression.isStateDependent))},Io.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Ro=function(t,e,n){this.binders={},this._buffers=[];var r=[];for(var i in t.paint._values)if(n(i)){var o=t.paint.get(i);if(o instanceof di&&Rn(o.property.specification)){var a=No(i,t.type),s=o.value,u=o.property.specification.type,l=o.property.useIntegerZoom,c=o.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[i]=h?new Po(s.value,a):new Oo(s.value,a,u),r.push("/u_"+i);else if("source"===s.kind||h){var p=Fo(i,u,"source");this.binders[i]=h?new Io(s,u,l,e,p,t.id):new ko(s,a,u,p),r.push("/a_"+i)}else{var f=Fo(i,u,"composite");this.binders[i]=new Lo(s,a,u,l,e,f),r.push("/z_"+i)}}}this.cacheKey=r.sort().join("")};Ro.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof ko||e instanceof Lo?e.maxValue:0},Ro.prototype.populatePaintArrays=function(t,e,n,r,i){for(var o in this.binders){var a=this.binders[o];(a instanceof ko||a instanceof Lo||a instanceof Io)&&a.populatePaintArray(t,e,n,r,i)}},Ro.prototype.setConstantPatternPositions=function(t,e){for(var n in this.binders){var r=this.binders[n];r instanceof Po&&r.setConstantPatternPositions(t,e)}},Ro.prototype.updatePaintArrays=function(t,e,n,r,i){var o=!1;for(var a in t)for(var s=0,u=e.getPositions(a);s<u.length;s+=1){var l=u[s],c=n.feature(l.index);for(var h in this.binders){var p=this.binders[h];if((p instanceof ko||p instanceof Lo||p instanceof Io)&&!0===p.expression.isStateDependent){var f=r.paint.get(h);p.expression=f.value,p.updatePaintArray(l.start,l.end,c,t[a],i),o=!0}}}return o},Ro.prototype.defines=function(){var t=[];for(var e in this.binders){var n=this.binders[e];(n instanceof Oo||n instanceof Po)&&t.push.apply(t,n.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Ro.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof ko||n instanceof Lo)for(var r=0;r<n.paintVertexAttributes.length;r++)t.push(n.paintVertexAttributes[r].name);else if(n instanceof Io)for(var i=0;i<lo.members.length;i++)t.push(lo.members[i].name)}return t},Ro.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof Oo||n instanceof Po||n instanceof Lo)for(var r=0,i=n.uniformNames;r<i.length;r+=1)t.push(i[r])}return t},Ro.prototype.getPaintVertexBuffers=function(){return this._buffers},Ro.prototype.getUniforms=function(t,e){var n=[];for(var r in this.binders){var i=this.binders[r];if(i instanceof Oo||i instanceof Po||i instanceof Lo)for(var o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=i.getBinding(t,e[s],s);n.push({name:s,property:r,binding:u})}}}return n},Ro.prototype.setUniforms=function(t,e,n,r){for(var i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.name,u=a.property;this.binders[u].setUniform(a.binding,r,n.get(u),s)}},Ro.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var n=this.binders[e];if(t&&n instanceof Io){var r=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else(n instanceof ko||n instanceof Lo)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}},Ro.prototype.upload=function(t){for(var e in this.binders){var n=this.binders[e];(n instanceof ko||n instanceof Lo||n instanceof Io)&&n.upload(t)}this.updatePaintBuffers()},Ro.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof ko||e instanceof Lo||e instanceof Io)&&e.destroy()}};var Do=function(t,e,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var r=0,i=t;r<i.length;r+=1){var o=i[r];this.programConfigurations[o.id]=new Ro(o,e,n)}this.needsUpload=!1,this._featureMap=new mo,this._bufferOffset=0};function No(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 Fo(t,e,n){var r={color:{source:Li,composite:Xi},number:{source:Gi,composite:Li}},i=function(t){return{"line-pattern":{source:Ii,composite:Ii},"fill-pattern":{source:Ii,composite:Ii},"fill-extrusion-pattern":{source:Ii,composite:Ii}}[t]}(t);return i&&i[n]||r[e][n]}Do.prototype.populatePaintArrays=function(t,e,n,r,i,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,r,i,o);void 0!==e.id&&this._featureMap.add(e.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Do.prototype.updatePaintArrays=function(t,e,n,r){for(var i=0,o=n;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,r)||this.needsUpload}},Do.prototype.get=function(t){return this.programConfigurations[t]},Do.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Do.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},zr("ConstantBinder",Oo),zr("CrossFadedConstantBinder",Po),zr("SourceExpressionBinder",ko),zr("CrossFadedCompositeBinder",Io),zr("CompositeExpressionBinder",Lo),zr("ProgramConfiguration",Ro,{omit:["_buffers"]}),zr("ProgramConfigurationSet",Do);var zo=Math.pow(2,14)-1,Bo=-zo-1;function jo(t){for(var e=8192/t.extent,n=t.loadGeometry(),r=0;r<n.length;r++)for(var i=n[r],o=0;o<i.length;o++){var a=i[o],s=Math.round(a.x*e),u=Math.round(a.y*e);a.x=c(s,Bo,zo),a.y=c(u,Bo,zo),(s<a.x||s>a.x+1||u<a.y||u>a.y+1)&&S("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return n}function Uo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?jo(t):[]}}function Zo(t,e,n,r,i){t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)}var Vo=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 Ci,this.indexArray=new Ui,this.segments=new so,this.programConfigurations=new Do(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Go(t,e){for(var n=0;n<t.length;n++)if(Qo(e,t[n]))return!0;for(var r=0;r<e.length;r++)if(Qo(t,e[r]))return!0;return!!Yo(t,e)}function Ho(t,e,n){return!!Qo(t,e)||!!$o(e,t,n)}function Wo(t,e){if(1===t.length)return Jo(e,t[0]);for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;i++)if(Qo(t,r[i]))return!0;for(var o=0;o<t.length;o++)if(Jo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Yo(t,e[a]))return!0;return!1}function qo(t,e,n){if(t.length>1){if(Yo(t,e))return!0;for(var r=0;r<e.length;r++)if($o(e[r],t,n))return!0}for(var i=0;i<t.length;i++)if($o(t[i],e,n))return!0;return!1}function Yo(t,e){if(0===t.length||0===e.length)return!1;for(var n=0;n<t.length-1;n++)for(var r=t[n],i=t[n+1],o=0;o<e.length-1;o++)if(Xo(r,i,e[o],e[o+1]))return!0;return!1}function Xo(t,e,n,r){return E(t,n,r)!==E(e,n,r)&&E(t,e,n)!==E(t,e,r)}function $o(t,e,n){var r=n*n;if(1===e.length)return t.distSqr(e[0])<r;for(var i=1;i<e.length;i++)if(Ko(t,e[i-1],e[i])<r)return!0;return!1}function Ko(t,e,n){var r=e.distSqr(n);if(0===r)return t.distSqr(e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return t.distSqr(i<0?e:i>1?n:n.sub(e)._mult(i)._add(e))}function Jo(t,e){for(var n,r,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(n=t[a]).length-1;s<n.length;u=s++)(r=n[s]).y>e.y!=(i=n[u]).y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function Qo(t,e){for(var n=!1,r=0,i=t.length-1;r<t.length;i=r++){var o=t[r],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function ta(t,e,n){var r=n[0],i=n[2];if(t.x<r.x&&e.x<r.x||t.x>i.x&&e.x>i.x||t.y<r.y&&e.y<r.y||t.y>i.y&&e.y>i.y)return!1;var o=E(t,e,n[0]);return o!==E(t,e,n[1])||o!==E(t,e,n[2])||o!==E(t,e,n[3])}function ea(t,e,n){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).getMaxValue(t)}function na(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ra(t,e,n,r,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===n&&a._rotate(-r);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(a));return s}Vo.prototype.populate=function(t,e,n){var r=this.layers[0],i=[],o=null;"circle"===r.type&&(o=r.layout.get("circle-sort-key"));for(var a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,c=u.id,h=u.index,p=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=Uo(l,f);if(this.layers[0]._featureFilter.filter(new si(this.zoom),d,n)){var m=o?o.evaluate(d,{},n):void 0,g={id:c,properties:l.properties,type:l.type,sourceLayerIndex:p,index:h,geometry:f?d.geometry:jo(l),patterns:{},sortKey:m};i.push(g)}}o&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,v=i;y<v.length;y+=1){var _=v[y],b=_.geometry,x=_.index,w=_.sourceLayerIndex,S=t[x].feature;this.addFeature(_,b,x,n),e.featureIndex.insert(S,b,x,w,this.index)}},Vo.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Vo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Vo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ao),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Vo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Vo.prototype.addFeature=function(t,e,n,r){for(var i=0,o=e;i<o.length;i+=1)for(var a=0,s=o[i];a<s.length;a+=1){var u=s[a],l=u.x,c=u.y;if(!(l<0||l>=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;Zo(this.layoutVertexArray,l,c,-1,-1),Zo(this.layoutVertexArray,l,c,1,-1),Zo(this.layoutVertexArray,l,c,1,1),Zo(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},r)},zr("CircleBucket",Vo,{omit:["layers"]});var ia=new xi({"circle-sort-key":new yi(Ot.layout_circle["circle-sort-key"])}),oa={paint:new xi({"circle-radius":new yi(Ot.paint_circle["circle-radius"]),"circle-color":new yi(Ot.paint_circle["circle-color"]),"circle-blur":new yi(Ot.paint_circle["circle-blur"]),"circle-opacity":new yi(Ot.paint_circle["circle-opacity"]),"circle-translate":new gi(Ot.paint_circle["circle-translate"]),"circle-translate-anchor":new gi(Ot.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new gi(Ot.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new gi(Ot.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yi(Ot.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yi(Ot.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yi(Ot.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(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 ua(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=n[0],b=n[1],x=n[2],w=n[3];return t[0]=_*r+b*s+x*h+w*m,t[1]=_*i+b*u+x*p+w*g,t[2]=_*o+b*l+x*f+w*y,t[3]=_*a+b*c+x*d+w*v,t[4]=(_=n[4])*r+(b=n[5])*s+(x=n[6])*h+(w=n[7])*m,t[5]=_*i+b*u+x*p+w*g,t[6]=_*o+b*l+x*f+w*y,t[7]=_*a+b*c+x*d+w*v,t[8]=(_=n[8])*r+(b=n[9])*s+(x=n[10])*h+(w=n[11])*m,t[9]=_*i+b*u+x*p+w*g,t[10]=_*o+b*l+x*f+w*y,t[11]=_*a+b*c+x*d+w*v,t[12]=(_=n[12])*r+(b=n[13])*s+(x=n[14])*h+(w=n[15])*m,t[13]=_*i+b*u+x*p+w*g,t[14]=_*o+b*l+x*f+w*y,t[15]=_*a+b*c+x*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,n=arguments.length;n--;)e+=t[n]*t[n];return Math.sqrt(e)});var la,ca=ua;function ha(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}la=new aa(3),aa!=Float32Array&&(la[0]=0,la[1]=0,la[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Vo(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+na(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a,s){for(var u=ra(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e){return t.map((function(t){return fa(t,e)}))}(u,s),p=c?l*a:l,f=0,d=r;f<d.length;f+=1)for(var m=0,g=d[f];m<g.length;m+=1){var y=g[m],v=c?y:fa(y,s),_=p,b=ha([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=b[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/b[3]),Ho(h,v,_))return!0}return!1},e}(wi));function fa(t,e){var n=ha([],[t.x,t.y,0,1],e);return new i(n[0]/n[3],n[1]/n[3])}var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Vo);function ma(t,e,n,r){var i=e.width,o=e.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==i*o*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(i*o*n);return t.width=i,t.height=o,t.data=r,t}function ga(t,e,n){var r=e.width,i=e.height;if(r!==t.width||i!==t.height){var o=ma({},{width:r,height:i},n);ya(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,i)},n),t.width=r,t.height=i,t.data=o.data}}function ya(t,e,n,r,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.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||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((n.y+u)*t.width+n.x)*o,c=((r.y+u)*e.width+r.x)*o,h=0;h<i.width*o;h++)s[c+h]=a[l+h];return e}zr("HeatmapBucket",da,{omit:["layers"]});var va=function(t,e){ma(this,t,1,e)};va.prototype.resize=function(t){ga(this,t,1)},va.prototype.clone=function(){return new va({width:this.width,height:this.height},new Uint8Array(this.data))},va.copy=function(t,e,n,r,i){ya(t,e,n,r,i,1)};var _a=function(t,e){ma(this,t,4,e)};_a.prototype.resize=function(t){ga(this,t,4)},_a.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},_a.prototype.clone=function(){return new _a({width:this.width,height:this.height},new Uint8Array(this.data))},_a.copy=function(t,e,n,r,i){ya(t,e,n,r,i,4)},zr("AlphaImage",va),zr("RGBAImage",_a);var ba={paint:new xi({"heatmap-radius":new yi(Ot.paint_heatmap["heatmap-radius"]),"heatmap-weight":new yi(Ot.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new gi(Ot.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bi(Ot.paint_heatmap["heatmap-color"]),"heatmap-opacity":new gi(Ot.paint_heatmap["heatmap-opacity"])})};function xa(t){var e={},n=t.resolution||256,r=t.clips?t.clips.length:1,i=t.image||new _a({width:n,height:r}),o=function(n,r,o){e[t.evaluationKey]=o;var a=t.expression.evaluate(e);i.data[n+r+0]=Math.floor(255*a.r/a.a),i.data[n+r+1]=Math.floor(255*a.g/a.a),i.data[n+r+2]=Math.floor(255*a.b/a.a),i.data[n+r+3]=Math.floor(255*a.a)};if(t.clips)for(var a=0,s=0;a<r;++a,s+=4*n)for(var u=0,l=0;u<n;u++,l+=4){var c=u/(n-1),h=t.clips[a];o(s,l,h.start*(1-c)+h.end*c)}else for(var p=0,f=0;p<n;p++,f+=4)o(0,f,p/(n-1));return i}var wa=function(t){function e(e){t.call(this,e,ba),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new da(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=xa({expression:this._transitionablePaint._values["heatmap-color"].value.expression,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}(wi),Sa={paint:new xi({"hillshade-illumination-direction":new gi(Ot.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new gi(Ot.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new gi(Ot.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new gi(Ot.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new gi(Ot.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new gi(Ot.paint_hillshade["hillshade-accent-color"])})},Ea=function(t){function e(e){t.call(this,e,Sa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(wi),Ma=Ti([{name:"a_pos",components:2,type:"Int16"}],4).members,Ta=Ca,Aa=Ca;function Ca(t,e,n){n=n||2;var r,i,o,a,s,u,l,c=e&&e.length,h=c?e[0]*n:t.length,p=Oa(t,0,h,n,!0),f=[];if(!p||p.next===p.prev)return f;if(c&&(p=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=Oa(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(ja(a));for(s.sort(Na),i=0;i<s.length;i++)Fa(s[i],n),n=Pa(n,n.next);return n}(t,e,p,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var d=n;d<h;d+=n)(s=t[d])<r&&(r=s),(u=t[d+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-r,a-i))?1/l:0}return ka(p,f,n,r,i,l),f}function Oa(t,e,n,r,i){var o,a;if(i===Qa(t,e,n,r)>0)for(o=e;o<n;o+=r)a=$a(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=$a(o,t[o],t[o+1],a);return a&&Ga(a,a.next)&&(Ka(a),a=a.next),a}function Pa(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Ga(r,r.next)&&0!==Va(r.prev,r,r.next))r=r.next;else{if(Ka(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function ka(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Ba(i.x,i.y,e,n,r)),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,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Ia(t,r,i,o):La(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),Ka(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?ka(t=Ra(Pa(t),e,n),e,n,r,i,o,2):2===a&&Da(t,e,n,r,i,o):ka(Pa(t),e,n,r,i,o,1);break}}}function La(t){var e=t.prev,n=t,r=t.next;if(Va(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ua(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Va(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ia(t,e,n,r){var i=t.prev,o=t,a=t.next;if(Va(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=Ba(i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,e,n,r),c=Ba(s,u,e,n,r),h=t.prevZ,p=t.nextZ;h&&h.z>=l&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Va(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=l;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Va(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Ra(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Ga(i,o)&&Ha(i,r,r.next,o)&&Ya(i,o)&&Ya(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Ka(r),Ka(r.next),r=t=o),r=r.next}while(r!==t);return Pa(r)}function Da(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Za(a,s)){var u=Xa(a,s);return a=Pa(a,a.next),u=Pa(u,u.next),ka(a,e,n,r,i,o),void ka(u,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function Na(t,e){return t.x-e.x}function Fa(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n;var u,l=n,c=n.x,h=n.y,p=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&Ua(o<h?i:a,o,c,h,o<h?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),Ya(r,t)&&(u<p||u===p&&(r.x>n.x||r.x===n.x&&za(n,r)))&&(n=r,p=u)),r=r.next}while(r!==l);return n}(t,e)){var n=Xa(e,t);Pa(e,e.next),Pa(n,n.next)}}function za(t,e){return Va(t.prev,t,e.prev)<0&&Va(e.next,t,t.next)<0}function Ba(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ja(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Ua(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Za(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ha(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ya(t,e)&&Ya(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(Va(t.prev,t,e.prev)||Va(t,e.prev,e))||Ga(t,e)&&Va(t.prev,t,t.next)>0&&Va(e.prev,e,e.next)>0)}function Va(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ga(t,e){return t.x===e.x&&t.y===e.y}function Ha(t,e,n,r){var i=qa(Va(t,e,n)),o=qa(Va(t,e,r)),a=qa(Va(n,r,t)),s=qa(Va(n,r,e));return i!==o&&a!==s||!(0!==i||!Wa(t,n,e))||!(0!==o||!Wa(t,r,e))||!(0!==a||!Wa(n,t,r))||!(0!==s||!Wa(n,e,r))}function Wa(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function qa(t){return t>0?1:t<0?-1:0}function Ya(t,e){return Va(t.prev,t,t.next)<0?Va(t,e,t.next)>=0&&Va(t,t.prev,e)>=0:Va(t,e,t.prev)<0||Va(t,t.next,e)<0}function Xa(t,e){var n=new Ja(t.i,t.x,t.y),r=new Ja(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function $a(t,e,n,r){var i=new Ja(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ka(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 Ja(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Qa(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function ts(t,e,n,r,i){!function t(e,n,r,i,o){for(;i>r;){if(i-r>600){var a=i-r+1,s=n-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*l/a+c)),Math.min(i,Math.floor(n+(a-s)*l/a+c)),o)}var h=e[n],p=r,f=i;for(es(e,r,n),o(e[i],h)>0&&es(e,r,i);p<f;){for(es(e,p,f),p++,f--;o(e[p],h)<0;)p++;for(;o(e[f],h)>0;)f--}0===o(e[r],h)?es(e,r,f):es(e,++f,i),f<=n&&(r=f+1),n<=f&&(i=f-1)}}(t,e,n||0,r||t.length-1,i||ns)}function es(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ns(t,e){return t<e?-1:t>e?1:0}function rs(t,e){var n=t.length;if(n<=1)return[t];for(var r,i,o=[],a=0;a<n;a++){var s=M(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(r&&o.push(r),r=[t[a]]):r.push(t[a]))}if(r&&o.push(r),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(ts(o[u],e,1,o[u].length-1,is),o[u]=o[u].slice(0,e));return o}function is(t,e){return e.area-t.area}function os(t,e,n){for(var r=n.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,r[u.to]=!0,r[u.from]=!0)}return i}function as(t,e,n,r,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var c=l.evaluate({zoom:r-1},n,{},i.availableImages),h=l.evaluate({zoom:r},n,{},i.availableImages),p=l.evaluate({zoom:r+1},n,{},i.availableImages);h=h&&h.name?h.name:h,p=p&&p.name?p.name:p,o[c=c&&c.name?c.name:c]=!0,o[h]=!0,o[p]=!0,n.patterns[u.id]={min:c,mid:h,max:p}}}return n}Ca.deviation=function(t,e,n,r){var i=e&&e.length,o=Math.abs(Qa(t,0,i?e[0]*n:t.length,n));if(i)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(Qa(t,e[a]*n,a<s-1?e[a+1]*n:t.length,n));var u=0;for(a=0;a<r.length;a+=3){var l=r[a]*n,c=r[a+1]*n,h=r[a+2]*n;u+=Math.abs((t[l]-t[h])*(t[c+1]-t[l+1])-(t[l]-t[c])*(t[h+1]-t[l+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},Ca.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&n.holes.push(r+=t[i-1].length)}return n},Ta.default=Aa;var ss=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 Ci,this.indexArray=new Ui,this.indexArray2=new qi,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,n){this.hasPattern=os("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,c=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f=Uo(u,p);if(this.layers[0]._featureFilter.filter(new si(this.zoom),f,n)){var d=r?r.evaluate(f,{},n,e.availableImages):void 0,m={id:l,properties:u.properties,type:u.type,sourceLayerIndex:h,index:c,geometry:p?f.geometry:jo(u),patterns:{},sortKey:d};i.push(m)}}r&&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],_=v.geometry,b=v.index,x=v.sourceLayerIndex;if(this.hasPattern){var w=as("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(v,_,b,n,{});e.featureIndex.insert(t[b].feature,_,b,x,this.index)}},ss.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},ss.prototype.addFeatures=function(t,e,n){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var o=i[r];this.addFeature(o,o.geometry,o.index,e,n)}},ss.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ss.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ss.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ma),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ss.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ss.prototype.addFeature=function(t,e,n,r,i){for(var o=0,a=rs(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),p=h.vertexLength,f=[],d=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&d.push(f.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),_=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(_+y.length-1,_),f.push(y[0].x),f.push(y[0].y);for(var b=1;b<y.length;b++)this.layoutVertexArray.emplaceBack(y[b].x,y[b].y),this.indexArray2.emplaceBack(_+b-1,_+b),f.push(y[b].x),f.push(y[b].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var x=Ta(f,d),w=0;w<x.length;w+=3)this.indexArray.emplaceBack(p+x[w],p+x[w+1],p+x[w+2]);h.vertexLength+=u,h.primitiveLength+=x.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,r)},zr("FillBucket",ss,{omit:["layers","patternFeatures"]});var us=new xi({"fill-sort-key":new yi(Ot.layout_fill["fill-sort-key"])}),ls={paint:new xi({"fill-antialias":new gi(Ot.paint_fill["fill-antialias"]),"fill-opacity":new yi(Ot.paint_fill["fill-opacity"]),"fill-color":new yi(Ot.paint_fill["fill-color"]),"fill-outline-color":new yi(Ot.paint_fill["fill-outline-color"]),"fill-translate":new gi(Ot.paint_fill["fill-translate"]),"fill-translate-anchor":new gi(Ot.paint_fill["fill-translate-anchor"]),"fill-pattern":new vi(Ot.paint_fill["fill-pattern"])}),layout:us},cs=function(t){function e(e){t.call(this,e,ls)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n);var 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"])},e.prototype.createBucket=function(t){return new ss(t)},e.prototype.queryRadius=function(){return na(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a){return Wo(ra(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),r)},e.prototype.isTileClipped=function(){return!0},e}(wi),hs=Ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ps=fs;function fs(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(ds,this,e)}function ds(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){for(var n=t.readVarint()+t.pos;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function ms(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)r+=((n=t[a]).x-(e=t[i]).x)*(e.y+n.y);return r}fs.types=["Unknown","Point","LineString","Polygon"],fs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,o=0,a=0,s=0,u=[];t.pos<n;){if(o<=0){var l=t.readVarint();r=7&l,o=l>>3}if(o--,1===r||2===r)a+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&u.push(e),u},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(r<=0){var c=t.readVarint();n=7&c,r=c>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,l]},fs.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=fs.types[this.type];function c(t){for(var e=0;e<t.length;e++){var n=t[e];t[e]=[360*(n.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(n.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<u.length;r++)h[r]=u[r][0];c(u=h);break;case 2:for(r=0;r<u.length;r++)c(u[r]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=ms(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}return n&&i.push(n),i}(u),r=0;r<u.length;r++)for(i=0;i<u[r].length;i++)c(u[r][i])}1===u.length?u=u[0]:l="Multi"+l;var p={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(p.id=this.id),p};var gs=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(vs,this,e),this.length=this._features.length}function vs(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){for(var e=null,n=t.readVarint()+t.pos;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}function _s(t,e,n){if(3===t){var r=new gs(n,n.readVarint()+n.pos);r.length&&(e[r.name]=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 ps(this._pbf,e,this.extent,this._keys,this._values)};var bs={VectorTile:function(t,e){this.layers=t.readFields(_s,{},e)},VectorTileFeature:ps,VectorTileLayer:gs},xs=bs.VectorTileFeature.types,ws=Math.pow(2,13);function Ss(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,2*Math.floor(r*ws)+a,i*ws*2,o*ws*2,Math.round(s))}var Es=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 Pi,this.indexArray=new Ui,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ms(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Es.prototype.populate=function(t,e,n){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var r=0,i=t;r<i.length;r+=1){var o=i[r],a=o.feature,s=o.id,u=o.index,l=o.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,h=Uo(a,c);if(this.layers[0]._featureFilter.filter(new si(this.zoom),h,n)){var p={id:s,sourceLayerIndex:l,index:u,geometry:c?h.geometry:jo(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(as("fill-extrusion",this.layers,p,this.zoom,e)):this.addFeature(p,p.geometry,u,n,{}),e.featureIndex.insert(a,p.geometry,u,l,this.index,!0)}}},Es.prototype.addFeatures=function(t,e,n){for(var r=0,i=this.features;r<i.length;r+=1){var o=i[r];this.addFeature(o,o.geometry,o.index,e,n)}},Es.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Es.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Es.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Es.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,hs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Es.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Es.prototype.addFeature=function(t,e,n,r,i){for(var o=0,a=rs(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,f=s;p<f.length;p+=1){var d=f[p];if(0!==d.length&&!((L=d).every((function(t){return t.x<0}))||L.every((function(t){return t.x>8192}))||L.every((function(t){return t.y<0}))||L.every((function(t){return t.y>8192}))))for(var m=0,g=0;g<d.length;g++){var y=d[g];if(g>=1){var v=d[g-1];if(!Ms(y,v)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=y.sub(v)._perp()._unit(),b=v.dist(y);m+b>32768&&(m=0),Ss(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,0,m),Ss(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,1,m),Ss(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m+=b),Ss(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m);var x=h.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===xs[t.type]){for(var w=[],S=[],E=h.vertexLength,M=0,T=s;M<T.length;M+=1){var A=T[M];if(0!==A.length){A!==s[0]&&S.push(w.length/2);for(var C=0;C<A.length;C++){var O=A[C];Ss(this.layoutVertexArray,O.x,O.y,0,0,1,1,0),w.push(O.x),w.push(O.y)}}}for(var P=Ta(w,S),k=0;k<P.length;k+=3)this.indexArray.emplaceBack(E+P[k],E+P[k+2],E+P[k+1]);h.primitiveLength+=P.length/3,h.vertexLength+=u}}var L;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,r)},zr("FillExtrusionBucket",Es,{omit:["layers","features"]});var Ts={paint:new xi({"fill-extrusion-opacity":new gi(Ot["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yi(Ot["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gi(Ot["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gi(Ot["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new vi(Ot["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yi(Ot["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yi(Ot["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gi(Ot["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},As=function(t){function e(e){t.call(this,e,Ts)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Es(t)},e.prototype.queryRadius=function(){return na(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,n,r,o,a,s,u){var l=ra(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,n),h=this.paint.get("fill-extrusion-base").evaluate(e,n),p=function(t,e,n,r){for(var o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=[u.x,u.y,0,1];ha(l,l,e),o.push(new i(l[0]/l[3],l[1]/l[3]))}return o}(l,u),f=function(t,e,n,r){for(var o=[],a=[],s=r[8]*e,u=r[9]*e,l=r[10]*e,c=r[11]*e,h=r[8]*n,p=r[9]*n,f=r[10]*n,d=r[11]*n,m=0,g=t;m<g.length;m+=1){for(var y=[],v=[],_=0,b=g[m];_<b.length;_+=1){var x=b[_],w=x.x,S=x.y,E=r[0]*w+r[4]*S+r[12],M=r[1]*w+r[5]*S+r[13],T=r[2]*w+r[6]*S+r[14],A=r[3]*w+r[7]*S+r[15],C=T+l,O=A+c,P=E+h,k=M+p,L=T+f,I=A+d,R=new i((E+s)/O,(M+u)/O);R.z=C/O,y.push(R);var D=new i(P/I,k/I);D.z=L/I,v.push(D)}o.push(y),a.push(v)}return[o,a]}(r,h,c,u);return function(t,e,n){var r=1/0;Wo(n,e)&&(r=Os(n,e[0]));for(var i=0;i<e.length;i++)for(var o=e[i],a=t[i],s=0;s<o.length-1;s++){var u=o[s],l=[u,o[s+1],a[s+1],a[s],u];Go(n,l)&&(r=Math.min(r,Os(n,l)))}return r!==1/0&&r}(f[0],f[1],p)},e}(wi);function Cs(t,e){return t.x*e.x+t.y*e.y}function Os(t,e){if(1===t.length){for(var n,r=0,i=e[r++];!n||i.equals(n);)if(!(n=e[r++]))return 1/0;for(;r<e.length;r++){var o=e[r],a=t[0],s=n.sub(i),u=o.sub(i),l=a.sub(i),c=Cs(s,s),h=Cs(s,u),p=Cs(u,u),f=Cs(l,s),d=Cs(l,u),m=c*p-h*h,g=(p*f-h*d)/m,y=(c*d-h*f)/m,v=i.z*(1-g-y)+n.z*g+o.z*y;if(isFinite(v))return v}return 1/0}for(var _=1/0,b=0,x=e;b<x.length;b+=1)_=Math.min(_,x[b].z);return _}var Ps=Ti([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,ks=Ti([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Ls=bs.VectorTileFeature.types,Is=Math.cos(Math.PI/180*37.5),Rs=Math.pow(2,14)/.5,Ds=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 ki,this.layoutVertexArray2=new Li,this.indexArray=new Ui,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ds.prototype.populate=function(t,e,n){this.hasPattern=os("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,c=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f=Uo(u,p);if(this.layers[0]._featureFilter.filter(new si(this.zoom),f,n)){var d=r?r.evaluate(f,{},n):void 0,m={id:l,properties:u.properties,type:u.type,sourceLayerIndex:h,index:c,geometry:p?f.geometry:jo(u),patterns:{},sortKey:d};i.push(m)}}r&&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],_=v.geometry,b=v.index,x=v.sourceLayerIndex;if(this.hasPattern){var w=as("line",this.layers,v,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(v,_,b,n,{});e.featureIndex.insert(t[b].feature,_,b,x,this.index)}},Ds.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Ds.prototype.addFeatures=function(t,e,n){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var o=i[r];this.addFeature(o,o.geometry,o.index,e,n)}},Ds.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ds.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ds.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,ks)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ps),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ds.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ds.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}},Ds.prototype.addFeature=function(t,e,n,r,i){var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),u=o.get("line-miter-limit"),l=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,h=e;c<h.length;c+=1)this.addLine(h[c],t,a,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,r)},Ds.prototype.addLine=function(t,e,n,r,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===Ls[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===n&&(i=1.05);var c,h=this.overscaling<=16?122880/(512*this.overscaling):0,p=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(g=t[l].sub(c=t[u-2])._unit()._perp());for(var y=l;y<u;y++)if(!(d=y===u-1?s?t[l+1]:void 0:t[y+1])||!t[y].equals(d)){g&&(m=g),c&&(f=c),c=t[y],g=d?d.sub(c)._unit()._perp():m;var v=(m=m||g).add(g);0===v.x&&0===v.y||v._unit();var _=m.x*g.x+m.y*g.y,b=v.x*g.x+v.y*g.y,x=0!==b?1/b:1/0,w=2*Math.sqrt(2-2*b),S=b<Is&&f&&d,E=m.x*g.y-m.y*g.x>0;if(S&&y>l){var M=c.dist(f);if(M>2*h){var T=c.sub(c.sub(f)._mult(h/M)._round());this.updateDistance(f,T),this.addCurrentVertex(T,m,0,0,p),f=T}}var A=f&&d,C=A?n:s?"butt":r;if(A&&"round"===C&&(x<o?C="miter":x<=2&&(C="fakeround")),"miter"===C&&x>i&&(C="bevel"),"bevel"===C&&(x>2&&(C="flipbevel"),x<i&&(C="miter")),f&&this.updateDistance(f,c),"miter"===C)v._mult(x),this.addCurrentVertex(c,v,0,0,p);else if("flipbevel"===C){if(x>100)v=g.mult(-1);else{var O=x*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(O*(E?-1:1))}this.addCurrentVertex(c,v,0,0,p),this.addCurrentVertex(c,v.mult(-1),0,0,p)}else if("bevel"===C||"fakeround"===C){var P=-Math.sqrt(x*x-1),k=E?P:0,L=E?0:P;if(f&&this.addCurrentVertex(c,m,k,L,p),"fakeround"===C)for(var I=Math.round(180*w/Math.PI/20),R=1;R<I;R++){var D=R/I;if(.5!==D){var N=D-.5;D+=D*N*(D-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*N*N+(.848013+_*(.215638*_-1.06021)))}var F=g.sub(m)._mult(D)._add(m)._unit()._mult(E?-1:1);this.addHalfVertex(c,F.x,F.y,!1,E,0,p)}d&&this.addCurrentVertex(c,g,-k,-L,p)}else if("butt"===C)this.addCurrentVertex(c,v,0,0,p);else if("square"===C){var z=f?1:-1;this.addCurrentVertex(c,v,z,z,p)}else"round"===C&&(f&&(this.addCurrentVertex(c,m,0,0,p),this.addCurrentVertex(c,m,1,1,p,!0)),d&&(this.addCurrentVertex(c,g,-1,-1,p,!0),this.addCurrentVertex(c,g,0,0,p)));if(S&&y<u-1){var B=c.dist(d);if(B>2*h){var j=c.add(d.sub(c)._mult(h/B)._round());this.updateDistance(c,j),this.addCurrentVertex(j,g,0,0,p),c=j}}}}},Ds.prototype.addCurrentVertex=function(t,e,n,r,i,o){void 0===o&&(o=!1);var a=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*n,e.y-e.x*n,o,!1,n,i),this.addHalfVertex(t,a,s,o,!0,-r,i),this.distance>Rs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,n,r,i,o))},Ds.prototype.addHalfVertex=function(t,e,n,r,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Rs-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(r?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Ds.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ds.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},zr("LineBucket",Ds,{omit:["layers","patternFeatures"]});var Ns=new xi({"line-cap":new gi(Ot.layout_line["line-cap"]),"line-join":new yi(Ot.layout_line["line-join"]),"line-miter-limit":new gi(Ot.layout_line["line-miter-limit"]),"line-round-limit":new gi(Ot.layout_line["line-round-limit"]),"line-sort-key":new yi(Ot.layout_line["line-sort-key"])}),Fs={paint:new xi({"line-opacity":new yi(Ot.paint_line["line-opacity"]),"line-color":new yi(Ot.paint_line["line-color"]),"line-translate":new gi(Ot.paint_line["line-translate"]),"line-translate-anchor":new gi(Ot.paint_line["line-translate-anchor"]),"line-width":new yi(Ot.paint_line["line-width"]),"line-gap-width":new yi(Ot.paint_line["line-gap-width"]),"line-offset":new yi(Ot.paint_line["line-offset"]),"line-blur":new yi(Ot.paint_line["line-blur"]),"line-dasharray":new _i(Ot.paint_line["line-dasharray"]),"line-pattern":new vi(Ot.paint_line["line-pattern"]),"line-gradient":new bi(Ot.paint_line["line-gradient"])}),layout:Ns},zs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,n){return n=new si(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),t.prototype.possiblyEvaluate.call(this,e,n)},e.prototype.evaluate=function(e,n,r,i){return n=p({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,r,i)},e}(yi))(Fs.paint.properties["line-width"].specification);zs.useIntegerZoom=!0;var Bs=function(t){function e(e){t.call(this,e,Fs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ve,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n),this.paint._values["line-floorwidth"]=zs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ds(t)},e.prototype.queryRadius=function(t){var e=t,n=js(ea("line-width",this,e),ea("line-gap-width",this,e)),r=ea("line-offset",this,e);return n/2+Math.abs(r)+na(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,o,a,s){var u=ra(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*js(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),c=this.paint.get("line-offset").evaluate(e,n);return c&&(r=function(t,e){for(var n=[],r=new i(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u],c=a[u+1],h=0===u?r:l.sub(a[u-1])._unit()._perp(),p=u===a.length-1?r:c.sub(l)._unit()._perp(),f=h._add(p)._unit();f._mult(1/(f.x*p.x+f.y*p.y)),s.push(f._mult(e)._add(l))}n.push(s)}return n}(r,c*s)),function(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];if(t.length>=3)for(var o=0;o<i.length;o++)if(Qo(t,i[o]))return!0;if(qo(t,i,n))return!0}return!1}(u,r,l)},e.prototype.isTileClipped=function(){return!0},e}(wi);function js(t,e){return e>0?e+2*t:t}var Us=Ti([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Zs=Ti([{name:"a_projected_pos",components:3,type:"Float32"}],4),Vs=(Ti([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ti([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Gs=(Ti([{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"}]),Ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Hs=Ti([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ws(t,e,n){return t.sections.forEach((function(t){t.text=function(t,e,n){var r=e.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,n)})),t}Ti([{name:"triangle",components:3,type:"Uint16"}]),Ti([{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"}]),Ti([{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"}]),Ti([{type:"Float32",name:"offsetX"}]),Ti([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var qs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ys=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,h=n?i-1:0,p=n?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)},Xs=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?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,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+f]=255&a,f+=d,a/=256,l-=8);t[n+f-d]|=128*m},$s=Ks;function Ks(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ks.Varint=0,Ks.Fixed64=1,Ks.Bytes=2,Ks.Fixed32=5;var Js="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Qs(t){return t.type===Ks.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function nu(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function ru(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function iu(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function ou(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function au(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function su(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function uu(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function lu(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function cu(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function hu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function pu(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function fu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function du(t,e,n){1===t&&n.readMessage(mu,e)}function mu(t,e,n){if(3===t){var r=n.readMessage(gu,{}),i=r.width,o=r.height,a=r.left,s=r.top,u=r.advance;e.push({id:r.id,bitmap:new va({width:i+6,height:o+6},r.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function gu(t,e,n){1===t?e.id=n.readVarint():2===t?e.bitmap=n.readBytes():3===t?e.width=n.readVarint():4===t?e.height=n.readVarint():5===t?e.left=n.readSVarint():6===t?e.top=n.readSVarint():7===t&&(e.advance=n.readVarint())}function yu(t){for(var e=0,n=0,r=0,i=t;r<i.length;r+=1){var o=i[r];e+=o.w*o.h,n=Math.max(n,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}],s=0,u=0,l=0,c=t;l<c.length;l+=1)for(var h=c[l],p=a.length-1;p>=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p<a.length&&(a[p]=d)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(a.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}Ks.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*fu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ys(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ys(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return tu(t,r,e);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return tu(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Js?function(t,e,n){return Js.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",i=e;i<n;){var o,a,s,u=t[i],l=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c>n)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=c}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ks.Bytes)return t.push(this.readVarint(e));var n=Qs(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Ks.Bytes)return t.push(this.readSVarint());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ks.Bytes)return t.push(this.readBoolean());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ks.Bytes)return t.push(this.readFloat());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ks.Bytes)return t.push(this.readDouble());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ks.Bytes)return t.push(this.readFixed32());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ks.Bytes)return t.push(this.readSFixed32());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ks.Bytes)return t.push(this.readFixed64());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ks.Bytes)return t.push(this.readSFixed64());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ks.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ks.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ks.Fixed32)this.pos+=4;else{if(e!==Ks.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),pu(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),pu(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),pu(this.buf,-1&t,this.pos),pu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),pu(this.buf,-1&t,this.pos),pu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,n.buf[n.pos]=127&(t>>>=7)}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&eu(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),Xs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Xs(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&eu(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,Ks.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writeBytesField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var vu=function(t,e){var n=e.pixelRatio,r=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=n,this.stretchX=i,this.stretchY=o,this.content=a,this.version=r},_u={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_u.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},_u.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},_u.tlbr.get=function(){return this.tl.concat(this.br)},_u.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(vu.prototype,_u);var bu=function(t,e){var n={},r={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,n,i),this.addImages(e,r,i);var o=yu(i),a=new _a({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=n[s].paddedRect;_a.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var h=e[c],p=r[c].paddedRect,f=p.x+1,d=p.y+1,m=h.data.width,g=h.data.height;_a.copy(h.data,a,{x:0,y:0},{x:f,y:d},h.data),_a.copy(h.data,a,{x:0,y:g-1},{x:f,y:d-1},{width:m,height:1}),_a.copy(h.data,a,{x:0,y:0},{x:f,y:d+g},{width:m,height:1}),_a.copy(h.data,a,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:g}),_a.copy(h.data,a,{x:0,y:0},{x:f+m,y:d},{width:1,height:g})}this.image=a,this.iconPositions=n,this.patternPositions=r};bu.prototype.addImages=function(t,e,n){for(var r in t){var i=t[r],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(o),e[r]=new vu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},bu.prototype.patchUpdatedImages=function(t,e){for(var n in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[n],t.getImage(n),e),this.patchUpdatedImage(this.patternPositions[n],t.getImage(n),e)},bu.prototype.patchUpdatedImage=function(t,e,n){if(t&&e&&t.version!==e.version){t.version=e.version;var r=t.tl;n.update(e.data,void 0,{x:r[0],y:r[1]})}},zr("ImagePosition",vu),zr("ImageAtlas",bu);var xu={horizontal:1,vertical:2,horizontalOnly:3},wu=function(){this.scale=1,this.fontStack="",this.imageName=null};wu.forText=function(t,e){var n=new wu;return n.scale=t||1,n.fontStack=e,n},wu.forImage=function(t){var e=new wu;return e.imageName=t,e};var Su=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Eu(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m){var g,y=Su.fromFeature(t,i);h===xu.vertical&&y.verticalizePunctuation();var v=ai.processBidirectionalText,_=ai.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var b=0,x=v(y.toString(),ku(y,l,o,e,r,f,d));b<x.length;b+=1){var w=x[b],S=new Su;S.text=w,S.sections=y.sections;for(var E=0;E<w.length;E++)S.sectionIndex.push(0);g.push(S)}}else if(_){g=[];for(var M=0,T=_(y.text,y.sectionIndex,ku(y,l,o,e,r,f,d));M<T.length;M+=1){var A=T[M],C=new Su;C.text=A[0],C.sectionIndex=A[1],C.sections=y.sections,g.push(C)}}else g=function(t,e){for(var n=[],r=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];n.push(t.substring(i,s)),i=s}return i<r.length&&n.push(t.substring(i,r.length)),n}(y,ku(y,l,o,e,r,f,d));var O=[],P={positionedLines:O,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,n,r,i,o,a,s,u,l,c,h){for(var p=0,f=-17,d=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,_=i;v<_.length;v+=1){var b=_[v];b.trim();var x=b.getMaxScale(),w=24*(x-1),S={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=S;var E=S.positionedGlyphs,M=0;if(b.length()){for(var T=0;T<b.length();T++){var A=b.getSection(T),C=b.getSectionIndex(T),O=b.getCharCode(T),P=0,k=null,L=null,I=null,R=24,D=!(u===xu.horizontal||!c&&!qr(O)||c&&(Mu[O]||(G=O,Hr.Arabic(G)||Hr["Arabic Supplement"](G)||Hr["Arabic Extended-A"](G)||Hr["Arabic Presentation Forms-A"](G)||Hr["Arabic Presentation Forms-B"](G))));if(A.imageName){var N=r[A.imageName];if(!N)continue;I=A.imageName,t.iconsInText=t.iconsInText||!0,L=N.paddedRect;var F=N.displaySize;A.scale=24*A.scale/h,P=w+(24-F[1]*A.scale),R=(k={width:F[0],height:F[1],left:1,top:-3,advance:D?F[1]:F[0]}).advance;var z=D?F[0]*A.scale-24*x:F[1]*A.scale-24*x;z>0&&z>M&&(M=z)}else{var B=n[A.fontStack],j=B&&B[O];if(j&&j.rect)L=j.rect,k=j.metrics;else{var U=e[A.fontStack],Z=U&&U[O];if(!Z)continue;k=Z.metrics}P=24*(x-A.scale)}D?(t.verticalizable=!0,E.push({glyph:O,imageName:I,x:p,y:f+P,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:k,rect:L}),p+=R*A.scale+l):(E.push({glyph:O,imageName:I,x:p,y:f+P,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:k,rect:L}),p+=k.advance*A.scale+l)}0!==E.length&&(d=Math.max(p-l,d),Iu(E,0,E.length-1,g,M)),p=0;var V=o*x+M;S.lineOffset=Math.max(M,w),f+=V,m=Math.max(V,m),++y}else f+=o,++y}var G,H=f- -17,W=Lu(a),q=W.horizontalAlign,Y=W.verticalAlign;(function(t,e,n,r,i,o,a,s,u){var l,c=(e-n)*i;l=o!==a?-s*r- -17:(-r*u+.5)*a;for(var h=0,p=t;h<p.length;h+=1)for(var f=0,d=p[h].positionedGlyphs;f<d.length;f+=1){var m=d[f];m.x+=c,m.y+=l}})(t.positionedLines,g,q,Y,d,m,o,H,i.length),t.top+=-Y*H,t.bottom=t.top+H,t.left+=-q*d,t.right=t.left+d}(P,e,n,r,g,a,s,u,h,l,p,m),!function(t){for(var e=0,n=t;e<n.length;e+=1)if(0!==n[e].positionedGlyphs.length)return!1;return!0}(O)&&P}Su.fromFeature=function(t,e){for(var n=new Su,r=0;r<t.sections.length;r++){var i=t.sections[r];i.image?n.addImageSection(i):n.addTextSection(i,e)}return n},Su.prototype.length=function(){return this.text.length},Su.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},Su.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},Su.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},Su.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n+1)||null,i=t.charCodeAt(n-1)||null;e+=r&&Yr(r)&&!qs[t[n+1]]||i&&Yr(i)&&!qs[t[n-1]]||!qs[t[n]]?t[n]:qs[t[n]]}return e}(this.text)},Su.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Mu[this.text.charCodeAt(e)];e++)t++;for(var n=this.text.length,r=this.text.length-1;r>=0&&r>=t&&Mu[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},Su.prototype.substring=function(t,e){var n=new Su;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},Su.prototype.toString=function(){return this.text},Su.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}),0)},Su.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(wu.forText(t.scale,t.fontStack||e));for(var n=this.sections.length-1,r=0;r<t.text.length;++r)this.sectionIndex.push(n)},Su.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(wu.forImage(e)),this.sectionIndex.push(this.sections.length-1)):S("Reached maximum number of images 6401")}else S("Can't add FormattedSection with an empty image.")},Su.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Mu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Tu={};function Au(t,e,n,r,i,o){if(e.imageName){var a=r[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=n[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Cu(t,e,n,r){var i=Math.pow(t-e,2);return r?t<e?i/2:2*i:i+Math.abs(n)*n}function Ou(t,e,n){var r=0;return 10===t&&(r-=1e4),n&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Pu(t,e,n,r,i,o){for(var a=null,s=Cu(e,n,i,o),u=0,l=r;u<l.length;u+=1){var c=l[u],h=Cu(e-c.x,n,i,o)+c.badness;h<=s&&(a=c,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function ku(t,e,n,r,i,o,a){if("point"!==o)return[];if(!t)return[];for(var s,u=[],l=function(t,e,n,r,i,o){for(var a=0,s=0;s<t.length();s++){var u=t.getSection(s);a+=Au(t.getCharCode(s),u,r,i,e,o)}return a/Math.max(1,Math.ceil(a/n))}(t,e,n,r,i,a),c=t.text.indexOf("")>=0,h=0,p=0;p<t.length();p++){var f=t.getSection(p),d=t.getCharCode(p);if(Mu[d]||(h+=Au(d,f,r,i,e,a)),p<t.length()-1){var m=!((s=d)<11904||!(Hr["Bopomofo Extended"](s)||Hr.Bopomofo(s)||Hr["CJK Compatibility Forms"](s)||Hr["CJK Compatibility Ideographs"](s)||Hr["CJK Compatibility"](s)||Hr["CJK Radicals Supplement"](s)||Hr["CJK Strokes"](s)||Hr["CJK Symbols and Punctuation"](s)||Hr["CJK Unified Ideographs Extension A"](s)||Hr["CJK Unified Ideographs"](s)||Hr["Enclosed CJK Letters and Months"](s)||Hr["Halfwidth and Fullwidth Forms"](s)||Hr.Hiragana(s)||Hr["Ideographic Description Characters"](s)||Hr["Kangxi Radicals"](s)||Hr["Katakana Phonetic Extensions"](s)||Hr.Katakana(s)||Hr["Vertical Forms"](s)||Hr["Yi Radicals"](s)||Hr["Yi Syllables"](s)));(Tu[d]||m||f.imageName)&&u.push(Pu(p+1,h,l,u,Ou(d,t.getCharCode(p+1),m&&c),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Pu(t.length(),h,l,u,0,!0))}function Lu(t){var e=.5,n=.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":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function Iu(t,e,n,r,i){if(r||i)for(var o=t[n],a=(t[n].x+o.metrics.advance*o.scale)*r,s=e;s<=n;s++)t[s].x-=a,t[s].y+=i}function Ru(t,e,n,r,i,o){var a,s=t.image;if(s.content){var u=s.content,l=s.pixelRatio||1;a=[u[0]/l,u[1]/l,s.displaySize[0]-u[2]/l,s.displaySize[1]-u[3]/l]}var c,h,p,f,d=e.left*o,m=e.right*o;"width"===n||"both"===n?(f=i[0]+d-r[3],h=i[0]+m+r[1]):h=(f=i[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var g=e.top*o,y=e.bottom*o;return"height"===n||"both"===n?(c=i[1]+g-r[0],p=i[1]+y+r[2]):p=(c=i[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:h,bottom:p,left:f,collisionPadding:a}}Tu[10]=!0,Tu[32]=!0,Tu[38]=!0,Tu[40]=!0,Tu[41]=!0,Tu[43]=!0,Tu[45]=!0,Tu[47]=!0,Tu[173]=!0,Tu[183]=!0,Tu[8203]=!0,Tu[8208]=!0,Tu[8211]=!0,Tu[8231]=!0;var Du=function(t){function e(e,n,r,i){t.call(this,e,n),this.angle=r,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);function Nu(t,e){var n=e.expression;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new si(t+1))};if("source"===n.kind)return{kind:"source"};for(var r=n.zoomStops,i=n.interpolationType,o=0;o<r.length&&r[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<r.length&&r[a]<t+1;)a++;a=Math.min(r.length-1,a);var s=r[o],u=r[a];return"composite"===n.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:n.evaluate(new si(s)),maxSize:n.evaluate(new si(u)),interpolationType:i}}function Fu(t,e,n){var r=e.uSize,i=n.lowerSize;return"source"===t.kind?i/128:"composite"===t.kind?Ge(i/128,n.upperSize/128,e.uSizeT):r}function zu(t,e){var n=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,o=i?c(an.interpolationFactor(i,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?r=Ge(t.minSize,t.maxSize,o):n=o}return{uSizeT:n,uSize:r}}zr("Anchor",Du);var Bu=Object.freeze({__proto__:null,getSizeData:Nu,evaluateSizeForFeature:Fu,evaluateSizeForZoom:zu,SIZE_PACK_FACTOR:128});function ju(t,e,n,r,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-n/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<n/2;){var c=t[a],h=t[a+1];if(!h)return!1;var p=t[a-1].angleTo(c)-c.angleTo(h);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:p}),l+=p;s-u[0].distance>r;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Uu(t){for(var e=0,n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}function Zu(t,e,n){return t?.6*e*n:0}function Vu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Gu(t,e,n,r,i,o){for(var a=Zu(n,i,o),s=Vu(n,r)*o,u=0,l=Uu(t)/2,c=0;c<t.length-1;c++){var h=t[c],p=t[c+1],f=h.dist(p);if(u+f>l){var d=(l-u)/f,m=Ge(h.x,p.x,d),g=Ge(h.y,p.y,d),y=new Du(m,g,p.angleTo(h),c);return y._round(),!a||ju(t,y,s,a,e)?y:void 0}u+=f}}function Hu(t,e,n,r,i,o,a,s,u){var l=Zu(r,o,a),c=Vu(r,i),h=c*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h<e/4&&(e=h+e/4),function t(e,n,r,i,o,a,s,u,l){for(var c=a/2,h=Uu(e),p=0,f=n-r,d=[],m=0;m<e.length-1;m++){for(var g=e[m],y=e[m+1],v=g.dist(y),_=y.angleTo(g);f+r<p+v;){var b=((f+=r)-p)/v,x=Ge(g.x,y.x,b),w=Ge(g.y,y.y,b);if(x>=0&&x<l&&w>=0&&w<l&&f-c>=0&&f+c<=h){var S=new Du(x,w,_,m);S._round(),i&&!ju(e,S,a,i,o)||d.push(S)}}p+=v}return u||d.length||s||(d=t(e,p/2,r,i,o,a,s,!0,l)),d}(t,p?e/2*s%e:(c/2+2*o)*a*s%e,e,l,n,h,p,!1,u)}function Wu(t,e,n,r,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,c=0;c<u.length-1;c++){var h=u[c],p=u[c+1];h.x<e&&p.x<e||(h.x<e?h=new i(e,h.y+(e-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x<e&&(p=new i(e,h.y+(e-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y<n&&p.y<n||(h.y<n?h=new i(h.x+(n-h.y)/(p.y-h.y)*(p.x-h.x),n)._round():p.y<n&&(p=new i(h.x+(n-h.y)/(p.y-h.y)*(p.x-h.x),n)._round()),h.x>=r&&p.x>=r||(h.x>=r?h=new i(r,h.y+(r-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=r&&(p=new i(r,h.y+(r-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),l&&h.equals(l[l.length-1])||a.push(l=[h]),l.push(p)))))}return a}function qu(t,e,n,r){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},m=p.reduce(d,0),g=f.reduce(d,0),y=u-m,v=l-g,_=0,b=m,x=0,w=g,S=0,E=y,M=0,T=v;if(a.content&&r){var A=a.content;_=Yu(p,0,A[0]),x=Yu(f,0,A[1]),b=Yu(p,A[0],A[2]),w=Yu(f,A[1],A[3]),S=A[0]-_,M=A[1]-x,E=A[2]-A[0]-b,T=A[3]-A[1]-w}var C=function(r,o,u,l){var p=$u(r.stretch-_,b,c,t.left),f=Ku(r.fixed-S,E,r.stretch,m),d=$u(o.stretch-x,w,h,t.top),y=Ku(o.fixed-M,T,o.stretch,g),v=$u(u.stretch-_,b,c,t.left),A=Ku(u.fixed-S,E,u.stretch,m),C=$u(l.stretch-x,w,h,t.top),O=Ku(l.fixed-M,T,l.stretch,g),P=new i(p,d),k=new i(v,d),L=new i(v,C),I=new i(p,C),R=new i(f/s,y/s),D=new i(A/s,O/s),N=e*Math.PI/180;if(N){var F=Math.sin(N),z=Math.cos(N),B=[z,-F,F,z];P._matMult(B),k._matMult(B),I._matMult(B),L._matMult(B)}var j=r.stretch+r.fixed,U=o.stretch+o.fixed;return{tl:P,tr:k,bl:I,br:L,tex:{x:a.paddedRect.x+1+j,y:a.paddedRect.y+1+U,w:u.stretch+u.fixed-j,h:l.stretch+l.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:D,minFontScaleX:E/s/c,minFontScaleY:T/s/h,isSDF:n}};if(r&&(a.stretchX||a.stretchY))for(var O=Xu(p,y,m),P=Xu(f,v,g),k=0;k<O.length-1;k++)for(var L=O[k],I=O[k+1],R=0;R<P.length-1;R++)o.push(C(L,P[R],I,P[R+1]));else o.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:l+1}));return o}function Yu(t,e,n){for(var r=0,i=0,o=t;i<o.length;i+=1){var a=o[i];r+=Math.max(e,Math.min(n,a[1]))-Math.max(e,Math.min(n,a[0]))}return r}function Xu(t,e,n){for(var r=[{fixed:-1,stretch:0}],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a[0],u=a[1],l=r[r.length-1];r.push({fixed:s-l.stretch,stretch:l.stretch}),r.push({fixed:s-l.stretch,stretch:l.stretch+(u-s)})}return r.push({fixed:e+1,stretch:n}),r}function $u(t,e,n,r){return t/e*n+r}function Ku(t,e,n,r){return t-e*n/r}var Ju=function(t,e,n,r,o,a,s,u,l,c){if(this.boxStartIndex=t.length,l){var h=a.top,p=a.bottom,f=a.collisionPadding;f&&(h-=f[1],p+=f[3]);var d=p-h;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=a.top*s-u,g=a.bottom*s+u,y=a.left*s-u,v=a.right*s+u,_=a.collisionPadding;if(_&&(y-=_[0]*s,m-=_[1]*s,v+=_[2]*s,g+=_[3]*s),c){var b=new i(y,m),x=new i(v,m),w=new i(y,g),S=new i(v,g),E=c*Math.PI/180;b._rotate(E),x._rotate(E),w._rotate(E),S._rotate(E),y=Math.min(b.x,x.x,w.x,S.x),v=Math.max(b.x,x.x,w.x,S.x),m=Math.min(b.y,x.y,w.y,S.y),g=Math.max(b.y,x.y,w.y,S.y)}t.emplaceBack(e.x,e.y,y,m,v,g,n,r,o)}this.boxEndIndex=t.length},Qu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tl),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function tl(t,e){return t<e?-1:t>e?1:0}function el(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var r=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var c=u[l];(!l||c.x<r)&&(r=c.x),(!l||c.y<o)&&(o=c.y),(!l||c.x>a)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var h=Math.min(a-r,s-o),p=h/2,f=new Qu([],nl);if(0===h)return new i(r,o);for(var d=r;d<a;d+=h)for(var m=o;m<s;m+=h)f.push(new rl(d+p,m+p,p,t));for(var g=function(t){for(var e=0,n=0,r=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var u=i[o],l=i[s],c=u.x*l.y-l.x*u.y;n+=(u.x+l.x)*c,r+=(u.y+l.y)*c,e+=3*c}return new rl(n/e,r/e,0,t)}(t),y=f.length;f.length;){var v=f.pop();(v.d>g.d||!g.d)&&(g=v,n&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,y)),v.max-g.d<=e||(f.push(new rl(v.p.x-(p=v.h/2),v.p.y-p,p,t)),f.push(new rl(v.p.x+p,v.p.y-p,p,t)),f.push(new rl(v.p.x-p,v.p.y+p,p,t)),f.push(new rl(v.p.x+p,v.p.y+p,p,t)),y+=4)}return n&&(console.log("num probes: "+y),console.log("best distance: "+g.d)),g.p}function nl(t,e){return e.max-t.max}function rl(t,e,n,r){this.p=new i(t,e),this.h=n,this.d=function(t,e){for(var n=!1,r=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],c=o[u];l.y>t.y!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(n=!n),r=Math.min(r,Ko(t,l,c))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}Qu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Qu.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}},Qu.prototype.peek=function(){return this.data[0]},Qu.prototype._up=function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},Qu.prototype._down=function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,i)>=0)break;e[t]=a,t=o}e[t]=i};var il=Number.POSITIVE_INFINITY;function ol(t,e){return e[1]!==il?function(t,e,n){var r=0,i=0;switch(e=Math.abs(e),n=Math.abs(n),t){case"top-right":case"top-left":case"top":i=n-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-n}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,i]}(t,e[0],e[1]):function(t,e){var n=0,r=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":r=i-7;break;case"bottom-right":case"bottom-left":r=7-i;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=e;break;case"right":n=-e}return[n,r]}(t,e[0])}function al(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 sl(t,e,n,r,o,a,s,u,l,c,h,p,f,d,m){var g=function(t,e,n,r,o,a,s,u){for(var l=r.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,p=e.positionedLines;h<p.length;h+=1)for(var f=p[h],d=0,m=f.positionedGlyphs;d<m.length;d+=1){var g=m[d];if(g.rect){var y=g.rect||{},v=4,_=!0,b=1,x=0,w=(o||u)&&g.vertical,S=g.metrics.advance*g.scale/2;if(u&&e.verticalizable&&(x=f.lineOffset/2-(g.imageName?-(24-g.metrics.width*g.scale)/2:24*(g.scale-1))),g.imageName){var E=s[g.imageName];_=E.sdf,v=1/(b=E.pixelRatio)}var M=o?[g.x+S,g.y]:[0,0],T=o?[0,0]:[g.x+S+n[0],g.y+n[1]-x],A=[0,0];w&&(A=T,T=[0,0]);var C=(g.metrics.left-v)*g.scale-S+T[0],O=(-g.metrics.top-v)*g.scale+T[1],P=C+y.w*g.scale/b,k=O+y.h*g.scale/b,L=new i(C,O),I=new i(P,O),R=new i(C,k),D=new i(P,k);if(w){var N=new i(-S,S- -17),F=-Math.PI/2,z=12-S,B=new i(22-z,-(g.imageName?z:0)),j=new(Function.prototype.bind.apply(i,[null].concat(A)));L._rotateAround(F,N)._add(B)._add(j),I._rotateAround(F,N)._add(B)._add(j),R._rotateAround(F,N)._add(B)._add(j),D._rotateAround(F,N)._add(B)._add(j)}if(l){var U=Math.sin(l),Z=Math.cos(l),V=[Z,-U,U,Z];L._matMult(V),I._matMult(V),R._matMult(V),D._matMult(V)}var G=new i(0,0),H=new i(0,0);c.push({tl:L,tr:I,bl:R,br:D,tex:y,writingMode:e.writingMode,glyphOffset:M,sectionIndex:g.sectionIndex,isSDF:_,pixelOffsetTL:G,pixelOffsetBR:H,minFontScaleX:0,minFontScaleY:0})}}return c}(0,n,u,o,a,s,r,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[128*o.layout.get("text-size").evaluate(s,{})])[0]>32640&&S(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&S(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,v,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,m);for(var _=0,b=h;_<b.length;_+=1)p[b[_]]=t.text.placedSymbolArray.length-1;return 4*g.length}function ul(t){for(var e in t)return t[e];return null}function ll(t,e,n,r){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(r.dist(o[a])<n)return!0}else i[e]=[];return i[e].push(r),!1}var cl=bs.VectorTileFeature.types,hl=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function pl(t,e,n,r,i,o,a,s,u,l,c,h,p){var f=s?Math.min(32640,Math.round(s[0])):0,d=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,n,Math.round(32*r),Math.round(32*i),o,a,(f<<1)+(u?1:0),d,16*l,16*c,256*h,256*p)}function fl(t,e,n){t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n)}function dl(t){for(var e=0,n=t.sections;e<n.length;e+=1)if(Kr(n[e].text))return!0;return!1}var ml=function(t){this.layoutVertexArray=new Ri,this.indexArray=new Ui,this.programConfigurations=t,this.segments=new so,this.dynamicLayoutVertexArray=new Di,this.opacityVertexArray=new Ni,this.placedSymbolArray=new Qi};ml.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},ml.prototype.upload=function(t,e,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Us.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Zs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,hl,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(t))},ml.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},zr("SymbolBuffers",ml);var gl=function(t,e,n){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new n,this.segments=new so,this.collisionVertexArray=new ji};gl.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Vs.members,!0)},gl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},zr("CollisionBuffers",gl);var yl=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=sa([]),this.placementViewportMatrix=sa([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Nu(this.zoom,e["text-size"]),this.iconSizeData=Nu(this.zoom,e["icon-size"]);var n=this.layers[0].layout,r=n.get("symbol-sort-key"),i=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==r.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((function(t){return xu[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};yl.prototype.createArrays=function(){this.text=new ml(new Do(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new ml(new Do(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new no,this.lineVertexArray=new ro,this.symbolInstances=new eo},yl.prototype.calculateGlyphDependencies=function(t,e,n,r,i){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(n||r)&&i){var a=qs[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},yl.prototype.populate=function(t,e,n){var r=this.layers[0],i=r.layout,o=i.get("text-font"),a=i.get("text-field"),s=i.get("icon-image"),u=("constant"!==a.value.kind||a.value.value instanceof re&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],u||l){for(var h=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new si(this.zoom),m=0,g=t;m<g.length;m+=1){var y=g[m],v=y.feature,_=y.id,b=y.index,x=y.sourceLayerIndex,w=r._featureFilter.needGeometry,S=Uo(v,w);if(r._featureFilter.filter(d,S,n)){w||(S.geometry=jo(v));var E=void 0;if(u){var M=r.getValueAndResolveTokens("text-field",S,n,f),T=re.factory(M);dl(T)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ii()||this.hasRTLText&&ai.isParsed())&&(E=Ws(T,r,S))}var A=void 0;if(l){var C=r.getValueAndResolveTokens("icon-image",S,n,f);A=C instanceof ie?C:ie.fromString(C)}if(E||A){var O=this.sortFeaturesByKey?c.evaluate(S,{},n):void 0;if(this.features.push({id:_,text:E,icon:A,index:b,sourceLayerIndex:x,geometry:S.geometry,properties:v.properties,type:cl[v.type],sortKey:O}),A&&(h[A.name]=!0),E){var P=o.evaluate(S,{},n).join(","),k="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(xu.vertical)>=0;for(var L=0,I=E.sections;L<I.length;L+=1){var R=I[L];if(R.image)h[R.image.name]=!0;else{var D=Wr(E.toString()),N=R.fontStack||P,F=p[N]=p[N]||{};this.calculateGlyphDependencies(R.text,F,k,this.allowVerticalPlacement,D)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},n={},r=[],i=0;function o(e){r.push(t[e]),i++}function a(t,e,i){var o=n[t];return delete n[t],n[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function s(t,n,i){var o=e[n];return delete e[n],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function u(t,e,n){var r=n?e[0][e[0].length-1]:e[0][0];return t+":"+r.x+":"+r.y}for(var l=0;l<t.length;l++){var c=t[l],h=c.geometry,p=c.text?c.text.toString():null;if(p){var f=u(p,h),d=u(p,h,!0);if(f in n&&d in e&&n[f]!==e[d]){var m=s(f,d,h),g=a(f,d,r[m].geometry);delete e[f],delete n[d],n[u(p,r[g].geometry,!0)]=g,r[m].geometry=null}else f in n?a(f,d,h):d in e?s(f,d,h):(o(l),e[f]=i-1,n[d]=i-1)}else o(l)}return r.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},yl.prototype.update=function(t,e,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,n),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,n))},yl.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},yl.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},yl.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},yl.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},yl.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},yl.prototype.addToLineVertexArray=function(t,e){var n=this.lineVertexArray.length;if(void 0!==t.segment){for(var r=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a<e.length-1&&(r+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}},yl.prototype.addSymbols=function(t,e,n,r,i,o,a,s,u,l,c,h){for(var p=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,p,this.canOverlap?o.sortKey:void 0),m=this.glyphOffsetArray.length,g=d.vertexLength,y=this.allowVerticalPlacement&&a===xu.vertical?Math.PI/2:0,v=o.text&&o.text.sections,_=0;_<e.length;_++){var b=e[_],x=b.tl,w=b.tr,S=b.bl,E=b.br,M=b.tex,T=b.pixelOffsetTL,A=b.pixelOffsetBR,C=b.minFontScaleX,O=b.minFontScaleY,P=b.glyphOffset,k=b.isSDF,L=b.sectionIndex,I=d.vertexLength,R=P[1];pl(f,s.x,s.y,x.x,R+x.y,M.x,M.y,n,k,T.x,T.y,C,O),pl(f,s.x,s.y,w.x,R+w.y,M.x+M.w,M.y,n,k,A.x,T.y,C,O),pl(f,s.x,s.y,S.x,R+S.y,M.x,M.y+M.h,n,k,T.x,A.y,C,O),pl(f,s.x,s.y,E.x,R+E.y,M.x+M.w,M.y+M.h,n,k,A.x,A.y,C,O),fl(t.dynamicLayoutVertexArray,s,y),p.emplaceBack(I,I+1,I+2),p.emplaceBack(I+1,I+2,I+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(P[0]),_!==e.length-1&&L===e[_+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},h,v&&v[L])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,u,l,s.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],a,0,!1,0,c)},yl.prototype._addCollisionDebugVertex=function(t,e,n,r,i,o){return e.emplaceBack(0,0),t.emplaceBack(n.x,n.y,r,i,Math.round(o.x),Math.round(o.y))},yl.prototype.addCollisionDebugVertices=function(t,e,n,r,o,a,s){var u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=u.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,p=s.anchorX,f=s.anchorY;this._addCollisionDebugVertex(c,h,a,p,f,new i(t,e)),this._addCollisionDebugVertex(c,h,a,p,f,new i(n,e)),this._addCollisionDebugVertex(c,h,a,p,f,new i(n,r)),this._addCollisionDebugVertex(c,h,a,p,f,new i(t,r)),u.vertexLength+=4;var d=o.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),u.primitiveLength+=4},yl.prototype.addDebugCollisionBoxes=function(t,e,n,r){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,r?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,n)}},yl.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new gl(zi,Gs.members,qi),this.iconCollisionBox=new gl(zi,Gs.members,qi);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)}},yl.prototype._deserializeCollisionBoxesForSymbol=function(t,e,n,r,i,o,a,s,u){for(var l={},c=e;c<n;c++){var h=t.get(c);l.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},l.textFeatureIndex=h.featureIndex;break}for(var p=r;p<i;p++){var f=t.get(p);l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}for(var d=o;d<a;d++){var m=t.get(d);l.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},l.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<u;g++){var y=t.get(g);l.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},l.verticalIconFeatureIndex=y.featureIndex;break}return l},yl.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var n=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}},yl.prototype.hasTextData=function(){return this.text.segments.get().length>0},yl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var n=t.placedSymbolArray.get(e),r=n.vertexStartIndex+4*n.numGlyphs,i=n.vertexStartIndex;i<r;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},yl.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),n=Math.cos(t),r=[],i=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);r.push(0|Math.round(e*s.anchorX+n*s.anchorY)),i.push(s.featureIndex)}return o.sort((function(t,e){return r[t]-r[e]||i[e]-i[t]})),o},yl.prototype.addToSortKeyRanges=function(t,e){var n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===e?n.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},yl.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 n=0,r=this.symbolInstanceIndexes;n<r.length;n+=1){var i=this.symbolInstances.get(r[n]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,n,r){t>=0&&r.indexOf(t)===n&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},zr("SymbolBucket",yl,{omit:["layers","collisionBoxArray","features","compareText"]}),yl.MAX_GLYPHS=65535,yl.addDynamicAttributes=fl;var vl=new xi({"symbol-placement":new gi(Ot.layout_symbol["symbol-placement"]),"symbol-spacing":new gi(Ot.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gi(Ot.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yi(Ot.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gi(Ot.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gi(Ot.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gi(Ot.layout_symbol["icon-ignore-placement"]),"icon-optional":new gi(Ot.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gi(Ot.layout_symbol["icon-rotation-alignment"]),"icon-size":new yi(Ot.layout_symbol["icon-size"]),"icon-text-fit":new gi(Ot.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gi(Ot.layout_symbol["icon-text-fit-padding"]),"icon-image":new yi(Ot.layout_symbol["icon-image"]),"icon-rotate":new yi(Ot.layout_symbol["icon-rotate"]),"icon-padding":new gi(Ot.layout_symbol["icon-padding"]),"icon-keep-upright":new gi(Ot.layout_symbol["icon-keep-upright"]),"icon-offset":new yi(Ot.layout_symbol["icon-offset"]),"icon-anchor":new yi(Ot.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gi(Ot.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gi(Ot.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gi(Ot.layout_symbol["text-rotation-alignment"]),"text-field":new yi(Ot.layout_symbol["text-field"]),"text-font":new yi(Ot.layout_symbol["text-font"]),"text-size":new yi(Ot.layout_symbol["text-size"]),"text-max-width":new yi(Ot.layout_symbol["text-max-width"]),"text-line-height":new gi(Ot.layout_symbol["text-line-height"]),"text-letter-spacing":new yi(Ot.layout_symbol["text-letter-spacing"]),"text-justify":new yi(Ot.layout_symbol["text-justify"]),"text-radial-offset":new yi(Ot.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gi(Ot.layout_symbol["text-variable-anchor"]),"text-anchor":new yi(Ot.layout_symbol["text-anchor"]),"text-max-angle":new gi(Ot.layout_symbol["text-max-angle"]),"text-writing-mode":new gi(Ot.layout_symbol["text-writing-mode"]),"text-rotate":new yi(Ot.layout_symbol["text-rotate"]),"text-padding":new gi(Ot.layout_symbol["text-padding"]),"text-keep-upright":new gi(Ot.layout_symbol["text-keep-upright"]),"text-transform":new yi(Ot.layout_symbol["text-transform"]),"text-offset":new yi(Ot.layout_symbol["text-offset"]),"text-allow-overlap":new gi(Ot.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gi(Ot.layout_symbol["text-ignore-placement"]),"text-optional":new gi(Ot.layout_symbol["text-optional"])}),_l={paint:new xi({"icon-opacity":new yi(Ot.paint_symbol["icon-opacity"]),"icon-color":new yi(Ot.paint_symbol["icon-color"]),"icon-halo-color":new yi(Ot.paint_symbol["icon-halo-color"]),"icon-halo-width":new yi(Ot.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yi(Ot.paint_symbol["icon-halo-blur"]),"icon-translate":new gi(Ot.paint_symbol["icon-translate"]),"icon-translate-anchor":new gi(Ot.paint_symbol["icon-translate-anchor"]),"text-opacity":new yi(Ot.paint_symbol["text-opacity"]),"text-color":new yi(Ot.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new yi(Ot.paint_symbol["text-halo-color"]),"text-halo-width":new yi(Ot.paint_symbol["text-halo-width"]),"text-halo-blur":new yi(Ot.paint_symbol["text-halo-blur"]),"text-translate":new gi(Ot.paint_symbol["text-translate"]),"text-translate-anchor":new gi(Ot.paint_symbol["text-translate-anchor"])}),layout:vl},bl=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};bl.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},bl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},bl.prototype.outputDefined=function(){return!1},bl.prototype.serialize=function(){return null},zr("FormatSectionOverride",bl,{omit:["defaultValue"]});var xl=function(t){function e(e){t.call(this,e,_l)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,n){if(t.prototype.recalculate.call(this,e,n),"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"]=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 r=this.layout.get("text-writing-mode");if(r){for(var i=[],o=0,a=r;o<a.length;o+=1){var s=a[o];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,n,r){var i=this.layout.get(t).evaluate(e,{},n,r),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Wn(o.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,n){return n in t?String(t[n]):""}))}(e.properties,i)},e.prototype.createBucket=function(t){return new yl(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,n=_l.paint.overridableProperties;t<n.length;t+=1){var r=n[t];if(e.hasPaintOverride(this.layout,r)){var i,o=this.paint.get(r),a=new bl(o),s=new Hn(a,o.property.specification);i="constant"===o.value.kind||"source"===o.value.kind?new Yn("source",s):new Xn("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[r]=new di(o.property,i,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,n,r){return!(!this.layout||n.isDataDriven()||r.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var n=t.get("text-field"),r=_l.paint.properties[e],i=!1,o=function(t){for(var e=0,n=t;e<n.length;e+=1)if(r.overrides&&r.overrides.hasOverride(n[e]))return void(i=!0)};if("constant"===n.value.kind&&n.value.value instanceof re)o(n.value.value.sections);else if("source"===n.value.kind){var a=function(t){i||(t instanceof le&&se(t.value)===Ht?o(t.value.sections):t instanceof fe?o(t.sections):t.eachChild(a))},s=n.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e}(wi),wl={paint:new xi({"background-color":new gi(Ot.paint_background["background-color"]),"background-pattern":new _i(Ot.paint_background["background-pattern"]),"background-opacity":new gi(Ot.paint_background["background-opacity"])})},Sl=function(t){function e(e){t.call(this,e,wl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(wi),El={paint:new xi({"raster-opacity":new gi(Ot.paint_raster["raster-opacity"]),"raster-hue-rotate":new gi(Ot.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new gi(Ot.paint_raster["raster-brightness-min"]),"raster-brightness-max":new gi(Ot.paint_raster["raster-brightness-max"]),"raster-saturation":new gi(Ot.paint_raster["raster-saturation"]),"raster-contrast":new gi(Ot.paint_raster["raster-contrast"]),"raster-resampling":new gi(Ot.paint_raster["raster-resampling"]),"raster-fade-duration":new gi(Ot.paint_raster["raster-fade-duration"])})},Ml=function(t){function e(e){t.call(this,e,El)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(wi),Tl=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(wi),Al={circle:pa,heatmap:wa,hillshade:Ea,fill:cs,"fill-extrusion":As,line:Bs,symbol:xl,background:Sl,raster:Ml},Cl=a.HTMLImageElement,Ol=a.HTMLCanvasElement,Pl=a.HTMLVideoElement,kl=a.ImageData,Ll=a.ImageBitmap,Il=function(t,e,n,r){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(e,r)};Il.prototype.update=function(t,e,n){var r=t.width,i=t.height,o=!(this.size&&this.size[0]===r&&this.size[1]===i||n),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[r,i],t instanceof Cl||t instanceof Ol||t instanceof Pl||t instanceof kl||Ll&&t instanceof Ll?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,r,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var u=n||{x:0,y:0},l=u.x,c=u.y;t instanceof Cl||t instanceof Ol||t instanceof Pl||t instanceof kl||Ll&&t instanceof Ll?s.texSubImage2D(s.TEXTURE_2D,0,l,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,c,r,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Il.prototype.bind=function(t,e,n){var r=this.context.gl;r.bindTexture(r.TEXTURE_2D,this.texture),n!==r.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=r.LINEAR),t!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,n||t),this.filter=t),e!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e),this.wrap=e)},Il.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Il.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Rl=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Rl.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))},Rl.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Dl=function(t,e,n){this.target=t,this.parent=e,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},y(["receive","process"],this),this.invoker=new Rl(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=T()?t:a};function Nl(t,e,n){var r=2*Math.PI*6378137/256/Math.pow(2,n);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}Dl.prototype.send=function(t,e,n,r,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(this.callbacks[a]=n);var s=O(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!n,targetMapId:r,mustQueue:i,sourceMapId:this.mapId,data:Zr(e,s)},s),{cancel:function(){n&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:r,sourceMapId:o.mapId})}}},Dl.prototype.receive=function(t){var e=t.data,n=e.id;if(n&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[n];var r=this.cancelCallbacks[n];delete this.cancelCallbacks[n],r&&r()}else T()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e)},Dl.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)}},Dl.prototype.processTask=function(t,e){var n=this;if("<response>"===e.type){var r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(Vr(e.error)):r(null,Vr(e.data)))}else{var i=!1,o=O(this.globalScope)?void 0:[],a=e.hasCallback?function(e,r){i=!0,delete n.cancelCallbacks[t],n.target.postMessage({id:t,type:"<response>",sourceMapId:n.mapId,error:e?Zr(e):null,data:Zr(r,o)},o)}:function(t){i=!0},s=null,u=Vr(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Dl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Fl=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]))};Fl.prototype.setNorthEast=function(t){return this._ne=t instanceof zl?new zl(t.lng,t.lat):zl.convert(t),this},Fl.prototype.setSouthWest=function(t){return this._sw=t instanceof zl?new zl(t.lng,t.lat):zl.convert(t),this},Fl.prototype.extend=function(t){var e,n,r=this._sw,i=this._ne;if(t instanceof zl)e=t,n=t;else{if(!(t instanceof Fl))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Fl.convert(t)):this.extend(zl.convert(t)):this;if(n=t._ne,!(e=t._sw)||!n)return this}return r||i?(r.lng=Math.min(e.lng,r.lng),r.lat=Math.min(e.lat,r.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new zl(e.lng,e.lat),this._ne=new zl(n.lng,n.lat)),this},Fl.prototype.getCenter=function(){return new zl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Fl.prototype.getSouthWest=function(){return this._sw},Fl.prototype.getNorthEast=function(){return this._ne},Fl.prototype.getNorthWest=function(){return new zl(this.getWest(),this.getNorth())},Fl.prototype.getSouthEast=function(){return new zl(this.getEast(),this.getSouth())},Fl.prototype.getWest=function(){return this._sw.lng},Fl.prototype.getSouth=function(){return this._sw.lat},Fl.prototype.getEast=function(){return this._ne.lng},Fl.prototype.getNorth=function(){return this._ne.lat},Fl.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Fl.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Fl.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Fl.prototype.contains=function(t){var e=zl.convert(t),n=e.lng,r=e.lat,i=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i},Fl.convert=function(t){return!t||t instanceof Fl?t:new Fl(t)};var zl=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")};zl.prototype.wrap=function(){return new zl(h(this.lng,-180,180),this.lat)},zl.prototype.toArray=function(){return[this.lng,this.lat]},zl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},zl.prototype.distanceTo=function(t){var e=Math.PI/180,n=this.lat*e,r=t.lat*e,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},zl.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return new Fl(new zl(this.lng-n,this.lat-e),new zl(this.lng+n,this.lat+e))},zl.convert=function(t){if(t instanceof zl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new zl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new zl(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 Bl=2*Math.PI*6371008.8;function jl(t){return Bl*Math.cos(t*Math.PI/180)}function Ul(t){return(180+t)/360}function Zl(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Vl(t,e){return t/jl(e)}function Gl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Hl=function(t,e,n){void 0===n&&(n=0),this.x=+t,this.y=+e,this.z=+n};Hl.fromLngLat=function(t,e){void 0===e&&(e=0);var n=zl.convert(t);return new Hl(Ul(n.lng),Zl(n.lat),Vl(e,n.lat))},Hl.prototype.toLngLat=function(){return new zl(360*this.x-180,Gl(this.y))},Hl.prototype.toAltitude=function(){return this.z*jl(Gl(this.y))},Hl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Bl*(t=Gl(this.y),1/Math.cos(t*Math.PI/180));var t};var Wl=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=Xl(0,t,t,e,n)};Wl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Wl.prototype.url=function(t,e){var n,r,i,o,a,s=(r=this.y,i=this.z,o=Nl(256*(n=this.x),256*(r=Math.pow(2,i)-r-1),i),a=Nl(256*(n+1),256*(r+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,n){for(var r,i="",o=t;o>0;o--)i+=(e&(r=1<<o-1)?1:0)+(n&r?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}",u).replace("{bbox-epsg-3857}",s)},Wl.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Wl.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ql=function(t,e){this.wrap=t,this.canonical=e,this.key=Xl(t,e.z,e.z,e.x,e.y)},Yl=function(t,e,n,r,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Wl(n,+r,+i),this.key=Xl(e,t,n,r,i)};function Xl(t,e,n,r,i){(t*=2)<0&&(t=-1*t-1);var o=1<<n;return(o*o*t+o*i+r).toString(36)+n.toString(36)+e.toString(36)}Yl.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Yl.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Yl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Yl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Yl.prototype.calculateScaledKey=function(t,e){var n=this.canonical.z-t;return t>this.canonical.z?Xl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Xl(this.wrap*+e,t,t,this.canonical.x>>n,this.canonical.y>>n)},Yl.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},Yl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Yl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new Yl(e,this.wrap,e,n,r),new Yl(e,this.wrap,e,n+1,r),new Yl(e,this.wrap,e,n,r+1),new Yl(e,this.wrap,e,n+1,r+1)]},Yl.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))},Yl.prototype.wrapped=function(){return new Yl(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Yl.prototype.unwrapTo=function(t){return new Yl(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Yl.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Yl.prototype.toUnwrapped=function(){return new ql(this.wrap,this.canonical)},Yl.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Yl.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Hl(t.x-this.wrap,t.y))},zr("CanonicalTileID",Wl),zr("OverscaledTileID",Yl,{omit:["posMatrix"]});var $l=function(t,e,n){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return S('"'+n+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var r=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=n||"mapbox";for(var i=0;i<r;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(r,i)]=this.data[this._idx(r-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,r)]=this.data[this._idx(i,r-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(r,-1)]=this.data[this._idx(r-1,0)],this.data[this._idx(-1,r)]=this.data[this._idx(0,r-1)],this.data[this._idx(r,r)]=this.data[this._idx(r-1,r-1)]};$l.prototype.get=function(t,e){var n=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(n[r],n[r+1],n[r+2])},$l.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},$l.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)},$l.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},$l.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},$l.prototype.getPixels=function(){return new _a({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},$l.prototype.backfillBorder=function(t,e,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var r=e*this.dim,i=e*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(e){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-n*this.dim,l=o;l<a;l++)for(var c=r;c<i;c++)this.data[this._idx(c,l)]=t.data[this._idx(c+s,l+u)]},zr("DEMData",$l);var Kl=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var n=t[e];this._stringToNumber[n]=e,this._numberToString[e]=n}};Kl.prototype.encode=function(t){return this._stringToNumber[t]},Kl.prototype.decode=function(t){return this._numberToString[t]};var Jl=function(t,e,n,r,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=n,t._y=r,this.properties=t.properties,this.id=i},Ql={geometry:{configurable:!0}};Ql.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},Ql.geometry.set=function(t){this._geometry=t},Jl.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(Jl.prototype,Ql);var tc=function(){this.state={},this.stateChanges={},this.deletedStates={}};tc.prototype.updateState=function(t,e,n){var r=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][r]=this.stateChanges[t][r]||{},p(this.stateChanges[t][r],n),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==r&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][r])for(var o in this.deletedStates[t][r]={},this.state[t][r])n[o]||(this.deletedStates[t][r][o]=null);else for(var a in n)this.deletedStates[t]&&this.deletedStates[t][r]&&null===this.deletedStates[t][r][a]&&delete this.deletedStates[t][r][a]},tc.prototype.removeFeatureState=function(t,e,n){if(null!==this.deletedStates[t]){var r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},n&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][n]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(n in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][n]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}},tc.prototype.getState=function(t,e){var n=String(e),r=p({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var i=this.deletedStates[t][e];if(null===i)return{};for(var o in i)delete r[o]}return r},tc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},tc.prototype.coalesceChanges=function(t,e){var n={};for(var r in this.stateChanges){this.state[r]=this.state[r]||{};var i={};for(var o in this.stateChanges[r])this.state[r][o]||(this.state[r][o]={}),p(this.state[r][o],this.stateChanges[r][o]),i[o]=this.state[r][o];n[r]=i}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var u in this.state[a])s[u]={},this.state[a][u]={};else for(var l in this.deletedStates[a]){if(null===this.deletedStates[a][l])this.state[a][l]={};else for(var c=0,h=Object.keys(this.deletedStates[a][l]);c<h.length;c+=1)delete this.state[a][l][h[c]];s[l]=this.state[a][l]}n[a]=n[a]||{},p(n[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(var f in t)t[f].setFeatureState(n,e)};var ec=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ir(8192,16,0),this.grid3D=new Ir(8192,16,0),this.featureIndexArray=new oo,this.promoteId=e};function nc(t,e,n,r,i){return _(t,(function(t,o){var a=e instanceof mi?e.get(o):null;return a&&a.evaluate?a.evaluate(n,r,i):a}))}function rc(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),n=Math.min(n,s.y),r=Math.max(r,s.x),i=Math.max(i,s.y)}return{minX:e,minY:n,maxX:r,maxY:i}}function ic(t,e){return e-t}ec.prototype.insert=function(t,e,n,r,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],c=[1/0,1/0,-1/0,-1/0],h=0;h<l.length;h++){var p=l[h];c[0]=Math.min(c[0],p.x),c[1]=Math.min(c[1],p.y),c[2]=Math.max(c[2],p.x),c[3]=Math.max(c[3],p.y)}c[0]<8192&&c[1]<8192&&c[2]>=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},ec.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new bs.VectorTile(new $s(this.rawTileData)).layers,this.sourceLayerCoder=new Kl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ec.prototype.query=function(t,e,n,r){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=ar(a.filter),l=t.queryGeometry,c=t.queryPadding*s,h=rc(l),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),f=rc(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,n,r,o){return function(t,e,n,r,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&n<=u.y&&r>=u.x&&o>=u.y)return!0}var l=[new i(e,n),new i(e,o),new i(r,o),new i(r,n)];if(t.length>2)for(var c=0,h=l;c<h.length;c+=1)if(Qo(t,h[c]))return!0;for(var p=0;p<t.length-1;p++)if(ta(t[p],t[p+1],l))return!0;return!1}(t.cameraQueryGeometry,e-c,n-c,r+c,o+c)})),m=0,g=d;m<g.length;m+=1)p.push(g[m]);p.sort(ic);for(var y,v={},_=function(i){var c=p[i];if(c!==y){y=c;var h=o.featureIndexArray.get(c),f=null;o.loadMatchingFeature(v,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,u,a.layers,a.availableImages,e,n,r,(function(e,n,r){return f||(f=jo(e)),n.queryIntersectsFeature(l,e,r,f,o.z,t.transform,s,t.pixelPosMatrix)}))}},b=0;b<p.length;b++)_(b);return v},ec.prototype.loadMatchingFeature=function(t,e,n,r,i,o,a,s,u,l,c){var h=this.bucketLayerIDs[e];if(!o||function(t,e){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(n),d=this.vtLayers[f].feature(r);if(i.needGeometry){var m=Uo(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var g=this.getId(d,f),y=0;y<h.length;y++){var v=h[y];if(!(o&&o.indexOf(v)<0)){var _=s[v];if(_){var b={};void 0!==g&&l&&(b=l.getState(_.sourceLayer||"_geojsonTileLayer",g));var x=p({},u[v]);x.paint=nc(x.paint,_.paint,d,b,a),x.layout=nc(x.layout,_.layout,d,b,a);var w=!c||c(d,_,b);if(w){var S=new Jl(d,this.z,this.x,this.y,g);S.layer=x;var E=t[v];void 0===E&&(E=t[v]=[]),E.push({featureIndex:r,feature:S,intersectionZ:w})}}}}}},ec.prototype.lookupSymbolFeatures=function(t,e,n,r,i,o,a,s){var u={};this.loadVTLayers();for(var l=ar(i),c=0,h=t;c<h.length;c+=1)this.loadMatchingFeature(u,n,r,h[c],l,o,a,s,e);return u},ec.prototype.hasLayer=function(t){for(var e=0,n=this.bucketLayerIDs;e<n.length;e+=1)for(var r=0,i=n[e];r<i.length;r+=1)if(t===i[r])return!0;return!1},ec.prototype.getId=function(t,e){var n=t.id;return this.promoteId&&"boolean"==typeof(n=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(n=Number(n)),n},zr("FeatureIndex",ec,{omit:["rawTileData","sourceLayerCoder"]});var oc=function(t,e){this.tileID=t,this.uid=d(),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"};oc.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<z.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},oc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},oc.prototype.loadVectorData=function(t,e,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var r 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 n={};if(!e)return n;for(var r=function(){var t=o[i],r=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==r.length){t.layers=r,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return r.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=r;a<s.length;a+=1)n[s[a].id]=t}},i=0,o=t;i<o.length;i+=1)r();return n}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[r];if(i instanceof yl){if(this.hasSymbolBuckets=!0,!n)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof yl&&a.hasRTLText){this.hasRTLText=!0,ai.isLoading()||ai.isLoaded()||"deferred"!==ii()||oi();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Ki},oc.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"},oc.prototype.getBucket=function(t){return this.buckets[t.id]},oc.prototype.upload=function(t){for(var e in this.buckets){var n=this.buckets[e];n.uploadPending()&&n.upload(t)}var r=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Il(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Il(t,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)},oc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},oc.prototype.queryRenderedFeatures=function(t,e,n,r,i,o,a,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:o,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:a,queryPadding:this.queryPadding*u},t,e,n):{}},oc.prototype.querySourceFeatures=function(t,e){var n=this.latestFeatureIndex;if(n&&n.rawTileData){var r=n.loadVTLayers(),i=e?e.sourceLayer:"",o=r._geojsonTileLayer||r[i];if(o)for(var a=ar(e&&e.filter),s=this.tileID.canonical,u=s.z,l=s.x,c=s.y,h={z:u,x:l,y:c},p=0;p<o.length;p++){var f=o.feature(p);if(a.needGeometry){var d=Uo(f,!0);if(!a.filter(new si(this.tileID.overscaledZ),d,this.tileID.canonical))continue}else if(!a.filter(new si(this.tileID.overscaledZ),f))continue;var m=n.getId(f,i),g=new Jl(f,u,l,c,m);g.tile=h,t.push(g)}}},oc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},oc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},oc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var n=A(t.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var r=Date.now(),i=!1;if(this.expirationTime>r)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var o=this.expirationTime-e;o?this.expirationTime=r+Math.max(o,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},oc.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)},oc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var n=this.latestFeatureIndex.loadVTLayers();for(var r in this.buckets)if(e.style.hasLayer(r)){var i=this.buckets[r],o=i.layers[0].sourceLayer||"_geojsonTileLayer",a=n[o],s=t[o];if(a&&s&&0!==Object.keys(s).length){i.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});var u=e&&e.style&&e.style.getLayer(r);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(i)))}}}},oc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},oc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<z.now()},oc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},oc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=z.now()+t},oc.prototype.setDependencies=function(t,e){for(var n={},r=0,i=e;r<i.length;r+=1)n[i[r]]=!0;this.dependencies[t]=n},oc.prototype.hasDependency=function(t,e){for(var n=0,r=t;n<r.length;n+=1){var i=this.dependencies[r[n]];if(i)for(var o=0,a=e;o<a.length;o+=1)if(i[a[o]])return!0}return!1};var ac=a.performance,sc=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},ac.mark(this._marks.start)};sc.prototype.finish=function(){ac.mark(this._marks.end);var t=ac.getEntriesByName(this._marks.measure);return 0===t.length&&(ac.measure(this._marks.measure,this._marks.start,this._marks.end),t=ac.getEntriesByName(this._marks.measure),ac.clearMarks(this._marks.start),ac.clearMarks(this._marks.end),ac.clearMeasures(this._marks.measure)),t},t.Actor=Dl,t.AlphaImage=va,t.CanonicalTileID=Wl,t.CollisionBoxArray=Ki,t.Color=te,t.DEMData=$l,t.DataConstantProperty=gi,t.DictionaryCoder=Kl,t.EXTENT=8192,t.ErrorEvent=At,t.EvaluationParameters=si,t.Event=Tt,t.Evented=Ct,t.FeatureIndex=ec,t.FillBucket=ss,t.FillExtrusionBucket=Es,t.ImageAtlas=bu,t.ImagePosition=vu,t.LineBucket=Ds,t.LngLat=zl,t.LngLatBounds=Fl,t.MercatorCoordinate=Hl,t.ONE_EM=24,t.OverscaledTileID=Yl,t.Point=i,t.Point$1=i,t.Properties=xi,t.Protobuf=$s,t.RGBAImage=_a,t.RequestManager=H,t.RequestPerformance=sc,t.ResourceType=dt,t.SegmentVector=so,t.SourceFeatureState=tc,t.StructArrayLayout1ui2=Yi,t.StructArrayLayout2f1f2i16=Bi,t.StructArrayLayout2i4=Ci,t.StructArrayLayout3ui6=Ui,t.StructArrayLayout4i8=Oi,t.SymbolBucket=yl,t.Texture=Il,t.Tile=oc,t.Transitionable=ci,t.Uniform1f=xo,t.Uniform1i=bo,t.Uniform2f=wo,t.Uniform3f=So,t.Uniform4f=Eo,t.UniformColor=Mo,t.UniformMatrix4f=Ao,t.UnwrappedTileID=ql,t.ValidationError=Pt,t.WritingMode=xu,t.ZoomHistory=Gr,t.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},t.addDynamicAttributes=fl,t.asyncAll=function(t,e,n){if(!t.length)return n(null,[]);var r=t.length,i=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),i[a]=e,0==--r&&n(o,i)}))}))},t.bezier=u,t.bindAll=y,t.browser=z,t.cacheEntryPossiblyAdded=function(t){++pt>ut&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Wu,t.clone=function(t){var e=new aa(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=x,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Hs,t.config=B,t.create=function(){var t=new aa(16);return aa!=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 aa(9);return aa!=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 aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=qn,t.createLayout=Ti,t.createStyleLayer=function(t){return"custom"===t.type?new Tl(t):new Al[t.type](t)},t.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t},t.deepEqual=function t(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==n){if("object"!=typeof n)return!1;if(Object.keys(e).length!==Object.keys(n).length)return!1;for(var i in e)if(!t(e[i],n[i]))return!1;return!0}return e===n},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=l,t.emitValidationErrors=Lr,t.endsWith=v,t.enforceCacheSizeLimit=function(t){lt(),tt&&tt.then((function(e){e.keys().then((function(n){for(var r=0;r<n.length-t;r++)e.delete(n[r])}))}))},t.evaluateSizeForFeature=Fu,t.evaluateSizeForZoom=zu,t.evaluateVariableOffset=ol,t.evented=ri,t.extend=p,t.featureFilter=ar,t.filterObject=b,t.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Lu,t.getAnchorJustification=al,t.getArrayBuffer=bt,t.getImage=St,t.getJSON=function(t,e){return _t(p(t,{type:"json"}),e)},t.getRTLTextPluginStatus=ii,t.getReferrer=vt,t.getVideo=function(t,e){var n,r,i=a.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var o=0;o<t.length;o++){var s=a.document.createElement("source");n=t[o],r=void 0,(r=a.document.createElement("a")).href=n,(r.protocol!==a.document.location.protocol||r.host!==a.document.location.host)&&(i.crossOrigin="Anonymous"),s.src=t[o],i.appendChild(s)}return{cancel:function(){}}},t.identity=sa,t.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=n*s-r*a,_=n*u-i*a,b=n*l-o*a,x=r*u-i*s,w=r*l-o*s,S=i*l-o*u,E=c*m-h*d,M=c*g-p*d,T=c*y-f*d,A=h*g-p*m,C=h*y-f*m,O=p*y-f*g,P=v*O-_*C+b*A+x*T-w*M+S*E;return P?(t[0]=(s*O-u*C+l*A)*(P=1/P),t[1]=(i*C-r*O-o*A)*P,t[2]=(m*S-g*w+y*x)*P,t[3]=(p*w-h*S-f*x)*P,t[4]=(u*T-a*O-l*M)*P,t[5]=(n*O-i*T+o*M)*P,t[6]=(g*b-d*S-y*_)*P,t[7]=(c*S-p*b+f*_)*P,t[8]=(a*C-s*T+l*E)*P,t[9]=(r*T-n*C-o*E)*P,t[10]=(d*w-m*b+y*v)*P,t[11]=(h*b-c*w-f*v)*P,t[12]=(s*M-a*A-u*E)*P,t[13]=(n*A-r*M+i*E)*P,t[14]=(m*_-d*x-g*v)*P,t[15]=(c*x-h*_+p*v)*P,t):null},t.isChar=Hr,t.isMapboxURL=W,t.keysDifference=function(t,e){var n=[];for(var r in t)r in e||n.push(r);return n},t.makeRequest=_t,t.mapObject=_,t.mercatorXfromLng=Ul,t.mercatorYfromLat=Zl,t.mercatorZfromAltitude=Vl,t.mul=ca,t.multiply=ua,t.mvt=bs,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ge,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new $s(t).readFields(du,[])},t.pbf=$s,t.performSymbolLayout=function(t,e,n,r,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,l={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(c.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,f=p.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(p.minZoom),a),u["icon-size"].possiblyEvaluate(new si(f),a)]}l.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),l.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),g=s.get("text-keep-upright"),y=s.get("text-size"),v=function(){var o=b[_],u=s.get("text-font").evaluate(o,{},a).join(","),c=y.evaluate(o,{},a),h=l.layoutTextSize.evaluate(o,{},a),p=l.layoutIconSize.evaluate(o,{},a),f={horizontal:{},vertical:void 0},v=o.text,x=[0,0];if(v){var w=v.toString(),E=24*s.get("text-letter-spacing").evaluate(o,{},a),M=function(t){for(var e=0,n=t;e<n.length;e+=1)if(r=n[e].charCodeAt(0),Hr.Arabic(r)||Hr["Arabic Supplement"](r)||Hr["Arabic Extended-A"](r)||Hr["Arabic Presentation Forms-A"](r)||Hr["Arabic Presentation Forms-B"](r))return!1;var r;return!0}(w)?E:0,T=s.get("text-anchor").evaluate(o,{},a),A=s.get("text-variable-anchor");if(!A){var C=s.get("text-radial-offset").evaluate(o,{},a);x=C?ol(T,[24*C,il]):s.get("text-offset").evaluate(o,{},a).map((function(t){return 24*t}))}var O=m?"center":s.get("text-justify").evaluate(o,{},a),P=s.get("symbol-placement"),k="point"===P?24*s.get("text-max-width").evaluate(o,{},a):0,L=function(){t.allowVerticalPlacement&&Wr(w)&&(f.vertical=Eu(v,e,n,i,u,k,d,T,"left",M,x,xu.vertical,!0,P,h,c))};if(!m&&A){for(var I="auto"===O?A.map((function(t){return al(t)})):[O],R=!1,D=0;D<I.length;D++){var N=I[D];if(!f.horizontal[N])if(R)f.horizontal[N]=f.horizontal[0];else{var F=Eu(v,e,n,i,u,k,d,"center",N,M,x,xu.horizontal,!1,P,h,c);F&&(f.horizontal[N]=F,R=1===F.positionedLines.length)}}L()}else{"auto"===O&&(O=al(T));var z=Eu(v,e,n,i,u,k,d,T,O,M,x,xu.horizontal,!1,P,h,c);z&&(f.horizontal[O]=z),L(),Wr(w)&&m&&g&&(f.vertical=Eu(v,e,n,i,u,k,d,T,O,M,x,xu.vertical,!1,P,h,c))}}var B=void 0,j=!1;if(o.icon&&o.icon.name){var U=r[o.icon.name];U&&(B=function(t,e,n){var r=Lu(n),i=e[0]-t.displaySize[0]*r.horizontalAlign,o=e[1]-t.displaySize[1]*r.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(i[o.icon.name],s.get("icon-offset").evaluate(o,{},a),s.get("icon-anchor").evaluate(o,{},a)),j=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&S("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==t.pixelRatio||0!==s.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var Z=ul(f.horizontal)||f.vertical;t.iconsInText=!!Z&&Z.iconsInText,(Z||B)&&function(t,e,n,r,i,o,a,s,u,l,c){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=a);var p,f=t.layers[0].layout,d=f.get("icon-offset").evaluate(e,{},c),m=ul(n.horizontal),g=a/24,y=t.tilePixelRatio*g,v=t.tilePixelRatio*h/24,_=t.tilePixelRatio*s,b=t.tilePixelRatio*f.get("symbol-spacing"),x=f.get("text-padding")*t.tilePixelRatio,w=f.get("icon-padding")*t.tilePixelRatio,E=f.get("text-max-angle")/180*Math.PI,M="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),T="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),A=f.get("symbol-placement"),C=b/2,O=f.get("icon-text-fit");r&&"none"!==O&&(t.allowVerticalPlacement&&n.vertical&&(p=Ru(r,n.vertical,O,f.get("icon-text-fit-padding"),d,g)),m&&(r=Ru(r,m,O,f.get("icon-text-fit-padding"),d,g)));var P=function(s,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g,y,v,_,b,x,w,E,M){var T,A,C,O,P,k=t.addToLineVertexArray(e,n),L=0,I=0,R=0,D=0,N=-1,F=-1,z={},B=po(""),j=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(j=(T=s.layout.get("text-offset").evaluate(b,{},E).map((function(t){return 24*t})))[0],U=T[1]):(j=24*s.layout.get("text-radial-offset").evaluate(b,{},E),U=il),t.allowVerticalPlacement&&r.vertical){var Z=s.layout.get("text-rotate").evaluate(b,{},E)+90;O=new Ju(u,e,l,c,h,r.vertical,p,f,d,Z),a&&(P=new Ju(u,e,l,c,h,a,g,y,d,Z))}if(i){var V=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),H=qu(i,V,w,G),W=a?qu(a,V,w,G):void 0;C=new Ju(u,e,l,c,h,i,g,y,!1,V),L=4*H.length;var q=t.iconSizeData,Y=null;"source"===q.kind?(Y=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&S(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===q.kind&&((Y=[128*x.compositeIconSizes[0].evaluate(b,{},E),128*x.compositeIconSizes[1].evaluate(b,{},E)])[0]>32640||Y[1]>32640)&&S(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,H,Y,_,v,b,!1,e,k.lineStartIndex,k.lineLength,-1,E),N=t.icon.placedSymbolArray.length-1,W&&(I=4*W.length,t.addSymbols(t.icon,W,Y,_,v,b,xu.vertical,e,k.lineStartIndex,k.lineLength,-1,E),F=t.icon.placedSymbolArray.length-1)}for(var X in r.horizontal){var $=r.horizontal[X];if(!A){B=po($.text);var K=s.layout.get("text-rotate").evaluate(b,{},E);A=new Ju(u,e,l,c,h,$,p,f,d,K)}var J=1===$.positionedLines.length;if(R+=sl(t,e,$,o,s,d,b,m,k,r.vertical?xu.horizontal:xu.horizontalOnly,J?Object.keys(r.horizontal):[X],z,N,x,E),J)break}r.vertical&&(D+=sl(t,e,r.vertical,o,s,d,b,m,k,xu.vertical,["vertical"],z,F,x,E));var Q=A?A.boxStartIndex:t.collisionBoxArray.length,tt=A?A.boxEndIndex:t.collisionBoxArray.length,et=O?O.boxStartIndex:t.collisionBoxArray.length,nt=O?O.boxEndIndex:t.collisionBoxArray.length,rt=C?C.boxStartIndex:t.collisionBoxArray.length,it=C?C.boxEndIndex:t.collisionBoxArray.length,ot=P?P.boxStartIndex:t.collisionBoxArray.length,at=P?P.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(A,st),st=ut(O,st),st=ut(C,st);var lt=(st=ut(P,st))>-1?1:0;lt&&(st*=M/24),t.glyphOffsetArray.length>=yl.MAX_GLYPHS&&S("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,z.right>=0?z.right:-1,z.center>=0?z.center:-1,z.left>=0?z.left:-1,z.vertical||-1,N,F,B,Q,tt,et,nt,rt,it,ot,at,l,R,D,L,I,lt,0,p,j,U,st)}(t,h,s,n,r,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,x,M,u,_,w,T,d,e,o,l,c,a)};if("line"===A)for(var k=0,L=Wu(e.geometry,0,0,8192,8192);k<L.length;k+=1)for(var I=L[k],R=0,D=Hu(I,b,E,n.vertical||m,r,24,v,t.overscaling,8192);R<D.length;R+=1){var N=D[R];m&&ll(t,m.text,C,N)||P(I,N)}else if("line-center"===A)for(var F=0,z=e.geometry;F<z.length;F+=1){var B=z[F];if(B.length>1){var j=Gu(B,E,n.vertical||m,r,24,v);j&&P(B,j)}}else if("Polygon"===e.type)for(var U=0,Z=rs(e.geometry,0);U<Z.length;U+=1){var V=Z[U],G=el(V,16);P(V[0],new Du(G.x,G.y,0))}else if("LineString"===e.type)for(var H=0,W=e.geometry;H<W.length;H+=1){var q=W[H];P(q,new Du(q[0].x,q[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[$];P([J],new Du(J.x,J.y,0))}}(t,o,f,B,r,l,h,p,x,j,a)},_=0,b=t.features;_<b.length;_+=1)v();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,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[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t},t.pick=function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r];i in t&&(n[i]=t[i])}return n},t.plugin=ai,t.polygonIntersectsPolygon=Go,t.postMapLoadEvent=at,t.postTurnstileEvent=it,t.potpack=yu,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=zr,t.registerForPluginStateChange=function(t){return t({pluginStatus:Qr,pluginURL:ti}),ri.on("pluginStateChange",t),t},t.renderColorRamp=xa,t.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*s,t[1]=i*u+a*s,t[2]=r*-s+o*u,t[3]=i*-s+a*u,t},t.rotateX=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],p=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]=o*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t},t.rotateZ=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],p=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]=o*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},t.scale=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},t.scale$2=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},t.setCacheLimits=function(t,e){st=t,ut=e},t.setRTLTextPlugin=function(t,e,n){if(void 0===n&&(n=!1),"deferred"===Qr||"loading"===Qr||"loaded"===Qr)throw new Error("setRTLTextPlugin cannot be called multiple times.");ti=z.resolveURL(t),Qr="deferred",Jr=e,ni(),n||oi()},t.sphericalToCartesian=function(t){var e=t[0],n=t[1],r=t[2];return n+=90,n*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(n)*Math.sin(r),y:e*Math.sin(n)*Math.sin(r),z:e*Math.cos(r)}},t.sqrLen=function(t){var e=t[0],n=t[1];return e*e+n*n},t.styleSpec=Ot,t.sub=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},t.symbolSize=Bu,t.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},t.transformMat4=ha,t.translate=function(t,e,n){var r,i,o,a,s,u,l,c,h,p,f,d,m=n[0],g=n[1],y=n[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],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*m+s*g+h*y+e[12],t[13]=i*m+u*g+p*y+e[13],t[14]=o*m+l*g+f*y+e[14],t[15]=a*m+c*g+d*y+e[15]),t},t.triggerPluginCompletionEvent=ei,t.uniqueId=d,t.validateCustomStyleLayer=function(t){var e=[],n=t.id;return void 0===n&&e.push({message:"layers."+n+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+n+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+n+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Or,t.validateStyle=Cr,t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.vectorTile=bs,t.version="1.13.3",t.warnOnce=S,t.webpSupported=j,t.window=a,t.wrap=h})),r(0,(function(t){function e(t){var n=typeof t;if("number"===n||"boolean"===n||"string"===n||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",i=0,o=t;i<o.length;i+=1)r+=e(o[i])+",";return r+"]"}for(var a=Object.keys(t).sort(),s="{",u=0;u<a.length;u++)s+=JSON.stringify(a[u])+":"+e(t[a[u]])+",";return s+"}"}function n(n){for(var r="",i=0,o=t.refProperties;i<o.length;i+=1)r+="/"+e(n[o[i]]);return r}var r=function(t){this.keyCache={},t&&this.replace(t)};r.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},r.prototype.update=function(e,r){for(var i=this,o=0,a=e;o<a.length;o+=1){var s=a[o];this._layerConfigs[s.id]=s;var u=this._layers[s.id]=t.createStyleLayer(s);u._featureFilter=t.featureFilter(u.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var l=0,c=r;l<c.length;l+=1){var h=c[l];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var p=0,f=function(t,e){for(var r={},i=0;i<t.length;i++){var o=e&&e[t[i].id]||n(t[i]);e&&(e[t[i].id]=o);var a=r[o];a||(a=r[o]=[]),a.push(t[i])}var s=[];for(var u in r)s.push(r[u]);return s}(t.values(this._layerConfigs),this.keyCache);p<f.length;p+=1){var d=f[p].map((function(t){return i._layers[t.id]})),m=d[0];if("none"!==m.visibility){var g=m.source||"",y=this.familiesBySource[g];y||(y=this.familiesBySource[g]={});var v=m.sourceLayer||"_geojsonTileLayer",_=y[v];_||(_=y[v]=[]),_.push(d)}}};var i=function(e){var n={},r=[];for(var i in e){var o=e[i],a=n[i]={};for(var s in o){var u=o[+s];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var l={x:0,y:0,w:u.bitmap.width+2,h:u.bitmap.height+2};r.push(l),a[s]={rect:l,metrics:u.metrics}}}}var c=t.potpack(r),h=new t.AlphaImage({width:c.w||1,height:c.h||1});for(var p in e){var f=e[p];for(var d in f){var m=f[+d];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var g=n[p][d].rect;t.AlphaImage.copy(m.bitmap,h,{x:0,y:0},{x:g.x+1,y:g.y+1},m.bitmap)}}}this.image=h,this.positions=n};t.register("GlyphAtlas",i);var o=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 a(e,n,r){for(var i=new t.EvaluationParameters(n),o=0,a=e;o<a.length;o+=1)a[o].recalculate(i,r)}function s(e,n){var r=t.getArrayBuffer(e.request,(function(e,r,i,o){e?n(e):r&&n(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(r)),rawData:r,cacheControl:i,expires:o})}));return function(){r.cancel(),n()}}o.prototype.parse=function(e,n,r,o,s){var u=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var l=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var h,p,f,d,m={},g={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},y=n.familiesBySource[this.source];for(var v in y){var _=e.layers[v];if(_){1===_.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var b=l.encode(v),x=[],w=0;w<_.length;w++){var S=_.feature(w),E=c.getId(S,v);x.push({feature:S,id:E,index:w,sourceLayerIndex:b})}for(var M=0,T=y[v];M<T.length;M+=1){var A=T[M],C=A[0];C.minzoom&&this.zoom<Math.floor(C.minzoom)||C.maxzoom&&this.zoom>=C.maxzoom||"none"!==C.visibility&&(a(A,this.zoom,r),(m[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(x,g,this.tileID.canonical),c.bucketLayerIDs.push(A.map((function(t){return t.id}))))}}}var O=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(O).length?o.send("getGlyphs",{uid:this.uid,stacks:O},(function(t,e){h||(h=t,p=e,L.call(u))})):p={};var P=Object.keys(g.iconDependencies);P.length?o.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,L.call(u))})):f={};var k=Object.keys(g.patternDependencies);function L(){if(h)return s(h);if(p&&f&&d){var e=new i(p),n=new t.ImageAtlas(f,d);for(var o in m){var u=m[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,r),t.performSymbolLayout(u,p,e.positions,f,n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,r),u.addFeatures(g,this.tileID.canonical,n.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:n,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}k.length?o.send("getImages",{icons:k,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,L.call(u))})):d={},L.call(this)};var u=function(t,e,n,r){this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=r||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,n){var r=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete r.loading[i],e||!o)return s.status="done",r.loaded[i]=s,n(e);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(e,r){if(e||!r)return n(e);n(null,t.extend({rawTileData:u.slice(0)},r,l,c))})),r.loaded=r.loaded||{},r.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var n=this,r=this.loaded,i=t.uid,o=this;if(r&&r[i]){var a=r[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,r){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,n.availableImages,o.actor,i)),e(t,r)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var n=this.loading,r=t.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),e()},u.prototype.removeTile=function(t,e){var n=this.loaded,r=t.uid;n&&n[r]&&delete n[r],e()};var l=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var n=1;n<t.length;n++)p(t[n],!e)}}function p(t,e){for(var n=0,r=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),u=n+s;r+=Math.abs(n)>=Math.abs(s)?n-u+s:s-u+n,n=u}n+r>=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,n){var r=e.uid,i=e.encoding,o=e.rawImageData,a=l&&o instanceof l?this.getImageData(o):o,s=new t.DEMData(r,a,i);this.loaded=this.loaded||{},this.loaded[r]=s,n(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var n=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:n.width,height:n.height},n.data)},c.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=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))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],n=0,r=this._feature.geometry;n<r.length;n+=1){var i=r[n];e.push([new t.Point$1(i[0],i[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,c=s[a];l<c.length;l+=1){var h=c[l];u.push(new t.Point$1(h[0],h[1]))}o.push(u)}return o},d.prototype.toGeoJSON=function(t,e,n){return f.call(this,t,e,n)};var m=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};m.prototype.feature=function(t){return new d(this._features[t])};var g=t.vectorTile.VectorTileFeature,y=v;function v(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}v.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var n=0;n<e.length;n++){for(var r=e[n],i=[],o=0;o<r.length;o++)i.push(new t.Point$1(r[o][0],r[o][1]));this.geometry.push(i)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),n=Math.max(n,u.x),r=Math.min(r,u.y),i=Math.max(i,u.y)}return[e,r,n,i]},_.prototype.toGeoJSON=g.prototype.toGeoJSON;var b=w,x=y;function w(e){var n=new t.pbf;return function(t,e){for(var n in t.layers)e.writeMessage(3,S,t.layers[n])}(e,n),n.finish()}function S(t,e){var n;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<t.length;n++)r.feature=t.feature(n),e.writeMessage(2,E,r);var i=r.keys;for(n=0;n<i.length;n++)e.writeStringField(3,i[n]);var o=r.values;for(n=0;n<o.length;n++)e.writeMessage(4,O,o[n])}function E(t,e){var n=t.feature;void 0!==n.id&&e.writeVarintField(1,n.id),e.writeMessage(2,M,t),e.writeVarintField(3,n.type),e.writeMessage(4,C,n)}function M(t,e){var n=t.feature,r=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in n.properties){var u=o[s];void 0===u&&(r.push(s),o[s]=u=r.length-1),e.writeVarint(u);var l=n.properties[s],c=typeof l;"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var h=c+":"+l,p=a[h];void 0===p&&(i.push(l),a[h]=p=i.length-1),e.writeVarint(p)}}function T(t,e){return(e<<3)+(7&t)}function A(t){return t<<1^t>>31}function C(t,e){for(var n=t.loadGeometry(),r=t.type,i=0,o=0,a=n.length,s=0;s<a;s++){var u=n[s],l=1;1===r&&(l=u.length),e.writeVarint(T(1,l));for(var c=3===r?u.length-1:u.length,h=0;h<c;h++){1===h&&1!==r&&e.writeVarint(T(2,c-1));var p=u[h].x-i,f=u[h].y-o;e.writeVarint(A(p)),e.writeVarint(A(f)),i+=p,o+=f}3===r&&e.writeVarint(T(7,1))}}function O(t,e){var n=typeof t;"string"===n?e.writeStringField(1,t):"boolean"===n?e.writeBooleanField(7,t):"number"===n&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function P(t,e,n,r){k(t,n,r),k(e,2*n,2*r),k(e,2*n+1,2*r+1)}function k(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function L(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}b.fromVectorTileJs=w,b.fromGeojsonVt=function(t,e){e=e||{};var n={};for(var r in t)n[r]=new y(t[r].features,e),n[r].name=r,n[r].version=e.version,n[r].extent=e.extent;return w({layers:n})},b.GeoJSONWrapper=x;var I=function(t){return t[0]},R=function(t){return t[1]},D=function(t,e,n,r,i){void 0===e&&(e=I),void 0===n&&(n=R),void 0===r&&(r=64),void 0===i&&(i=Float64Array),this.nodeSize=r,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u<t.length;u++)a[u]=u,s[2*u]=e(t[u]),s[2*u+1]=n(t[u]);!function t(e,n,r,i,o,a){if(!(o-i<=r)){var s=i+o>>1;!function t(e,n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=n[2*r+a],f=i,d=o;for(P(e,n,i,r),n[2*o+a]>p&&P(e,n,i,o);f<d;){for(P(e,n,f,d),f++,d--;n[2*f+a]<p;)f++;for(;n[2*d+a]>p;)d--}n[2*i+a]===p?P(e,n,i,d):P(e,n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(e,n,s,i,o,a%2),t(e,n,r,i,s-1,a+1),t(e,n,r,s+1,o,a+1)}}(a,s,r,0,a.length-1,0)};D.prototype.range=function(t,e,n,r){return function(t,e,n,r,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),p=l.pop(),f=l.pop();if(p-f<=a)for(var d=f;d<=p;d++)u=e[2*d+1],(s=e[2*d])>=n&&s<=i&&u>=r&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+p)/2);u=e[2*m+1],(s=e[2*m])>=n&&s<=i&&u>=r&&u<=o&&c.push(t[m]);var g=(h+1)%2;(0===h?n<=s:r<=u)&&(l.push(f),l.push(m-1),l.push(g)),(0===h?i>=s:o>=u)&&(l.push(m+1),l.push(p),l.push(g))}}return c}(this.ids,this.coords,t,e,n,r,this.nodeSize)},D.prototype.within=function(t,e,n){return function(t,e,n,r,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)L(e[2*p],e[2*p+1],n,r)<=u&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],m=e[2*f+1];L(d,m,n,r)<=u&&s.push(t[f]);var g=(l+1)%2;(0===l?n-i<=d:r-i<=m)&&(a.push(h),a.push(f-1),a.push(g)),(0===l?n+i>=d:r+i>=m)&&(a.push(f+1),a.push(c),a.push(g))}}return s}(this.ids,this.coords,t,e,n,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}},F=function(t){this.options=G(Object.create(N),t),this.trees=new Array(this.options.maxZoom+1)};function z(t,e,n,r,i){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function B(t,e){var n=t.geometry.coordinates,r=n[1];return{x:Z(n[0]),y:V(r),zoom:1/0,index:e,parentId:-1}}function j(t){return{type:"Feature",id:t.id,properties:U(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,r}function U(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function Z(t){return t/360+.5}function V(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function G(t,e){for(var n in e)t[n]=e[n];return t}function H(t){return t.x}function W(t){return t.y}function q(t,e,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var u=((t-n)*a+(e-r)*s)/(a*a+s*s);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=s*u)}return(a=t-n)*a+(s=e-r)*s}function Y(t,e,n,r){var i={id:void 0===t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)X(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<e.length;r++)X(t,e[r]);else if("MultiPolygon"===n)for(r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)X(t,e[r][i])}(i),i}function X(t,e){for(var n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function $(t,e,n,r){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],u=e.id;if(n.promoteId?u=e.properties[n.promoteId]:n.generateId&&(u=r||0),"Point"===o)K(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)K(i[l],s);else if("LineString"===o)J(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(l=0;l<i.length;l++)J(i[l],s=[],a,!1),t.push(Y(u,"LineString",s,e.properties));return}Q(i,s,a,!1)}else if("Polygon"===o)Q(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)$(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var c=[];Q(i[l],c,a,!0),s.push(c)}}t.push(Y(u,o,s,e.properties))}}function K(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function J(t,e,n,r){for(var i,o,a=0,s=0;s<t.length;s++){var u=tt(t[s][0]),l=et(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(a+=r?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,function t(e,n,r,i){for(var o,a=i,s=r-n>>1,u=r-n,l=e[n],c=e[n+1],h=e[r],p=e[r+1],f=n+3;f<r;f+=3){var d=q(e[f],e[f+1],l,c,h,p);if(d>a)o=f,a=d;else if(d===a){var m=Math.abs(f-s);m<u&&(o=f,u=m)}}a>i&&(o-n>3&&t(e,n,o,i),e[o+2]=a,r-o>3&&t(e,o,r,i))}(e,0,c,n),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Q(t,e,n,r){for(var i=0;i<t.length;i++){var o=[];J(t[i],o,n,r),e.push(o)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function nt(t,e,n,r,i,o,a,s){if(r/=e,o>=(n/=e)&&a<r)return t;if(a<n||o>=r)return null;for(var u=[],l=0;l<t.length;l++){var c=t[l],h=c.geometry,p=c.type,f=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(f>=n&&d<r)u.push(c);else if(!(d<n||f>=r)){var m=[];if("Point"===p||"MultiPoint"===p)rt(h,m,n,r,i);else if("LineString"===p)it(h,m,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===p)at(h,m,n,r,i,!1);else if("Polygon"===p)at(h,m,n,r,i,!0);else if("MultiPolygon"===p)for(var g=0;g<h.length;g++){var y=[];at(h[g],y,n,r,i,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(g=0;g<m.length;g++)u.push(Y(c.id,p,m[g],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),u.push(Y(c.id,p,m,c.tags))}}}return u.length?u:null}function rt(t,e,n,r,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,n,r,i,o,a){for(var s,u,l=ot(t),c=0===i?ut:lt,h=t.start,p=0;p<t.length-3;p+=3){var f=t[p],d=t[p+1],m=t[p+2],g=t[p+3],y=t[p+4],v=0===i?f:d,_=0===i?g:y,b=!1;a&&(s=Math.sqrt(Math.pow(f-g,2)+Math.pow(d-y,2))),v<n?_>n&&(u=c(l,f,d,g,y,n),a&&(l.start=h+s*u)):v>r?_<r&&(u=c(l,f,d,g,y,r),a&&(l.start=h+s*u)):st(l,f,d,m),_<n&&v>=n&&(u=c(l,f,d,g,y,n),b=!0),_>r&&v<=r&&(u=c(l,f,d,g,y,r),b=!0),!o&&b&&(a&&(l.end=h+s*u),e.push(l),l=ot(t)),a&&(h+=s)}var x=t.length-3;f=t[x],d=t[x+1],m=t[x+2],(v=0===i?f:d)>=n&&v<=r&&st(l,f,d,m),x=l.length-3,o&&x>=3&&(l[x]!==l[0]||l[x+1]!==l[1])&&st(l,l[0],l[1],l[2]),l.length&&e.push(l)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,n,r,i,o){for(var a=0;a<t.length;a++)it(t[a],e,n,r,i,o,!1)}function st(t,e,n,r){t.push(e),t.push(n),t.push(r)}function ut(t,e,n,r,i,o){var a=(o-e)/(r-e);return t.push(o),t.push(n+(i-n)*a),t.push(1),a}function lt(t,e,n,r,i,o){var a=(o-n)/(i-n);return t.push(e+(r-e)*a),t.push(o),t.push(1),a}function ct(t,e){for(var n=[],r=0;r<t.length;r++){var i,o=t[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=ht(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(ht(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(ht(o.geometry[s][l],e));i.push(u)}n.push(Y(o.id,a,i,o.tags))}return n}function ht(t,e){var n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);for(var r=0;r<t.length;r+=3)n.push(t[r]+e,t[r+1],t[r+2]);return n}function pt(t,e){if(t.transformed)return t;var n,r,i,o=1<<t.z,a=t.x,s=t.y;for(n=0;n<t.features.length;n++){var u=t.features[n],l=u.geometry,c=u.type;if(u.geometry=[],1===c)for(r=0;r<l.length;r+=2)u.geometry.push(ft(l[r],l[r+1],e,o,a,s));else for(r=0;r<l.length;r++){var h=[];for(i=0;i<l[r].length;i+=2)h.push(ft(l[r][i],l[r][i+1],e,o,a,s));u.geometry.push(h)}}return t.transformed=!0,t}function ft(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function dt(t,e,n,r,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,mt(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,c=t[s].maxX,h=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function mt(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)gt(a,i,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)gt(a,i[s],t,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)gt(a,l[s],t,n,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var p={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(p.id=e.id),t.features.push(p)}}function gt(t,e,n,r,i,o){var a=r*r;if(r>0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===r||e[u+2]>a)&&(n.numSimplified++,s.push(e[u]),s.push(e[u+1])),n.numPoints++;i&&function(t,e){for(var n=0,r=0,i=t.length,o=i-2;r<i;o=r,r+=2)n+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(n>0===e)for(r=0,i=t.length;r<i/2;r+=2){var a=t[r],s=t[r+1];t[r]=t[i-2-r],t[r+1]=t[i-1-r],t[i-2-r]=a,t[i-1-r]=s}}(s,o),t.push(s)}}function yt(t,e){var n=(e=this.options=function(t,e){for(var n in e)t[n]=e[n];return t}(Object.create(this.options),e)).debug;if(n&&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 r=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)$(n,t.features[r],e,r);else $(n,"Feature"===t.type?t:{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(r=function(t,e){var n=e.buffer/e.extent,r=t,i=nt(t,1,-1-n,n,0,-1,2,e),o=nt(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=nt(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=ct(i,1).concat(r)),o&&(r=r.concat(ct(o,-1)))),r}(r,e)).length&&this.splitTile(r,0,0,0),n&&(r.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 vt(t,e,n){return 32*((1<<t)*n+e)+t}function _t(t,e){var n=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return e(null,null);var i=new m(r.features),o=b(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}F.prototype.load=function(t){var e=this.options,n=e.log,r=e.minZoom,i=e.maxZoom,o=e.nodeSize;n&&console.time("total time");var a="prepare "+t.length+" points";n&&console.time(a),this.points=t;for(var s=[],u=0;u<t.length;u++)t[u].geometry&&s.push(B(t[u],u));this.trees[i+1]=new D(s,H,W,o,Float32Array),n&&console.timeEnd(a);for(var l=i;l>=r;l--){var c=+Date.now();s=this._cluster(s,l),this.trees[l]=new D(s,H,W,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-c)}return n&&console.timeEnd("total time"),this},F.prototype.getClusters=function(t,e){var n=((t[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],e),s=this.getClusters([-180,r,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],c=0,h=u.range(Z(n),V(o),Z(i),V(r));c<h.length;c+=1){var p=u.points[h[c]];l.push(p.numPoints?j(p):this.points[p.index])}return l},F.prototype.getChildren=function(t){var e=this._getOriginId(t),n=this._getOriginZoom(t),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var o=i.points[e];if(!o)throw new Error(r);for(var a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=[],u=0,l=i.within(o.x,o.y,a);u<l.length;u+=1){var c=i.points[l[u]];c.parentId===t&&s.push(c.numPoints?j(c):this.points[c.index])}if(0===s.length)throw new Error(r);return s},F.prototype.getLeaves=function(t,e,n){var r=[];return this._appendLeaves(r,t,e=e||10,n=n||0,0),r},F.prototype.getTile=function(t,e,n){var r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.radius/o.extent,s=(n-a)/i,u=(n+1+a)/i,l={features:[]};return this._addTileFeatures(r.range((e-a)/i,s,(e+1+a)/i,u),r.points,e,n,i,l),0===e&&this._addTileFeatures(r.range(1-a/i,s,1,u),r.points,i,n,i,l),e===i-1&&this._addTileFeatures(r.range(0,s,a/i,u),r.points,-1,n,i,l),l.features.length?l:null},F.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},F.prototype._appendLeaves=function(t,e,n,r,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=r?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,n,r,i):i<r?i++:t.push(s),t.length===n)break}return i},F.prototype._addTileFeatures=function(t,e,n,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l=u.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-n)),Math.round(this.options.extent*(u.y*i-r))]],tags:l?U(u):this.points[u.index].properties},h=void 0;l?h=u.id:this.options.generateId?h=u.index:this.points[u.index].id&&(h=this.points[u.index].id),void 0!==h&&(c.id=h),o.features.push(c)}},F.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},F.prototype._cluster=function(t,e){for(var n=[],r=this.options,i=r.reduce,o=r.minPoints,a=r.radius/(r.extent*Math.pow(2,e)),s=0;s<t.length;s++){var u=t[s];if(!(u.zoom<=e)){u.zoom=e;for(var l=this.trees[e+1],c=l.within(u.x,u.y,a),h=u.numPoints||1,p=h,f=0,d=c;f<d.length;f+=1){var m=l.points[d[f]];m.zoom>e&&(p+=m.numPoints||1)}if(p>=o){for(var g=u.x*h,y=u.y*h,v=i&&h>1?this._map(u,!0):null,_=(s<<5)+(e+1)+this.points.length,b=0,x=c;b<x.length;b+=1){var w=l.points[x[b]];if(!(w.zoom<=e)){w.zoom=e;var S=w.numPoints||1;g+=w.x*S,y+=w.y*S,w.parentId=_,i&&(v||(v=this._map(u,!0)),i(v,this._map(w)))}}u.parentId=_,n.push(z(g/p,y/p,_,p,v))}else if(n.push(u),p>1)for(var E=0,M=c;E<M.length;E+=1){var T=l.points[M[E]];T.zoom<=e||(T.zoom=e,n.push(T))}}}return n},F.prototype._getOriginId=function(t){return t-this.points.length>>5},F.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},F.prototype._map=function(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;var n=this.points[t.index].properties,r=this.options.map(n);return e&&r===n?G({},r):r},yt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},yt.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],u=this.options,l=u.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=vt(e,n,r),p=this.tiles[h];if(!p&&(l>1&&console.time("creation"),p=this.tiles[h]=dt(t,e,n,r,u),this.tileCoords.push({z:e,x:n,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<<i-e;if(n!==Math.floor(o/d)||r!==Math.floor(a/d))continue}else if(e===u.indexMaxZoom||p.numPoints<=u.indexMaxPoints)continue;if(p.source=null,0!==t.length){l>1&&console.time("clipping");var m,g,y,v,_,b,x=.5*u.buffer/u.extent,w=.5-x,S=.5+x,E=1+x;m=g=y=v=null,_=nt(t,c,n-x,n+S,0,p.minX,p.maxX,u),b=nt(t,c,n+w,n+E,0,p.minX,p.maxX,u),t=null,_&&(m=nt(_,c,r-x,r+S,1,p.minY,p.maxY,u),g=nt(_,c,r+w,r+E,1,p.minY,p.maxY,u),_=null),b&&(y=nt(b,c,r-x,r+S,1,p.minY,p.maxY,u),v=nt(b,c,r+w,r+E,1,p.minY,p.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*n,2*r),s.push(g||[],e+1,2*n,2*r+1),s.push(y||[],e+1,2*n+1,2*r),s.push(v||[],e+1,2*n+1,2*r+1)}}},yt.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug;if(t<0||t>24)return null;var a=1<<t,s=vt(t,e=(e%a+a)%a,n);if(this.tiles[s])return pt(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var u,l=t,c=e,h=n;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[vt(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?pt(this.tiles[s],i):null):null};var bt=function(e){function n(t,n,r,i){e.call(this,t,n,r,_t),i&&(this.loadGeoJSON=i)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.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())},n.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var n=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(r&&r.request&&r.request.collectResourceTiming)&&new t.RequestPerformance(r.request);this.loadGeoJSON(r,(function(o,a){if(o||!a)return n(o);if("object"!=typeof a)return n(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,n){var r,i=e&&e.type;if("FeatureCollection"===i)for(r=0;r<e.features.length;r++)t(e.features[r],n);else if("GeometryCollection"===i)for(r=0;r<e.geometries.length;r++)t(e.geometries[r],n);else if("Feature"===i)t(e.geometry,n);else if("Polygon"===i)h(e.coordinates,n);else if("MultiPolygon"===i)for(r=0;r<e.coordinates.length;r++)h(e.coordinates[r],n);return e}(a,!0);try{if(r.filter){var s=t.createExpression(r.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 u=a.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));a={type:"FeatureCollection",features:u}}e._geoJSONIndex=r.cluster?new F(function(e){var n=e.superclusterOptions,r=e.clusterProperties;if(!r||!n)return n;for(var i={},o={},a={accumulated:null,zoom:0},s={properties:null},u=Object.keys(r),l=0,c=u;l<c.length;l+=1){var h=c[l],p=r[h],f=p[0],d=t.createExpression(p[1]),m=t.createExpression("string"==typeof f?[f,["accumulated"],["get",h]]:f);i[h]=d.value,o[h]=m.value}return n.map=function(t){s.properties=t;for(var e={},n=0,r=u;n<r.length;n+=1){var o=r[n];e[o]=i[o].evaluate(a,s)}return e},n.reduce=function(t,e){s.properties=e;for(var n=0,r=u;n<r.length;n+=1){var i=r[n];a.accumulated=t[i],t[i]=o[i].evaluate(a,s)}},n}(r)).load(a.features):function(t,e){return new yt(t,e)}(a,r.geojsonVtOptions)}catch(o){return n(o)}e.loaded={};var l={};if(i){var c=i.finish();c&&(l.resourceTiming={},l.resourceTiming[r.source]=JSON.parse(JSON.stringify(c)))}n(null,l)}))}},n.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},n.prototype.reloadTile=function(t,n){var r=this.loaded;return r&&r[t.uid]?e.prototype.reloadTile.call(this,t,n):this.loadTile(t,n)},n.prototype.loadGeoJSON=function(e,n){if(e.request)t.getJSON(e.request,n);else{if("string"!=typeof e.data)return n(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return n(null,JSON.parse(e.data))}catch(t){return n(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},n.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},n.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},n.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},n.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},n}(u),xt=function(e){var n=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:u,geojson:bt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(n.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');n.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 xt.prototype.setReferrer=function(t,e){this.referrer=e},xt.prototype.setImages=function(t,e,n){for(var r in this.availableImages[t]=e,this.workerSources[t]){var i=this.workerSources[t][r];for(var o in i)i[o].availableImages=e}n()},xt.prototype.setLayers=function(t,e,n){this.getLayerIndex(t).replace(e),n()},xt.prototype.updateLayers=function(t,e,n){this.getLayerIndex(t).update(e.layers,e.removedIds),n()},xt.prototype.loadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).loadTile(e,n)},xt.prototype.loadDEMTile=function(t,e,n){this.getDEMWorkerSource(t,e.source).loadTile(e,n)},xt.prototype.reloadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).reloadTile(e,n)},xt.prototype.abortTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).abortTile(e,n)},xt.prototype.removeTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).removeTile(e,n)},xt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},xt.prototype.removeSource=function(t,e,n){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var r=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==r.removeSource?r.removeSource(e,n):n()}},xt.prototype.loadWorkerSource=function(t,e,n){try{this.self.importScripts(e.url),n()}catch(t){n(t.toString())}},xt.prototype.syncRTLPluginState=function(e,n,r){try{t.plugin.setState(n);var i=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=i){this.self.importScripts(i);var o=t.plugin.isParsed();r(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),o)}}catch(t){r(t.toString())}},xt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},xt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new r),e},xt.prototype.getWorkerSource=function(t,e,n){var r=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][n]||(this.workerSources[t][e][n]=new this.workerSourceTypes[e]({send:function(e,n,i){r.actor.send(e,n,i,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][n]},xt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new c),this.demWorkerSources[t][e]},xt.prototype.enforceCacheSizeLimit=function(e,n){t.enforceCacheSizeLimit(n)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new xt(self)),xt})),r(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!n(t)}function n(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,n=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(n);try{e=new Worker(r),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(r),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 n=e.getImageData(0,0,1,1);return n&&n.width===t.width}()?(void 0===r[n=t&&t.failIfMajorPerformanceCaveat]&&(r[n]=function(t){var n=function(t){var n=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,n.probablySupportsContext?n.probablySupportsContext("webgl",r)||n.probablySupportsContext("experimental-webgl",r):n.supportsContext?n.supportsContext("webgl",r)||n.supportsContext("experimental-webgl",r):n.getContext("webgl",r)||n.getContext("experimental-webgl",r)}(t);if(!n)return!1;var r=n.createShader(n.VERTEX_SHADER);return!(!r||n.isContextLost())&&(n.shaderSource(r,"void main() {}"),n.compileShader(r),!0===n.getShaderParameter(r,n.COMPILE_STATUS))}(n)),r[n]?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";var n}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=n);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),n={create:function(e,n,r){var i=t.window.document.createElement(e);return void 0!==n&&(i.className=n),r&&r.appendChild(i),i},createNS:function(e,n){return t.window.document.createElementNS(e,n)}},r=t.window.document&&t.window.document.documentElement.style;function i(t){if(!r)return t[0];for(var e=0;e<t.length;e++)if(t[e]in r)return t[e];return t[0]}var o,a=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);n.disableDrag=function(){r&&a&&(o=r[a],r[a]="none")},n.enableDrag=function(){r&&a&&(r[a]=o)};var s=i(["transform","WebkitTransform"]);n.setTransform=function(t,e){t.style[s]=e};var u=!1;try{var l=Object.defineProperty({},"passive",{get:function(){u=!0}});t.window.addEventListener("test",l,l),t.window.removeEventListener("test",l,l)}catch(t){u=!1}n.addEventListener=function(t,e,n,r){void 0===r&&(r={}),t.addEventListener(e,n,"passive"in r&&u?r:r.capture)},n.removeEventListener=function(t,e,n,r){void 0===r&&(r={}),t.removeEventListener(e,n,"passive"in r&&u?r:r.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}n.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},n.mousePos=function(e,n){var r=e.getBoundingClientRect();return new t.Point(n.clientX-r.left-e.clientLeft,n.clientY-r.top-e.clientTop)},n.touchPos=function(e,n){for(var r=e.getBoundingClientRect(),i=[],o=0;o<n.length;o++)i.push(new t.Point(n[o].clientX-r.left-e.clientLeft,n[o].clientY-r.top-e.clientTop));return i},n.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},n.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function n(){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&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.isLoaded=function(){return this.loaded},n.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,n=this.requestors;e<n.length;e+=1){var r=n[e];this._notify(r.ids,r.callback)}this.requestors=[]}},n.prototype.getImage=function(t){return this.images[t]},n.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},n.prototype._validate=function(e,n){var r=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),r=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),r=!1),this._validateContent(n.content,n)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),r=!1),r},n.prototype._validateStretch=function(t,e){if(!t)return!0;for(var n=0,r=0,i=t;r<i.length;r+=1){var o=i[r];if(o[0]<n||o[1]<o[0]||e<o[1])return!1;n=o[1]}return!0},n.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]))},n.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},n.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()},n.prototype.listImages=function(){return Object.keys(this.images)},n.prototype.getImages=function(t,e){var n=!0;if(!this.isLoaded())for(var r=0,i=t;r<i.length;r+=1)this.images[i[r]]||(n=!1);this.isLoaded()||n?this._notify(t,e):this.requestors.push({ids:t,callback:e})},n.prototype._notify=function(e,n){for(var r={},i=0,o=e;i<o.length;i+=1){var a=o[i];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?r[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" 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.')}n(null,r)},n.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},n.prototype.getPattern=function(e){var n=this.patterns[e],r=this.getImage(e);if(!r)return null;if(n&&n.position.version===r.version)return n.position;if(n)n.position.version=r.version;else{var i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},o=new t.ImagePosition(i,r);this.patterns[e]={bin:i,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},n.prototype.bind=function(e){var n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)},n.prototype._updatePatternAtlas=function(){var e=[];for(var n in this.patterns)e.push(this.patterns[n].bin);var r=t.potpack(e),i=r.w,o=r.h,a=this.atlasImage;for(var s in a.resize({width:i||1,height:o||1}),this.patterns){var u=this.patterns[s].bin,l=u.x+1,c=u.y+1,h=this.images[s].data,p=h.width,f=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:c},{width:p,height:f}),t.RGBAImage.copy(h,a,{x:0,y:f-1},{x:l,y:c-1},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:c+f},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:p-1,y:0},{x:l-1,y:c},{width:1,height:f}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l+p,y:c},{width:1,height:f})}this.dirty=!0},n.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},n.prototype.dispatchRenderCallbacks=function(t){for(var e=0,n=t;e<n.length;e+=1){var r=n[e];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var i=this.images[r];h(i)&&this.updateImage(r,i)}}},n}(t.Evented),f=g,d=g,m=1e20;function g(t,e,n,r,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,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(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(t,e,n,r,i,o,a){for(var s=0;s<e;s++){for(var u=0;u<n;u++)r[u]=t[u*e+s];for(v(r,i,o,a,n),u=0;u<n;u++)t[u*e+s]=i[u]}for(u=0;u<n;u++){for(s=0;s<e;s++)r[s]=t[u*e+s];for(v(r,i,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(i[s])}}function v(t,e,n,r,i){n[0]=0,r[0]=-m,r[1]=+m;for(var o=1,a=0;o<i;o++){for(var s=(t[o]+o*o-(t[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);s<=r[a];)a--,s=(t[o]+o*o-(t[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);n[++a]=o,r[a]=s,r[a+1]=+m}for(o=0,a=0;o<i;o++){for(;r[a+1]<o;)a++;e[o]=(o-n[a])*(o-n[a])+t[n[a]]}}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),n=new Uint8ClampedArray(this.size*this.size),r=0;r<this.size*this.size;r++){var i=e.data[4*r+3]/255;this.gridOuter[r]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[r]=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),r=0;r<this.size*this.size;r++)n[r]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[r]-this.gridInner[r])/this.radius+this.cutoff))));return n},f.default=d;var _=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};_.prototype.setURL=function(t){this.url=t},_.prototype.getGlyphs=function(e,n){var r=this,i=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1)i.push({stack:o,id:s[a]});t.asyncAll(i,(function(t,e){var n=t.stack,i=t.id,o=r.entries[n];o||(o=r.entries[n]={glyphs:{},requests:{},ranges:{}});var a=o.glyphs[i];if(void 0===a){if(a=r._tinySDF(o,n,i))return o.glyphs[i]=a,void e(null,{stack:n,id:i,glyph:a});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:n,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],_.loadGlyphRange(n,s,r.url,r.requestManager,(function(t,e){if(e){for(var n in e)r._doesCharSupportLocalGlyph(+n)||(o.glyphs[+n]=e[+n]);o.ranges[s]=!0}for(var i=0,a=u;i<a.length;i+=1)(0,a[i])(t,e);delete o.requests[s]}))),u.push((function(t,r){t?e(t):r&&e(null,{stack:n,id:i,glyph:r[i]||null})}))}}else e(null,{stack:n,id:i,glyph:a})}),(function(t,e){if(t)n(t);else if(e){for(var r={},i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.stack,u=a.id,l=a.glyph;(r[s]||(r[s]={}))[u]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics}}n(null,r)}}))},_.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))},_.prototype._tinySDF=function(e,n,r){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(r)){var o=e.tinySDF;if(!o){var a="400";/bold/i.test(n)?a="900":/medium/i.test(n)?a="500":/light/i.test(n)&&(a="200"),o=e.tinySDF=new _.TinySDF(24,3,8,.25,i,a)}return{id:r,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},_.loadGlyphRange=function(e,n,r,i,o){var a=256*n,s=a+255,u=i.transformRequest(i.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(u,(function(e,n){if(e)o(e);else if(n){for(var r={},i=0,a=t.parseGlyphPBF(n);i<a.length;i+=1){var s=a[i];r[s.id]=s}o(null,r)}}))},_.TinySDF=f;var b=function(){this.specification=t.styleSpec.light.position};b.prototype.possiblyEvaluate=function(e,n){return t.sphericalToCartesian(e.expression.evaluate(n))},b.prototype.interpolate=function(e,n,r){return{x:t.number(e.x,n.x,r),y:t.number(e.y,n.y,r),z:t.number(e.z,n.z,r)}};var x=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new b,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function n(n){e.call(this),this._transitionable=new t.Transitionable(x),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getLight=function(){return this._transitionable.serialize()},n.prototype.setLight=function(e,n){if(void 0===n&&(n={}),!this._validate(t.validateLight,e,n))for(var r in e){var i=e[r];t.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-11),i):this._transitionable.setValue(r,i)}},n.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},n.prototype.hasTransition=function(){return this._transitioning.hasTransition()},n.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},n.prototype._validate=function(e,n,r){return(!r||!1!==r.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},n}(t.Evented),S=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};S.prototype.getDash=function(t,e){var n=t.join(",")+String(e);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(t,e)),this.dashEntry[n]},S.prototype.getDashRanges=function(t,e,n){var r=[],i=t.length%2==1?-t[t.length-1]*n:0,o=t[0]*n,a=!0;r.push({left:i,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],u=1;u<t.length;u++){var l=t[u];r.push({left:i=s*n,right:o=(s+=l)*n,isDash:a=!a,zeroLength:0===l})}return r},S.prototype.addRoundDash=function(t,e,n){for(var r=e/2,i=-n;i<=n;i++)for(var o=this.width*(this.nextRow+n+i),a=0,s=t[a],u=0;u<this.width;u++){u/s.right>1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),h=Math.min(l,c),p=void 0,f=i/n*(r+1);if(s.isDash){var d=r-Math.abs(f);p=Math.sqrt(h*h+d*d)}else p=r-Math.sqrt(h*h+f*f);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},S.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var n=t[e],r=t[e+1];n.zeroLength?t.splice(e,1):r&&r.isDash===n.isDash&&(r.left=n.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l<this.width;l++){l/u.right>1&&(u=t[++s]);var c=Math.abs(l-u.left),h=Math.abs(l-u.right),p=Math.min(c,h);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},S.prototype.addDash=function(e,n){var r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a<e.length;a++)o+=e[a];if(0!==o){var s=this.width/o,u=this.getDashRanges(e,this.width,s);n?this.addRoundDash(u,s,r):this.addRegularDash(u)}var l={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};return this.nextRow+=i,this.dirty=!0,l},S.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 E=function e(n,r){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),o=0;o<i.length;o++){var a=new e.Actor(i[o],r,this.id);a.name="Worker "+o,this.actors.push(a)}};function M(e,n,r){var i=function(i,o){if(i)return r(i);if(o){var a=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(a.vectorLayers=o.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=n.canonicalizeTileset(a,e.url),r(null,a)}};return e.url?t.getJSON(n.transformRequest(n.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame((function(){return i(null,e)}))}E.prototype.broadcast=function(e,n,r){t.asyncAll(this.actors,(function(t,r){t.send(e,n,r)}),r=r||function(){})},E.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},E.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},E.Actor=t.Actor;var T=function(e,n,r){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=r||24};T.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]},T.prototype.contains=function(e){var n=Math.pow(2,e.z),r=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*n),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*n),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*n),a=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*n);return e.x>=r&&e.x<o&&e.y>=i&&e.y<a};var A=function(e){function n(n,r,i,o){if(e.call(this),this.id=n,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(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=M(this._options,this.map._requestManager,(function(n,r){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new T(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(r.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"})))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},n.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},n.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.loadTile=function(e,n){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(r,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 o(r,i){return delete e.request,e.aborted?n(null):r&&404!==r.status?n(r):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),n(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=n:e.request=e.actor.send("reloadTile",i,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,o.bind(this)))},n.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)},n.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},n.prototype.hasTransition=function(){return!1},n}(t.Evented),C=function(e){function n(n,r,i,o){e.call(this),this.id=n,this.dispatcher=i,this.setEventedParent(o),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"},r),t.extend(this,t.pick(r,["url","scheme","tileSize"]))}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=M(this._options,this.map._requestManager,(function(n,r){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new T(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles),t.postMapLoadEvent(r.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"})))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.loadTile=function(e,n){var r=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,o){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(i)e.state="errored",n(i);else if(o){r.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=r.map.painter.context,s=a.gl;e.texture=r.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(r.dispatcher),n(null)}}))},n.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},n.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},n.prototype.hasTransition=function(){return!1},n}(t.Evented),O=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},n.prototype.loadTile=function(e,n){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(t,r){t&&(e.state="errored",n(t)),r&&(e.dem=r,e.needsHillshadePrepare=!0,e.state="loaded",n(null))}e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),function(r,o){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(r)e.state="errored",n(r);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?o:t.browser.getImageData(o,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,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)},n.prototype._getNeighboringTiles=function(e){var n=e.canonical,r=Math.pow(2,n.z),i=(n.x-1+r)%r,o=0===n.x?e.wrap-1:e.wrap,a=(n.x+1+r)%r,s=n.x+1===r?e.wrap+1:e.wrap,u={};return u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y).key]={backfilled:!1},n.y>0&&(u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+1<r&&(u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y+1).key]={backfilled:!1}),u},n.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})},n}(C),P=function(e){function n(n,r,i,o){e.call(this),this.id=n,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(o),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({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:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:t.EXTENT,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(n){if(n)e.fire(new t.ErrorEvent(n));else{var r={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r))}}))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setData=function(e){var n=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)n.fire(new t.ErrorEvent(e));else{var r={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new t.Event("data",r))}})),this},n.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},n.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},n.prototype.getClusterLeaves=function(t,e,n,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:n},r),this},n.prototype._updateWorkerData=function(e){var n=this;this._loaded=!1;var r=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+".loadData",r,(function(t,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.actor.send(n.type+".coalesce",{source:r.source},null),e(t))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(e,n){var r=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{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},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?n(null):t?n(t):(e.loadVectorData(o,r.map.painter,"reloadTile"===i),n(null))}))},n.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},n.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},n.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},n.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(t.Evented),k=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),L=function(e){function n(t,n,r,i){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(e,n){var r=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,o){r._loaded=!0,i?r.fire(new t.ErrorEvent(i)):o&&(r.image=o,e&&(r.coordinates=e),n&&n(),r._finishLoading())}))},n.prototype.loaded=function(){return this._loaded},n.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},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setCoordinates=function(e){var n=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0,s=e;a<s.length;a+=1){var u=s[a];n=Math.min(n,u.x),r=Math.min(r,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y)}var l=Math.max(i-n,o-r),c=Math.max(0,Math.floor(-Math.log(l)/Math.LN2)),h=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((n+i)/2*h),Math.floor((r+o)/2*h))}(r),this.minzoom=this.maxzoom=this.tileID.z;var i=r.map((function(t){return n.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},n.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,n=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,k.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},n.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))},n.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return!1},n}(t.Evented),I=function(e){function n(t,n,r,i){e.call(this,t,n,r,i),this.roundZoom=!0,this.type="video",this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1;var n=this.options;this.urls=[];for(var r=0,i=n.urls;r<i.length;r+=1)this.urls.push(this.map._requestManager.transformRequest(i[r],t.ResourceType.Source).url);t.getVideo(this.urls,(function(n,r){e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):r&&(e.video=r,e.video.loop=!0,e.video.setAttribute("playsinline",""),e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},n.prototype.pause=function(){this.video&&this.video.pause()},n.prototype.play=function(){this.video&&this.video.play()},n.prototype.seek=function(e){if(this.video){var n=this.video.seekable;e<n.start(0)||e>n.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+n.start(0)+" and "+n.end(0)+"-second mark."))):this.video.currentTime=e}},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,n=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,k.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(L),R=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.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."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,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."+n,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.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())},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.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 n=this.map.painter.context,r=n.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,k.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(n,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var n=e[t];if(isNaN(n)||n<=0)return!0}return!1},n}(L),D={vector:A,raster:C,"raster-dem":O,geojson:P,video:I,image:L,canvas:R};function N(e,n){var r=t.identity([]);return t.translate(r,r,[1,1,0]),t.scale(r,r,[.5*e.width,.5*e.height,1]),t.multiply(r,r,e.calculatePosMatrix(n.toUnwrapped()))}function F(t,e,n,r,i,o){var a=function(t,e,n){if(t)for(var r=0,i=t;r<i.length;r+=1){var o=e[i[r]];if(o&&o.source===n&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===n&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,e,t.id),s=o.maxPitchScaleFactor(),u=t.tilesIn(r,s,a);u.sort(z);for(var l=[],c=0,h=u;c<h.length;c+=1){var p=h[c];l.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,n,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,i,o,s,N(t.transform,p.tileID))})}var f=function(t){for(var e={},n={},r=0,i=t;r<i.length;r+=1){var o=i[r],a=o.queryResults,s=o.wrappedTileID,u=n[s]=n[s]||{};for(var l in a)for(var c=a[l],h=u[l]=u[l]||{},p=e[l]=e[l]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];h[m.featureIndex]||(h[m.featureIndex]=!0,p.push(m))}}return e}(l);for(var d in f)f[d].forEach((function(e){var n=e.feature,r=t.getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=r}));return f}function z(t,e){var n=t.tileID,r=e.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.canonical.x}var B=function(t,e){this.max=t,this.onRemove=e,this.reset()};B.prototype.reset=function(){for(var t in this.data)for(var e=0,n=this.data[t];e<n.length;e+=1){var r=n[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value)}return this.data={},this.order=[],this},B.prototype.add=function(t,e,n){var r=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var o={value:e,timeout:void 0};if(void 0!==n&&(o.timeout=setTimeout((function(){r.remove(t,o)}),n)),this.data[i].push(o),this.order.push(i),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.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},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var n=t.wrapped().key,r=void 0===e?0:this.data[n].indexOf(e),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this},B.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},B.prototype.filter=function(t){var e=[];for(var n in this.data)for(var r=0,i=this.data[n];r<i.length;r+=1){var o=i[r];t(o.value)||e.push(o)}for(var a=0,s=e;a<s.length;a+=1){var u=s[a];this.remove(u.value.tileID,u)}};var j=function(t,e,n){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};j.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},j.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},j.prototype.destroy=function(){this.buffer&&(this.context.gl.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"},Z=function(t,e,n,r){this.length=e.length,this.attributes=n,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,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};Z.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Z.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},Z.prototype.enableAttributes=function(t,e){for(var n=0;n<this.attributes.length;n++){var r=e.attributes[this.attributes[n].name];void 0!==r&&t.enableVertexAttribArray(r)}},Z.prototype.setVertexAttribPointers=function(t,e,n){for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],o=e.attributes[i.name];void 0!==o&&t.vertexAttribPointer(o,i.components,t[U[i.type]],!1,this.itemSize,i.offset+this.itemSize*(n||0))}},Z.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var V=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};V.prototype.get=function(){return this.current},V.prototype.set=function(t){},V.prototype.getDefault=function(){return this.default},V.prototype.setDefault=function(){this.set(this.default)};var G=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getDefault=function(){return t.Color.transparent},n.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)},n}(V),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),it=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getDefault=function(){return t.Color.transparent},n.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)},n}(V),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),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)).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}(V),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(V),xt=function(t){function e(e,n){t.call(this,e),this.context=e,this.parent=n}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(V),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(xt),St=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(xt),Et=function(t,e,n,r){this.context=t,this.width=e,this.height=n;var i=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new wt(t,i),r&&(this.depthAttachment=new St(t,i))};Et.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n)}t.deleteFramebuffer(this.framebuffer)};var Mt=function(t,e,n){this.func=t,this.mask=e,this.range=n};Mt.ReadOnly=!1,Mt.ReadWrite=!0,Mt.disabled=new Mt(519,Mt.ReadOnly,[0,1]);var Tt=function(t,e,n,r,i,o){this.test=t,this.ref=e,this.mask=n,this.fail=r,this.depthFail=i,this.pass=o};Tt.disabled=new Tt({func:519,mask:0},0,0,7680,7680,7680);var At=function(t,e,n){this.blendFunction=t,this.blendColor=e,this.mask=n};At.disabled=new At(At.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),At.unblended=new At(At.Replace,t.Color.transparent,[!0,!0,!0,!0]),At.alphaBlended=new At([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Ct=function(t,e,n){this.enable=t,this.mode=e,this.frontFace=n};Ct.disabled=new Ct(!1,1029,2305),Ct.backCCW=new Ct(!0,1029,2305);var Ot=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new G(this),this.clearDepth=new H(this),this.clearStencil=new W(this),this.colorMask=new q(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 nt(this),this.blendFunc=new rt(this),this.blendColor=new it(this),this.blendEquation=new ot(this),this.cullFace=new at(this),this.cullFaceSide=new st(this),this.frontFace=new ut(this),this.program=new lt(this),this.activeTexture=new ct(this),this.viewport=new ht(this),this.bindFramebuffer=new pt(this),this.bindRenderbuffer=new ft(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 _t(this),this.pixelStoreUnpackFlipY=new bt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Ot.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()},Ot.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},Ot.prototype.createIndexBuffer=function(t,e){return new j(this,t,e)},Ot.prototype.createVertexBuffer=function(t,e,n){return new Z(this,t,e,n)},Ot.prototype.createRenderbuffer=function(t,e,n){var r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,t,e,n),this.bindRenderbuffer.set(null),i},Ot.prototype.createFramebuffer=function(t,e,n){return new Et(this,t,e,n)},Ot.prototype.clear=function(t){var e=t.color,n=t.depth,r=this.gl,i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),r.clear(i)},Ot.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))},Ot.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)},Ot.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)},Ot.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,At.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Ot.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Pt=function(e){function n(n,r,i){var o=this;e.call(this),this.id=n,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,n,r,i){var o=new D[n.type](e,n,r,i);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(n,r,i,this),this._tiles={},this._cache=new B(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},n.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},n.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!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},n.prototype.getSource=function(){return this._source},n.prototype.pause=function(){this._paused=!0},n.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)}},n.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},n.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},n.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},n.prototype.serialize=function(){return this._source.serialize()},n.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 n=this._tiles[e];n.upload(t),n.prepare(this.map.style.imageManager)}},n.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(kt).map((function(t){return t.key}))},n.prototype.getRenderableIds=function(e){var n=this,r=[];for(var i in this._tiles)this._isIdRenderable(i,e)&&r.push(this._tiles[i]);return e?r.sort((function(e,r){var i=e.tileID,o=r.tileID,a=new t.Point(i.canonical.x,i.canonical.y)._rotate(n.transform.angle),s=new t.Point(o.canonical.x,o.canonical.y)._rotate(n.transform.angle);return i.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):r.map((function(t){return t.tileID})).sort(kt).map((function(t){return t.key}))},n.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},n.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},n.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")},n.prototype._reloadTile=function(t,e){var n=this._tiles[t];n&&("loading"!==n.state&&(n.state=e),this._loadTile(n,this._tileLoaded.bind(this,n,t,e)))},n.prototype._tileLoaded=function(e,n,r,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"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,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}))},n.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),n=0;n<e.length;n++){var r=e[n];if(t.neighboringTiles&&t.neighboringTiles[r]){var i=this.getTileByID(r);o(t,i),o(i,t)}}function o(t,e){t.needsHillshadePrepare=!0;var n=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===n&&0===r||Math.abs(r)>1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,n,r),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},n.prototype.getTile=function(t){return this.getTileByID(t.key)},n.prototype.getTileByID=function(t){return this._tiles[t]},n.prototype._retainLoadedChildren=function(t,e,n,r){for(var i in this._tiles){var o=this._tiles[i];if(!(r[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>n)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){r[a.key]=a;break}}}},n.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var n=this._loadedParentTiles[t.key];return n&&n.tileID.overscaledZ>=e?n:null}for(var r=t.overscaledZ-1;r>=e;r--){var i=t.scaledTo(r),o=this._getLoadedTile(i);if(o)return o}},n.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},n.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,r=Math.floor(e*n*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i)},n.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var n={};for(var r in this._tiles){var i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},n.prototype.update=function(e){var r=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 r._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-n.maxOverzooming,this._source.minzoom),s=Math.max(o+n.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(Lt(this._source.type)){for(var l={},c={},h=0,p=Object.keys(u);h<p.length;h+=1){var f=p[h],d=u[f],m=this._tiles[f];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(d,a);g&&(this._addTile(g.tileID),l[g.tileID.key]=g.tileID),c[f]=d}}for(var y in this._retainLoadedChildren(c,o,s,u),l)u[y]||(this._coveredTiles[y]=!0,u[y]=l[y])}for(var v in u)this._tiles[v].clearFadeHold();for(var _=0,b=t.keysDifference(this._tiles,u);_<b.length;_+=1){var x=b[_],w=this._tiles[x];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(x)}this._updateLoadedParentTileCache()}},n.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},n.prototype._updateRetainedTiles=function(t,e){for(var r={},i={},o=Math.max(e-n.maxOverzooming,this._source.minzoom),a=Math.max(e+n.maxUnderzooming,this._source.minzoom),s={},u=0,l=t;u<l.length;u+=1){var c=l[u],h=this._addTile(c);r[c.key]=c,h.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,a,r);for(var p=0,f=t;p<f.length;p+=1){var d=f[p],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()){r[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(r[v[0].key]&&r[v[1].key]&&r[v[2].key]&&r[v[3].key])continue}for(var _=m.wasRequested(),b=d.overscaledZ-1;b>=o;--b){var x=d.scaledTo(b);if(i[x.key])break;if(i[x.key]=!0,!(m=this.getTile(x))&&_&&(m=this._addTile(x)),m&&(r[x.key]=x,_=m.wasRequested(),m.hasData()))break}}}return r},n.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],n=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}e.push(r.key);var i=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(i))break;r=i}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[o]]=n}},n.prototype._addTile=function(e){var n=this._tiles[e.key];if(n)return n;(n=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));var r=Boolean(n);return r||(n=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,e.key,n.state))),n?(n.uses++,this._tiles[e.key]=n,r||this._source.fire(new t.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n):null},n.prototype._setTileReloadTimer=function(t,e){var n=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){n._reloadTile(t,"expired"),delete n._timers[t]}),r))},n.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))))},n.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},n.prototype.tilesIn=function(e,n,r){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=r?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),l=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,m=0,g=l;m<g.length;m+=1){var y=g[m];h=Math.min(h,y.x),p=Math.min(p,y.y),f=Math.max(f,y.x),d=Math.max(d,y.y)}for(var v=function(e){var r=i._tiles[c[e]];if(!r.holdingForFade()){var s=r.tileID,m=Math.pow(2,a.zoom-r.tileID.overscaledZ),g=n*r.queryPadding*t.EXTENT/r.tileSize/m,y=[s.getTilePoint(new t.MercatorCoordinate(h,p)),s.getTilePoint(new t.MercatorCoordinate(f,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=u.map((function(t){return s.getTilePoint(t)})),_=l.map((function(t){return s.getTilePoint(t)}));o.push({tile:r,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_<c.length;_++)v(_);return o},n.prototype.getVisibleCoordinates=function(t){for(var e=this,n=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),r=0,i=n;r<i.length;r+=1){var o=i[r];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return n},n.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Lt(this._source.type))for(var e in this._tiles){var n=this._tiles[e];if(void 0!==n.fadeEndTime&&n.fadeEndTime>=t.browser.now())return!0}return!1},n.prototype.setFeatureState=function(t,e,n){this._state.updateState(t=t||"_geojsonTileLayer",e,n)},n.prototype.removeFeatureState=function(t,e,n){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,n)},n.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},n.prototype.setDependencies=function(t,e,n){var r=this._tiles[t];r&&r.setDependencies(e,n)},n.prototype.reloadTilesForDependencies=function(t,e){for(var n in this._tiles)this._tiles[n].hasDependency(t,e)&&this._reloadTile(n,"reloading");this._cache.filter((function(n){return!n.hasDependency(t,e)}))},n}(t.Evented);function kt(t,e){var n=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-n||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Lt(t){return"raster"===t||"image"===t||"video"===t}function It(){return new t.window.Worker(Xi.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Dt.workerCount;)this.workers.push(new It);return this.active[t]=!0,this.workers.slice()},Dt.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Dt.prototype.isPreloaded=function(){return!!this.active[Rt]},Dt.prototype.numActive=function(){return Object.keys(this.active).length};var Nt,Ft=Math.floor(t.browser.hardwareConcurrency/2);function zt(){return Nt||(Nt=new Dt),Nt}function Bt(e,n){var r={};for(var i in e)"ref"!==i&&(r[i]=e[i]);return t.refProperties.forEach((function(t){t in n&&(r[t]=n[t])})),r}function jt(t){t=t.slice();for(var e=Object.create(null),n=0;n<t.length;n++)e[t[n].id]=t[n];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=Bt(t[r],e[t[r].ref]));return t}Dt.workerCount=Math.max(Math.min(Ft,6),1);var Ut={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 Zt(t,e,n){n.push({command:Ut.addSource,args:[t,e[t]]})}function Vt(t,e,n){e.push({command:Ut.removeSource,args:[t]}),n[t]=!0}function Gt(t,e,n,r){Vt(t,n,r),Zt(t,e,n)}function Ht(e,n,r){var i;for(i in e[r])if(e[r].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[r][i],n[r][i]))return!1;for(i in n[r])if(n[r].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[r][i],n[r][i]))return!1;return!0}function Wt(e,n,r,i,o,a){var s;for(s in n=n||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}));for(s in n)n.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}))}function qt(t){return t.id}function Yt(t,e){return t[e.id]=e,t}var Xt=function(t,e){this.reset(t,e)};Xt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-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},Xt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var n=1,r=this._distances[n],i=e*this.paddedLength+this.padding;r<i&&n<this._distances.length;)r=this._distances[++n];var o=n-1,a=this._distances[o],s=r-a,u=s>0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[n].mult(u))};var $t=function(t,e,n){var r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(e/n);for(var o=0;o<this.xCellCount*this.yCellCount;o++)r.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 Kt(e,n,r,i,o){var a=t.create();return n?(t.scale(a,a,[1/o,1/o,1]),r||t.rotateZ(a,a,i.angle)):t.multiply(a,i.labelPlaneMatrix,e),a}function Jt(e,n,r,i,o){if(n){var a=t.clone(e);return t.scale(a,a,[o,o,1]),r||t.rotateZ(a,a,-i.angle),a}return i.glCoordMatrix}function Qt(e,n){var r=[e.x,e.y,0,1];ce(r,r,n);var i=r[3];return{point:new t.Point(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function te(t,e){return.5+t/e*.5}function ee(t,e){var n=t[0]/t[3],r=t[1]/t[3];return n>=-e[0]&&n<=e[0]&&r>=-e[1]&&r<=e[1]}function ne(e,n,r,i,o,a,s,u){var l=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,r.transform.zoom),h=[256/r.width*2+1,256/r.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=r.transform.width/r.transform.height,g=!1,y=0;y<d.length;y++){var v=d.get(y);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!g)le(v.numGlyphs,p);else{g=!1;var _=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(_,_,n),ee(_,h)){var b=te(r.transform.cameraToCenterDistance,_[3]),x=t.evaluateSizeForFeature(l,c,v),w=s?x/b:x*b,S=new t.Point(v.anchorX,v.anchorY),E=Qt(S,o).point,M={},T=oe(v,w,!1,u,n,o,a,e.glyphOffsetArray,f,p,E,S,M,m);g=T.useVertical,(T.notEnoughRoom||g||T.needsFlipping&&oe(v,w,!0,u,n,o,a,e.glyphOffsetArray,f,p,E,S,M,m).notEnoughRoom)&&le(v.numGlyphs,p)}else le(v.numGlyphs,p)}}i?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p)}function re(t,e,n,r,i,o,a,s,u,l,c){var h=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(h-1),g=se(t*d,n,r,i,o,a,s.segment,p,f,u,l,c);if(!g)return null;var y=se(t*m,n,r,i,o,a,s.segment,p,f,u,l,c);return y?{first:g,last:y}:null}function ie(e,n,r,i){return e===t.WritingMode.horizontal&&Math.abs(r.y-n.y)>Math.abs(r.x-n.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?n.y<r.y:n.x>r.x)?{needsFlipping:!0}:null}function oe(e,n,r,i,o,a,s,u,l,c,h,p,f,d){var m,g=n/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,x=e.lineStartIndex+e.lineLength,w=re(g,u,y,v,r,h,p,e,l,a,f);if(!w)return{notEnoughRoom:!0};var S=Qt(w.first.point,s).point,E=Qt(w.last.point,s).point;if(i&&!r){var M=ie(e.writingMode,S,E,d);if(M)return M}m=[w.first];for(var T=e.glyphStartIndex+1;T<_-1;T++)m.push(se(g*u.getoffsetX(T),y,v,r,h,p,e.segment,b,x,l,a,f));m.push(w.last)}else{if(i&&!r){var A=Qt(p,o).point,C=e.lineStartIndex+e.segment+1,O=new t.Point(l.getx(C),l.gety(C)),P=Qt(O,o),k=P.signedDistanceFromCamera>0?P.point:ae(p,O,A,1,o),L=ie(e.writingMode,A,k,d);if(L)return L}var I=se(g*u.getoffsetX(e.glyphStartIndex),y,v,r,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f);if(!I)return{notEnoughRoom:!0};m=[I]}for(var R=0,D=m;R<D.length;R+=1){var N=D[R];t.addDynamicAttributes(c,N.point,N.angle)}return{}}function ae(t,e,n,r,i){var o=Qt(t.add(t.sub(e)._unit()),i).point,a=n.sub(o);return n.add(a._mult(r/a.mag()))}function se(e,n,r,i,o,a,s,u,l,c,h,p){var f=i?e-n:e+n,d=f>0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?u+s:u+s+1,y=o,v=o,_=0,b=0,x=Math.abs(f),w=[];_+b<=x;){if((g+=d)<u||g>=l)return null;if(v=y,w.push(y),void 0===(y=p[g])){var S=new t.Point(c.getx(g),c.gety(g)),E=Qt(S,h);if(E.signedDistanceFromCamera>0)y=p[g]=E.point;else{var M=g-d;y=ae(0===_?a:new t.Point(c.getx(M),c.gety(M)),S,v,x-_+1,h)}}_+=b,b=v.dist(y)}var T=(x-_)/b,A=y.sub(v),C=A.mult(T)._add(v);C._add(A._unit()._perp()._mult(r*d));var O=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(C),{point:C,angle:O,path:w}}$t.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},$t.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},$t.prototype.insertCircle=function(t,e,n,r){this._forEachCell(e-r,n-r,e+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(n),this.circles.push(r)},$t.prototype._insertBoxCell=function(t,e,n,r,i,o){this.boxCells[i].push(o)},$t.prototype._insertCircleCell=function(t,e,n,r,i,o){this.circleCells[i].push(o)},$t.prototype._query=function(t,e,n,r,i,o){if(n<0||t>this.width||r<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)a.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 u=0;u<this.circleKeys.length;u++){var l=this.circles[3*u],c=this.circles[3*u+1],h=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:l-h,y1:c-h,x2:l+h,y2:c+h})}return o?a.filter(o):a}return this._forEachCell(t,e,n,r,this._queryCell,a,{hitTest:i,seenUids:{box:{},circle:{}}},o),i?a.length>0:a},$t.prototype._queryCircle=function(t,e,n,r,i){var o=t-n,a=t+n,s=e-n,u=e+n;if(a<0||o>this.width||u<0||s>this.height)return!r&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:r,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}},i),r?l.length>0:l},$t.prototype.query=function(t,e,n,r,i){return this._query(t,e,n,r,!1,i)},$t.prototype.hitTest=function(t,e,n,r,i){return this._query(t,e,n,r,!0,i)},$t.prototype.hitTestCircle=function(t,e,n,r){return this._queryCircle(t,e,n,!0,r)},$t.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,h=0,p=l;h<p.length;h+=1){var f=p[h];if(!u.box[f]){u.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&n>=c[d+0]&&r>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var _=v[y];if(!u.circle[_]){u.circle[_]=!0;var b=3*_;if(this._circleAndRectCollide(g[b],g[b+1],g[b+2],t,e,n,r)&&(!s||s(this.circleKeys[_]))){if(a.hitTest)return o.push(!0),!0;var x=g[b],w=g[b+1],S=g[b+2];o.push({key:this.circleKeys[_],x1:x-S,y1:w-S,x2:x+S,y2:w+S})}}}},$t.prototype._queryCellCircle=function(t,e,n,r,i,o,a,s){var u=a.circle,l=a.seenUids,c=this.boxCells[i];if(null!==c)for(var h=this.bboxes,p=0,f=c;p<f.length;p+=1){var d=f[p];if(!l.box[d]){l.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(u.x,u.y,u.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,v=0,_=g;v<_.length;v+=1){var b=_[v];if(!l.circle[b]){l.circle[b]=!0;var x=3*b;if(this._circlesCollide(y[x],y[x+1],y[x+2],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[b])))return o.push(!0),!0}}},$t.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),c=this._convertToXCellCoord(n),h=this._convertToYCellCoord(r),p=u;p<=c;p++)for(var f=l;f<=h;f++)if(i.call(this,t,e,n,r,this.xCellCount*f+p,o,a,s))return},$t.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},$t.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},$t.prototype._circlesCollide=function(t,e,n,r,i,o){var a=r-t,s=i-e,u=n+o;return u*u>a*a+s*s},$t.prototype._circleAndRectCollide=function(t,e,n,r,i,o,a){var s=(o-r)/2,u=Math.abs(t-(r+s));if(u>s+n)return!1;var l=(a-i)/2,c=Math.abs(e-(i+l));if(c>l+n)return!1;if(u<=s||c<=l)return!0;var h=u-s,p=c-l;return h*h+p*p<=n*n};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(var n=0;n<t;n++){var r=e.length;e.resize(r+4),e.float32.set(ue,3*r)}}function ce(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t[3]=n[3]*r+n[7]*i+n[15],t}var he=function(t,e,n){void 0===e&&(e=new $t(t.width+200,t.height+200,25)),void 0===n&&(n=new $t(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function pe(e,n,r){return n*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}he.prototype.placeCollisionBox=function(t,e,n,r,i){var o=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),a=n*o.perspectiveRatio,s=t.x1*a+o.point.x,u=t.y1*a+o.point.y,l=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,u,l,c)||!e&&this.grid.hitTest(s,u,l,c,i)?{box:[],offscreen:!1}:{box:[s,u,l,c],offscreen:this.isOffscreen(s,u,l,c)}},he.prototype.placeCollisionCircles=function(e,n,r,i,o,a,s,u,l,c,h,p,f){var d=[],m=new t.Point(n.anchorX,n.anchorY),g=Qt(m,a),y=te(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(c?o/y:o*y)/t.ONE_EM,_=Qt(m,s).point,b=re(v,i,n.lineOffsetX*v,n.lineOffsetY*v,!1,_,m,n,r,s,{}),x=!1,w=!1,S=!0;if(b){for(var E=.5*p*y+f,M=new t.Point(-100,-100),T=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),A=new Xt,C=b.first,O=b.last,P=[],k=C.path.length-1;k>=1;k--)P.push(C.path[k]);for(var L=1;L<O.path.length;L++)P.push(O.path[L]);var I=2.5*E;if(u){var R=P.map((function(t){return Qt(t,u)}));P=R.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:R.map((function(t){return t.point}))}var D=[];if(P.length>0){for(var N=P[0].clone(),F=P[0].clone(),z=1;z<P.length;z++)N.x=Math.min(N.x,P[z].x),N.y=Math.min(N.y,P[z].y),F.x=Math.max(F.x,P[z].x),F.y=Math.max(F.y,P[z].y);D=N.x>=M.x&&F.x<=T.x&&N.y>=M.y&&F.y<=T.y?[P]:F.x<M.x||N.x>T.x||F.y<M.y||N.y>T.y?[]:t.clipLine([P],M.x,M.y,T.x,T.y)}for(var B=0,j=D;B<j.length;B+=1){var U;A.reset(j[B],.25*E),U=A.length<=.5*E?1:Math.ceil(A.paddedLength/I)+1;for(var Z=0;Z<U;Z++){var V=Z/Math.max(U-1,1),G=A.lerp(V),H=G.x+100,W=G.y+100;d.push(H,W,E,0);var q=H-E,Y=W-E,X=H+E,$=W+E;if(S=S&&this.isOffscreen(q,Y,X,$),w=w||this.isInsideGrid(q,Y,X,$),!e&&this.grid.hitTestCircle(H,W,E,h)&&(x=!0,!l))return{circles:[],offscreen:!1,collisionDetected:x}}}}return{circles:!l&&x||!w?[]:d,offscreen:S,collisionDetected:x}},he.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var n=[],r=1/0,i=1/0,o=-1/0,a=-1/0,s=0,u=e;s<u.length;s+=1){var l=u[s],c=new t.Point(l.x+100,l.y+100);r=Math.min(r,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y),n.push(c)}for(var h={},p={},f=0,d=this.grid.query(r,i,o,a).concat(this.ignoredGrid.query(r,i,o,a));f<d.length;f+=1){var m=d[f],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(n,y)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===p[g.bucketInstanceId]&&(p[g.bucketInstanceId]=[]),p[g.bucketInstanceId].push(g.featureIndex))}}return p},he.prototype.insertCollisionBox=function(t,e,n,r,i){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:r,collisionGroupID:i},t[0],t[1],t[2],t[3])},he.prototype.insertCollisionCircles=function(t,e,n,r,i){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:n,featureIndex:r,collisionGroupID:i},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},he.prototype.projectAndGetPerspectiveRatio=function(e,n,r){var i=[n,r,0,1];return ce(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},he.prototype.isOffscreen=function(t,e,n,r){return n<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,n,r){return n>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary},he.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var fe=function(t,e,n,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&n?1:0,this.placed=n};fe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var de=function(t,e,n,r,i){this.text=new fe(t?t.text:null,e,n,i),this.icon=new fe(t?t.icon:null,e,r,i)};de.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var me=function(t,e,n){this.text=t,this.icon=e,this.skipFade=n},ge=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ye=function(t,e,n,r,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i},ve=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function _e(e,n,r,i,o){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*n,u=-(a.verticalAlign-.5)*r,l=t.evaluateVariableOffset(e,i);return new t.Point(s+l[0]*o,u+l[1]*o)}function be(e,n,r,i,o,a){var s=e.x1,u=e.x2,l=e.y1,c=e.y2,h=e.anchorPointX,p=e.anchorPointY,f=new t.Point(n,r);return i&&f._rotate(o?a:-a),{x1:s+f.x,y1:l+f.y,x2:u+f.x,y2:c+f.y,anchorPointX:h,anchorPointY:p}}ve.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 xe=function(t,e,n,r){this.transform=t.clone(),this.collisionIndex=new he(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ve(n),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}};function we(t,e,n,r,i){t.emplaceBack(e?1:0,n?1:0,r||0,i||0),t.emplaceBack(e?1:0,n?1:0,r||0,i||0),t.emplaceBack(e?1:0,n?1:0,r||0,i||0),t.emplaceBack(e?1:0,n?1:0,r||0,i||0)}xe.prototype.getBucketParts=function(e,n,r,i){var o=r.getBucket(n),a=r.latestFeatureIndex;if(o&&a&&n.id===o.layerIds[0]){var s=r.collisionBoxArray,u=o.layers[0].layout,l=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),p="map"===u.get("text-pitch-alignment"),f="map"===u.get("text-rotation-alignment"),d=pe(r,1,this.transform.zoom),m=Kt(h,p,f,this.transform,d),g=null;if(p){var y=Jt(h,p,f,this.transform,d);g=t.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[o.bucketInstanceId]=new ye(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID);var v={bucket:o,layout:u,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:l,textPixelRatio:c,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(i)for(var _=0,b=o.sortKeyRanges;_<b.length;_+=1){var x=b[_];e.push({sortKey:x.sortKey,symbolInstanceStart:x.symbolInstanceStart,symbolInstanceEnd:x.symbolInstanceEnd,parameters:v})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:v})}},xe.prototype.attemptAnchorPlacement=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d){var m,g=[h.textOffset0,h.textOffset1],y=_e(t,n,r,g,i),v=this.collisionIndex.placeCollisionBox(be(e,y.x,y.y,o,a,this.transform.angle),c,s,u,l.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(be(d,y.x,y.y,o,a,this.transform.angle),c,s,u,l.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:n,height:r,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:y,placedGlyphBoxes:v}):void 0},xe.prototype.placeLayerBucketPart=function(e,n,r){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,l=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,f=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,m=o.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),x="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),S="viewport-y"===s.get("symbol-z-order"),E=v&&(_||!a.hasIconData()||y),M=_&&(v||!a.hasTextData()||g);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f);var T=function(e,o){if(!n[e.crossTileID])if(p)i.placements[e.crossTileID]=new me(!1,!1,!1);else{var f,S=!1,T=!1,A=!0,C=null,O={box:null,offscreen:null},P={box:null,offscreen:null},k=null,L=null,I=0,R=0,D=0;o.textFeatureIndex?I=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(I=e.featureIndex),o.verticalTextFeatureIndex&&(R=o.verticalTextFeatureIndex);var N=o.textBox;if(N){var F=function(n){var r=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!n&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,r=o,e))}return r},z=function(n,r){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i<s.length&&(s[i]===t.WritingMode.vertical?(O=r(),P=O):O=n(),!(O&&O.box&&O.box.length));i+=1);else O=n()};if(s.get("text-variable-anchor")){var B=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[e.crossTileID]){var j=i.prevPlacement.variableOffsets[e.crossTileID];B.indexOf(j.anchor)>0&&(B=B.filter((function(t){return t!==j.anchor}))).unshift(j.anchor)}var U=function(t,n,r){for(var o=t.x2-t.x1,s=t.y2-t.y1,l=e.textBoxScale,c=w&&!_?n:null,p={box:[],offscreen:!1},f=v?2*B.length:B.length,d=0;d<f;++d){var g=i.attemptAnchorPlacement(B[d%B.length],t,o,s,l,b,x,h,u,m,d>=B.length,e,a,r,c);if(g&&(p=g.placedGlyphBoxes)&&p.box&&p.box.length){S=!0,C=g.shift;break}}return p};z((function(){return U(N,o.iconBox,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return a.allowVerticalPlacement&&!(O&&O.box&&O.box.length)&&e.numVerticalGlyphVertices>0&&n?U(n,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),O&&(S=O.box,A=O.offscreen);var Z=F(O&&O.box);if(!S&&i.prevPlacement){var V=i.prevPlacement.variableOffsets[e.crossTileID];V&&(i.variableOffsets[e.crossTileID]=V,i.markUsedJustification(a,V.anchor,e,Z))}}else{var G=function(t,n){var r=i.collisionIndex.placeCollisionBox(t,v,h,u,m.predicate);return r&&r.box&&r.box.length&&(i.markUsedOrientation(a,n,e),i.placedOrientations[e.crossTileID]=n),r};z((function(){return G(N,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n?G(n,t.WritingMode.vertical):{box:null,offscreen:null}})),F(O&&O.box&&O.box.length)}}if(S=(f=O)&&f.box&&f.box.length>0,A=f&&f.offscreen,e.useRuntimeCollisionCircles){var H=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(a.textSizeData,d,H),q=s.get("text-padding");k=i.collisionIndex.placeCollisionCircles(v,H,a.lineVertexArray,a.glyphOffsetArray,W,u,l,c,r,x,m.predicate,e.collisionCircleDiameter,q),S=v||k.circles.length>0&&!k.collisionDetected,A=A&&k.offscreen}if(o.iconFeatureIndex&&(D=o.iconFeatureIndex),o.iconBox){var Y=function(t){var e=w&&C?be(t,C.x,C.y,b,x,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,_,h,u,m.predicate)};T=P&&P.box&&P.box.length&&o.verticalIconBox?(L=Y(o.verticalIconBox)).box.length>0:(L=Y(o.iconBox)).box.length>0,A=A&&L.offscreen}var X=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,$=y||0===e.numIconVertices;if(X||$?$?X||(T=T&&S):S=T&&S:T=S=T&&S,S&&f&&f.box&&i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),a.bucketInstanceId,P&&P.box&&R?R:I,m.ID),T&&L&&i.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,m.ID),k&&(S&&i.collisionIndex.insertCollisionCircles(k.circles,s.get("text-ignore-placement"),a.bucketInstanceId,I,m.ID),r)){var K=a.bucketInstanceId,J=i.collisionCircleArrays[K];void 0===J&&(J=i.collisionCircleArrays[K]=new ge);for(var Q=0;Q<k.circles.length;Q+=4)J.circles.push(k.circles[Q+0]),J.circles.push(k.circles[Q+1]),J.circles.push(k.circles[Q+2]),J.circles.push(k.collisionDetected?1:0)}i.placements[e.crossTileID]=new me(S||E,T||M,A||a.justReloaded),n[e.crossTileID]=!0}};if(S)for(var A=a.getSortedSymbolIndexes(this.transform.angle),C=A.length-1;C>=0;--C){var O=A[C];T(a.symbolInstances.get(O),a.collisionArrays[O])}else for(var P=e.symbolInstanceStart;P<e.symbolInstanceEnd;P++)T(a.symbolInstances.get(P),a.collisionArrays[P]);if(r&&a.bucketInstanceId in this.collisionCircleArrays){var k=this.collisionCircleArrays[a.bucketInstanceId];t.invert(k.invProjMatrix,u),k.viewportMatrix=this.collisionIndex.getViewportMatrix()}a.justReloaded=!1},xe.prototype.markUsedJustification=function(e,n,r,i){var o;o=i===t.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(n)];for(var a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var u=s[a];u>=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:r.crossTileID)}},xe.prototype.markUsedOrientation=function(e,n,r){for(var i=n===t.WritingMode.horizontal||n===t.WritingMode.horizontalOnly?n:0,o=n===t.WritingMode.vertical?n:0,a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=i;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=o)},xe.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,n=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var r=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var u=this.placements[s],l=i[s];l?(this.opacities[s]=new de(l,r,u.text,u.icon),n=n||u.text!==l.text.placed||u.icon!==l.icon.placed):(this.opacities[s]=new de(null,r,u.text,u.icon,u.skipFade),n=n||u.text||u.icon)}for(var c in i){var h=i[c];if(!this.opacities[c]){var p=new de(h,r,!1,!1);p.isHidden()||(this.opacities[c]=p,n=n||h.text.placed||h.icon.placed)}}for(var f in o)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=o[f]);for(var d in a)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=a[d]);n?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},xe.prototype.updateLayerOpacities=function(t,e){for(var n={},r=0,i=e;r<i.length;r+=1){var o=i[r],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,n,o.collisionBoxArray)}},xe.prototype.updateBucketOpacities=function(e,n,r){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 o=e.layers[0].layout,a=new de(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),l=o.get("text-variable-anchor"),c="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),f=new de(null,0,s&&(u||!e.hasIconData()||o.get("icon-optional")),u&&(s||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(r);for(var d=function(t,e,n){for(var r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(n)},m=function(r){var o=e.symbolInstances.get(r),s=o.numHorizontalGlyphVertices,u=o.numVerticalGlyphVertices,m=o.crossTileID,g=i.opacities[m];n[m]?g=a:g||(i.opacities[m]=g=f),n[m]=!0;var y=o.numIconVertices>0,v=i.placedOrientations[o.crossTileID],_=v===t.WritingMode.vertical,b=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||u>0){var x=Pe(g.text);d(e.text,s,_?ke:x),d(e.text,u,b?ke:x);var w=g.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||_?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||b?1:0);var S=i.variableOffsets[o.crossTileID];S&&i.markUsedJustification(e,S.anchor,o,v);var E=i.placedOrientations[o.crossTileID];E&&(i.markUsedJustification(e,"left",o,E),i.markUsedOrientation(e,E,o))}if(y){var M=Pe(g.icon),T=!(p&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,T?M:ke),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=g.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,T?ke:M),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var A=e.collisionArrays[r];if(A){var C=new t.Point(0,0);if(A.textBox||A.verticalTextBox){var O=!0;if(l){var P=i.variableOffsets[m];P?(C=_e(P.anchor,P.width,P.height,P.textOffset,P.textBoxScale),c&&C._rotate(h?i.transform.angle:-i.transform.angle)):O=!1}A.textBox&&we(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||_,C.x,C.y),A.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,g.text.placed,!O||b,C.x,C.y)}var k=Boolean(!b&&A.verticalIconBox);A.iconBox&&we(e.iconCollisionBox.collisionVertexArray,g.icon.placed,k,p?C.x:0,p?C.y:0),A.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!k,p?C.x:0,p?C.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]}},xe.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},xe.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},xe.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},xe.prototype.stillRecent=function(t,e){var n=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*n>t},xe.prototype.setStale=function(){this.stale=!0};var Se=Math.pow(2,25),Ee=Math.pow(2,24),Me=Math.pow(2,17),Te=Math.pow(2,16),Ae=Math.pow(2,9),Ce=Math.pow(2,8),Oe=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,n=Math.floor(127*t.opacity);return n*Se+e*Ee+n*Me+e*Te+n*Ae+e*Ce+n*Oe+e}var ke=0,Le=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=[]};Le.prototype.continuePlacement=function(t,e,n,r,i){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,i())return!0;return!1};var Ie=function(t,e,n,r,i,o,a){this.placement=new xe(t,i,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=r,this._done=!1};Ie.prototype.isDone=function(){return this._done},Ie.prototype.continuePlacement=function(e,n,r){for(var i=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=n[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new Le(s)),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ie.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Re=512/t.EXTENT/2,De=function(t,e,n){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;r<e.length;r++){var i=e.get(r),o=i.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};De.prototype.getScaledCoordinates=function(e,n){var r=Re/Math.pow(2,n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*t.EXTENT+e.anchorX)*r),y:Math.floor((n.canonical.y*t.EXTENT+e.anchorY)*r)}},De.prototype.findMatches=function(t,e,n){for(var r=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 o=t.get(i);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,l=a;u<l.length;u+=1){var c=l[u];if(Math.abs(c.coord.x-s.x)<=r&&Math.abs(c.coord.y-s.y)<=r&&!n[c.crossTileID]){n[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}};var Ne=function(){this.maxCrossTileID=0};Ne.prototype.generate=function(){return++this.maxCrossTileID};var Fe=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Fe.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var n in this.indexes){var r=this.indexes[n],i={};for(var o in r){var a=r[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),i[a.tileID.key]=a}this.indexes[n]=i}this.lng=t},Fe.prototype.addBucket=function(t,e,n){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 r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,i)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=n.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new De(t,e.symbolInstances,e.bucketInstanceId),!0},Fe.prototype.removeBucketCrossTileIDs=function(t,e){for(var n in e.indexedSymbolInstances)for(var r=0,i=e.indexedSymbolInstances[n];r<i.length;r+=1)delete this.usedCrossTileIDs[t][i[r].crossTileID]},Fe.prototype.removeStaleBuckets=function(t){var e=!1;for(var n in this.indexes){var r=this.indexes[n];for(var i in r)t[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],e=!0)}return e};var ze=function(){this.layerIndexes={},this.crossTileIDs=new Ne,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};ze.prototype.addLayer=function(t,e,n){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new Fe);var i=!1,o={};r.handleWrapJump(n);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(u.tileID,l,this.crossTileIDs)&&(i=!0),o[l.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(i=!0),i},ze.prototype.pruneUnusedLayers=function(t){var e={};for(var n in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[n]||delete this.layerIndexes[n]};var Be=function(e,n){return t.emitValidationErrors(e,n&&n.filter((function(t){return"source.canvas"!==t.identifier})))},je=t.pick(Ut,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ue=t.pick(Ut,["setCenter","setZoom","setBearing","setPitch"]),Ze=function(){var e={},n=t.styleSpec.$version;for(var r in t.styleSpec.$root){var i,o=t.styleSpec.$root[r];o.required&&null!=(i="version"===r?n:"array"===o.type?[]:{})&&(e[r]=i)}return e}(),Ve=function(e){function n(r,i){var o=this;void 0===i&&(i={}),e.call(this),this.map=r,this.dispatcher=new E(zt(),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new _(r._requestManager,i.localIdeographFontFamily),this.lineAtlas=new S(256,512),this.crossTileSymbolIndex=new ze,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 a=this;this._rtlTextPluginCallback=n.registerForPluginStateChange((function(e){a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,n){if(t.triggerPluginCompletionEvent(e),n&&n.every((function(t){return t})))for(var r in a.sourceCaches)a.sourceCaches[r].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var n=e.getSource();if(n&&n.vectorLayerIds)for(var r in o._layers){var i=o._layers[r];i.source===n.id&&o._validateLayer(i)}}}}))}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.loadURL=function(e,n){var r=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof n.validate?n.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,n.accessToken);var o=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,n){r._request=null,e?r.fire(new t.ErrorEvent(e)):n&&r._load(n,i)}))},n.prototype.loadJSON=function(e,n){var r=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){r._request=null,r._load(e,!1!==n.validate)}))},n.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ze,!1)},n.prototype._load=function(e,n){if(!n||!Be(this,t.validateStyle(e))){for(var r in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(r,e.sources[r],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=jt(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var o=0,a=i;o<a.length;o+=1){var s=a[o];(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"))}},n.prototype._loadSprite=function(e){var n=this;this._spriteRequest=function(e,n,r){var i,o,a,s=t.browser.devicePixelRatio>1?"@2x":"",u=t.getJSON(n.transformRequest(n.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,c())})),l=t.getImage(n.transformRequest(n.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,a||(a=t,o=e,c())}));function c(){if(a)r(a);else if(i&&o){var e=t.browser.getImageData(o),n={};for(var s in i){var u=i[s],l=u.width,c=u.height,h=u.x,p=u.y,f=u.sdf,d=u.pixelRatio,m=u.stretchX,g=u.stretchY,y=u.content,v=new t.RGBAImage({width:l,height:c});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:l,height:c}),n[s]={data:v,pixelRatio:d,sdf:f,stretchX:m,stretchY:g,content:y}}r(null,n)}}return{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}}}(e,this.map._requestManager,(function(e,r){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n._availableImages=n.imageManager.listImages(),n.dispatcher.broadcast("setImages",n._availableImages),n.fire(new t.Event("data",{dataType:"style"}))}))},n.prototype._validateLayer=function(e){var n=this.sourceCaches[e.source];if(n){var r=e.sourceLayer;if(r){var i=n.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},n.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},n.prototype._serializeLayers=function(t){for(var e=[],n=0,r=t;n<r.length;n+=1){var i=this._layers[r[n]];"custom"!==i.type&&e.push(i.serialize())}return e},n.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},n.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},n.prototype.update=function(e){if(this._loaded){var n=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var o in(r.length||i.length)&&this._updateWorkerLayers(r,i),this._updatedSources){var a=this._updatedSources[o];"reload"===a?this._reloadSource(o):"clear"===a&&this._clearSource(o)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var u={};for(var l in this.sourceCaches){var c=this.sourceCaches[l];u[l]=c.used,c.used=!1}for(var h=0,p=this._order;h<p.length;h+=1){var f=this._layers[p[h]];f.recalculate(e,this._availableImages),!f.isHidden(e.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}for(var d in u){var m=this.sourceCaches[d];u[d]!==m.used&&m.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:d}))}this.light.recalculate(e),this.z=e.zoom,n&&this.fire(new t.Event("data",{dataType:"style"}))}},n.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={}}},n.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},n.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},n.prototype.setState=function(e){var n=this;if(this._checkLoaded(),Be(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=jt(e.layers);var r=function(e,n){if(!e)return[{command:Ut.setStyle,args:[n]}];var r=[];try{if(!t.deepEqual(e.version,n.version))return[{command:Ut.setStyle,args:[n]}];t.deepEqual(e.center,n.center)||r.push({command:Ut.setCenter,args:[n.center]}),t.deepEqual(e.zoom,n.zoom)||r.push({command:Ut.setZoom,args:[n.zoom]}),t.deepEqual(e.bearing,n.bearing)||r.push({command:Ut.setBearing,args:[n.bearing]}),t.deepEqual(e.pitch,n.pitch)||r.push({command:Ut.setPitch,args:[n.pitch]}),t.deepEqual(e.sprite,n.sprite)||r.push({command:Ut.setSprite,args:[n.sprite]}),t.deepEqual(e.glyphs,n.glyphs)||r.push({command:Ut.setGlyphs,args:[n.glyphs]}),t.deepEqual(e.transition,n.transition)||r.push({command:Ut.setTransition,args:[n.transition]}),t.deepEqual(e.light,n.light)||r.push({command:Ut.setLight,args:[n.light]});var i={},o=[];!function(e,n,r,i){var o;for(o in n=n||{},e=e||{})e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||Vt(o,r,i));for(o in n)n.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],n[o])||("geojson"===e[o].type&&"geojson"===n[o].type&&Ht(e,n,o)?r.push({command:Ut.setGeoJSONSourceData,args:[o,n[o].data]}):Gt(o,n,r,i)):Zt(o,n,r))}(e.sources,n.sources,o,i);var a=[];e.layers&&e.layers.forEach((function(t){i[t.source]?r.push({command:Ut.removeLayer,args:[t.id]}):a.push(t)})),r=r.concat(o),function(e,n,r){n=n||[];var i,o,a,s,u,l,c,h=(e=e||[]).map(qt),p=n.map(qt),f=e.reduce(Yt,{}),d=n.reduce(Yt,{}),m=h.slice(),g=Object.create(null);for(i=0,o=0;i<h.length;i++)d.hasOwnProperty(a=h[i])?o++:(r.push({command:Ut.removeLayer,args:[a]}),m.splice(m.indexOf(a,o),1));for(i=0,o=0;i<p.length;i++)m[m.length-1-i]!==(a=p[p.length-1-i])&&(f.hasOwnProperty(a)?(r.push({command:Ut.removeLayer,args:[a]}),m.splice(m.lastIndexOf(a,m.length-o),1)):o++,r.push({command:Ut.addLayer,args:[d[a],l=m[m.length-i]]}),m.splice(m.length-i,0,a),g[a]=!0);for(i=0;i<p.length;i++)if(s=f[a=p[i]],u=d[a],!g[a]&&!t.deepEqual(s,u))if(t.deepEqual(s.source,u.source)&&t.deepEqual(s["source-layer"],u["source-layer"])&&t.deepEqual(s.type,u.type)){for(c in Wt(s.layout,u.layout,r,a,null,Ut.setLayoutProperty),Wt(s.paint,u.paint,r,a,null,Ut.setPaintProperty),t.deepEqual(s.filter,u.filter)||r.push({command:Ut.setFilter,args:[a,u.filter]}),t.deepEqual(s.minzoom,u.minzoom)&&t.deepEqual(s.maxzoom,u.maxzoom)||r.push({command:Ut.setLayerZoomRange,args:[a,u.minzoom,u.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Wt(s[c],u[c],r,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],u[c])||r.push({command:Ut.setLayerProperty,args:[a,c,u[c]]}));for(c in u)u.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Wt(s[c],u[c],r,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],u[c])||r.push({command:Ut.setLayerProperty,args:[a,c,u[c]]}))}else r.push({command:Ut.removeLayer,args:[a]}),l=m[m.lastIndexOf(a)+1],r.push({command:Ut.addLayer,args:[u,l]})}(a,n.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Ut.setStyle,args:[n]}]}return r}(this.serialize(),e).filter((function(t){return!(t.command in Ue)}));if(0===r.length)return!1;var i=r.filter((function(t){return!(t.command in je)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return r.forEach((function(t){"setTransition"!==t.command&&n[t.command].apply(n,t.args)})),this.stylesheet=e,!0},n.prototype.addImage=function(e,n){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,n),this._afterImageUpdated(e)},n.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},n.prototype.getImage=function(t){return this.imageManager.getImage(t)},n.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)},n.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"}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(e,n,r){var i=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(n).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,n,null,r))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Pt(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var n in this._layers)if(this._layers[n].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+n+'" is using it.')));var r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},n.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},n.prototype.addLayer=function(e,n,r){void 0===r&&(r={}),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 o;if("custom"===e.type){if(Be(this,t.validateCustomStyleLayer(e)))return;o=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},r))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},n.prototype.moveLayer=function(e,n){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==n){var r=this._order.indexOf(e);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;n&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" 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.")))},n.prototype.removeLayer=function(e){this._checkLoaded();var n=this._layers[e];if(n){n.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.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.")))},n.prototype.getLayer=function(t){return this._layers[t]},n.prototype.hasLayer=function(t){return t in this._layers},n.prototype.setLayerZoomRange=function(e,n,r){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),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.")))},n.prototype.setFilter=function(e,n,r){void 0===r&&(r={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,n))return null==n?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",n,null,r)||(i.filter=t.clone$1(n),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.")))},n.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},n.prototype.setLayoutProperty=function(e,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(n),r)||(o.setLayoutProperty(n,r,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getLayoutProperty=function(e,n){var r=this.getLayer(e);if(r)return r.getLayoutProperty(n);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},n.prototype.setPaintProperty=function(e,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(n),r)||(o.setPaintProperty(n,r,i)&&this._updateLayer(o),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.")))},n.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},n.prototype.setFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=e.sourceLayer,o=this.sourceCaches[r];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,n)):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.")))},n.prototype.removeFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=this.sourceCaches[r];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?n&&"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(a,e.id,n):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.")))},n.prototype.getFeatureState=function(e){this._checkLoaded();var n=e.source,r=e.sourceLayer,i=this.sourceCaches[n];if(void 0!==i){if("vector"!==i.getSource().type||r)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(r,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 '"+n+"' does not exist in the map's style.")))},n.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.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}))},n.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},n.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,n=function(t){return"fill-extrusion"===e._layers[t].type},r={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(n(a)){r[a]=o;for(var s=0,u=t;s<u.length;s+=1){var l=u[s][a];if(l)for(var c=0,h=l;c<h.length;c+=1)i.push(h[c])}}}i.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],f=this._order.length-1;f>=0;f--){var d=this._order[f];if(n(d))for(var m=i.length-1;m>=0;m--){var g=i[m].feature;if(r[g.layer.id]<f)break;p.push(g),i.pop()}else for(var y=0,v=t;y<v.length;y+=1){var _=v[y][d];if(_)for(var b=0,x=_;b<x.length;b+=1)p.push(x[b].feature)}}return p},n.prototype.queryRenderedFeatures=function(e,n,r){n&&n.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",n.filter,null,n);var i={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=n.layers;o<a.length;o+=1){var s=a[o],u=this._layers[s];if(!u)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[u.source]=!0}}var l=[];for(var c in n.availableImages=this._availableImages,this.sourceCaches)n.layers&&!i[c]||l.push(F(this.sourceCaches[c],this._layers,this._serializedLayers,e,n,r));return this.placement&&l.push(function(t,e,n,r,i,o,a){for(var s={},u=o.queryRenderedSymbols(r),l=[],c=0,h=Object.keys(u).map(Number);c<h.length;c+=1)l.push(a[h[c]]);l.sort(z);for(var p=function(){var n=d[f],r=n.featureIndex.lookupSymbolFeatures(u[n.bucketInstanceId],e,n.bucketIndex,n.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(var o in r){var a=s[o]=s[o]||[],l=r[o];l.sort((function(t,e){var r=n.featureSortOrder;if(r){var i=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(var c=0,h=l;c<h.length;c+=1)a.push(h[c])}},f=0,d=l;f<d.length;f+=1)p();var m=function(e){s[e].forEach((function(r){var i=r.feature,o=n[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=o}))};for(var g in s)m(g);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(l)},n.prototype.querySourceFeatures=function(e,n){n&&n.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);var r=this.sourceCaches[e];return r?function(t,e){for(var n=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),r=[],i={},o=0;o<n.length;o++){var a=n[o],s=a.tileID.canonical.key;i[s]||(i[s]=!0,a.querySourceFeatures(r,e))}return r}(r,n):[]},n.prototype.addSourceType=function(t,e,r){return n.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(n.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},n.prototype.getLight=function(){return this.light.getLight()},n.prototype.setLight=function(e,n){void 0===n&&(n={}),this._checkLoaded();var r=this.light.getLight(),i=!1;for(var o in e)if(!t.deepEqual(e[o],r[o])){i=!0;break}if(i){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(a)}},n.prototype._validate=function(e,n,r,i,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&Be(this,e.call(t.validateStyle,t.extend({key:n,style:this.serialize(),value:r,styleSpec:t.styleSpec},i)))},n.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 n in this.sourceCaches)this.sourceCaches[n].clearTiles(),this.sourceCaches[n].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},n.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},n.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},n.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},n.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},n.prototype._updatePlacement=function(e,n,r,i,o){void 0===o&&(o=!1);for(var a=!1,s=!1,u={},l=0,c=this._order;l<c.length;l+=1){var h=this._layers[c[l]];if("symbol"===h.type){if(!u[h.source]){var p=this.sourceCaches[h.source];u[h.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 f=this.crossTileSymbolIndex.addLayer(h,u[h.source],e.center.lng);a=a||f}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Ie(e,this._order,o,n,r,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var d=0,m=this._order;d<m.length;d+=1){var g=this._layers[m[d]];"symbol"===g.type&&this.placement.updateLayerOpacities(g,u[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},n.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},n.prototype.getImages=function(t,e,n){this.imageManager.getImages(e.icons,n),this._updateTilesForChangedImages();var r=this.sourceCaches[e.source];r&&r.setDependencies(e.tileID.key,e.type,e.icons)},n.prototype.getGlyphs=function(t,e,n){this.glyphManager.getGlyphs(e.stacks,n)},n.prototype.getResource=function(e,n,r){return t.makeRequest(n,r)},n}(t.Evented);Ve.getSourceType=function(t){return D[t]},Ve.setSourceType=function(t,e){D[t]=e},Ve.registerForPluginStateChange=t.registerForPluginStateChange;var Ge=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),He=vn("#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;}"),We=vn("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);}"),qe=vn("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);}"),Ye=vn("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);}"),Xe=vn("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);}"),$e=vn("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;}"),Ke=vn("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;}"),Je=vn("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;}"),Qe=vn("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);}"),tn=vn("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);}"),en=vn("#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);}"),nn=vn("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;}"),rn=vn("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;}"),on=vn("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);}"),an=vn("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;}"),sn=vn("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;}"),un=vn("#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;}"),ln=vn("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;}"),cn=vn("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);}"),hn=vn("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);}"),pn=vn("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;}"),fn=vn("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);}"),dn=vn("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;}"),mn=vn("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));}"),gn=vn("#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);}"),yn=vn("#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 vn(t,e){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(n,(function(t,e,n,r,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+n+" "+r+" "+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(n,(function(t,e,n,r,i){var o="float"===r?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+n+" "+o+" a_"+i+";\nvarying "+n+" "+r+" "+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+n+" "+o+" a_"+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+n+" "+r+" "+i+" = a_"+i+";\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+n+" "+r+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:r,staticUniforms:a}}var _n=Object.freeze({__proto__:null,prelude:He,background:We,backgroundPattern:qe,circle:Ye,clippingMask:Xe,heatmap:$e,heatmapTexture:Ke,collisionBox:Je,collisionCircle:Qe,debug:tn,fill:en,fillOutline:nn,fillOutlinePattern:rn,fillPattern:on,fillExtrusion:an,fillExtrusionPattern:sn,hillshadePrepare:un,hillshade:ln,line:cn,lineGradient:hn,linePattern:pn,lineSDF:fn,raster:dn,symbolIcon:mn,symbolSDF:gn,symbolTextAndIcon:yn}),bn=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xn(t){for(var e=[],n=0;n<t.length;n++)if(null!==t[n]){var r=t[n].split(" ");e.push(r.pop())}return e}bn.prototype.bind=function(t,e,n,r,i,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==r.length,l=0;!u&&l<r.length;l++)this.boundPaintVertexBuffers[l]!==r[l]&&(u=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===n&&!u&&this.boundIndexBuffer===i&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind()):this.freshBind(e,n,r,i,o,a,s)},bn.prototype.freshBind=function(t,e,n,r,i,o,a){var s,u=t.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=l.currentNumAttributes||0;for(var h=u;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var p=0,f=n;p<f.length;p+=1)f[p].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(var d=0,m=n;d<m.length;d+=1){var g=m[d];g.bind(),g.setVertexAttribPointers(c,t,i)}o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),l.currentNumAttributes=u},bn.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var wn=function(t,e,n,r,i,o){var a=t.gl;this.program=a.createProgram();for(var s=xn(n.staticAttributes),u=r?r.getBinderAttributes():[],l=s.concat(u),c=n.staticUniforms?xn(n.staticUniforms):[],h=r?r.getBinderUniforms():[],p=[],f=0,d=c.concat(h);f<d.length;f+=1){var m=d[f];p.indexOf(m)<0&&p.push(m)}var g=r?r.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;");var y=g.concat(He.fragmentSource,n.fragmentSource).join("\n"),v=g.concat(He.vertexSource,n.vertexSource).join("\n"),_=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(_,y),a.compileShader(_),a.attachShader(this.program,_);var b=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(b,v),a.compileShader(b),a.attachShader(this.program,b),this.attributes={};var x={};this.numAttributes=l.length;for(var w=0;w<this.numAttributes;w++)l[w]&&(a.bindAttribLocation(this.program,w,l[w]),this.attributes[l[w]]=w);a.linkProgram(this.program),a.deleteShader(b),a.deleteShader(_);for(var S=0;S<p.length;S++){var E=p[S];if(E&&!x[E]){var M=a.getUniformLocation(this.program,E);M&&(x[E]=M)}}this.fixedUniforms=i(t,x),this.binderUniforms=r?r.getUniforms(t,x):[]}}};function Sn(t,e,n){var r=1/pe(n,1,e.transform.tileZoom),i=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,e.transform.tileZoom)/i,a=o*(n.tileID.canonical.x+n.tileID.wrap*i),s=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}wn.prototype.draw=function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(r),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var _=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],b=0,x=c.get();b<x.length;b+=1){var w=x[b],S=w.vaos||(w.vaos={});(S[s]||(S[s]=new bn)).bind(t,this,u,f?f.getPaintVertexBuffers():[],l,w.vertexOffset,d,m),y.drawElements(e,w.primitiveLength*_,y.UNSIGNED_SHORT,w.primitiveOffset*_*2)}}};var En=function(e,n,r,i){var o=n.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],u=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(u,-n.transform.angle),t.transformMat3(s,s,u);var l=o.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:i}},Mn=function(e,n,r,i,o,a,s){return t.extend(En(e,n,r,i),Sn(a,n,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8})},Tn=function(t){return{u_matrix:t}},An=function(e,n,r,i){return t.extend(Tn(e),Sn(r,n,i))},Cn=function(t,e){return{u_matrix:t,u_world:e}},On=function(e,n,r,i,o){return t.extend(An(e,n,r,i),{u_world:o})},Pn=function(e,n,r,i){var o,a,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var u=pe(r,1,s.zoom);o=!0,a=[u,u]}else o=!1,a=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(n.posMatrix,r,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},kn=function(t,e,n){var r=pe(n,1,e.zoom),i=Math.pow(2,e.zoom-n.tileID.overscaledZ),o=n.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*i),e.pixelsToGLUnits[1]/(r*i)],u_overscale_factor:o}},Ln=function(t,e,n){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},In=function(t,e,n){return void 0===n&&(n=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:n}},Rn=function(t){return{u_matrix:t}},Dn=function(t,e,n,r){return{u_matrix:t,u_extrude_scale:pe(e,1,n),u_intensity:r}},Nn=function(e,n,r){var i=e.transform;return{u_matrix:Un(e,n,r),u_ratio:1/pe(n,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Fn=function(e,n,r,i){return t.extend(Nn(e,n,r),{u_image:0,u_image_height:i})},zn=function(e,n,r,i){var o=e.transform,a=jn(n,o);return{u_matrix:Un(e,n,r),u_texsize:n.imageAtlasTexture.size,u_ratio:1/pe(n,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Bn=function(e,n,r,i,o){var a=e.lineAtlas,s=jn(n,e.transform),u="round"===r.layout.get("line-cap"),l=a.getDash(i.from,u),c=a.getDash(i.to,u),h=l.width*o.fromScale,p=c.width*o.toScale;return t.extend(Nn(e,n,r),{u_patternscale_a:[s/h,-l.height/2],u_patternscale_b:[s/p,-c.height/2],u_sdfgamma:a.width/(256*Math.min(h,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:l.y,u_tex_y_b:c.y,u_mix:o.t})};function jn(t,e){return 1/pe(t,1,e.tileZoom)}function Un(t,e,n){return t.translatePosMatrix(e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Zn=function(t,e,n,r,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.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:(a=i.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Vn(i.paint.get("raster-hue-rotate"))};var o,a};function Vn(t){t*=Math.PI/180;var e=Math.sin(t),n=Math.cos(t);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}var Gn,Hn=function(t,e,n,r,i,o,a,s,u,l){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+r,u_texsize:l,u_texture:0}},Wn=function(e,n,r,i,o,a,s,u,l,c,h){var p=o.transform;return t.extend(Hn(e,n,r,i,o,a,s,u,l,c),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},qn=function(e,n,r,i,o,a,s,u,l,c){return t.extend(Wn(e,n,r,i,o,a,s,u,!0,l,!0),{u_texsize_icon:c,u_texture_icon:1})},Yn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},Xn=function(e,n,r,i,o,a){return t.extend(function(t,e,n,r){var i=n.imageManager.getPattern(t.from.toString()),o=n.imageManager.getPattern(t.to.toString()),a=n.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,n.transform.tileZoom)/l,h=c*(r.tileID.canonical.x+r.tileID.wrap*l),p=c*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(r,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,r,o),{u_matrix:e,u_opacity:n})},$n={fillExtrusion:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fillExtrusionPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,n.u_height_factor),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fill:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},fillPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},fillOutline:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world)}},fillOutlinePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},circle:function(e,n){return{u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,n.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},collisionBox:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,n.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,n.u_overscale_factor)}},collisionCircle:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,n.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,n.u_viewport_size)}},debug:function(e,n){return{u_color:new t.UniformColor(e,n.u_color),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_overlay:new t.Uniform1i(e,n.u_overlay),u_overlay_scale:new t.Uniform1f(e,n.u_overlay_scale)}},clippingMask:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmap:function(e,n){return{u_extrude_scale:new t.Uniform1f(e,n.u_extrude_scale),u_intensity:new t.Uniform1f(e,n.u_intensity),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmapTexture:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_color_ramp:new t.Uniform1i(e,n.u_color_ramp),u_opacity:new t.Uniform1f(e,n.u_opacity)}},hillshade:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_latrange:new t.Uniform2f(e,n.u_latrange),u_light:new t.Uniform2f(e,n.u_light),u_shadow:new t.UniformColor(e,n.u_shadow),u_highlight:new t.UniformColor(e,n.u_highlight),u_accent:new t.UniformColor(e,n.u_accent)}},hillshadePrepare:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_dimension:new t.Uniform2f(e,n.u_dimension),u_zoom:new t.Uniform1f(e,n.u_zoom),u_unpack:new t.Uniform4f(e,n.u_unpack)}},line:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels)}},lineGradient:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_image:new t.Uniform1i(e,n.u_image),u_image_height:new t.Uniform1f(e,n.u_image_height)}},linePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_texsize:new t.Uniform2f(e,n.u_texsize),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_image:new t.Uniform1i(e,n.u_image),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},lineSDF:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,n.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,n.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,n.u_sdfgamma),u_image:new t.Uniform1i(e,n.u_image),u_tex_y_a:new t.Uniform1f(e,n.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,n.u_tex_y_b),u_mix:new t.Uniform1f(e,n.u_mix)}},raster:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_tl_parent:new t.Uniform2f(e,n.u_tl_parent),u_scale_parent:new t.Uniform1f(e,n.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,n.u_buffer_scale),u_fade_t:new t.Uniform1f(e,n.u_fade_t),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image0:new t.Uniform1i(e,n.u_image0),u_image1:new t.Uniform1i(e,n.u_image1),u_brightness_low:new t.Uniform1f(e,n.u_brightness_low),u_brightness_high:new t.Uniform1f(e,n.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,n.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,n.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,n.u_spin_weights)}},symbolIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture)}},symbolSDF:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},symbolTextAndIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texsize_icon:new t.Uniform2f(e,n.u_texsize_icon),u_texture:new t.Uniform1i(e,n.u_texture),u_texture_icon:new t.Uniform1i(e,n.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},background:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_color:new t.UniformColor(e,n.u_color)}},backgroundPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image:new t.Uniform1i(e,n.u_image),u_pattern_tl_a:new t.Uniform2f(e,n.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,n.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,n.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,n.u_pattern_br_b),u_texsize:new t.Uniform2f(e,n.u_texsize),u_mix:new t.Uniform1f(e,n.u_mix),u_pattern_size_a:new t.Uniform2f(e,n.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,n.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,n.u_scale_a),u_scale_b:new t.Uniform1f(e,n.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,n.u_tile_units_to_pixels)}}};function Kn(e,n,r,i,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d<i.length;d++){var m=i[d],g=n.getTile(m),y=g.getBucket(r);if(y){var v=m.posMatrix;0===o[0]&&0===o[1]||(v=e.translatePosMatrix(m.posMatrix,g,o,a));var _=s?y.textCollisionBox:y.iconCollisionBox,b=y.collisionCircleArray;if(b.length>0){var x=t.create(),w=v;t.mul(x,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(x,x,y.placementViewportMatrix),h.push({circleArray:b,circleOffset:f,transform:w,invTransform:x}),f=p+=b.length/4}_&&c.draw(u,l.LINES,Mt.disabled,Tt.disabled,e.colorModeForRenderPass(),Ct.disabled,kn(v,e.transform,g),r.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&h.length){var S=e.useProgram("collisionCircle"),E=new t.StructArrayLayout2f1f2i16;E.resize(4*p),E._trim();for(var M=0,T=0,A=h;T<A.length;T+=1)for(var C=A[T],O=0;O<C.circleArray.length/4;O++){var P=4*O,k=C.circleArray[P+0],L=C.circleArray[P+1],I=C.circleArray[P+2],R=C.circleArray[P+3];E.emplace(M++,k,L,I,R,0),E.emplace(M++,k,L,I,R,1),E.emplace(M++,k,L,I,R,2),E.emplace(M++,k,L,I,R,3)}(!Gn||Gn.length<2*p)&&(Gn=function(e){var n=2*e,r=new t.StructArrayLayout3ui6;r.resize(n),r._trim();for(var i=0;i<n;i++){var o=6*i;r.uint16[o+0]=4*i+0,r.uint16[o+1]=4*i+1,r.uint16[o+2]=4*i+2,r.uint16[o+3]=4*i+2,r.uint16[o+4]=4*i+3,r.uint16[o+5]=4*i+0}return r}(p));for(var D=u.createIndexBuffer(Gn,!0),N=u.createVertexBuffer(E,t.collisionCircleLayout.members,!0),F=0,z=h;F<z.length;F+=1){var B=z[F],j=Ln(B.transform,B.invTransform,e.transform);S.draw(u,l.TRIANGLES,Mt.disabled,Tt.disabled,e.colorModeForRenderPass(),Ct.disabled,j,r.id,N,D,t.SegmentVector.simpleSegment(0,2*B.circleOffset,B.circleArray.length,B.circleArray.length/2),null,e.transform.zoom,null,null,null)}N.destroy(),D.destroy()}}var Jn=t.identity(new Float32Array(16));function Qn(e,n,r,i,o,a){var s=t.getAnchorAlignment(e),u=-(s.horizontalAlign-.5)*n,l=-(s.verticalAlign-.5)*r,c=t.evaluateVariableOffset(e,i);return new t.Point((u/o+c[0])*a,(l/o+c[1])*a)}function tr(e,n,r,i,o,a,s,u,l,c,h){var p=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,m={};f.clear();for(var g=0;g<p.length;g++){var y=p.get(g),v=y.hidden||!y.crossTileID||e.allowVerticalPlacement&&!y.placedOrientation?null:i[y.crossTileID];if(v){var _=new t.Point(y.anchorX,y.anchorY),b=Qt(_,r?u:s),x=te(a.cameraToCenterDistance,b.signedDistanceFromCamera),w=o.evaluateSizeForFeature(e.textSizeData,c,y)*x/t.ONE_EM;r&&(w*=e.tilePixelRatio/l);for(var S=Qn(v.anchor,v.width,v.height,v.textOffset,v.textBoxScale,w),E=r?Qt(_.add(S),s).point:b.point.add(n?S.rotate(-a.angle):S),M=e.allowVerticalPlacement&&y.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,T=0;T<y.numGlyphs;T++)t.addDynamicAttributes(f,E,M);h&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:E,angle:M})}else le(y.numGlyphs,f)}if(h){d.clear();for(var A=e.icon.placedSymbolArray,C=0;C<A.length;C++){var O=A.get(C);if(O.hidden)le(O.numGlyphs,d);else{var P=m[C];if(P)for(var k=0;k<O.numGlyphs;k++)t.addDynamicAttributes(d,P.shiftedAnchor,P.angle);else le(O.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function er(t,e,n){return n.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function nr(e,n,r,i,o,a,s,u,l,c,h,p){for(var f=e.context,d=f.gl,m=e.transform,g="map"===u,y="map"===l,v=g&&"point"!==r.layout.get("symbol-placement"),_=g&&!y&&!v,b=void 0!==r.layout.get("symbol-sort-key").constantOr(1),x=!1,w=e.depthModeForSublayer(0,Mt.ReadOnly),S=r.layout.get("text-variable-anchor"),E=[],M=0,T=i;M<T.length;M+=1){var A=T[M],C=n.getTile(A),O=C.getBucket(r);if(O){var P=o?O.text:O.icon;if(P&&P.segments.get().length){var k=P.programConfigurations.get(r.id),L=o||O.sdfIcons,I=o?O.textSizeData:O.iconSizeData,R=y||0!==m.pitch,D=e.useProgram(er(L,o,O),k),N=t.evaluateSizeForZoom(I,m.zoom),F=void 0,z=[0,0],B=void 0,j=void 0,U=null,Z=void 0;if(o)B=C.glyphAtlasTexture,j=d.LINEAR,F=C.glyphAtlasTexture.size,O.iconsInText&&(z=C.imageAtlasTexture.size,U=C.imageAtlasTexture,Z=R||e.options.rotating||e.options.zooming||"composite"===I.kind||"camera"===I.kind?d.LINEAR:d.NEAREST);else{var V=1!==r.layout.get("icon-size").constantOr(0)||O.iconsNeedLinear;B=C.imageAtlasTexture,j=L||e.options.rotating||e.options.zooming||V||R?d.LINEAR:d.NEAREST,F=C.imageAtlasTexture.size}var G=pe(C,1,e.transform.zoom),H=Kt(A.posMatrix,y,g,e.transform,G),W=Jt(A.posMatrix,y,g,e.transform,G),q=S&&O.hasTextData(),Y="none"!==r.layout.get("icon-text-fit")&&q&&O.hasIconData();v&&ne(O,A.posMatrix,e,o,H,W,y,c);var X=e.translatePosMatrix(A.posMatrix,C,a,s),$=v||o&&S||Y?Jn:H,K=e.translatePosMatrix(W,C,a,s,!0),J=L&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:D,buffers:P,uniformValues:L?O.iconsInText?qn(I.kind,N,_,y,e,X,$,K,F,z):Wn(I.kind,N,_,y,e,X,$,K,o,F,!0):Hn(I.kind,N,_,y,e,X,$,K,o,F),atlasTexture:B,atlasTextureIcon:U,atlasInterpolation:j,atlasInterpolationIcon:Z,isSDF:L,hasHalo:J};if(b&&O.canOverlap){x=!0;for(var tt=0,et=P.segments.get();tt<et.length;tt+=1){var nt=et[tt];E.push({segments:new t.SegmentVector([nt]),sortKey:nt.sortKey,state:Q})}}else E.push({segments:P.segments,sortKey:0,state:Q})}}}x&&E.sort((function(t,e){return t.sortKey-e.sortKey}));for(var rt=0,it=E;rt<it.length;rt+=1){var ot=it[rt],at=ot.state;if(f.activeTexture.set(d.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,d.CLAMP_TO_EDGE),at.atlasTextureIcon&&(f.activeTexture.set(d.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),at.isSDF){var st=at.uniformValues;at.hasHalo&&(st.u_is_halo=1,rr(at.buffers,ot.segments,r,e,at.program,w,h,p,st)),st.u_is_halo=0}rr(at.buffers,ot.segments,r,e,at.program,w,h,p,at.uniformValues)}}function rr(t,e,n,r,i,o,a,s,u){var l=r.context;i.draw(l,l.gl.TRIANGLES,o,a,s,Ct.disabled,u,n.id,t.layoutVertexBuffer,t.indexBuffer,e,n.paint,r.transform.zoom,t.programConfigurations.get(n.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ir(t,e,n,r,i,o,a){var s,u,l,c,h,p=t.context.gl,f=n.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=n.getCrossfadeParameters();a?(u=d&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(u=d?"fillPattern":"fill",s=p.TRIANGLES);for(var g=0,y=r;g<y.length;g+=1){var v=y[g],_=e.getTile(v);if(!d||_.patternsLoaded()){var b=_.getBucket(n);if(b){var x=b.programConfigurations.get(n.id),w=t.useProgram(u,x);d&&(t.context.activeTexture.set(p.TEXTURE0),_.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),x.updatePaintBuffers(m));var S=f.constantOr(null);if(S&&_.imageAtlas){var E=_.imageAtlas,M=E.patternPositions[S.to.toString()],T=E.patternPositions[S.from.toString()];M&&T&&x.setConstantPatternPositions(M,T)}var A=t.translatePosMatrix(v.posMatrix,_,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){c=b.indexBuffer2,h=b.segments2;var C=[p.drawingBufferWidth,p.drawingBufferHeight];l="fillOutlinePattern"===u&&d?On(A,t,m,_,C):Cn(A,C)}else c=b.indexBuffer,h=b.segments,l=d?An(A,t,m,_):Tn(A);w.draw(t.context,s,i,t.stencilModeForClipping(v),o,Ct.disabled,l,n.id,b.layoutVertexBuffer,c,h,n.paint,t.transform.zoom,x)}}}}function or(t,e,n,r,i,o,a){for(var s=t.context,u=s.gl,l=n.paint.get("fill-extrusion-pattern"),c=l.constantOr(1),h=n.getCrossfadeParameters(),p=n.paint.get("fill-extrusion-opacity"),f=0,d=r;f<d.length;f+=1){var m=d[f],g=e.getTile(m),y=g.getBucket(n);if(y){var v=y.programConfigurations.get(n.id),_=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",v);c&&(t.context.activeTexture.set(u.TEXTURE0),g.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var b=l.constantOr(null);if(b&&g.imageAtlas){var x=g.imageAtlas,w=x.patternPositions[b.to.toString()],S=x.patternPositions[b.from.toString()];w&&S&&v.setConstantPatternPositions(w,S)}var E=t.translatePosMatrix(m.posMatrix,g,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),M=n.paint.get("fill-extrusion-vertical-gradient"),T=c?Mn(E,t,M,p,m,h,g):En(E,t,M,p);_.draw(s,s.gl.TRIANGLES,i,o,a,Ct.backCCW,T,n.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,n.paint,t.transform.zoom,v)}}}function ar(e,n,r,i,o,a){var s=e.context,u=s.gl,l=n.fbo;if(l){var c=e.useProgram("hillshade");s.activeTexture.set(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,l.colorAttachment.get());var h=function(e,n,r){var i=r.paint.get("hillshade-shadow-color"),o=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var u,l,c,h=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(n.tileID.toUnwrapped(),h),u_image:0,u_latrange:(u=n.tileID,l=Math.pow(2,u.canonical.z),c=u.canonical.y,[new t.MercatorCoordinate(0,c/l).toLngLat().lat,new t.MercatorCoordinate(0,(c+1)/l).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:o,u_accent:a}}(e,n,r);c.draw(s,u.TRIANGLES,i,o,a,Ct.disabled,h,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function sr(e,n,r,i,o,a){var s=e.context,u=s.gl,l=n.dem;if(l&&l.data){var c=l.dim,h=l.stride,p=l.getPixels();if(s.activeTexture.set(u.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(h),n.demTexture){var f=n.demTexture;f.update(p,{premultiply:!1}),f.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else n.demTexture=new t.Texture(s,p,u.RGBA,{premultiply:!1}),n.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);s.activeTexture.set(u.TEXTURE0);var d=n.fbo;if(!d){var m=new t.Texture(s,{width:c,height:c,data:null},u.RGBA);m.bind(u.LINEAR,u.CLAMP_TO_EDGE),(d=n.fbo=s.createFramebuffer(c,c,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(s,u.TRIANGLES,i,o,a,Ct.disabled,function(e,n){var r=n.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:[r,r],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}}(n.tileID,l),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function ur(e,n,r,i,o){var a=i.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),u=(s-e.timeAdded)/a,l=n?(s-n.timeAdded)/a:-1,c=r.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!n||Math.abs(n.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-l,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var lr=new t.Color(1,0,0,1),cr=new t.Color(0,1,0,1),hr=new t.Color(0,0,1,1),pr=new t.Color(1,0,1,1),fr=new t.Color(0,1,1,1);function dr(t,e,n,r){gr(t,0,e+n/2,t.transform.width,n,r)}function mr(t,e,n,r){gr(t,e-n/2,0,n,t.transform.height,r)}function gr(e,n,r,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(n*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function yr(e,n,r){var i=e.context,o=i.gl,a=r.posMatrix,s=e.useProgram("debug"),u=Mt.disabled,l=Tt.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,l,c,Ct.disabled,In(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=n.getTileByID(r.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),f=n.getTile(r).tileSize,d=512/Math.min(f,512)*(r.overscaledZ/e.transform.zoom)*.5,m=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(m+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var n=t.debugOverlayCanvas,r=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,n.width,n.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(n),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(e,m+" "+p+"kb"),s.draw(i,o.TRIANGLES,u,l,At.alphaBlended,Ct.disabled,In(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var vr={symbol:function(e,n,r,i,o){if("translucent"===e.renderPass){var a=Tt.disabled,s=e.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(e,n,r,i,o,a,s){for(var u=n.transform,l="map"===o,c="map"===a,h=0,p=e;h<p.length;h+=1){var f=p[h],d=i.getTile(f),m=d.getBucket(r);if(m&&m.text&&m.text.segments.get().length){var g=t.evaluateSizeForZoom(m.textSizeData,u.zoom),y=pe(d,1,n.transform.zoom),v=Kt(f.posMatrix,c,l,n.transform,y),_="none"!==r.layout.get("icon-text-fit")&&m.hasIconData();if(g){var b=Math.pow(2,u.zoom-d.tileID.overscaledZ);tr(m,l,c,s,t.symbolSize,u,v,f.posMatrix,b,g,_)}}}}(i,e,r,n,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),o),0!==r.paint.get("icon-opacity").constantOr(1)&&nr(e,n,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,s),0!==r.paint.get("text-opacity").constantOr(1)&&nr(e,n,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,s),n.map.showCollisionBoxes&&(Kn(e,n,r,i,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Kn(e,n,r,i,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))}},circle:function(e,n,r,i){if("translucent"===e.renderPass){var o=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),u=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var l=e.context,c=l.gl,h=e.depthModeForSublayer(0,Mt.ReadOnly),p=Tt.disabled,f=e.colorModeForRenderPass(),d=[],m=0;m<i.length;m++){var g=i[m],y=n.getTile(g),v=y.getBucket(r);if(v){var _=v.programConfigurations.get(r.id),b={programConfiguration:_,program:e.useProgram("circle",_),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:Pn(e,g,y,r)};if(u)for(var x=0,w=v.segments.get();x<w.length;x+=1){var S=w[x];d.push({segments:new t.SegmentVector([S]),sortKey:S.sortKey,state:b})}else d.push({segments:v.segments,sortKey:0,state:b})}}u&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var E=0,M=d;E<M.length;E+=1){var T=M[E],A=T.state;A.program.draw(l,c.TRIANGLES,h,p,f,Ct.disabled,A.uniformValues,r.id,A.layoutVertexBuffer,A.indexBuffer,T.segments,r.paint,e.transform.zoom,A.programConfiguration)}}}},heatmap:function(e,n,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=Tt.disabled,u=new At([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,n){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=n.heatmapFbo;if(i)r.bindTexture(r.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),i=n.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,n,r){var i=t.gl;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e.width/4,e.height/4,0,i.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE,null),r.colorAttachment.set(n)}(t,e,o,i)}}(o,e,r),o.clear({color:t.Color.transparent});for(var l=0;l<i.length;l++){var c=i[l];if(!n.hasRenderableParent(c)){var h=n.getTile(c),p=h.getBucket(r);if(p){var f=p.programConfigurations.get(r.id);e.useProgram("heatmap",f).draw(o,a.TRIANGLES,Mt.disabled,s,u,Ct.disabled,Dn(c.posMatrix,h,e.transform.zoom,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,e.transform.zoom,f)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,n){var r=e.context,i=r.gl,o=n.heatmapFbo;if(o){r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1);var a=n.colorRampTexture;a||(a=n.colorRampTexture=new t.Texture(r,n.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(r,i.TRIANGLES,Mt.disabled,Tt.disabled,e.colorModeForRenderPass(),Ct.disabled,function(e,n,r,i){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var a=e.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:n.paint.get("heatmap-opacity")}}(e,n),n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom)}}(e,r))},line:function(e,n,r,i){if("translucent"===e.renderPass){var o=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1))for(var s=e.depthModeForSublayer(0,Mt.ReadOnly),u=e.colorModeForRenderPass(),l=r.paint.get("line-dasharray"),c=r.paint.get("line-pattern"),h=c.constantOr(1),p=r.paint.get("line-gradient"),f=r.getCrossfadeParameters(),d=h?"linePattern":l?"lineSDF":p?"lineGradient":"line",m=e.context,g=m.gl,y=!0,v=0,_=i;v<_.length;v+=1){var b=_[v],x=n.getTile(b);if(!h||x.patternsLoaded()){var w=x.getBucket(r);if(w){var S=w.programConfigurations.get(r.id),E=e.context.program.get(),M=e.useProgram(d,S),T=y||M.program!==E,A=c.constantOr(null);if(A&&x.imageAtlas){var C=x.imageAtlas,O=C.patternPositions[A.to.toString()],P=C.patternPositions[A.from.toString()];O&&P&&S.setConstantPatternPositions(O,P)}var k=h?zn(e,x,r,f):l?Bn(e,x,r,l,f):p?Fn(e,x,r,w.lineClipsArray.length):Nn(e,x,r);if(h)m.activeTexture.set(g.TEXTURE0),x.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),S.updatePaintBuffers(f);else if(l&&(T||e.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m);else if(p){var L=w.gradients[r.id],I=L.texture;if(r.gradientVersion!==L.version){var R=256;if(r.stepInterpolant){var D=n.getSource().maxzoom,N=b.canonical.z===D?Math.ceil(1<<e.transform.maxZoom-b.canonical.z):1;R=t.clamp(t.nextPowerOfTwo(w.maxLineLength/t.EXTENT*1024*N),256,m.maxTextureSize)}L.gradient=t.renderColorRamp({expression:r.gradientExpression(),evaluationKey:"lineProgress",resolution:R,image:L.gradient||void 0,clips:w.lineClipsArray}),L.texture?L.texture.update(L.gradient):L.texture=new t.Texture(m,L.gradient,g.RGBA),L.version=r.gradientVersion,I=L.texture}m.activeTexture.set(g.TEXTURE0),I.bind(r.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}M.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(b),u,Ct.disabled,k,r.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,r.paint,e.transform.zoom,S,w.layoutVertexBuffer2),y=!1}}}}},fill:function(e,n,r,i){var o=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),u=r.paint.get("fill-pattern"),l=e.opaquePassEnabledForLayer()&&!u.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===l){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?Mt.ReadWrite:Mt.ReadOnly);ir(e,n,r,i,c,s,!1)}if("translucent"===e.renderPass&&r.paint.get("fill-antialias")){var h=e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Mt.ReadOnly);ir(e,n,r,i,h,s,!0)}}},"fill-extrusion":function(t,e,n,r){var i=n.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var o=new Mt(t.context.gl.LEQUAL,Mt.ReadWrite,t.depthRangeFor3D);if(1!==i||n.paint.get("fill-extrusion-pattern").constantOr(1))or(t,e,n,r,o,Tt.disabled,At.disabled),or(t,e,n,r,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();or(t,e,n,r,o,Tt.disabled,a)}}},hillshade:function(t,e,n,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,o=t.depthModeForSublayer(0,Mt.ReadOnly),a=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r],u=s[0],l=0,c=s[1];l<c.length;l+=1){var h=c[l],p=e.getTile(h);p.needsHillshadePrepare&&"offscreen"===t.renderPass?sr(t,p,n,o,Tt.disabled,a):"translucent"===t.renderPass&&ar(t,p,n,o,u[h.overscaledZ],a)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,n,r){if("translucent"===t.renderPass&&0!==n.paint.get("raster-opacity")&&r.length)for(var i=t.context,o=i.gl,a=e.getSource(),s=t.useProgram("raster"),u=t.colorModeForRenderPass(),l=a instanceof L?[{},r]:t.stencilConfigForOverlap(r),c=l[0],h=l[1],p=h[h.length-1].overscaledZ,f=!t.options.moving,d=0,m=h;d<m.length;d+=1){var g=m[d],y=t.depthModeForSublayer(g.overscaledZ-p,1===n.paint.get("raster-opacity")?Mt.ReadWrite:Mt.ReadOnly,o.LESS),v=e.getTile(g),_=t.transform.calculatePosMatrix(g.toUnwrapped(),f);v.registerFadeDuration(n.paint.get("raster-fade-duration"));var b=e.findLoadedParent(g,0),x=ur(v,b,e,n,t.transform),w=void 0,S=void 0,E="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;i.activeTexture.set(o.TEXTURE0),v.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(o.TEXTURE1),b?(b.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,b.tileID.overscaledZ-v.tileID.overscaledZ),S=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var M=Zn(_,S||[0,0],w||1,x,n);a instanceof L?s.draw(i,o.TRIANGLES,y,Tt.disabled,u,Ct.disabled,M,n.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(i,o.TRIANGLES,y,c[g.overscaledZ],u,Ct.disabled,M,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,n){var r=n.paint.get("background-color"),i=n.paint.get("background-opacity");if(0!==i){var o=t.context,a=o.gl,s=t.transform,u=s.tileSize,l=n.paint.get("background-pattern");if(!t.isPatternMissing(l)){var c=!l&&1===r.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var h=Tt.disabled,p=t.depthModeForSublayer(0,"opaque"===c?Mt.ReadWrite:Mt.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(l?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:u});l&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var g=n.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var _=v[y],b=t.transform.calculatePosMatrix(_.toUnwrapped()),x=l?Xn(b,i,t,l,{tileID:_,tileSize:u},g):Yn(b,i,r);d.draw(o,a.TRIANGLES,p,h,f,Ct.disabled,x,n.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,n){for(var r=0;r<n.length;r++)yr(t,e,n[r])},custom:function(t,e,n){var r=t.context,i=n.implementation;if("offscreen"===t.renderPass){var o=i.prerender;o&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),o.call(i,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(Tt.disabled);var a="3d"===i.renderingMode?new Mt(t.context.gl.LEQUAL,Mt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Mt.ReadOnly);r.setDepthMode(a),i.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}},_r=function(t,e){this.context=new Ot(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Pt.maxUnderzooming+Pt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ze,this.gpuTimers={}};_r.prototype.resize=function(e,n){if(this.width=e*t.browser.devicePixelRatio,this.height=n*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,i=this.style._order;r<i.length;r+=1)this.style._layers[i[r]].resize()},_r.prototype.setup=function(){var e=this.context,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.tileExtentBuffer=e.createVertexBuffer(n,Ge.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var 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.debugBuffer=e.createVertexBuffer(r,Ge.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,k.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Ge.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);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 u=this.context.gl;this.stencilClearMode=new Tt({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO)},_r.prototype.clearStencil=function(){var e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=t.create();t.ortho(r,0,this.width,this.height,0,0,1),t.scale(r,r,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Mt.disabled,this.stencilClearMode,At.disabled,Ct.disabled,Rn(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},_r.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var n=this.context,r=n.gl;this.nextStencilID+e.length>256&&this.clearStencil(),n.setColorMode(At.disabled),n.setDepthMode(Mt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(n,r.TRIANGLES,Mt.disabled,new Tt({func:r.ALWAYS,mask:0},u,255,r.KEEP,r.KEEP,r.REPLACE),At.disabled,Ct.disabled,Rn(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},_r.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Tt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_r.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Tt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_r.prototype.stencilConfigForOverlap=function(t){var e,n=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=r[r.length-1].overscaledZ,o=r[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s<o;s++)a[s+i]=new Tt({func:n.GEQUAL,mask:255},s+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[a,r]}return[(e={},e[i]=Tt.disabled,e),r]},_r.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new At([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?At.unblended:At.alphaBlended},_r.prototype.depthModeForSublayer=function(t,e,n){if(!this.opaquePassEnabledForLayer())return Mt.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Mt(n||this.context.gl.LEQUAL,e,[r,r])},_r.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},_r.prototype.render=function(e,n){var r=this;this.style=e,this.options=n,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,o=this.style.sourceCaches;for(var a in o){var s=o[a];s.used&&s.prepare(this.context)}var u,l,c={},h={},p={};for(var f in o){var d=o[f];c[f]=d.getVisibleCoordinates(),h[f]=c[f].slice().reverse(),p[f]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++)if(this.style._layers[i[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var g=0,y=i;g<y.length;g+=1){var v=this.style._layers[y[g]];if(v.hasOffscreenPass()&&!v.isHidden(this.transform.zoom)){var _=h[v.source];("custom"===v.type||_.length)&&this.renderLayer(this,o[v.source],v,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.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 b=this.style._layers[i[this.currentLayer]],x=o[b.source],w=c[b.source];this._renderTileClippingMasks(b,w),this.renderLayer(this,x,b,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var S=this.style._layers[i[this.currentLayer]],E=o[S.source],M=("symbol"===S.type?p:h)[S.source];this._renderTileClippingMasks(S,c[S.source]),this.renderLayer(this,E,S,M)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(r.transform.zoom)&&(t.source!==(l&&l.id)&&(l=r.style.sourceCaches[t.source]),(!u||u.getSource().maxzoom<l.getSource().maxzoom)&&(u=l))})),u&&vr.debug(this,u,u.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;dr(t,t.transform.height-(e.top||0),3,lr),dr(t,e.bottom||0,3,cr),mr(t,e.left||0,3,hr),mr(t,t.transform.width-(e.right||0),3,pr);var n=t.transform.centerPoint;!function(t,e,n,r){gr(t,e-1,n-10,2,20,r),gr(t,e-10,n-1,20,2,r)}(t,n.x,t.transform.height-n.y,fr)}(this),this.context.setDefault()},_r.prototype.renderLayer=function(t,e,n,r){n.isHidden(this.transform.zoom)||("background"===n.type||"custom"===n.type||r.length)&&(this.id=n.id,this.gpuTimingStart(n),vr[n.type](t,e,n,r,this.style.placement.variableOffsets),this.gpuTimingEnd())},_r.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,n=this.gpuTimers[t.id];n||(n=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),n.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,n.query)}},_r.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},_r.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},_r.prototype.queryGpuTimers=function(t){var e={};for(var n in t){var r=t[n],i=this.context.extTimerQuery,o=i.getQueryObjectEXT(r.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(r.query),e[n]=o}return e},_r.prototype.translatePosMatrix=function(e,n,r,i,o){if(!r[0]&&!r[1])return e;var a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){var s=Math.sin(a),u=Math.cos(a);r=[r[0]*u-r[1]*s,r[0]*s+r[1]*u]}var l=[o?r[0]:pe(n,r[0],this.transform.zoom),o?r[1]:pe(n,r[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,l),c},_r.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},_r.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},_r.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),n=this.imageManager.getPattern(t.to.toString());return!e||!n},_r.prototype.useProgram=function(t,e){this.cache=this.cache||{};var n=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new wn(this.context,t,_n[t],e,$n[t],this._showOverdrawInspector)),this.cache[n]},_r.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()},_r.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)},_r.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},_r.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var br=function(t,e){this.points=t,this.planes=e};br.fromInvProjectionMatrix=function(e,n,r){var i=Math.pow(2,r),o=[[-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(n){return t.transformMat4([],n,e)})).map((function(e){return t.scale$1([],e,1/e[3]/n*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var n=t.sub([],o[e[0]],o[e[1]]),r=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],n,r)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new br(o,a)};var xr=function(e,n){this.min=e,this.max=n,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};xr.prototype.quadrant=function(e){for(var n=[e%2==0,e<2],r=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o<n.length;o++)r[o]=n[o]?this.min[o]:this.center[o],i[o]=n[o]?this.center[o]:this.max[o];return i[2]=this.max[2],new xr(r,i)},xr.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},xr.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},xr.prototype.intersects=function(e){for(var n=[[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]],r=!0,i=0;i<e.planes.length;i++){for(var o=e.planes[i],a=0,s=0;s<n.length;s++)a+=t.dot$1(o,n[s])>=0;if(0===a)return 0;a!==n.length&&(r=!1)}if(r)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var p=e.points[h][u]-this.min[u];l=Math.min(l,p),c=Math.max(c,p)}if(c<0||l>this.max[u]-this.min[u])return 0}return 1};var wr=function(t,e,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(n)||n<0||isNaN(r)||r<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=n,this.right=r};wr.prototype.interpolate=function(e,n,r){return null!=n.top&&null!=e.top&&(this.top=t.number(e.top,n.top,r)),null!=n.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,n.bottom,r)),null!=n.left&&null!=e.left&&(this.left=t.number(e.left,n.left,r)),null!=n.right&&null!=e.right&&(this.right=t.number(e.right,n.right,r)),this},wr.prototype.getCenter=function(e,n){var r=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+n-this.bottom)/2,0,n);return new t.Point(r,i)},wr.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wr.prototype.clone=function(){return new wr(this.top,this.bottom,this.left,this.right)},wr.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Sr=function(e,n,r,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==r?0:r,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wr,this._posMatrixCache={},this._alignedPosMatrixCache={}},Er={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}};Sr.prototype.clone=function(){var t=new Sr(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},Er.minZoom.get=function(){return this._minZoom},Er.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Er.maxZoom.get=function(){return this._maxZoom},Er.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Er.minPitch.get=function(){return this._minPitch},Er.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Er.maxPitch.get=function(){return this._maxPitch},Er.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Er.renderWorldCopies.get=function(){return this._renderWorldCopies},Er.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Er.worldSize.get=function(){return this.tileSize*this.scale},Er.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Er.size.get=function(){return new t.Point(this.width,this.height)},Er.bearing.get=function(){return-this.angle/Math.PI*180},Er.bearing.set=function(e){var n=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Er.pitch.get=function(){return this._pitch/Math.PI*180},Er.pitch.set=function(e){var n=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},Er.fov.get=function(){return this._fov/Math.PI*180},Er.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())},Er.zoom.get=function(){return this._zoom},Er.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())},Er.center.get=function(){return this._center},Er.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Er.padding.get=function(){return this._edgeInsets.toJSON()},Er.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Er.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Sr.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Sr.prototype.interpolatePadding=function(t,e,n){this._unmodified=!1,this._edgeInsets.interpolate(t,e,n),this._constrain(),this._calcMatrices()},Sr.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)},Sr.prototype.getVisibleUnwrappedCoordinates=function(e){var n=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),u=Math.floor(Math.max(r.x,i.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&n.push(new t.UnwrappedTileID(l,e));return n},Sr.prototype.coveringTiles=function(e){var n=this.coveringZoomLevel(e),r=n;if(void 0!==e.minzoom&&n<e.minzoom)return[];void 0!==e.maxzoom&&n>e.maxzoom&&(n=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,n),a=[o*i.x,o*i.y,0],s=br.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=n);var l=function(t){return{aabb:new xr([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],p=n,f=e.reparseOverscaled?r:n;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));c.length>0;){var m=c.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var _=m.aabb.intersects(s);if(0===_)continue;v=2===_}var b=m.aabb.distanceX(a),x=m.aabb.distanceY(a),w=Math.max(Math.abs(b),Math.abs(x));if(m.zoom===p||w>3+(1<<p-m.zoom)-2&&m.zoom>=u)h.push({tileID:new t.OverscaledTileID(m.zoom===p?f:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([a[0]-.5-g,a[1]-.5-y])});else for(var S=0;S<4;S++){var E=(g<<1)+S%2,M=(y<<1)+(S>>1);c.push({aabb:m.aabb.quadrant(S),zoom:m.zoom+1,x:E,y:M,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Sr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Er.unmodified.get=function(){return this._unmodified},Sr.prototype.zoomScale=function(t){return Math.pow(2,t)},Sr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Sr.prototype.project=function(e){var n=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(n)*this.worldSize)},Sr.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Er.point.get=function(){return this.project(this.center)},Sr.prototype.setLocationAtPoint=function(e,n){var r=this.pointCoordinate(n),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(r.x-i.x),o.y-(r.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},Sr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Sr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Sr.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Sr.prototype.coordinateLocation=function(t){return t.toLngLat()},Sr.prototype.pointCoordinate=function(e){var n=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.transformMat4(n,n,this.pixelMatrixInverse),t.transformMat4(r,r,this.pixelMatrixInverse);var i=n[3],o=r[3],a=n[1]/i,s=r[1]/o,u=n[2]/i,l=r[2]/o,c=u===l?0:(0-u)/(l-u);return new t.MercatorCoordinate(t.number(n[0]/i,r[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},Sr.prototype.coordinatePoint=function(e){var n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix),new t.Point(n[0]/n[3],n[1]/n[3])},Sr.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)))},Sr.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},Sr.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])},Sr.prototype.calculatePosMatrix=function(e,n){void 0===n&&(n=!1);var r=e.key,i=n?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,n?this.alignedProjMatrix:this.projMatrix,u),i[r]=new Float32Array(u),i[r]},Sr.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Sr.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,n,r,i,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-o<l.y?l.y/(a-o):0}if(this.lngRange){var p=this.lngRange;s=t.mercatorXfromLng(p[0])*this.worldSize,n=(u=t.mercatorXfromLng(p[1])*this.worldSize)-s<l.x?l.x/(u-s):0}var f=this.point,d=Math.max(n||0,e||0);if(d)return this.center=this.unproject(new t.Point(n?(u+s)/2:f.x,e?(a+o)/2:f.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=f.y,g=l.y/2;m-g<o&&(i=o+g),m+g>a&&(i=a-g)}if(this.lngRange){var y=f.x,v=l.x/2;y-v<s&&(r=s+v),y+v>u&&(r=u-v)}void 0===r&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==r?r:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},Sr.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var n=Math.PI/2+this._pitch,r=this._fov*(.5+e.y/this.height),i=Math.sin(r)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-r,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,u),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),m=a-Math.round(a)+f*h+d*p,g=s-Math.round(s)+f*p+d*h,y=new Float64Array(c);if(t.translate(y,y,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=y,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Sr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},Sr.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},Sr.prototype.getCameraQueryGeometry=function(e){var n=this.getCameraPoint();if(1===e.length)return[e[0],n];for(var r=n.x,i=n.y,o=n.x,a=n.y,s=0,u=e;s<u.length;s+=1){var l=u[s];r=Math.min(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y)}return[new t.Point(r,i),new t.Point(o,i),new t.Point(o,a),new t.Point(r,a),new t.Point(r,i)]},Object.defineProperties(Sr.prototype,Er);var Mr=function(e){var n,r,i,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(n=this._updateHashUnthrottled.bind(this),r=!1,i=null,o=function(){i=null,r&&(n(),i=setTimeout(o,300),r=!1)},function(){return r=!0,i||o(),i})};Mr.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Mr.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Mr.prototype.getHashString=function(e){var n=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(n.lng*o)/o,s=Math.round(n.lat*o)/o,u=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=e?"/"+a+"/"+s+"/"+r:r+"/"+s+"/"+a,(u||l)&&(c+="/"+Math.round(10*u)/10),l&&(c+="/"+Math.round(l)),this._hashName){var h=this._hashName,p=!1,f=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(p=!0,e+"="+c):t})).filter((function(t){return t}));return p||f.push(h+"="+c),"#"+f.join("&")}return"#"+c},Mr.prototype._getCurrentHash=function(){var e,n=this,r=t.window.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===n._hashName&&(e=t)})),(e&&e[1]||"").split("/")):r.split("/")},Mr.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},Mr.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Tr={linearity:.3,easing:t.bezier(0,0,.3,1)},Ar=t.extend({deceleration:2500,maxSpeed:1400},Tr),Cr=t.extend({deceleration:20,maxSpeed:1400},Tr),Or=t.extend({deceleration:1e3,maxSpeed:360},Tr),Pr=t.extend({deceleration:1e3,maxSpeed:90},Tr),kr=function(t){this._map=t,this.clear()};function Lr(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Ir(e,n,r){var i=r.maxSpeed,o=r.linearity,a=r.deceleration,s=t.clamp(e*o/(n/1e3),-i,i),u=Math.abs(s)/(a*o);return{easing:r.easing,duration:1e3*u,amount:s*(u/2)}}kr.prototype.clear=function(){this._inertiaBuffer=[]},kr.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},kr.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,n=t.browser.now();e.length>0&&n-e[0].time>160;)e.shift()},kr.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var n={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},r=0,i=this._inertiaBuffer;r<i.length;r+=1){var o=i[r].settings;n.zoom+=o.zoomDelta||0,n.bearing+=o.bearingDelta||0,n.pitch+=o.pitchDelta||0,o.panDelta&&n.pan._add(o.panDelta),o.around&&(n.around=o.around),o.pinchAround&&(n.pinchAround=o.pinchAround)}var a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(n.pan.mag()){var u=Ir(n.pan.mag(),a,t.extend({},Ar,e||{}));s.offset=n.pan.mult(u.amount/n.pan.mag()),s.center=this._map.transform.center,Lr(s,u)}if(n.zoom){var l=Ir(n.zoom,a,Cr);s.zoom=this._map.transform.zoom+l.amount,Lr(s,l)}if(n.bearing){var c=Ir(n.bearing,a,Or);s.bearing=this._map.transform.bearing+t.clamp(c.amount,-179,179),Lr(s,c)}if(n.pitch){var h=Ir(n.pitch,a,Pr);s.pitch=this._map.transform.pitch+h.amount,Lr(s,h)}if(s.zoom||s.bearing){var p=void 0===n.pinchAround?n.around:n.pinchAround;s.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var Rr=function(e){function r(r,i,o,a){void 0===a&&(a={});var s=n.mousePos(i.getCanvasContainer(),o),u=i.unproject(s);e.call(this,r,t.extend({point:s,lngLat:u,originalEvent:o},a)),this._defaultPrevented=!1,this.target=i}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),Dr=function(e){function r(r,i,o){var a="touchend"===r?o.changedTouches:o.touches,s=n.touchPos(i.getCanvasContainer(),a),u=s.map((function(t){return i.unproject(t)})),l=s.reduce((function(t,e,n,r){return t.add(e.div(r.length))}),new t.Point(0,0)),c=i.unproject(l);e.call(this,r,{points:s,point:l,lngLats:u,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),Nr=function(t){function e(e,n,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,n),e}(t.Event),Fr=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Fr.prototype.reset=function(){delete this._mousedownPos},Fr.prototype.wheel=function(t){return this._firePreventable(new Nr(t.type,this._map,t))},Fr.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new Rr(t.type,this._map,t))},Fr.prototype.mouseup=function(t){this._map.fire(new Rr(t.type,this._map,t))},Fr.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Rr(t.type,this._map,t))},Fr.prototype.dblclick=function(t){return this._firePreventable(new Rr(t.type,this._map,t))},Fr.prototype.mouseover=function(t){this._map.fire(new Rr(t.type,this._map,t))},Fr.prototype.mouseout=function(t){this._map.fire(new Rr(t.type,this._map,t))},Fr.prototype.touchstart=function(t){return this._firePreventable(new Dr(t.type,this._map,t))},Fr.prototype.touchmove=function(t){this._map.fire(new Dr(t.type,this._map,t))},Fr.prototype.touchend=function(t){this._map.fire(new Dr(t.type,this._map,t))},Fr.prototype.touchcancel=function(t){this._map.fire(new Dr(t.type,this._map,t))},Fr.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Fr.prototype.isEnabled=function(){return!0},Fr.prototype.isActive=function(){return!1},Fr.prototype.enable=function(){},Fr.prototype.disable=function(){};var zr=function(t){this._map=t};zr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},zr.prototype.mousemove=function(t){this._map.fire(new Rr(t.type,this._map,t))},zr.prototype.mousedown=function(){this._delayContextMenu=!0},zr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},zr.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},zr.prototype.isEnabled=function(){return!0},zr.prototype.isActive=function(){return!1},zr.prototype.enable=function(){},zr.prototype.disable=function(){};var Br=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function jr(t,e){for(var n={},r=0;r<t.length;r++)n[t[r].identifier]=e[r];return n}Br.prototype.isEnabled=function(){return!!this._enabled},Br.prototype.isActive=function(){return!!this._active},Br.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Br.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Br.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(n.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Br.prototype.mousemoveWindow=function(t,e){if(this._active){var r=e;if(!(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=r,this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(i.x,r.x),a=Math.max(i.x,r.x),s=Math.min(i.y,r.y),u=Math.max(i.y,r.y);n.setTransform(this._box,"translate("+o+"px,"+s+"px)"),this._box.style.width=a-o+"px",this._box.style.height=u-s+"px"}}},Br.prototype.mouseupWindow=function(e,r){var i=this;if(this._active&&0===e.button){var o=this._startPos,a=r;if(this.reset(),n.suppressClick(),o.x!==a.x||o.y!==a.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,a,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Br.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Br.prototype.blur=function(){this.reset()},Br.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos},Br.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,{originalEvent:n}))};var Ur=function(t){this.reset(),this.numTouches=t.numTouches};Ur.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Ur.prototype.touchstart=function(e,n,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=function(e){for(var n=new t.Point(0,0),r=0,i=e;r<i.length;r+=1)n._add(i[r]);return n.div(e.length)}(n),this.touches=jr(r,n)))},Ur.prototype.touchmove=function(t,e,n){if(!this.aborted&&this.centroid){var r=jr(n,e);for(var i in this.touches){var o=r[i];(!o||o.dist(this.touches[i])>30)&&(this.aborted=!0)}}},Ur.prototype.touchend=function(t,e,n){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var Zr=function(t){this.singleTap=new Ur(t),this.numTaps=t.numTaps,this.reset()};Zr.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zr.prototype.touchstart=function(t,e,n){this.singleTap.touchstart(t,e,n)},Zr.prototype.touchmove=function(t,e,n){this.singleTap.touchmove(t,e,n)},Zr.prototype.touchend=function(t,e,n){var r=this.singleTap.touchend(t,e,n);if(r){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(r)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var Vr=function(){this._zoomIn=new Zr({numTouches:1,numTaps:2}),this._zoomOut=new Zr({numTouches:2,numTaps:1}),this.reset()};Vr.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vr.prototype.touchstart=function(t,e,n){this._zoomIn.touchstart(t,e,n),this._zoomOut.touchstart(t,e,n)},Vr.prototype.touchmove=function(t,e,n){this._zoomIn.touchmove(t,e,n),this._zoomOut.touchmove(t,e,n)},Vr.prototype.touchend=function(t,e,n){var r=this,i=this._zoomIn.touchend(t,e,n),o=this._zoomOut.touchend(t,e,n);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Vr.prototype.touchcancel=function(){this.reset()},Vr.prototype.enable=function(){this._enabled=!0},Vr.prototype.disable=function(){this._enabled=!1,this.reset()},Vr.prototype.isEnabled=function(){return this._enabled},Vr.prototype.isActive=function(){return this._active};var Gr={0:1,2:2},Hr=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Hr.prototype.blur=function(){this.reset()},Hr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Hr.prototype._correctButton=function(t,e){return!1},Hr.prototype._move=function(t,e){return{}},Hr.prototype.mousedown=function(t,e){if(!this._lastPoint){var r=n.mouseButton(t);this._correctButton(t,r)&&(this._lastPoint=e,this._eventButton=r)}},Hr.prototype.mousemoveWindow=function(t,e){var n=this._lastPoint;if(n)if(t.preventDefault(),function(t,e){var n=Gr[e];return void 0===t.buttons||(t.buttons&n)!==n}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(n,e)},Hr.prototype.mouseupWindow=function(t){this._lastPoint&&n.mouseButton(t)===this._eventButton&&(this._moved&&n.suppressClick(),this.reset())},Hr.prototype.enable=function(){this._enabled=!0},Hr.prototype.disable=function(){this._enabled=!1,this.reset()},Hr.prototype.isEnabled=function(){return this._enabled},Hr.prototype.isActive=function(){return this._active};var Wr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,n){t.prototype.mousedown.call(this,e,n),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}(Hr),qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var n=.8*(e.x-t.x);if(n)return this._active=!0,{bearingDelta:n}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Hr),Yr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var n=-.5*(e.y-t.y);if(n)return this._active=!0,{pitchDelta:n}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Hr),Xr=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Xr.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Xr.prototype.touchstart=function(t,e,n){return this._calculateTransform(t,e,n)},Xr.prototype.touchmove=function(t,e,n){if(this._active&&!(n.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,n)},Xr.prototype.touchend=function(t,e,n){this._calculateTransform(t,e,n),this._active&&n.length<this._minTouches&&this.reset()},Xr.prototype.touchcancel=function(){this.reset()},Xr.prototype._calculateTransform=function(e,n,r){r.length>0&&(this._active=!0);var i=jr(r,n),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var l=i[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,i[u]=l)}if(this._touches=i,!(s<this._minTouches)&&a.mag()){var h=a.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:h}}},Xr.prototype.enable=function(){this._enabled=!0},Xr.prototype.disable=function(){this._enabled=!1,this.reset()},Xr.prototype.isEnabled=function(){return this._enabled},Xr.prototype.isActive=function(){return this._active};var $r=function(){this.reset()};function Kr(t,e,n){for(var r=0;r<t.length;r++)if(t[r].identifier===n)return e[r]}function Jr(t,e){return Math.log(t/e)/Math.LN2}$r.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},$r.prototype._start=function(t){},$r.prototype._move=function(t,e,n){return{}},$r.prototype.touchstart=function(t,e,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([e[0],e[1]]))},$r.prototype.touchmove=function(t,e,n){if(this._firstTwoTouches){t.preventDefault();var r=this._firstTwoTouches,i=r[1],o=Kr(n,e,r[0]),a=Kr(n,e,i);if(o&&a){var s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}}},$r.prototype.touchend=function(t,e,r){if(this._firstTwoTouches){var i=this._firstTwoTouches,o=i[1],a=Kr(r,e,i[0]),s=Kr(r,e,o);a&&s||(this._active&&n.suppressClick(),this.reset())}},$r.prototype.touchcancel=function(){this.reset()},$r.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},$r.prototype.disable=function(){this._enabled=!1,this.reset()},$r.prototype.isEnabled=function(){return this._enabled},$r.prototype.isActive=function(){return this._active};var Qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 n=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Jr(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Jr(this._distance,n),pinchAround:e}},e}($r);function ti(t,e){return 180*t.angleWith(e)/Math.PI}var ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ti(this._vector,n),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,n=ti(t,this._startVector);return Math.abs(n)<e},e}($r);function ni(t){return Math.abs(t.y)>Math.abs(t.x)}var ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,n){var r=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,n){if(void 0!==this._valid)return this._valid;var r=t.mag()>=2,i=e.mag()>=2;if(r||i){if(!r||!i)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ni(t)&&ni(e)&&o}},e}($r),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.blur=function(){this.reset()},oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var n=0,r=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:n?Math.round(u)+n*(t.shiftKey?2:1):u,bearing:s.getBearing()+r*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var n=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.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 r=n.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:n.zoom,u=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&u&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=l(h);a=t.number(u,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var n=t.ease;if(this._prevEase){var r=this._prevEase,i=(t.browser.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);n=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:n},n},si.prototype.blur=function(){this.reset()},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var li=function(){this.reset()};li.prototype.reset=function(){this._active=!1},li.prototype.blur=function(){this.reset()},li.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(t.shiftKey?-1:1),around:n.unproject(e)},{originalEvent:t})}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ci=function(){this._tap=new Zr({numTouches:1,numTaps:1}),this.reset()};ci.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ci.prototype.touchstart=function(t,e,n){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=e[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(t,e,n))},ci.prototype.touchmove=function(t,e,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var r=e[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,n)},ci.prototype.touchend=function(t,e,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(t,e,n)&&(this._tapTime=t.timeStamp)},ci.prototype.touchcancel=function(){this.reset()},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var hi=function(t,e,n){this._el=t,this._mousePan=e,this._touchPan=n};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,n){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=n};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fi=function(t,e,n,r){this._el=t,this._touchZoom=e,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0};fi.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")},fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function gi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yi=function(e,r){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new kr(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r),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 o=0,a=this._listeners;o<a.length;o+=1){var s=a[o],u=s[0];n.addEventListener(u,s[1],u===t.window.document?this.handleWindowEvent:this.handleEvent,s[2])}};yi.prototype.destroy=function(){for(var e=0,r=this._listeners;e<r.length;e+=1){var i=r[e],o=i[0];n.removeEventListener(o,i[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,i[2])}},yi.prototype._addDefaultHandlers=function(t){var e=this._map,n=e.getCanvasContainer();this._add("mapEvent",new Fr(e,t));var r=e.boxZoom=new Br(e,t);this._add("boxZoom",r);var i=new Vr,o=new li;e.doubleClickZoom=new ui(o,i),this._add("tapZoom",i),this._add("clickZoom",o);var a=new ci;this._add("tapDragZoom",a);var s=e.touchPitch=new ri;this._add("touchPitch",s);var u=new qr(t),l=new Yr(t);e.dragRotate=new pi(t,u,l),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",l,["mouseRotate"]);var c=new Wr(t),h=new Xr(t);e.dragPan=new hi(n,c,h),this._add("mousePan",c),this._add("touchPan",h,["touchZoom","touchRotate"]);var p=new ei,f=new Qr;e.touchZoomRotate=new fi(n,f,p,a),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]);var d=e.scrollZoom=new si(e,this);this._add("scrollZoom",d,["mousePan"]);var m=e.keyboard=new oi;this._add("keyboard",m),this._add("blockableMapEvent",new zr(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])}},yi.prototype._add=function(t,e,n){this._handlers.push({handlerName:t,handler:e,allowed:n}),this._handlersById[t]=e},yi.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,n=this._handlers;e<n.length;e+=1)n[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},yi.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},yi.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},yi.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},yi.prototype.isMoving=function(){return Boolean(di(this._eventsInProgress))||this.isZooming()},yi.prototype._blockedByActive=function(t,e,n){for(var r in t)if(r!==n&&(!e||e.indexOf(r)<0))return!0;return!1},yi.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},yi.prototype._getMapTouches=function(t){for(var e=[],n=0,r=t;n<r.length;n+=1){var i=r[n];this._el.contains(i.target)&&e.push(i)}return e},yi.prototype.handleEvent=function(t,e){this._updatingCamera=!0;for(var r="renderFrame"===t.type?void 0:t,i={needsRenderFrame:!1},o={},a={},s=t.touches?this._getMapTouches(t.touches):void 0,u=s?n.touchPos(this._el,s):n.mousePos(this._el,t),l=0,c=this._handlers;l<c.length;l+=1){var h=c[l],p=h.handlerName,f=h.handler,d=h.allowed;if(f.isEnabled()){var m=void 0;this._blockedByActive(a,d,p)?f.reset():f[e||t.type]&&(m=f[e||t.type](t,u,s),this.mergeHandlerResult(i,o,m,p,r),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||f.isActive())&&(a[p]=f)}}var g={};for(var y in this._previousActiveHandlers)a[y]||(g[y]=r);this._previousActiveHandlers=a,(Object.keys(g).length||gi(i))&&(this._changes.push([i,o,g]),this._triggerRenderFrame()),(Object.keys(a).length||gi(i))&&this._map._stop(!0),this._updatingCamera=!1;var v=i.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],v(this._map))},yi.prototype.mergeHandlerResult=function(e,n,r,i,o){if(r){t.extend(e,r);var a={handlerName:i,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(n.zoom=a),void 0!==r.panDelta&&(n.drag=a),void 0!==r.pitchDelta&&(n.pitch=a),void 0!==r.bearingDelta&&(n.rotate=a)}},yi.prototype._applyChanges=function(){for(var e={},n={},r={},i=0,o=this._changes;i<o.length;i+=1){var a=o[i],s=a[0],u=a[1],l=a[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(n,u),t.extend(r,l)}this._updateMapTransform(e,n,r),this._changes=[]},yi.prototype._updateMapTransform=function(t,e,n){var r=this._map,i=r.transform;if(!gi(t))return this._fireEvents(e,n,!0);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,u=t.pitchDelta,l=t.around,c=t.pinchAround;void 0!==c&&(l=c),r._stop(!0),l=l||r.transform.centerPoint;var h=i.pointLocation(o?l.sub(o):l);s&&(i.bearing+=s),u&&(i.pitch+=u),a&&(i.zoom+=a),i.setLocationAtPoint(h,l),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,n,!0)},yi.prototype._fireEvents=function(e,n,r){var i=this,o=di(this._eventsInProgress),a=di(e),s={};for(var u in e)this._eventsInProgress[u]||(s[u+"start"]=e[u].originalEvent),this._eventsInProgress[u]=e[u];for(var l in!o&&a&&this._fireEvent("movestart",a.originalEvent),s)this._fireEvent(l,s[l]);for(var c in a&&this._fireEvent("move",a.originalEvent),e)this._fireEvent(c,e[c].originalEvent);var h,p={};for(var f in this._eventsInProgress){var d=this._eventsInProgress[f],m=d.handlerName,g=d.originalEvent;this._handlersById[m].isActive()||(delete this._eventsInProgress[f],p[f+"end"]=h=n[m]||g)}for(var y in p)this._fireEvent(y,p[y]);var v=di(this._eventsInProgress);if(r&&(o||a)&&!v){this._updatingCamera=!0;var _=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),b=function(t){return 0!==t&&-i._bearingSnap<t&&t<i._bearingSnap};_?(b(_.bearing||this._map.getBearing())&&(_.bearing=0),this._map.easeTo(_,{originalEvent:h})):(this._map.fire(new t.Event("moveend",{originalEvent:h})),b(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},yi.prototype._fireEvent=function(e,n){this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},yi.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new mi("renderFrame",{timeStamp:e})),t._applyChanges()}))},yi.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var vi=function(e){function n(n,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},n.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},n.prototype.panBy=function(e,n,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},n),r)},n.prototype.panTo=function(e,n,r){return this.easeTo(t.extend({center:e},n),r)},n.prototype.getZoom=function(){return this.transform.zoom},n.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},n.prototype.zoomTo=function(e,n,r){return this.easeTo(t.extend({zoom:e},n),r)},n.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},n.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},n.prototype.getBearing=function(){return this.transform.bearing},n.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},n.prototype.getPadding=function(){return this.transform.padding},n.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},n.prototype.rotateTo=function(e,n,r){return this.easeTo(t.extend({bearing:e},n),r)},n.prototype.resetNorth=function(e,n){return this.rotateTo(0,t.extend({duration:1e3},e),n),this},n.prototype.resetNorthPitch=function(e,n){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),n),this},n.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},n.prototype.getPitch=function(){return this.transform.pitch},n.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},n.prototype.cameraForBounds=function(e,n){e=t.LngLatBounds.convert(e);var r=n&&n.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,n)},n.prototype._cameraForBoxAndBearing=function(e,n,r,i){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var a=i.padding;i.padding={top:a,bottom:a,right:a,left:a}}i.padding=t.extend(o,i.padding);var s=this.transform,u=s.padding,l=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(n)),h=l.rotate(-r*Math.PI/180),p=c.rotate(-r*Math.PI/180),f=new t.Point(Math.max(h.x,p.x),Math.max(h.y,p.y)),d=new t.Point(Math.min(h.x,p.x),Math.min(h.y,p.y)),m=f.sub(d),g=(s.width-(u.left+u.right+i.padding.left+i.padding.right))/m.x,y=(s.height-(u.top+u.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),_="number"==typeof i.offset.x?new t.Point(i.offset.x,i.offset.y):t.Point.convert(i.offset),b=new t.Point((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(r*Math.PI/180),x=_.add(b).mult(s.scale/s.zoomScale(v));return{center:s.unproject(l.add(c).div(2).sub(x)),zoom:v,bearing:r}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},n.prototype.fitBounds=function(t,e,n){return this._fitInternal(this.cameraForBounds(t,e),e,n)},n.prototype.fitScreenCoordinates=function(e,n,r,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(n)),r,i),i,o)},n.prototype._fitInternal=function(e,n,r){return e?(delete(n=t.extend(e,n)).padding,n.linear?this.easeTo(n,r):this.flyTo(n,r)):this},n.prototype.jumpTo=function(e,n){this.stop();var r=this.transform,i=!1,o=!1,a=!1;return"zoom"in e&&r.zoom!==+e.zoom&&(i=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(o=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.pitch=+e.pitch),null==e.padding||r.isPaddingEqual(e.padding)||(r.padding=e.padding),this.fire(new t.Event("movestart",n)).fire(new t.Event("move",n)),i&&this.fire(new t.Event("zoomstart",n)).fire(new t.Event("zoom",n)).fire(new t.Event("zoomend",n)),o&&this.fire(new t.Event("rotatestart",n)).fire(new t.Event("rotate",n)).fire(new t.Event("rotateend",n)),a&&this.fire(new t.Event("pitchstart",n)).fire(new t.Event("pitch",n)).fire(new t.Event("pitchend",n)),this.fire(new t.Event("moveend",n))},n.prototype.easeTo=function(e,n){var r=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,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),l="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,h="pitch"in e?+e.pitch:s,p="padding"in e?e.padding:i.padding,f=t.Point.convert(e.offset),d=i.centerPoint.add(f),m=i.pointLocation(d),g=t.LngLat.convert(e.center||m);this._normalizeCenter(g);var y,v,_=i.project(m),b=i.project(g).sub(_),x=i.zoomScale(l-o);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||l!==o,this._rotating=this._rotating||a!==c,this._pitching=this._pitching||h!==s,this._padding=!i.isPaddingEqual(p),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,w),this._ease((function(e){if(r._zooming&&(i.zoom=t.number(o,l,e)),r._rotating&&(i.bearing=t.number(a,c,e)),r._pitching&&(i.pitch=t.number(s,h,e)),r._padding&&(i.interpolatePadding(u,p,e),d=i.centerPoint.add(f)),y)i.setLocationAtPoint(y,v);else{var m=i.zoomScale(i.zoom-o),g=l>o?Math.min(2,x):Math.max(.5,x),w=Math.pow(g,1-e),S=i.unproject(_.add(b.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?S.wrap():S,d)}r._fireMoveEvents(n)}),(function(t){r._afterEase(n,t)}),e),this},n.prototype._prepareEase=function(e,n,r){void 0===r&&(r={}),this._moving=!0,n||r.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!r.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new t.Event("pitchstart",e))},n.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))},n.prototype._afterEase=function(e,n){if(!this._easeId||!n||this._easeId!==n){delete this._easeId;var r=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},n.prototype.flyTo=function(e,n){var r=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:u,f="padding"in e?e.padding:o.padding,d=o.zoomScale(c-a),m=t.Point.convert(e.offset),g=o.centerPoint.add(m),y=o.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var _=o.project(y),b=o.project(v).sub(_),x=e.curve,w=Math.max(o.width,o.height),S=w/d,E=b.mag();if("minZoom"in e){var M=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),T=w/o.zoomScale(M-a);x=Math.sqrt(T/E*2)}var A=x*x;function C(t){var e=(S*S-w*w+(t?-1:1)*A*A*E*E)/(2*(t?S:w)*A*E);return Math.log(Math.sqrt(e*e+1)-e)}function O(t){return(Math.exp(t)-Math.exp(-t))/2}function P(t){return(Math.exp(t)+Math.exp(-t))/2}var k=C(0),L=function(t){return P(k)/P(k+x*t)},I=function(t){return w*((P(k)*(O(e=k+x*t)/P(e))-O(k))/A)/E;var e},R=(C(1)-k)/x;if(Math.abs(E)<1e-6||!isFinite(R)){if(Math.abs(w-S)<1e-6)return this.easeTo(e,n);var D=S<w?-1:1;R=Math.abs(Math.log(S/w))/x,I=function(){return 0},L=function(t){return Math.exp(D*x*t)}}return e.duration="duration"in e?+e.duration:1e3*R/("screenSpeed"in e?+e.screenSpeed/x:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==u,this._padding=!o.isPaddingEqual(f),this._prepareEase(n,!1),this._ease((function(e){var i=e*R,d=1/L(i);o.zoom=1===e?c:a+o.scaleZoom(d),r._rotating&&(o.bearing=t.number(s,h,e)),r._pitching&&(o.pitch=t.number(u,p,e)),r._padding&&(o.interpolatePadding(l,f,e),g=o.centerPoint.add(m));var y=1===e?v:o.unproject(_.add(b.mult(I(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?y.wrap():y,g),r._fireMoveEvents(n)}),(function(){return r._afterEase(n)}),e),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){return this._stop()},n.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,e)}if(!t){var r=this.handlers;r&&r.stop(!1)}return this},n.prototype._ease=function(e,n,r){!1===r.animate||0===r.duration?(e(1),n()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.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()},n.prototype._normalizeBearing=function(e,n){e=t.wrap(e,-180,180);var r=Math.abs(e-n);return Math.abs(e-360-n)<r&&(e-=360),Math.abs(e+360-n)<r&&(e+=360),e},n.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var n=t.lng-e.center.lng;t.lng+=n>180?-360:n<-180?360:0}},n}(t.Evented),_i=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};_i.prototype.getDefaultPosition=function(){return"bottom-right"},_i.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=n.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.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},_i.prototype.onRemove=function(){n.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},_i.prototype._setElementTitle=function(t,e){var n=this._map._getUIString("AttributionControl."+e);t.title=n,t.setAttribute("aria-label",n)},_i.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"))},_i.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var n=[{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 r=n.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<n.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},_i.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},_i.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 n=this._map.style.sourceCaches;for(var r in n){var i=n[r];if(i.used){var o=i.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,n){for(var r=n+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var bi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};bi.prototype.onAdd=function(t){this._map=t,this._container=n.create("div","mapboxgl-ctrl");var e=n.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},bi.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bi.prototype.getDefaultPosition=function(){return"bottom-left"},bi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},bi.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}},bi.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 xi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};xi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},xi.prototype.remove=function(t){for(var e=this._currentlyRunning,n=0,r=e?this._queue.concat(e):this._queue;n<r.length;n+=1){var i=r[n];if(i.id===t)return void(i.cancelled=!0)}},xi.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,r=e;n<r.length;n+=1){var i=r[n];if(!i.cancelled&&(i.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},xi.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var wi={"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"},Si=t.window.HTMLImageElement,Ei=t.window.HTMLElement,Mi=t.window.ImageBitmap,Ti={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},Ai=function(r){function i(e){var n=this;if(null!=(e=t.extend({},Ti,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 Sr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.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 xi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,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 Ei))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 n._update(!1)})),this.on("moveend",(function(){return n._update(!1)})),this.on("zoom",(function(){return n._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new yi(this,e),this._hash=e.hash&&new Mr("string"==typeof e.hash&&e.hash||void 0).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 _i({customAttribution:e.customAttribution})),this.addControl(new bi,e.logoPosition),this.on("style.load",(function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)})),this.on("data",(function(e){n._update("style"===e.dataType),n.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){n.fire(new t.Event(e.dataType+"dataloading",e))}))}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var o={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,n){if(void 0===n&&(n=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 r=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[n];return-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),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 n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var n=this._containerDimensions(),r=n[0],i=n[1];if(r===this.transform.width&&i===this.transform.height)return this;this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i);var o=!this._moving;return o&&this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>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,n){var r,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){var a=i.getLayer(e)?i.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?o||(o=!0,n.call(i,new Rr(t,i,r.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){(i.getLayer(e)?i.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,n.call(i,new Rr(t,i,r.originalEvent)))},mouseout:function(e){a&&(a=!1,n.call(i,new Rr(t,i,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(r={},r[t]=function(t){var r=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(i,t),delete t.features)},r)}},i.prototype.on=function(t,e,n){if(void 0===n)return r.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,n);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,n){if(void 0===n)return r.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,n);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,n){var i=this;return void 0===n?r.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(r){for(var o=r[t],a=0;a<o.length;a++){var s=o[a];if(s.layer===e&&s.listener===n){for(var u in s.delegates)i.off(u,s.delegates[u]);return o.splice(a,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(e,n){if(!this.style)return[];var r;if(void 0!==n||void 0===e||e instanceof t.Point||Array.isArray(e)||(n=e,e=void 0),n=n||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])r=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),o=t.Point.convert(e[1]);r=[i,new t.Point(o.x,i.y),o,new t.Point(i.x,o.y),i]}return this.style.queryRenderedFeatures(r,n,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,n){return!1!==(n=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(e,n))},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 Ve(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 Ve(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(e,n){var r=this;if("string"==typeof e){var i=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(o,(function(e,i){e?r.fire(new t.ErrorEvent(e)):i&&r._updateDiff(i,n)}))}else"object"==typeof e&&this._updateDiff(e,n)},i.prototype._updateDiff=function(e,n){try{this.style.setState(e)&&this._update(!0)}catch(r){t.warnOnce("Unable to perform style diff: "+(r.message||r.error||r)+". Rebuilding the style from scratch."),this._updateStyle(e,n)}},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 n=this.style&&this.style.sourceCaches[e];if(void 0!==n)return n.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 n=t[e]._tiles;for(var r in n){var i=n[r];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,n)},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,n,r){void 0===r&&(r={});var i=r.pixelRatio;void 0===i&&(i=1);var o=r.sdf;void 0===o&&(o=!1);var a=r.stretchX,s=r.stretchY,u=r.content;if(this._lazyInitEmptyStyle(),n instanceof Si||Mi&&n instanceof Mi){var l=t.browser.getImageData(n);this.style.addImage(e,{data:new t.RGBAImage({width:l.width,height:l.height},l.data),pixelRatio:i,stretchX:a,stretchY:s,content:u,sdf:o,version:0})}else{if(void 0===n.width||void 0===n.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 c=n;this.style.addImage(e,{data:new t.RGBAImage({width:n.width,height:n.height},new Uint8Array(n.data)),pixelRatio:i,stretchX:a,stretchY:s,content:u,sdf:o,version:0,userImage:c}),c.onAdd&&c.onAdd(this,e)}},i.prototype.updateImage=function(e,n){var r=this.style.getImage(e);if(!r)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=n instanceof Si||Mi&&n instanceof Mi?t.browser.getImageData(n):n,o=i.width,a=i.height,s=i.data;return void 0===o||void 0===a?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`"))):o!==r.data.width||a!==r.data.height?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"))):(r.data.replace(s,!(n instanceof Si||Mi&&n instanceof Mi)),void this.style.updateImage(e,r))},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,n){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),n)},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,n){return this.style.setLayerZoomRange(t,e,n),this._update(!0)},i.prototype.setFilter=function(t,e,n){return void 0===n&&(n={}),this.style.setFilter(t,e,n),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,n,r){return void 0===r&&(r={}),this.style.setPaintProperty(t,e,n,r),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,n,r){return void 0===r&&(r={}),this.style.setLayoutProperty(t,e,n,r),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=n.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=n.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=n.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 r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=this._controlContainer=n.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=n.create("div","mapboxgl-ctrl-"+t,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(e,n){var r=t.browser.devicePixelRatio||1;this._canvas.width=r*e,this._canvas.height=r*n,this._canvas.style.width=e+"px",this._canvas.style.height=n+"px"},i.prototype._setupPainter=function(){var n=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",n)||this._canvas.getContext("experimental-webgl",n);r?(this.painter=new _r(r,this.transform),t.webpSupported.testSupport(r)):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 n,r=this,i=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(n=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,n),i=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,u=t.browser.now();this.style.zoomHistory.update(s,u);var l=new t.EvaluationParameters(s,{now:u,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=l.crossFadingFactor();1===c&&c===this._crossFadingFactor||(a=!0,this._crossFadingFactor=c),this.style.update(l)}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()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-i;o.endQueryEXT(o.TIME_ELAPSED_EXT,n),setTimeout((function(){var e=o.getQueryObjectEXT(n,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(n),r.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var p=this.painter.collectGpuTimers();setTimeout((function(){var e=r.painter.queryGpuTimers(p);r.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var f=this._sourcesDirty||this._styleDirty||this._placementDirty;return f||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||f||(this._fullyLoaded=!0),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,n=this._controls;e<n.length;e+=1)n[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Ci(this._canvasContainer),Ci(this._controlContainer),Ci(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()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,n){t.setCacheLimits(e,n)},o.version.get=function(){return t.version},Object.defineProperties(i.prototype,o),i}(vi);function Ci(t){t.parentNode&&t.parentNode.removeChild(t)}var Oi={showCompass:!0,showZoom:!0,visualizePitch:!1},Pi=function(e){var r=this;this.options=t.extend({},Oi,e),this._container=n.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 r._map.zoomIn({},{originalEvent:t})})),n.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return r._map.zoomOut({},{originalEvent:t})})),n.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){r.options.visualizePitch?r._map.resetNorthPitch({},{originalEvent:t}):r._map.resetNorth({},{originalEvent:t})})),this._compassIcon=n.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Pi.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),n=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},Pi.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},Pi.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 ki(this._map,this._compass,this.options.visualizePitch)),this._container},Pi.prototype.onRemove=function(){n.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},Pi.prototype._createButton=function(t,e){var r=n.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},Pi.prototype._setButtonTitle=function(t,e){var n=this._map._getUIString("NavigationControl."+e);t.title=n,t.setAttribute("aria-label",n)};var ki=function(e,r,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=r,this.mouseRotate=new qr({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,i&&(this.mousePitch=new Yr({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener(r,"mousedown",this.mousedown),n.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(r,"touchmove",this.touchmove),n.addEventListener(r,"touchend",this.touchend),n.addEventListener(r,"touchcancel",this.reset)};function Li(e,n,r){if(e=new t.LngLat(e.lng,e.lat),n){var i=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=r.locationPoint(e).distSqr(n);r.locationPoint(i).distSqr(n)<a?e=i:r.locationPoint(o).distSqr(n)<a&&(e=o)}for(;Math.abs(e.lng-r.center.lng)>180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e}ki.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),n.disableDrag()},ki.prototype.move=function(t,e){var n=this.map,r=this.mouseRotate.mousemoveWindow(t,e);if(r&&r.bearingDelta&&n.setBearing(n.getBearing()+r.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&n.setPitch(n.getPitch()+i.pitchDelta)}},ki.prototype.off=function(){var t=this.element;n.removeEventListener(t,"mousedown",this.mousedown),n.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(t,"touchmove",this.touchmove),n.removeEventListener(t,"touchend",this.touchend),n.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},ki.prototype.offTemp=function(){n.enableDrag(),n.removeEventListener(t.window,"mousemove",this.mousemove),n.removeEventListener(t.window,"mouseup",this.mouseup)},ki.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),n.mousePos(this.element,e)),n.addEventListener(t.window,"mousemove",this.mousemove),n.addEventListener(t.window,"mouseup",this.mouseup)},ki.prototype.mousemove=function(t){this.move(t,n.mousePos(this.element,t))},ki.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},ki.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},ki.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},ki.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},ki.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Ii={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 Ri(t,e,n){var r=t.classList;for(var i in Ii)r.remove("mapboxgl-"+n+"-anchor-"+i);r.add("mapboxgl-"+n+"-anchor-"+e)}var Di,Ni=function(e){function r(r,i){if(e.call(this),(r instanceof t.window.HTMLElement||i)&&(r=t.extend({element:r},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&"auto"!==r.pitchAlignment?r.pitchAlignment:this._rotationAlignment,r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div"),this._element.setAttribute("aria-label","Map marker");var o=n.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var a=n.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");var s=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var u=n.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(3.0, 29.0)"),u.setAttributeNS(null,"fill","#000000");for(var l=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];l<c.length;l+=1){var h=c[l],p=n.createNS("http://www.w3.org/2000/svg","ellipse");p.setAttributeNS(null,"opacity","0.04"),p.setAttributeNS(null,"cx","10.5"),p.setAttributeNS(null,"cy","5.80029008"),p.setAttributeNS(null,"rx",h.rx),p.setAttributeNS(null,"ry",h.ry),u.appendChild(p)}var f=n.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var d=n.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"),f.appendChild(d);var m=n.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=n.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=n.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=n.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=n.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var b=n.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),v.appendChild(_),v.appendChild(b),s.appendChild(u),s.appendChild(f),s.appendChild(m),s.appendChild(y),s.appendChild(v),o.appendChild(s),o.setAttributeNS(null,"height",41*this._scale+"px"),o.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(o),this._offset=t.Point.convert(r&&r.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()})),Ri(this._element,this._anchor,"marker"),this._popup=null}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.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},r.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),n.remove(this._element),this._popup&&this._popup.remove(),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.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=Math.sqrt(Math.pow(13.5,2)/2);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._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},r.prototype._onKeyPress=function(t){var e=t.code,n=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==n&&13!==n||this.togglePopup()},r.prototype._onMapClick=function(t){var e=t.originalEvent.target,n=this._element;this._popup&&(e===n||n.contains(e))&&this.togglePopup()},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},r.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Li(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 r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),n.setTransform(this._element,Ii[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+r+" "+e)}},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},r.prototype._onMove=function(e){if(!this._isDragging){var n=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=n}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")))},r.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"},r.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))},r.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},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(t.Evented),Fi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},zi=0,Bi=!1,ji=function(e){function r(n){e.call(this),this.options=t.extend({},Fi,n),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==Di?r(Di):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){r(Di="denied"!==t.state)})):r(Di=!!t.window.navigator.geolocation),this._container},r.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(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,zi=0,Bi=!1},r.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),n=t.coords;return e&&(n.longitude<e.getWest()||n.longitude>e.getEast()||n.latitude<e.getSouth()||n.latitude>e.getNorth())},r.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")}},r.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()}},r.prototype._updateCamera=function(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),o,{geolocateSource:!0})},r.prototype._updateMarker=function(e){if(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},r.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),n=this._map.unproject([1,t]),r=e.distanceTo(n),i=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},r.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 n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Bi)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()}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(e){var r=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=n.create("button","mapboxgl-ctrl-geolocate",this._container),n.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 o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ni(this._dotElement),this._circleElement=n.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ni({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){e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")))}))},r.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":zi--,Bi=!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"),++zi>1?(e={maximumAge:6e5,timeout:0},Bi=!0):(e=this.options.positionOptions,Bi=!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},r.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)},r}(t.Evented),Ui={maxWidth:100,unit:"metric"},Zi=function(e){this.options=t.extend({},Ui,e),t.bindAll(["_onMove","setUnit"],this)};function Vi(t,e,n){var r=n&&n.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([r,i]),s=o.distanceTo(a);if(n&&"imperial"===n.unit){var u=3.2808*s;u>5280?Gi(e,r,u/5280,t._getUIString("ScaleControl.Miles")):Gi(e,r,u,t._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?Gi(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Gi(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,r,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,n,r){var i,o,a,s=(i=n,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/n)+"px",t.innerHTML=s+" "+r}Zi.prototype.getDefaultPosition=function(){return"bottom-left"},Zi.prototype._onMove=function(){Vi(this._map,this._container,this.options)},Zi.prototype.onAdd=function(t){return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Zi.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Zi.prototype.setUnit=function(t){this.options.unit=t,Vi(this._map,this._container,this.options)};var Hi=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")};Hi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.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},Hi.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Hi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Hi.prototype._setupUI=function(){var e=this._fullscreenButton=n.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);n.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)},Hi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Hi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Hi.prototype._isFullscreen=function(){return this._fullscreen},Hi.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())},Hi.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 Wi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},qi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Yi=function(e){function r(n){e.call(this),this.options=t.extend(Object.create(Wi),n),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.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},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.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},r.prototype.getLngLat=function(){return this._lngLat},r.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},r.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},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var n,r=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},r.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},r.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},r.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},r.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},r.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=n.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},r.prototype._onMouseUp=function(t){this._update(t.point)},r.prototype._onMouseMove=function(t){this._update(t.point)},r.prototype._onDrag=function(t){this._update(t.point)},r.prototype._update=function(e){var r=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=n.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=n.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return r._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=Li(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(n){if(n){if("number"==typeof n){var r=Math.round(Math.sqrt(.5*Math.pow(n,2)));return{center:new t.Point(0,0),top:new t.Point(0,n),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-n),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(n,0),right:new t.Point(-n,0)}}if(n instanceof t.Point||Array.isArray(n)){var i=t.Point.convert(n);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(n.center||[0,0]),top:t.Point.convert(n.top||[0,0]),"top-left":t.Point.convert(n["top-left"]||[0,0]),"top-right":t.Point.convert(n["top-right"]||[0,0]),bottom:t.Point.convert(n.bottom||[0,0]),"bottom-left":t.Point.convert(n["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(n["bottom-right"]||[0,0]),left:t.Point.convert(n.left||[0,0]),right:t.Point.convert(n.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+a.bottom.y<l?["top"]:i.y>this._map.transform.height-l?["bottom"]:[],i.x<u/2?s.push("left"):i.x>this._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=i.add(a[o]).round();n.setTransform(this._container,Ii[o]+" translate("+c.x+"px,"+c.y+"px)"),Ri(this._container,o,"popup")}},r.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(qi);t&&t.focus()}},r.prototype._onClose=function(){this.remove()},r}(t.Evented),Xi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ai,NavigationControl:Pi,GeolocateControl:ji,AttributionControl:_i,ScaleControl:Zi,FullscreenControl:Hi,Popup:Yi,Marker:Ni,Style:Ve,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){zt().acquire(Rt)},clearPrewarmedResources:function(){var t=Nt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Nt=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 Dt.workerCount},set workerCount(t){Dt.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 Xi})),n}()},3358:t=>{t.exports=function(t){!function(t){if(!t)throw new Error("Eventify cannot use falsy object as events subject");for(var e=["on","fire","off"],n=0;n<e.length;++n)if(t.hasOwnProperty(e[n]))throw new Error("Subject cannot be eventified, since it already has property '"+e[n]+"'")}(t);var e=function(t){var e=Object.create(null);return{on:function(n,r,i){if("function"!=typeof r)throw new Error("callback is expected to be a function");var o=e[n];return o||(o=e[n]=[]),o.push({callback:r,ctx:i}),t},off:function(n,r){if(void 0===n)return e=Object.create(null),t;if(e[n])if("function"!=typeof r)delete e[n];else for(var i=e[n],o=0;o<i.length;++o)i[o].callback===r&&i.splice(o,1);return t},fire:function(n){var r,i=e[n];if(!i)return t;arguments.length>1&&(r=Array.prototype.splice.call(arguments,1));for(var o=0;o<i.length;++o){var a=i[o];a.callback.apply(a.ctx,r)}return t}}}(t);return t.on=e.on,t.off=e.off,t.fire=e.fire,t}},201:(t,e,n)=>{t.exports=function(t,e){if(!t)throw new Error("Graph structure cannot be undefined");var o=(e&&e.createSimulator||n(9931))(e);if(Array.isArray(e))throw new Error("Physics settings is expected to be an object");var a=t.version>19?function(e){var n=t.getLinks(e);return n?1+n.size/3:1}:function(e){var n=t.getLinks(e);return n?1+n.length/3:1};e&&"function"==typeof e.nodeMass&&(a=e.nodeMass);var s=new Map,u={},l=0,c=o.settings.springTransform||i;l=0,t.forEachNode((function(t){g(t.id),l+=1})),t.forEachLink(y),t.on("changed",m);var h=!1,p={step:function(){if(0===l)return f(!0),!0;var t=o.step();p.lastMove=t,p.fire("step");var e=t/l<=.01;return f(e),e},getNodePosition:function(t){return b(t).pos},setNodePosition:function(t){var e=b(t);e.setPosition.apply(e,Array.prototype.slice.call(arguments,1))},getLinkPosition:function(t){var e=u[t];if(e)return{from:e.from.pos,to:e.to.pos}},getGraphRect:function(){return o.getBBox()},forEachBody:d,pinNode:function(t,e){b(t.id).isPinned=!!e},isNodePinned:function(t){return b(t.id).isPinned},dispose:function(){t.off("changed",m),p.fire("disposed")},getBody:function(t){return s.get(t)},getSpring:function(e,n){var r;if(void 0===n)r="object"!=typeof e?e:e.id;else{var i=t.hasLink(e,n);if(!i)return;r=i.id}return u[r]},getForceVectorLength:function(){var t=0,e=0;return d((function(n){t+=Math.abs(n.force.x),e+=Math.abs(n.force.y)})),Math.sqrt(t*t+e*e)},simulator:o,graph:t,lastMove:0};return r(p),p;function f(t){var e;h!==t&&(h=t,e=t,p.fire("stable",e))}function d(t){s.forEach(t)}function m(e){for(var n=0;n<e.length;++n){var r=e[n];"add"===r.changeType?(r.node&&g(r.node.id),r.link&&y(r.link)):"remove"===r.changeType&&(r.node&&(i=r.node,a=void 0,u=void 0,a=i.id,(u=s.get(a))&&(s.delete(a),o.removeBody(u))),r.link&&v(r.link))}var i,a,u;l=t.getNodesCount()}function g(e){var n=s.get(e);if(!n){var r=t.getNode(e);if(!r)throw new Error("initBody() was called with unknown node id");var i=r.position;if(!i){var a=function(t){var e=[];if(!t.links)return e;for(var n=Math.min(t.links.length,2),r=0;r<n;++r){var i=t.links[r],o=i.fromId!==t.id?s.get(i.fromId):s.get(i.toId);o&&o.pos&&e.push(o)}return e}(r);i=o.getBestNewBodyPosition(a)}(n=o.addBodyAt(i)).id=e,s.set(e,n),_(e),function(t){return t&&(t.isPinned||t.data&&t.data.isPinned)}(r)&&(n.isPinned=!0)}}function y(t){_(t.fromId),_(t.toId);var e=s.get(t.fromId),n=s.get(t.toId),r=o.addSpring(e,n,t.length);c(t,r),u[t.id]=r}function v(e){var n=u[e.id];if(n){var r=t.getNode(e.fromId),i=t.getNode(e.toId);r&&_(r.id),i&&_(i.id),delete u[e.id],o.removeSpring(n)}}function _(t){var e=s.get(t);if(e.mass=a(t),Number.isNaN(e.mass))throw new Error("Node mass should be a number")}function b(t){var e=s.get(t);return e||(g(t),e=s.get(t)),e}},t.exports.simulator=n(9931);var r=n(3358);function i(){}},8135:(t,e,n)=>{const r=n(8418);t.exports=function(t){return function(e,n){let i=n&&n.indent||0,o=n&&void 0!==n.join?n.join:"\n",a=Array(i+1).join(" "),s=[];for(let n=0;n<t;++n){let t=r(n),i=0===n?"":a;s.push(i+e.replace(/{var}/g,t))}return s.join(o)}}},8392:(t,e,n)=>{t.exports=function(t){let e=i(t);return new Function("bodies","settings","random",e)},t.exports.generateFunctionBody=i;const r=n(8135);function i(t){let e=r(t);return`\n var boundingBox = {\n ${e("min_{var}: 0, max_{var}: 0,",{indent:4})}\n };\n\n return {\n box: boundingBox,\n\n update: updateBoundingBox,\n\n reset: resetBoundingBox,\n\n getBestNewPosition: function (neighbors) {\n var ${e("base_{var} = 0",{join:", "})};\n\n if (neighbors.length) {\n for (var i = 0; i < neighbors.length; ++i) {\n let neighborPos = neighbors[i].pos;\n ${e("base_{var} += neighborPos.{var};",{indent:10})}\n }\n\n ${e("base_{var} /= neighbors.length;",{indent:8})}\n } else {\n ${e("base_{var} = (boundingBox.min_{var} + boundingBox.max_{var}) / 2;",{indent:8})}\n }\n\n var springLength = settings.springLength;\n return {\n ${e("{var}: base_{var} + (random.nextDouble() - 0.5) * springLength,",{indent:8})}\n };\n }\n };\n\n function updateBoundingBox() {\n var i = bodies.length;\n if (i === 0) return; // No bodies - no borders.\n\n ${e("var max_{var} = -Infinity;",{indent:4})}\n ${e("var min_{var} = Infinity;",{indent:4})}\n\n while(i--) {\n // this is O(n), it could be done faster with quadtree, if we check the root node bounds\n var bodyPos = bodies[i].pos;\n ${e("if (bodyPos.{var} < min_{var}) min_{var} = bodyPos.{var};",{indent:6})}\n ${e("if (bodyPos.{var} > max_{var}) max_{var} = bodyPos.{var};",{indent:6})}\n }\n\n ${e("boundingBox.min_{var} = min_{var};",{indent:4})}\n ${e("boundingBox.max_{var} = max_{var};",{indent:4})}\n }\n\n function resetBoundingBox() {\n ${e("boundingBox.min_{var} = boundingBox.max_{var} = 0;",{indent:4})}\n }\n`}},6928:(t,e,n)=>{const r=n(8135);function i(t,e){return`\n${a(t,e)}\n${o(t)}\nreturn {Body: Body, Vector: Vector};\n`}function o(t){let e=r(t),n=e("{var}",{join:", "});return`\nfunction Body(${n}) {\n this.isPinned = false;\n this.pos = new Vector(${n});\n this.force = new Vector();\n this.velocity = new Vector();\n this.mass = 1;\n\n this.springCount = 0;\n this.springLength = 0;\n}\n\nBody.prototype.reset = function() {\n this.force.reset();\n this.springCount = 0;\n this.springLength = 0;\n}\n\nBody.prototype.setPosition = function (${n}) {\n ${e("this.pos.{var} = {var} || 0;",{indent:2})}\n};`}function a(t,e){let n=r(t),i="";return e&&(i=`${n("\n var v{var};\nObject.defineProperty(this, '{var}', {\n set: function(v) { \n if (!Number.isFinite(v)) throw new Error('Cannot set non-numbers to {var}');\n v{var} = v; \n },\n get: function() { return v{var}; }\n});")}`),`function Vector(${n("{var}",{join:", "})}) {\n ${i}\n if (typeof arguments[0] === 'object') {\n // could be another vector\n let v = arguments[0];\n ${n('if (!Number.isFinite(v.{var})) throw new Error("Expected value is not a finite number at Vector constructor ({var})");',{indent:4})}\n ${n("this.{var} = v.{var};",{indent:4})}\n } else {\n ${n('this.{var} = typeof {var} === "number" ? {var} : 0;',{indent:4})}\n }\n }\n \n Vector.prototype.reset = function () {\n ${n("this.{var} = ",{join:""})}0;\n };`}t.exports=function(t,e){let n=i(t,e),{Body:r}=new Function(n)();return r},t.exports.generateCreateBodyFunctionBody=i,t.exports.getVectorCode=a,t.exports.getBodyCode=o},2054:(t,e,n)=>{const r=n(8135);function i(t){return`\n if (!Number.isFinite(options.dragCoefficient)) throw new Error('dragCoefficient is not a finite number');\n\n return {\n update: function(body) {\n ${r(t)("body.force.{var} -= options.dragCoefficient * body.velocity.{var};",{indent:6})}\n }\n };\n`}t.exports=function(t){let e=i(t);return new Function("options",e)},t.exports.generateCreateDragForceFunctionBody=i},8237:(t,e,n)=>{const r=n(8135);function i(t){let e=r(t);return`\n if (!Number.isFinite(options.springCoefficient)) throw new Error('Spring coefficient is not a number');\n if (!Number.isFinite(options.springLength)) throw new Error('Spring length is not a number');\n\n return {\n /**\n * Updates forces acting on a spring\n */\n update: function (spring) {\n var body1 = spring.from;\n var body2 = spring.to;\n var length = spring.length < 0 ? options.springLength : spring.length;\n ${e("var d{var} = body2.pos.{var} - body1.pos.{var};",{indent:6})}\n var r = Math.sqrt(${e("d{var} * d{var}",{join:" + "})});\n\n if (r === 0) {\n ${e("d{var} = (random.nextDouble() - 0.5) / 50;",{indent:8})}\n r = Math.sqrt(${e("d{var} * d{var}",{join:" + "})});\n }\n\n var d = r - length;\n var coefficient = ((spring.coefficient > 0) ? spring.coefficient : options.springCoefficient) * d / r;\n\n ${e("body1.force.{var} += coefficient * d{var}",{indent:6})};\n body1.springCount += 1;\n body1.springLength += r;\n\n ${e("body2.force.{var} -= coefficient * d{var}",{indent:6})};\n body2.springCount += 1;\n body2.springLength += r;\n }\n };\n`}t.exports=function(t){let e=i(t);return new Function("options","random",e)},t.exports.generateCreateSpringForceFunctionBody=i},6851:(t,e,n)=>{const r=n(8135);function i(t){let e=r(t);return`\n var length = bodies.length;\n if (length === 0) return 0;\n\n ${e("var d{var} = 0, t{var} = 0;",{indent:2})}\n\n for (var i = 0; i < length; ++i) {\n var body = bodies[i];\n if (body.isPinned) continue;\n\n if (adaptiveTimeStepWeight && body.springCount) {\n timeStep = (adaptiveTimeStepWeight * body.springLength/body.springCount);\n }\n\n var coeff = timeStep / body.mass;\n\n ${e("body.velocity.{var} += coeff * body.force.{var};",{indent:4})}\n ${e("var v{var} = body.velocity.{var};",{indent:4})}\n var v = Math.sqrt(${e("v{var} * v{var}",{join:" + "})});\n\n if (v > 1) {\n // We normalize it so that we move within timeStep range. \n // for the case when v <= 1 - we let velocity to fade out.\n ${e("body.velocity.{var} = v{var} / v;",{indent:6})}\n }\n\n ${e("d{var} = timeStep * body.velocity.{var};",{indent:4})}\n\n ${e("body.pos.{var} += d{var};",{indent:4})}\n\n ${e("t{var} += Math.abs(d{var});",{indent:4})}\n }\n\n return (${e("t{var} * t{var}",{join:" + "})})/length;\n`}t.exports=function(t){let e=i(t);return new Function("bodies","timeStep","adaptiveTimeStepWeight",e)},t.exports.generateIntegratorFunctionBody=i},9905:(t,e,n)=>{const r=n(8135),i=n(8418);function o(t){let e=r(t),n=Math.pow(2,t);return`\n\n/**\n * Our implementation of QuadTree is non-recursive to avoid GC hit\n * This data structure represent stack of elements\n * which we are trying to insert into quad tree.\n */\nfunction InsertStack () {\n this.stack = [];\n this.popIdx = 0;\n}\n\nInsertStack.prototype = {\n isEmpty: function() {\n return this.popIdx === 0;\n },\n push: function (node, body) {\n var item = this.stack[this.popIdx];\n if (!item) {\n // we are trying to avoid memory pressure: create new element\n // only when absolutely necessary\n this.stack[this.popIdx] = new InsertStackElement(node, body);\n } else {\n item.node = node;\n item.body = body;\n }\n ++this.popIdx;\n },\n pop: function () {\n if (this.popIdx > 0) {\n return this.stack[--this.popIdx];\n }\n },\n reset: function () {\n this.popIdx = 0;\n }\n};\n\nfunction InsertStackElement(node, body) {\n this.node = node; // QuadTree node\n this.body = body; // physical body which needs to be inserted to node\n}\n\n${l(t)}\n${a(t)}\n${u(t)}\n${s(t)}\n\nfunction createQuadTree(options, random) {\n options = options || {};\n options.gravity = typeof options.gravity === 'number' ? options.gravity : -1;\n options.theta = typeof options.theta === 'number' ? options.theta : 0.8;\n\n var gravity = options.gravity;\n var updateQueue = [];\n var insertStack = new InsertStack();\n var theta = options.theta;\n\n var nodesCache = [];\n var currentInCache = 0;\n var root = newNode();\n\n return {\n insertBodies: insertBodies,\n\n /**\n * Gets root node if it is present\n */\n getRoot: function() {\n return root;\n },\n\n updateBodyForce: update,\n\n options: function(newOptions) {\n if (newOptions) {\n if (typeof newOptions.gravity === 'number') {\n gravity = newOptions.gravity;\n }\n if (typeof newOptions.theta === 'number') {\n theta = newOptions.theta;\n }\n\n return this;\n }\n\n return {\n gravity: gravity,\n theta: theta\n };\n }\n };\n\n function newNode() {\n // To avoid pressure on GC we reuse nodes.\n var node = nodesCache[currentInCache];\n if (node) {\n${function(t){let e=[];for(let t=0;t<n;++t)e.push(` node.quad${t} = null;`);return e.join("\n")}()}\n node.body = null;\n node.mass = ${e("node.mass_{var} = ",{join:""})}0;\n ${e("node.min_{var} = node.max_{var} = ",{join:""})}0;\n } else {\n node = new QuadNode();\n nodesCache[currentInCache] = node;\n }\n\n ++currentInCache;\n return node;\n }\n\n function update(sourceBody) {\n var queue = updateQueue;\n var v;\n ${e("var d{var};",{indent:4})}\n var r; \n ${e("var f{var} = 0;",{indent:4})}\n var queueLength = 1;\n var shiftIdx = 0;\n var pushIdx = 1;\n\n queue[0] = root;\n\n while (queueLength) {\n var node = queue[shiftIdx];\n var body = node.body;\n\n queueLength -= 1;\n shiftIdx += 1;\n var differentBody = (body !== sourceBody);\n if (body && differentBody) {\n // If the current node is a leaf node (and it is not source body),\n // calculate the force exerted by the current node on body, and add this\n // amount to body's net force.\n ${e("d{var} = body.pos.{var} - sourceBody.pos.{var};",{indent:8})}\n r = Math.sqrt(${e("d{var} * d{var}",{join:" + "})});\n\n if (r === 0) {\n // Poor man's protection against zero distance.\n ${e("d{var} = (random.nextDouble() - 0.5) / 50;",{indent:10})}\n r = Math.sqrt(${e("d{var} * d{var}",{join:" + "})});\n }\n\n // This is standard gravitation force calculation but we divide\n // by r^3 to save two operations when normalizing force vector.\n v = gravity * body.mass * sourceBody.mass / (r * r * r);\n ${e("f{var} += v * d{var};",{indent:8})}\n } else if (differentBody) {\n // Otherwise, calculate the ratio s / r, where s is the width of the region\n // represented by the internal node, and r is the distance between the body\n // and the node's center-of-mass\n ${e("d{var} = node.mass_{var} / node.mass - sourceBody.pos.{var};",{indent:8})}\n r = Math.sqrt(${e("d{var} * d{var}",{join:" + "})});\n\n if (r === 0) {\n // Sorry about code duplication. I don't want to create many functions\n // right away. Just want to see performance first.\n ${e("d{var} = (random.nextDouble() - 0.5) / 50;",{indent:10})}\n r = Math.sqrt(${e("d{var} * d{var}",{join:" + "})});\n }\n // If s / r < θ, treat this internal node as a single body, and calculate the\n // force it exerts on sourceBody, and add this amount to sourceBody's net force.\n if ((node.max_${i(0)} - node.min_${i(0)}) / r < theta) {\n // in the if statement above we consider node's width only\n // because the region was made into square during tree creation.\n // Thus there is no difference between using width or height.\n v = gravity * node.mass * sourceBody.mass / (r * r * r);\n ${e("f{var} += v * d{var};",{indent:10})}\n } else {\n // Otherwise, run the procedure recursively on each of the current node's children.\n\n // I intentionally unfolded this loop, to save several CPU cycles.\n${function(){let t=Array(11).join(" "),e=[];for(let r=0;r<n;++r)e.push(t+`if (node.quad${r}) {`),e.push(t+` queue[pushIdx] = node.quad${r};`),e.push(t+" queueLength += 1;"),e.push(t+" pushIdx += 1;"),e.push(t+"}");return e.join("\n")}()}\n }\n }\n }\n\n ${e("sourceBody.force.{var} += f{var};",{indent:4})}\n }\n\n function insertBodies(bodies) {\n ${e("var {var}min = Number.MAX_VALUE;",{indent:4})}\n ${e("var {var}max = Number.MIN_VALUE;",{indent:4})}\n var i = bodies.length;\n\n // To reduce quad tree depth we are looking for exact bounding box of all particles.\n while (i--) {\n var pos = bodies[i].pos;\n ${e("if (pos.{var} < {var}min) {var}min = pos.{var};",{indent:6})}\n ${e("if (pos.{var} > {var}max) {var}max = pos.{var};",{indent:6})}\n }\n\n // Makes the bounds square.\n var maxSideLength = -Infinity;\n ${e("if ({var}max - {var}min > maxSideLength) maxSideLength = {var}max - {var}min ;",{indent:4})}\n\n currentInCache = 0;\n root = newNode();\n ${e("root.min_{var} = {var}min;",{indent:4})}\n ${e("root.max_{var} = {var}min + maxSideLength;",{indent:4})}\n\n i = bodies.length - 1;\n if (i >= 0) {\n root.body = bodies[i];\n }\n while (i--) {\n insert(bodies[i], root);\n }\n }\n\n function insert(newBody) {\n insertStack.reset();\n insertStack.push(root, newBody);\n\n while (!insertStack.isEmpty()) {\n var stackItem = insertStack.pop();\n var node = stackItem.node;\n var body = stackItem.body;\n\n if (!node.body) {\n // This is internal node. Update the total mass of the node and center-of-mass.\n ${e("var {var} = body.pos.{var};",{indent:8})}\n node.mass += body.mass;\n ${e("node.mass_{var} += body.mass * {var};",{indent:8})}\n\n // Recursively insert the body in the appropriate quadrant.\n // But first find the appropriate quadrant.\n var quadIdx = 0; // Assume we are in the 0's quad.\n ${e("var min_{var} = node.min_{var};",{indent:8})}\n ${e("var max_{var} = (min_{var} + node.max_{var}) / 2;",{indent:8})}\n\n${function(e){let n=[],r=Array(9).join(" ");for(let e=0;e<t;++e)n.push(r+`if (${i(e)} > max_${i(e)}) {`),n.push(r+` quadIdx = quadIdx + ${Math.pow(2,e)};`),n.push(r+` min_${i(e)} = max_${i(e)};`),n.push(r+` max_${i(e)} = node.max_${i(e)};`),n.push(r+"}");return n.join("\n")}()}\n\n var child = getChild(node, quadIdx);\n\n if (!child) {\n // The node is internal but this quadrant is not taken. Add\n // subnode to it.\n child = newNode();\n ${e("child.min_{var} = min_{var};",{indent:10})}\n ${e("child.max_{var} = max_{var};",{indent:10})}\n child.body = body;\n\n setChild(node, quadIdx, child);\n } else {\n // continue searching in this quadrant.\n insertStack.push(child, body);\n }\n } else {\n // We are trying to add to the leaf node.\n // We have to convert current leaf into internal node\n // and continue adding two nodes.\n var oldBody = node.body;\n node.body = null; // internal nodes do not cary bodies\n\n if (isSamePosition(oldBody.pos, body.pos)) {\n // Prevent infinite subdivision by bumping one node\n // anywhere in this quadrant\n var retriesCount = 3;\n do {\n var offset = random.nextDouble();\n ${e("var d{var} = (node.max_{var} - node.min_{var}) * offset;",{indent:12})}\n\n ${e("oldBody.pos.{var} = node.min_{var} + d{var};",{indent:12})}\n retriesCount -= 1;\n // Make sure we don't bump it out of the box. If we do, next iteration should fix it\n } while (retriesCount > 0 && isSamePosition(oldBody.pos, body.pos));\n\n if (retriesCount === 0 && isSamePosition(oldBody.pos, body.pos)) {\n // This is very bad, we ran out of precision.\n // if we do not return from the method we'll get into\n // infinite loop here. So we sacrifice correctness of layout, and keep the app running\n // Next layout iteration should get larger bounding box in the first step and fix this\n return;\n }\n }\n // Next iteration should subdivide node further.\n insertStack.push(node, oldBody);\n insertStack.push(node, body);\n }\n }\n }\n}\nreturn createQuadTree;\n\n`}function a(t){let e=r(t);return`\n function isSamePosition(point1, point2) {\n ${e("var d{var} = Math.abs(point1.{var} - point2.{var});",{indent:2})}\n \n return ${e("d{var} < 1e-8",{join:" && "})};\n } \n`}function s(t){var e=Math.pow(2,t);return`\nfunction setChild(node, idx, child) {\n ${function(){let t=[];for(let n=0;n<e;++n){let e=0===n?" ":" else ";t.push(`${e}if (idx === ${n}) node.quad${n} = child;`)}return t.join("\n")}()}\n}`}function u(t){return`function getChild(node, idx) {\n${function(){let e=[],n=Math.pow(2,t);for(let t=0;t<n;++t)e.push(` if (idx === ${t}) return node.quad${t};`);return e.join("\n")}()}\n return null;\n}`}function l(t){let e=r(t),n=Math.pow(2,t);return`\nfunction QuadNode() {\n // body stored inside this node. In quad tree only leaf nodes (by construction)\n // contain bodies:\n this.body = null;\n\n // Child nodes are stored in quads. Each quad is presented by number:\n // 0 | 1\n // -----\n // 2 | 3\n${function(t){let e=[];for(let t=0;t<n;++t)e.push(` this.quad${t} = null;`);return e.join("\n")}()}\n\n // Total mass of current node\n this.mass = 0;\n\n // Center of mass coordinates\n ${e("this.mass_{var} = 0;",{indent:2})}\n\n // bounding box coordinates\n ${e("this.min_{var} = 0;",{indent:2})}\n ${e("this.max_{var} = 0;",{indent:2})}\n}\n`}function c(){return"\n/**\n * Our implementation of QuadTree is non-recursive to avoid GC hit\n * This data structure represent stack of elements\n * which we are trying to insert into quad tree.\n */\nfunction InsertStack () {\n this.stack = [];\n this.popIdx = 0;\n}\n\nInsertStack.prototype = {\n isEmpty: function() {\n return this.popIdx === 0;\n },\n push: function (node, body) {\n var item = this.stack[this.popIdx];\n if (!item) {\n // we are trying to avoid memory pressure: create new element\n // only when absolutely necessary\n this.stack[this.popIdx] = new InsertStackElement(node, body);\n } else {\n item.node = node;\n item.body = body;\n }\n ++this.popIdx;\n },\n pop: function () {\n if (this.popIdx > 0) {\n return this.stack[--this.popIdx];\n }\n },\n reset: function () {\n this.popIdx = 0;\n }\n};\n\nfunction InsertStackElement(node, body) {\n this.node = node; // QuadTree node\n this.body = body; // physical body which needs to be inserted to node\n}\n"}t.exports=function(t){let e=o(t);return new Function(e)()},t.exports.generateQuadTreeFunctionBody=o,t.exports.getInsertStackCode=c,t.exports.getQuadNodeCode=l,t.exports.isSamePosition=a,t.exports.getChildBodyCode=u,t.exports.setChildBodyCode=s},8418:t=>{t.exports=function(t){return 0===t?"x":1===t?"y":2===t?"z":"c"+(t+1)}},9931:(t,e,n)=>{t.exports=function(t){var e=n(8443),h=n(8103),p=n(3358);if(t){if(void 0!==t.springCoeff)throw new Error("springCoeff was renamed to springCoefficient");if(void 0!==t.dragCoeff)throw new Error("dragCoeff was renamed to dragCoefficient")}t=h(t,{springLength:10,springCoefficient:.8,gravity:-12,theta:.8,dragCoefficient:.9,timeStep:.5,adaptiveTimeStepWeight:0,dimensions:2,debug:!1});var f=l[t.dimensions];if(!f){var d=t.dimensions;f={Body:r(d,t.debug),createQuadTree:i(d),createBounds:o(d),createDragForce:a(d),createSpringForce:s(d),integrate:u(d)},l[d]=f}var m=f.Body,g=f.createQuadTree,y=f.createBounds,v=f.createDragForce,_=f.createSpringForce,b=f.integrate,x=n(6171).random(42),w=[],S=[],E=g(t,x),M=y(w,t,x),T=_(t,x),A=v(t),C=[],O=new Map,P=0;I("nbody",(function(){if(0!==w.length){E.insertBodies(w);for(var t=w.length;t--;){var e=w[t];e.isPinned||(e.reset(),E.updateBodyForce(e),A.update(e))}}})),I("spring",(function(){for(var t=S.length;t--;)T.update(S[t])}));var k={bodies:w,quadTree:E,springs:S,settings:t,addForce:I,removeForce:function(t){var e=C.indexOf(O.get(t));e<0||(C.splice(e,1),O.delete(t))},getForces:function(){return O},step:function(){for(var e=0;e<C.length;++e)C[e](P);var n=b(w,t.timeStep,t.adaptiveTimeStepWeight);return P+=1,n},addBody:function(t){if(!t)throw new Error("Body is required");return w.push(t),t},addBodyAt:function(t){if(!t)throw new Error("Body position is required");var e=(t=>new m(t))(t);return w.push(e),e},removeBody:function(t){if(t){var e=w.indexOf(t);if(!(e<0))return w.splice(e,1),0===w.length&&M.reset(),!0}},addSpring:function(t,n,r,i){if(!t||!n)throw new Error("Cannot add null spring to force simulator");"number"!=typeof r&&(r=-1);var o=new e(t,n,r,i>=0?i:-1);return S.push(o),o},getTotalMovement:function(){return 0},removeSpring:function(t){if(t){var e=S.indexOf(t);return e>-1?(S.splice(e,1),!0):void 0}},getBestNewBodyPosition:function(t){return M.getBestNewPosition(t)},getBBox:L,getBoundingBox:L,invalidateBBox:function(){console.warn("invalidateBBox() is deprecated, bounds always recomputed on `getBBox()` call")},gravity:function(e){return void 0!==e?(t.gravity=e,E.options({gravity:e}),this):t.gravity},theta:function(e){return void 0!==e?(t.theta=e,E.options({theta:e}),this):t.theta},random:x};return function(t,e){for(var n in t)c(t,e,n)}(t,k),p(k),k;function L(){return M.update(),M.box}function I(t,e){if(O.has(t))throw new Error("Force "+t+" is already added");O.set(t,e),C.push(e)}};var r=n(6928),i=n(9905),o=n(8392),a=n(2054),s=n(8237),u=n(6851),l={};function c(t,e,n){if(t.hasOwnProperty(n)&&"function"!=typeof e[n]){var r=Number.isFinite(t[n]);e[n]=r?function(r){if(void 0!==r){if(!Number.isFinite(r))throw new Error("Value of "+n+" should be a valid number.");return t[n]=r,e}return t[n]}:function(r){return void 0!==r?(t[n]=r,e):t[n]}}}},8443:t=>{t.exports=function(t,e,n,r){this.from=t,this.to=e,this.length=n,this.coefficient=r}},7322:(t,e,n)=>{t.exports=function(t){if("uniqueLinkId"in(t=t||{})&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n","\n","Note: there is also change in default behavior: From now on each graph\nis considered to be not a multigraph by default (each edge is unique)."),t.multigraph=t.uniqueLinkId),void 0===t.multigraph&&(t.multigraph=!1),"function"!=typeof Map)throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var e,n=new Map,u=new Map,l={},c=0,h=t.multigraph?function(t,e,n){var r=s(t,e),i=l.hasOwnProperty(r);if(i||T(t,e)){i||(l[r]=0);var o="@"+ ++l[r];r=s(t+o,e+o)}return new a(t,e,n,r)}:function(t,e,n){var r=s(t,e),i=u.get(r);return i?(i.data=n,i):new a(t,e,n,r)},p=[],f=A,d=A,m=A,g=A,y={version:20,addNode:b,addLink:function(t,e,n){m();var r=x(t)||b(t),i=x(e)||b(e),a=h(t,e,n),s=u.has(a.id);return u.set(a.id,a),o(r,a),t!==e&&o(i,a),f(a,s?"update":"add"),g(),a},removeLink:function(t,e){return void 0!==e&&(t=T(t,e)),M(t)},removeNode:w,getNode:x,getNodeCount:S,getLinkCount:E,getEdgeCount:E,getLinksCount:E,getNodesCount:S,getLinks:function(t){var e=x(t);return e?e.links:null},forEachNode:P,forEachLinkedNode:function(t,e,r){var i=x(t);if(i&&i.links&&"function"==typeof e)return r?function(t,e,r){for(var i=t.values(),o=i.next();!o.done;){var a=o.value;if(a.fromId===e&&r(n.get(a.toId),a))return!0;o=i.next()}}(i.links,t,e):function(t,e,r){for(var i=t.values(),o=i.next();!o.done;){var a=o.value,s=a.fromId===e?a.toId:a.fromId;if(r(n.get(s),a))return!0;o=i.next()}}(i.links,t,e)},forEachLink:function(t){if("function"==typeof t)for(var e=u.values(),n=e.next();!n.done;){if(t(n.value))return!0;n=e.next()}},beginUpdate:m,endUpdate:g,clear:function(){m(),P((function(t){w(t.id)})),g()},hasLink:T,hasNode:x,getLink:T};return r(y),e=y.on,y.on=function(){return y.beginUpdate=m=C,y.endUpdate=g=O,f=v,d=_,y.on=e,e.apply(y,arguments)},y;function v(t,e){p.push({link:t,changeType:e})}function _(t,e){p.push({node:t,changeType:e})}function b(t,e){if(void 0===t)throw new Error("Invalid node identifier");m();var r=x(t);return r?(r.data=e,d(r,"update")):(r=new i(t,e),d(r,"add")),n.set(t,r),g(),r}function x(t){return n.get(t)}function w(t){var e=x(t);if(!e)return!1;m();var r=e.links;return r&&(r.forEach(M),e.links=null),n.delete(t),d(e,"remove"),g(),!0}function S(){return n.size}function E(){return u.size}function M(t){if(!t)return!1;if(!u.get(t.id))return!1;m(),u.delete(t.id);var e=x(t.fromId),n=x(t.toId);return e&&e.links.delete(t),n&&n.links.delete(t),f(t,"remove"),g(),!0}function T(t,e){if(void 0!==t&&void 0!==e)return u.get(s(t,e))}function A(){}function C(){c+=1}function O(){0==(c-=1)&&p.length>0&&(y.fire("changed",p),p.length=0)}function P(t){if("function"!=typeof t)throw new Error("Function is expected to iterate over graph nodes. You passed "+t);for(var e=n.values(),r=e.next();!r.done;){if(t(r.value))return!0;r=e.next()}}};var r=n(3358);function i(t,e){this.id=t,this.links=null,this.data=e}function o(t,e){t.links?t.links.add(e):t.links=new Set([e])}function a(t,e,n,r){this.fromId=t,this.toId=e,this.data=n,this.id=r}function s(t,e){return t.toString()+"👉 "+e.toString()}},8103:t=>{t.exports=function t(e,n){var r;if(e||(e={}),n)for(r in n)if(n.hasOwnProperty(r)){var i=e.hasOwnProperty(r),o=typeof n[r];i&&typeof e[r]===o?"object"===o&&(e[r]=t(e[r],n[r])):e[r]=n[r]}return e}},6171:t=>{function e(t){return new n("number"==typeof t?t:+new Date)}function n(t){this.seed=t}function r(t){return Math.sqrt(2*Math.PI/t)*Math.pow(1/Math.E*(t+1/(12*t-1/(10*t))),t)}function i(){var t=this.seed;return t=4294967295&(3042594569^(t=4251993797+(t=4294967295&(3550635116+(t=374761393+(t=4294967295&(3345072700^(t=t+2127912214+(t<<12)&4294967295)^t>>>19))+(t<<5)&4294967295)^t<<9))+(t<<3)&4294967295)^t>>>16),this.seed=t,(268435455&t)/268435456}t.exports=e,t.exports.random=e,t.exports.randomIterator=function(t,n){var r=n||e();if("function"!=typeof r.next)throw new Error("customRandom does not match expected API: next() function is missing");return{forEach:function(e){var n,i,o;for(n=t.length-1;n>0;--n)i=r.next(n+1),o=t[i],t[i]=t[n],t[n]=o,e(o);t.length&&e(t[0])},shuffle:function(){var e,n,i;for(e=t.length-1;e>0;--e)n=r.next(e+1),i=t[n],t[n]=t[e],t[e]=i;return t}}},n.prototype.next=function(t){return Math.floor(this.nextDouble()*t)},n.prototype.nextDouble=i,n.prototype.uniform=i,n.prototype.gaussian=function(){var t,e,n;do{t=(e=2*this.nextDouble()-1)*e+(n=2*this.nextDouble()-1)*n}while(t>=1||0===t);return e*Math.sqrt(-2*Math.log(t)/t)},n.prototype.levy=function(){var t=1.5,e=Math.pow(r(2.5)*Math.sin(Math.PI*t/2)/(r(1.25)*t*Math.pow(2,.25)),1/t);return this.gaussian()*e/Math.pow(Math.abs(this.gaussian()),1/t)}},2458:t=>{"use strict";var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.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={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,i){for(var o,a,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),u=1;u<arguments.length;u++){for(var l in o=Object(arguments[u]))n.call(o,l)&&(s[l]=o[l]);if(e){a=e(o);for(var c=0;c<a.length;c++)r.call(o,a[c])&&(s[a[c]]=o[a[c]])}}return s}},6434:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,n){return 0===t&&0===n?1/t==1/n:t===n||!(!e(t)||!e(n))}},2641:(t,e,n)=>{"use strict";var r=n(6648),i=n(5592),o=n(6434),a=n(5669),s=n(9525),u=i(a(),Object);r(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},5669:(t,e,n)=>{"use strict";var r=n(6434);t.exports=function(){return"function"==typeof Object.is?Object.is:r}},9525:(t,e,n)=>{"use strict";var r=n(5669),i=n(6648);t.exports=function(){var t=r();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},3032:(t,e,n)=>{"use strict";var r;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=n(9473),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===o.call(t),r=a(t),s=e&&"[object String]"===o.call(t),p=[];if(!e&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var d=l&&n;if(s&&t.length>0&&!i.call(t,0))for(var m=0;m<t.length;++m)p.push(String(m));if(r&&t.length>0)for(var g=0;g<t.length;++g)p.push(String(g));else for(var y in t)d&&"prototype"===y||!i.call(t,y)||p.push(String(y));if(u)for(var v=function(t){if("undefined"==typeof window||!f)return h(t);try{return h(t)}catch(t){return!1}}(t),_=0;_<c.length;++_)v&&"constructor"===c[_]||!i.call(t,c[_])||p.push(c[_]);return p}}t.exports=r},3571:(t,e,n)=>{"use strict";var r=Array.prototype.slice,i=n(9473),o=Object.keys,a=o?function(t){return o(t)}:n(3032),s=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 i(t)?s(r.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},9473:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var n=e.call(t),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),r}},997:(t,e,n)=>{"use strict";t.exports=i;var r=n(7164);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o=4294967296,a=1/o,s="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function u(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function l(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function c(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function h(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function y(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function v(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function _(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function b(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function x(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function w(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=w(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=b(this.buf,this.pos)+b(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=b(this.buf,this.pos)+w(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return l(t,r,e);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return l(t,r,e);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return l(t,r,e);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return l(t,r,e);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return l(t,r,e);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return l(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&s?function(t,e,n){return s.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",i=e;i<n;){var o,a,s,u=t[i],l=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c>n)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=c}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*a),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&c(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&c(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,i.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},635:t=>{"use strict";var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}},6311:(t,e,n)=>{"use strict";var r=Math.log(2),i=t.exports,o=n(635);function a(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return i.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,r=!1,i=o.isNumber(e.width)?e.width:2,a=o.isNumber(e.size)?e.size:50,s=o.isNumber(e.min)?e.min:(n=!0,o.findMinMulti(t)),u=o.isNumber(e.max)?e.max:(r=!0,o.findMaxMulti(t)),l=(u-s)/(a-1);return n&&(s-=2*i*l),r&&(u+=2*i*l),{min:s,max:u}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var n=o.isNumber(e.size)?e.size:50,r=o.isNumber(e.width)?e.width:2,s=i.getUnifiedMinMax(t,{size:n,width:r,min:e.min,max:e.max}),u=s.min,l=s.max-u,c=l/(n-1);if(0===l)return[{x:u,y:1}];for(var h=[],p=0;p<n;p++)h.push({x:u+p*c,y:0});var f=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(a,r),d=f[r],m=f[r-1]-f[r-2],g=0;t.forEach((function(t){var e=function(t){return Math.floor((t-u)/c)}(t);if(!(e+r<0||e-r>=h.length)){var n=Math.max(e-r,0),i=e,a=Math.min(e+r,h.length-1),s=n-(e-r),l=e+r-a,p=f[-r-1+s]||0,y=f[-r-1+l]||0,v=d/(d-p-y);s>0&&(g+=v*(s-1)*m);var _=Math.max(0,e-r+1);o.inside(0,h.length-1,_)&&(h[_].y+=1*v*m),o.inside(0,h.length-1,i+1)&&(h[i+1].y-=2*v*m),o.inside(0,h.length-1,a+1)&&(h[a+1].y+=1*v*m)}}));var y=g,v=0,_=0;return h.forEach((function(t){v+=t.y,y+=v,t.y=y,_+=y})),_>0&&h.forEach((function(t){t.y/=_})),h},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){var n=Math.log(t.y);isFinite(n)&&(e+=t.y*n)})),e=-e/r,Math.pow(2,e)}}},2980:t=>{t.exports=function(t,e,n,r){var i=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var s=(r-n)/2,u=0,l=s-1;u<s;l=u++){var c=e[n+2*u+0],h=e[n+2*u+1],p=e[n+2*l+0],f=e[n+2*l+1];h>o!=f>o&&i<(p-c)*(o-h)/(f-h)+c&&(a=!a)}return a}},1807:(t,e,n)=>{var r=n(2980),i=n(375);t.exports=function(t,e,n,o){return e.length>0&&Array.isArray(e[0])?i(t,e,n,o):r(t,e,n,o)},t.exports.nested=i,t.exports.flat=r},375:t=>{t.exports=function(t,e,n,r){var i=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var s=r-n,u=0,l=s-1;u<s;l=u++){var c=e[u+n][0],h=e[u+n][1],p=e[l+n][0],f=e[l+n][1];h>o!=f>o&&i<(p-c)*(o-h)/(f-h)+c&&(a=!a)}return a}},7516:function(t,e,n){var r=n(3656);t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}var i=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function o(t,e){return t>e?1:t<e?-1:0}function a(t,e,n){for(var r=new i(null,null),o=r,a=r;;){var s=n(t,e.key);if(s<0){if(null===e.left)break;if(n(t,e.left.key)<0){var u=e.left;if(e.left=u.right,u.right=e,null===(e=u).left)break}a.left=e,a=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(n(t,e.right.key)>0&&(u=e.right,e.right=u.left,u.left=e,null===(e=u).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,a.left=e.right,e.left=r.right,e.right=r.left,e}function s(t,e,n,r){var o=new i(t,e);if(null===n)return o.left=o.right=null,o;var s=r(t,(n=a(t,n,r)).key);return s<0?(o.left=n.left,o.right=n,n.left=null):s>=0&&(o.right=n.right,o.left=n,n.right=null),o}function u(t,e,n){var r=null,i=null;if(e){var o=n((e=a(t,e,n)).key,t);0===o?(r=e.left,i=e.right):o<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function l(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&l(t.left,o,!1,r,i),t.right&&l(t.right,o,!0,r,i)}}var c=function(){function t(t){void 0===t&&(t=o),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=s(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new i(t,e);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=a(t,this._root,r),s=r(t,o.key);return 0===s?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r;return null===e?null:0===n(t,(e=a(t,e,n)).key)?(null===e.left?r=e.right:(r=a(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=a(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=a(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&n.call(r,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,n=[],r=!1,o=new i(null,null),a=o;!r;)e?(n.push(e),e=e.left):n.length>0?e=(e=a=a.next=n.pop()).right:r=!0;return a.next=null,o.next}(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,o=this._comparator;if(n&&f(t,e,0,r-1,o),null===this._root)this._root=h(t,e,0,r),this._size=r;else{var a=function(t,e,n){for(var r=new i(null,null),o=r,a=t,s=e;null!==a&&null!==s;)n(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),r.next}(this.toList(),function(t,e){for(var n=new i(null,null),r=n,o=0;o<t.length;o++)r=r.next=new i(t[o],e[o]);return r.next=null,n.next}(t,e),o);r=this._size+r,this._root=p({head:a},0,r)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return l(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,n){var r=this._comparator,i=u(t,this._root,r),o=i.left,l=i.right;r(t,e)<0?l=s(e,n,l,r):o=s(e,n,o,r),this._root=function(t,e,n){return null===e?t:(null===t||((e=a(t.key,e,n)).left=t),e)}(o,l,r)},t.prototype.split=function(t){return u(t,this._root,this._comparator)},t}();function h(t,e,n,r){var o=r-n;if(o>0){var a=n+Math.floor(o/2),s=t[a],u=e[a],l=new i(s,u);return l.left=h(t,e,n,a),l.right=h(t,e,a+1,r),l}return null}function p(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=p(t,e,i),a=t.head;return a.left=o,t.head=t.head.next,a.right=p(t,i+1,n),a}return null}function f(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],a=n-1,s=r+1;;){do{a++}while(i(t[a],o)<0);do{s--}while(i(t[s],o)>0);if(a>=s)break;var u=t[a];t[a]=t[s],t[s]=u,u=e[a],e[a]=e[s],e[s]=u}f(t,e,n,s,i),f(t,e,s+1,r,i)}}var d=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},m=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},g=Number.EPSILON;void 0===g&&(g=Math.pow(2,-52));var y=g*g,v=function(t,e){if(-g<t&&t<g&&-g<e&&e<g)return 0;var n=t-e;return n*n<y*t*e?0:t<e?-1:1},_=function(){function e(){t(this,e),this.reset()}return n(e,[{key:"reset",value:function(){this.xRounder=new b,this.yRounder=new b}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),e}(),b=function(){function e(){t(this,e),this.tree=new c,this.round(0)}return n(e,[{key:"round",value:function(t){var e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===v(e.key,n.key))return this.tree.remove(t),n.key;var r=this.tree.next(e);return null!==r&&0===v(e.key,r.key)?(this.tree.remove(t),r.key):t}}]),e}(),x=new _,w=function(t,e){return t.x*e.y-t.y*e.x},S=function(t,e){return t.x*e.x+t.y*e.y},E=function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y},o=w(r,i);return v(o,0)},M=function(t){return Math.sqrt(S(t,t))},T=function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return S(i,r)/M(i)/M(r)},A=function(t,e,n){return 0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},C=function(t,e,n){return 0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},O=function(){function e(n,r){t(this,e),void 0===n.events?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=r}return n(e,null,[{key:"compare",value:function(t,n){var r=e.comparePoints(t.point,n.point);return 0!==r?r:(t.point!==n.point&&t.link(n),t.isLeft!==n.isLeft?t.isLeft?1:-1:k.compare(t.segment,n.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),n(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n<r;n++){var i=e[n];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var n=this.point.events[e];if(void 0===n.segment.consumedBy)for(var r=e+1;r<t;r++){var i=this.point.events[r];void 0===i.consumedBy&&n.otherSE.point.events===i.otherSE.point.events&&n.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,n=this.point.events.length;e<n;e++){var r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,n=new Map,r=function(r){var i,o,a,s,u,l=r.otherSE;n.set(r,{sine:(i=e.point,o=t.point,a=l.point,s={x:o.x-i.x,y:o.y-i.y},u={x:a.x-i.x,y:a.y-i.y},w(u,s)/M(u)/M(s)),cosine:T(e.point,t.point,l.point)})};return function(t,e){n.has(t)||r(t),n.has(e)||r(e);var i=n.get(t),o=i.sine,a=i.cosine,s=n.get(e),u=s.sine,l=s.cosine;return o>=0&&u>=0?a<l?1:a>l?-1:0:o<0&&u<0?a<l?-1:a>l?1:0:u<o?-1:u>o?1:0}}}]),e}(),P=0,k=function(){function e(n,r,i,o){t(this,e),this.id=++P,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=o}return n(e,null,[{key:"compare",value:function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n<r){if(s<a&&s<u)return 1;if(s>a&&s>u)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n>r){if(a<s&&a<l)return-1;if(a>s&&a>l)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(i<o){var d=e.comparePoint(t.rightSE.point);if(0!==d)return d}if(i>o){var m=t.comparePoint(e.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(i!==o){var g=u-a,y=i-n,v=l-s,_=o-r;if(g>y&&v<_)return 1;if(g<y&&v>_)return-1}return i>o?1:i<o||u<l?-1:u>l?1:t.id<e.id?-1:t.id>e.id?1:0}}]),n(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;var i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;var a=(t.x-e.x)/r.x,s=e.y+a*r.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),n=t.bbox(),r=m(e,n);if(null===r)return null;var i=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,u=d(e,a)&&0===this.comparePoint(a),l=d(n,i)&&0===t.comparePoint(i),c=d(e,s)&&0===this.comparePoint(s),h=d(n,o)&&0===t.comparePoint(o);if(l&&u)return h&&!c?o:!h&&c?s:null;if(l)return c&&i.x===s.x&&i.y===s.y?null:i;if(u)return h&&o.x===a.x&&o.y===a.y?null:a;if(h&&c)return null;if(h)return o;if(c)return s;var p=function(t,e,n,r){if(0===e.x)return C(n,r,t.x);if(0===r.x)return C(t,e,n.x);if(0===e.y)return A(n,r,t.y);if(0===r.y)return A(t,e,n.y);var i=w(e,r);if(0==i)return null;var o={x:n.x-t.x,y:n.y-t.y},a=w(o,e)/i,s=w(o,r)/i;return{x:(t.x+s*e.x+(n.x+a*r.x))/2,y:(t.y+s*e.y+(n.y+a*r.y))/2}}(i,this.vector(),a,t.vector());return null===p?null:d(r,p)?x.round(p.x,p.y):null}},{key:"split",value:function(t){var n=[],r=void 0!==t.events,i=new O(t,!0),o=new O(t,!1),a=this.rightSE;this.replaceRightSE(o),n.push(o),n.push(i);var s=new e(i,a,this.rings.slice(),this.windings.slice());return O.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),O.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}},{key:"consume",value:function(t){for(var n=this,r=t;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=e.compare(n,r);if(0!==i){if(i>0){var o=n;n=r,r=o}if(n.prev===r){var a=n;n=r,r=a}for(var s=0,u=r.rings.length;s<u;s++){var l=r.rings[s],c=r.windings[s],h=n.rings.indexOf(l);-1===h?(n.rings.push(l),n.windings.push(c)):n.windings[h]+=c}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys,i=0,o=this.rings.length;i<o;i++){var a=this.rings[i],s=this.windings[i],u=e.indexOf(a);-1===u?(e.push(a),n.push(s)):n[u]+=s}for(var l=[],c=[],h=0,p=e.length;h<p;h++)if(0!==n[h]){var f=e[h],d=f.poly;if(-1===c.indexOf(d))if(f.isExterior)l.push(d);else{-1===c.indexOf(d)&&c.push(d);var m=l.indexOf(f.poly);-1!==m&&l.splice(m,1)}}for(var g=0,y=l.length;g<y;g++){var v=l[g].multiPoly;-1===r.indexOf(v)&&r.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(U.type){case"union":var n=0===t.length,r=0===e.length;this._isInResult=n!==r;break;case"intersection":var i,o;t.length<e.length?(i=t.length,o=e.length):(i=e.length,o=t.length),this._isInResult=o===U.numMultiPolys&&i<o;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(U.type))}return this._isInResult}}],[{key:"fromRing",value:function(t,n,r){var i,o,a,s=O.comparePoints(t,n);if(s<0)i=t,o=n,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=n,o=t,a=-1}return new e(new O(i,!0),new O(o,!1),[r],[a])}}]),e}(),L=function(){function e(n,r,i){if(t(this,e),!Array.isArray(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!=typeof n[0][0]||"number"!=typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=x.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,u=n.length;s<u;s++){if("number"!=typeof n[s][0]||"number"!=typeof n[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=x.round(n[s][0],n[s][1]);l.x===a.x&&l.y===a.y||(this.segments.push(k.fromRing(a,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),a=l)}o.x===a.x&&o.y===a.y||this.segments.push(k.fromRing(a,o,this))}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.segments.length;e<n;e++){var r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}}]),e}(),I=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new L(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,o=n.length;i<o;i++){var a=new L(n[i],this,!1);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=r}return n(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;e<n;e++)for(var r=this.interiorRings[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}]),e}(),R=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof n[0][0][0]&&(n=[n])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,o=n.length;i<o;i++){var a=new I(n[i],this);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=r}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++)for(var r=this.polys[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}]),e}(),D=function(){function e(n){t(this,e),this.events=n;for(var r=0,i=n.length;r<i;r++)n[r].segment.ringOut=this;this.poly=null}return n(e,null,[{key:"factory",value:function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];if(o.isInResult()&&!o.ringOut){for(var a=null,s=o.leftSE,u=o.rightSE,l=[s],c=s.point,h=[];a=s,s=u,l.push(s),s.point!==c;)for(;;){var p=s.getAvailableLinkedEvents();if(0===p.length){var f=l[0].point,d=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(f.x,",")+" ".concat(f.y,"]. Last matching segment found ends at")+" [".concat(d.x,", ").concat(d.y,"]."))}if(1===p.length){u=p[0].otherSE;break}for(var m=null,g=0,y=h.length;g<y;g++)if(h[g].point===s.point){m=g;break}if(null===m){h.push({index:l.length,point:s.point});var v=s.getLeftmostComparator(a);u=p.sort(v)[0].otherSE;break}var _=h.splice(m)[0],b=l.splice(_.index);b.unshift(b[0].otherSE),n.push(new e(b.reverse()))}n.push(new e(l))}}return n}}]),n(e,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point,o=this.events[n+1].point;0!==E(i,t,o)&&(e.push(i),t=i)}if(1===e.length)return null;var a=e[0],s=e[1];0===E(a,t,s)&&e.shift(),e.push(e[0]);for(var u=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:e.length-1,c=this.isExteriorRing()?e.length:-1,h=[],p=l;p!=c;p+=u)h.push([e[p].x,e[p].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,n=this.events.length;e<n;e++){var r=this.events[e];O.compare(t,r)>0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),e}(),N=function(){function e(n){t(this,e),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return n(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e<n;e++){var r=this.interiorRings[e].getGeom();null!==r&&t.push(r)}return t}}]),e}(),F=function(){function e(n){t(this,e),this.rings=n,this.polys=this._composePolys(n)}return n(e,[{key:"getGeom",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++){var r=this.polys[e].getGeom();null!==r&&t.push(r)}return t}},{key:"_composePolys",value:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];if(!i.poly)if(i.isExteriorRing())e.push(new N(i));else{var o=i.enclosingRing();o.poly||e.push(new N(o)),o.poly.addInterior(i)}}return e}}]),e}(),z=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.compare;t(this,e),this.queue=n,this.tree=new c(r),this.segments=[]}return n(e,[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var l=a.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!a.isAnEndpoint(l)))for(var c=this._splitSafely(a,l),h=0,p=c.length;h<p;h++)n.push(c[h])}var f=null;if(s){var d=s.getIntersection(e);if(null!==d&&(e.isAnEndpoint(d)||(f=d),!s.isAnEndpoint(d)))for(var m=this._splitSafely(s,d),g=0,y=m.length;g<y;g++)n.push(m[g])}if(null!==u||null!==f){var v;v=null===u?f:null===f||O.comparePoints(u,f)<=0?u:f,this.queue.remove(e.rightSE),n.push(e.rightSE);for(var _=e.split(v),b=0,x=_.length;b<x;b++)n.push(_[b])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var w=a.getIntersection(s);if(null!==w){if(!a.isAnEndpoint(w))for(var S=this._splitSafely(a,w),E=0,M=S.length;E<M;E++)n.push(S[E]);if(!s.isAnEndpoint(w))for(var T=this._splitSafely(s,w),A=0,C=T.length;A<C;A++)n.push(T[A])}}this.tree.remove(e)}return n}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var n=t.rightSE;this.queue.remove(n);var r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.insert(t),r}}]),e}(),B=void 0!==r&&r.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,j=void 0!==r&&r.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,U=new(function(){function e(){t(this,e)}return n(e,[{key:"run",value:function(t,e,n){U.type=t,x.reset();for(var r=[new R(e,!0)],i=0,o=n.length;i<o;i++)r.push(new R(n[i],!1));if(U.numMultiPolys=r.length,"difference"===U.type)for(var a=r[0],s=1;s<r.length;)null!==m(r[s].bbox,a.bbox)?s++:r.splice(s,1);if("intersection"===U.type)for(var u=0,l=r.length;u<l;u++)for(var h=r[u],p=u+1,f=r.length;p<f;p++)if(null===m(h.bbox,r[p].bbox))return[];for(var d=new c(O.compare),g=0,y=r.length;g<y;g++)for(var v=r[g].getSweepEvents(),_=0,b=v.length;_<b;_++)if(d.insert(v[_]),d.size>B)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new z(d),S=d.size,E=d.pop();E;){var M=E.key;if(d.size===S){var T=M.segment;throw new Error("Unable to pop() ".concat(M.isLeft?"left":"right"," SweepEvent ")+"[".concat(M.point.x,", ").concat(M.point.y,"] from segment #").concat(T.id," ")+"[".concat(T.leftSE.point.x,", ").concat(T.leftSE.point.y,"] -> ")+"[".concat(T.rightSE.point.x,", ").concat(T.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>B)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>j)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var A=w.process(M),C=0,P=A.length;C<P;C++){var k=A[C];void 0===k.consumedBy&&d.insert(k)}S=d.size,E=d.pop()}x.reset();var L=D.factory(w.segments);return new F(L).getGeom()}}]),e}());return{union:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return U.run("union",t,n)},intersection:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return U.run("intersection",t,n)},xor:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return U.run("xor",t,n)},difference:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return U.run("difference",t,n)}}}()},3656:t=>{var e,n,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(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(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,u=[],l=!1,c=-1;function h(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&p())}function p(){if(!l){var t=a(h);l=!0;for(var e=u.length;e;){for(s=u,u=[];++c<e;)s&&s[c].run();c=-1,e=u.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function d(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||l||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=d,r.addListener=d,r.once=d,r.off=d,r.removeListener=d,r.removeAllListeners=d,r.emit=d,r.prependListener=d,r.prependOnceListener=d,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},9499:function(t){t.exports=function(){"use strict";function t(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=n[r],f=i,d=o;for(e(n,i,r),a(n[o],p)>0&&e(n,i,o);f<d;){for(e(n,f,d),f++,d--;a(n[f],p)<0;)f++;for(;a(n[d],p)>0;)d--}0===a(n[i],p)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}return function(e,r,i,o,a){t(e,r,i||0,o||e.length-1,a||n)}}()},6690:(t,e,n)=>{"use strict";t.exports=i,t.exports.default=i;var r=n(9499);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,a=e;a<n;a++)o=t.children[a],u(i,t.leaf?r(o):o);return i}function u(t,e){return 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),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,n,i,o){for(var a,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=i||(a=e+Math.ceil((n-e)/i/2)*i,r(t,a,e,n,o),s.push(e,a,a,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!d(t,e))return n;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i<o;i++)a=e.children[i],d(t,s=e.leaf?r(a):a)&&(e.leaf?n.push(a):f(t,s)?this._all(a,n):u.push(a));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!d(t,e))return!1;for(var r,i,o,a,s=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],d(t,a=e.leaf?n(o):o)){if(e.leaf||f(t,a))return!0;s.push(o)}e=s.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,a,s=this.data,u=this.toBBox(t),l=[],c=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],n=c.pop(),a=!0),s.leaf&&-1!==(i=o(t,s.children,e)))return s.children.splice(i,1),l.push(s),this._condense(l),this;a||s.leaf||!f(s,u)?r?(n++,s=r.children[n],a=!1):s=null:(l.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=m([])).leaf=!1,i.height=r;var u,l,c,h,p=Math.ceil(o/s),f=p*Math.ceil(Math.sqrt(s));for(g(t,e,n,f,this.compareMinX),u=e;u<=n;u+=f)for(g(t,u,c=Math.min(u+f-1,n),p,this.compareMinY),l=u;l<=c;l+=p)h=Math.min(l+p-1,c),i.children.push(this._build(t,l,h,r-1));return a(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,a,s,u,l,c,p,f,d;r.push(e),!e.leaf&&r.length-1!==n;){for(c=p=1/0,i=0,o=e.children.length;i<o;i++)u=h(a=e.children[i]),f=t,d=a,(l=(Math.max(d.maxX,f.maxX)-Math.min(d.minX,f.minX))*(Math.max(d.maxY,f.maxY)-Math.min(d.minY,f.minY))-u)<p?(p=l,c=u<c?u:c,s=a):l===p&&u<c&&(c=u,s=a);e=s||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],a=this._chooseSubtree(i,this.data,e,o);for(a.children.push(t),u(a,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,a,u,l,c,p,f,d,m,g,y,v;for(l=c=1/0,r=e;r<=n-e;r++)f=i=s(t,0,r,this.toBBox),d=o=s(t,r,n,this.toBBox),void 0,void 0,void 0,void 0,m=Math.max(f.minX,d.minX),g=Math.max(f.minY,d.minY),y=Math.min(f.maxX,d.maxX),v=Math.min(f.maxY,d.maxY),a=Math.max(0,y-m)*Math.max(0,v-g),u=h(i)+h(o),a<l?(l=a,p=r,c=u<c?u:c):a===l&&u<c&&(c=u,p=r);return p},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,a=this.toBBox,l=s(t,0,e,a),c=s(t,n-e,n,a),h=p(l)+p(c);for(i=e;i<n-e;i++)o=t.children[i],u(l,t.leaf?a(o):o),h+=p(l);for(i=n-e-1;i>=e;i--)o=t.children[i],u(c,t.leaf?a(o):o),h+=p(c);return h},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():a(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},8346:function(t){t.exports=function(){"use strict";function t(t,r,i,o,a){!function t(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=n[r],f=i,d=o;for(e(n,i,r),a(n[o],p)>0&&e(n,i,o);f<d;){for(e(n,f,d),f++,d--;a(n[f],p)<0;)f++;for(;a(n[d],p)>0;)d--}0===a(n[i],p)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(t,r,i||0,o||t.length-1,a||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,r,i){i||(i=d(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];s(i,t.leaf?r(a):a)}return i}function s(t,e){return 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),t}function u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;f(t,s)&&(e.leaf?n.push(a):p(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(f(t,o)){if(e.leaf||p(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=d([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=l.pop(),o=!0),a.leaf){var c=i(t,a.children,e);if(-1!==c)return a.children.splice(c,1),u.push(a),this._condense(u),this}o||a.leaf||!p(a,s)?r?(n++,a=r.children[n],o=!1):a=null:(u.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(a<=s)return o(i=d(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(i=d([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));m(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var h=Math.min(c+l-1,n);m(t,c,h,u,this.compareMinY);for(var p=c;p<=h;p+=u){var f=Math.min(p+u-1,h);i.children.push(this._build(t,p,f,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var u=e.children[s],l=c(u),h=(p=t,f=u,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l);h<o?(o=h,i=l<i?l:i,a=u):h===o&&l<i&&(i=l,a=u)}e=a||e.children[0]}var p,f;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),s(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=d(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,s,u,l,h,p=1/0,f=1/0,d=e;d<=n-e;d++){var m=a(t,0,d,this.toBBox),g=a(t,d,n,this.toBBox),y=(i=m,o=g,void 0,void 0,void 0,void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,h-u)),v=c(m)+c(g);y<p?(p=y,r=d,f=v<f?v:f):y===p&&v<f&&(f=v,r=d)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=a(t,0,e,i),u=a(t,n-e,n,i),l=h(o)+h(u),c=e;c<n-e;c++){var p=t.children[c];s(o,t.leaf?i(p):p),l+=h(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];s(u,t.leaf?i(d):d),l+=h(u)}return l},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)s(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},171:(t,e,n)=>{var r,i=n(3656);!function(t){!function(e){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=a(t);function a(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:o=a(r.Reflect,o),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!a&&!s,l={create:a?function(){return N(Object.create(null))}:s?function(){return N({__proto__:null})}:function(){return N({})},has:u?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:u?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),h="object"==typeof i&&i.env&&"true"===i.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[o]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,i)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[o]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function i(t,e){return e}function a(t,e){return[t,e]}}():Map,f=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new p}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[o]=function(){return this.keys()},t}():Set,d=new(h||"function"!=typeof WeakMap?function(){var t=16,n=l.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+s()}while(l.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:l.create()})}return t[r]}function a(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(){var e,n=(e=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e));n[6]=79&n[6]|64,n[8]=191&n[8]|128;for(var r="",i=0;i<t;++i){var o=n[i];4!==i&&6!==i&&8!==i||(r+="-"),o<16&&(r+="0"),r+=o.toString(16).toLowerCase()}return r}}():WeakMap);function m(t,e,n){var r=d.get(t);if(E(r)){if(!n)return;r=new p,d.set(t,r)}var i=r.get(e);if(E(i)){if(!n)return;i=new p,r.set(e,i)}return i}function g(t,e,n){if(y(t,e,n))return!0;var r=D(e);return!M(r)&&g(t,r,n)}function y(t,e,n){var r=m(e,n,!1);return!E(r)&&!!r.has(t)}function v(t,e,n){if(y(t,e,n))return _(t,e,n);var r=D(e);return M(r)?void 0:v(t,r,n)}function _(t,e,n){var r=m(e,n,!1);if(!E(r))return r.get(t)}function b(t,e,n,r){m(n,r,!0).set(t,e)}function x(t,e){var n=w(t,e),r=D(t);if(null===r)return n;var i=x(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new f,a=[],s=0,u=n;s<u.length;s++){var l=u[s];o.has(l)||(o.add(l),a.push(l))}for(var c=0,h=i;c<h.length;c++)l=h[c],o.has(l)||(o.add(l),a.push(l));return a}function w(t,e){var n=[],r=m(t,e,!1);if(E(r))return n;for(var i=function(t){var e=L(t,o);if(!P(e))throw new TypeError;var n=e.call(t);if(!T(n))throw new TypeError;return n}(r.keys()),a=0;;){var s=I(i);if(!s)return n.length=a,n;var u=s.value;try{n[a]=u}catch(t){try{R(i)}finally{throw t}}a++}}function S(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function M(t){return null===t}function T(t){return"object"==typeof t?null!==t:"function"==typeof t}function A(t,e){switch(S(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=L(t,r);if(void 0!==i){var o=i.call(t,n);if(T(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(P(n)&&!T(i=n.call(t)))return i;if(P(r=t.valueOf)&&!T(i=r.call(t)))return i}else{var r;if(P(r=t.valueOf)&&!T(i=r.call(t)))return i;var i,o=t.toString;if(P(o)&&!T(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function C(t){var e=A(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function O(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function P(t){return"function"==typeof t}function k(t){return"function"==typeof t}function L(t,e){var n=t[e];if(null!=n){if(!P(n))throw new TypeError;return n}}function I(t){var e=t.next();return!e.done&&e}function R(t){var e=t.return;e&&e.call(t)}function D(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function N(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,n,r){if(E(n)){if(!O(t))throw new TypeError;if(!k(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!E(r)&&!M(r)){if(!k(r))throw new TypeError;e=r}}return e}(t,e)}if(!O(t))throw new TypeError;if(!T(e))throw new TypeError;if(!T(r)&&!E(r)&&!M(r))throw new TypeError;return M(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!E(o)&&!M(o)){if(!T(o))throw new TypeError;r=o}}return r}(t,e,n=C(n),r)})),t("metadata",(function(t,e){return function(n,r){if(!T(n))throw new TypeError;if(!E(r)&&!function(t){switch(S(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),t("defineMetadata",(function(t,e,n,r){if(!T(n))throw new TypeError;return E(r)||(r=C(r)),b(t,e,n,r)})),t("hasMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return E(n)||(n=C(n)),g(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return E(n)||(n=C(n)),y(t,e,n)})),t("getMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return E(n)||(n=C(n)),v(t,e,n)})),t("getOwnMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return E(n)||(n=C(n)),_(t,e,n)})),t("getMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return E(e)||(e=C(e)),x(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return E(e)||(e=C(e)),w(t,e)})),t("deleteMetadata",(function(t,e,n){if(!T(e))throw new TypeError;E(n)||(n=C(n));var r=m(e,n,!1);if(E(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}))}(o)}()}(r||(r={}))},9041:(t,e,n)=>{"use strict";var r=n(9879).functionsHaveConfigurableNames(),i=Object,o=TypeError;t.exports=function(){if(null!=this&&this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},r&&Object.defineProperty&&Object.defineProperty(t.exports,"name",{value:"get flags"})},3799:(t,e,n)=>{"use strict";var r=n(6648),i=n(5592),o=n(9041),a=n(2285),s=n(4407),u=i(a());r(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},2285:(t,e,n)=>{"use strict";var r=n(9041),i=n(6648).supportsDescriptors,o=Object.getOwnPropertyDescriptor;t.exports=function(){if(i&&"gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return r}},4407:(t,e,n)=>{"use strict";var r=n(6648).supportsDescriptors,i=n(2285),o=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,l=/a/;t.exports=function(){if(!r||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=u(l),n=o(e,"flags");return n&&n.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},8935:function(t,e){!function(t){"use strict";const e=134217729;function n(t,e,n,r,i){let o,a,s,u,l=e[0],c=r[0],h=0,p=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++p]);let f=0;if(h<t&&p<n)for(c>l==c>-l?(s=o-((a=l+o)-l),l=e[++h]):(s=o-((a=c+o)-c),c=r[++p]),o=a,0!==s&&(i[f++]=s);h<t&&p<n;)c>l==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=e[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=r[++p]),o=a,0!==s&&(i[f++]=s);for(;h<t;)s=o-((a=o+l)-(u=a-o))+(l-u),l=e[++h],o=a,0!==s&&(i[f++]=s);for(;p<n;)s=o-((a=o+c)-(u=a-o))+(c-u),c=r[++p],o=a,0!==s&&(i[f++]=s);return 0===o&&0!==f||(i[f++]=o),f}function r(t){return new Float64Array(t)}const i=r(4),o=r(8),a=r(12),s=r(16),u=r(4);t.orient2d=function(t,r,l,c,h,p){const f=(r-p)*(l-h),d=(t-h)*(c-p),m=f-d;if(0===f||0===d||f>0!=d>0)return m;const g=Math.abs(f+d);return Math.abs(m)>=33306690738754716e-32*g?m:-function(t,r,l,c,h,p,f){let d,m,g,y,v,_,b,x,w,S,E,M,T,A,C,O,P,k;const L=t-h,I=l-h,R=r-p,D=c-p;v=(C=(x=L-(b=(_=e*L)-(_-L)))*(S=D-(w=(_=e*D)-(_-D)))-((A=L*D)-b*w-x*w-b*S))-(E=C-(P=(x=R-(b=(_=e*R)-(_-R)))*(S=I-(w=(_=e*I)-(_-I)))-((O=R*I)-b*w-x*w-b*S))),i[0]=C-(E+v)+(v-P),v=(T=A-((M=A+E)-(v=M-A))+(E-v))-(E=T-O),i[1]=T-(E+v)+(v-O),v=(k=M+E)-M,i[2]=M-(k-v)+(E-v),i[3]=k;let N=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,i),F=22204460492503146e-32*f;if(N>=F||-N>=F)return N;if(d=t-(L+(v=t-L))+(v-h),g=l-(I+(v=l-I))+(v-h),m=r-(R+(v=r-R))+(v-p),y=c-(D+(v=c-D))+(v-p),0===d&&0===m&&0===g&&0===y)return N;if(F=11093356479670487e-47*f+33306690738754706e-32*Math.abs(N),(N+=L*y+D*d-(R*g+I*m))>=F||-N>=F)return N;v=(C=(x=d-(b=(_=e*d)-(_-d)))*(S=D-(w=(_=e*D)-(_-D)))-((A=d*D)-b*w-x*w-b*S))-(E=C-(P=(x=m-(b=(_=e*m)-(_-m)))*(S=I-(w=(_=e*I)-(_-I)))-((O=m*I)-b*w-x*w-b*S))),u[0]=C-(E+v)+(v-P),v=(T=A-((M=A+E)-(v=M-A))+(E-v))-(E=T-O),u[1]=T-(E+v)+(v-O),v=(k=M+E)-M,u[2]=M-(k-v)+(E-v),u[3]=k;const z=n(4,i,4,u,o);v=(C=(x=L-(b=(_=e*L)-(_-L)))*(S=y-(w=(_=e*y)-(_-y)))-((A=L*y)-b*w-x*w-b*S))-(E=C-(P=(x=R-(b=(_=e*R)-(_-R)))*(S=g-(w=(_=e*g)-(_-g)))-((O=R*g)-b*w-x*w-b*S))),u[0]=C-(E+v)+(v-P),v=(T=A-((M=A+E)-(v=M-A))+(E-v))-(E=T-O),u[1]=T-(E+v)+(v-O),v=(k=M+E)-M,u[2]=M-(k-v)+(E-v),u[3]=k;const B=n(z,o,4,u,a);v=(C=(x=d-(b=(_=e*d)-(_-d)))*(S=y-(w=(_=e*y)-(_-y)))-((A=d*y)-b*w-x*w-b*S))-(E=C-(P=(x=m-(b=(_=e*m)-(_-m)))*(S=g-(w=(_=e*g)-(_-g)))-((O=m*g)-b*w-x*w-b*S))),u[0]=C-(E+v)+(v-P),v=(T=A-((M=A+E)-(v=M-A))+(E-v))-(E=T-O),u[1]=T-(E+v)+(v-O),v=(k=M+E)-M,u[2]=M-(k-v)+(E-v),u[3]=k;const j=n(B,a,4,u,s);return s[j-1]}(t,r,l,c,h,p,g)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},9187:(t,e,n)=>{"use strict";var r=n(2086),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},382:t=>{"use strict";t.exports={eudist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var a=(t[o]||0)-(e[o]||0);i+=a*a}return n?Math.sqrt(i):i},mandist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(i):i},dist:function(t,e,n){var r=Math.abs(t-e);return n?r:r*r}}},5040:(t,e,n)=>{"use strict";var r=n(382),i=r.eudist,o=r.dist;t.exports={kmrand:function(t,e){for(var n={},r=[],i=e<<2,o=t.length,a=t[0].length>0;r.length<e&&i-- >0;){var s=t[Math.floor(Math.random()*o)],u=a?s.join("_"):""+s;n[u]||(n[u]=!0,r.push(s))}if(r.length<e)throw new Error("Error initializating clusters");return r},kmpp:function(t,e){var n=t[0].length?i:o,r=[],a=t.length,s=t[0].length>0,u=t[Math.floor(Math.random()*a)];for(s&&u.join("_"),r.push(u);r.length<e;){for(var l=[],c=r.length,h=0,p=[],f=0;f<a;f++){for(var d=1/0,m=0;m<c;m++){var g=n(t[f],r[m]);g<=d&&(d=g)}l[f]=d}for(var y=0;y<a;y++)h+=l[y];for(var v=0;v<a;v++)p[v]={i:v,v:t[v],pr:l[v]/h,cs:0};p.sort((function(t,e){return t.pr-e.pr})),p[0].cs=p[0].pr;for(var _=1;_<a;_++)p[_].cs=p[_-1].cs+p[_].pr;for(var b=Math.random(),x=0;x<a-1&&p[x++].cs<b;);r.push(p[x-1].v)}return r}}},2087:(t,e,n)=>{"use strict";var r=n(382),i=n(5040),o=r.eudist,a=(r.mandist,r.dist,i.kmrand),s=i.kmpp;function u(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}t.exports=function(t,e,n,r){var i=[],l=[],c=[],h=[],p=!1,f=r||1e4,d=t.length,m=t[0].length,g=m>0,y=[];if(n)i="kmrand"==n?a(t,e):"kmpp"==n?s(t,e):n;else for(var v={};i.length<e;){var _=Math.floor(Math.random()*d);v[_]||(v[_]=!0,i.push(t[_]))}do{u(e,0,y);for(var b=0;b<d;b++){for(var x=1/0,w=0,S=0;S<e;S++)(h=g?o(t[b],i[S]):Math.abs(t[b]-i[S]))<=x&&(x=h,w=S);c[b]=w,y[w]++}for(var E=[],M=(l=[],0);M<e;M++)E[M]=g?u(m,0,E[M]):0,l[M]=i[M];if(g){for(var T=0;T<e;T++)i[T]=[];for(var A=0;A<d;A++)for(var C=E[c[A]],O=t[A],P=0;P<m;P++)C[P]+=O[P];p=!0;for(var k=0;k<e;k++){for(var L=i[k],I=E[k],R=l[k],D=y[k],N=0;N<m;N++)L[N]=I[N]/D||0;if(p)for(var F=0;F<m;F++)if(R[F]!=L[F]){p=!1;break}}}else{for(var z=0;z<d;z++)E[c[z]]+=t[z];for(var B=0;B<e;B++)i[B]=E[B]/y[B]||0;p=!0;for(var j=0;j<e;j++)if(l[j]!=i[j]){p=!1;break}}p=p||--f<=0}while(!p);return{it:1e4-f,k:e,idxs:c,centroids:i}}},1469:function(t){t.exports=function(){"use strict";function t(n,r,i,o,a,s){if(!(a-o<=i)){var u=o+a>>1;e(n,r,u,o,a,s%2),t(n,r,i,o,u-1,s+1),t(n,r,i,u+1,a,s+1)}}function e(t,r,i,o,a,s){for(;a>o;){if(a-o>600){var u=a-o+1,l=i-o+1,c=Math.log(u),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1);e(t,r,i,Math.max(o,Math.floor(i-l*h/u+p)),Math.min(a,Math.floor(i+(u-l)*h/u+p)),s)}var f=r[2*i+s],d=o,m=a;for(n(t,r,o,i),r[2*a+s]>f&&n(t,r,o,a);d<m;){for(n(t,r,d,m),d++,m--;r[2*d+s]<f;)d++;for(;r[2*m+s]>f;)m--}r[2*o+s]===f?n(t,r,o,m):n(t,r,++m,a),m<=i&&(o=m+1),i<=m&&(a=m-1)}}function n(t,e,n,i){r(t,n,i),r(e,2*n,2*i),r(e,2*n+1,2*i+1)}function r(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function i(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}var o=function(t){return t[0]},a=function(t){return t[1]},s=function(e,n,r,i,s){void 0===n&&(n=o),void 0===r&&(r=a),void 0===i&&(i=64),void 0===s&&(s=Float64Array),this.nodeSize=i,this.points=e;for(var u=e.length<65536?Uint16Array:Uint32Array,l=this.ids=new u(e.length),c=this.coords=new s(2*e.length),h=0;h<e.length;h++)l[h]=h,c[2*h]=n(e[h]),c[2*h+1]=r(e[h]);t(l,c,i,0,l.length-1,0)};s.prototype.range=function(t,e,n,r){return function(t,e,n,r,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),p=l.pop(),f=l.pop();if(p-f<=a)for(var d=f;d<=p;d++)s=e[2*d],u=e[2*d+1],s>=n&&s<=i&&u>=r&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+p)/2);s=e[2*m],u=e[2*m+1],s>=n&&s<=i&&u>=r&&u<=o&&c.push(t[m]);var g=(h+1)%2;(0===h?n<=s:r<=u)&&(l.push(f),l.push(m-1),l.push(g)),(0===h?i>=s:o>=u)&&(l.push(m+1),l.push(p),l.push(g))}}return c}(this.ids,this.coords,t,e,n,r,this.nodeSize)},s.prototype.within=function(t,e,n){return function(t,e,n,r,o,a){for(var s=[0,t.length-1,0],u=[],l=o*o;s.length;){var c=s.pop(),h=s.pop(),p=s.pop();if(h-p<=a)for(var f=p;f<=h;f++)i(e[2*f],e[2*f+1],n,r)<=l&&u.push(t[f]);else{var d=Math.floor((p+h)/2),m=e[2*d],g=e[2*d+1];i(m,g,n,r)<=l&&u.push(t[d]);var y=(c+1)%2;(0===c?n-o<=m:r-o<=g)&&(s.push(p),s.push(d-1),s.push(y)),(0===c?n+o>=m:r+o>=g)&&(s.push(d+1),s.push(h),s.push(y))}}return u}(this.ids,this.coords,t,e,n,this.nodeSize)};var u,l={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},c=Math.fround||(u=new Float32Array(1),function(t){return u[0]=+t,u[0]}),h=function(t){this.options=v(Object.create(l),t),this.trees=new Array(this.options.maxZoom+1)};function p(t,e,n,r,i){return{x:c(t),y:c(e),zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function f(t,e){var n=t.geometry.coordinates,r=n[0],i=n[1];return{x:c(g(r)),y:c(y(i)),zoom:1/0,index:e,parentId:-1}}function d(t){return{type:"Feature",id:t.id,properties:m(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,r}function m(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return v(v({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function g(t){return t/360+.5}function y(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function v(t,e){for(var n in e)t[n]=e[n];return t}function _(t){return t.x}function b(t){return t.y}return h.prototype.load=function(t){var e=this.options,n=e.log,r=e.minZoom,i=e.maxZoom,o=e.nodeSize;n&&console.time("total time");var a="prepare "+t.length+" points";n&&console.time(a),this.points=t;for(var u=[],l=0;l<t.length;l++)t[l].geometry&&u.push(f(t[l],l));this.trees[i+1]=new s(u,_,b,o,Float32Array),n&&console.timeEnd(a);for(var c=i;c>=r;c--){var h=+Date.now();u=this._cluster(u,c),this.trees[c]=new s(u,_,b,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",c,u.length,+Date.now()-h)}return n&&console.timeEnd("total time"),this},h.prototype.getClusters=function(t,e){var n=((t[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],e),s=this.getClusters([-180,r,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],c=0,h=u.range(g(n),y(o),g(i),y(r));c<h.length;c+=1){var p=h[c],f=u.points[p];l.push(f.numPoints?d(f):this.points[f.index])}return l},h.prototype.getChildren=function(t){var e=this._getOriginId(t),n=this._getOriginZoom(t),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var o=i.points[e];if(!o)throw new Error(r);for(var a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=[],u=0,l=i.within(o.x,o.y,a);u<l.length;u+=1){var c=l[u],h=i.points[c];h.parentId===t&&s.push(h.numPoints?d(h):this.points[h.index])}if(0===s.length)throw new Error(r);return s},h.prototype.getLeaves=function(t,e,n){e=e||10,n=n||0;var r=[];return this._appendLeaves(r,t,e,n,0),r},h.prototype.getTile=function(t,e,n){var r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.extent,s=o.radius/a,u=(n-s)/i,l=(n+1+s)/i,c={features:[]};return this._addTileFeatures(r.range((e-s)/i,u,(e+1+s)/i,l),r.points,e,n,i,c),0===e&&this._addTileFeatures(r.range(1-s/i,u,1,l),r.points,i,n,i,c),e===i-1&&this._addTileFeatures(r.range(0,u,s/i,l),r.points,-1,n,i,c),c.features.length?c:null},h.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},h.prototype._appendLeaves=function(t,e,n,r,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=r?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,n,r,i):i<r?i++:t.push(s),t.length===n)break}return i},h.prototype._addTileFeatures=function(t,e,n,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l=u.numPoints,c=void 0,h=void 0,p=void 0;if(l)c=m(u),h=u.x,p=u.y;else{var f=this.points[u.index];c=f.properties,h=g(f.geometry.coordinates[0]),p=y(f.geometry.coordinates[1])}var d={type:1,geometry:[[Math.round(this.options.extent*(h*i-n)),Math.round(this.options.extent*(p*i-r))]],tags:c},v=void 0;l?v=u.id:this.options.generateId?v=u.index:this.points[u.index].id&&(v=this.points[u.index].id),void 0!==v&&(d.id=v),o.features.push(d)}},h.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))},h.prototype._cluster=function(t,e){for(var n=[],r=this.options,i=r.radius,o=r.extent,a=r.reduce,s=r.minPoints,u=i/(o*Math.pow(2,e)),l=0;l<t.length;l++){var c=t[l];if(!(c.zoom<=e)){c.zoom=e;for(var h=this.trees[e+1],f=h.within(c.x,c.y,u),d=c.numPoints||1,m=d,g=0,y=f;g<y.length;g+=1){var v=y[g],_=h.points[v];_.zoom>e&&(m+=_.numPoints||1)}if(m>d&&m>=s){for(var b=c.x*d,x=c.y*d,w=a&&d>1?this._map(c,!0):null,S=(l<<5)+(e+1)+this.points.length,E=0,M=f;E<M.length;E+=1){var T=M[E],A=h.points[T];if(!(A.zoom<=e)){A.zoom=e;var C=A.numPoints||1;b+=A.x*C,x+=A.y*C,A.parentId=S,a&&(w||(w=this._map(c,!0)),a(w,this._map(A)))}}c.parentId=S,n.push(p(b/m,x/m,S,m,w))}else if(n.push(c),m>1)for(var O=0,P=f;O<P.length;O+=1){var k=P[O],L=h.points[k];L.zoom<=e||(L.zoom=e,n.push(L))}}}return n},h.prototype._getOriginId=function(t){return t-this.points.length>>5},h.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},h.prototype._map=function(t,e){if(t.numPoints)return e?v({},t.properties):t.properties;var n=this.points[t.index].properties,r=this.options.map(n);return e&&r===n?v({},r):r},h}()},1048:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});class r{constructor(t=[],e=i){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.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,r=e[t];for(;t>0;){const i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}_down(t){const{data:e,compare:n}=this,r=this.length>>1,i=e[t];for(;t<r;){let r=1+(t<<1),o=e[r];const a=r+1;if(a<this.length&&n(e[a],o)<0&&(r=a,o=e[a]),n(o,i)>=0)break;e[t]=o,t=r}e[t]=i}}function i(t,e){return t<e?-1:t>e?1:0}},3273:(t,e,n)=>{"use strict";function r(t){return t}function i(t){if(null==t)return r;var e,n,i=t.scale[0],o=t.scale[1],a=t.translate[0],s=t.translate[1];return function(t,r){r||(e=n=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*i+a,c[1]=(n+=t[1])*o+s;u<l;)c[u]=t[u],++u;return c}}function o(t){var e,n=i(t.transform),r=1/0,o=r,a=-r,s=-r;function u(t){(t=n(t))[0]<r&&(r=t[0]),t[0]>a&&(a=t[0]),t[1]<o&&(o=t[1]),t[1]>s&&(s=t[1])}function l(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(l);break;case"Point":u(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(u)}}for(e in t.arcs.forEach((function(t){for(var e,i=-1,u=t.length;++i<u;)(e=n(t[i],i))[0]<r&&(r=e[0]),e[0]>a&&(a=e[0]),e[1]<o&&(o=e[1]),e[1]>s&&(s=e[1])})),t.objects)l(t.objects[e]);return[r,o,a,s]}function a(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return s(t,e)}))}:s(t,e)}function s(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=u(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function u(t,e){var n=i(t.transform),r=t.arcs;function o(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function a(t){return n(t)}function s(t){for(var e=[],n=0,r=t.length;n<r;++n)o(t[n],e);return e.length<2&&e.push(e[0]),e}function u(t){for(var e=s(t);e.length<4;)e.push(e[0]);return e}function l(t){return t.map(u)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=a(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(a);break;case"LineString":n=s(e.arcs);break;case"MultiLineString":n=e.arcs.map(s);break;case"Polygon":n=l(e.arcs);break;case"MultiPolygon":n=e.arcs.map(l);break;default:return null}return{type:r,coordinates:n}}(e)}function l(t,e){var n={},r={},i={},o=[],a=-1;function s(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1],e<0?[n,i]:[i,n]}(e),s=a[0],u=a[1];if(n=i[s])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var l=o===n?n:n.concat(o);r[l.start=n.start]=i[l.end=o.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=s,o=i[s]){delete i[o.end];var c=o===n?n:o.concat(n);r[c.start=o.start]=i[c.end=n.end]=c}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=s]=i[n.end=u]=n})),s(i,r),s(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o}function c(t){return u(t,h.apply(this,arguments))}function h(t,e,n){var r,i,o;if(arguments.length>1)r=function(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function s(t){t.forEach(a)}function u(t){t.forEach(s)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":u(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(u)}(e.arcs)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:l(t,r)}}function p(t){return u(t,f.apply(this,arguments))}function f(t,e){var n={},r=[],i=[];function o(t){t.forEach((function(e){e.forEach((function(e){(n[e=e<0?~e:e]||(n[e]=[])).push(t)}))})),r.push(t)}function a(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(u(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":o(e.arcs);break;case"MultiPolygon":e.arcs.forEach(o)}})),r.forEach((function(t){if(!t._){var e=[],r=[t];for(t._=1,i.push(e);t=r.pop();)e.push(t),t.forEach((function(t){t.forEach((function(t){n[t<0?~t:t].forEach((function(t){t._||(t._=1,r.push(t))}))}))}))}})),r.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:i.map((function(e){var r,i=[];if(e.forEach((function(t){t.forEach((function(t){t.forEach((function(t){n[t<0?~t:t].length<2&&i.push(t)}))}))})),(r=(i=l(t,i)).length)>1)for(var o,s,u=1,c=a(i[0]);u<r;++u)(o=a(i[u]))>c&&(s=i[0],i[0]=i[u],i[u]=s,c=o);return i})).filter((function(t){return t.length>0}))}}function d(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;t[i]<e?n=i+1:r=i}return n}function m(t){var e={},n=t.map((function(){return[]}));function r(t,n){t.forEach((function(t){t<0&&(t=~t);var r=e[t];r?r.push(n):e[t]=[n]}))}function i(t,e){t.forEach((function(t){r(t,e)}))}var o={LineString:r,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach((function(t){i(t,e)}))}};for(var a in t.forEach((function t(e,n){"GeometryCollection"===e.type?e.geometries.forEach((function(e){t(e,n)})):e.type in o&&o[e.type](e.arcs,n)})),e)for(var s=e[a],u=s.length,l=0;l<u;++l)for(var c=l+1;c<u;++c){var h,p=s[l],f=s[c];(h=n[p])[a=d(h,f)]!==f&&h.splice(a,0,f),(h=n[f])[a=d(h,p)]!==p&&h.splice(a,0,p)}return n}function g(t){if(null==t)return r;var e,n,i=t.scale[0],o=t.scale[1],a=t.translate[0],s=t.translate[1];return function(t,r){r||(e=n=0);var u=2,l=t.length,c=new Array(l),h=Math.round((t[0]-a)/i),p=Math.round((t[1]-s)/o);for(c[0]=h-e,e=h,c[1]=p-n,n=p;u<l;)c[u]=t[u],++u;return c}}function y(t,e){if(t.transform)throw new Error("already quantized");if(e&&e.scale)u=t.bbox;else{if(!((n=Math.floor(e))>=2))throw new Error("n must be ≥2");var n,r=(u=t.bbox||o(t))[0],i=u[1],a=u[2],s=u[3];e={scale:[a-r?(a-r)/(n-1):1,s-i?(s-i)/(n-1):1],translate:[r,i]}}var u,l,c=g(e),h=t.objects,p={};function f(t){return c(t)}function d(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(d)};break;case"Point":e={type:"Point",coordinates:f(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(f)};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(l in h)p[l]=d(h[l]);return{type:"Topology",bbox:u,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,n=0,r=1,i=t.length,o=new Array(i);for(o[0]=c(t[0],0);++n<i;)((e=c(t[n],n))[0]||e[1])&&(o[r++]=e);return 1===r&&(o[r++]=[0,0]),o.length=r,o}))}}n.r(e),n.d(e,{bbox:()=>o,feature:()=>a,merge:()=>p,mergeArcs:()=>f,mesh:()=>c,meshArcs:()=>h,neighbors:()=>m,quantize:()=>y,transform:()=>i,untransform:()=>g})},9055:function(t,e){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function a(t){return null===t?Rt:t.color}function s(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function p(){}function f(){this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}function d(){}function m(t){this.message=t||""}function g(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var y=function(){};y.prototype.interfaces_=function(){return[]},y.prototype.getClass=function(){return y},y.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var v=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),_=function(){},b={MAX_VALUE:{configurable:!0}};_.isNaN=function(t){return Number.isNaN(t)},_.doubleToLongBits=function(t){return t},_.longBitsToDouble=function(t){return t},_.isInfinite=function(t){return!Number.isFinite(t)},b.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(_,b);var x=function(){},w=function(){},S=function(){},E=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},M={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};E.prototype.setOrdinate=function(t,e){switch(t){case E.X:this.x=e;break;case E.Y:this.y=e;break;case E.Z:this.z=e;break;default:throw new v("Invalid ordinate index: "+t)}},E.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!y.equalsWithTolerance(this.x,e.x,n)&&!!y.equalsWithTolerance(this.y,e.y,n)}},E.prototype.getOrdinate=function(t){switch(t){case E.X:return this.x;case E.Y:return this.y;case E.Z:return this.z}throw new v("Invalid ordinate index: "+t)},E.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||_.isNaN(this.z))&&_.isNaN(t.z)},E.prototype.equals=function(t){return t instanceof E&&this.equals2D(t)},E.prototype.equalInZ=function(t,e){return y.equalsWithTolerance(this.z,t.z,e)},E.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},E.prototype.clone=function(){},E.prototype.copy=function(){return new E(this)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},E.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},E.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},E.prototype.hashCode=function(){var t=17;return 37*(t=37*t+E.hashCode(this.x))+E.hashCode(this.y)},E.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},E.prototype.interfaces_=function(){return[x,w,e]},E.prototype.getClass=function(){return E},E.hashCode=function(){if(1===arguments.length){var t=_.doubleToLongBits(arguments[0]);return Math.trunc((t^t)>>>32)}},M.DimensionalComparator.get=function(){return T},M.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},M.NULL_ORDINATE.get=function(){return _.NaN},M.X.get=function(){return 0},M.Y.get=function(){return 1},M.Z.get=function(){return 2},Object.defineProperties(E,M);var T=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new v("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};T.prototype.compare=function(t,e){var n=t,r=e,i=T.compare(n.x,r.x);if(0!==i)return i;var o=T.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:T.compare(n.z,r.z)},T.prototype.interfaces_=function(){return[S]},T.prototype.getClass=function(){return T},T.compare=function(t,e){return t<e?-1:t>e?1:_.isNaN(t)?_.isNaN(e)?0:-1:_.isNaN(e)?1:0};var A=function(){};A.prototype.create=function(){},A.prototype.interfaces_=function(){return[]},A.prototype.getClass=function(){return A};var C=function(){},O={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C},C.toLocationSymbol=function(t){switch(t){case C.EXTERIOR:return"e";case C.BOUNDARY:return"b";case C.INTERIOR:return"i";case C.NONE:return"-"}throw new v("Unknown location value: "+t)},O.INTERIOR.get=function(){return 0},O.BOUNDARY.get=function(){return 1},O.EXTERIOR.get=function(){return 2},O.NONE.get=function(){return-1},Object.defineProperties(C,O);var P=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},k=function(){},L={LOG_10:{configurable:!0}};k.prototype.interfaces_=function(){return[]},k.prototype.getClass=function(){return k},k.log10=function(t){var e=Math.log(t);return _.isInfinite(e)||_.isNaN(e)?e:e/k.LOG_10},k.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},k.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},k.wrap=function(t,e){return t<0?e- -t%e:t%e},k.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],a=arguments[0];return r>a&&(a=r),i>a&&(a=i),o>a&&(a=o),a}},k.average=function(t,e){return(t+e)/2},L.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(k,L);var I=function(t){this.str=t};I.prototype.append=function(t){this.str+=t},I.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},I.prototype.toString=function(t){return this.str};var R=function(t){this.value=t};R.prototype.intValue=function(){return this.value},R.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},R.isNaN=function(t){return Number.isNaN(t)};var D=function(){};D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()};var N=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}},F={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};N.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},N.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=N.magnitude(n._hi),i=N.TEN.pow(r);(n=n.divide(i)).gt(N.TEN)?(n=n.divide(N.TEN),r+=1):n.lt(N.ONE)&&(n=n.multiply(N.TEN),r-=1);for(var o=r+1,a=new I,s=N.MAX_PRINT_DIGITS-1,u=0;u<=s;u++){t&&u===o&&a.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,a.append(h),n=n.subtract(N.valueOf(l)).multiply(N.TEN),c&&n.selfAdd(N.TEN);var p=!0,f=N.magnitude(n._hi);if(f<0&&Math.abs(f)>=s-u&&(p=!1),!p)break}return e[0]=r,a.toString()},N.prototype.sqr=function(){return this.multiply(this)},N.prototype.doubleValue=function(){return this._hi+this._lo},N.prototype.subtract=function(){if(arguments[0]instanceof N){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},N.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},N.prototype.isZero=function(){return 0===this._hi&&0===this._lo},N.prototype.selfSubtract=function(){if(arguments[0]instanceof N){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},N.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},N.prototype.min=function(t){return this.le(t)?this:t},N.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof N){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n,r,i,o,a=arguments[0],s=arguments[1],u=null,l=null,c=null,h=null;return i=this._hi/a,h=(u=(c=N.SPLIT*i)-(u=c-i))*(l=(h=N.SPLIT*a)-(l=h-a))-(o=i*a)+u*(r=a-l)+(n=i-u)*l+n*r,h=i+(c=(this._hi-o-h+this._lo-i*s)/a),this._hi=h,this._lo=i-h+c,this}},N.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},N.prototype.divide=function(){if(arguments[0]instanceof N){var t,e,n,r,i=arguments[0],o=null,a=null,s=null,u=null;return t=(n=this._hi/i._hi)-(o=(s=N.SPLIT*n)-(o=s-n)),u=o*(a=(u=N.SPLIT*i._hi)-(a=u-i._hi))-(r=n*i._hi)+o*(e=i._hi-a)+t*a+t*e,s=(this._hi-r-u+this._lo-n*i._lo)/i._hi,new N(u=n+s,n-u+s)}if("number"==typeof arguments[0]){var l=arguments[0];return _.isNaN(l)?N.createNaN():N.copy(this).selfDivide(l,0)}},N.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},N.prototype.pow=function(t){if(0===t)return N.valueOf(1);var e=new N(this),n=N.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},N.prototype.ceil=function(){if(this.isNaN())return N.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new N(t,e)},N.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},N.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},N.prototype.setValue=function(){if(arguments[0]instanceof N){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},N.prototype.max=function(t){return this.ge(t)?this:t},N.prototype.sqrt=function(){if(this.isZero())return N.valueOf(0);if(this.isNegative())return N.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=N.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},N.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof N){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e,n,r,i,o,a=arguments[0],s=null;return s=(r=this._hi+a)-(i=r-this._hi),n=(o=(s=a-i+(this._hi-s))+this._lo)+(r-(e=r+o)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var u,l,c,h,p=arguments[0],f=arguments[1],d=null,m=null,g=null;c=this._hi+p,l=this._lo+f,m=c-(g=c-this._hi),d=l-(h=l-this._lo);var y=(u=c+(g=(m=p-g+(this._hi-m))+l))+(g=(d=f-h+(this._lo-d))+(g+(c-u))),v=g+(u-y);return this._hi=y,this._lo=v,this}},N.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof N){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n,r,i=arguments[0],o=arguments[1],a=null,s=null,u=null,l=null;a=(u=N.SPLIT*this._hi)-this._hi,l=N.SPLIT*i,a=u-a,n=this._hi-a,s=l-i;var c=(u=this._hi*i)+(l=a*(s=l-s)-u+a*(r=i-s)+n*s+n*r+(this._hi*o+this._lo*i)),h=l+(a=u-c);return this._hi=c,this._lo=h,this}},N.prototype.selfSqr=function(){return this.selfMultiply(this)},N.prototype.floor=function(){if(this.isNaN())return N.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new N(t,e)},N.prototype.negate=function(){return this.isNaN()?this:new N(-this._hi,-this._lo)},N.prototype.clone=function(){},N.prototype.multiply=function(){if(arguments[0]instanceof N){var t=arguments[0];return t.isNaN()?N.createNaN():N.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return _.isNaN(e)?N.createNaN():N.copy(this).selfMultiply(e,0)}},N.prototype.isNaN=function(){return _.isNaN(this._hi)},N.prototype.intValue=function(){return Math.trunc(this._hi)},N.prototype.toString=function(){var t=N.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},N.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+N.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+N.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},N.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,a=null,s=null;t=(n=1/this._hi)-(i=(a=N.SPLIT*n)-(i=a-n)),o=(s=N.SPLIT*this._hi)-this._hi;var u=n+(a=(1-(r=n*this._hi)-(s=i*(o=s-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new N(u,n-u+a)},N.prototype.toSciNotation=function(){if(this.isZero())return N.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=N.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},N.prototype.abs=function(){return this.isNaN()?N.NaN:this.isNegative()?this.negate():new N(this)},N.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},N.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},N.prototype.add=function(){if(arguments[0]instanceof N){var t=arguments[0];return N.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return N.copy(this).selfAdd(e)}},N.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof N){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},N.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},N.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},N.prototype.trunc=function(){return this.isNaN()?N.NaN:this.isPositive()?this.floor():this.ceil()},N.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},N.prototype.interfaces_=function(){return[e,x,w]},N.prototype.getClass=function(){return N},N.sqr=function(t){return N.valueOf(t).selfMultiply(t)},N.valueOf=function(){return"string"==typeof arguments[0]?N.parse(arguments[0]):"number"==typeof arguments[0]?new N(arguments[0]):void 0},N.sqrt=function(t){return N.valueOf(t).sqrt()},N.parse=function(t){for(var e=0,n=t.length;D.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new N,a=0,s=0,u=0;!(e>=n);){var l=t.charAt(e);if(e++,D.isDigit(l)){var c=l-"0";o.selfMultiply(N.TEN),o.selfAdd(c),a++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=R.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}s=a}}var p=o,f=a-s-u;if(0===f)p=o;else if(f>0){var d=N.TEN.pow(f);p=o.divide(d)}else if(f<0){var m=N.TEN.pow(-f);p=o.multiply(m)}return r?p.negate():p},N.createNaN=function(){return new N(_.NaN,_.NaN)},N.copy=function(t){return new N(t)},N.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},N.stringOfChar=function(t,e){for(var n=new I,r=0;r<e;r++)n.append(t);return n.toString()},F.PI.get=function(){return new N(3.141592653589793,12246467991473532e-32)},F.TWO_PI.get=function(){return new N(6.283185307179586,24492935982947064e-32)},F.PI_2.get=function(){return new N(1.5707963267948966,6123233995736766e-32)},F.E.get=function(){return new N(2.718281828459045,14456468917292502e-32)},F.NaN.get=function(){return new N(_.NaN,_.NaN)},F.EPS.get=function(){return 123259516440783e-46},F.SPLIT.get=function(){return 134217729},F.MAX_PRINT_DIGITS.get=function(){return 32},F.TEN.get=function(){return N.valueOf(10)},F.ONE.get=function(){return N.valueOf(1)},F.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},F.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(N,F);var z=function(){},B={DP_SAFE_EPSILON:{configurable:!0}};z.prototype.interfaces_=function(){return[]},z.prototype.getClass=function(){return z},z.orientationIndex=function(t,e,n){var r=z.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=N.valueOf(e.x).selfAdd(-t.x),o=N.valueOf(e.y).selfAdd(-t.y),a=N.valueOf(n.x).selfAdd(-e.x),s=N.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(s).selfSubtract(o.selfMultiply(a)).signum()},z.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},z.intersection=function(t,e,n,r){var i=N.valueOf(r.y).selfSubtract(n.y).selfMultiply(N.valueOf(e.x).selfSubtract(t.x)),o=N.valueOf(r.x).selfSubtract(n.x).selfMultiply(N.valueOf(e.y).selfSubtract(t.y)),a=i.subtract(o),s=N.valueOf(r.x).selfSubtract(n.x).selfMultiply(N.valueOf(t.y).selfSubtract(n.y)),u=N.valueOf(r.y).selfSubtract(n.y).selfMultiply(N.valueOf(t.x).selfSubtract(n.x)),l=s.subtract(u).selfDivide(a).doubleValue(),c=N.valueOf(t.x).selfAdd(N.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).doubleValue(),h=N.valueOf(e.x).selfSubtract(t.x).selfMultiply(N.valueOf(t.y).selfSubtract(n.y)),p=N.valueOf(e.y).selfSubtract(t.y).selfMultiply(N.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(p).selfDivide(a).doubleValue(),d=N.valueOf(n.y).selfAdd(N.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new E(c,d)},z.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),a=i-o;if(i>0){if(o<=0)return z.signum(a);r=i+o}else{if(!(i<0))return z.signum(a);if(o>=0)return z.signum(a);r=-i-o}var s=z.DP_SAFE_EPSILON*r;return a>=s||-a>=s?z.signum(a):2},z.signum=function(t){return t>0?1:t<0?-1:0},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(z,B);var j=function(){},U={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};U.X.get=function(){return 0},U.Y.get=function(){return 1},U.Z.get=function(){return 2},U.M.get=function(){return 3},j.prototype.setOrdinate=function(t,e,n){},j.prototype.size=function(){},j.prototype.getOrdinate=function(t,e){},j.prototype.getCoordinate=function(){},j.prototype.getCoordinateCopy=function(t){},j.prototype.getDimension=function(){},j.prototype.getX=function(t){},j.prototype.clone=function(){},j.prototype.expandEnvelope=function(t){},j.prototype.copy=function(){},j.prototype.getY=function(t){},j.prototype.toCoordinateArray=function(){},j.prototype.interfaces_=function(){return[w]},j.prototype.getClass=function(){return j},Object.defineProperties(j,U);var Z=function(){},V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Z),G=function(){};G.arraycopy=function(t,e,n,r,i){for(var o=0,a=e;a<e+i;a++)n[r+o]=t[a],o++},G.getProperty=function(t){return{"line.separator":"\n"}[t]};var H=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof E&&arguments[1]instanceof E){var a=arguments[0],s=arguments[1];this.x=a.y-s.y,this.y=s.x-a.x,this.w=a.x*s.y-s.x*a.y}}else if(3===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(4===arguments.length){var h=arguments[0],p=arguments[1],f=arguments[2],d=arguments[3],m=h.y-p.y,g=p.x-h.x,y=h.x*p.y-p.x*h.y,v=f.y-d.y,_=d.x-f.x,b=f.x*d.y-d.x*f.y;this.x=g*b-_*y,this.y=v*y-m*b,this.w=m*_-v*g}};H.prototype.getY=function(){var t=this.y/this.w;if(_.isNaN(t)||_.isInfinite(t))throw new V;return t},H.prototype.getX=function(){var t=this.x/this.w;if(_.isNaN(t)||_.isInfinite(t))throw new V;return t},H.prototype.getCoordinate=function(){var t=new E;return t.x=this.getX(),t.y=this.getY(),t},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,s=n.y-r.y,u=r.x-n.x,l=n.x*r.y-r.x*n.y,c=i*u-s*o,h=(o*l-u*a)/c,p=(s*a-i*l)/c;if(_.isNaN(h)||_.isInfinite(h)||_.isNaN(p)||_.isInfinite(p))throw new V;return new E(h,p)};var W=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof E){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],u=arguments[3];this.init(o,a,s,u)}},q={serialVersionUID:{configurable:!0}};W.prototype.getArea=function(){return this.getWidth()*this.getHeight()},W.prototype.equals=function(t){if(!(t instanceof W))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},W.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new W;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new W(e,r,n,i)},W.prototype.isNull=function(){return this._maxx<this._minx},W.prototype.getMaxX=function(){return this._maxx},W.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof W){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},W.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof W){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof E){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},W.prototype.getMinY=function(){return this._miny},W.prototype.getMinX=function(){return this._minx},W.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof W){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},W.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},W.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},W.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},W.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},W.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},W.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},W.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},W.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},W.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},W.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof W){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof E){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},W.prototype.centre=function(){return this.isNull()?null:new E((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},W.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof W){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),a<s?(this._miny=a,this._maxy=s):(this._miny=s,this._maxy=a)}},W.prototype.getMaxY=function(){return this._maxy},W.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},W.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+E.hashCode(this._minx))+E.hashCode(this._maxx))+E.hashCode(this._miny))+E.hashCode(this._maxy)},W.prototype.interfaces_=function(){return[x,e]},W.prototype.getClass=function(){return W},W.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||c<s||(s=Math.min(o.y,a.y),u=Math.max(o.y,a.y),l=Math.min(r.y,i.y),c=Math.max(r.y,i.y),l>u||c<s))}},q.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(W,q);var Y={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},X=function(t){this.geometryFactory=t||new ye};X.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=Y.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=Y.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],K[n]&&(e=K[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},X.prototype.write=function(t){return this.extractGeometry(t)},X.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!$[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+$[e].apply(this,[t])+")"};var $={coordinate:function(t){return t.x+" "+t.y},point:function(t){return $.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push($.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push($.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+$.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+$.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+$.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},K={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(Y.spaces);return this.geometryFactory.createPoint(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Y.trimParens,"$1"),r.push(K.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Y.spaces),r.push(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Y.spaces),r.push(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(Y.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Y.trimParens,"$1"),r.push(K.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(Y.parenComma),a=[],s=0,u=o.length;s<u;++s)e=o[s].replace(Y.trimParens,"$1"),n=K.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?i=r:a.push(r);return this.geometryFactory.createPolygon(i,a)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(Y.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Y.trimParens,"$1"),r.push(K.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},J=function(t){this.parser=new X(t)};J.prototype.write=function(t){return this.parser.write(t)},J.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Q=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Q),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t;if(1===arguments.length)et.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new tt:new tt(t)},et.equals=function(){var t,e,n;if(2===arguments.length)et.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new E,this._intPt[1]=new E,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new I;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return J.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+J.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=r>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new W(this._inputLines[0][0],this._inputLines[0][1]),n=new W(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,W.intersects(n,r,e)&&0===st.orientationIndex(n,r,e)&&0===st.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=H.intersection(t,n,r,i)}catch(a){if(!(a instanceof V))throw a;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new E(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=z.intersection(t,e,n,r),a=this.isInSegmentEnvelopes(o);G.out.println("DD in env = "+a+" --------------------- "+o),i.distance(o)>1e-4&&G.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new E(t),o=new E(e),a=new E(n),s=new E(r),u=new E;this.normalizeToEnvCentre(i,o,a,s,u);var l=this.safeHCoordinateIntersection(i,o,a,s);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=W.intersects(e,n,r),a=W.intersects(e,n,i),s=W.intersects(r,i,e),u=W.intersects(r,i,n);return o&&a?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||a||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,a=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>l?o:l)+(s<h?s:h))/2,d=((a>c?a:c)+(u<p?u:p))/2;i.x=f,i.y=d,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!W.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=st.orientationIndex(e,n,r),a=st.orientationIndex(e,n,i);if(o>0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var s=st.orientationIndex(r,i,e),u=st.orientationIndex(r,i,n);return s>0&&u>0||s<0&&u<0?t.NO_INTERSECTION:0===o&&0===a&&0===s&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===a||0===s||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new E(r):0===a?this._intPt[0]=new E(i):0===s?this._intPt[0]=new E(e):0===u&&(this._intPt[0]=new E(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=st.distancePointLine(t,n,r),a=st.distancePointLine(e,n,r);return a<o&&(o=a,i=e),(a=st.distancePointLine(n,t,e))<o&&(o=a,i=n),(a=st.distancePointLine(r,t,e))<o&&(o=a,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,a=n.y-e.y;return ot.signOfDet2x2(r,i,o,a)},ot.signOfDet2x2=function(t,e,n,r){var i=null,o=null,a=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(a=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=a*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(a=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=a*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};at.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,s=e.y-this._p.y,u=ot.signOfDet2x2(i,o,a,s);if(0===u)return this._isPointOnSegment=!0,null;s<o&&(u=-u),u>0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==C.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?C.BOUNDARY:this._crossingCount%2==1?C.INTERIOR:C.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof E&&P(arguments[1],j)){for(var t=arguments[1],e=new at(arguments[0]),n=new E,r=new E,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof E&&arguments[1]instanceof Array){for(var o=arguments[1],a=new at(arguments[0]),s=1;s<o.length;s++){var u=o[s],l=o[s-1];if(a.countSegment(u,l),a.isOnSegment())return a.getLocation()}return a.getLocation()}};var st=function(){},ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){return z.orientationIndex(t,e,n)},st.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(P(arguments[0],j)){var a=arguments[0],s=a.size();if(s<3)return 0;var u=new E,l=new E,c=new E;a.getCoordinate(0,l),a.getCoordinate(1,c);var h=l.x;c.x-=h;for(var p=0,f=1;f<s-1;f++)u.y=l.y,l.x=c.x,l.y=c.y,a.getCoordinate(f+1,c),c.x-=h,p+=l.x*(u.y-c.y);return p/2}},st.distanceLineLine=function(t,e,n,r){if(t.equals(e))return st.distancePointLine(t,n,r);if(n.equals(r))return st.distancePointLine(r,t,e);var i=!1;if(W.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var a=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),s=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=a/o;(u<0||u>1||s<0||s>1)&&(i=!0)}}else i=!0;return i?k.min(st.distancePointLine(t,n,r),st.distancePointLine(e,n,r),st.distancePointLine(n,t,e),st.distancePointLine(r,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==C.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new E;t.getCoordinate(0,r);for(var i=r.x,o=r.y,a=1;a<e;a++){t.getCoordinate(a,r);var s=r.x,u=r.y,l=s-i,c=u-o;n+=Math.sqrt(l*l+c*c),i=s,o=u}return n},st.isCCW=function(t){var e=t.length-1;if(e<3)throw new v("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var a=r;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(n)&&a!==r);var s=r;do{s=(s+1)%e}while(t[s].equals2D(n)&&s!==r);var u=t[a],l=t[s];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=st.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>0},st.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},st.computeOrientation=function(t,e,n){return st.orientationIndex(t,e,n)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new v("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=st.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];if(a.x===s.x&&a.y===s.y)return o.distance(a);var u=(s.x-a.x)*(s.x-a.x)+(s.y-a.y)*(s.y-a.y),l=((o.x-a.x)*(s.x-a.x)+(o.y-a.y)*(s.y-a.y))/u;if(l<=0)return o.distance(a);if(l>=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/u;return Math.abs(c)*Math.sqrt(u)}},st.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return st.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return st.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return st.COLLINEAR},Object.defineProperties(st,ut);var lt=function(){};lt.prototype.filter=function(t){},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},ht={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new v("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new W(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),a=i.compareTo(o);if(0!==a)return a}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[w,x,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},ht.serialVersionUID.get=function(){return 0x799ea46522854c00},ht.SORTINDEX_POINT.get=function(){return 0},ht.SORTINDEX_MULTIPOINT.get=function(){return 1},ht.SORTINDEX_LINESTRING.get=function(){return 2},ht.SORTINDEX_LINEARRING.get=function(){return 3},ht.SORTINDEX_MULTILINESTRING.get=function(){return 4},ht.SORTINDEX_POLYGON.get=function(){return 5},ht.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ht.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ht.geometryChangedFilter.get=function(){return pt},Object.defineProperties(ct,ht);var pt=function(){};pt.interfaces_=function(){return[lt]},pt.filter=function(t){t.geometryChangedAction()};var ft=function(){};ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft};var dt=function(){},mt={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};dt.prototype.isInBoundary=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},mt.Mod2BoundaryNodeRule.get=function(){return gt},mt.EndPointBoundaryNodeRule.get=function(){return yt},mt.MultiValentEndPointBoundaryNodeRule.get=function(){return vt},mt.MonoValentEndPointBoundaryNodeRule.get=function(){return _t},mt.MOD2_BOUNDARY_RULE.get=function(){return new gt},mt.ENDPOINT_BOUNDARY_RULE.get=function(){return new yt},mt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},mt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},mt.OGC_SFS_BOUNDARY_RULE.get=function(){return dt.MOD2_BOUNDARY_RULE},Object.defineProperties(dt,mt);var gt=function(){};gt.prototype.isInBoundary=function(t){return t%2==1},gt.prototype.interfaces_=function(){return[dt]},gt.prototype.getClass=function(){return gt};var yt=function(){};yt.prototype.isInBoundary=function(t){return t>0},yt.prototype.interfaces_=function(){return[dt]},yt.prototype.getClass=function(){return yt};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>1},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var _t=function(){};_t.prototype.isInBoundary=function(t){return 1===t},_t.prototype.interfaces_=function(){return[dt]},_t.prototype.getClass=function(){return _t};var bt=function(){};bt.prototype.add=function(){},bt.prototype.addAll=function(){},bt.prototype.isEmpty=function(){},bt.prototype.iterator=function(){},bt.prototype.size=function(){},bt.prototype.toArray=function(){},bt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var xt=function(){};xt.prototype.hasNext=function(){},xt.prototype.next=function(){},xt.prototype.remove=function(){};var 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.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(bt);(r.prototype=new Error).name="NoSuchElementException";var St=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,bt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Et(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wt),Et=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(xt),Mt=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof E&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l<s.length;l++)this.add(s[l],u);else for(var c=s.length-1;c>=0;c--)this.add(s[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof E){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(h<f&&this.get(h).equals2D(p))return null}}t.prototype.add.call(this,h,p)}}else if(4===arguments.length){var d=arguments[0],m=arguments[1],g=arguments[2],y=arguments[3],v=1;g>y&&(v=-1);for(var _=g;_!==y;_+=v)this.add(d[_],m);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new E(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(St),Tt=function(){},At={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};At.ForwardComparator.get=function(){return Ct},At.BidirectionalComparator.get=function(){return Ot},At.coordArrayType.get=function(){return new Array(0).fill(null)},Tt.prototype.interfaces_=function(){return[]},Tt.prototype.getClass=function(){return Tt},Tt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Tt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Tt.indexOf(r,e)<0)return r}return null},Tt.scroll=function(t,e){var n=Tt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);G.arraycopy(t,n,r,0,t.length-n),G.arraycopy(t,0,r,t.length-n,n),G.arraycopy(r,0,t,0,t.length)},Tt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(0!==o.compare(r[a],i[a]))return!1;return!0}},Tt.intersection=function(t,e){for(var n=new Mt,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Tt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Tt.removeRepeatedPoints=function(t){return Tt.hasRepeatedPoints(t)?new Mt(t,!1).toCoordinateArray():t},Tt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Tt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Tt.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new E(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=arguments[4],u=0;u<s;u++)o[a+u]=new E(r[i+u])},Tt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Tt.envelope=function(t){for(var e=new W,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Tt.toCoordinateArray=function(t){return t.toArray(Tt.coordArrayType)},Tt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Tt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Tt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},Tt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},Tt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},Tt.extract=function(t,e,n){e=k.clamp(e,0,t.length);var r=(n=k.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,a=e;a<=n;a++)i[o++]=t[a];return i},Object.defineProperties(Tt,At);var Ct=function(){};Ct.prototype.compare=function(t,e){return Tt.compare(t,e)},Ct.prototype.interfaces_=function(){return[S]},Ct.prototype.getClass=function(){return Ct};var Ot=function(){};Ot.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=Tt.compare(n,r);return Tt.isEqualReversed(n,r)?0:i},Ot.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=Tt.increasingDirection(n),o=Tt.increasingDirection(r),a=i>0?0:n.length-1,s=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[a].compareTo(r[s]);if(0!==l)return l;a+=i,s+=o}return 0},Ot.prototype.interfaces_=function(){return[S]},Ot.prototype.getClass=function(){return Ot};var Pt=function(){};Pt.prototype.get=function(){},Pt.prototype.put=function(){},Pt.prototype.size=function(){},Pt.prototype.values=function(){},Pt.prototype.entrySet=function(){};var kt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Pt);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new bt).contains=function(){};var Lt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new It(this)},e}(o),It=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(xt),Rt=0;(h.prototype=new kt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Rt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:n,color:Rt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===l(s(s(t)))){var e=c(s(s(t)));1===a(e)?(u(s(t),Rt),u(e,Rt),u(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),u(s(t),Rt),u(s(s(t)),1),this.rotateRight(s(s(t))))}else{var n=l(s(s(t)));1===a(n)?(u(s(t),Rt),u(n,Rt),u(s(s(t)),1),t=s(s(t))):(t===l(s(t))&&(t=s(t),this.rotateRight(t)),u(s(t),Rt),u(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Rt},h.prototype.values=function(){var t=new St,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new Lt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},h.prototype.size=function(){return this.size_};var Dt=function(){};Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},p.prototype=new o,(f.prototype=new p).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},f.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},f.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},f.prototype.remove=function(t){throw new i},f.prototype.size=function(){return this.array_.length},f.prototype.isEmpty=function(){return 0===this.array_.length},f.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},f.prototype.iterator=function(){return new Nt(this)};var Nt=function(t){this.treeSet_=t,this.position_=0};Nt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Nt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Nt.prototype.remove=function(){throw new i};var Ft=function(){};Ft.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},Ft.asList=function(t){for(var e=new St,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var zt=function(){},Bt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Bt.P.get=function(){return 0},Bt.L.get=function(){return 1},Bt.A.get=function(){return 2},Bt.FALSE.get=function(){return-1},Bt.TRUE.get=function(){return-2},Bt.DONTCARE.get=function(){return-3},Bt.SYM_FALSE.get=function(){return"F"},Bt.SYM_TRUE.get=function(){return"T"},Bt.SYM_DONTCARE.get=function(){return"*"},Bt.SYM_P.get=function(){return"0"},Bt.SYM_L.get=function(){return"1"},Bt.SYM_A.get=function(){return"2"},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.toDimensionSymbol=function(t){switch(t){case zt.FALSE:return zt.SYM_FALSE;case zt.TRUE:return zt.SYM_TRUE;case zt.DONTCARE:return zt.SYM_DONTCARE;case zt.P:return zt.SYM_P;case zt.L:return zt.SYM_L;case zt.A:return zt.SYM_A}throw new v("Unknown dimension value: "+t)},zt.toDimensionValue=function(t){switch(D.toUpperCase(t)){case zt.SYM_FALSE:return zt.FALSE;case zt.SYM_TRUE:return zt.TRUE;case zt.SYM_DONTCARE:return zt.DONTCARE;case zt.SYM_P:return zt.P;case zt.SYM_L:return zt.L;case zt.SYM_A:return zt.A}throw new v("Unknown dimension symbol: "+t)},Object.defineProperties(zt,Bt);var jt=function(){};jt.prototype.filter=function(t){},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt};var Ut=function(){};Ut.prototype.filter=function(t,e){},Ut.prototype.isDone=function(){},Ut.prototype.isGeometryChanged=function(){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Zt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new v("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new W,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Ft.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=zt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=zt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new f(Ft.asList(this._geometries)),n=new f(Ft.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),a=i.getNumGeometries(),s=0;s<o&&s<a;){var u=this.getGeometryN(s),l=i.getGeometryN(s),c=u.compareToSameClass(l,r);if(0!==c)return c;s++}return s<o?1:s<a?-1:0}},e.prototype.apply=function(){if(P(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(P(arguments[0],Ut)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(P(arguments[0],jt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(P(arguments[0],lt)){var a=arguments[0];a.filter(this);for(var s=0;s<this._geometries.length;s++)this._geometries[s].apply(a)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),Vt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?zt.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Gt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Zt),Gt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=dt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Gt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Gt.prototype.getBoundary=function(){return this._geom instanceof Xt?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Gt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Gt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Gt.prototype.computeBoundaryCoordinates=function(t){var e=new St;this._endpointMap=new h;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),a=o.getValue().count;this._bnRule.isInBoundary(a)&&e.add(o.getKey())}return Tt.toCoordinateArray(e)},Gt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Ht,this._endpointMap.put(t,e)),e.count++},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.getBoundary=function(){return 1===arguments.length?new Gt(arguments[0]).getBoundary():2===arguments.length?new Gt(arguments[0],arguments[1]).getBoundary():void 0};var Ht=function(){this.count=null};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht};var Wt=function(){},qt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Wt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[1],i="",o=new function(){}(new function(){}(Wt.getStackTrace(arguments[0]))),a=0;a<r;a++)try{i+=o.readLine()+Wt.NEWLINE}catch(t){if(!(t instanceof d))throw t;et.shouldNeverReachHere()}return i}},Wt.split=function(t,e){for(var n=e.length,r=new St,i=""+t,o=i.indexOf(e);o>=0;){var a=i.substring(0,o);r.add(a),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var s=new Array(r.size()).fill(null),u=0;u<s.length;u++)s[u]=r.get(u);return s},Wt.toString=function(){if(1===arguments.length){var t=arguments[0];return Wt.SIMPLE_ORDINATE_FORMAT.format(t)}},Wt.spaces=function(t){return Wt.chars(" ",t)},qt.NEWLINE.get=function(){return G.getProperty("line.separator")},qt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Wt,qt);var Yt=function(){};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Yt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,j.X)===t.getOrdinate(e-1,j.X)&&t.getOrdinate(0,j.Y)===t.getOrdinate(e-1,j.Y)},Yt.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var a=t.getOrdinate(i,o),s=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||_.isNaN(a)&&_.isNaN(s)))return!1}return!0},Yt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Yt.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Yt.copy(e,i-1,r,o,1);return r},Yt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Yt.swap(t,r,e-r)},Yt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Yt.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Yt.copyCoord(t,e+o,n,r+o)},Yt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new I;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Wt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Yt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Yt.createClosedRing(t,e,4):e.getOrdinate(0,j.X)===e.getOrdinate(n-1,j.X)&&e.getOrdinate(0,j.Y)===e.getOrdinate(n-1,j.Y)?e:Yt.createClosedRing(t,e,n+1)},Yt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Yt.copy(e,0,r,0,i);for(var o=i;o<n;o++)Yt.copy(e,0,r,o,1);return r};var Xt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new W:this._points.expandEnvelope(new W)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Yt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?zt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Yt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(P(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(P(arguments[0],Ut)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(P(arguments[0],jt)||P(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Gt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new v("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),$t=function(){};$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Kt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new W;var t=new W;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return zt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(P(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(P(arguments[0],Ut)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(P(arguments[0],jt)||P(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),Jt=function(){};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var Qt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new v("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new v("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),a=0;a<o.length;a++)t[++e]=o[a];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(st.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(st.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),a=t.getY(0),s=1;s<=4;s++){var u=t.getX(s),l=t.getY(s);if(u!==o==(l!==a))return!1;o=u,a=l}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!this._holes[a].equalsExact(r._holes[a],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Ft.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);G.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Tt.minCoordinate(e.getCoordinates());Tt.scroll(r,i),G.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],st.isCCW(e.getCoordinates())===n&&Tt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],o=this._shell,a=i._shell,s=o.compareToSameClass(a,r);if(0!==s)return s;for(var u=this.getNumInteriorRing(),l=i.getNumInteriorRing(),c=0;c<u&&c<l;){var h=this.getInteriorRingN(c),p=i.getInteriorRingN(c),f=h.compareToSameClass(p,r);if(0!==f)return f;c++}return c<u?1:c<l?-1:0}},e.prototype.apply=function(t){if(P(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(P(t,Ut)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(P(t,jt))t.filter(this);else if(P(t,lt)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return zt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Zt),ee=function(t){function e(e,n){e instanceof E&&n instanceof ye&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return zt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Yt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new v("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new v("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Xt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new St,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Zt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Zt?this.editGeometryCollection(t,e):t instanceof Qt?this.editPolygon(t,e):t instanceof Kt||t instanceof Xt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new St,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new St,o=0;o<n.getNumInteriorRing();o++){var a=this.edit(n.getInteriorRingN(o),e);null===a||a.isEmpty()||i.add(a)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return ae},ie.CoordinateSequenceOperation.get=function(){return se},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var ae=function(){};ae.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Xt?e.createLineString(n):t instanceof Kt?n.length>0?e.createPoint(n[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Xt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new E}else if(P(arguments[0],j)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var a=arguments[0],s=arguments[1];this._coordinates=new Array(a).fill(null),this._dimension=s;for(var u=0;u<a;u++)this._coordinates[u]=new E}},le={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case j.X:this._coordinates[t].x=n;break;case j.Y:this._coordinates[t].y=n;break;case j.Z:this._coordinates[t].z=n;break;default:throw new v("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case j.X:return this._coordinates[t].x;case j.Y:return this._coordinates[t].y;case j.Z:return this._coordinates[t].z}return _.NaN},ue.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ue.prototype.getCoordinateCopy=function(t){return new E(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new I(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[j,e]},ue.prototype.getClass=function(){return ue},le.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,le);var ce=function(){},he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ue(arguments[0]);if(P(arguments[0],j))return new ue(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ue(t):new ue(t,e)}},ce.prototype.interfaces_=function(){return[A,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he);var pe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new St,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Lt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Pt),fe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof me){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new R(n).compareTo(new R(r))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return _.isNaN(t)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof E){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,x]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,de);var me=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ge={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};me.prototype.readResolve=function(){return me.nameToTypeMap.get(this._name)},me.prototype.toString=function(){return this._name},me.prototype.interfaces_=function(){return[e]},me.prototype.getClass=function(){return me},ge.serialVersionUID.get=function(){return-552860263173159e4},ge.nameToTypeMap.get=function(){return new pe},Object.defineProperties(me,ge),fe.Type=me,fe.FIXED=new me("FIXED"),fe.FLOATING=new me("FLOATING"),fe.FLOATING_SINGLE=new me("FLOATING SINGLE");var ye=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?P(arguments[0],A)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ve={serialVersionUID:{configurable:!0}};ye.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new E(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new E(t.getMinX(),t.getMinY()),new E(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new E(t.getMinX(),t.getMinY()),new E(t.getMinX(),t.getMaxY()),new E(t.getMaxX(),t.getMaxY()),new E(t.getMaxX(),t.getMinY()),new E(t.getMinX(),t.getMinY())]),null)},ye.prototype.createLineString=function(t){return t?t instanceof Array?new Xt(this.getCoordinateSequenceFactory().create(t),this):P(t,j)?new Xt(t,this):void 0:new Xt(this.getCoordinateSequenceFactory().create([]),this)},ye.prototype.createMultiLineString=function(){return 0===arguments.length?new Vt(null,this):1===arguments.length?new Vt(arguments[0],this):void 0},ye.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ye.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Qt)return this.createMultiPolygon(ye.toPolygonArray(t));if(s instanceof Xt)return this.createMultiLineString(ye.toLineStringArray(t));if(s instanceof Kt)return this.createMultiPoint(ye.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},ye.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ye.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof E){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(P(arguments[0],j))return new Kt(arguments[0],this)}},ye.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ye.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(P(arguments[0],j)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Qt(arguments[0],arguments[1],this)},ye.prototype.getSRID=function(){return this._SRID},ye.prototype.createGeometryCollection=function(){return 0===arguments.length?new Zt(null,this):1===arguments.length?new Zt(arguments[0],this):void 0},ye.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ye.prototype.getPrecisionModel=function(){return this._precisionModel},ye.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(P(arguments[0],j))return new ee(arguments[0],this)}},ye.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ye.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(P(arguments[0],j)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Yt.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},ye.prototype.interfaces_=function(){return[e]},ye.prototype.getClass=function(){return ye},ye.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},ye.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ve.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(ye,ve);var _e=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],be=function(t){this.geometryFactory=t||new ye};be.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!xe[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==_e.indexOf(n)?xe[n].apply(this,[e.coordinates]):"GeometryCollection"===n?xe[n].apply(this,[e.geometries]):xe[n].apply(this,[e])},be.prototype.write=function(t){var e=t.getGeometryType();if(!we[e])throw new Error("Geometry is not supported");return we[e].apply(this,[t])};var xe={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!xe[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=xe.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new E(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new E(t[0],t[1]),new E(t[2],t[1]),new E(t[2],t[3]),new E(t[0],t[3]),new E(t[0],t[1])])},Point:function(t){var e=new E(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(xe.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=xe.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(xe.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=xe.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],a=xe.coordinates.apply(this,[o]),s=this.geometryFactory.createLinearRing(a);r.push(s)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(xe.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},we={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:we.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(we.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=we.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=we.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=we.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(we[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Se=function(t){this.geometryFactory=t||new ye,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new be(this.geometryFactory)};Se.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},Se.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ee=function(){this.parser=new be(this.geometryFactory)};Ee.prototype.write=function(t){return this.parser.write(t)};var Me=function(){},Te={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.opposite=function(t){return t===Me.LEFT?Me.RIGHT:t===Me.RIGHT?Me.LEFT:t},Te.ON.get=function(){return 0},Te.LEFT.get=function(){return 1},Te.RIGHT.get=function(){return 2},Object.defineProperties(Me,Te),(m.prototype=new Error).name="EmptyStackException",(g.prototype=new wt).add=function(t){return this.array_.push(t),!0},g.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},g.prototype.push=function(t){return this.array_.push(t),t},g.prototype.pop=function(t){if(0===this.array_.length)throw new m;return this.array_.pop()},g.prototype.peek=function(){if(0===this.array_.length)throw new m;return this.array_[this.array_.length-1]},g.prototype.empty=function(){return 0===this.array_.length},g.prototype.isEmpty=function(){return this.empty()},g.prototype.search=function(t){return this.array_.indexOf(t)},g.prototype.size=function(){return this.array_.length},g.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ae=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ae.prototype.getCoordinate=function(){return this._minCoord},Ae.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Ae.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=st.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===st.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===st.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Ae.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Me.LEFT;return n[e].y<n[e+1].y&&(r=Me.RIGHT),r},Ae.prototype.getEdge=function(){return this._orientedDe},Ae.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ae.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ae.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Me.LEFT&&(this._orientedDe=this._minDe.getSym())},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae};var Ce=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new E(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Q),Oe=function(){this.array_=[]};Oe.prototype.addLast=function(t){this.array_.push(t)},Oe.prototype.removeFirst=function(){return this.array_.shift()},Oe.prototype.isEmpty=function(){return 0===this.array_.length};var Pe=function(){this._finder=null,this._dirEdgeList=new St,this._nodes=new St,this._rightMostCoord=null,this._env=null,this._finder=new Ae};Pe.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Pe.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Pe.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Ce("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Pe.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Me.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Pe.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Pe.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Me.RIGHT)>=1&&e.getDepth(Me.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Pe.prototype.computeDepths=function(t){var e=new Lt,n=new Oe,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},Pe.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Pe.prototype.getEnvelope=function(){if(null===this._env){for(var t=new W,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Pe.prototype.addReachable=function(t){var e=new g;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Pe.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Me.LEFT,t.getDepth(Me.RIGHT)),e.setDepth(Me.RIGHT,t.getDepth(Me.LEFT))},Pe.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Pe.prototype.getNodes=function(){return this._nodes},Pe.prototype.getDirectedEdges=function(){return this._dirEdgeList},Pe.prototype.interfaces_=function(){return[x]},Pe.prototype.getClass=function(){return Pe};var ke=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Me.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];this.init(3),this.location[Me.ON]=o,this.location[Me.LEFT]=a,this.location[Me.RIGHT]=s}};ke.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},ke.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==C.NONE)return!1;return!0},ke.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===C.NONE&&(this.location[e]=t)},ke.prototype.isLine=function(){return 1===this.location.length},ke.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Me.ON]=this.location[Me.ON],e[Me.LEFT]=C.NONE,e[Me.RIGHT]=C.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===C.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},ke.prototype.getLocations=function(){return this.location},ke.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Me.LEFT];this.location[Me.LEFT]=this.location[Me.RIGHT],this.location[Me.RIGHT]=t},ke.prototype.toString=function(){var t=new I;return this.location.length>1&&t.append(C.toLocationSymbol(this.location[Me.LEFT])),t.append(C.toLocationSymbol(this.location[Me.ON])),this.location.length>1&&t.append(C.toLocationSymbol(this.location[Me.RIGHT])),t.toString()},ke.prototype.setLocations=function(t,e,n){this.location[Me.ON]=t,this.location[Me.LEFT]=e,this.location[Me.RIGHT]=n},ke.prototype.get=function(t){return t<this.location.length?this.location[t]:C.NONE},ke.prototype.isArea=function(){return this.location.length>1},ke.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===C.NONE)return!0;return!1},ke.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Me.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},ke.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(C.NONE)},ke.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},ke.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke};var Le=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new ke(e),this.elt[1]=new ke(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new ke(n.elt[0]),this.elt[1]=new ke(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new ke(C.NONE),this.elt[1]=new ke(C.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];this.elt[0]=new ke(o,a,s),this.elt[1]=new ke(o,a,s)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new ke(C.NONE,C.NONE,C.NONE),this.elt[1]=new ke(C.NONE,C.NONE,C.NONE),this.elt[u].setLocations(l,c,h)}};Le.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Le.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Le.prototype.isNull=function(t){return this.elt[t].isNull()},Le.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Le.prototype.isLine=function(t){return this.elt[t].isLine()},Le.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new ke(t.elt[e]):this.elt[e].merge(t.elt[e])},Le.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Le.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Me.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Le.prototype.toString=function(){var t=new I;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Le.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Le.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Le.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Me.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Le.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Le.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Le.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new ke(this.elt[t].location[0]))},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.toLineLabel=function(t){for(var e=new Le(C.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ie=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new St,this._pts=new St,this._label=new Le(C.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new St,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ie.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=st.isCCW(this._ring.getCoordinates())},Ie.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Ie.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ce("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ce("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Ie.prototype.getLinearRing=function(){return this._ring},Ie.prototype.getCoordinate=function(t){return this._pts.get(t)},Ie.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Ie.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var a=r.length-2;n&&(a=r.length-1);for(var s=a;s>=0;s--)this._pts.add(r[s])}},Ie.prototype.isHole=function(){return this._isHole},Ie.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Ie.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Ie.prototype.addHole=function(t){this._holes.add(t)},Ie.prototype.isShell=function(){return null===this._shell},Ie.prototype.getLabel=function(){return this._label},Ie.prototype.getEdges=function(){return this._edges},Ie.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ie.prototype.getShell=function(){return this._shell},Ie.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Me.RIGHT);if(n===C.NONE)return null;if(this._label.getLocation(e)===C.NONE)return this._label.setLocation(e,n),null}},Ie.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Ie.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var Re=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ie),De=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new St,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Re(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ie),Ne=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};Ne.prototype.setVisited=function(t){this._isVisited=t},Ne.prototype.setInResult=function(t){this._isInResult=t},Ne.prototype.isCovered=function(){return this._isCovered},Ne.prototype.isCoveredSet=function(){return this._isCoveredSet},Ne.prototype.setLabel=function(t){this._label=t},Ne.prototype.getLabel=function(){return this._label},Ne.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Ne.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Ne.prototype.isInResult=function(){return this._isInResult},Ne.prototype.isVisited=function(){return this._isVisited},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne};var Fe=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Le(0,C.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=C.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==C.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Le(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Le)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===C.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=C.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;if(e===C.BOUNDARY)n=C.INTERIOR;else n=C.BOUNDARY;this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ne),ze=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};ze.prototype.find=function(t){return this.nodeMap.get(t)},ze.prototype.addNode=function(){if(arguments[0]instanceof E){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Fe){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},ze.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},ze.prototype.iterator=function(){return this.nodeMap.values().iterator()},ze.prototype.values=function(){return this.nodeMap.values()},ze.prototype.getBoundaryNodes=function(t){for(var e=new St,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===C.BOUNDARY&&e.add(r)}return e},ze.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze};var Be=function(){},je={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Be.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Be.NE:Be.SE:e>=0?Be.NW:Be.SW}if(arguments[0]instanceof E&&arguments[1]instanceof E){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new v("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Be.NE:Be.SE:r.y>=n.y?Be.NW:Be.SW}},je.NE.get=function(){return 0},je.NW.get=function(){return 1},je.SW.get=function(){return 2},je.SE.get=function(){return 3},Object.defineProperties(Be,je);var Ue=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}};Ue.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:st.computeOrientation(t._p0,t._p1,this._p1)},Ue.prototype.getDy=function(){return this._dy},Ue.prototype.getCoordinate=function(){return this._p0},Ue.prototype.setNode=function(t){this._node=t},Ue.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Ue.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ue.prototype.getDirectedCoordinate=function(){return this._p1},Ue.prototype.getDx=function(){return this._dx},Ue.prototype.getLabel=function(){return this._label},Ue.prototype.getEdge=function(){return this._edge},Ue.prototype.getQuadrant=function(){return this._quadrant},Ue.prototype.getNode=function(){return this._node},Ue.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Ue.prototype.computeLabel=function(t){},Ue.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Be.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Ue.prototype.interfaces_=function(){return[x]},Ue.prototype.getClass=function(){return Ue};var Ze=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Le(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Ce("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Me.LEFT)===C.INTERIOR&&this._label.getLocation(e,Me.RIGHT)===C.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Me.LEFT]+"/"+this._depth[Me.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,C.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,C.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Me.LEFT&&(r=-1);var i=Me.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===C.EXTERIOR&&e===C.INTERIOR?1:t===C.INTERIOR&&e===C.EXTERIOR?-1:0},e}(Ue),Ve=function(){};Ve.prototype.createNode=function(t){return new Fe(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var Ge=function(){if(this._edges=new St,this._nodes=null,this._edgeEndList=new St,0===arguments.length)this._nodes=new ze(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new ze(t)}};Ge.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},Ge.prototype.find=function(t){return this._nodes.find(t)},Ge.prototype.addNode=function(){if(arguments[0]instanceof Fe){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof E){var e=arguments[0];return this._nodes.addNode(e)}},Ge.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ge.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ge.prototype.debugPrintln=function(t){G.out.println(t)},Ge.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===C.BOUNDARY},Ge.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ge.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&st.computeOrientation(t,e,r)===st.COLLINEAR&&Be.quadrant(t,e)===Be.quadrant(n,r)},Ge.prototype.getEdgeEnds=function(){return this._edgeEndList},Ge.prototype.debugPrint=function(t){G.out.print(t)},Ge.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ge.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Ge.prototype.insertEdge=function(t){this._edges.add(t)},Ge.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ge.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ze(n,!0),i=new Ze(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ge.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ge.prototype.getNodes=function(){return this._nodes.values()},Ge.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var He=function(){this._geometryFactory=null,this._shellList=new St;var t=arguments[0];this._geometryFactory=t};He.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},He.prototype.computePolygons=function(t){for(var e=new St,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},He.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Ce("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},He.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new St,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):n.addAll(a)}else r.add(o)}return r},He.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},He.prototype.buildMaximalEdgeRings=function(t){for(var e=new St,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new De(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},He.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},He.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},He.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&st.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(o=u)}return o},He.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},He.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0];Ge.linkResultDirectedEdges(arguments[1]);var n=this.buildMaximalEdgeRings(e),r=new St,i=this.buildMinimalEdgeRings(n,this._shellList,r);this.sortShellsAndHoles(i,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var We=function(){};We.prototype.getBounds=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var qe=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};qe.prototype.getItem=function(){return this._item},qe.prototype.getBounds=function(){return this._bounds},qe.prototype.interfaces_=function(){return[We,e]},qe.prototype.getClass=function(){return qe};var Ye=function(){this._size=null,this._items=null,this._size=0,this._items=new St,this._items.add(null)};Ye.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Ye.prototype.size=function(){return this._size},Ye.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Ye.prototype.clear=function(){this._size=0,this._items.clear()},Ye.prototype.isEmpty=function(){return 0===this._size},Ye.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var Xe=function(){};Xe.prototype.visitItem=function(t){},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var $e=function(){};$e.prototype.insert=function(t,e){},$e.prototype.remove=function(t,e){},$e.prototype.query=function(){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Ke=function(){if(this._childBoundables=new St,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Je={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[We,e]},Ke.prototype.getClass=function(){return Ke},Je.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Je);var Qe=function(){};Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.sort=function(t,e){var n=t.toArray();e?Ft.sort(n,e):Ft.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},Qe.singletonList=function(t){var e=new St;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new v("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new tn(o,e,this._itemDistance);a.getDistance()<r&&n.add(a)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[x]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Ke};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new St,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ke?t+=this.size(n):n instanceof qe&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof qe&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new St:t}if(1===arguments.length){for(var e=arguments[0],n=new St,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ke){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof qe?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new qe(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new St;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Ke?this.boundablesAtLevel(n,a,i):(et.isTrue(a instanceof qe),-1===n&&i.add(a))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new St;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(P(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var i=arguments[0],o=arguments[2],a=arguments[1].getChildBoundables(),s=0;s<a.size();s++){var u=a.get(s);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof Ke?this.query(i,u,o):u instanceof qe?o.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(P(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var l=arguments[0],c=arguments[2],h=arguments[1].getChildBoundables(),p=0;p<h.size();p++){var f=h.get(p);this.getIntersectsOp().intersects(f.getBounds(),l)&&(f instanceof Ke?this.query(l,f,c):f instanceof qe?c.add(f.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var a=null,s=r.getChildBoundables().iterator();s.hasNext();){var u=s.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Ke&&(o=this.remove(n,u,i))){a=u;break}}return null!==a&&a.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(a),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ke){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new St;n.add(this.createNode(e));var r=new St(t);Qe.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var an=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new St,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new sn(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new St;for(var a=0;i.hasNext()&&a<n;){var s=i.next();r[o].add(s),a++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(P(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var i=arguments[0],o=arguments[1],a=arguments[2];t.prototype.query.call(this,i,o,a)}else if(P(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var s=arguments[0],u=arguments[1],l=arguments[2];t.prototype.query.call(this,s,u,l)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new St(t);Qe.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(P(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,_.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&P(arguments[1],on)){var i=arguments[0],o=arguments[1],a=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(a)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var s=arguments[0],u=arguments[1],l=null,c=new Ye;for(c.add(s);!c.isEmpty()&&u>0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],d=new qe(arguments[0],arguments[1]),m=new tn(this.getRoot(),d,f);return this.nearestNeighbour(m)[0]}},n.prototype.interfaces_=function(){return[$e,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return sn},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[S]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[S]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),sn=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new W(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),un=function(){};un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ln=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new E(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ln.prototype.getCoordinate=function(){return this.coord},ln.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ln.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},ln.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ln.prototype.isInterior=function(){return this._isInterior},ln.prototype.interfaces_=function(){return[x]},ln.prototype.getClass=function(){return ln};var cn=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new Mt;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new St;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new R(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new E(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new E(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new R(e[0])),r=i}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new E(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this._edge.getCoordinate(s);return i&&(o[a]=new E(e.coord)),new dn(o,this._edge.getData())},cn.prototype.add=function(t,e){var n=new ln(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Q("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Q("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var hn=function(){};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof E&&arguments[1]instanceof E){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new v("Cannot compute the octant for two identical points "+i);return hn.octant(a,s)}};var pn=function(){};pn.prototype.getCoordinates=function(){},pn.prototype.size=function(){},pn.prototype.getCoordinate=function(t){},pn.prototype.isClosed=function(){},pn.prototype.setData=function(t){},pn.prototype.getData=function(){},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var fn=function(){};fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[pn]},fn.prototype.getClass=function(){return fn};var dn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};dn.prototype.getCoordinates=function(){return this._pts},dn.prototype.size=function(){return this._pts.length},dn.prototype.getCoordinate=function(t){return this._pts[t]},dn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},dn.prototype.setData=function(t){this._data=t},dn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hn.octant(t,e)},dn.prototype.getData=function(){return this._data},dn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new E(arguments[0].getIntersection(r));this.addIntersection(i,n)}},dn.prototype.toString=function(){return J.toLineString(new ue(this._pts))},dn.prototype.getNodeList=function(){return this._nodeList},dn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},dn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},dn.prototype.interfaces_=function(){return[fn]},dn.prototype.getClass=function(){return dn},dn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new St;return dn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var mn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new E,this.p1=new E;else if(1===arguments.length){var t=arguments[0];this.p0=new E(t.p0),this.p1=new E(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new E(e,n),this.p1=new E(r,i)}},gn={serialVersionUID:{configurable:!0}};mn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},mn.prototype.orientationIndex=function(){if(arguments[0]instanceof mn){var t=arguments[0],e=st.orientationIndex(this.p0,this.p1,t.p0),n=st.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof E){var r=arguments[0];return st.orientationIndex(this.p0,this.p1,r)}},mn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},mn.prototype.isVertical=function(){return this.p0.x===this.p1.x},mn.prototype.equals=function(t){if(!(t instanceof mn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},mn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},mn.prototype.project=function(){if(arguments[0]instanceof E){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new E(t);var e=this.projectionFactor(t),n=new E;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof mn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(r.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(r.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new mn(a,s)}},mn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},mn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},mn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},mn.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},mn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},mn.prototype.midPoint=function(){return mn.midPoint(this.p0,this.p1)},mn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?_.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},mn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=_.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))<r&&(r=i,n[0]=a,n[1]=t.p1);var s=t.closestPoint(this.p0);(i=s.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=s);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},mn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},mn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},mn.prototype.getLength=function(){return this.p0.distance(this.p1)},mn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},mn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},mn.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},mn.prototype.lineIntersection=function(t){try{return H.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},mn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},mn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(i*i+o*o),s=0,u=0;if(0!==e){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*i/a,u=e*o/a}return new E(n-u,r+s)},mn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},mn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||_.isNaN(e))&&(e=1),e},mn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},mn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},mn.prototype.distance=function(){if(arguments[0]instanceof mn){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof E){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},mn.prototype.pointAlong=function(t){var e=new E;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},mn.prototype.hashCode=function(){var t=_.doubleToLongBits(this.p0.x);t^=31*_.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=_.doubleToLongBits(this.p1.x);return n^=31*_.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},mn.prototype.interfaces_=function(){return[x,e]},mn.prototype.getClass=function(){return mn},mn.midPoint=function(t,e){return new E((t.x+e.x)/2,(t.y+e.y)/2)},gn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(mn,gn);var yn=function(){this.tempEnv1=new W,this.tempEnv2=new W,this._overlapSeg1=new mn,this._overlapSeg2=new mn};yn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var vn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};vn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},vn.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,r),a<n&&this.computeSelect(t,a,n,r)},vn.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},vn.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},vn.prototype.setId=function(t){this._id=t},vn.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},vn.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new W(t,e)}return this._env},vn.prototype.getEndIndex=function(){return this._end},vn.prototype.getStartIndex=function(){return this._start},vn.prototype.getContext=function(){return this._context},vn.prototype.getId=function(){return this._id},vn.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var a=this._pts[t],s=this._pts[e],u=n._pts[r],l=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(a,s),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var _n=function(){};_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.getChainStartIndices=function(t){var e=0,n=new St;n.add(new R(e));do{var r=_n.findChainEnd(t,e);n.add(new R(r)),e=r}while(e<t.length-1);return _n.toIntArray(n)},_n.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Be.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Be.quadrant(t[i-1],t[i])===r);)i++;return i-1},_n.getChains=function(){if(1===arguments.length)return _n.getChains(arguments[0],null);if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=new St,r=_n.getChainStartIndices(t),i=0;i<r.length-1;i++){var o=new vn(t,r[i],r[i+1],e);n.add(o)}return n}},_n.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var bn=function(){};bn.prototype.computeNodes=function(t){},bn.prototype.getNodedSubstrings=function(){},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn};var xn=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};xn.prototype.setSegmentIntersector=function(t){this._segInt=t},xn.prototype.interfaces_=function(){return[bn]},xn.prototype.getClass=function(){return xn};var wn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new St,this._index=new an,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=_n.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new Sn(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return Sn},Object.defineProperties(e,n),e}(xn),Sn=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[0].getContext(),o=n.getContext();this._si.processIntersections(i,e,o,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yn),En=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},Mn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};En.prototype.getEndCapStyle=function(){return this._endCapStyle},En.prototype.isSingleSided=function(){return this._isSingleSided},En.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=En.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=En.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==En.JOIN_ROUND&&(this._quadrantSegments=En.DEFAULT_QUADRANT_SEGMENTS)},En.prototype.getJoinStyle=function(){return this._joinStyle},En.prototype.setJoinStyle=function(t){this._joinStyle=t},En.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},En.prototype.getSimplifyFactor=function(){return this._simplifyFactor},En.prototype.getQuadrantSegments=function(){return this._quadrantSegments},En.prototype.setEndCapStyle=function(t){this._endCapStyle=t},En.prototype.getMitreLimit=function(){return this._mitreLimit},En.prototype.setMitreLimit=function(t){this._mitreLimit=t},En.prototype.setSingleSided=function(t){this._isSingleSided=t},En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En},En.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Mn.CAP_ROUND.get=function(){return 1},Mn.CAP_FLAT.get=function(){return 2},Mn.CAP_SQUARE.get=function(){return 3},Mn.JOIN_ROUND.get=function(){return 1},Mn.JOIN_MITRE.get=function(){return 2},Mn.JOIN_BEVEL.get=function(){return 3},Mn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Mn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Mn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(En,Mn);var Tn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},An={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Tn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,r)&&this.isShallowSampled(i,o,t,n,r)},Tn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Tn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Tn.prototype.isShallowConcavity=function(t,e,n,r){return st.computeOrientation(t,e,n)===this._angleOrientation&&st.distancePointLine(e,t,n)<r},Tn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Tn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var a=n;a<r;a+=o)if(!this.isShallow(t,e,this._inputLine[a],i))return!1;return!0},Tn.prototype.isConcave=function(t,e,n){return st.computeOrientation(t,e,n)===this._angleOrientation},Tn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=st.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Tn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Tn.DELETE;)e++;return e},Tn.prototype.isShallow=function(t,e,n,r){return st.distancePointLine(e,t,n)<r},Tn.prototype.collapseLine=function(){for(var t=new Mt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Tn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Tn.simplify=function(t,e){return new Tn(t).simplify(e)},An.INIT.get=function(){return 0},An.DELETE.get=function(){return 1},An.KEEP.get=function(){return 1},An.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Tn,An);var Cn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new St},On={COORDINATE_ARRAY_TYPE:{configurable:!0}};Cn.prototype.getCoordinates=function(){return this._ptList.toArray(Cn.COORDINATE_ARRAY_TYPE)},Cn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Cn.prototype.addPt=function(t){var e=new E(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Cn.prototype.revere=function(){},Cn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Cn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Cn.prototype.toString=function(){return(new ye).createLineString(this.getCoordinates()).toString()},Cn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new E(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Cn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},On.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Cn,On);var Pn=function(){},kn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.toDegrees=function(t){return 180*t/Math.PI},Pn.normalize=function(t){for(;t>Math.PI;)t-=Pn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Pn.PI_TIMES_2;return t},Pn.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Pn.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Pn.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Pn.interiorAngle=function(t,e,n){var r=Pn.angle(e,t),i=Pn.angle(e,n);return Math.abs(i-r)},Pn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Pn.PI_TIMES_2;t>=Pn.PI_TIMES_2&&(t=0)}else{for(;t>=Pn.PI_TIMES_2;)t-=Pn.PI_TIMES_2;t<0&&(t=0)}return t},Pn.angleBetween=function(t,e,n){var r=Pn.angle(e,t),i=Pn.angle(e,n);return Pn.diff(r,i)},Pn.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Pn.toRadians=function(t){return t*Math.PI/180},Pn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Pn.COUNTERCLOCKWISE:n<0?Pn.CLOCKWISE:Pn.NONE},Pn.angleBetweenOriented=function(t,e,n){var r=Pn.angle(e,t),i=Pn.angle(e,n)-r;return i<=-Math.PI?i+Pn.PI_TIMES_2:i>Math.PI?i-Pn.PI_TIMES_2:i},kn.PI_TIMES_2.get=function(){return 2*Math.PI},kn.PI_OVER_2.get=function(){return Math.PI/2},kn.PI_OVER_4.get=function(){return Math.PI/4},kn.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},kn.CLOCKWISE.get=function(){return st.CLOCKWISE},kn.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Pn,kn);var Ln=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new mn,this._seg1=new mn,this._offset0=new mn,this._offset1=new mn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===En.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},In={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Ln.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=st.computeOrientation(this._s0,this._s1,this._s2),r=n===st.CLOCKWISE&&this._side===Me.LEFT||n===st.COUNTERCLOCKWISE&&this._side===Me.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Ln.prototype.addLineEndCap=function(t,e){var n=new mn(t,e),r=new mn;this.computeOffsetSegment(n,Me.LEFT,this._distance,r);var i=new mn;this.computeOffsetSegment(n,Me.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case En.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case En.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case En.CAP_SQUARE:var u=new E;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var l=new E(r.p1.x+u.x,r.p1.y+u.y),c=new E(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},Ln.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ln.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=H.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof V))throw t;o=new E(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Ln.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);r===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,i),this._segList.addPt(n)},Ln.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===En.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===En.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},Ln.prototype.createSquare=function(t){this._segList.addPt(new E(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new E(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new E(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new E(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Ln.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Ln.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ln.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Ln.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Ln.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Pn.angle(i,this._seg0.p0),a=Pn.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,s=Pn.normalize(o+a),u=Pn.normalize(s+Math.PI),l=r*n,c=n-l*Math.abs(Math.sin(a)),h=i.x+l*Math.cos(u),p=i.y+l*Math.sin(u),f=new E(h,p),d=new mn(i,f),m=d.pointAlongOffset(1,c),g=d.pointAlongOffset(1,-c);this._side===Me.LEFT?(this._segList.addPt(m),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(m))},Ln.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Me.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,s=Math.sqrt(o*o+a*a),u=i*n*o/s,l=i*n*a/s;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u},Ln.prototype.addFilletArc=function(t,e,n,r,i){var o=r===st.CLOCKWISE?-1:1,a=Math.abs(e-n),s=Math.trunc(a/this._filletAngleQuantum+.5);if(s<1)return null;for(var u=a/s,l=0,c=new E;l<a;){var h=e+o*l;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),l+=u}},Ln.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new E((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new E((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ln.prototype.createCircle=function(t){var e=new E(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ln.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ln.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Cn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ln.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===En.JOIN_BEVEL||this._bufParams.getJoinStyle()===En.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,st.CLOCKWISE,this._distance))},Ln.prototype.closeRing=function(){this._segList.closeRing()},Ln.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},In.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},In.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},In.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},In.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ln,In);var Rn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Rn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Tt.reverse(o),o},Rn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Tn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Me.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{n.addSegments(t,!1);var s=Tn.simplify(t,r),u=s.length-1;n.initSideSegments(s[0],s[1],Me.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(s[l],!0)}n.addLastSegment(),n.closeRing()},Rn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Me.RIGHT&&(r=-r);var i=Tn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;n.addNextSegment(i[a],s)}n.closeRing()},Rn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Tn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Me.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var a=Tn.simplify(t,-n),s=a.length-1;e.initSideSegments(a[s],a[s-1],Me.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Rn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case En.CAP_ROUND:e.createCircle(t);break;case En.CAP_SQUARE:e.createSquare(t)}},Rn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Rn.prototype.getBufferParameters=function(){return this._bufParams},Rn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Rn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Rn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Rn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Tn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Me.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{var s=Tn.simplify(t,r),u=s.length-1;n.initSideSegments(s[0],s[1],Me.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(s[l],!0)}n.addLastSegment()},Rn.prototype.getSegGen=function(t){return new Ln(this._precisionModel,this._bufParams,t)},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Rn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new E(t[n]);return e};var Dn=function(){this._subgraphs=null,this._seg=new mn,this._cga=new st;var t=arguments[0];this._subgraphs=t},Nn={DepthSegment:{configurable:!0}};Dn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new St,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(P(arguments[2],wt)&&arguments[0]instanceof E&&arguments[1]instanceof Ze){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,o)===st.RIGHT)){var c=a.getDepth(Me.LEFT);this._seg.p0.equals(u[l])||(c=a.getDepth(Me.RIGHT));var h=new Fn(this._seg,c);s.add(h)}}else if(P(arguments[2],wt)&&arguments[0]instanceof E&&P(arguments[1],wt))for(var p=arguments[0],f=arguments[2],d=arguments[1].iterator();d.hasNext();){var m=d.next();m.isForward()&&this.findStabbedSegments(p,m,f)}},Dn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Qe.min(e)._leftDepth},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Nn.DepthSegment.get=function(){return Fn},Object.defineProperties(Dn,Nn);var Fn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new mn(t),this._leftDepth=e};Fn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Fn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fn.prototype.toString=function(){return this._upwardSeg.toString()},Fn.prototype.interfaces_=function(){return[x]},Fn.prototype.getClass=function(){return Fn};var zn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};zn.prototype.area=function(){return zn.area(this.p0,this.p1,this.p2)},zn.prototype.signedArea=function(){return zn.signedArea(this.p0,this.p1,this.p2)},zn.prototype.interpolateZ=function(t){if(null===t)throw new v("Supplied point is null.");return zn.interpolateZ(t,this.p0,this.p1,this.p2)},zn.prototype.longestSideLength=function(){return zn.longestSideLength(this.p0,this.p1,this.p2)},zn.prototype.isAcute=function(){return zn.isAcute(this.p0,this.p1,this.p2)},zn.prototype.circumcentre=function(){return zn.circumcentre(this.p0,this.p1,this.p2)},zn.prototype.area3D=function(){return zn.area3D(this.p0,this.p1,this.p2)},zn.prototype.centroid=function(){return zn.centroid(this.p0,this.p1,this.p2)},zn.prototype.inCentre=function(){return zn.inCentre(this.p0,this.p1,this.p2)},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},zn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},zn.det=function(t,e,n,r){return t*r-e*n},zn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,a=n.x-i,s=r.x-i,u=n.y-o,l=r.y-o,c=a*l-s*u,h=t.x-i,p=t.y-o,f=(l*h-s*p)/c,d=(-u*h+a*p)/c;return e.z+f*(n.z-e.z)+d*(r.z-e.z)},zn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),a=r;return i>a&&(a=i),o>a&&(a=o),a},zn.isAcute=function(t,e,n){return!!Pn.isAcute(t,e,n)&&!!Pn.isAcute(e,n,t)&&!!Pn.isAcute(n,t,e)},zn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,a=t.y-i,s=e.x-r,u=e.y-i,l=2*zn.det(o,a,s,u),c=zn.det(a,o*o+a*a,u,s*s+u*u),h=zn.det(o,o*o+a*a,s,s*s+u*u);return new E(r-c/l,i+h/l)},zn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new H(t.x+n/2,t.y+r/2,1),o=new H(t.x-r+n/2,t.y+n+r/2,1);return new H(i,o)},zn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,a=n.y-t.y;return new E(t.x+i*o,t.y+i*a)},zn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=n.x-t.x,s=n.y-t.y,u=n.z-t.z,l=i*u-o*s,c=o*a-r*u,h=r*s-i*a,p=l*l+c*c+h*h;return Math.sqrt(p)/2},zn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new E(r,i)},zn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),a=r+i+o,s=(r*t.x+i*e.x+o*n.x)/a,u=(r*t.y+i*e.y+o*n.y)/a;return new E(s,u)};var Bn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new St;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Bn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.prototype.addPolygon=function(t){var e=this._distance,n=Me.LEFT;this._distance<0&&(e=-this._distance,n=Me.RIGHT);var r=t.getExteriorRing(),i=Tt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,C.EXTERIOR,C.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var a=t.getInteriorRingN(o),s=Tt.removeRepeatedPoints(a.getCoordinates());this._distance>0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,e,Me.opposite(n),C.INTERIOR,C.EXTERIOR)}},Bn.prototype.isTriangleErodedCompletely=function(t,e){var n=new zn(t[0],t[1],t[2]),r=n.inCentre();return st.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Bn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Tt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new dn(t,new Le(0,C.BOUNDARY,e,n));this._curveList.add(r)},Bn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Bn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,a=i;t.length>=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(o=i,a=r,n=Me.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,o,a)},Bn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Xt?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof Vt||t instanceof ne||t instanceof Zt)&&this.addCollection(t)},Bn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Bn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn};var jn=function(){};jn.prototype.locate=function(t){},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn};var Un=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Un.prototype.next=function(){if(this._atStart)return this._atStart=!1,Un.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof Zt?(this._subcollectionIterator=new Un(t),this._subcollectionIterator.next()):t},Un.prototype.remove=function(){throw new Error(this.getClass().getName())},Un.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Un.prototype.interfaces_=function(){return[xt]},Un.prototype.getClass=function(){return Un},Un.isAtomic=function(t){return!(t instanceof Zt)};var Zn=function(){this._geom=null;var t=arguments[0];this._geom=t};Zn.prototype.locate=function(t){return Zn.locate(t,this._geom)},Zn.prototype.interfaces_=function(){return[jn]},Zn.prototype.getClass=function(){return Zn},Zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},Zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Zn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Zn.isPointInRing(t,i))return!1}return!0},Zn.containsPoint=function(t,e){if(e instanceof Qt)return Zn.containsPointInPolygon(t,e);if(e instanceof Zt)for(var n=new Un(e);n.hasNext();){var r=n.next();if(r!==e&&Zn.containsPoint(t,r))return!0}return!1},Zn.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:Zn.containsPoint(t,e)?C.INTERIOR:C.EXTERIOR};var Vn=function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[C.NONE,C.NONE]};Vn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Vn.prototype.propagateSideLabels=function(t){for(var e=C.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Me.LEFT)!==C.NONE&&(e=r.getLocation(t,Me.LEFT))}if(e===C.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getLabel();if(s.getLocation(t,Me.ON)===C.NONE&&s.setLocation(t,Me.ON,i),s.isArea(t)){var u=s.getLocation(t,Me.LEFT),l=s.getLocation(t,Me.RIGHT);if(l!==C.NONE){if(l!==i)throw new Ce("side location conflict",a.getCoordinate());u===C.NONE&&et.shouldNeverReachHere("found single null side (at "+a.getCoordinate()+")"),i=u}else et.isTrue(s.getLocation(t,Me.LEFT)===C.NONE,"found single null side"),s.setLocation(t,Me.RIGHT,i),s.setLocation(t,Me.LEFT,i)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){G.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Vn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Vn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Me.LEFT);et.isTrue(r!==C.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var a=o.next().getLabel();et.isTrue(a.isArea(t),"Found non-area edge");var s=a.getLocation(t,Me.LEFT),u=a.getLocation(t,Me.RIGHT);if(s===u)return!1;if(u!==i)return!1;i=s}return!0},Vn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Vn.prototype.iterator=function(){return this.getEdges().iterator()},Vn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new St(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===C.NONE&&(this._ptInAreaLocation[t]=Zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new I;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Vn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Vn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===C.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var a=o.next(),s=a.getLabel(),u=0;u<2;u++)if(s.isAnyNull(u)){var l=C.NONE;if(e[u])l=C.EXTERIOR;else{var c=a.getCoordinate();l=this.getLocation(u,c,t)}s.setAllLocationsIfNull(u,l)}},Vn.prototype.getDegree=function(){return this._edgeMap.size()},Vn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var Gn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Ce("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Be.isNorthern(i)&&Be.isNorthern(o)?n:Be.isNorthern(i)||Be.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){G.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new St;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Me.LEFT),r=t.getDepth(Me.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Ce("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],a=arguments[2],s=arguments[0];s<o;s++){var u=this._edgeList.get(s);u.setEdgeDepths(Me.RIGHT,a),a=u.getDepth(Me.LEFT)}return a}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;n=a,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=C.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=C.INTERIOR;break}if(r.isInResult()){t=C.EXTERIOR;break}}}if(t===C.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===C.INTERIOR):(a.isInResult()&&(i=C.EXTERIOR),s.isInResult()&&(i=C.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Le(C.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==C.INTERIOR&&o!==C.BOUNDARY||this._label.setLocation(i,C.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Hn=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.createNode=function(t){return new Fe(t,new Gn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),Wn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Wn.prototype.compareTo=function(t){var e=t;return Wn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Wn.prototype.interfaces_=function(){return[x]},Wn.prototype.getClass=function(){return Wn},Wn.orientation=function(t){return 1===Tt.increasingDirection(t)},Wn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,a=e?t.length:-1,s=r?n.length:-1,u=e?0:t.length-1,l=r?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=i)===a,p=(l+=o)===s;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var qn=function(){this._edges=new St,this._ocaMap=new h};qn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},qn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},qn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},qn.prototype.iterator=function(){return this._edges.iterator()},qn.prototype.getEdges=function(){return this._edges},qn.prototype.get=function(t){return this._edges.get(t)},qn.prototype.findEqualEdge=function(t){var e=new Wn(t.getCoordinates());return this._ocaMap.get(e)},qn.prototype.add=function(t){this._edges.add(t);var e=new Wn(t.getCoordinates());this._ocaMap.put(e,t)},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn};var Yn=function(){};Yn.prototype.processIntersections=function(t,e,n,r){},Yn.prototype.isDone=function(){},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var Xn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Xn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Xn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Xn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Xn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Xn.prototype.getLineIntersector=function(){return this._li},Xn.prototype.hasProperIntersection=function(){return this._hasProper},Xn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Xn.prototype.hasIntersection=function(){return this._hasIntersection},Xn.prototype.isDone=function(){return!1},Xn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Xn.prototype.interfaces_=function(){return[Yn]},Xn.prototype.getClass=function(){return Xn},Xn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var $n=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new E(t),this.segmentIndex=e,this.dist=n};$n.prototype.getSegmentIndex=function(){return this.segmentIndex},$n.prototype.getCoordinate=function(){return this.coord},$n.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},$n.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},$n.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},$n.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},$n.prototype.getDistance=function(){return this.dist},$n.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},$n.prototype.interfaces_=function(){return[x]},$n.prototype.getClass=function(){return $n};var Kn=function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Kn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Kn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new E(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new nr(o,new Le(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new $n(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Jn=function(){};Jn.prototype.getChainStartIndices=function(t){var e=0,n=new St;n.add(new R(e));do{var r=this.findChainEnd(t,e);n.add(new R(r)),e=r}while(e<t.length-1);return Jn.toIntArray(n)},Jn.prototype.findChainEnd=function(t,e){for(var n=Be.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Be.quadrant(t[r-1],t[r])===n;)r++;return r-1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn},Jn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Qn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new W,this.env2=new W;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Jn;this.startIndex=e.getChainStartIndices(this.pts)};Qn.prototype.getCoordinates=function(){return this.pts},Qn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Qn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Qn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[i],h=this.pts[o],p=a.pts[s],f=a.pts[u];if(o-i==1&&u-s==1)return l.addIntersections(this.e,i,a.e,s),null;if(this.env1.init(c,h),this.env2.init(p,f),!this.env1.intersects(this.env2))return null;var d=Math.trunc((i+o)/2),m=Math.trunc((s+u)/2);i<d&&(s<m&&this.computeIntersectsForChain(i,d,a,s,m,l),m<u&&this.computeIntersectsForChain(i,d,a,m,u,l)),d<o&&(s<m&&this.computeIntersectsForChain(d,o,a,s,m,l),m<u&&this.computeIntersectsForChain(d,o,a,m,u,l))}},Qn.prototype.getStartIndexes=function(){return this.startIndex},Qn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var tr=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Me.RIGHT]-this._depth[t][Me.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?C.EXTERIOR:C.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==C.EXTERIOR&&r!==C.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===C.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===C.EXTERIOR?0:t===C.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Le.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,a=0;a<this.pts.length;a++)if(this.pts[a].equals2D(n.pts[a])||(r=!1),this.pts[a].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Qn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new W;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new E(t.getIntersection(r)),o=e,a=t.getEdgeDistance(n,r),s=o+1;if(s<this.pts.length){var u=this.pts[s];i.equals2D(u)&&(o=s,a=0)}this.eiList.add(i,o,a)},e.prototype.toString=function(){var t=new I;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Me.ON),e.getLocation(1,Me.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Me.LEFT),e.getLocation(1,Me.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Me.RIGHT),e.getLocation(1,Me.RIGHT),2))},e}(Ne),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new qn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Le(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new St,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),a=new Dn(n).getDepth(o);i.computeDepth(a),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new St,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Pe;i.create(r),e.add(i)}}return Qe.sort(e,Qe.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new wn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Xn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Rn(n,this._bufParams),i=new Bn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ge(new Hn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),a=new He(this._geomFact);this.buildSubgraphs(o,a);var s=a.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var a=i.getData(),s=new nr(i.getCoordinates(),new Le(a));this.insertUniqueEdge(s)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Me.LEFT),n=t.getLocation(0,Me.RIGHT);return e===C.INTERIOR&&n===C.EXTERIOR?1:e===C.EXTERIOR&&n===C.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new ye,n=new St;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(P(arguments[0],bt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&G.out.println(n)}},ir.prototype.scale=function(){if(P(arguments[0],bt)){for(var t=arguments[0],e=new St,n=t.iterator();n.hasNext();){var r=n.next();e.add(new dn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),a=0;a<i.length;a++)o[a]=new E(Math.round((i[a].x-this._offsetX)*this._scaleFactor),Math.round((i[a].y-this._offsetY)*this._scaleFactor),i[a].z);return Tt.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[bn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},ar={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Q("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],a=i.getCoordinates(),s=o.getCoordinates(),u=0;u<a.length-1;u++)for(var l=0;l<s.length-1;l++)this.checkInteriorIntersections(i,u,o,l);else if(4===arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3];if(c===p&&h===f)return null;var d=c.getCoordinates()[h],m=c.getCoordinates()[h+1],g=p.getCoordinates()[f],y=p.getCoordinates()[f+1];if(this._li.computeIntersection(d,m,g,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,m)||this.hasInteriorIntersection(this._li,g,y)))throw new Q("found non-noded intersection at "+d+"-"+m+" and "+g+"-"+y)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Q("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},ar.fact.get=function(){return new ye},Object.defineProperties(or,ar);var sr=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new v("Scale factor must be non-zero");1!==e&&(this._pt=new E(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new E,this._p1Scaled=new E),this.initCorners(this._pt)},ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(a&&s),"Found bad envelope test"),s},sr.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new E(this._maxx,this._maxy),this._corner[1]=new E(this._minx,this._maxy),this._corner[2]=new E(this._minx,this._miny),this._corner[3]=new E(this._maxx,this._miny)},sr.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sr.prototype.getCoordinate=function(){return this._originalPt},sr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new W(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sr.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},sr.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},sr.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sr,ur);var lr=function(){this.tempEnv1=new W,this.selectedSegment=new mn};lr.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr};var cr=function(){this._index=null;var t=arguments[0];this._index=t},hr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new pr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Xe]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},hr.HotPixelSnapAction.get=function(){return pr},Object.defineProperties(cr,hr);var pr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(lr),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new St};fr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},fr.prototype.isDone=function(){return!1},fr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},fr.prototype.interfaces_=function(){return[Yn]},fr.prototype.getClass=function(){return fr};var dr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};dr.prototype.checkCorrectness=function(t){var e=dn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof Z))throw t;t.printStackTrace()}},dr.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},dr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},dr.prototype.findInteriorIntersections=function(t,e){var n=new fr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},dr.prototype.computeVertexSnaps=function(){if(P(arguments[0],bt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof dn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new sr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},dr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new wn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},dr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},dr.prototype.interfaces_=function(){return[bn]},dr.prototype.getClass=function(){return dr};var mr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new En,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},gr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};mr.prototype.bufferFixedPrecision=function(t){var e=new ir(new dr(new fe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},mr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=mr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Ce))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=mr.precisionScaleFactor(this._argGeom,this._distance,n),i=new fe(r);this.bufferFixedPrecision(i)}},mr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},mr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},mr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Q))throw t;this._saveException=t}},mr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},mr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new mr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new mr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof En&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var i=arguments[1];return new mr(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],a=arguments[2],s=arguments[3],u=new mr(arguments[0]);return u.setQuadrantSegments(a),u.setEndCapStyle(s),u.getResultGeometry(o)}},mr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=k.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},gr.CAP_ROUND.get=function(){return En.CAP_ROUND},gr.CAP_BUTT.get=function(){return En.CAP_FLAT},gr.CAP_FLAT.get=function(){return En.CAP_FLAT},gr.CAP_SQUARE.get=function(){return En.CAP_SQUARE},gr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(mr,gr);var yr=function(){this._pt=[new E,new E],this._distance=_.NaN,this._isNull=!0};yr.prototype.getCoordinates=function(){return this._pt},yr.prototype.getCoordinate=function(t){return this._pt[t]},yr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},yr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},yr.prototype.getDistance=function(){return this._distance},yr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var vr=function(){};vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},vr.computeDistance=function(){if(arguments[2]instanceof yr&&arguments[0]instanceof Xt&&arguments[1]instanceof E)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new mn,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var o=r.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof yr&&arguments[0]instanceof Qt&&arguments[1]instanceof E){var a=arguments[0],s=arguments[1],u=arguments[2];vr.computeDistance(a.getExteriorRing(),s,u);for(var l=0;l<a.getNumInteriorRing();l++)vr.computeDistance(a.getInteriorRingN(l),s,u)}else if(arguments[2]instanceof yr&&arguments[0]instanceof ct&&arguments[1]instanceof E){var c=arguments[0],h=arguments[1],p=arguments[2];if(c instanceof Xt)vr.computeDistance(c,h,p);else if(c instanceof Qt)vr.computeDistance(c,h,p);else if(c instanceof Zt)for(var f=c,d=0;d<f.getNumGeometries();d++){var m=f.getGeometryN(d);vr.computeDistance(m,h,p)}else p.setMinimum(c.getCoordinate(),h)}else if(arguments[2]instanceof yr&&arguments[0]instanceof mn&&arguments[1]instanceof E){var g=arguments[1],y=arguments[2],v=arguments[0].closestPoint(g);y.setMinimum(v,g)}};var _r=function(t){this._maxPtDist=new yr,this._inputGeom=t||null},br={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};_r.prototype.computeMaxMidpointDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},_r.prototype.computeMaxVertexDistance=function(t){var e=new xr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},_r.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},_r.prototype.getDistancePoints=function(){return this._maxPtDist},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},br.MaxPointDistanceFilter.get=function(){return xr},br.MaxMidpointDistanceFilter.get=function(){return wr},Object.defineProperties(_r,br);var xr=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};xr.prototype.filter=function(t){this._minPtDist.initialize(),vr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xr.prototype.getMaxPointDistance=function(){return this._maxPtDist},xr.prototype.interfaces_=function(){return[ft]},xr.prototype.getClass=function(){return xr};var wr=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};wr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new E((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),vr.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.isDone=function(){return!1},wr.prototype.isGeometryChanged=function(){return!1},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[Ut]},wr.prototype.getClass=function(){return wr};var Sr=function(t){this._comps=t||null};Sr.prototype.filter=function(t){t instanceof Qt&&this._comps.add(t)},Sr.prototype.interfaces_=function(){return[jt]},Sr.prototype.getClass=function(){return Sr},Sr.getPolygons=function(){if(1===arguments.length)return Sr.getPolygons(arguments[0],new St);if(2===arguments.length){var t=arguments[0],e=arguments[1];return t instanceof Qt?e.add(t):t instanceof Zt&&t.apply(new Sr(e)),e}};var Er=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Er.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Xt&&this._lines.add(t)},Er.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Er.prototype.interfaces_=function(){return[lt]},Er.prototype.getClass=function(){return Er},Er.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Er.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Er.getLines(e,n))}},Er.getLines=function(){if(1===arguments.length)return Er.getLines(arguments[0],!1);if(2===arguments.length){if(P(arguments[0],bt)&&P(arguments[1],bt)){for(var t=arguments[1],e=arguments[0].iterator();e.hasNext();){var n=e.next();Er.getLines(n,t)}return t}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var r=arguments[0],i=arguments[1],o=new St;return r.apply(new Er(o,i)),o}if(arguments[0]instanceof ct&&P(arguments[1],bt)){var a=arguments[0],s=arguments[1];return a instanceof Xt?s.add(a):a.apply(new Er(s)),s}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&P(arguments[0],bt)&&P(arguments[1],bt)){for(var u=arguments[1],l=arguments[2],c=arguments[0].iterator();c.hasNext();){var h=c.next();Er.getLines(h,u,l)}return u}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&P(arguments[1],bt)){var p=arguments[1],f=arguments[2];return arguments[0].apply(new Er(p,f)),p}}};var Mr=function(){if(this._boundaryRule=dt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new v("Rule must be non-null");this._boundaryRule=t}};Mr.prototype.locateInternal=function(){if(arguments[0]instanceof E&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return C.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===C.EXTERIOR)return C.EXTERIOR;if(r===C.BOUNDARY)return C.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),a=this.locateInPolygonRing(t,o);if(a===C.INTERIOR)return C.EXTERIOR;if(a===C.BOUNDARY)return C.BOUNDARY}return C.INTERIOR}if(arguments[0]instanceof E&&arguments[1]instanceof Xt){var s=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(s))return C.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!s.equals(l[0])&&!s.equals(l[l.length-1])?st.isOnLine(s,l)?C.INTERIOR:C.EXTERIOR:C.BOUNDARY}if(arguments[0]instanceof E&&arguments[1]instanceof Kt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?C.INTERIOR:C.EXTERIOR}},Mr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?st.locatePointInRing(t,e.getCoordinates()):C.EXTERIOR},Mr.prototype.intersects=function(t,e){return this.locate(t,e)!==C.EXTERIOR},Mr.prototype.updateLocationInfo=function(t){t===C.INTERIOR&&(this._isIn=!0),t===C.BOUNDARY&&this._numBoundaries++},Mr.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Xt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Qt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,a=0;a<o.getNumGeometries();a++){var s=o.getGeometryN(a);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof Zt)for(var u=new Un(e);u.hasNext();){var l=u.next();l!==e&&this.computeLocation(t,l)}},Mr.prototype.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:e instanceof Xt||e instanceof Qt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?C.BOUNDARY:this._numBoundaries>0||this._isIn?C.INTERIOR:C.EXTERIOR)},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr};var Tr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Ar={INSIDE_AREA:{configurable:!0}};Tr.prototype.isInsideArea=function(){return this._segIndex===Tr.INSIDE_AREA},Tr.prototype.getCoordinate=function(){return this._pt},Tr.prototype.getGeometryComponent=function(){return this._component},Tr.prototype.getSegmentIndex=function(){return this._segIndex},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Ar.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Tr,Ar);var Cr=function(t){this._pts=t||null};Cr.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Cr.prototype.interfaces_=function(){return[jt]},Cr.prototype.getClass=function(){return Cr},Cr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Qe.singletonList(t):Cr.getPoints(t,new St)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof Zt&&e.apply(new Cr(n)),n}};var Or=function(){this._locations=null;var t=arguments[0];this._locations=t};Or.prototype.filter=function(t){(t instanceof Kt||t instanceof Xt||t instanceof Qt)&&this._locations.add(new Tr(t,0,t.getCoordinate()))},Or.prototype.interfaces_=function(){return[jt]},Or.prototype.getClass=function(){return Or},Or.getLocations=function(t){var e=new St;return t.apply(new Or(e)),e};var Pr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Mr,this._minDistanceLocation=null,this._minDistance=_.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Pr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=Sr.getPolygons(this._geom[e]);if(i.size()>0){var o=Or.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&P(arguments[0],wt)&&P(arguments[1],wt)){for(var a=arguments[0],s=arguments[1],u=arguments[2],l=0;l<a.size();l++)for(var c=a.get(l),h=0;h<s.size();h++)if(this.computeContainmentDistance(c,s.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Tr&&arguments[1]instanceof Qt){var p=arguments[0],f=arguments[1],d=arguments[2],m=p.getCoordinate();if(C.EXTERIOR!==this._ptLocator.locate(m,f))return this._minDistance=0,d[0]=p,d[1]=new Tr(f,m),null}},Pr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o);if(this.computeMinDistance(i,a,n),this._minDistance<=this._terminateDistance)return null}},Pr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Er.getLines(this._geom[0]),n=Er.getLines(this._geom[1]),r=Cr.getPoints(this._geom[0]),i=Cr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Pr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Pr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Pr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Pr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Xt&&arguments[1]instanceof Kt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var a=st.distancePointLine(i,r[o],r[o+1]);if(a<this._minDistance){this._minDistance=a;var s=new mn(r[o],r[o+1]).closestPoint(i);n[0]=new Tr(t,o,s),n[1]=new Tr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Xt&&arguments[1]instanceof Xt){var u=arguments[0],l=arguments[1],c=arguments[2];if(u.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),p=l.getCoordinates(),f=0;f<h.length-1;f++)for(var d=0;d<p.length-1;d++){var m=st.distanceLineLine(h[f],h[f+1],p[d],p[d+1]);if(m<this._minDistance){this._minDistance=m;var g=new mn(h[f],h[f+1]),y=new mn(p[d],p[d+1]),v=g.closestPoints(y);c[0]=new Tr(u,f,v[0]),c[1]=new Tr(l,d,v[1])}if(this._minDistance<=this._terminateDistance)return null}}},Pr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o),s=i.getCoordinate().distance(a.getCoordinate());if(s<this._minDistance&&(this._minDistance=s,n[0]=new Tr(i,0,i.getCoordinate()),n[1]=new Tr(a,0,a.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Pr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new v("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Pr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o);if(this.computeMinDistance(i,a,n),this._minDistance<=this._terminateDistance)return null}},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.distance=function(t,e){return new Pr(t,e).distance()},Pr.isWithinDistance=function(t,e,n){return new Pr(t,e,n).distance()<=n},Pr.nearestPoints=function(t,e){return new Pr(t,e).nearestPoints()};var kr=function(){this._pt=[new E,new E],this._distance=_.NaN,this._isNull=!0};kr.prototype.getCoordinates=function(){return this._pt},kr.prototype.getCoordinate=function(t){return this._pt[t]},kr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},kr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},kr.prototype.toString=function(){return J.toLineString(this._pt[0],this._pt[1])},kr.prototype.getDistance=function(){return this._distance},kr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr};var Lr=function(){};Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.computeDistance=function(){if(arguments[2]instanceof kr&&arguments[0]instanceof Xt&&arguments[1]instanceof E)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new mn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var a=r.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof kr&&arguments[0]instanceof Qt&&arguments[1]instanceof E){var s=arguments[0],u=arguments[1],l=arguments[2];Lr.computeDistance(s.getExteriorRing(),u,l);for(var c=0;c<s.getNumInteriorRing();c++)Lr.computeDistance(s.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof kr&&arguments[0]instanceof ct&&arguments[1]instanceof E){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Xt)Lr.computeDistance(h,p,f);else if(h instanceof Qt)Lr.computeDistance(h,p,f);else if(h instanceof Zt)for(var d=h,m=0;m<d.getNumGeometries();m++){var g=d.getGeometryN(m);Lr.computeDistance(g,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof kr&&arguments[0]instanceof mn&&arguments[1]instanceof E){var y=arguments[1],v=arguments[2],_=arguments[0].closestPoint(y);v.setMinimum(_,y)}};var Ir=function(){this._g0=null,this._g1=null,this._ptDist=new kr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Rr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ir.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ir.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new v("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ir.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ir.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ir.prototype.computeOrientedDistance=function(t,e,n){var r=new Dr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Nr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Ir.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir},Ir.distance=function(){if(2===arguments.length)return new Ir(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Ir(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Rr.MaxPointDistanceFilter.get=function(){return Dr},Rr.MaxDensifiedByFractionDistanceFilter.get=function(){return Nr},Object.defineProperties(Ir,Rr);var Dr=function(){this._maxPtDist=new kr,this._minPtDist=new kr,this._euclideanDist=new Lr,this._geom=null;var t=arguments[0];this._geom=t};Dr.prototype.filter=function(t){this._minPtDist.initialize(),Lr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Dr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dr.prototype.interfaces_=function(){return[ft]},Dr.prototype.getClass=function(){return Dr};var Nr=function(){this._maxPtDist=new kr,this._minPtDist=new kr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Nr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,a=0;a<this._numSubSegs;a++){var s=n.x+a*i,u=n.y+a*o,l=new E(s,u);this._minPtDist.initialize(),Lr.computeDistance(this._geom,l,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Nr.prototype.isDone=function(){return!1},Nr.prototype.isGeometryChanged=function(){return!1},Nr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Nr.prototype.interfaces_=function(){return[Ut]},Nr.prototype.getClass=function(){return Nr};var Fr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},zr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fr.prototype.checkMaximumDistance=function(t,e,n){var r=new Ir(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+J.toLineString(i[0],i[1])+")"}},Fr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fr.VERBOSE&&G.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Qt||this._input instanceof ne||this._input instanceof Zt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fr.prototype.getErrorIndicator=function(){return this._errorIndicator},Fr.prototype.checkMinimumDistance=function(t,e,n){var r=new Pr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+J.toLineString(i[0],i[1])+" )"}},Fr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Fr.prototype.getErrorLocation=function(){return this._errorLocation},Fr.prototype.getPolygonLines=function(t){for(var e=new St,n=new Er(e),r=Sr.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Fr.prototype.getErrorMessage=function(){return this._errMsg},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},zr.VERBOSE.get=function(){return!1},zr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Fr,zr);var Br=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},jr={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Br.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Br.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Br.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new W(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new W(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Br.prototype.checkDistance=function(){var t=new Fr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Br.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Br.prototype.checkPolygonal=function(){this._result instanceof Qt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Br.prototype.report=function(t){if(!Br.VERBOSE)return null;G.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Br.prototype.getErrorMessage=function(){return this._errorMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.isValidMsg=function(t,e,n){var r=new Br(t,e,n);return r.isValid()?null:r.getErrorMessage()},Br.isValid=function(t,e,n){return!!new Br(t,e,n).isValid()},jr.VERBOSE.get=function(){return!1},jr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,jr);var Ur=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ur.prototype.getCoordinates=function(){return this._pts},Ur.prototype.size=function(){return this._pts.length},Ur.prototype.getCoordinate=function(t){return this._pts[t]},Ur.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ur.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Ur.prototype.setData=function(t){this._data=t},Ur.prototype.getData=function(){return this._data},Ur.prototype.toString=function(){return J.toLineString(new ue(this._pts))},Ur.prototype.interfaces_=function(){return[pn]},Ur.prototype.getClass=function(){return Ur};var Zr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new St,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Zr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Zr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Zr.prototype.getIntersectionSegments=function(){return this._intSegments},Zr.prototype.count=function(){return this._intersectionCount},Zr.prototype.getIntersections=function(){return this._intersections},Zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Zr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Zr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Zr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Zr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Zr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Zr.prototype.interfaces_=function(){return[Yn]},Zr.prototype.getClass=function(){return Zr},Zr.createAllIntersectionsFinder=function(t){var e=new Zr(t);return e.setFindAllIntersections(!0),e},Zr.createAnyIntersectionFinder=function(t){return new Zr(t)},Zr.createIntersectionCounter=function(t){var e=new Zr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Vr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Vr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Vr.prototype.isValid=function(){return this.execute(),this._isValid},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Zr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Vr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ce(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Vr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+J.toLineString(t[0],t[1])+" and "+J.toLineString(t[2],t[3])},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.computeIntersections=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Gr=function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))};Gr.prototype.checkValid=function(){this._nv.checkValid()},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.toSegmentStrings=function(t){for(var e=new St,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Ur(r.getCoordinates(),r))}return e},Gr.checkValid=function(t){new Gr(t).checkValid()};var Hr=function(t){this._mapOp=t};Hr.prototype.map=function(t){for(var e=new St,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(ye.toGeometryArray(e))},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr},Hr.map=function(t,e){return new Hr(e).map(t)};var Wr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new St,this._resultLineList=new St;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Wr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},Wr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Wr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Wr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Ti.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Wr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Wr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Wr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Wr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Ti.isResultOfOp(r,e)&&e===Ti.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var qr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new St;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};qr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},qr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Ti.INTERSECTION)){var r=n.getLabel();Ti.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},qr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var Yr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Yr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Yr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new St,o=0;o<t.getNumInteriorRing();o++){var a=this.transformLinearRing(t.getInteriorRingN(o),t);null===a||a.isEmpty()||(a instanceof ee||(n=!1),i.add(a))}if(n)return this._factory.createPolygon(r,i.toArray([]));var s=new St;return null!==r&&s.add(r),s.addAll(i),this._factory.buildGeometry(s)},Yr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Yr.prototype.getInputGeometry=function(){return this._inputGeom},Yr.prototype.transformMultiLineString=function(t,e){for(var n=new St,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Yr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Yr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Yr.prototype.transformMultiPoint=function(t,e){for(var n=new St,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Yr.prototype.transformMultiPolygon=function(t,e){for(var n=new St,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Yr.prototype.copy=function(t){return t.copy()},Yr.prototype.transformGeometryCollection=function(t,e){for(var n=new St,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ye.toGeometryArray(n)):this._factory.buildGeometry(n)},Yr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Xt)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof Qt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof Zt)return this.transformGeometryCollection(t,null);throw new v("Unknown Geometry subtype: "+t.getClass().getName())},Yr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Xr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new mn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Xt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Xr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new E(o)),0===r&&this._isClosed&&t.set(t.size()-1,new E(o)))}},Xr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Xr.prototype.snapTo=function(t){var e=new Mt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Xr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new E(i),!1)}},Xr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=_.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Xr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var $r=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};$r.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Jr(e,n).transform(this._srcGeom)},$r.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Jr(t,n,!0).transform(this._srcGeom),i=r;return e&&P(i,Jt)&&(i=r.buffer(0)),i},$r.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},$r.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},$r.prototype.computeMinimumSegmentLength=function(t){for(var e=_.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.snap=function(t,e,n){var r=new Array(2).fill(null),i=new $r(t);r[0]=i.snapTo(e,n);var o=new $r(e);return r[1]=o.snapTo(r[0],n),r},$r.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=$r.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fe.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min($r.computeOverlaySnapTolerance(i),$r.computeOverlaySnapTolerance(o))}},$r.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*$r.SNAP_PRECISION_FACTOR},$r.snapToSelf=function(t,e,n){return new $r(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties($r,Kr);var Jr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Xr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Yr),Qr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qr.prototype.getCommon=function(){return _.longBitsToDouble(this._commonBits)},Qr.prototype.add=function(t){var e=_.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qr.signExpBits(this._commonBits),this._isFirst=!1,null):Qr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=_.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+_.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Qr.signExpBits=function(t){return t>>52},Qr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qr.getBit(t,r)!==Qr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new E(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Qr,this._commonBitsY=new Qr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new E(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ft]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Ut]},ri.prototype.getClass=function(){return ri};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new $r(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Ti.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||G.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=$r.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return $r.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Ti.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Ti.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Ti.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Ti.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Ti.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Ti.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ti.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ti.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ti.DIFFERENCE)};var ai=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var si=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};si.prototype.isDelete=function(){return this._eventType===si.DELETE},si.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},si.prototype.getObject=function(){return this._obj},si.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},si.prototype.getInsertEvent=function(){return this._insertEvent},si.prototype.isInsert=function(){return this._eventType===si.INSERT},si.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},si.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},si.prototype.interfaces_=function(){return[x]},si.prototype.getClass=function(){return si},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(si,ui);var li=function(){};li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var ci=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new St,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ci&&P(arguments[0],wt)&&P(arguments[1],wt)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&P(arguments[0],wt)&&arguments[1]instanceof ci){var a=arguments[0],s=arguments[1];arguments[2]?this.addEdges(a,null):this.addEdges(a),this.computeIntersections(s)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new ai(n,i),a=new si(e,n.getMinX(i),o);this.events.add(a),this.events.add(new si(n.getMaxX(i),a))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var a=this.events.get(o);if(a.isInsert()){var s=a.getObject();n.isSameLabel(a)||(i.computeIntersections(s,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(li),pi=function(){this._min=_.POSITIVE_INFINITY,this._max=_.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}};pi.prototype.getMin=function(){return this._min},pi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},pi.prototype.getMax=function(){return this._max},pi.prototype.toString=function(){return J.toLineString(new E(this._min,0),new E(this._max,0))},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},fi.NodeComparator.get=function(){return di},Object.defineProperties(pi,fi);var di=function(){};di.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},di.prototype.interfaces_=function(){return[S]},di.prototype.getClass=function(){return di};var mi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),gi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),yi=function(){this._leaves=new St,this._root=null,this._level=0};yi.prototype.buildTree=function(){Qe.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,n=new St;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},yi.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new mi(t,e,n))},yi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},yi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},yi.prototype.printNode=function(t){G.out.println(J.toLineString(new E(t._min,this._level),new E(t._max,this._level)))},yi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},yi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new gi(t.get(n),t.get(n+1));e.add(i)}}},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var vi=function(){this._items=new St};vi.prototype.visitItem=function(t){this._items.add(t)},vi.prototype.getItems=function(){return this._items},vi.prototype.interfaces_=function(){return[Xe]},vi.prototype.getClass=function(){return vi};var _i=function(){this._index=null;var t=arguments[0];if(!P(t,Jt))throw new v("Argument must be Polygonal");this._index=new wi(t)},bi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};_i.prototype.locate=function(t){var e=new at(t),n=new xi(e);return this._index.query(t.y,t.y,n),e.getLocation()},_i.prototype.interfaces_=function(){return[jn]},_i.prototype.getClass=function(){return _i},bi.SegmentVisitor.get=function(){return xi},bi.IntervalIndexedGeometry.get=function(){return wi},Object.defineProperties(_i,bi);var xi=function(){this._counter=null;var t=arguments[0];this._counter=t};xi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},xi.prototype.interfaces_=function(){return[Xe]},xi.prototype.getClass=function(){return xi};var wi=function(){this._index=new yi;var t=arguments[0];this.init(t)};wi.prototype.init=function(t){for(var e=Er.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new mn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},wi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new vi;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Si=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new pe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Mr,2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=a,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;r.getLocation(t,Me.ON)===C.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new ci(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),a=this._parentGeom instanceof ee||this._parentGeom instanceof Qt||this._parentGeom instanceof ne,s=n||!a;return o.computeIntersections(this._edges,i,s),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new ci(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,C.INTERIOR)}else if(arguments[0]instanceof E){var e=arguments[0];this.insertPoint(this._argIndex,e,C.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),C.EXTERIOR,C.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,C.INTERIOR,C.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],C.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],C.BOUNDARY)},e.prototype.addLineString=function(t){var e=Tt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Le(this._argIndex,C.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===C.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Tt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;st.isCCW(r)&&(i=n,o=e);var a=new nr(r,new Le(this._argIndex,C.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,r[0],C.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Le(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Qt)this.addPolygon(e);else if(e instanceof Xt)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof Zt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return P(this._parentGeom,Jt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new _i(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?C.BOUNDARY:C.INTERIOR},e}(Ge),Ei=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Si(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Si(0,e,r),this._arg[1]=new Si(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Si(0,i,a),this._arg[1]=new Si(1,o,a)}};Ei.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ei.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei};var Mi=function(){};Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.map=function(){if(arguments[0]instanceof ct&&P(arguments[1],Mi.MapOp)){for(var t=arguments[0],e=arguments[1],n=new St,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(P(arguments[0],bt)&&P(arguments[1],Mi.MapOp)){for(var o=arguments[0],a=arguments[1],s=new St,u=o.iterator();u.hasNext();){var l=u.next(),c=a.map(l);null!==c&&s.add(c)}return s}},Mi.MapOp=function(){};var Ti=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Mr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new qn,this._resultPolyList=new St,this._resultLineList=new St,this._resultPointList=new St,this._graph=new Ge(new Hn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Le(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new St;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==C.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new St,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new St;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Gr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new He(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Wr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new qr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Me.RIGHT),i.getLocation(1,Me.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Me.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Me.LEFT,r.getLocation(i,Me.LEFT)),et.isTrue(!r.isNull(i,Me.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Me.RIGHT,r.getLocation(i,Me.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ei);Ti.overlayOp=function(t,e,n){return new Ti(t,e).getResultGeometry(n)},Ti.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Ti.createEmptyResult(Ti.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Hr.map(t,{interfaces_:function(){return[Mi.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ti.INTERSECTION)},Ti.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ti.createEmptyResult(Ti.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ti.SYMDIFFERENCE)},Ti.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Ti.INTERSECTION:o=Math.min(r,i);break;case Ti.UNION:o=Math.max(r,i);break;case Ti.DIFFERENCE:o=r;break;case Ti.SYMDIFFERENCE:o=Math.max(r,i)}return o},Ti.createEmptyResult=function(t,e,n,r){var i=null;switch(Ti.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Ti.difference=function(t,e){return t.isEmpty()?Ti.createEmptyResult(Ti.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ti.DIFFERENCE))},Ti.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Ti.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1];switch(i===C.BOUNDARY&&(i=C.INTERIOR),o===C.BOUNDARY&&(o=C.INTERIOR),arguments[2]){case Ti.INTERSECTION:return i===C.INTERIOR&&o===C.INTERIOR;case Ti.UNION:return i===C.INTERIOR||o===C.INTERIOR;case Ti.DIFFERENCE:return i===C.INTERIOR&&o!==C.INTERIOR;case Ti.SYMDIFFERENCE:return i===C.INTERIOR&&o!==C.INTERIOR||i!==C.INTERIOR&&o===C.INTERIOR}return!1}},Ti.INTERSECTION=1,Ti.UNION=2,Ti.DIFFERENCE=3,Ti.SYMDIFFERENCE=4;var Ai=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Mr,this._seg=new mn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Ai.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Ai.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?C.BOUNDARY:this._ptLocator.locate(t,this._g)},Ai.prototype.extractLinework=function(t){var e=new Ci;t.apply(e);var n=e.getLinework(),r=ye.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var Ci=function(){this._linework=null,this._linework=new St};Ci.prototype.getLinework=function(){return this._linework},Ci.prototype.filter=function(t){if(t instanceof Qt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Ci.prototype.interfaces_=function(){return[jt]},Ci.prototype.getClass=function(){return Ci};var Oi=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Oi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Oi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Oi.prototype.getPoints=function(t){for(var e=new St,n=Er.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Oi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=Math.sqrt(i*i+o*o),s=n*i/a,u=n*o/a,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new E(l-u,c+s);r.add(h)}if(this._doRight){var p=new E(l+u,c-s);r.add(p)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var Pi=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new St;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Ai(this._geom[0],this._boundaryDistanceTolerance),new Ai(this._geom[1],this._boundaryDistanceTolerance),new Ai(this._geom[2],this._boundaryDistanceTolerance)]},ki={TOLERANCE:{configurable:!0}};Pi.prototype.reportResult=function(t,e,n){G.out.println("Overlay result invalid - A:"+C.toLocationSymbol(e[0])+" B:"+C.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+C.toLocationSymbol(e[2]))},Pi.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Pi.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Pi.hasLocation(this._location,C.BOUNDARY)||this.isValidResult(r,this._location)}},Pi.prototype.addTestPts=function(t){var e=new Oi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pi.prototype.isValidResult=function(t,e){var n=Ti.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===C.INTERIOR);return r||this.reportResult(t,e,n),r},Pi.prototype.getInvalidLocation=function(){return this._invalidLocation},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},Pi.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Pi.computeBoundaryDistanceTolerance=function(t,e){return Math.min($r.computeSizeBasedSnapTolerance(t),$r.computeSizeBasedSnapTolerance(e))},Pi.isValid=function(t,e,n,r){return new Pi(t,e,r).isValid(n)},ki.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pi,ki);var Li=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Li.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Li.prototype.combine=function(){for(var t=new St,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.combine=function(){return 1===arguments.length?new Li(arguments[0]).combine():2===arguments.length?new Li(Li.createList(arguments[0],arguments[1])).combine():3===arguments.length?new Li(Li.createList(arguments[0],arguments[1],arguments[2])).combine():void 0},Li.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Li.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new St;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=new St;return a.add(r),a.add(i),a.add(o),a}};var Ii=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new St)},Ri={STRTREE_NODE_CAPACITY:{configurable:!0}};Ii.prototype.reduceToGeometries=function(t){for(var e=new St,n=t.iterator();n.hasNext();){var r=n.next(),i=null;P(r,wt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Ii.prototype.extractByEnvelope=function(t,e,n){for(var r=new St,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Ii.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Li.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Ii.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new an(Ii.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Ii.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Ii.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ii.getGeometry(e,n),Ii.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),a=this.binaryUnion(e,n,o),s=this.binaryUnion(e,o,r);return this.unionSafe(a,s)}},Ii.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Ii.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ii.prototype.unionActual=function(t,e){return Ii.restrictToPolygons(t.union(e))},Ii.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ii.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new St,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),a=this.unionActual(i,o);return r.add(a),Li.combine(r)},Ii.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii},Ii.restrictToPolygons=function(t){if(P(t,Jt))return t;var e=Sr.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ye.toPolygonArray(e))},Ii.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ii.union=function(t){return new Ii(t).union()},Ri.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ii,Ri);var Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ti.createEmptyResult(Ti.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ti.UNION)},t.GeoJSONReader=Se,t.GeoJSONWriter=Ee,t.OverlayOp=Ti,t.UnionOp=Di,t.BufferOp=mr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},2370:(t,e,n)=>{"use strict";var r=n(3656);e.__esModule=!0,e.isIOS=e.isAndroid=e.isWeb=e.isWechatApp=e.isMiniApp=e.isReactNative=e.isWeex=e.isNode=void 0;var i="undefined"!=typeof __sfc__,o="object"==typeof navigator&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),a=void 0!==r&&!(!r.versions||!r.versions.node);e.isNode=a;var s="function"==typeof callNative||"object"==typeof WXEnvironment&&"Web"!==WXEnvironment.platform;e.isWeex=s;var u="undefined"!=typeof __fbBatchedBridgeConfig;e.isReactNative=u;var l="object"==typeof my&&void 0!==my.getSystemInfo&&!i;e.isMiniApp=l;var c="object"==typeof wx&&void 0!==wx.getSystemInfo;e.isWechatApp=c;var h=o&&!l&&!c||i;e.isWeb=h;var p={};l&&(p=my.getSystemInfoSync()),c&&(p=wx.getSystemInfoSync()),s&&(p=navigator);var f=l||c||s?"android"===(p.platform||"").toLowerCase():!!h&&Boolean(navigator.userAgent.match(/android/i));e.isAndroid=f;var d=l||c||s?["ios","iOS","iPhone OS"].indexOf(p.platform)>-1:!!h&&Boolean(navigator.userAgent.match(/(iphone|ipod|ipad)/i));e.isIOS=d},3618:e=>{"use strict";e.exports=t},1024:t=>{"use strict";t.exports=e},314:t=>{"use strict";t.exports=n},9479:t=>{"use strict";t.exports=r},2721:t=>{"use strict";t.exports=i},3321:()=>{},6964:(t,e,n)=>{var r=n(3606).default;function i(){"use strict";t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),s=new C(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d={};function m(){}function g(){}function y(){}var v={};h(v,u,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(O([])));b&&b!==n&&o.call(b,u)&&(v=b);var x=y.prototype=m.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,a,s,u){var l=f(t[i],t,a);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,u)}),(function(t){n("throw",t,s,u)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,u)}))}u(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function E(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=M(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function M(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,M(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:P}}function P(){return{value:void 0,done:!0}}return g.prototype=y,a(x,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=h(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,h(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},w(S.prototype),h(S.prototype,l,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new S(p(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(x),h(x,c,"Generator"),h(x,u,(function(){return this})),h(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},3606:t=>{function e(n){return t.exports=e="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.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},1109:(t,e,n)=>{var r=n(6964)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},7677:(t,e,n)=>{"use strict";function r(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}n.d(e,{Z:()=>r})},4722:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,{Z:()=>r})},5161:(t,e,n)=>{"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:()=>r})},800:(t,e,n)=>{"use strict";function r(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,u,"next",t)}function u(t){r(a,i,o,s,u,"throw",t)}s(void 0)}))}}n.d(e,{Z:()=>i})},3192:(t,e,n)=>{"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{Z:()=>r})},5927:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(8535);function i(t,e,n){return i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&(0,r.Z)(o,n.prototype),o},i.apply(null,arguments)}},6838:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(1347);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(0,r.Z)(i.key),i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}},6297:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(1347);function i(t,e,n){return(e=(0,r.Z)(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},9458:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(6875);function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=(0,r.Z)(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},i.apply(this,arguments)}},6875:(t,e,n)=>{"use strict";function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:()=>r})},6193:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(8535);function i(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&&(0,r.Z)(t,e)}},6902:(t,e,n)=>{"use strict";function r(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}n.d(e,{Z:()=>r})},3659:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(6297);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}},2718:(t,e,n)=>{"use strict";function r(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}n.d(e,{Z:()=>r})},9097:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(7743),i=n(5161);function o(t,e){if(e&&("object"===(0,r.Z)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(t)}},8535:(t,e,n)=>{"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}n.d(e,{Z:()=>r})},5162:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(6198);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||(0,r.Z)(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.")}()}},9908:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(4722),i=n(6198);function o(t){return function(t){if(Array.isArray(t))return(0,r.Z)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,i.Z)(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.")}()}},1347:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(7743);function i(t){var e=function(t,e){if("object"!==(0,r.Z)(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==(0,r.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===(0,r.Z)(e)?e:String(e)}},7743:(t,e,n)=>{"use strict";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},r(t)}n.d(e,{Z:()=>r})},6198:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(4722);function i(t,e){if(t){if("string"==typeof t)return(0,r.Z)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.Z)(t,e):void 0}}},6070:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var r=n(6875),i=n(8535),o=n(5927);function a(t){var e="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return(0,o.Z)(t,arguments,(0,r.Z)(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,t)},a(t)}},5203:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(3959);function i(t,e){void 0===e&&(e={});var n=Number(t[0]),i=Number(t[1]),o=Number(t[2]),a=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,i],u=[n,a],l=[o,a],c=[o,i];return(0,r.yu)([[s,c,l,u,s]],e.properties,{bbox:t,id:e.id})}},2512:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(8912);function i(t){var e=[1/0,1/0,-1/0,-1/0];return(0,r.pZ)(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}i.default=i;const o=i},3959:(t,e,n)=>{"use strict";n.d(e,{DL:()=>p,Ht:()=>m,Tu:()=>u,lF:()=>f,ot:()=>c,tw:()=>h,uf:()=>l,vi:()=>d,xm:()=>a,yu:()=>s,zL:()=>o});var r=6371008.8,i={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*r,kilometers:6371.0088,kilometres:6371.0088,meters:r,metres:r,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:r/1852,radians:1,yards:6967335.223679999};function o(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function a(t,e,n){if(void 0===n&&(n={}),!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(!g(t[0])||!g(t[1]))throw new Error("coordinates must contain numbers");return o({type:"Point",coordinates:t},e,n)}function s(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var a=i[r];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return o({type:"Polygon",coordinates:t},e,n)}function u(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return o({type:"LineString",coordinates:t},e,n)}function l(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function c(t,e,n){return void 0===n&&(n={}),o({type:"MultiPoint",coordinates:t},e,n)}function h(t,e,n){return void 0===n&&(n={}),o({type:"MultiPolygon",coordinates:t},e,n)}function p(t,e){void 0===e&&(e="kilometers");var n=i[e];if(!n)throw new Error(e+" units is invalid");return t*n}function f(t,e){void 0===e&&(e="kilometers");var n=i[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 t%360*Math.PI/180}function g(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}},601:(t,e,n)=>{"use strict";function r(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function i(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function o(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function a(t){return"Feature"===t.type?t.geometry:t}function s(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}n.d(e,{c9:()=>r,nK:()=>o,oL:()=>s,r7:()=>i,wA:()=>a}),n(3959)},8912:(t,e,n)=>{"use strict";n.d(e,{Lo:()=>o,mm:()=>s,nG:()=>u,pZ:()=>i});var r=n(3959);function i(t,e,n){if(null!==t)for(var r,o,a,s,u,l,c,h,p=0,f=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,y=m?t.features.length:1,v=0;v<y;v++){u=(h=!!(c=m?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<u;_++){var b=0,x=0;if(null!==(s=h?c.geometries[_]:c)){l=s.coordinates;var w=s.type;switch(p=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,f,v,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],f,v,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-p;o++){if(!1===e(l[r][o],f,v,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(x=0,o=0;o<l[r].length;o++){for(a=0;a<l[r][o].length-p;a++){if(!1===e(l[r][o][a],f,v,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===i(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e,n,r){var o=n;return i(t,(function(t,r,i,a,s){o=0===r&&void 0===n?t:e(o,t,r,i,a,s)}),r),o}function a(t,e){var n,r,i,o,a,s,u,l,c,h,p=0,f="FeatureCollection"===t.type,d="Feature"===t.type,m=f?t.features.length:1;for(n=0;n<m;n++){for(s=f?t.features[n].geometry:d?t.geometry:t,l=f?t.features[n].properties:d?t.properties:{},c=f?t.features[n].bbox:d?t.bbox:void 0,h=f?t.features[n].id:d?t.id:void 0,a=(u=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=u?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,l,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],p,l,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,l,c,h))return!1;p++}}function s(t,e,n){var r=n;return a(t,(function(t,i,o,a,s){r=0===i&&void 0===n?t:e(r,t,i,o,a,s)})),r}function u(t,e){a(t,(function(t,n,i,o,a){var s,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e((0,r.zL)(t,i,{bbox:o,id:a}),n,0)&&void 0}switch(u){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c={type:s,coordinates:t.coordinates[l]};if(!1===e((0,r.zL)(c,i),n,l))return!1}}))}},9349:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var r=n(7516),i=n(601),o=n(3959);const a=function(t,e,n){void 0===n&&(n={});var a=(0,i.wA)(t),s=(0,i.wA)(e),u=r.union(a.coordinates,s.coordinates);return 0===u.length?null:1===u.length?(0,o.yu)(u[0],n.properties):(0,o.tw)(u,n.properties)}},7737:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(4660),i=n(7627);const o=(0,r.Z)(i.Z,"Map")},5088:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(4660),i=n(7627);const o=(0,r.Z)(i.Z,"Set")},344:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=n(7627).Z.Symbol},2624:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(4660),i=n(7627);const o=(0,r.Z)(i.Z,"WeakMap")},7909:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(344),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r.Z?r.Z.toStringTag:void 0;var u=Object.prototype.toString;var l=r.Z?r.Z.toStringTag:void 0;const c=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":l&&l in Object(t)?function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}(t):function(t){return u.call(t)}(t)}},2828:(t,e,n)=>{"use strict";n.d(e,{Z:()=>m});var r,i=n(9477),o=n(7277),a=(r=/[^.]+$/.exec(o.Z&&o.Z.keys&&o.Z.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";var s=n(7247),u=n(7785),l=/^\[object .+?Constructor\]$/,c=Function.prototype,h=Object.prototype,p=c.toString,f=h.hasOwnProperty,d=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const m=function(t){return!(!(0,s.Z)(t)||(e=t,a&&a in e))&&((0,i.Z)(t)?d:l).test((0,u.Z)(t));var e}},34:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var r=n(2375);const i=(0,n(1534).Z)(Object.keys,Object);var o=Object.prototype.hasOwnProperty;const a=function(t){if(!(0,r.Z)(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},8066:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(5859),i=/^\s+/;const o=function(t){return t?t.slice(0,(0,r.Z)(t)+1).replace(i,""):t}},544:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=function(t){return function(e){return t(e)}}},7277:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=n(7627).Z["__core-js_shared__"]},6184:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r="object"==typeof global&&global&&global.Object===Object&&global},4660:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(2828);const i=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return(0,r.Z)(n)?n:void 0}},7963:(t,e,n)=>{"use strict";n.d(e,{Z:()=>S});var r=n(4660),i=n(7627);const o=(0,r.Z)(i.Z,"DataView");var a=n(7737);const s=(0,r.Z)(i.Z,"Promise");var u=n(5088),l=n(2624),c=n(7909),h=n(7785),p="[object Map]",f="[object Promise]",d="[object Set]",m="[object WeakMap]",g="[object DataView]",y=(0,h.Z)(o),v=(0,h.Z)(a.Z),_=(0,h.Z)(s),b=(0,h.Z)(u.Z),x=(0,h.Z)(l.Z),w=c.Z;(o&&w(new o(new ArrayBuffer(1)))!=g||a.Z&&w(new a.Z)!=p||s&&w(s.resolve())!=f||u.Z&&w(new u.Z)!=d||l.Z&&w(new l.Z)!=m)&&(w=function(t){var e=(0,c.Z)(t),n="[object Object]"==e?t.constructor:void 0,r=n?(0,h.Z)(n):"";if(r)switch(r){case y:return g;case v:return p;case _:return f;case b:return d;case x:return m}return e});const S=w},2375:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=Object.prototype;const i=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},3851:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(6184),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof module&&module&&!module.nodeType&&module,a=o&&o.exports===i&&r.Z.process;const s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}()},1534:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=function(t,e){return function(n){return t(e(n))}}},7627:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(6184),i="object"==typeof self&&self&&self.Object===Object&&self;const o=r.Z||i||Function("return this")()},7785:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=Function.prototype.toString;const i=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},5859:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=/\s/;const i=function(t){for(var e=t.length;e--&&r.test(t.charAt(e)););return e}},9208:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(7247),i=n(7502),o=n(2498),a=Math.max,s=Math.min;const u=function(t,e,n){var u,l,c,h,p,f,d=0,m=!1,g=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var n=u,r=l;return u=l=void 0,d=e,h=t.apply(r,n)}function _(t){var n=t-f;return void 0===f||n>=e||n<0||g&&t-d>=c}function b(){var t=(0,i.Z)();if(_(t))return x(t);p=setTimeout(b,function(t){var n=e-(t-f);return g?s(n,c-(t-d)):n}(t))}function x(t){return p=void 0,y&&u?v(t):(u=l=void 0,h)}function w(){var t=(0,i.Z)(),n=_(t);if(u=arguments,l=this,f=t,n){if(void 0===p)return function(t){return d=t,p=setTimeout(b,e),m?v(t):h}(f);if(g)return clearTimeout(p),p=setTimeout(b,e),v(f)}return void 0===p&&(p=setTimeout(b,e)),h}return e=(0,o.Z)(e)||0,(0,r.Z)(n)&&(m=!!n.leading,c=(g="maxWait"in n)?a((0,o.Z)(n.maxWait)||0,e):c,y="trailing"in n?!!n.trailing:y),w.cancel=function(){void 0!==p&&clearTimeout(p),d=0,u=f=l=p=void 0},w.flush=function(){return void 0===p?h:x((0,i.Z)())},w}},5437:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(7909),i=n(4764);const o=function(t){return(0,i.Z)(t)&&"[object Arguments]"==(0,r.Z)(t)};var a=Object.prototype,s=a.hasOwnProperty,u=a.propertyIsEnumerable;const l=o(function(){return arguments}())?o:function(t){return(0,i.Z)(t)&&s.call(t,"callee")&&!u.call(t,"callee")}},3788:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=Array.isArray},3932:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(9477),i=n(3277);const o=function(t){return null!=t&&(0,i.Z)(t.length)&&!(0,r.Z)(t)}},6181:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(7627),i=n(4811),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof module&&module&&!module.nodeType&&module,s=a&&a.exports===o?r.Z.Buffer:void 0;const u=(s?s.isBuffer:void 0)||i.Z},7127:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var r=n(34),i=n(7963),o=n(5437),a=n(3788),s=n(3932),u=n(6181),l=n(2375),c=n(1817),h=Object.prototype.hasOwnProperty;const p=function(t){if(null==t)return!0;if((0,s.Z)(t)&&((0,a.Z)(t)||"string"==typeof t||"function"==typeof t.splice||(0,u.Z)(t)||(0,c.Z)(t)||(0,o.Z)(t)))return!t.length;var e=(0,i.Z)(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if((0,l.Z)(t))return!(0,r.Z)(t).length;for(var n in t)if(h.call(t,n))return!1;return!0}},9477:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(7909),i=n(7247);const o=function(t){if(!(0,i.Z)(t))return!1;var e=(0,r.Z)(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},3277:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7247:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},4764:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=function(t){return null!=t&&"object"==typeof t}},718:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(7909),i=n(4764);const o=function(t){return"symbol"==typeof t||(0,i.Z)(t)&&"[object Symbol]"==(0,r.Z)(t)}},1817:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(7909),i=n(3277),o=n(4764),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var s=n(544),u=n(3851),l=u.Z&&u.Z.isTypedArray;const c=l?(0,s.Z)(l):function(t){return(0,o.Z)(t)&&(0,i.Z)(t.length)&&!!a[(0,r.Z)(t)]}},8665:(t,e,n)=>{"use strict";n.r(e),n.d(e,{add:()=>p,after:()=>g,ary:()=>At,assign:()=>$t,assignIn:()=>ee,assignInWith:()=>re,assignWith:()=>oe,at:()=>je,attempt:()=>Ke,before:()=>Je,bind:()=>tn,bindAll:()=>en,bindKey:()=>rn,camelCase:()=>ir,capitalize:()=>En,castArray:()=>or,ceil:()=>lr,chain:()=>cr,chunk:()=>fr,clamp:()=>mr,clone:()=>ti,cloneDeep:()=>ei,cloneDeepWith:()=>ni,cloneWith:()=>ri,commit:()=>ii,compact:()=>oi,concat:()=>ai,cond:()=>Ni,conforms:()=>zi,conformsTo:()=>Bi,constant:()=>nt,countBy:()=>Xi,create:()=>$i,curry:()=>Ji,curryRight:()=>to,debounce:()=>eo.Z,deburr:()=>Pn,default:()=>af,defaultTo:()=>no,defaults:()=>ao,defaultsDeep:()=>yo,defer:()=>bo,delay:()=>wo,difference:()=>Mo,differenceBy:()=>Ao,differenceWith:()=>Co,divide:()=>Oo,drop:()=>Po,dropRight:()=>ko,dropRightWhile:()=>Io,dropWhile:()=>Ro,each:()=>No,eachRight:()=>Uo,endsWith:()=>Zo,entries:()=>Go,entriesIn:()=>Ho,eq:()=>Ot,escape:()=>Xo,escapeRegExp:()=>Jo,every:()=>ea,extend:()=>ee,extendWith:()=>re,fill:()=>ra,filter:()=>oa,find:()=>la,findIndex:()=>ua,findKey:()=>ha,findLast:()=>ma,findLastIndex:()=>da,findLastKey:()=>ga,first:()=>ya,flatMap:()=>ba,flatMapDeep:()=>xa,flatMapDepth:()=>wa,flatten:()=>ze,flattenDeep:()=>Sa,flattenDepth:()=>Ea,flip:()=>Ma,floor:()=>Ta,flow:()=>Ca,flowRight:()=>Oa,forEach:()=>No,forEachRight:()=>Uo,forIn:()=>Pa,forInRight:()=>ka,forOwn:()=>La,forOwnRight:()=>Ia,fromPairs:()=>Ra,functions:()=>Na,functionsIn:()=>Fa,get:()=>Le,groupBy:()=>Ba,gt:()=>Za,gte:()=>Va,has:()=>Wa,hasIn:()=>ki,head:()=>ya,identity:()=>y,inRange:()=>Xa,includes:()=>ts,indexOf:()=>ns,initial:()=>rs,intersection:()=>ss,intersectionBy:()=>us,intersectionWith:()=>ls,invert:()=>ps,invertBy:()=>gs,invoke:()=>_s,invokeMap:()=>bs,isArguments:()=>Ut.Z,isArray:()=>s.Z,isArrayBuffer:()=>ws,isArrayLike:()=>Nt.Z,isArrayLikeObject:()=>uo,isBoolean:()=>Ss,isBuffer:()=>Zt.Z,isDate:()=>Ms,isElement:()=>Ts,isEmpty:()=>As.Z,isEqual:()=>Cs,isEqualWith:()=>Os,isError:()=>Xe,isFinite:()=>ks,isFunction:()=>lo.Z,isInteger:()=>Ls,isLength:()=>Oi.Z,isMap:()=>Wr,isMatch:()=>Is,isMatchWith:()=>Rs,isNaN:()=>Ns,isNative:()=>Us,isNil:()=>Zs,isNull:()=>Vs,isNumber:()=>Ds,isObject:()=>w.Z,isObjectLike:()=>V.Z,isPlainObject:()=>Ye,isRegExp:()=>Hs,isSafeInteger:()=>Ws,isSet:()=>Yr,isString:()=>$a,isSymbol:()=>r.Z,isTypedArray:()=>Vt.Z,isUndefined:()=>qs,isWeakMap:()=>Ys,isWeakSet:()=>Xs,iteratee:()=>$s,join:()=>Js,kebabCase:()=>Qs,keyBy:()=>tu,keys:()=>qt,keysIn:()=>Qt,last:()=>To,lastIndexOf:()=>ru,lodash:()=>Y,lowerCase:()=>iu,lowerFirst:()=>ou,lt:()=>su,lte:()=>uu,map:()=>_a,mapKeys:()=>lu,mapValues:()=>cu,matches:()=>hu,matchesProperty:()=>pu,max:()=>du,maxBy:()=>mu,mean:()=>vu,meanBy:()=>_u,memoize:()=>Se,merge:()=>xu,mergeWith:()=>go,method:()=>wu,methodOf:()=>Su,min:()=>Eu,minBy:()=>Mu,mixin:()=>Tu,multiply:()=>Au,negate:()=>Cu,next:()=>ku,noop:()=>D,now:()=>Lu.Z,nth:()=>Ru,nthArg:()=>Du,omit:()=>zu,omitBy:()=>Zu,once:()=>Vu,orderBy:()=>Wu,over:()=>Yu,overArgs:()=>Ju,overEvery:()=>Qu,overSome:()=>tl,pad:()=>xl,padEnd:()=>wl,padStart:()=>Sl,parseInt:()=>Tl,partial:()=>Cl,partialRight:()=>Pl,partition:()=>kl,pick:()=>Ll,pickBy:()=>Uu,plant:()=>Il,property:()=>Ri,propertyOf:()=>Rl,pull:()=>Bl,pullAll:()=>zl,pullAllBy:()=>jl,pullAllWith:()=>Ul,pullAt:()=>Gl,random:()=>Kl,range:()=>ec,rangeRight:()=>nc,rearg:()=>ic,reduce:()=>ac,reduceRight:()=>uc,reject:()=>lc,remove:()=>cc,repeat:()=>hc,replace:()=>pc,rest:()=>fc,result:()=>dc,reverse:()=>gc,round:()=>yc,sample:()=>bc,sampleSize:()=>Ec,set:()=>Mc,setWith:()=>Tc,shuffle:()=>Oc,size:()=>Pc,slice:()=>kc,snakeCase:()=>Lc,some:()=>Rc,sortBy:()=>Dc,sortedIndex:()=>jc,sortedIndexBy:()=>Uc,sortedIndexOf:()=>Zc,sortedLastIndex:()=>Vc,sortedLastIndexBy:()=>Gc,sortedLastIndexOf:()=>Hc,sortedUniq:()=>qc,sortedUniqBy:()=>Yc,split:()=>Xc,spread:()=>Kc,startCase:()=>Jc,startsWith:()=>Qc,stubArray:()=>Mr,stubFalse:()=>Bs.Z,stubObject:()=>th,stubString:()=>eh,stubTrue:()=>nh,subtract:()=>rh,sum:()=>ih,sumBy:()=>oh,tail:()=>ah,take:()=>sh,takeRight:()=>uh,takeRightWhile:()=>lh,takeWhile:()=>ch,tap:()=>hh,template:()=>Ah,templateSettings:()=>vh,throttle:()=>Ch,thru:()=>Oh,times:()=>Lh,toArray:()=>Pu,toFinite:()=>d,toInteger:()=>m,toIterator:()=>Ih,toJSON:()=>Dh,toLength:()=>na,toLower:()=>Nh,toNumber:()=>f.Z,toPairs:()=>Go,toPairsIn:()=>Ho,toPath:()=>Fh,toPlainObject:()=>ho,toSafeInteger:()=>zh,toString:()=>Ce,toUpper:()=>Bh,transform:()=>jh,trim:()=>Gh,trimEnd:()=>Wh,trimStart:()=>Yh,truncate:()=>$h,unary:()=>Kh,unescape:()=>ep,union:()=>op,unionBy:()=>ap,unionWith:()=>sp,uniq:()=>up,uniqBy:()=>lp,uniqWith:()=>cp,uniqueId:()=>pp,unset:()=>fp,unzip:()=>mp,unzipWith:()=>gp,update:()=>vp,updateWith:()=>_p,upperCase:()=>bp,upperFirst:()=>Sn,value:()=>Dh,valueOf:()=>Dh,values:()=>Ja,valuesIn:()=>xp,without:()=>wp,words:()=>er,wrap:()=>Sp,wrapperAt:()=>Ep,wrapperChain:()=>Mp,wrapperCommit:()=>ii,wrapperLodash:()=>Y,wrapperNext:()=>ku,wrapperPlant:()=>Il,wrapperReverse:()=>Tp,wrapperToIterator:()=>Ih,wrapperValue:()=>Dh,xor:()=>Cp,xorBy:()=>Op,xorWith:()=>Pp,zip:()=>kp,zipObject:()=>Ip,zipObjectDeep:()=>Rp,zipWith:()=>Dp});var r=n(718);const i=function(t){return"number"==typeof t?t:(0,r.Z)(t)?NaN:+t};var o=n(344);const a=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i};var s=n(3788),u=o.Z?o.Z.prototype:void 0,l=u?u.toString:void 0;const c=function t(e){if("string"==typeof e)return e;if((0,s.Z)(e))return a(e,t)+"";if((0,r.Z)(e))return l?l.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},h=function(t,e){return function(n,r){var o;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=c(n),r=c(r)):(n=i(n),r=i(r)),o=t(n,r)}return o}},p=h((function(t,e){return t+e}),0);var f=n(2498);const d=function(t){return t?Infinity===(t=(0,f.Z)(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},m=function(t){var e=d(t),n=e%1;return e==e?n?e-n:e:0},g=function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=m(t),function(){if(--t<1)return e.apply(this,arguments)}},y=function(t){return t};var v=n(2624);const _=v.Z&&new v.Z;var b=_?function(t,e){return _.set(t,e),t}:y;const x=b;var w=n(7247),S=Object.create;const E=function(){function t(){}return function(e){if(!(0,w.Z)(e))return{};if(S)return S(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),M=function(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=E(t.prototype),r=t.apply(n,e);return(0,w.Z)(r)?r:n}};var T=n(7627);const A=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)};var C=Math.max;const O=function(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,u=e.length,l=C(o-a,0),c=Array(u+l),h=!r;++s<u;)c[s]=e[s];for(;++i<a;)(h||i<o)&&(c[n[i]]=t[i]);for(;l--;)c[s++]=t[i++];return c};var P=Math.max;const k=function(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,u=-1,l=e.length,c=P(o-s,0),h=Array(c+l),p=!r;++i<c;)h[i]=t[i];for(var f=i;++u<l;)h[f+u]=e[u];for(;++a<s;)(p||i<o)&&(h[f+n[a]]=t[i++]);return h},L=function(){};function I(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}I.prototype=E(L.prototype),I.prototype.constructor=I;const R=I,D=function(){};var N=_?function(t){return _.get(t)}:D;const F=N,z={};var B=Object.prototype.hasOwnProperty;const j=function(t){for(var e=t.name+"",n=z[e],r=B.call(z,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e};function U(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}U.prototype=E(L.prototype),U.prototype.constructor=U;const Z=U;var V=n(4764);const G=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e},H=function(t){if(t instanceof R)return t.clone();var e=new Z(t.__wrapped__,t.__chain__);return e.__actions__=G(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e};var W=Object.prototype.hasOwnProperty;function q(t){if((0,V.Z)(t)&&!(0,s.Z)(t)&&!(t instanceof R)){if(t instanceof Z)return t;if(W.call(t,"__wrapped__"))return H(t)}return new Z(t)}q.prototype=L.prototype,q.prototype.constructor=q;const Y=q,X=function(t){var e=j(t),n=Y[e];if("function"!=typeof n||!(e in R.prototype))return!1;if(t===n)return!0;var r=F(n);return!!r&&t===r[0]};var $=Date.now;const K=function(t){var e=0,n=0;return function(){var r=$(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},J=K(x);var Q=/\{\n\/\* \[wrapped with (.+)\] \*/,tt=/,? & /;var et=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;const nt=function(t){return function(){return t}};var rt=n(4660),it=function(){try{var t=(0,rt.Z)(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const ot=it;var at=ot?function(t,e){return ot(t,"toString",{configurable:!0,enumerable:!1,value:nt(e),writable:!0})}:y;const st=K(at),ut=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},lt=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1},ct=function(t){return t!=t},ht=function(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):lt(t,ct,n)},pt=function(t,e){return!(null==t||!t.length)&&ht(t,e,0)>-1};var ft=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];const dt=function(t,e,n){var r=e+"";return st(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(et,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ut(ft,(function(n){var r="_."+n[0];e&n[1]&&!pt(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Q);return e?e[1].split(tt):[]}(r),n)))},mt=function(t,e,n,r,i,o,a,s,u,l){var c=8&e;e|=c?32:64,4&(e&=~(c?64:32))||(e&=-4);var h=[t,e,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,s,u,l],p=n.apply(void 0,h);return X(t)&&J(p,h),p.placeholder=r,dt(p,t,e)},gt=function(t){return t.placeholder};var yt=/^(?:0|[1-9]\d*)$/;const vt=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e};var _t=Math.min;var bt="__lodash_placeholder__";const xt=function(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==bt||(t[n]=bt,o[i++]=n)}return o},wt=function t(e,n,r,i,o,a,s,u,l,c){var h=128&n,p=1&n,f=2&n,d=24&n,m=512&n,g=f?void 0:M(e);return function y(){for(var v=arguments.length,_=Array(v),b=v;b--;)_[b]=arguments[b];if(d)var x=gt(y),w=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,x);if(i&&(_=O(_,i,o,d)),a&&(_=k(_,a,s,d)),v-=w,d&&v<c){var S=xt(_,x);return mt(e,n,t,y.placeholder,r,_,S,u,l,c-v)}var E=p?r:this,A=f?E[e]:e;return v=_.length,u?_=function(t,e){for(var n=t.length,r=_t(e.length,n),i=G(t);r--;){var o=e[r];t[r]=vt(o,n)?i[o]:void 0}return t}(_,u):m&&v>1&&_.reverse(),h&&l<v&&(_.length=l),this&&this!==T.Z&&this instanceof y&&(A=g||M(A)),A.apply(E,_)}};var St="__lodash_placeholder__",Et=Math.min;var Mt=Math.max;const Tt=function(t,e,n,r,i,o,a,s){var u=2&e;if(!u&&"function"!=typeof t)throw new TypeError("Expected a function");var l=r?r.length:0;if(l||(e&=-97,r=i=void 0),a=void 0===a?a:Mt(m(a),0),s=void 0===s?s:m(s),l-=i?i.length:0,64&e){var c=r,h=i;r=i=void 0}var p=u?void 0:F(t),f=[t,e,n,r,i,c,h,o,a,s];if(p&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=128==r&&8==n||128==r&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var s=e[3];if(s){var u=t[3];t[3]=u?O(u,s,e[4]):s,t[4]=u?xt(t[3],St):e[4]}(s=e[5])&&(u=t[5],t[5]=u?k(u,s,e[6]):s,t[6]=u?xt(t[5],St):e[6]),(s=e[7])&&(t[7]=s),128&r&&(t[8]=null==t[8]?e[8]:Et(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(f,p),t=f[0],e=f[1],n=f[2],r=f[3],i=f[4],!(s=f[9]=void 0===f[9]?u?0:t.length:Mt(f[9]-l,0))&&24&e&&(e&=-25),e&&1!=e)d=8==e||16==e?function(t,e,n){var r=M(t);return function i(){for(var o=arguments.length,a=Array(o),s=o,u=gt(i);s--;)a[s]=arguments[s];var l=o<3&&a[0]!==u&&a[o-1]!==u?[]:xt(a,u);if((o-=l.length)<n)return mt(t,e,wt,i.placeholder,void 0,a,l,void 0,void 0,n-o);var c=this&&this!==T.Z&&this instanceof i?r:t;return A(c,this,a)}}(t,e,s):32!=e&&33!=e||i.length?wt.apply(void 0,f):function(t,e,n,r){var i=1&e,o=M(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=Array(l+s),h=this&&this!==T.Z&&this instanceof e?o:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return A(h,i?n:this,c)}}(t,e,n,r);else var d=function(t,e,n){var r=1&e,i=M(t);return function e(){return(this&&this!==T.Z&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return dt((p?x:J)(d,f),t,e)},At=function(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,Tt(t,128,void 0,void 0,void 0,void 0,e)},Ct=function(t,e,n){"__proto__"==e&&ot?ot(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Ot=function(t,e){return t===e||t!=t&&e!=e};var Pt=Object.prototype.hasOwnProperty;const kt=function(t,e,n){var r=t[e];Pt.call(t,e)&&Ot(r,n)&&(void 0!==n||e in t)||Ct(t,e,n)},Lt=function(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],u=r?r(n[s],t[s],s,n,t):void 0;void 0===u&&(u=t[s]),i?Ct(n,s,u):kt(n,s,u)}return n};var It=Math.max;const Rt=function(t,e,n){return e=It(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=It(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),A(t,this,s)}},Dt=function(t,e){return st(Rt(t,e,y),t+"")};var Nt=n(3932);const Ft=function(t,e,n){if(!(0,w.Z)(n))return!1;var r=typeof e;return!!("number"==r?(0,Nt.Z)(n)&&vt(e,n.length):"string"==r&&e in n)&&Ot(n[e],t)},zt=function(t){return Dt((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Ft(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e}))};var Bt=n(2375);const jt=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r};var Ut=n(5437),Zt=n(6181),Vt=n(1817),Gt=Object.prototype.hasOwnProperty;const Ht=function(t,e){var n=(0,s.Z)(t),r=!n&&(0,Ut.Z)(t),i=!n&&!r&&(0,Zt.Z)(t),o=!n&&!r&&!i&&(0,Vt.Z)(t),a=n||r||i||o,u=a?jt(t.length,String):[],l=u.length;for(var c in t)!e&&!Gt.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vt(c,l))||u.push(c);return u};var Wt=n(34);const qt=function(t){return(0,Nt.Z)(t)?Ht(t):(0,Wt.Z)(t)};var Yt=Object.prototype.hasOwnProperty,Xt=zt((function(t,e){if((0,Bt.Z)(e)||(0,Nt.Z)(e))Lt(e,qt(e),t);else for(var n in e)Yt.call(e,n)&&kt(t,n,e[n])}));const $t=Xt;var Kt=Object.prototype.hasOwnProperty;const Jt=function(t){if(!(0,w.Z)(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=(0,Bt.Z)(t),n=[];for(var r in t)("constructor"!=r||!e&&Kt.call(t,r))&&n.push(r);return n},Qt=function(t){return(0,Nt.Z)(t)?Ht(t,!0):Jt(t)};var te=zt((function(t,e){Lt(e,Qt(e),t)}));const ee=te;var ne=zt((function(t,e,n,r){Lt(e,Qt(e),t,r)}));const re=ne;var ie=zt((function(t,e,n,r){Lt(e,qt(e),t,r)}));const oe=ie;var ae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,se=/^\w*$/;const ue=function(t,e){if((0,s.Z)(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!(0,r.Z)(t))||se.test(t)||!ae.test(t)||null!=e&&t in Object(e)},le=(0,rt.Z)(Object,"create");var ce=Object.prototype.hasOwnProperty;var he=Object.prototype.hasOwnProperty;function pe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}pe.prototype.clear=function(){this.__data__=le?le(null):{},this.size=0},pe.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},pe.prototype.get=function(t){var e=this.__data__;if(le){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ce.call(e,t)?e[t]:void 0},pe.prototype.has=function(t){var e=this.__data__;return le?void 0!==e[t]:he.call(e,t)},pe.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=le&&void 0===e?"__lodash_hash_undefined__":e,this};const fe=pe,de=function(t,e){for(var n=t.length;n--;)if(Ot(t[n][0],e))return n;return-1};var me=Array.prototype.splice;function ge(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ge.prototype.clear=function(){this.__data__=[],this.size=0},ge.prototype.delete=function(t){var e=this.__data__,n=de(e,t);return!(n<0||(n==e.length-1?e.pop():me.call(e,n,1),--this.size,0))},ge.prototype.get=function(t){var e=this.__data__,n=de(e,t);return n<0?void 0:e[n][1]},ge.prototype.has=function(t){return de(this.__data__,t)>-1},ge.prototype.set=function(t,e){var n=this.__data__,r=de(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};const ye=ge;var ve=n(7737);const _e=function(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map};function be(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}be.prototype.clear=function(){this.size=0,this.__data__={hash:new fe,map:new(ve.Z||ye),string:new fe}},be.prototype.delete=function(t){var e=_e(this,t).delete(t);return this.size-=e?1:0,e},be.prototype.get=function(t){return _e(this,t).get(t)},be.prototype.has=function(t){return _e(this,t).has(t)},be.prototype.set=function(t,e){var n=_e(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};const xe=be;function we(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(we.Cache||xe),n}we.Cache=xe;const Se=we;var Ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Me=/\\(\\)?/g,Te=function(t){var e=Se(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ee,(function(t,n,r,i){e.push(r?i.replace(Me,"$1"):n||t)})),e}));const Ae=Te,Ce=function(t){return null==t?"":c(t)},Oe=function(t,e){return(0,s.Z)(t)?t:ue(t,e)?[t]:Ae(Ce(t))},Pe=function(t){if("string"==typeof t||(0,r.Z)(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},ke=function(t,e){for(var n=0,r=(e=Oe(e,t)).length;null!=t&&n<r;)t=t[Pe(e[n++])];return n&&n==r?t:void 0},Le=function(t,e,n){var r=null==t?void 0:ke(t,e);return void 0===r?n:r},Ie=function(t,e){for(var n=-1,r=e.length,i=Array(r),o=null==t;++n<r;)i[n]=o?void 0:Le(t,e[n]);return i},Re=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t};var De=o.Z?o.Z.isConcatSpreadable:void 0;const Ne=function(t){return(0,s.Z)(t)||(0,Ut.Z)(t)||!!(De&&t&&t[De])},Fe=function t(e,n,r,i,o){var a=-1,s=e.length;for(r||(r=Ne),o||(o=[]);++a<s;){var u=e[a];n>0&&r(u)?n>1?t(u,n-1,r,i,o):Re(o,u):i||(o[o.length]=u)}return o},ze=function(t){return null!=t&&t.length?Fe(t,1):[]},Be=function(t){return st(Rt(t,void 0,ze),t+"")},je=Be(Ie);var Ue=n(7909);const Ze=(0,n(1534).Z)(Object.getPrototypeOf,Object);var Ve=Function.prototype,Ge=Object.prototype,He=Ve.toString,We=Ge.hasOwnProperty,qe=He.call(Object);const Ye=function(t){if(!(0,V.Z)(t)||"[object Object]"!=(0,Ue.Z)(t))return!1;var e=Ze(t);if(null===e)return!0;var n=We.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&He.call(n)==qe},Xe=function(t){if(!(0,V.Z)(t))return!1;var e=(0,Ue.Z)(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ye(t)};var $e=Dt((function(t,e){try{return A(t,void 0,e)}catch(t){return Xe(t)?t:new Error(t)}}));const Ke=$e,Je=function(t,e){var n;if("function"!=typeof e)throw new TypeError("Expected a function");return t=m(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}};var Qe=Dt((function(t,e,n){var r=1;if(n.length){var i=xt(n,gt(Qe));r|=32}return Tt(t,r,e,n,i)}));Qe.placeholder={};const tn=Qe,en=Be((function(t,e){return ut(e,(function(e){e=Pe(e),Ct(t,e,tn(t[e],t))})),t}));var nn=Dt((function(t,e,n){var r=3;if(n.length){var i=xt(n,gt(nn));r|=32}return Tt(e,r,t,n,i)}));nn.placeholder={};const rn=nn,on=function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o},an=function(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:on(t,e,n)};var sn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const un=function(t){return sn.test(t)};var ln="\\ud800-\\udfff",cn="["+ln+"]",hn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",pn="\\ud83c[\\udffb-\\udfff]",fn="[^"+ln+"]",dn="(?:\\ud83c[\\udde6-\\uddff]){2}",mn="[\\ud800-\\udbff][\\udc00-\\udfff]",gn="(?:"+hn+"|"+pn+")?",yn="[\\ufe0e\\ufe0f]?",vn=yn+gn+"(?:\\u200d(?:"+[fn,dn,mn].join("|")+")"+yn+gn+")*",_n="(?:"+[fn+hn+"?",hn,dn,mn,cn].join("|")+")",bn=RegExp(pn+"(?="+pn+")|"+_n+vn,"g");const xn=function(t){return un(t)?function(t){return t.match(bn)||[]}(t):function(t){return t.split("")}(t)},wn=function(t){return function(e){e=Ce(e);var n=un(e)?xn(e):void 0,r=n?n[0]:e.charAt(0),i=n?an(n,1).join(""):e.slice(1);return r[t]()+i}},Sn=wn("toUpperCase"),En=function(t){return Sn(Ce(t).toLowerCase())},Mn=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n},Tn=function(t){return function(e){return null==t?void 0:t[e]}},An=Tn({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});var Cn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,On=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");const Pn=function(t){return(t=Ce(t))&&t.replace(Cn,An).replace(On,"")};var kn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Ln=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var In="\\ud800-\\udfff",Rn="\\u2700-\\u27bf",Dn="a-z\\xdf-\\xf6\\xf8-\\xff",Nn="A-Z\\xc0-\\xd6\\xd8-\\xde",Fn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zn="["+Fn+"]",Bn="\\d+",jn="["+Rn+"]",Un="["+Dn+"]",Zn="[^"+In+Fn+Bn+Rn+Dn+Nn+"]",Vn="(?:\\ud83c[\\udde6-\\uddff]){2}",Gn="[\\ud800-\\udbff][\\udc00-\\udfff]",Hn="["+Nn+"]",Wn="(?:"+Un+"|"+Zn+")",qn="(?:"+Hn+"|"+Zn+")",Yn="(?:['’](?:d|ll|m|re|s|t|ve))?",Xn="(?:['’](?:D|LL|M|RE|S|T|VE))?",$n="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Kn="[\\ufe0e\\ufe0f]?",Jn=Kn+$n+"(?:\\u200d(?:"+["[^"+In+"]",Vn,Gn].join("|")+")"+Kn+$n+")*",Qn="(?:"+[jn,Vn,Gn].join("|")+")"+Jn,tr=RegExp([Hn+"?"+Un+"+"+Yn+"(?="+[zn,Hn,"$"].join("|")+")",qn+"+"+Xn+"(?="+[zn,Hn+Wn,"$"].join("|")+")",Hn+"?"+Wn+"+"+Yn,Hn+"+"+Xn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bn,Qn].join("|"),"g");const er=function(t,e,n){return t=Ce(t),void 0===(e=n?void 0:e)?function(t){return Ln.test(t)}(t)?function(t){return t.match(tr)||[]}(t):function(t){return t.match(kn)||[]}(t):t.match(e)||[]};var nr=RegExp("['’]","g");const rr=function(t){return function(e){return Mn(er(Pn(e).replace(nr,"")),t,"")}};const ir=rr((function(t,e,n){return e=e.toLowerCase(),t+(n?En(e):e)})),or=function(){if(!arguments.length)return[];var t=arguments[0];return(0,s.Z)(t)?t:[t]};var ar=T.Z.isFinite,sr=Math.min;const ur=function(t){var e=Math[t];return function(t,n){if(t=(0,f.Z)(t),(n=null==n?0:sr(m(n),292))&&ar(t)){var r=(Ce(t)+"e").split("e"),i=e(r[0]+"e"+(+r[1]+n));return+((r=(Ce(i)+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}},lr=ur("ceil"),cr=function(t){var e=Y(t);return e.__chain__=!0,e};var hr=Math.ceil,pr=Math.max;const fr=function(t,e,n){e=(n?Ft(t,e,n):void 0===e)?1:pr(m(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(hr(r/e));i<r;)a[o++]=on(t,i,i+=e);return a},dr=function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t},mr=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=(0,f.Z)(n))==n?n:0),void 0!==e&&(e=(e=(0,f.Z)(e))==e?e:0),dr((0,f.Z)(t),e,n)};function gr(t){var e=this.__data__=new ye(t);this.size=e.size}gr.prototype.clear=function(){this.__data__=new ye,this.size=0},gr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},gr.prototype.get=function(t){return this.__data__.get(t)},gr.prototype.has=function(t){return this.__data__.has(t)},gr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof ye){var r=n.__data__;if(!ve.Z||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new xe(r)}return n.set(t,e),this.size=n.size,this};const yr=gr,vr=function(t,e){return t&&Lt(e,qt(e),t)};var _r="object"==typeof exports&&exports&&!exports.nodeType&&exports,br=_r&&"object"==typeof module&&module&&!module.nodeType&&module,xr=br&&br.exports===_r?T.Z.Buffer:void 0,wr=xr?xr.allocUnsafe:void 0;const Sr=function(t,e){if(e)return t.slice();var n=t.length,r=wr?wr(n):new t.constructor(n);return t.copy(r),r},Er=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o},Mr=function(){return[]};var Tr=Object.prototype.propertyIsEnumerable,Ar=Object.getOwnPropertySymbols;const Cr=Ar?function(t){return null==t?[]:(t=Object(t),Er(Ar(t),(function(e){return Tr.call(t,e)})))}:Mr;const Or=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Re(e,Cr(t)),t=Ze(t);return e}:Mr,Pr=function(t,e,n){var r=e(t);return(0,s.Z)(t)?r:Re(r,n(t))},kr=function(t){return Pr(t,qt,Cr)},Lr=function(t){return Pr(t,Qt,Or)};var Ir=n(7963),Rr=Object.prototype.hasOwnProperty;const Dr=T.Z.Uint8Array,Nr=function(t){var e=new t.constructor(t.byteLength);return new Dr(e).set(new Dr(t)),e};var Fr=/\w*$/;var zr=o.Z?o.Z.prototype:void 0,Br=zr?zr.valueOf:void 0;const jr=function(t,e){var n=e?Nr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},Ur=function(t,e,n){var r,i,o,a=t.constructor;switch(e){case"[object ArrayBuffer]":return Nr(t);case"[object Boolean]":case"[object Date]":return new a(+t);case"[object DataView]":return function(t,e){var n=e?Nr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return jr(t,n);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(t);case"[object RegExp]":return(o=new(i=t).constructor(i.source,Fr.exec(i))).lastIndex=i.lastIndex,o;case"[object Symbol]":return r=t,Br?Object(Br.call(r)):{}}},Zr=function(t){return"function"!=typeof t.constructor||(0,Bt.Z)(t)?{}:E(Ze(t))};var Vr=n(544),Gr=n(3851),Hr=Gr.Z&&Gr.Z.isMap;const Wr=Hr?(0,Vr.Z)(Hr):function(t){return(0,V.Z)(t)&&"[object Map]"==(0,Ir.Z)(t)};var qr=Gr.Z&&Gr.Z.isSet;const Yr=qr?(0,Vr.Z)(qr):function(t){return(0,V.Z)(t)&&"[object Set]"==(0,Ir.Z)(t)};var Xr="[object Arguments]",$r="[object Function]",Kr="[object Object]",Jr={};Jr[Xr]=Jr["[object Array]"]=Jr["[object ArrayBuffer]"]=Jr["[object DataView]"]=Jr["[object Boolean]"]=Jr["[object Date]"]=Jr["[object Float32Array]"]=Jr["[object Float64Array]"]=Jr["[object Int8Array]"]=Jr["[object Int16Array]"]=Jr["[object Int32Array]"]=Jr["[object Map]"]=Jr["[object Number]"]=Jr[Kr]=Jr["[object RegExp]"]=Jr["[object Set]"]=Jr["[object String]"]=Jr["[object Symbol]"]=Jr["[object Uint8Array]"]=Jr["[object Uint8ClampedArray]"]=Jr["[object Uint16Array]"]=Jr["[object Uint32Array]"]=!0,Jr["[object Error]"]=Jr[$r]=Jr["[object WeakMap]"]=!1;const Qr=function t(e,n,r,i,o,a){var u,l=1&n,c=2&n,h=4&n;if(r&&(u=o?r(e,i,o,a):r(e)),void 0!==u)return u;if(!(0,w.Z)(e))return e;var p=(0,s.Z)(e);if(p){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rr.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return G(e,u)}else{var f=(0,Ir.Z)(e),d=f==$r||"[object GeneratorFunction]"==f;if((0,Zt.Z)(e))return Sr(e,l);if(f==Kr||f==Xr||d&&!o){if(u=c||d?{}:Zr(e),!l)return c?function(t,e){return Lt(t,Or(t),e)}(e,function(t,e){return t&&Lt(e,Qt(e),t)}(u,e)):function(t,e){return Lt(t,Cr(t),e)}(e,vr(u,e))}else{if(!Jr[f])return o?e:{};u=Ur(e,f,l)}}a||(a=new yr);var m=a.get(e);if(m)return m;a.set(e,u),Yr(e)?e.forEach((function(i){u.add(t(i,n,r,i,e,a))})):Wr(e)&&e.forEach((function(i,o){u.set(o,t(i,n,r,o,e,a))}));var g=p?void 0:(h?c?Lr:kr:c?Qt:qt)(e);return ut(g||e,(function(i,o){g&&(i=e[o=i]),kt(u,o,t(i,n,r,o,e,a))})),u},ti=function(t){return Qr(t,4)},ei=function(t){return Qr(t,5)},ni=function(t,e){return Qr(t,5,e="function"==typeof e?e:void 0)},ri=function(t,e){return Qr(t,4,e="function"==typeof e?e:void 0)},ii=function(){return new Z(this.value(),this.__chain__)},oi=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},ai=function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Re((0,s.Z)(n)?G(n):[n],Fe(e,1))};function si(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new xe;++e<n;)this.add(t[e])}si.prototype.add=si.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},si.prototype.has=function(t){return this.__data__.has(t)};const ui=si,li=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},ci=function(t,e){return t.has(e)},hi=function(t,e,n,r,i,o){var a=1&n,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var h=-1,p=!0,f=2&n?new ui:void 0;for(o.set(t,e),o.set(e,t);++h<s;){var d=t[h],m=e[h];if(r)var g=a?r(m,d,h,e,t,o):r(d,m,h,t,e,o);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!li(e,(function(t,e){if(!ci(f,e)&&(d===t||i(d,t,n,r,o)))return f.push(e)}))){p=!1;break}}else if(d!==m&&!i(d,m,n,r,o)){p=!1;break}}return o.delete(t),o.delete(e),p},pi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},fi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var di=o.Z?o.Z.prototype:void 0,mi=di?di.valueOf:void 0;var gi=Object.prototype.hasOwnProperty;var yi="[object Arguments]",vi="[object Array]",_i="[object Object]",bi=Object.prototype.hasOwnProperty;const xi=function(t,e,n,r,i,o){var a=(0,s.Z)(t),u=(0,s.Z)(e),l=a?vi:(0,Ir.Z)(t),c=u?vi:(0,Ir.Z)(e),h=(l=l==yi?_i:l)==_i,p=(c=c==yi?_i:c)==_i,f=l==c;if(f&&(0,Zt.Z)(t)){if(!(0,Zt.Z)(e))return!1;a=!0,h=!1}if(f&&!h)return o||(o=new yr),a||(0,Vt.Z)(t)?hi(t,e,n,r,i,o):function(t,e,n,r,i,o,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Dr(t),new Dr(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ot(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=pi;case"[object Set]":var u=1&r;if(s||(s=fi),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=hi(s(t),s(e),r,i,o,a);return a.delete(t),c;case"[object Symbol]":if(mi)return mi.call(t)==mi.call(e)}return!1}(t,e,l,n,r,i,o);if(!(1&n)){var d=h&&bi.call(t,"__wrapped__"),m=p&&bi.call(e,"__wrapped__");if(d||m){var g=d?t.value():t,y=m?e.value():e;return o||(o=new yr),i(g,y,n,r,o)}}return!!f&&(o||(o=new yr),function(t,e,n,r,i,o){var a=1&n,s=kr(t),u=s.length;if(u!=kr(e).length&&!a)return!1;for(var l=u;l--;){var c=s[l];if(!(a?c in e:gi.call(e,c)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var f=!0;o.set(t,e),o.set(e,t);for(var d=a;++l<u;){var m=t[c=s[l]],g=e[c];if(r)var y=a?r(g,m,c,e,t,o):r(m,g,c,t,e,o);if(!(void 0===y?m===g||i(m,g,n,r,o):y)){f=!1;break}d||(d="constructor"==c)}if(f&&!d){var v=t.constructor,_=e.constructor;v==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(t),o.delete(e),f}(t,e,n,r,i,o))},wi=function t(e,n,r,i,o){return e===n||(null==e||null==n||!(0,V.Z)(e)&&!(0,V.Z)(n)?e!=e&&n!=n:xi(e,n,r,i,t,o))},Si=function(t,e,n,r){var i=n.length,o=i,a=!r;if(null==t)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){var u=(s=n[i])[0],l=t[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in t))return!1}else{var h=new yr;if(r)var p=r(l,c,u,t,e,h);if(!(void 0===p?wi(c,l,3,r,h):p))return!1}}return!0},Ei=function(t){return t==t&&!(0,w.Z)(t)},Mi=function(t){for(var e=qt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Ei(i)]}return e},Ti=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},Ai=function(t){var e=Mi(t);return 1==e.length&&e[0][2]?Ti(e[0][0],e[0][1]):function(n){return n===t||Si(n,t,e)}},Ci=function(t,e){return null!=t&&e in Object(t)};var Oi=n(3277);const Pi=function(t,e,n){for(var r=-1,i=(e=Oe(e,t)).length,o=!1;++r<i;){var a=Pe(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&(0,Oi.Z)(i)&&vt(a,i)&&((0,s.Z)(t)||(0,Ut.Z)(t))},ki=function(t,e){return null!=t&&Pi(t,e,Ci)},Li=function(t,e){return ue(t)&&Ei(e)?Ti(Pe(t),e):function(n){var r=Le(n,t);return void 0===r&&r===e?ki(n,t):wi(e,r,3)}},Ii=function(t){return function(e){return null==e?void 0:e[t]}},Ri=function(t){return ue(t)?Ii(Pe(t)):function(t){return function(e){return ke(e,t)}}(t)},Di=function(t){return"function"==typeof t?t:null==t?y:"object"==typeof t?(0,s.Z)(t)?Li(t[0],t[1]):Ai(t):Ri(t)},Ni=function(t){var e=null==t?0:t.length,n=Di;return t=e?a(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],Dt((function(n){for(var r=-1;++r<e;){var i=t[r];if(A(i[0],this,n))return A(i[1],this,n)}}))},Fi=function(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0},zi=function(t){return function(t){var e=qt(t);return function(n){return Fi(n,t,e)}}(Qr(t,1))},Bi=function(t,e){return null==e||Fi(t,e,qt(e))},ji=function(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r},Ui=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}},Zi=Ui(),Vi=function(t,e){return t&&Zi(t,e,qt)},Gi=function(t,e){return function(n,r){if(null==n)return n;if(!(0,Nt.Z)(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}},Hi=Gi(Vi),Wi=function(t,e,n,r){return Hi(t,(function(t,i,o){e(r,t,n(t),o)})),r},qi=function(t,e){return function(n,r){var i=(0,s.Z)(n)?ji:Wi,o=e?e():{};return i(n,t,Di(r),o)}};var Yi=Object.prototype.hasOwnProperty;const Xi=qi((function(t,e,n){Yi.call(t,n)?++t[n]:Ct(t,n,1)})),$i=function(t,e){var n=E(t);return null==e?n:vr(n,e)};function Ki(t,e,n){var r=Tt(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Ki.placeholder,r}Ki.placeholder={};const Ji=Ki;function Qi(t,e,n){var r=Tt(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Qi.placeholder,r}Qi.placeholder={};const to=Qi;var eo=n(9208);const no=function(t,e){return null==t||t!=t?e:t};var ro=Object.prototype,io=ro.hasOwnProperty,oo=Dt((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Ft(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=Qt(o),s=-1,u=a.length;++s<u;){var l=a[s],c=t[l];(void 0===c||Ot(c,ro[l])&&!io.call(t,l))&&(t[l]=o[l])}return t}));const ao=oo,so=function(t,e,n){(void 0!==n&&!Ot(t[e],n)||void 0===n&&!(e in t))&&Ct(t,e,n)},uo=function(t){return(0,V.Z)(t)&&(0,Nt.Z)(t)};var lo=n(9477);const co=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},ho=function(t){return Lt(t,Qt(t))},po=function t(e,n,r,i,o){e!==n&&Zi(n,(function(a,u){if(o||(o=new yr),(0,w.Z)(a))!function(t,e,n,r,i,o,a){var u=co(t,n),l=co(e,n),c=a.get(l);if(c)so(t,n,c);else{var h=o?o(u,l,n+"",t,e,a):void 0,p=void 0===h;if(p){var f=(0,s.Z)(l),d=!f&&(0,Zt.Z)(l),m=!f&&!d&&(0,Vt.Z)(l);h=l,f||d||m?(0,s.Z)(u)?h=u:uo(u)?h=G(u):d?(p=!1,h=Sr(l,!0)):m?(p=!1,h=jr(l,!0)):h=[]:Ye(l)||(0,Ut.Z)(l)?(h=u,(0,Ut.Z)(u)?h=ho(u):(0,w.Z)(u)&&!(0,lo.Z)(u)||(h=Zr(l))):p=!1}p&&(a.set(l,h),i(h,l,r,o,a),a.delete(l)),so(t,n,h)}}(e,n,u,r,t,i,o);else{var l=i?i(co(e,u),a,u+"",e,n,o):void 0;void 0===l&&(l=a),so(e,u,l)}}),Qt)},fo=function t(e,n,r,i,o,a){return(0,w.Z)(e)&&(0,w.Z)(n)&&(a.set(n,e),po(e,n,void 0,t,a),a.delete(n)),e};var mo=zt((function(t,e,n,r){po(t,e,n,r)}));const go=mo,yo=Dt((function(t){return t.push(void 0,fo),A(go,void 0,t)})),vo=function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)};var _o=Dt((function(t,e){return vo(t,1,e)}));const bo=_o;var xo=Dt((function(t,e,n){return vo(t,(0,f.Z)(e)||0,n)}));const wo=xo,So=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1},Eo=function(t,e,n,r){var i=-1,o=pt,s=!0,u=t.length,l=[],c=e.length;if(!u)return l;n&&(e=a(e,(0,Vr.Z)(n))),r?(o=So,s=!1):e.length>=200&&(o=ci,s=!1,e=new ui(e));t:for(;++i<u;){var h=t[i],p=null==n?h:n(h);if(h=r||0!==h?h:0,s&&p==p){for(var f=c;f--;)if(e[f]===p)continue t;l.push(h)}else o(e,p,r)||l.push(h)}return l};const Mo=Dt((function(t,e){return uo(t)?Eo(t,Fe(e,1,uo,!0)):[]})),To=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};const Ao=Dt((function(t,e){var n=To(e);return uo(n)&&(n=void 0),uo(t)?Eo(t,Fe(e,1,uo,!0),Di(n)):[]}));const Co=Dt((function(t,e){var n=To(e);return uo(n)&&(n=void 0),uo(t)?Eo(t,Fe(e,1,uo,!0),void 0,n):[]})),Oo=h((function(t,e){return t/e}),1),Po=function(t,e,n){var r=null==t?0:t.length;return r?(e=n||void 0===e?1:m(e),on(t,e<0?0:e,r)):[]},ko=function(t,e,n){var r=null==t?0:t.length;return r?(e=n||void 0===e?1:m(e),on(t,0,(e=r-e)<0?0:e)):[]},Lo=function(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?on(t,r?0:o,r?o+1:i):on(t,r?o+1:0,r?i:o)},Io=function(t,e){return t&&t.length?Lo(t,Di(e),!0,!0):[]},Ro=function(t,e){return t&&t.length?Lo(t,Di(e),!0):[]},Do=function(t){return"function"==typeof t?t:y},No=function(t,e){return((0,s.Z)(t)?ut:Hi)(t,Do(e))},Fo=function(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t},zo=Ui(!0),Bo=function(t,e){return t&&zo(t,e,qt)},jo=Gi(Bo,!0),Uo=function(t,e){return((0,s.Z)(t)?Fo:jo)(t,Do(e))},Zo=function(t,e,n){t=Ce(t),e=c(e);var r=t.length,i=n=void 0===n?r:dr(m(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Vo=function(t){return function(e){var n,r,i,o=(0,Ir.Z)(e);return"[object Map]"==o?pi(e):"[object Set]"==o?(n=e,r=-1,i=Array(n.size),n.forEach((function(t){i[++r]=[t,t]})),i):function(t,e){return a(e,(function(e){return[e,t[e]]}))}(e,t(e))}},Go=Vo(qt),Ho=Vo(Qt),Wo=Tn({"&":"&","<":"<",">":">",'"':""","'":"'"});var qo=/[&<>"']/g,Yo=RegExp(qo.source);const Xo=function(t){return(t=Ce(t))&&Yo.test(t)?t.replace(qo,Wo):t};var $o=/[\\^$.*+?()[\]{}|]/g,Ko=RegExp($o.source);const Jo=function(t){return(t=Ce(t))&&Ko.test(t)?t.replace($o,"\\$&"):t},Qo=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0},ta=function(t,e){var n=!0;return Hi(t,(function(t,r,i){return n=!!e(t,r,i)})),n},ea=function(t,e,n){var r=(0,s.Z)(t)?Qo:ta;return n&&Ft(t,e,n)&&(e=void 0),r(t,Di(e))},na=function(t){return t?dr(m(t),0,4294967295):0},ra=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Ft(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=m(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:m(r))<0&&(r+=i),r=n>r?0:na(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},ia=function(t,e){var n=[];return Hi(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n},oa=function(t,e){return((0,s.Z)(t)?Er:ia)(t,Di(e))},aa=function(t){return function(e,n,r){var i=Object(e);if(!(0,Nt.Z)(e)){var o=Di(n);e=qt(e),n=function(t){return o(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}};var sa=Math.max;const ua=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:m(n);return i<0&&(i=sa(r+i,0)),lt(t,Di(e),i)},la=aa(ua),ca=function(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r},ha=function(t,e){return ca(t,Di(e),Vi)};var pa=Math.max,fa=Math.min;const da=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=m(n),i=n<0?pa(r+i,0):fa(i,r-1)),lt(t,Di(e),i,!0)},ma=aa(da),ga=function(t,e){return ca(t,Di(e),Bo)},ya=function(t){return t&&t.length?t[0]:void 0},va=function(t,e){var n=-1,r=(0,Nt.Z)(t)?Array(t.length):[];return Hi(t,(function(t,i,o){r[++n]=e(t,i,o)})),r},_a=function(t,e){return((0,s.Z)(t)?a:va)(t,Di(e))},ba=function(t,e){return Fe(_a(t,e),1)},xa=function(t,e){return Fe(_a(t,e),1/0)},wa=function(t,e,n){return n=void 0===n?1:m(n),Fe(_a(t,e),n)},Sa=function(t){return null!=t&&t.length?Fe(t,1/0):[]},Ea=function(t,e){return null!=t&&t.length?(e=void 0===e?1:m(e),Fe(t,e)):[]},Ma=function(t){return Tt(t,512)},Ta=ur("floor"),Aa=function(t){return Be((function(e){var n=e.length,r=n,i=Z.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new TypeError("Expected a function");if(i&&!a&&"wrapper"==j(o))var a=new Z([],!0)}for(r=a?r:n;++r<n;){o=e[r];var u=j(o),l="wrapper"==u?F(o):void 0;a=l&&X(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[j(l[0])].apply(a,l[3]):1==o.length&&X(o)?a[u]():a.thru(o)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&(0,s.Z)(r))return a.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))},Ca=Aa(),Oa=Aa(!0),Pa=function(t,e){return null==t?t:Zi(t,Do(e),Qt)},ka=function(t,e){return null==t?t:zo(t,Do(e),Qt)},La=function(t,e){return t&&Vi(t,Do(e))},Ia=function(t,e){return t&&Bo(t,Do(e))},Ra=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Da=function(t,e){return Er(e,(function(e){return(0,lo.Z)(t[e])}))},Na=function(t){return null==t?[]:Da(t,qt(t))},Fa=function(t){return null==t?[]:Da(t,Qt(t))};var za=Object.prototype.hasOwnProperty;const Ba=qi((function(t,e,n){za.call(t,n)?t[n].push(e):Ct(t,n,[e])})),ja=function(t,e){return t>e},Ua=function(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=(0,f.Z)(e),n=(0,f.Z)(n)),t(e,n)}},Za=Ua(ja),Va=Ua((function(t,e){return t>=e}));var Ga=Object.prototype.hasOwnProperty;const Ha=function(t,e){return null!=t&&Ga.call(t,e)},Wa=function(t,e){return null!=t&&Pi(t,e,Ha)};var qa=Math.max,Ya=Math.min;const Xa=function(t,e,n){return e=d(e),void 0===n?(n=e,e=0):n=d(n),function(t,e,n){return t>=Ya(e,n)&&t<qa(e,n)}(t=(0,f.Z)(t),e,n)},$a=function(t){return"string"==typeof t||!(0,s.Z)(t)&&(0,V.Z)(t)&&"[object String]"==(0,Ue.Z)(t)},Ka=function(t,e){return a(e,(function(e){return t[e]}))},Ja=function(t){return null==t?[]:Ka(t,qt(t))};var Qa=Math.max;const ts=function(t,e,n,r){t=(0,Nt.Z)(t)?t:Ja(t),n=n&&!r?m(n):0;var i=t.length;return n<0&&(n=Qa(i+n,0)),$a(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&ht(t,e,n)>-1};var es=Math.max;const ns=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:m(n);return i<0&&(i=es(r+i,0)),ht(t,e,i)},rs=function(t){return null!=t&&t.length?on(t,0,-1):[]};var is=Math.min;const os=function(t,e,n){for(var r=n?So:pt,i=t[0].length,o=t.length,s=o,u=Array(o),l=1/0,c=[];s--;){var h=t[s];s&&e&&(h=a(h,(0,Vr.Z)(e))),l=is(h.length,l),u[s]=!n&&(e||i>=120&&h.length>=120)?new ui(s&&h):void 0}h=t[0];var p=-1,f=u[0];t:for(;++p<i&&c.length<l;){var d=h[p],m=e?e(d):d;if(d=n||0!==d?d:0,!(f?ci(f,m):r(c,m,n))){for(s=o;--s;){var g=u[s];if(!(g?ci(g,m):r(t[s],m,n)))continue t}f&&f.push(m),c.push(d)}}return c},as=function(t){return uo(t)?t:[]},ss=Dt((function(t){var e=a(t,as);return e.length&&e[0]===t[0]?os(e):[]}));const us=Dt((function(t){var e=To(t),n=a(t,as);return e===To(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?os(n,Di(e)):[]})),ls=Dt((function(t){var e=To(t),n=a(t,as);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?os(n,void 0,e):[]})),cs=function(t,e){return function(n,r){return function(t,e,n,r){return Vi(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}};var hs=Object.prototype.toString;const ps=cs((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=hs.call(e)),t[e]=n}),nt(y));var fs=Object.prototype,ds=fs.hasOwnProperty,ms=fs.toString;const gs=cs((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=ms.call(e)),ds.call(t,e)?t[e].push(n):t[e]=[n]}),Di),ys=function(t,e){return e.length<2?t:ke(t,on(e,0,-1))},vs=function(t,e,n){e=Oe(e,t);var r=null==(t=ys(t,e))?t:t[Pe(To(e))];return null==r?void 0:A(r,t,n)},_s=Dt(vs);const bs=Dt((function(t,e,n){var r=-1,i="function"==typeof e,o=(0,Nt.Z)(t)?Array(t.length):[];return Hi(t,(function(t){o[++r]=i?A(e,t,n):vs(t,e,n)})),o}));var xs=Gr.Z&&Gr.Z.isArrayBuffer;const ws=xs?(0,Vr.Z)(xs):function(t){return(0,V.Z)(t)&&"[object ArrayBuffer]"==(0,Ue.Z)(t)},Ss=function(t){return!0===t||!1===t||(0,V.Z)(t)&&"[object Boolean]"==(0,Ue.Z)(t)};var Es=Gr.Z&&Gr.Z.isDate;const Ms=Es?(0,Vr.Z)(Es):function(t){return(0,V.Z)(t)&&"[object Date]"==(0,Ue.Z)(t)},Ts=function(t){return(0,V.Z)(t)&&1===t.nodeType&&!Ye(t)};var As=n(7127);const Cs=function(t,e){return wi(t,e)},Os=function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?wi(t,e,void 0,n):!!r};var Ps=T.Z.isFinite;const ks=function(t){return"number"==typeof t&&Ps(t)},Ls=function(t){return"number"==typeof t&&t==m(t)},Is=function(t,e){return t===e||Si(t,e,Mi(e))},Rs=function(t,e,n){return n="function"==typeof n?n:void 0,Si(t,e,Mi(e),n)},Ds=function(t){return"number"==typeof t||(0,V.Z)(t)&&"[object Number]"==(0,Ue.Z)(t)},Ns=function(t){return Ds(t)&&t!=+t};var Fs=n(2828),zs=n(7277),Bs=n(4811);const js=zs.Z?lo.Z:Bs.Z,Us=function(t){if(js(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return(0,Fs.Z)(t)},Zs=function(t){return null==t},Vs=function(t){return null===t};var Gs=Gr.Z&&Gr.Z.isRegExp;const Hs=Gs?(0,Vr.Z)(Gs):function(t){return(0,V.Z)(t)&&"[object RegExp]"==(0,Ue.Z)(t)};const Ws=function(t){return Ls(t)&&t>=-9007199254740991&&t<=9007199254740991},qs=function(t){return void 0===t},Ys=function(t){return(0,V.Z)(t)&&"[object WeakMap]"==(0,Ir.Z)(t)},Xs=function(t){return(0,V.Z)(t)&&"[object WeakSet]"==(0,Ue.Z)(t)},$s=function(t){return Di("function"==typeof t?t:Qr(t,1))};var Ks=Array.prototype.join;const Js=function(t,e){return null==t?"":Ks.call(t,e)};const Qs=rr((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}));const tu=qi((function(t,e,n){Ct(t,n,e)}));var eu=Math.max,nu=Math.min;const ru=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=m(n))<0?eu(r+i,0):nu(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):lt(t,ct,i,!0)};const iu=rr((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),ou=wn("toLowerCase"),au=function(t,e){return t<e},su=Ua(au),uu=Ua((function(t,e){return t<=e})),lu=function(t,e){var n={};return e=Di(e),Vi(t,(function(t,r,i){Ct(n,e(t,r,i),t)})),n},cu=function(t,e){var n={};return e=Di(e),Vi(t,(function(t,r,i){Ct(n,r,e(t,r,i))})),n},hu=function(t){return Ai(Qr(t,1))},pu=function(t,e){return Li(t,Qr(e,1))},fu=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(void 0===u?s==s&&!(0,r.Z)(s):n(s,u)))var u=s,l=a}return l},du=function(t){return t&&t.length?fu(t,y,ja):void 0},mu=function(t,e){return t&&t.length?fu(t,Di(e),ja):void 0},gu=function(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n},yu=function(t,e){var n=null==t?0:t.length;return n?gu(t,e)/n:NaN},vu=function(t){return yu(t,y)},_u=function(t,e){return yu(t,Di(e))};var bu=zt((function(t,e,n){po(t,e,n)}));const xu=bu,wu=Dt((function(t,e){return function(n){return vs(n,t,e)}})),Su=Dt((function(t,e){return function(n){return vs(t,n,e)}})),Eu=function(t){return t&&t.length?fu(t,y,au):void 0},Mu=function(t,e){return t&&t.length?fu(t,Di(e),au):void 0},Tu=function(t,e,n){var r=qt(e),i=Da(e,r),o=!((0,w.Z)(n)&&"chain"in n&&!n.chain),a=(0,lo.Z)(t);return ut(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=G(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Re([this.value()],arguments))})})),t},Au=h((function(t,e){return t*e}),1),Cu=function(t){if("function"!=typeof t)throw new TypeError("Expected a function");return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}};var Ou=o.Z?o.Z.iterator:void 0;const Pu=function(t){if(!t)return[];if((0,Nt.Z)(t))return $a(t)?xn(t):G(t);if(Ou&&t[Ou])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Ou]());var e=(0,Ir.Z)(t);return("[object Map]"==e?pi:"[object Set]"==e?fi:Ja)(t)},ku=function(){void 0===this.__values__&&(this.__values__=Pu(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}};var Lu=n(7502);const Iu=function(t,e){var n=t.length;if(n)return vt(e+=e<0?n:0,n)?t[e]:void 0},Ru=function(t,e){return t&&t.length?Iu(t,m(e)):void 0},Du=function(t){return t=m(t),Dt((function(e){return Iu(e,t)}))},Nu=function(t,e){return e=Oe(e,t),null==(t=ys(t,e))||delete t[Pe(To(e))]},Fu=function(t){return Ye(t)?void 0:t};const zu=Be((function(t,e){var n={};if(null==t)return n;var r=!1;e=a(e,(function(e){return e=Oe(e,t),r||(r=e.length>1),e})),Lt(t,Lr(t),n),r&&(n=Qr(n,7,Fu));for(var i=e.length;i--;)Nu(n,e[i]);return n})),Bu=function(t,e,n,r){if(!(0,w.Z)(t))return t;for(var i=-1,o=(e=Oe(e,t)).length,a=o-1,s=t;null!=s&&++i<o;){var u=Pe(e[i]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=(0,w.Z)(c)?c:vt(e[i+1])?[]:{})}kt(s,u,l),s=s[u]}return t},ju=function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ke(t,a);n(s,a)&&Bu(o,Oe(a,t),s)}return o},Uu=function(t,e){if(null==t)return{};var n=a(Lr(t),(function(t){return[t]}));return e=Di(e),ju(t,n,(function(t,n){return e(t,n[0])}))},Zu=function(t,e){return Uu(t,Cu(Di(e)))},Vu=function(t){return Je(2,t)},Gu=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=(0,r.Z)(t),s=void 0!==e,u=null===e,l=e==e,c=(0,r.Z)(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||i&&s&&l||!n&&l||!o)return 1;if(!i&&!a&&!c&&t<e||c&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!l)return-1}return 0},Hu=function(t,e,n){e=e.length?a(e,(function(t){return(0,s.Z)(t)?function(e){return ke(e,1===t.length?t[0]:t)}:t})):[y];var r=-1;return e=a(e,(0,Vr.Z)(Di)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(va(t,(function(t,n,i){return{criteria:a(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var u=Gu(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))},Wu=function(t,e,n,r){return null==t?[]:((0,s.Z)(e)||(e=null==e?[]:[e]),n=r?void 0:n,(0,s.Z)(n)||(n=null==n?[]:[n]),Hu(t,e,n))},qu=function(t){return Be((function(e){return e=a(e,(0,Vr.Z)(Di)),Dt((function(n){var r=this;return t(e,(function(t){return A(t,r,n)}))}))}))},Yu=qu(a),Xu=Dt;var $u=Math.min,Ku=Xu((function(t,e){var n=(e=1==e.length&&(0,s.Z)(e[0])?a(e[0],(0,Vr.Z)(Di)):a(Fe(e,1),(0,Vr.Z)(Di))).length;return Dt((function(r){for(var i=-1,o=$u(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return A(t,this,r)}))}));const Ju=Ku,Qu=qu(Qo),tl=qu(li);var el=Math.floor;const nl=function(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=el(e/2))&&(t+=t)}while(e);return n},rl=Ii("length");var il="\\ud800-\\udfff",ol="["+il+"]",al="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",sl="\\ud83c[\\udffb-\\udfff]",ul="[^"+il+"]",ll="(?:\\ud83c[\\udde6-\\uddff]){2}",cl="[\\ud800-\\udbff][\\udc00-\\udfff]",hl="(?:"+al+"|"+sl+")?",pl="[\\ufe0e\\ufe0f]?",fl=pl+hl+"(?:\\u200d(?:"+[ul,ll,cl].join("|")+")"+pl+hl+")*",dl="(?:"+[ul+al+"?",al,ll,cl,ol].join("|")+")",ml=RegExp(sl+"(?="+sl+")|"+dl+fl,"g");const gl=function(t){return un(t)?function(t){for(var e=ml.lastIndex=0;ml.test(t);)++e;return e}(t):rl(t)};var yl=Math.ceil;const vl=function(t,e){var n=(e=void 0===e?" ":c(e)).length;if(n<2)return n?nl(e,t):e;var r=nl(e,yl(t/gl(e)));return un(e)?an(xn(r),0,t).join(""):r.slice(0,t)};var _l=Math.ceil,bl=Math.floor;const xl=function(t,e,n){t=Ce(t);var r=(e=m(e))?gl(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return vl(bl(i),n)+t+vl(_l(i),n)},wl=function(t,e,n){t=Ce(t);var r=(e=m(e))?gl(t):0;return e&&r<e?t+vl(e-r,n):t},Sl=function(t,e,n){t=Ce(t);var r=(e=m(e))?gl(t):0;return e&&r<e?vl(e-r,n)+t:t};var El=/^\s+/,Ml=T.Z.parseInt;const Tl=function(t,e,n){return n||null==e?e=0:e&&(e=+e),Ml(Ce(t).replace(El,""),e||0)};var Al=Dt((function(t,e){var n=xt(e,gt(Al));return Tt(t,32,void 0,e,n)}));Al.placeholder={};const Cl=Al;var Ol=Dt((function(t,e){var n=xt(e,gt(Ol));return Tt(t,64,void 0,e,n)}));Ol.placeholder={};const Pl=Ol;const kl=qi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ll=Be((function(t,e){return null==t?{}:function(t,e){return ju(t,e,(function(e,n){return ki(t,n)}))}(t,e)})),Il=function(t){for(var e,n=this;n instanceof L;){var r=H(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Rl=function(t){return function(e){return null==t?void 0:ke(t,e)}},Dl=function(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1};var Nl=Array.prototype.splice;const Fl=function(t,e,n,r){var i=r?Dl:ht,o=-1,s=e.length,u=t;for(t===e&&(e=G(e)),n&&(u=a(t,(0,Vr.Z)(n)));++o<s;)for(var l=0,c=e[o],h=n?n(c):c;(l=i(u,h,l,r))>-1;)u!==t&&Nl.call(u,l,1),Nl.call(t,l,1);return t},zl=function(t,e){return t&&t.length&&e&&e.length?Fl(t,e):t},Bl=Dt(zl),jl=function(t,e,n){return t&&t.length&&e&&e.length?Fl(t,e,Di(n)):t},Ul=function(t,e,n){return t&&t.length&&e&&e.length?Fl(t,e,void 0,n):t};var Zl=Array.prototype.splice;const Vl=function(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;vt(i)?Zl.call(t,i,1):Nu(t,i)}}return t};const Gl=Be((function(t,e){var n=null==t?0:t.length,r=Ie(t,e);return Vl(t,a(e,(function(t){return vt(t,n)?+t:t})).sort(Gu)),r}));var Hl=Math.floor,Wl=Math.random;const ql=function(t,e){return t+Hl(Wl()*(e-t+1))};var Yl=parseFloat,Xl=Math.min,$l=Math.random;const Kl=function(t,e,n){if(n&&"boolean"!=typeof n&&Ft(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=d(t),void 0===e?(e=t,t=0):e=d(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=$l();return Xl(t+i*(e-t+Yl("1e-"+((i+"").length-1))),e)}return ql(t,e)};var Jl=Math.ceil,Ql=Math.max;const tc=function(t){return function(e,n,r){return r&&"number"!=typeof r&&Ft(e,n,r)&&(n=r=void 0),e=d(e),void 0===n?(n=e,e=0):n=d(n),function(t,e,n,r){for(var i=-1,o=Ql(Jl((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:d(r),t)}},ec=tc(),nc=tc(!0);var rc=Be((function(t,e){return Tt(t,256,void 0,void 0,void 0,e)}));const ic=rc,oc=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n},ac=function(t,e,n){var r=(0,s.Z)(t)?Mn:oc,i=arguments.length<3;return r(t,Di(e),n,i,Hi)},sc=function(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n},uc=function(t,e,n){var r=(0,s.Z)(t)?sc:oc,i=arguments.length<3;return r(t,Di(e),n,i,jo)},lc=function(t,e){return((0,s.Z)(t)?Er:ia)(t,Cu(Di(e)))},cc=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=Di(e);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Vl(t,i),n},hc=function(t,e,n){return e=(n?Ft(t,e,n):void 0===e)?1:m(e),nl(Ce(t),e)},pc=function(){var t=arguments,e=Ce(t[0]);return t.length<3?e:e.replace(t[1],t[2])},fc=function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=void 0===e?e:m(e),Dt(t,e)},dc=function(t,e,n){var r=-1,i=(e=Oe(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[Pe(e[r])];void 0===o&&(r=i,o=n),t=(0,lo.Z)(o)?o.call(t):o}return t};var mc=Array.prototype.reverse;const gc=function(t){return null==t?t:mc.call(t)},yc=ur("round"),vc=function(t){var e=t.length;return e?t[ql(0,e-1)]:void 0},_c=function(t){return vc(Ja(t))},bc=function(t){return((0,s.Z)(t)?vc:_c)(t)},xc=function(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var o=ql(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t},wc=function(t,e){return xc(G(t),dr(e,0,t.length))},Sc=function(t,e){var n=Ja(t);return xc(n,dr(e,0,n.length))},Ec=function(t,e,n){return e=(n?Ft(t,e,n):void 0===e)?1:m(e),((0,s.Z)(t)?wc:Sc)(t,e)},Mc=function(t,e,n){return null==t?t:Bu(t,e,n)},Tc=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Bu(t,e,n,r)},Ac=function(t){return xc(G(t))},Cc=function(t){return xc(Ja(t))},Oc=function(t){return((0,s.Z)(t)?Ac:Cc)(t)},Pc=function(t){if(null==t)return 0;if((0,Nt.Z)(t))return $a(t)?gl(t):t.length;var e=(0,Ir.Z)(t);return"[object Map]"==e||"[object Set]"==e?t.size:(0,Wt.Z)(t).length},kc=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&Ft(t,e,n)?(e=0,n=r):(e=null==e?0:m(e),n=void 0===n?r:m(n)),on(t,e,n)):[]};const Lc=rr((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ic=function(t,e){var n;return Hi(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n},Rc=function(t,e,n){var r=(0,s.Z)(t)?li:Ic;return n&&Ft(t,e,n)&&(e=void 0),r(t,Di(e))},Dc=Dt((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Ft(t,e[0],e[1])?e=[]:n>2&&Ft(e[0],e[1],e[2])&&(e=[e[0]]),Hu(t,Fe(e,1),[])}));var Nc=Math.floor,Fc=Math.min;const zc=function(t,e,n,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,l=(0,r.Z)(e),c=void 0===e;o<a;){var h=Nc((o+a)/2),p=n(t[h]),f=void 0!==p,d=null===p,m=p==p,g=(0,r.Z)(p);if(s)var y=i||m;else y=c?m&&(i||f):u?m&&f&&(i||!d):l?m&&f&&!d&&(i||!g):!d&&!g&&(i?p<=e:p<e);y?o=h+1:a=h}return Fc(a,4294967294)},Bc=function(t,e,n){var i=0,o=null==t?i:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;i<o;){var a=i+o>>>1,s=t[a];null!==s&&!(0,r.Z)(s)&&(n?s<=e:s<e)?i=a+1:o=a}return o}return zc(t,e,y,n)},jc=function(t,e){return Bc(t,e)},Uc=function(t,e,n){return zc(t,e,Di(n))},Zc=function(t,e){var n=null==t?0:t.length;if(n){var r=Bc(t,e);if(r<n&&Ot(t[r],e))return r}return-1},Vc=function(t,e){return Bc(t,e,!0)},Gc=function(t,e,n){return zc(t,e,Di(n),!0)},Hc=function(t,e){if(null!=t&&t.length){var n=Bc(t,e,!0)-1;if(Ot(t[n],e))return n}return-1},Wc=function(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Ot(s,u)){var u=s;o[i++]=0===a?0:a}}return o},qc=function(t){return t&&t.length?Wc(t):[]},Yc=function(t,e){return t&&t.length?Wc(t,Di(e)):[]},Xc=function(t,e,n){return n&&"number"!=typeof n&&Ft(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=Ce(t))&&("string"==typeof e||null!=e&&!Hs(e))&&!(e=c(e))&&un(t)?an(xn(t),0,n):t.split(e,n):[]};var $c=Math.max;const Kc=function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:$c(m(e),0),Dt((function(n){var r=n[e],i=an(n,0,e);return r&&Re(i,r),A(t,this,i)}))};const Jc=rr((function(t,e,n){return t+(n?" ":"")+Sn(e)})),Qc=function(t,e,n){return t=Ce(t),n=null==n?0:dr(m(n),0,t.length),e=c(e),t.slice(n,n+e.length)==e},th=function(){return{}},eh=function(){return""},nh=function(){return!0},rh=h((function(t,e){return t-e}),0),ih=function(t){return t&&t.length?gu(t,y):0},oh=function(t,e){return t&&t.length?gu(t,Di(e)):0},ah=function(t){var e=null==t?0:t.length;return e?on(t,1,e):[]},sh=function(t,e,n){return t&&t.length?(e=n||void 0===e?1:m(e),on(t,0,e<0?0:e)):[]},uh=function(t,e,n){var r=null==t?0:t.length;return r?(e=n||void 0===e?1:m(e),on(t,(e=r-e)<0?0:e,r)):[]},lh=function(t,e){return t&&t.length?Lo(t,Di(e),!1,!0):[]},ch=function(t,e){return t&&t.length?Lo(t,Di(e)):[]},hh=function(t,e){return e(t),t};var ph=Object.prototype,fh=ph.hasOwnProperty;const dh=function(t,e,n,r){return void 0===t||Ot(t,ph[n])&&!fh.call(r,n)?e:t};var mh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};const gh=function(t){return"\\"+mh[t]},yh=/<%=([\s\S]+?)%>/g,vh={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:yh,variable:"",imports:{_:{escape:Xo}}};var _h=/\b__p \+= '';/g,bh=/\b(__p \+=) '' \+/g,xh=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wh=/[()=,{}\[\]\/\s]/,Sh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Eh=/($^)/,Mh=/['\n\r\u2028\u2029\\]/g,Th=Object.prototype.hasOwnProperty;const Ah=function(t,e,n){var r=vh.imports._.templateSettings||vh;n&&Ft(t,e,n)&&(e=void 0),t=Ce(t),e=re({},e,r,dh);var i,o,a=re({},e.imports,r.imports,dh),s=qt(a),u=Ka(a,s),l=0,c=e.interpolate||Eh,h="__p += '",p=RegExp((e.escape||Eh).source+"|"+c.source+"|"+(c===yh?Sh:Eh).source+"|"+(e.evaluate||Eh).source+"|$","g"),f=Th.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(p,(function(e,n,r,a,s,u){return r||(r=a),h+=t.slice(l,u).replace(Mh,gh),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var d=Th.call(e,"variable")&&e.variable;if(d){if(wh.test(d))throw new Error("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(_h,""):h).replace(bh,"$1").replace(xh,"$1;"),h="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ke((function(){return Function(s,f+"return "+h).apply(void 0,u)}));if(m.source=h,Xe(m))throw m;return m},Ch=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return(0,w.Z)(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),(0,eo.Z)(t,e,{leading:r,maxWait:e,trailing:i})},Oh=function(t,e){return e(t)};var Ph=4294967295,kh=Math.min;const Lh=function(t,e){if((t=m(t))<1||t>9007199254740991)return[];var n=Ph,r=kh(t,Ph);e=Do(e),t-=Ph;for(var i=jt(r,e);++n<t;)e(n);return i},Ih=function(){return this},Rh=function(t,e){var n=t;return n instanceof R&&(n=n.value()),Mn(e,(function(t,e){return e.func.apply(e.thisArg,Re([t],e.args))}),n)},Dh=function(){return Rh(this.__wrapped__,this.__actions__)},Nh=function(t){return Ce(t).toLowerCase()},Fh=function(t){return(0,s.Z)(t)?a(t,Pe):(0,r.Z)(t)?[t]:G(Ae(Ce(t)))};const zh=function(t){return t?dr(m(t),-9007199254740991,9007199254740991):0===t?t:0},Bh=function(t){return Ce(t).toUpperCase()},jh=function(t,e,n){var r=(0,s.Z)(t),i=r||(0,Zt.Z)(t)||(0,Vt.Z)(t);if(e=Di(e),null==n){var o=t&&t.constructor;n=i?r?new o:[]:(0,w.Z)(t)&&(0,lo.Z)(o)?E(Ze(t)):{}}return(i?ut:Vi)(t,(function(t,r,i){return e(n,t,r,i)})),n};var Uh=n(8066);const Zh=function(t,e){for(var n=t.length;n--&&ht(e,t[n],0)>-1;);return n},Vh=function(t,e){for(var n=-1,r=t.length;++n<r&&ht(e,t[n],0)>-1;);return n},Gh=function(t,e,n){if((t=Ce(t))&&(n||void 0===e))return(0,Uh.Z)(t);if(!t||!(e=c(e)))return t;var r=xn(t),i=xn(e),o=Vh(r,i),a=Zh(r,i)+1;return an(r,o,a).join("")};var Hh=n(5859);const Wh=function(t,e,n){if((t=Ce(t))&&(n||void 0===e))return t.slice(0,(0,Hh.Z)(t)+1);if(!t||!(e=c(e)))return t;var r=xn(t),i=Zh(r,xn(e))+1;return an(r,0,i).join("")};var qh=/^\s+/;const Yh=function(t,e,n){if((t=Ce(t))&&(n||void 0===e))return t.replace(qh,"");if(!t||!(e=c(e)))return t;var r=xn(t),i=Vh(r,xn(e));return an(r,i).join("")};var Xh=/\w*$/;const $h=function(t,e){var n=30,r="...";if((0,w.Z)(e)){var i="separator"in e?e.separator:i;n="length"in e?m(e.length):n,r="omission"in e?c(e.omission):r}var o=(t=Ce(t)).length;if(un(t)){var a=xn(t);o=a.length}if(n>=o)return t;var s=n-gl(r);if(s<1)return r;var u=a?an(a,0,s).join(""):t.slice(0,s);if(void 0===i)return u+r;if(a&&(s+=u.length-s),Hs(i)){if(t.slice(s).search(i)){var l,h=u;for(i.global||(i=RegExp(i.source,Ce(Xh.exec(i))+"g")),i.lastIndex=0;l=i.exec(h);)var p=l.index;u=u.slice(0,void 0===p?s:p)}}else if(t.indexOf(c(i),s)!=s){var f=u.lastIndexOf(i);f>-1&&(u=u.slice(0,f))}return u+r},Kh=function(t){return At(t,1)},Jh=Tn({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Qh=/&(?:amp|lt|gt|quot|#39);/g,tp=RegExp(Qh.source);const ep=function(t){return(t=Ce(t))&&tp.test(t)?t.replace(Qh,Jh):t};var np=n(5088);const rp=np.Z&&1/fi(new np.Z([,-0]))[1]==1/0?function(t){return new np.Z(t)}:D,ip=function(t,e,n){var r=-1,i=pt,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=So;else if(o>=200){var l=e?null:rp(t);if(l)return fi(l);a=!1,i=ci,u=new ui}else u=e?[]:s;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,a&&h==h){for(var p=u.length;p--;)if(u[p]===h)continue t;e&&u.push(h),s.push(c)}else i(u,h,n)||(u!==s&&u.push(h),s.push(c))}return s},op=Dt((function(t){return ip(Fe(t,1,uo,!0))}));const ap=Dt((function(t){var e=To(t);return uo(e)&&(e=void 0),ip(Fe(t,1,uo,!0),Di(e))})),sp=Dt((function(t){var e=To(t);return e="function"==typeof e?e:void 0,ip(Fe(t,1,uo,!0),void 0,e)})),up=function(t){return t&&t.length?ip(t):[]},lp=function(t,e){return t&&t.length?ip(t,Di(e)):[]},cp=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?ip(t,void 0,e):[]};var hp=0;const pp=function(t){var e=++hp;return Ce(t)+e},fp=function(t,e){return null==t||Nu(t,e)};var dp=Math.max;const mp=function(t){if(!t||!t.length)return[];var e=0;return t=Er(t,(function(t){if(uo(t))return e=dp(t.length,e),!0})),jt(e,(function(e){return a(t,Ii(e))}))},gp=function(t,e){if(!t||!t.length)return[];var n=mp(t);return null==e?n:a(n,(function(t){return A(e,void 0,t)}))},yp=function(t,e,n,r){return Bu(t,e,n(ke(t,e)),r)},vp=function(t,e,n){return null==t?t:yp(t,e,Do(n))},_p=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:yp(t,e,Do(n),r)};const bp=rr((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),xp=function(t){return null==t?[]:Ka(t,Qt(t))};const wp=Dt((function(t,e){return uo(t)?Eo(t,e):[]})),Sp=function(t,e){return Cl(Do(e),t)},Ep=Be((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Ie(e,t)};return!(e>1||this.__actions__.length)&&r instanceof R&&vt(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Oh,args:[i],thisArg:void 0}),new Z(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)})),Mp=function(){return cr(this)},Tp=function(){var t=this.__wrapped__;if(t instanceof R){var e=t;return this.__actions__.length&&(e=new R(this)),(e=e.reverse()).__actions__.push({func:Oh,args:[gc],thisArg:void 0}),new Z(e,this.__chain__)}return this.thru(gc)},Ap=function(t,e,n){var r=t.length;if(r<2)return r?ip(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=Eo(o[i]||a,t[s],e,n));return ip(Fe(o,1),e,n)},Cp=Dt((function(t){return Ap(Er(t,uo))}));const Op=Dt((function(t){var e=To(t);return uo(e)&&(e=void 0),Ap(Er(t,uo),Di(e))})),Pp=Dt((function(t){var e=To(t);return e="function"==typeof e?e:void 0,Ap(Er(t,uo),void 0,e)})),kp=Dt(mp),Lp=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a},Ip=function(t,e){return Lp(t||[],e||[],kt)},Rp=function(t,e){return Lp(t||[],e||[],Bu)};const Dp=Dt((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,gp(t,n)})),Np={chunk:fr,compact:oi,concat:ai,difference:Mo,differenceBy:Ao,differenceWith:Co,drop:Po,dropRight:ko,dropRightWhile:Io,dropWhile:Ro,fill:ra,findIndex:ua,findLastIndex:da,first:ya,flatten:ze,flattenDeep:Sa,flattenDepth:Ea,fromPairs:Ra,head:ya,indexOf:ns,initial:rs,intersection:ss,intersectionBy:us,intersectionWith:ls,join:Js,last:To,lastIndexOf:ru,nth:Ru,pull:Bl,pullAll:zl,pullAllBy:jl,pullAllWith:Ul,pullAt:Gl,remove:cc,reverse:gc,slice:kc,sortedIndex:jc,sortedIndexBy:Uc,sortedIndexOf:Zc,sortedLastIndex:Vc,sortedLastIndexBy:Gc,sortedLastIndexOf:Hc,sortedUniq:qc,sortedUniqBy:Yc,tail:ah,take:sh,takeRight:uh,takeRightWhile:lh,takeWhile:ch,union:op,unionBy:ap,unionWith:sp,uniq:up,uniqBy:lp,uniqWith:cp,unzip:mp,unzipWith:gp,without:wp,xor:Cp,xorBy:Op,xorWith:Pp,zip:kp,zipObject:Ip,zipObjectDeep:Rp,zipWith:Dp},Fp={countBy:Xi,each:No,eachRight:Uo,every:ea,filter:oa,find:la,findLast:ma,flatMap:ba,flatMapDeep:xa,flatMapDepth:wa,forEach:No,forEachRight:Uo,groupBy:Ba,includes:ts,invokeMap:bs,keyBy:tu,map:_a,orderBy:Wu,partition:kl,reduce:ac,reduceRight:uc,reject:lc,sample:bc,sampleSize:Ec,shuffle:Oc,size:Pc,some:Rc,sortBy:Dc},zp={now:Lu.Z},Bp={after:g,ary:At,before:Je,bind:tn,bindKey:rn,curry:Ji,curryRight:to,debounce:eo.Z,defer:bo,delay:wo,flip:Ma,memoize:Se,negate:Cu,once:Vu,overArgs:Ju,partial:Cl,partialRight:Pl,rearg:ic,rest:fc,spread:Kc,throttle:Ch,unary:Kh,wrap:Sp},jp={castArray:or,clone:ti,cloneDeep:ei,cloneDeepWith:ni,cloneWith:ri,conformsTo:Bi,eq:Ot,gt:Za,gte:Va,isArguments:Ut.Z,isArray:s.Z,isArrayBuffer:ws,isArrayLike:Nt.Z,isArrayLikeObject:uo,isBoolean:Ss,isBuffer:Zt.Z,isDate:Ms,isElement:Ts,isEmpty:As.Z,isEqual:Cs,isEqualWith:Os,isError:Xe,isFinite:ks,isFunction:lo.Z,isInteger:Ls,isLength:Oi.Z,isMap:Wr,isMatch:Is,isMatchWith:Rs,isNaN:Ns,isNative:Us,isNil:Zs,isNull:Vs,isNumber:Ds,isObject:w.Z,isObjectLike:V.Z,isPlainObject:Ye,isRegExp:Hs,isSafeInteger:Ws,isSet:Yr,isString:$a,isSymbol:r.Z,isTypedArray:Vt.Z,isUndefined:qs,isWeakMap:Ys,isWeakSet:Xs,lt:su,lte:uu,toArray:Pu,toFinite:d,toInteger:m,toLength:na,toNumber:f.Z,toPlainObject:ho,toSafeInteger:zh,toString:Ce},Up={add:p,ceil:lr,divide:Oo,floor:Ta,max:du,maxBy:mu,mean:vu,meanBy:_u,min:Eu,minBy:Mu,multiply:Au,round:yc,subtract:rh,sum:ih,sumBy:oh},Zp={clamp:mr,inRange:Xa,random:Kl},Vp={assign:$t,assignIn:ee,assignInWith:re,assignWith:oe,at:je,create:$i,defaults:ao,defaultsDeep:yo,entries:Go,entriesIn:Ho,extend:ee,extendWith:re,findKey:ha,findLastKey:ga,forIn:Pa,forInRight:ka,forOwn:La,forOwnRight:Ia,functions:Na,functionsIn:Fa,get:Le,has:Wa,hasIn:ki,invert:ps,invertBy:gs,invoke:_s,keys:qt,keysIn:Qt,mapKeys:lu,mapValues:cu,merge:xu,mergeWith:go,omit:zu,omitBy:Zu,pick:Ll,pickBy:Uu,result:dc,set:Mc,setWith:Tc,toPairs:Go,toPairsIn:Ho,transform:jh,unset:fp,update:vp,updateWith:_p,values:Ja,valuesIn:xp},Gp={at:Ep,chain:cr,commit:ii,lodash:Y,next:ku,plant:Il,reverse:Tp,tap:hh,thru:Oh,toIterator:Ih,toJSON:Dh,value:Dh,valueOf:Dh,wrapperChain:Mp},Hp={camelCase:ir,capitalize:En,deburr:Pn,endsWith:Zo,escape:Xo,escapeRegExp:Jo,kebabCase:Qs,lowerCase:iu,lowerFirst:ou,pad:xl,padEnd:wl,padStart:Sl,parseInt:Tl,repeat:hc,replace:pc,snakeCase:Lc,split:Xc,startCase:Jc,startsWith:Qc,template:Ah,templateSettings:vh,toLower:Nh,toUpper:Bh,trim:Gh,trimEnd:Wh,trimStart:Yh,truncate:$h,unescape:ep,upperCase:bp,upperFirst:Sn,words:er},Wp={attempt:Ke,bindAll:en,cond:Ni,conforms:zi,constant:nt,defaultTo:no,flow:Ca,flowRight:Oa,identity:y,iteratee:$s,matches:hu,matchesProperty:pu,method:wu,methodOf:Su,mixin:Tu,noop:D,nthArg:Du,over:Yu,overEvery:Qu,overSome:tl,property:Ri,propertyOf:Rl,range:ec,rangeRight:nc,stubArray:Mr,stubFalse:Bs.Z,stubObject:th,stubString:eh,stubTrue:nh,times:Lh,toPath:Fh,uniqueId:pp};var qp=Math.max,Yp=Math.min;var Xp=Math.min;var $p,Kp,Jp=4294967295,Qp=Array.prototype,tf=Object.prototype.hasOwnProperty,ef=o.Z?o.Z.iterator:void 0,nf=Math.max,rf=Math.min,of=($p=Tu,function(t,e,n){if(null==n){var r=(0,w.Z)(e),i=r&&qt(e),o=i&&i.length&&Da(e,i);(o?o.length:r)||(n=e,e=t,t=this)}return $p(t,e,n)});Y.after=Bp.after,Y.ary=Bp.ary,Y.assign=Vp.assign,Y.assignIn=Vp.assignIn,Y.assignInWith=Vp.assignInWith,Y.assignWith=Vp.assignWith,Y.at=Vp.at,Y.before=Bp.before,Y.bind=Bp.bind,Y.bindAll=Wp.bindAll,Y.bindKey=Bp.bindKey,Y.castArray=jp.castArray,Y.chain=Gp.chain,Y.chunk=Np.chunk,Y.compact=Np.compact,Y.concat=Np.concat,Y.cond=Wp.cond,Y.conforms=Wp.conforms,Y.constant=Wp.constant,Y.countBy=Fp.countBy,Y.create=Vp.create,Y.curry=Bp.curry,Y.curryRight=Bp.curryRight,Y.debounce=Bp.debounce,Y.defaults=Vp.defaults,Y.defaultsDeep=Vp.defaultsDeep,Y.defer=Bp.defer,Y.delay=Bp.delay,Y.difference=Np.difference,Y.differenceBy=Np.differenceBy,Y.differenceWith=Np.differenceWith,Y.drop=Np.drop,Y.dropRight=Np.dropRight,Y.dropRightWhile=Np.dropRightWhile,Y.dropWhile=Np.dropWhile,Y.fill=Np.fill,Y.filter=Fp.filter,Y.flatMap=Fp.flatMap,Y.flatMapDeep=Fp.flatMapDeep,Y.flatMapDepth=Fp.flatMapDepth,Y.flatten=Np.flatten,Y.flattenDeep=Np.flattenDeep,Y.flattenDepth=Np.flattenDepth,Y.flip=Bp.flip,Y.flow=Wp.flow,Y.flowRight=Wp.flowRight,Y.fromPairs=Np.fromPairs,Y.functions=Vp.functions,Y.functionsIn=Vp.functionsIn,Y.groupBy=Fp.groupBy,Y.initial=Np.initial,Y.intersection=Np.intersection,Y.intersectionBy=Np.intersectionBy,Y.intersectionWith=Np.intersectionWith,Y.invert=Vp.invert,Y.invertBy=Vp.invertBy,Y.invokeMap=Fp.invokeMap,Y.iteratee=Wp.iteratee,Y.keyBy=Fp.keyBy,Y.keys=qt,Y.keysIn=Vp.keysIn,Y.map=Fp.map,Y.mapKeys=Vp.mapKeys,Y.mapValues=Vp.mapValues,Y.matches=Wp.matches,Y.matchesProperty=Wp.matchesProperty,Y.memoize=Bp.memoize,Y.merge=Vp.merge,Y.mergeWith=Vp.mergeWith,Y.method=Wp.method,Y.methodOf=Wp.methodOf,Y.mixin=of,Y.negate=Cu,Y.nthArg=Wp.nthArg,Y.omit=Vp.omit,Y.omitBy=Vp.omitBy,Y.once=Bp.once,Y.orderBy=Fp.orderBy,Y.over=Wp.over,Y.overArgs=Bp.overArgs,Y.overEvery=Wp.overEvery,Y.overSome=Wp.overSome,Y.partial=Bp.partial,Y.partialRight=Bp.partialRight,Y.partition=Fp.partition,Y.pick=Vp.pick,Y.pickBy=Vp.pickBy,Y.property=Wp.property,Y.propertyOf=Wp.propertyOf,Y.pull=Np.pull,Y.pullAll=Np.pullAll,Y.pullAllBy=Np.pullAllBy,Y.pullAllWith=Np.pullAllWith,Y.pullAt=Np.pullAt,Y.range=Wp.range,Y.rangeRight=Wp.rangeRight,Y.rearg=Bp.rearg,Y.reject=Fp.reject,Y.remove=Np.remove,Y.rest=Bp.rest,Y.reverse=Np.reverse,Y.sampleSize=Fp.sampleSize,Y.set=Vp.set,Y.setWith=Vp.setWith,Y.shuffle=Fp.shuffle,Y.slice=Np.slice,Y.sortBy=Fp.sortBy,Y.sortedUniq=Np.sortedUniq,Y.sortedUniqBy=Np.sortedUniqBy,Y.split=Hp.split,Y.spread=Bp.spread,Y.tail=Np.tail,Y.take=Np.take,Y.takeRight=Np.takeRight,Y.takeRightWhile=Np.takeRightWhile,Y.takeWhile=Np.takeWhile,Y.tap=Gp.tap,Y.throttle=Bp.throttle,Y.thru=Oh,Y.toArray=jp.toArray,Y.toPairs=Vp.toPairs,Y.toPairsIn=Vp.toPairsIn,Y.toPath=Wp.toPath,Y.toPlainObject=jp.toPlainObject,Y.transform=Vp.transform,Y.unary=Bp.unary,Y.union=Np.union,Y.unionBy=Np.unionBy,Y.unionWith=Np.unionWith,Y.uniq=Np.uniq,Y.uniqBy=Np.uniqBy,Y.uniqWith=Np.uniqWith,Y.unset=Vp.unset,Y.unzip=Np.unzip,Y.unzipWith=Np.unzipWith,Y.update=Vp.update,Y.updateWith=Vp.updateWith,Y.values=Vp.values,Y.valuesIn=Vp.valuesIn,Y.without=Np.without,Y.words=Hp.words,Y.wrap=Bp.wrap,Y.xor=Np.xor,Y.xorBy=Np.xorBy,Y.xorWith=Np.xorWith,Y.zip=Np.zip,Y.zipObject=Np.zipObject,Y.zipObjectDeep=Np.zipObjectDeep,Y.zipWith=Np.zipWith,Y.entries=Vp.toPairs,Y.entriesIn=Vp.toPairsIn,Y.extend=Vp.assignIn,Y.extendWith=Vp.assignInWith,of(Y,Y),Y.add=Up.add,Y.attempt=Wp.attempt,Y.camelCase=Hp.camelCase,Y.capitalize=Hp.capitalize,Y.ceil=Up.ceil,Y.clamp=Zp.clamp,Y.clone=jp.clone,Y.cloneDeep=jp.cloneDeep,Y.cloneDeepWith=jp.cloneDeepWith,Y.cloneWith=jp.cloneWith,Y.conformsTo=jp.conformsTo,Y.deburr=Hp.deburr,Y.defaultTo=Wp.defaultTo,Y.divide=Up.divide,Y.endsWith=Hp.endsWith,Y.eq=jp.eq,Y.escape=Hp.escape,Y.escapeRegExp=Hp.escapeRegExp,Y.every=Fp.every,Y.find=Fp.find,Y.findIndex=Np.findIndex,Y.findKey=Vp.findKey,Y.findLast=Fp.findLast,Y.findLastIndex=Np.findLastIndex,Y.findLastKey=Vp.findLastKey,Y.floor=Up.floor,Y.forEach=Fp.forEach,Y.forEachRight=Fp.forEachRight,Y.forIn=Vp.forIn,Y.forInRight=Vp.forInRight,Y.forOwn=Vp.forOwn,Y.forOwnRight=Vp.forOwnRight,Y.get=Vp.get,Y.gt=jp.gt,Y.gte=jp.gte,Y.has=Vp.has,Y.hasIn=Vp.hasIn,Y.head=Np.head,Y.identity=y,Y.includes=Fp.includes,Y.indexOf=Np.indexOf,Y.inRange=Zp.inRange,Y.invoke=Vp.invoke,Y.isArguments=jp.isArguments,Y.isArray=s.Z,Y.isArrayBuffer=jp.isArrayBuffer,Y.isArrayLike=jp.isArrayLike,Y.isArrayLikeObject=jp.isArrayLikeObject,Y.isBoolean=jp.isBoolean,Y.isBuffer=jp.isBuffer,Y.isDate=jp.isDate,Y.isElement=jp.isElement,Y.isEmpty=jp.isEmpty,Y.isEqual=jp.isEqual,Y.isEqualWith=jp.isEqualWith,Y.isError=jp.isError,Y.isFinite=jp.isFinite,Y.isFunction=jp.isFunction,Y.isInteger=jp.isInteger,Y.isLength=jp.isLength,Y.isMap=jp.isMap,Y.isMatch=jp.isMatch,Y.isMatchWith=jp.isMatchWith,Y.isNaN=jp.isNaN,Y.isNative=jp.isNative,Y.isNil=jp.isNil,Y.isNull=jp.isNull,Y.isNumber=jp.isNumber,Y.isObject=w.Z,Y.isObjectLike=jp.isObjectLike,Y.isPlainObject=jp.isPlainObject,Y.isRegExp=jp.isRegExp,Y.isSafeInteger=jp.isSafeInteger,Y.isSet=jp.isSet,Y.isString=jp.isString,Y.isSymbol=jp.isSymbol,Y.isTypedArray=jp.isTypedArray,Y.isUndefined=jp.isUndefined,Y.isWeakMap=jp.isWeakMap,Y.isWeakSet=jp.isWeakSet,Y.join=Np.join,Y.kebabCase=Hp.kebabCase,Y.last=To,Y.lastIndexOf=Np.lastIndexOf,Y.lowerCase=Hp.lowerCase,Y.lowerFirst=Hp.lowerFirst,Y.lt=jp.lt,Y.lte=jp.lte,Y.max=Up.max,Y.maxBy=Up.maxBy,Y.mean=Up.mean,Y.meanBy=Up.meanBy,Y.min=Up.min,Y.minBy=Up.minBy,Y.stubArray=Wp.stubArray,Y.stubFalse=Wp.stubFalse,Y.stubObject=Wp.stubObject,Y.stubString=Wp.stubString,Y.stubTrue=Wp.stubTrue,Y.multiply=Up.multiply,Y.nth=Np.nth,Y.noop=Wp.noop,Y.now=zp.now,Y.pad=Hp.pad,Y.padEnd=Hp.padEnd,Y.padStart=Hp.padStart,Y.parseInt=Hp.parseInt,Y.random=Zp.random,Y.reduce=Fp.reduce,Y.reduceRight=Fp.reduceRight,Y.repeat=Hp.repeat,Y.replace=Hp.replace,Y.result=Vp.result,Y.round=Up.round,Y.sample=Fp.sample,Y.size=Fp.size,Y.snakeCase=Hp.snakeCase,Y.some=Fp.some,Y.sortedIndex=Np.sortedIndex,Y.sortedIndexBy=Np.sortedIndexBy,Y.sortedIndexOf=Np.sortedIndexOf,Y.sortedLastIndex=Np.sortedLastIndex,Y.sortedLastIndexBy=Np.sortedLastIndexBy,Y.sortedLastIndexOf=Np.sortedLastIndexOf,Y.startCase=Hp.startCase,Y.startsWith=Hp.startsWith,Y.subtract=Up.subtract,Y.sum=Up.sum,Y.sumBy=Up.sumBy,Y.template=Hp.template,Y.times=Wp.times,Y.toFinite=jp.toFinite,Y.toInteger=m,Y.toLength=jp.toLength,Y.toLower=Hp.toLower,Y.toNumber=jp.toNumber,Y.toSafeInteger=jp.toSafeInteger,Y.toString=jp.toString,Y.toUpper=Hp.toUpper,Y.trim=Hp.trim,Y.trimEnd=Hp.trimEnd,Y.trimStart=Hp.trimStart,Y.truncate=Hp.truncate,Y.unescape=Hp.unescape,Y.uniqueId=Wp.uniqueId,Y.upperCase=Hp.upperCase,Y.upperFirst=Hp.upperFirst,Y.each=Fp.forEach,Y.eachRight=Fp.forEachRight,Y.first=Np.head,of(Y,(Kp={},Vi(Y,(function(t,e){tf.call(Y.prototype,e)||(Kp[e]=t)})),Kp),{chain:!1}),Y.VERSION="4.17.21",(Y.templateSettings=Hp.templateSettings).imports._=Y,ut(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Y[t].placeholder=Y})),ut(["drop","take"],(function(t,e){R.prototype[t]=function(n){n=void 0===n?1:nf(m(n),0);var r=this.__filtered__&&!e?new R(this):this.clone();return r.__filtered__?r.__takeCount__=rf(n,r.__takeCount__):r.__views__.push({size:rf(n,Jp),type:t+(r.__dir__<0?"Right":"")}),r},R.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ut(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;R.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Di(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),ut(["head","last"],(function(t,e){var n="take"+(e?"Right":"");R.prototype[t]=function(){return this[n](1).value()[0]}})),ut(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");R.prototype[t]=function(){return this.__filtered__?new R(this):this[n](1)}})),R.prototype.compact=function(){return this.filter(y)},R.prototype.find=function(t){return this.filter(t).head()},R.prototype.findLast=function(t){return this.reverse().find(t)},R.prototype.invokeMap=Dt((function(t,e){return"function"==typeof t?new R(this):this.map((function(n){return vs(n,t,e)}))})),R.prototype.reject=function(t){return this.filter(Cu(Di(t)))},R.prototype.slice=function(t,e){t=m(t);var n=this;return n.__filtered__&&(t>0||e<0)?new R(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=m(e))<0?n.dropRight(-e):n.take(e-t)),n)},R.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},R.prototype.toArray=function(){return this.take(Jp)},Vi(R.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Y[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(Y.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof R,l=a[0],c=u||(0,s.Z)(e),h=function(t){var e=i.apply(Y,Re([t],a));return r&&p?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,d=o&&!p,m=u&&!f;if(!o&&c){e=m?e:new R(this);var g=t.apply(e,a);return g.__actions__.push({func:Oh,args:[h],thisArg:void 0}),new Z(g,p)}return d&&m?t.apply(this,a):(g=this.thru(h),d?r?g.value()[0]:g.value():g)})})),ut(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Qp[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Y.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply((0,s.Z)(i)?i:[],t)}return this[n]((function(n){return e.apply((0,s.Z)(n)?n:[],t)}))}})),Vi(R.prototype,(function(t,e){var n=Y[e];if(n){var r=n.name+"";tf.call(z,r)||(z[r]=[]),z[r].push({name:e,func:n})}})),z[wt(void 0,2).name]=[{name:"wrapper",func:void 0}],R.prototype.clone=function(){var t=new R(this.__wrapped__);return t.__actions__=G(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=G(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=G(this.__views__),t},R.prototype.reverse=function(){if(this.__filtered__){var t=new R(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},R.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=(0,s.Z)(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Yp(e,t+a);break;case"takeRight":t=qp(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,l=u-a,c=r?u:a-1,h=this.__iteratees__,p=h.length,f=0,d=Xp(l,this.__takeCount__);if(!n||!r&&i==l&&d==l)return Rh(t,this.__actions__);var m=[];t:for(;l--&&f<d;){for(var g=-1,y=t[c+=e];++g<p;){var v=h[g],_=v.iteratee,b=v.type,x=_(y);if(2==b)y=x;else if(!x){if(1==b)continue t;break t}}m[f++]=y}return m},Y.prototype.at=Gp.at,Y.prototype.chain=Gp.wrapperChain,Y.prototype.commit=Gp.commit,Y.prototype.next=Gp.next,Y.prototype.plant=Gp.plant,Y.prototype.reverse=Gp.reverse,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=Gp.value,Y.prototype.first=Y.prototype.head,ef&&(Y.prototype[ef]=Gp.toIterator);const af=Y},7502:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(7627);const i=function(){return r.Z.Date.now()}},4811:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r=function(){return!1}},2498:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(8066),i=n(7247),o=n(718),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;const c=function(t){if("number"==typeof t)return t;if((0,o.Z)(t))return NaN;if((0,i.Z)(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=(0,i.Z)(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=(0,r.Z)(t);var n=s.test(t);return n||u.test(t)?l(t.slice(2),n?2:8):a.test(t)?NaN:+t}},7768:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__addDisposableResource:()=>R,__assign:()=>o,__asyncDelegator:()=>M,__asyncGenerator:()=>E,__asyncValues:()=>T,__await:()=>S,__awaiter:()=>d,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>I,__classPrivateFieldSet:()=>L,__createBinding:()=>g,__decorate:()=>s,__disposeResources:()=>N,__esDecorate:()=>l,__exportStar:()=>y,__extends:()=>i,__generator:()=>m,__importDefault:()=>P,__importStar:()=>O,__makeTemplateObject:()=>A,__metadata:()=>f,__param:()=>u,__propKey:()=>h,__read:()=>_,__rest:()=>a,__runInitializers:()=>c,__setFunctionName:()=>p,__spread:()=>b,__spreadArray:()=>w,__spreadArrays:()=>x,__values:()=>v,default:()=>F});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function l(t,e,n,r,i,o){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,u=r.kind,l="getter"===u?"get":"setter"===u?"set":"value",c=!e&&t?r.static?t:t.prototype:null,h=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),p=!1,f=n.length-1;f>=0;f--){var d={};for(var m in r)d[m]="access"===m?{}:r[m];for(var m in r.access)d.access[m]=r.access[m];d.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(t||null))};var g=(0,n[f])("accessor"===u?{get:h.get,set:h.set}:h[l],d);if("accessor"===u){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(h.get=s),(s=a(g.set))&&(h.set=s),(s=a(g.init))&&i.unshift(s)}else(s=a(g))&&("field"===u?i.unshift(s):h[l]=s)}c&&Object.defineProperty(c,r.name,h),p=!0}function c(t,e,n){for(var r=arguments.length>2,i=0;i<e.length;i++)n=r?e[i].call(t,n):e[i].call(t);return r?n:void 0}function h(t){return"symbol"==typeof t?t:"".concat(t)}function p(t,e,n){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function d(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function m(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var g=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function y(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||g(e,t,n)}function v(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function b(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_(arguments[e]));return t}function x(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function w(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function S(t){return this instanceof S?(this.v=t,this):new S(t)}function E(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof S?Promise.resolve(n.value.v).then(u,l):c(o[0][2],n)}catch(t){c(o[0][3],t)}var n}function u(t){s("next",t)}function l(t){s("throw",t)}function c(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function M(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:S(t[r](e)),done:!1}:i?i(e):e}:i}}function T(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=v(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}function A(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var C=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function O(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&g(e,t,n);return C(e,t),e}function P(t){return t&&t.__esModule?t:{default:t}}function k(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function L(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function I(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function R(t,e,n){if(null!=e){if("object"!=typeof e)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var D="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function N(t){function e(e){t.error=t.hasError?new D(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}return function n(){for(;t.stack.length;){var r=t.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,(function(t){return e(t),n()}))}catch(t){e(t)}}if(t.hasError)throw t.error}()}const F={__extends:i,__assign:o,__rest:a,__decorate:s,__param:u,__metadata:f,__awaiter:d,__generator:m,__createBinding:g,__exportStar:y,__values:v,__read:_,__spread:b,__spreadArrays:x,__spreadArray:w,__await:S,__asyncGenerator:E,__asyncDelegator:M,__asyncValues:T,__makeTemplateObject:A,__importStar:O,__importDefault:P,__classPrivateFieldGet:k,__classPrivateFieldSet:L,__classPrivateFieldIn:I,__addDisposableResource:R,__disposeResources:N}},6744:t=>{"use strict";t.exports=JSON.parse('{"scene.src.LargeGraph.Component.SwitchToD":"Switch to 2D","scene.src.LargeGraph.Component.SwitchToD.1":"Switch to 3D","scene.LargeGraph.Toolbar.SmallWindow":"Small window","scene.src.LargeGraph.info.DBigPicture":"3D large graph","scene.src.LargeGraph.info.EnableDViewAndRight":"Enable 3D View and right-click node interaction","scene.src.LargeGraph.registerMeta.DefaultDisplay":"Default display","scene.src.LargeGraph.registerMeta.BackgroundColor":"Background color","scene.src.LargeGraph.registerMeta.HighlightColor":"Highlight color","scene.src.LargeGraph.registerMeta.MinimumSize":"Minimum size","scene.src.LargeGraph.registerMeta.MaximumSize":"Maximum size","scene.src.LargeGraph.registerMeta.PlacementOrientation":"Placement orientation","scene.src.LargeGraph.registerMeta.TopLeftTop":"top left/top","scene.src.LargeGraph.registerMeta.TopRightRight":"Top right/right","scene.src.LargeGraph.registerMeta.LowerLeftLeft":"Lower left/left","scene.src.LargeGraph.registerMeta.BottomRightBottom":"bottom right/bottom","scene.src.LargeGraph.registerMeta.OffsetDistance":"Offset distance","scene.src.MapMode.Component.SwitchToNetmap":"Switch to Netmap","scene.src.MapMode.Component.SwitchToMap":"Switch to map","scene.MapMode.L7Map.TheDataFormatDoesNot":"The data format does not meet the requirements.","scene.MapMode.L7Map.CheckWhetherTheSourceData":"Check whether the source data has latitude and longitude fields, or whether the configuration panel specifies latitude and longitude coordinates.","scene.MapMode.PropertiesPanel.Component.PropertiesPanel":"Properties panel","scene.MapMode.Toolbar.CircleSelection":"Circle selection","scene.MapMode.Toolbar.ReturnToNetgraphMode":"Return to Netgraph mode","scene.MapMode.Toolbar.SmallWindow":"Small window","scene.src.MapMode.info.MapMode":"Map mode","scene.src.MapMode.info.MapTheGeographicCoordinatesOf":"Map the geographic coordinates of a node to a map","scene.src.MapMode.registerMeta.DefaultDisplay":"Default display","scene.src.MapMode.registerMeta.MapType":"Map type","scene.src.MapMode.registerMeta.Amap":"AMap","scene.src.MapMode.registerMeta.Theme":"Theme","scene.src.MapMode.registerMeta.Bright":"Bright","scene.src.MapMode.registerMeta.Darkness":"Darkness","scene.src.MapMode.registerMeta.MinimumSize":"Minimum size","scene.src.MapMode.registerMeta.MaximumSize":"Maximum size","scene.src.MapMode.registerMeta.PlacementOrientation":"Placement orientation","scene.src.MapMode.registerMeta.TopLeftTop":"top left/top","scene.src.MapMode.registerMeta.TopRightRight":"Top right/right","scene.src.MapMode.registerMeta.LowerLeftLeft":"Lower left/left","scene.src.MapMode.registerMeta.BottomRightBottom":"bottom right/bottom","scene.src.MapMode.registerMeta.OffsetDistance":"Offset distance","scene.src.MapMode.registerMeta.LongitudeField":"Longitude field","scene.src.MapMode.registerMeta.LatitudeField":"Latitude field","scene.src.Timebar.Component.PleaseConfigureTheTimeField":"Please configure the time field","scene.src.Timebar.Component.MakeSureThatTheTime":"Make sure that the time field and the indicator field belong to the same node or edge!","scene.src.Timebar.constant.Seconds":"Seconds","scene.src.Timebar.constant.Days":"Days","scene.src.Timebar.constant.Month":"Month","scene.src.Timebar.constant.Year":"Year","scene.control.animation.constants.MovingTimeWindow":"Moving time window","scene.control.animation.constants.CumulativeTimeWindow":"Cumulative time window","scene.control.animation.PleaseBoxTheSelectionArea":"Please box the selection area first.","scene.Timebar.control.PleaseQueryTheGraphFirst":"Please query the graph first.","scene.control.panel.CurrentselectedrangeToCurrentselectedrange":"{currentSelectedRangeStart} to {currentSelectedRangeEnd}","scene.control.panel.DatatimestimesToDatatimestimes":"{dataTimesTimesStart} to {dataTimesTimesEnd}","scene.src.Timebar.info.TimelineController":"Timeline controller","scene.src.Timebar.registerMeta.TimeField":"Time field","scene.src.Timebar.registerMeta.Node":"Node","scene.src.Timebar.registerMeta.Edge":"Edge","scene.src.Timebar.registerMeta.IndicatorField":"Indicator field","scene.src.Timebar.registerMeta.OnlyAggregateCountsAreSupported":"Only aggregate counts are supported for non-numeric types.\\nMake sure that the and time fields belong to nodes or edges","scene.src.Timebar.registerMeta.Aggregation":"Aggregation","scene.src.Timebar.registerMeta.Count":"Count","scene.src.Timebar.registerMeta.Maximum":"Maximum","scene.src.Timebar.registerMeta.Mean":"Mean","scene.src.Timebar.registerMeta.MinimumValue":"Minimum value","scene.src.Timebar.registerMeta.Median":"Median","scene.src.Timebar.registerMeta.Summation":"Summation","scene.src.Timebar.registerMeta.TimeGranularity":"Time granularity","scene.src.Timebar.registerMeta.PlaybackSpeed":"Playback speed","scene.src.Timeline.info.TimeSeriesChart":"Time series chart","scene.src.Timeline.info.EnableTimingDiagramToGain":"Enable timing diagram to gain insight into the practical relationship of nodes","scene.src.Timeline.registerMeta.CanvasHeight":"Canvas height","scene.src.Timeline.registerMeta.TimeField":"Time field","scene.src.Timeline.registerMeta.DataType":"Data type","scene.src.Timeline.registerMeta.NodeData":"Node data","scene.src.Timeline.registerMeta.EdgeData":"EDGE data","scene.src.Timeline.registerMeta.XAxisField":"X-axis field","scene.src.Timeline.registerMeta.YAxisField":"Y-axis field","scene.src.Timebar.registerMeta.DefaultTimeLength":"Default time length","scene.src.Timebar.registerMeta.All":"All","scene.src.Timebar.registerMeta.OneMonth":"One month","scene.src.Timebar.registerMeta.OneYear":"One year","scene.src.Timebar.registerMeta.PlaybackMode":"Playback mode","scene.src.Timebar.registerMeta.Filtering":"Filtering","scene.src.Timebar.registerMeta.Highlight":"Highlight","scene.src.Timebar.registerMeta.ShowHide":"Show/Hide"}')},4623:t=>{"use strict";t.exports=JSON.parse('{"scene.src.LargeGraph.Component.SwitchToD":"切换至2D","scene.src.LargeGraph.Component.SwitchToD.1":"切换至3D","scene.LargeGraph.Toolbar.SmallWindow":"小窗","scene.src.LargeGraph.info.DBigPicture":"3D大图","scene.src.LargeGraph.info.EnableDViewAndRight":"启用3D视图,可右键节点交互","scene.src.LargeGraph.registerMeta.DefaultDisplay":"默认显示","scene.src.LargeGraph.registerMeta.BackgroundColor":"背景颜色","scene.src.LargeGraph.registerMeta.HighlightColor":"高亮颜色","scene.src.LargeGraph.registerMeta.MinimumSize":"最小尺寸","scene.src.LargeGraph.registerMeta.MaximumSize":"最大尺寸","scene.src.LargeGraph.registerMeta.PlacementOrientation":"放置方位","scene.src.LargeGraph.registerMeta.TopLeftTop":"左上 / top","scene.src.LargeGraph.registerMeta.TopRightRight":"右上 / right","scene.src.LargeGraph.registerMeta.LowerLeftLeft":"左下 / left","scene.src.LargeGraph.registerMeta.BottomRightBottom":"右下 / bottom","scene.src.LargeGraph.registerMeta.OffsetDistance":"偏移距离","scene.src.MapMode.Component.SwitchToNetmap":"切换至网图","scene.src.MapMode.Component.SwitchToMap":"切换至地图","scene.MapMode.L7Map.TheDataFormatDoesNot":"数据格式不合要求","scene.MapMode.L7Map.CheckWhetherTheSourceData":"请检查源数据是否有经纬度字段,或者检查「配置面板」,是否指定了经纬度坐标","scene.MapMode.PropertiesPanel.Component.PropertiesPanel":"属性面板","scene.MapMode.Toolbar.CircleSelection":"圈选","scene.MapMode.Toolbar.ReturnToNetgraphMode":"返回网图模式","scene.MapMode.Toolbar.SmallWindow":"小窗","scene.src.MapMode.info.MapMode":"地图模式","scene.src.MapMode.info.MapTheGeographicCoordinatesOf":"将节点的地理坐标映射到地图上","scene.src.MapMode.registerMeta.DefaultDisplay":"默认显示","scene.src.MapMode.registerMeta.MapType":"地图类型","scene.src.MapMode.registerMeta.Amap":"高德","scene.src.MapMode.registerMeta.Theme":"主题","scene.src.MapMode.registerMeta.Bright":"明亮","scene.src.MapMode.registerMeta.Darkness":"黑暗","scene.src.MapMode.registerMeta.MinimumSize":"最小尺寸","scene.src.MapMode.registerMeta.MaximumSize":"最大尺寸","scene.src.MapMode.registerMeta.PlacementOrientation":"放置方位","scene.src.MapMode.registerMeta.TopLeftTop":"左上 / top","scene.src.MapMode.registerMeta.TopRightRight":"右上 / right","scene.src.MapMode.registerMeta.LowerLeftLeft":"左下 / left","scene.src.MapMode.registerMeta.BottomRightBottom":"右下 / bottom","scene.src.MapMode.registerMeta.OffsetDistance":"偏移距离","scene.src.MapMode.registerMeta.LongitudeField":"经度字段","scene.src.MapMode.registerMeta.LatitudeField":"纬度字段","scene.src.Timebar.Component.PleaseConfigureTheTimeField":"请配置时间字段","scene.src.Timebar.Component.MakeSureThatTheTime":"请确保时间字段和指标字段同属于节点或边!","scene.src.Timebar.constant.Seconds":"秒","scene.src.Timebar.constant.Days":"天","scene.src.Timebar.constant.Month":"月","scene.src.Timebar.constant.Year":"年","scene.control.animation.constants.MovingTimeWindow":"移动时间窗口","scene.control.animation.constants.CumulativeTimeWindow":"累积时间窗口","scene.control.animation.PleaseBoxTheSelectionArea":"请先框选区间","scene.Timebar.control.PleaseQueryTheGraphFirst":"请先进行图查询","scene.control.panel.CurrentselectedrangeToCurrentselectedrange":"{currentSelectedRangeStart} 至 {currentSelectedRangeEnd}","scene.control.panel.DatatimestimesToDatatimestimes":"{dataTimesTimesStart} 至 {dataTimesTimesEnd}","scene.src.Timebar.info.TimelineController":"时间线控制器","scene.src.Timebar.registerMeta.TimeField":"时间字段","scene.src.Timebar.registerMeta.Node":"节点","scene.src.Timebar.registerMeta.Edge":"边","scene.src.Timebar.registerMeta.IndicatorField":"指标字段","scene.src.Timebar.registerMeta.OnlyAggregateCountsAreSupported":"非数值类型仅支持聚合计数\\n确保和时间字段同属于节点或边","scene.src.Timebar.registerMeta.Aggregation":"聚合","scene.src.Timebar.registerMeta.Count":"计数","scene.src.Timebar.registerMeta.Maximum":"最大值","scene.src.Timebar.registerMeta.Mean":"均值","scene.src.Timebar.registerMeta.MinimumValue":"最小值","scene.src.Timebar.registerMeta.Median":"中位数","scene.src.Timebar.registerMeta.Summation":"求和","scene.src.Timebar.registerMeta.TimeGranularity":"时间粒度","scene.src.Timebar.registerMeta.PlaybackSpeed":"播放速度","scene.src.Timeline.info.TimeSeriesChart":"时序线图","scene.src.Timeline.info.EnableTimingDiagramToGain":"启用时序图,可洞察节点的实践关系","scene.src.Timeline.registerMeta.CanvasHeight":"画布高度","scene.src.Timeline.registerMeta.TimeField":"时间字段","scene.src.Timeline.registerMeta.DataType":"数据类型","scene.src.Timeline.registerMeta.NodeData":"节点数据","scene.src.Timeline.registerMeta.EdgeData":"边数据","scene.src.Timeline.registerMeta.XAxisField":"X轴字段","scene.src.Timeline.registerMeta.YAxisField":"Y轴字段","scene.src.Timebar.registerMeta.DefaultTimeLength":"默认时间长度","scene.src.Timebar.registerMeta.All":"全部","scene.src.Timebar.registerMeta.OneMonth":"一个月","scene.src.Timebar.registerMeta.OneYear":"一年","scene.src.Timebar.registerMeta.PlaybackMode":"播放模式","scene.src.Timebar.registerMeta.Filtering":"过滤","scene.src.Timebar.registerMeta.Highlight":"高亮","scene.src.Timebar.registerMeta.ShowHide":"显示/隐藏"}')}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={id:t,loaded:!1,exports:{}};return o[t].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var u={};return(()=>{"use strict";s.r(u),s.d(u,{components:()=>cnt});var t={};s.r(t),s.d(t,{frequency:()=>WB,id:()=>qB,name:()=>YB,weight:()=>HB});var e={};s.r(e),s.d(e,{area:()=>HW,bottom:()=>JW,bottomLeft:()=>JW,bottomRight:()=>JW,inside:()=>JW,left:()=>JW,outside:()=>nq,right:()=>JW,spider:()=>iq,surround:()=>aq,top:()=>JW,topLeft:()=>JW,topRight:()=>JW});var n={};s.r(n),s.d(n,{geoAlbers:()=>k4,geoAlbersUsa:()=>L4,geoAzimuthalEqualArea:()=>N4,geoAzimuthalEqualAreaRaw:()=>D4,geoAzimuthalEquidistant:()=>z4,geoAzimuthalEquidistantRaw:()=>F4,geoConicConformal:()=>G4,geoConicConformalRaw:()=>V4,geoConicEqualArea:()=>P4,geoConicEqualAreaRaw:()=>O4,geoConicEquidistant:()=>Y4,geoConicEquidistantRaw:()=>q4,geoEqualEarth:()=>e6,geoEqualEarthRaw:()=>t6,geoEquirectangular:()=>W4,geoEquirectangularRaw:()=>H4,geoGnomonic:()=>r6,geoGnomonicRaw:()=>n6,geoIdentity:()=>i6,geoMercator:()=>j4,geoMercatorRaw:()=>B4,geoNaturalEarth1:()=>a6,geoNaturalEarth1Raw:()=>o6,geoOrthographic:()=>u6,geoOrthographicRaw:()=>s6,geoProjection:()=>T4,geoProjectionMutator:()=>A4,geoStereographic:()=>c6,geoStereographicRaw:()=>l6,geoTransverseMercator:()=>p6,geoTransverseMercatorRaw:()=>h6});var r={};s.r(r),s.d(r,{interpolateBlues:()=>g7,interpolateBrBG:()=>C8,interpolateBuGn:()=>W8,interpolateBuPu:()=>Y8,interpolateCividis:()=>A7,interpolateCool:()=>G7,interpolateCubehelixDefault:()=>Z7,interpolateGnBu:()=>$8,interpolateGreens:()=>v7,interpolateGreys:()=>b7,interpolateInferno:()=>e9,interpolateMagma:()=>t9,interpolateOrRd:()=>J8,interpolateOranges:()=>T7,interpolatePRGn:()=>P8,interpolatePiYG:()=>L8,interpolatePlasma:()=>n9,interpolatePuBu:()=>n7,interpolatePuBuGn:()=>t7,interpolatePuOr:()=>R8,interpolatePuRd:()=>i7,interpolatePurples:()=>w7,interpolateRainbow:()=>W7,interpolateRdBu:()=>N8,interpolateRdGy:()=>z8,interpolateRdPu:()=>a7,interpolateRdYlBu:()=>j8,interpolateRdYlGn:()=>Z8,interpolateReds:()=>E7,interpolateSinebow:()=>$7,interpolateSpectral:()=>G8,interpolateTurbo:()=>K7,interpolateViridis:()=>Q7,interpolateWarm:()=>V7,interpolateYlGn:()=>c7,interpolateYlGnBu:()=>u7,interpolateYlOrBr:()=>p7,interpolateYlOrRd:()=>d7,schemeAccent:()=>k6,schemeBlues:()=>m7,schemeBrBG:()=>A8,schemeBuGn:()=>H8,schemeBuPu:()=>q8,schemeCategory10:()=>P6,schemeDark2:()=>L6,schemeGnBu:()=>X8,schemeGreens:()=>y7,schemeGreys:()=>_7,schemeOrRd:()=>K8,schemeOranges:()=>M7,schemePRGn:()=>O8,schemePaired:()=>Ap,schemePastel1:()=>I6,schemePastel2:()=>R6,schemePiYG:()=>k8,schemePuBu:()=>e7,schemePuBuGn:()=>Q8,schemePuOr:()=>I8,schemePuRd:()=>r7,schemePurples:()=>x7,schemeRdBu:()=>D8,schemeRdGy:()=>F8,schemeRdPu:()=>o7,schemeRdYlBu:()=>B8,schemeRdYlGn:()=>U8,schemeReds:()=>S7,schemeSet1:()=>D6,schemeSet2:()=>N6,schemeSet3:()=>F6,schemeSpectral:()=>V8,schemeTableau10:()=>z6,schemeYlGn:()=>l7,schemeYlGnBu:()=>s7,schemeYlOrBr:()=>h7,schemeYlOrRd:()=>f7});var i=s(3618),o=s(1024),a=s.n(o);const l="139",c={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},h=0,p=1,f=2,d=1,m=2,g=3,y=0,v=1,_=2,b=0,x=1,w=2,S=3,E=4,M=5,T=100,A=101,C=102,O=103,P=104,k=200,L=201,I=202,R=203,D=204,N=205,F=206,z=207,B=208,j=209,U=210,Z=0,V=1,G=2,H=3,W=4,q=5,Y=6,X=7,$=0,K=1,J=2,Q=0,tt=1,et=2,nt=3,rt=4,it=5,ot=301,at=302,st=303,ut=304,lt=306,ct=1e3,ht=1001,pt=1002,ft=1003,dt=1004,mt=1005,gt=1006,yt=1007,vt=1008,_t=1009,bt=1010,xt=1011,wt=1012,St=1013,Et=1014,Mt=1015,Tt=1016,At=1017,Ct=1018,Ot=1020,Pt=1021,kt=1022,Lt=1023,It=1024,Rt=1025,Dt=1026,Nt=1027,Ft=1028,zt=1029,Bt=1030,jt=1031,Ut=1033,Zt=33776,Vt=33777,Gt=33778,Ht=33779,Wt=35840,qt=35841,Yt=35842,Xt=35843,$t=36196,Kt=37492,Jt=37496,Qt=37808,te=37809,ee=37810,ne=37811,re=37812,ie=37813,oe=37814,ae=37815,se=37816,ue=37817,le=37818,ce=37819,he=37820,pe=37821,fe=36492,de=2300,me=2301,ge=2302,ye=2400,ve=2401,_e=2402,be=3e3,xe=3001,we=3201,Se=0,Ee=1,Me="srgb",Te="srgb-linear",Ae=7680,Ce=35044,Oe=35048,Pe="300 es",ke=1035;class Le{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,r=n.length;e<r;e++)n[e].call(this,t);t.target=null}}}const Ie=[];for(let t=0;t<256;t++)Ie[t]=(t<16?"0":"")+t.toString(16);const Re=Math.PI/180,De=180/Math.PI;function Ne(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Ie[255&t]+Ie[t>>8&255]+Ie[t>>16&255]+Ie[t>>24&255]+"-"+Ie[255&e]+Ie[e>>8&255]+"-"+Ie[e>>16&15|64]+Ie[e>>24&255]+"-"+Ie[63&n|128]+Ie[n>>8&255]+"-"+Ie[n>>16&255]+Ie[n>>24&255]+Ie[255&r]+Ie[r>>8&255]+Ie[r>>16&255]+Ie[r>>24&255]).toLowerCase()}function Fe(t,e,n){return Math.max(e,Math.min(n,t))}function ze(t,e,n){return(1-n)*t+n*e}function Be(t){return 0==(t&t-1)&&0!==t}function je(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}class Ue{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Ue.prototype.isVector2=!0;class Ze{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,i,o,a,s,u){const l=this.elements;return l[0]=t,l[1]=r,l[2]=a,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[3],s=n[6],u=n[1],l=n[4],c=n[7],h=n[2],p=n[5],f=n[8],d=r[0],m=r[3],g=r[6],y=r[1],v=r[4],_=r[7],b=r[2],x=r[5],w=r[8];return i[0]=o*d+a*y+s*b,i[3]=o*m+a*v+s*x,i[6]=o*g+a*_+s*w,i[1]=u*d+l*y+c*b,i[4]=u*m+l*v+c*x,i[7]=u*g+l*_+c*w,i[2]=h*d+p*y+f*b,i[5]=h*m+p*v+f*x,i[8]=h*g+p*_+f*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8];return e*o*l-e*a*u-n*i*l+n*a*s+r*i*u-r*o*s}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=l*o-a*u,h=a*s-l*i,p=u*i-o*s,f=e*c+n*h+r*p;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const d=1/f;return t[0]=c*d,t[1]=(r*u-l*n)*d,t[2]=(a*n-r*o)*d,t[3]=h*d,t[4]=(l*e-r*s)*d,t[5]=(r*i-a*e)*d,t[6]=p*d,t[7]=(n*s-u*e)*d,t[8]=(o*e-n*i)*d,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,i,o,a){const s=Math.cos(i),u=Math.sin(i);return this.set(n*s,n*u,-n*(s*o+u*a)+o+t,-r*u,r*s,-r*(-u*o+s*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],u=r[4],l=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*u,r[6]=e*a+n*l,r[1]=-n*i+e*s,r[4]=-n*o+e*u,r[7]=-n*a+e*l,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}function Ve(t){for(let e=t.length-1;e>=0;--e)if(t[e]>65535)return!0;return!1}function Ge(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function He(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function We(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}Ze.prototype.isMatrix3=!0,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;const qe={[Me]:{[Te]:He},[Te]:{[Me]:We}},Ye={legacyMode:!0,get workingColorSpace(){return Te},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(qe[e]&&void 0!==qe[e][n]){const r=qe[e][n];return t.r=r(t.r),t.g=r(t.g),t.b=r(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},Xe={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},$e={r:0,g:0,b:0},Ke={h:0,s:0,l:0},Je={h:0,s:0,l:0};function Qe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function tn(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class en{constructor(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Me){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Ye.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=Te){return this.r=t,this.g=e,this.b=n,Ye.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=Te){if(t=function(t,e){return(t%e+e)%e}(t,1),e=Fe(e,0,1),n=Fe(n,0,1),0===e)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=Qe(i,r,t+1/3),this.g=Qe(i,r,t),this.b=Qe(i,r,t-1/3)}return Ye.toWorkingColorSpace(this,r),this}setStyle(t,e=Me){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const i=r[1],o=r[2];switch(i){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,Ye.toWorkingColorSpace(this,e),n(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,Ye.toWorkingColorSpace(this,e),n(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const r=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,o=parseInt(t[3],10)/100;return n(t[4]),this.setHSL(r,i,o,e)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=r[1],n=t.length;if(3===n)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,Ye.toWorkingColorSpace(this,e),this;if(6===n)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,Ye.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=Me){const n=Xe[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=He(t.r),this.g=He(t.g),this.b=He(t.b),this}copyLinearToSRGB(t){return this.r=We(t.r),this.g=We(t.g),this.b=We(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Me){return Ye.fromWorkingColorSpace(tn(this,$e),t),Fe(255*$e.r,0,255)<<16^Fe(255*$e.g,0,255)<<8^Fe(255*$e.b,0,255)<<0}getHexString(t=Me){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Te){Ye.fromWorkingColorSpace(tn(this,$e),e);const n=$e.r,r=$e.g,i=$e.b,o=Math.max(n,r,i),a=Math.min(n,r,i);let s,u;const l=(a+o)/2;if(a===o)s=0,u=0;else{const t=o-a;switch(u=l<=.5?t/(o+a):t/(2-o-a),o){case n:s=(r-i)/t+(r<i?6:0);break;case r:s=(i-n)/t+2;break;case i:s=(n-r)/t+4}s/=6}return t.h=s,t.s=u,t.l=l,t}getRGB(t,e=Te){return Ye.fromWorkingColorSpace(tn(this,$e),e),t.r=$e.r,t.g=$e.g,t.b=$e.b,t}getStyle(t=Me){return Ye.fromWorkingColorSpace(tn(this,$e),t),t!==Me?`color(${t} ${$e.r} ${$e.g} ${$e.b})`:`rgb(${255*$e.r|0},${255*$e.g|0},${255*$e.b|0})`}offsetHSL(t,e,n){return this.getHSL(Ke),Ke.h+=t,Ke.s+=e,Ke.l+=n,this.setHSL(Ke.h,Ke.s,Ke.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Ke),t.getHSL(Je);const n=ze(Ke.h,Je.h,e),r=ze(Ke.s,Je.s,e),i=ze(Ke.l,Je.l,e);return this.setHSL(n,r,i),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}let nn;en.NAMES=Xe,en.prototype.isColor=!0,en.prototype.r=1,en.prototype.g=1,en.prototype.b=1;class rn{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===nn&&(nn=Ge("canvas")),nn.width=t.width,nn.height=t.height;const n=nn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=nn}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Ge("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height),i=r.data;for(let t=0;t<i.length;t++)i[t]=255*He(i[t]/255);return n.putImageData(r,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*He(e[t]/255)):e[t]=He(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}class on{constructor(t=null){this.uuid=Ne(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e<n;e++)r[e].isDataTexture?t.push(an(r[e].image)):t.push(an(r[e]))}else t=an(r);n.url=t}return e||(t.images[this.uuid]=n),n}}function an(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?rn.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}on.prototype.isSource=!0;let sn=0;class un extends Le{constructor(t=un.DEFAULT_IMAGE,e=un.DEFAULT_MAPPING,n=ht,r=ht,i=gt,o=vt,a=Lt,s=_t,u=1,l=be){super(),Object.defineProperty(this,"id",{value:sn++}),this.uuid=Ne(),this.name="",this.source=new on(t),this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=s,this.offset=new Ue(0,0),this.repeat=new Ue(1,1),this.center=new Ue(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ze,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ct:t.x=t.x-Math.floor(t.x);break;case ht:t.x=t.x<0?0:1;break;case pt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case ct:t.y=t.y-Math.floor(t.y);break;case ht:t.y=t.y<0?0:1;break;case pt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}un.DEFAULT_IMAGE=null,un.DEFAULT_MAPPING=300,un.prototype.isTexture=!0;class ln{constructor(t=0,e=0,n=0,r=1){this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,i;const o=.01,a=.1,s=t.elements,u=s[0],l=s[4],c=s[8],h=s[1],p=s[5],f=s[9],d=s[2],m=s[6],g=s[10];if(Math.abs(l-h)<o&&Math.abs(c-d)<o&&Math.abs(f-m)<o){if(Math.abs(l+h)<a&&Math.abs(c+d)<a&&Math.abs(f+m)<a&&Math.abs(u+p+g-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(u+1)/2,s=(p+1)/2,y=(g+1)/2,v=(l+h)/4,_=(c+d)/4,b=(f+m)/4;return t>s&&t>y?t<o?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(t),r=v/n,i=_/n):s>y?s<o?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):y<o?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(y),n=_/i,r=b/i),this.set(n,r,i,e),this}let y=Math.sqrt((m-f)*(m-f)+(c-d)*(c-d)+(h-l)*(h-l));return Math.abs(y)<.001&&(y=1),this.x=(m-f)/y,this.y=(c-d)/y,this.z=(h-l)/y,this.w=Math.acos((u+p+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}ln.prototype.isVector4=!0;class cn extends Le{constructor(t,e,n={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new ln(0,0,t,e),this.scissorTest=!1,this.viewport=new ln(0,0,t,e);const r={width:t,height:e,depth:1};this.texture=new un(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:gt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0,this.texture.image=Object.assign({},t.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}cn.prototype.isWebGLRenderTarget=!0;class hn extends un{constructor(t=null,e=1,n=1,r=1){super(null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=ft,this.minFilter=ft,this.wrapR=ht,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}hn.prototype.isDataArrayTexture=!0,class extends cn{constructor(t,e,n){super(t,e),this.depth=n,this.texture=new hn(null,t,e,n),this.texture.isRenderTargetTexture=!0}}.prototype.isWebGLArrayRenderTarget=!0;class pn extends un{constructor(t=null,e=1,n=1,r=1){super(null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=ft,this.minFilter=ft,this.wrapR=ht,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}pn.prototype.isData3DTexture=!0,class extends cn{constructor(t,e,n){super(t,e),this.depth=n,this.texture=new pn(null,t,e,n),this.texture.isRenderTargetTexture=!0}}.prototype.isWebGL3DRenderTarget=!0,class extends cn{constructor(t,e,n,r={}){super(t,e,r);const i=this.texture;this.texture=[];for(let t=0;t<n;t++)this.texture[t]=i.clone(),this.texture[t].isRenderTargetTexture=!0}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let r=0,i=this.texture.length;r<i;r++)this.texture[r].image.width=t,this.texture[r].image.height=e,this.texture[r].image.depth=n;this.dispose()}return this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this.texture.length=0;for(let e=0,n=t.texture.length;e<n;e++)this.texture[e]=t.texture[e].clone();return this}}.prototype.isWebGLMultipleRenderTargets=!0;class fn{constructor(t=0,e=0,n=0,r=1){this._x=t,this._y=e,this._z=n,this._w=r}static slerp(t,e,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(t,e,r)}static slerpFlat(t,e,n,r,i,o,a){let s=n[r+0],u=n[r+1],l=n[r+2],c=n[r+3];const h=i[o+0],p=i[o+1],f=i[o+2],d=i[o+3];if(0===a)return t[e+0]=s,t[e+1]=u,t[e+2]=l,void(t[e+3]=c);if(1===a)return t[e+0]=h,t[e+1]=p,t[e+2]=f,void(t[e+3]=d);if(c!==d||s!==h||u!==p||l!==f){let t=1-a;const e=s*h+u*p+l*f+c*d,n=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,e*n);t=Math.sin(t*o)/i,a=Math.sin(a*o)/i}const i=a*n;if(s=s*t+h*i,u=u*t+p*i,l=l*t+f*i,c=c*t+d*i,t===1-a){const t=1/Math.sqrt(s*s+u*u+l*l+c*c);s*=t,u*=t,l*=t,c*=t}}t[e]=s,t[e+1]=u,t[e+2]=l,t[e+3]=c}static multiplyQuaternionsFlat(t,e,n,r,i,o){const a=n[r],s=n[r+1],u=n[r+2],l=n[r+3],c=i[o],h=i[o+1],p=i[o+2],f=i[o+3];return t[e]=a*f+l*c+s*p-u*h,t[e+1]=s*f+l*h+u*c-a*p,t[e+2]=u*f+l*p+a*h-s*c,t[e+3]=l*f-a*c-s*h-u*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,r=t._y,i=t._z,o=t._order,a=Math.cos,s=Math.sin,u=a(n/2),l=a(r/2),c=a(i/2),h=s(n/2),p=s(r/2),f=s(i/2);switch(o){case"XYZ":this._x=h*l*c+u*p*f,this._y=u*p*c-h*l*f,this._z=u*l*f+h*p*c,this._w=u*l*c-h*p*f;break;case"YXZ":this._x=h*l*c+u*p*f,this._y=u*p*c-h*l*f,this._z=u*l*f-h*p*c,this._w=u*l*c+h*p*f;break;case"ZXY":this._x=h*l*c-u*p*f,this._y=u*p*c+h*l*f,this._z=u*l*f+h*p*c,this._w=u*l*c-h*p*f;break;case"ZYX":this._x=h*l*c-u*p*f,this._y=u*p*c+h*l*f,this._z=u*l*f-h*p*c,this._w=u*l*c+h*p*f;break;case"YZX":this._x=h*l*c+u*p*f,this._y=u*p*c+h*l*f,this._z=u*l*f-h*p*c,this._w=u*l*c-h*p*f;break;case"XZY":this._x=h*l*c-u*p*f,this._y=u*p*c-h*l*f,this._z=u*l*f+h*p*c,this._w=u*l*c+h*p*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],i=e[8],o=e[1],a=e[5],s=e[9],u=e[2],l=e[6],c=e[10],h=n+a+c;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(l-s)*t,this._y=(i-u)*t,this._z=(o-r)*t}else if(n>a&&n>c){const t=2*Math.sqrt(1+n-a-c);this._w=(l-s)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(i+u)/t}else if(a>c){const t=2*Math.sqrt(1+a-n-c);this._w=(i-u)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(s+l)/t}else{const t=2*Math.sqrt(1+c-n-a);this._w=(o-r)/t,this._x=(i+u)/t,this._y=(s+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Fe(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,u=e._z,l=e._w;return this._x=n*l+o*a+r*u-i*s,this._y=r*l+o*s+i*a-n*u,this._z=i*l+o*u+n*s-r*a,this._w=o*l-n*a-r*s-i*u,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,r=this._y,i=this._z,o=this._w;let a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;const s=1-a*a;if(s<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*n+e*this._x,this._y=t*r+e*this._y,this._z=t*i+e*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(s),l=Math.atan2(u,a),c=Math.sin((1-e)*l)/u,h=Math.sin(e*l)/u;return this._w=o*c+this._w*h,this._x=n*c+this._x*h,this._y=r*c+this._y*h,this._z=i*c+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(e*Math.cos(r),n*Math.sin(i),n*Math.cos(i),e*Math.sin(r))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}fn.prototype.isQuaternion=!0;class dn{constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(gn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(gn.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,u=s*e+o*r-a*n,l=s*n+a*e-i*r,c=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=u*s+h*-i+l*-a-c*-o,this.y=l*s+h*-o+c*-i-u*-a,this.z=c*s+h*-a+u*-o-l*-i,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return mn.copy(this).projectOnVector(t),this.sub(mn)}reflect(t){return this.sub(mn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Fe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}dn.prototype.isVector3=!0;const mn=new dn,gn=new fn;class yn{constructor(t=new dn(1/0,1/0,1/0),e=new dn(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,u=t.length;s<u;s+=3){const u=t[s],l=t[s+1],c=t[s+2];u<e&&(e=u),l<n&&(n=l),c<r&&(r=c),u>i&&(i=u),l>o&&(o=l),c>a&&(a=c)}return this.min.set(e,n,r),this.max.set(i,o,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,u=t.count;s<u;s++){const u=t.getX(s),l=t.getY(s),c=t.getZ(s);u<e&&(e=u),l<n&&(n=l),c<r&&(r=c),u>i&&(i=u),l>o&&(o=l),c>a&&(a=c)}return this.min.set(e,n,r),this.max.set(i,o,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=_n.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n)if(e&&null!=n.attributes&&void 0!==n.attributes.position){const e=n.attributes.position;for(let n=0,r=e.count;n<r;n++)_n.fromBufferAttribute(e,n).applyMatrix4(t.matrixWorld),this.expandByPoint(_n)}else null===n.boundingBox&&n.computeBoundingBox(),bn.copy(n.boundingBox),bn.applyMatrix4(t.matrixWorld),this.union(bn);const r=t.children;for(let t=0,n=r.length;t<n;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,_n),_n.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(An),Cn.subVectors(this.max,An),xn.subVectors(t.a,An),wn.subVectors(t.b,An),Sn.subVectors(t.c,An),En.subVectors(wn,xn),Mn.subVectors(Sn,wn),Tn.subVectors(xn,Sn);let e=[0,-En.z,En.y,0,-Mn.z,Mn.y,0,-Tn.z,Tn.y,En.z,0,-En.x,Mn.z,0,-Mn.x,Tn.z,0,-Tn.x,-En.y,En.x,0,-Mn.y,Mn.x,0,-Tn.y,Tn.x,0];return!!kn(e,xn,wn,Sn,Cn)&&(e=[1,0,0,0,1,0,0,0,1],!!kn(e,xn,wn,Sn,Cn)&&(On.crossVectors(En,Mn),e=[On.x,On.y,On.z],kn(e,xn,wn,Sn,Cn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return _n.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(_n).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(vn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),vn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),vn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),vn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),vn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),vn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),vn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),vn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(vn)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}yn.prototype.isBox3=!0;const vn=[new dn,new dn,new dn,new dn,new dn,new dn,new dn,new dn],_n=new dn,bn=new yn,xn=new dn,wn=new dn,Sn=new dn,En=new dn,Mn=new dn,Tn=new dn,An=new dn,Cn=new dn,On=new dn,Pn=new dn;function kn(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Pn.fromArray(t,o);const a=i.x*Math.abs(Pn.x)+i.y*Math.abs(Pn.y)+i.z*Math.abs(Pn.z),s=e.dot(Pn),u=n.dot(Pn),l=r.dot(Pn);if(Math.max(-Math.max(s,u,l),Math.min(s,u,l))>a)return!1}return!0}const Ln=new yn,In=new dn,Rn=new dn,Dn=new dn;class Nn{constructor(t=new dn,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Ln.setFromPoints(t).getCenter(n);let r=0;for(let e=0,i=t.length;e<i;e++)r=Math.max(r,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){Dn.subVectors(t,this.center);const e=Dn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.add(Dn.multiplyScalar(n/t)),this.radius+=n}return this}union(t){return!0===this.center.equals(t.center)?Rn.set(0,0,1).multiplyScalar(t.radius):Rn.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(In.copy(t.center).add(Rn)),this.expandByPoint(In.copy(t.center).sub(Rn)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Fn=new dn,zn=new dn,Bn=new dn,jn=new dn,Un=new dn,Zn=new dn,Vn=new dn;class Gn{constructor(t=new dn,e=new dn(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Fn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Fn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Fn.copy(this.direction).multiplyScalar(e).add(this.origin),Fn.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){zn.copy(t).add(e).multiplyScalar(.5),Bn.copy(e).sub(t).normalize(),jn.copy(this.origin).sub(zn);const i=.5*t.distanceTo(e),o=-this.direction.dot(Bn),a=jn.dot(this.direction),s=-jn.dot(Bn),u=jn.lengthSq(),l=Math.abs(1-o*o);let c,h,p,f;if(l>0)if(c=o*s-a,h=o*a-s,f=i*l,c>=0)if(h>=-f)if(h<=f){const t=1/l;c*=t,h*=t,p=c*(c+o*h+2*a)+h*(o*c+h+2*s)+u}else h=i,c=Math.max(0,-(o*h+a)),p=-c*c+h*(h+2*s)+u;else h=-i,c=Math.max(0,-(o*h+a)),p=-c*c+h*(h+2*s)+u;else h<=-f?(c=Math.max(0,-(-o*i+a)),h=c>0?-i:Math.min(Math.max(-i,-s),i),p=-c*c+h*(h+2*s)+u):h<=f?(c=0,h=Math.min(Math.max(-i,-s),i),p=h*(h+2*s)+u):(c=Math.max(0,-(o*i+a)),h=c>0?i:Math.min(Math.max(-i,-s),i),p=-c*c+h*(h+2*s)+u);else h=o>0?-i:i,c=Math.max(0,-(o*h+a)),p=-c*c+h*(h+2*s)+u;return n&&n.copy(this.direction).multiplyScalar(c).add(this.origin),r&&r.copy(Bn).multiplyScalar(h).add(zn),p}intersectSphere(t,e){Fn.subVectors(t.center,this.origin);const n=Fn.dot(this.direction),r=Fn.dot(Fn)-n*n,i=t.radius*t.radius;if(r>i)return null;const o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,i,o,a,s;const u=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,h=this.origin;return u>=0?(n=(t.min.x-h.x)*u,r=(t.max.x-h.x)*u):(n=(t.max.x-h.x)*u,r=(t.min.x-h.x)*u),l>=0?(i=(t.min.y-h.y)*l,o=(t.max.y-h.y)*l):(i=(t.max.y-h.y)*l,o=(t.min.y-h.y)*l),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),c>=0?(a=(t.min.z-h.z)*c,s=(t.max.z-h.z)*c):(a=(t.max.z-h.z)*c,s=(t.min.z-h.z)*c),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,Fn)}intersectTriangle(t,e,n,r,i){Un.subVectors(e,t),Zn.subVectors(n,t),Vn.crossVectors(Un,Zn);let o,a=this.direction.dot(Vn);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}jn.subVectors(this.origin,t);const s=o*this.direction.dot(Zn.crossVectors(jn,Zn));if(s<0)return null;const u=o*this.direction.dot(Un.cross(jn));if(u<0)return null;if(s+u>a)return null;const l=-o*jn.dot(Vn);return l<0?null:this.at(l/a,i)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Hn{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=u,g[6]=l,g[10]=c,g[14]=h,g[3]=p,g[7]=f,g[11]=d,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Hn).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Wn.setFromMatrixColumn(t,0).length(),i=1/Wn.setFromMatrixColumn(t,1).length(),o=1/Wn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),u=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===t.order){const t=o*l,n=o*c,r=a*l,i=a*c;e[0]=s*l,e[4]=-s*c,e[8]=u,e[1]=n+r*u,e[5]=t-i*u,e[9]=-a*s,e[2]=i-t*u,e[6]=r+n*u,e[10]=o*s}else if("YXZ"===t.order){const t=s*l,n=s*c,r=u*l,i=u*c;e[0]=t+i*a,e[4]=r*a-n,e[8]=o*u,e[1]=o*c,e[5]=o*l,e[9]=-a,e[2]=n*a-r,e[6]=i+t*a,e[10]=o*s}else if("ZXY"===t.order){const t=s*l,n=s*c,r=u*l,i=u*c;e[0]=t-i*a,e[4]=-o*c,e[8]=r+n*a,e[1]=n+r*a,e[5]=o*l,e[9]=i-t*a,e[2]=-o*u,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){const t=o*l,n=o*c,r=a*l,i=a*c;e[0]=s*l,e[4]=r*u-n,e[8]=t*u+i,e[1]=s*c,e[5]=i*u+t,e[9]=n*u-r,e[2]=-u,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){const t=o*s,n=o*u,r=a*s,i=a*u;e[0]=s*l,e[4]=i-t*c,e[8]=r*c+n,e[1]=c,e[5]=o*l,e[9]=-a*l,e[2]=-u*l,e[6]=n*c+r,e[10]=t-i*c}else if("XZY"===t.order){const t=o*s,n=o*u,r=a*s,i=a*u;e[0]=s*l,e[4]=-c,e[8]=u*l,e[1]=t*c+i,e[5]=o*l,e[9]=n*c-r,e[2]=r*c-n,e[6]=a*l,e[10]=i*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Yn,t,Xn)}lookAt(t,e,n){const r=this.elements;return Jn.subVectors(t,e),0===Jn.lengthSq()&&(Jn.z=1),Jn.normalize(),$n.crossVectors(n,Jn),0===$n.lengthSq()&&(1===Math.abs(n.z)?Jn.x+=1e-4:Jn.z+=1e-4,Jn.normalize(),$n.crossVectors(n,Jn)),$n.normalize(),Kn.crossVectors(Jn,$n),r[0]=$n.x,r[4]=Kn.x,r[8]=Jn.x,r[1]=$n.y,r[5]=Kn.y,r[9]=Jn.y,r[2]=$n.z,r[6]=Kn.z,r[10]=Jn.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],u=n[12],l=n[1],c=n[5],h=n[9],p=n[13],f=n[2],d=n[6],m=n[10],g=n[14],y=n[3],v=n[7],_=n[11],b=n[15],x=r[0],w=r[4],S=r[8],E=r[12],M=r[1],T=r[5],A=r[9],C=r[13],O=r[2],P=r[6],k=r[10],L=r[14],I=r[3],R=r[7],D=r[11],N=r[15];return i[0]=o*x+a*M+s*O+u*I,i[4]=o*w+a*T+s*P+u*R,i[8]=o*S+a*A+s*k+u*D,i[12]=o*E+a*C+s*L+u*N,i[1]=l*x+c*M+h*O+p*I,i[5]=l*w+c*T+h*P+p*R,i[9]=l*S+c*A+h*k+p*D,i[13]=l*E+c*C+h*L+p*N,i[2]=f*x+d*M+m*O+g*I,i[6]=f*w+d*T+m*P+g*R,i[10]=f*S+d*A+m*k+g*D,i[14]=f*E+d*C+m*L+g*N,i[3]=y*x+v*M+_*O+b*I,i[7]=y*w+v*T+_*P+b*R,i[11]=y*S+v*A+_*k+b*D,i[15]=y*E+v*C+_*L+b*N,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],u=t[13],l=t[2],c=t[6],h=t[10],p=t[14];return t[3]*(+i*s*c-r*u*c-i*a*h+n*u*h+r*a*p-n*s*p)+t[7]*(+e*s*p-e*u*h+i*o*h-r*o*p+r*u*l-i*s*l)+t[11]*(+e*u*c-e*a*p-i*o*c+n*o*p+i*a*l-n*u*l)+t[15]*(-r*a*l-e*s*c+e*a*h+r*o*c-n*o*h+n*s*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],p=t[11],f=t[12],d=t[13],m=t[14],g=t[15],y=c*m*u-d*h*u+d*s*p-a*m*p-c*s*g+a*h*g,v=f*h*u-l*m*u-f*s*p+o*m*p+l*s*g-o*h*g,_=l*d*u-f*c*u+f*a*p-o*d*p-l*a*g+o*c*g,b=f*c*s-l*d*s-f*a*h+o*d*h+l*a*m-o*c*m,x=e*y+n*v+r*_+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return t[0]=y*w,t[1]=(d*h*i-c*m*i-d*r*p+n*m*p+c*r*g-n*h*g)*w,t[2]=(a*m*i-d*s*i+d*r*u-n*m*u-a*r*g+n*s*g)*w,t[3]=(c*s*i-a*h*i-c*r*u+n*h*u+a*r*p-n*s*p)*w,t[4]=v*w,t[5]=(l*m*i-f*h*i+f*r*p-e*m*p-l*r*g+e*h*g)*w,t[6]=(f*s*i-o*m*i-f*r*u+e*m*u+o*r*g-e*s*g)*w,t[7]=(o*h*i-l*s*i+l*r*u-e*h*u-o*r*p+e*s*p)*w,t[8]=_*w,t[9]=(f*c*i-l*d*i-f*n*p+e*d*p+l*n*g-e*c*g)*w,t[10]=(o*d*i-f*a*i+f*n*u-e*d*u-o*n*g+e*a*g)*w,t[11]=(l*a*i-o*c*i-l*n*u+e*c*u+o*n*p-e*a*p)*w,t[12]=b*w,t[13]=(l*d*r-f*c*r+f*n*h-e*d*h-l*n*m+e*c*m)*w,t[14]=(f*a*r-o*d*r-f*n*s+e*d*s+o*n*m-e*a*m)*w,t[15]=(o*c*r-l*a*r+l*n*s-e*c*s-o*n*h+e*a*h)*w,this}scale(t){const e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,a=t.y,s=t.z,u=i*o,l=i*a;return this.set(u*o+n,u*a-r*s,u*s+r*a,0,u*a+r*s,l*a+n,l*s-r*o,0,u*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,i,o){return this.set(1,n,i,0,t,1,o,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,u=i+i,l=o+o,c=a+a,h=i*u,p=i*l,f=i*c,d=o*l,m=o*c,g=a*c,y=s*u,v=s*l,_=s*c,b=n.x,x=n.y,w=n.z;return r[0]=(1-(d+g))*b,r[1]=(p+_)*b,r[2]=(f-v)*b,r[3]=0,r[4]=(p-_)*x,r[5]=(1-(h+g))*x,r[6]=(m+y)*x,r[7]=0,r[8]=(f+v)*w,r[9]=(m-y)*w,r[10]=(1-(h+d))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let i=Wn.set(r[0],r[1],r[2]).length();const o=Wn.set(r[4],r[5],r[6]).length(),a=Wn.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],qn.copy(this);const s=1/i,u=1/o,l=1/a;return qn.elements[0]*=s,qn.elements[1]*=s,qn.elements[2]*=s,qn.elements[4]*=u,qn.elements[5]*=u,qn.elements[6]*=u,qn.elements[8]*=l,qn.elements[9]*=l,qn.elements[10]*=l,e.setFromRotationMatrix(qn),n.x=i,n.y=o,n.z=a,this}makePerspective(t,e,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,s=2*i/(e-t),u=2*i/(n-r),l=(e+t)/(e-t),c=(n+r)/(n-r),h=-(o+i)/(o-i),p=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=u,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,r,i,o){const a=this.elements,s=1/(e-t),u=1/(n-r),l=1/(o-i),c=(e+t)*s,h=(n+r)*u,p=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}Hn.prototype.isMatrix4=!0;const Wn=new dn,qn=new Hn,Yn=new dn(0,0,0),Xn=new dn(1,1,1),$n=new dn,Kn=new dn,Jn=new dn,Qn=new Hn,tr=new fn;class er{constructor(t=0,e=0,n=0,r=er.DefaultOrder){this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,i=r[0],o=r[4],a=r[8],s=r[1],u=r[5],l=r[9],c=r[2],h=r[6],p=r[10];switch(e){case"XYZ":this._y=Math.asin(Fe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Fe(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(s,u)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Fe(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-Fe(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Fe(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Fe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-l,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Qn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Qn,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return tr.setFromEuler(this),this.setFromQuaternion(tr,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}er.prototype.isEuler=!0,er.DefaultOrder="XYZ",er.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class nr{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}isEnabled(t){return 0!=(this.mask&(1<<t|0))}}let rr=0;const ir=new dn,or=new fn,ar=new Hn,sr=new dn,ur=new dn,lr=new dn,cr=new fn,hr=new dn(1,0,0),pr=new dn(0,1,0),fr=new dn(0,0,1),dr={type:"added"},mr={type:"removed"};class gr extends Le{constructor(){super(),Object.defineProperty(this,"id",{value:rr++}),this.uuid=Ne(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=gr.DefaultUp.clone();const t=new dn,e=new er,n=new fn,r=new dn(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Hn},normalMatrix:{value:new Ze}}),this.matrix=new Hn,this.matrixWorld=new Hn,this.matrixAutoUpdate=gr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new nr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return or.setFromAxisAngle(t,e),this.quaternion.multiply(or),this}rotateOnWorldAxis(t,e){return or.setFromAxisAngle(t,e),this.quaternion.premultiply(or),this}rotateX(t){return this.rotateOnAxis(hr,t)}rotateY(t){return this.rotateOnAxis(pr,t)}rotateZ(t){return this.rotateOnAxis(fr,t)}translateOnAxis(t,e){return ir.copy(t).applyQuaternion(this.quaternion),this.position.add(ir.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(hr,t)}translateY(t){return this.translateOnAxis(pr,t)}translateZ(t){return this.translateOnAxis(fr,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(ar.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?sr.copy(t):sr.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),ur.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ar.lookAt(ur,sr,this.up):ar.lookAt(sr,ur,this.up),this.quaternion.setFromRotationMatrix(ar),r&&(ar.extractRotation(r.matrixWorld),or.setFromRotationMatrix(ar),this.quaternion.premultiply(or.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(dr)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(mr)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(mr)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),ar.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),ar.multiply(t.parent.matrixWorld)),t.applyMatrix4(ar),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ur,t,lr),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ur,cr,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++)t[e].updateWorldMatrix(!1,!0)}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){const r=n[e];i(t.shapes,r)}else i(t.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,r=this.material.length;n<r;n++)e.push(i(t.materials,this.material[n]));r.material=e}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];r.animations.push(i(t.animations,n))}}if(e){const e=o(t.geometries),r=o(t.materials),i=o(t.textures),a=o(t.images),s=o(t.shapes),u=o(t.skeletons),l=o(t.animations),c=o(t.nodes);e.length>0&&(n.geometries=e),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),u.length>0&&(n.skeletons=u),l.length>0&&(n.animations=l),c.length>0&&(n.nodes=c)}return n.object=r,n;function o(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}gr.DefaultUp=new dn(0,1,0),gr.DefaultMatrixAutoUpdate=!0,gr.prototype.isObject3D=!0;const yr=new dn,vr=new dn,_r=new dn,br=new dn,xr=new dn,wr=new dn,Sr=new dn,Er=new dn,Mr=new dn,Tr=new dn;class Ar{constructor(t=new dn,e=new dn,n=new dn){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),yr.subVectors(t,e),r.cross(yr);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(t,e,n,r,i){yr.subVectors(r,e),vr.subVectors(n,e),_r.subVectors(t,e);const o=yr.dot(yr),a=yr.dot(vr),s=yr.dot(_r),u=vr.dot(vr),l=vr.dot(_r),c=o*u-a*a;if(0===c)return i.set(-2,-1,-1);const h=1/c,p=(u*s-a*l)*h,f=(o*l-a*s)*h;return i.set(1-p-f,f,p)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,br),br.x>=0&&br.y>=0&&br.x+br.y<=1}static getUV(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,br),s.set(0,0),s.addScaledVector(i,br.x),s.addScaledVector(o,br.y),s.addScaledVector(a,br.z),s}static isFrontFacing(t,e,n,r){return yr.subVectors(n,e),vr.subVectors(t,e),yr.cross(vr).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return yr.subVectors(this.c,this.b),vr.subVectors(this.a,this.b),.5*yr.cross(vr).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Ar.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Ar.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,r,i){return Ar.getUV(t,this.a,this.b,this.c,e,n,r,i)}containsPoint(t){return Ar.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Ar.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,i=this.c;let o,a;xr.subVectors(r,n),wr.subVectors(i,n),Er.subVectors(t,n);const s=xr.dot(Er),u=wr.dot(Er);if(s<=0&&u<=0)return e.copy(n);Mr.subVectors(t,r);const l=xr.dot(Mr),c=wr.dot(Mr);if(l>=0&&c<=l)return e.copy(r);const h=s*c-l*u;if(h<=0&&s>=0&&l<=0)return o=s/(s-l),e.copy(n).addScaledVector(xr,o);Tr.subVectors(t,i);const p=xr.dot(Tr),f=wr.dot(Tr);if(f>=0&&p<=f)return e.copy(i);const d=p*u-s*f;if(d<=0&&u>=0&&f<=0)return a=u/(u-f),e.copy(n).addScaledVector(wr,a);const m=l*f-p*c;if(m<=0&&c-l>=0&&p-f>=0)return Sr.subVectors(i,r),a=(c-l)/(c-l+(p-f)),e.copy(r).addScaledVector(Sr,a);const g=1/(m+d+h);return o=d*g,a=h*g,e.copy(n).addScaledVector(xr,o).addScaledVector(wr,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Cr=0;class Or extends Le{constructor(){super(),Object.defineProperty(this,"id",{value:Cr++}),this.uuid=Ne(),this.name="",this.type="Material",this.fog=!0,this.blending=x,this.side=y,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=D,this.blendDst=N,this.blendEquation=T,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=H,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ae,this.stencilZFail=Ae,this.stencilZPass=Ae,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==x&&(n.blending=this.blending),this.side!==y&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){const e=r(t.textures),i=r(t.images);e.length>0&&(n.textures=e),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let r=0;r!==t;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}Or.prototype.isMaterial=!0,Or.fromType=function(){return null};class Pr extends Or{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new en(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Pr.prototype.isMeshBasicMaterial=!0;const kr=new dn,Lr=new Ue;class Ir{constructor(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=Ce,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),i=new en),e[n++]=i.r,e[n++]=i.g,e[n++]=i.b}return this}copyVector2sArray(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),i=new Ue),e[n++]=i.x,e[n++]=i.y}return this}copyVector3sArray(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new dn),e[n++]=i.x,e[n++]=i.y,e[n++]=i.z}return this}copyVector4sArray(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),i=new ln),e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n++]=i.w}return this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Lr.fromBufferAttribute(this,e),Lr.applyMatrix3(t),this.setXY(e,Lr.x,Lr.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)kr.fromBufferAttribute(this,e),kr.applyMatrix3(t),this.setXYZ(e,kr.x,kr.y,kr.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)kr.fromBufferAttribute(this,e),kr.applyMatrix4(t),this.setXYZ(e,kr.x,kr.y,kr.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)kr.fromBufferAttribute(this,e),kr.applyNormalMatrix(t),this.setXYZ(e,kr.x,kr.y,kr.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)kr.fromBufferAttribute(this,e),kr.transformDirection(t),this.setXYZ(e,kr.x,kr.y,kr.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Ce&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}}Ir.prototype.isBufferAttribute=!0;class Rr extends Ir{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class Dr extends Ir{constructor(t,e,n){super(new Uint32Array(t),e,n)}}(class extends Ir{constructor(t,e,n){super(new Uint16Array(t),e,n)}}).prototype.isFloat16BufferAttribute=!0;class Nr extends Ir{constructor(t,e,n){super(new Float32Array(t),e,n)}}let Fr=0;const zr=new Hn,Br=new gr,jr=new dn,Ur=new yn,Zr=new yn,Vr=new dn;class Gr extends Le{constructor(){super(),Object.defineProperty(this,"id",{value:Fr++}),this.uuid=Ne(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(Ve(t)?Dr:Rr)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Ze).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return zr.makeRotationFromQuaternion(t),this.applyMatrix4(zr),this}rotateX(t){return zr.makeRotationX(t),this.applyMatrix4(zr),this}rotateY(t){return zr.makeRotationY(t),this.applyMatrix4(zr),this}rotateZ(t){return zr.makeRotationZ(t),this.applyMatrix4(zr),this}translate(t,e,n){return zr.makeTranslation(t,e,n),this.applyMatrix4(zr),this}scale(t,e,n){return zr.makeScale(t,e,n),this.applyMatrix4(zr),this}lookAt(t){return Br.lookAt(t),Br.updateMatrix(),this.applyMatrix4(Br.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(jr).negate(),this.translate(jr.x,jr.y,jr.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Nr(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new yn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new dn(-1/0,-1/0,-1/0),new dn(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Ur.setFromBufferAttribute(n),this.morphTargetsRelative?(Vr.addVectors(this.boundingBox.min,Ur.min),this.boundingBox.expandByPoint(Vr),Vr.addVectors(this.boundingBox.max,Ur.max),this.boundingBox.expandByPoint(Vr)):(this.boundingBox.expandByPoint(Ur.min),this.boundingBox.expandByPoint(Ur.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Nn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new dn,1/0);if(t){const n=this.boundingSphere.center;if(Ur.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Zr.setFromBufferAttribute(n),this.morphTargetsRelative?(Vr.addVectors(Ur.min,Zr.min),Ur.expandByPoint(Vr),Vr.addVectors(Ur.max,Zr.max),Ur.expandByPoint(Vr)):(Ur.expandByPoint(Zr.min),Ur.expandByPoint(Zr.max))}Ur.getCenter(n);let r=0;for(let e=0,i=t.count;e<i;e++)Vr.fromBufferAttribute(t,e),r=Math.max(r,n.distanceToSquared(Vr));if(e)for(let i=0,o=e.length;i<o;i++){const o=e[i],a=this.morphTargetsRelative;for(let e=0,i=o.count;e<i;e++)Vr.fromBufferAttribute(o,e),a&&(jr.fromBufferAttribute(t,e),Vr.add(jr)),r=Math.max(r,n.distanceToSquared(Vr))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,r=e.position.array,i=e.normal.array,o=e.uv.array,a=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Ir(new Float32Array(4*a),4));const s=this.getAttribute("tangent").array,u=[],l=[];for(let t=0;t<a;t++)u[t]=new dn,l[t]=new dn;const c=new dn,h=new dn,p=new dn,f=new Ue,d=new Ue,m=new Ue,g=new dn,y=new dn;function v(t,e,n){c.fromArray(r,3*t),h.fromArray(r,3*e),p.fromArray(r,3*n),f.fromArray(o,2*t),d.fromArray(o,2*e),m.fromArray(o,2*n),h.sub(c),p.sub(c),d.sub(f),m.sub(f);const i=1/(d.x*m.y-m.x*d.y);isFinite(i)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(p,-d.y).multiplyScalar(i),y.copy(p).multiplyScalar(d.x).addScaledVector(h,-m.x).multiplyScalar(i),u[t].add(g),u[e].add(g),u[n].add(g),l[t].add(y),l[e].add(y),l[n].add(y))}let _=this.groups;0===_.length&&(_=[{start:0,count:n.length}]);for(let t=0,e=_.length;t<e;++t){const e=_[t],r=e.start;for(let t=r,i=r+e.count;t<i;t+=3)v(n[t+0],n[t+1],n[t+2])}const b=new dn,x=new dn,w=new dn,S=new dn;function E(t){w.fromArray(i,3*t),S.copy(w);const e=u[t];b.copy(e),b.sub(w.multiplyScalar(w.dot(e))).normalize(),x.crossVectors(S,e);const n=x.dot(l[t])<0?-1:1;s[4*t]=b.x,s[4*t+1]=b.y,s[4*t+2]=b.z,s[4*t+3]=n}for(let t=0,e=_.length;t<e;++t){const e=_[t],r=e.start;for(let t=r,i=r+e.count;t<i;t+=3)E(n[t+0]),E(n[t+1]),E(n[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Ir(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const r=new dn,i=new dn,o=new dn,a=new dn,s=new dn,u=new dn,l=new dn,c=new dn;if(t)for(let h=0,p=t.count;h<p;h+=3){const p=t.getX(h+0),f=t.getX(h+1),d=t.getX(h+2);r.fromBufferAttribute(e,p),i.fromBufferAttribute(e,f),o.fromBufferAttribute(e,d),l.subVectors(o,i),c.subVectors(r,i),l.cross(c),a.fromBufferAttribute(n,p),s.fromBufferAttribute(n,f),u.fromBufferAttribute(n,d),a.add(l),s.add(l),u.add(l),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(d,u.x,u.y,u.z)}else for(let t=0,a=e.count;t<a;t+=3)r.fromBufferAttribute(e,t+0),i.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),l.subVectors(o,i),c.subVectors(r,i),l.cross(c),n.setXYZ(t+0,l.x,l.y,l.z),n.setXYZ(t+1,l.x,l.y,l.z),n.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(void 0===t.attributes[r])continue;const i=n[r].array,o=t.attributes[r],a=o.array,s=o.itemSize*e,u=Math.min(a.length,i.length-s);for(let t=0,e=s;t<u;t++,e++)i[e]=a[t]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Vr.fromBufferAttribute(t,e),Vr.normalize(),t.setXYZ(e,Vr.x,Vr.y,Vr.z)}toNonIndexed(){function t(t,e){const n=t.array,r=t.itemSize,i=t.normalized,o=new n.constructor(e.length*r);let a=0,s=0;for(let i=0,u=e.length;i<u;i++){a=t.isInterleavedBufferAttribute?e[i]*t.data.stride+t.offset:e[i]*r;for(let t=0;t<r;t++)o[s++]=n[a++]}return new Ir(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Gr,n=this.index.array,r=this.attributes;for(const i in r){const o=t(r[i],n);e.setAttribute(i,o)}const i=this.morphAttributes;for(const r in i){const o=[],a=i[r];for(let e=0,r=a.length;e<r;e++){const r=t(a[e],n);o.push(r)}e.morphAttributes[r]=o}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let t=0,n=o.length;t<n;t++){const n=o[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const r=n[e];t.data.attributes[e]=r.toJSON(t.data)}const r={};let i=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],o=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];o.push(r.toJSON(t.data))}o.length>0&&(r[e]=o,i=!0)}i&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const r=t.attributes;for(const t in r){const n=r[t];this.setAttribute(t,n.clone(e))}const i=t.morphAttributes;for(const t in i){const n=[],r=i[t];for(let t=0,i=r.length;t<i;t++)n.push(r[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let t=0,e=o.length;t<e;t++){const e=o[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,void 0!==t.parameters&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}Gr.prototype.isBufferGeometry=!0;const Hr=new Hn,Wr=new Gn,qr=new Nn,Yr=new dn,Xr=new dn,$r=new dn,Kr=new dn,Jr=new dn,Qr=new dn,ti=new dn,ei=new dn,ni=new dn,ri=new Ue,ii=new Ue,oi=new Ue,ai=new dn,si=new dn;class ui extends gr{constructor(t=new Gr,e=new Pr){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),qr.copy(n.boundingSphere),qr.applyMatrix4(i),!1===t.ray.intersectsSphere(qr))return;if(Hr.copy(i).invert(),Wr.copy(t.ray).applyMatrix4(Hr),null!==n.boundingBox&&!1===Wr.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position,s=n.morphAttributes.position,u=n.morphTargetsRelative,l=n.attributes.uv,c=n.attributes.uv2,h=n.groups,p=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,f=h.length;n<f;n++){const f=h[n],d=r[f.materialIndex];for(let n=Math.max(f.start,p.start),r=Math.min(i.count,Math.min(f.start+f.count,p.start+p.count));n<r;n+=3){const r=i.getX(n),h=i.getX(n+1),p=i.getX(n+2);o=li(this,d,t,Wr,a,s,u,l,c,r,h,p),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=f.materialIndex,e.push(o))}}else for(let n=Math.max(0,p.start),h=Math.min(i.count,p.start+p.count);n<h;n+=3){const h=i.getX(n),p=i.getX(n+1),f=i.getX(n+2);o=li(this,r,t,Wr,a,s,u,l,c,h,p,f),o&&(o.faceIndex=Math.floor(n/3),e.push(o))}else if(void 0!==a)if(Array.isArray(r))for(let n=0,i=h.length;n<i;n++){const i=h[n],f=r[i.materialIndex];for(let n=Math.max(i.start,p.start),r=Math.min(a.count,Math.min(i.start+i.count,p.start+p.count));n<r;n+=3)o=li(this,f,t,Wr,a,s,u,l,c,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=i.materialIndex,e.push(o))}else for(let n=Math.max(0,p.start),i=Math.min(a.count,p.start+p.count);n<i;n+=3)o=li(this,r,t,Wr,a,s,u,l,c,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),e.push(o))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function li(t,e,n,r,i,o,a,s,u,l,c,h){Yr.fromBufferAttribute(i,l),Xr.fromBufferAttribute(i,c),$r.fromBufferAttribute(i,h);const p=t.morphTargetInfluences;if(o&&p){ti.set(0,0,0),ei.set(0,0,0),ni.set(0,0,0);for(let t=0,e=o.length;t<e;t++){const e=p[t],n=o[t];0!==e&&(Kr.fromBufferAttribute(n,l),Jr.fromBufferAttribute(n,c),Qr.fromBufferAttribute(n,h),a?(ti.addScaledVector(Kr,e),ei.addScaledVector(Jr,e),ni.addScaledVector(Qr,e)):(ti.addScaledVector(Kr.sub(Yr),e),ei.addScaledVector(Jr.sub(Xr),e),ni.addScaledVector(Qr.sub($r),e)))}Yr.add(ti),Xr.add(ei),$r.add(ni)}t.isSkinnedMesh&&(t.boneTransform(l,Yr),t.boneTransform(c,Xr),t.boneTransform(h,$r));const f=function(t,e,n,r,i,o,a,s){let u;if(u=e.side===v?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,e.side!==_,s),null===u)return null;si.copy(s),si.applyMatrix4(t.matrixWorld);const l=n.ray.origin.distanceTo(si);return l<n.near||l>n.far?null:{distance:l,point:si.clone(),object:t}}(t,e,n,r,Yr,Xr,$r,ai);if(f){s&&(ri.fromBufferAttribute(s,l),ii.fromBufferAttribute(s,c),oi.fromBufferAttribute(s,h),f.uv=Ar.getUV(ai,Yr,Xr,$r,ri,ii,oi,new Ue)),u&&(ri.fromBufferAttribute(u,l),ii.fromBufferAttribute(u,c),oi.fromBufferAttribute(u,h),f.uv2=Ar.getUV(ai,Yr,Xr,$r,ri,ii,oi,new Ue));const t={a:l,b:c,c:h,normal:new dn,materialIndex:0};Ar.getNormal(Yr,Xr,$r,t.normal),f.face=t}return f}ui.prototype.isMesh=!0;class ci extends Gr{constructor(t=1,e=1,n=1,r=1,i=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const s=[],u=[],l=[],c=[];let h=0,p=0;function f(t,e,n,r,i,o,f,d,m,g,y){const v=o/m,_=f/g,b=o/2,x=f/2,w=d/2,S=m+1,E=g+1;let M=0,T=0;const A=new dn;for(let o=0;o<E;o++){const a=o*_-x;for(let s=0;s<S;s++){const h=s*v-b;A[t]=h*r,A[e]=a*i,A[n]=w,u.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=d>0?1:-1,l.push(A.x,A.y,A.z),c.push(s/m),c.push(1-o/g),M+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const n=h+e+S*t,r=h+e+S*(t+1),i=h+(e+1)+S*(t+1),o=h+(e+1)+S*t;s.push(n,r,o),s.push(r,i,o),T+=6}a.addGroup(p,T,y),p+=T,h+=M}f("z","y","x",-1,-1,n,e,t,o,i,0),f("z","y","x",1,-1,n,e,-t,o,i,1),f("x","z","y",1,1,t,n,e,r,o,2),f("x","z","y",1,-1,t,n,-e,r,o,3),f("x","y","z",1,-1,t,e,n,r,i,4),f("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new Nr(u,3)),this.setAttribute("normal",new Nr(l,3)),this.setAttribute("uv",new Nr(c,2))}static fromJSON(t){return new ci(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function hi(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function pi(t){const e={};for(let n=0;n<t.length;n++){const r=hi(t[n]);for(const t in r)e[t]=r[t]}return e}const fi={clone:hi,merge:pi};class di extends Or{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=hi(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}di.prototype.isShaderMaterial=!0;class mi extends gr{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Hn,this.projectionMatrix=new Hn,this.projectionMatrixInverse=new Hn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}mi.prototype.isCamera=!0;class gi extends mi{constructor(t=50,e=1,n=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*De*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Re*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*De*Math.atan(Math.tan(.5*Re*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,r,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Re*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,a=o.fullHeight;i+=o.offsetX*r/t,e-=o.offsetY*n/a,r*=o.width/t,n*=o.height/a}const a=this.filmOffset;0!==a&&(i+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}gi.prototype.isPerspectiveCamera=!0;const yi=90;class vi extends gr{constructor(t,e,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new gi(yi,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new dn(1,0,0)),this.add(r);const i=new gi(yi,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new dn(-1,0,0)),this.add(i);const o=new gi(yi,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new dn(0,1,0)),this.add(o);const a=new gi(yi,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new dn(0,-1,0)),this.add(a);const s=new gi(yi,1,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new dn(0,0,1)),this.add(s);const u=new gi(yi,1,t,e);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new dn(0,0,-1)),this.add(u)}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,o,a,s,u]=this.children,l=t.getRenderTarget(),c=t.outputEncoding,h=t.toneMapping,p=t.xr.enabled;t.outputEncoding=be,t.toneMapping=Q,t.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,i),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=f,t.setRenderTarget(n,5),t.render(e,u),t.setRenderTarget(l),t.outputEncoding=c,t.toneMapping=h,t.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class _i extends un{constructor(t,e,n,r,i,o,a,s,u,l){super(t=void 0!==t?t:[],e=void 0!==e?e:ot,n,r,i,o,a,s,u,l),this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}_i.prototype.isCubeTexture=!0;class bi extends cn{constructor(t,e={}){super(t,t,e);const n={width:t,height:t,depth:1},r=[n,n,n,n,n,n];this.texture=new _i(r,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:gt}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new ci(5,5,5),a=new di({name:"CubemapFromEquirect",uniforms:hi(n),vertexShader:r,fragmentShader:i,side:v,blending:b});a.uniforms.tEquirect.value=e;const s=new ui(o,a),u=e.minFilter;return e.minFilter===vt&&(e.minFilter=gt),new vi(1,10,this).update(t,s),e.minFilter=u,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,r){const i=t.getRenderTarget();for(let i=0;i<6;i++)t.setRenderTarget(this,i),t.clear(e,n,r);t.setRenderTarget(i)}}bi.prototype.isWebGLCubeRenderTarget=!0;const xi=new dn,wi=new dn,Si=new Ze;class Ei{constructor(t=new dn(1,0,0),e=0){this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=xi.subVectors(n,e).cross(wi.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const n=t.delta(xi),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:e.copy(n).multiplyScalar(i).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Si.getNormalMatrix(t),r=this.coplanarPoint(xi).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Ei.prototype.isPlane=!0;const Mi=new Nn,Ti=new dn;class Ai{constructor(t=new Ei,e=new Ei,n=new Ei,r=new Ei,i=new Ei,o=new Ei){this.planes=[t,e,n,r,i,o]}set(t,e,n,r,i,o){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=n[7],h=n[8],p=n[9],f=n[10],d=n[11],m=n[12],g=n[13],y=n[14],v=n[15];return e[0].setComponents(a-r,c-s,d-h,v-m).normalize(),e[1].setComponents(a+r,c+s,d+h,v+m).normalize(),e[2].setComponents(a+i,c+u,d+p,v+g).normalize(),e[3].setComponents(a-i,c-u,d-p,v-g).normalize(),e[4].setComponents(a-o,c-l,d-f,v-y).normalize(),e[5].setComponents(a+o,c+l,d+f,v+y).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Mi.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Mi)}intersectsSprite(t){return Mi.center.set(0,0,0),Mi.radius=.7071067811865476,Mi.applyMatrix4(t.matrixWorld),this.intersectsSphere(Mi)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(n)<r)return!1;return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const r=e[n];if(Ti.x=r.normal.x>0?t.max.x:t.min.x,Ti.y=r.normal.y>0?t.max.y:t.min.y,Ti.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Ti)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Ci(){let t=null,e=!1,n=null,r=null;function i(e,o){n(e,o),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Oi(t,e){const n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const o=r.get(e);void 0===o?r.set(e,function(e,r){const i=e.array,o=e.usage,a=t.createBuffer();let s;if(t.bindBuffer(r,a),t.bufferData(r,i,o),e.onUploadCallback(),i instanceof Float32Array)s=5126;else if(i instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");s=5131}else s=5123;else if(i instanceof Int16Array)s=5122;else if(i instanceof Uint32Array)s=5125;else if(i instanceof Int32Array)s=5124;else if(i instanceof Int8Array)s=5120;else if(i instanceof Uint8Array)s=5121;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);s=5121}return{buffer:a,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,i)):o.version<e.version&&(function(e,r,i){const o=r.array,a=r.updateRange;t.bindBuffer(i,e),-1===a.count?t.bufferSubData(i,0,o):(n?t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(o.buffer,e,i),o.version=e.version)}}}class Pi extends Gr{constructor(t=1,e=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};const i=t/2,o=e/2,a=Math.floor(n),s=Math.floor(r),u=a+1,l=s+1,c=t/a,h=e/s,p=[],f=[],d=[],m=[];for(let t=0;t<l;t++){const e=t*h-o;for(let n=0;n<u;n++){const r=n*c-i;f.push(r,-e,0),d.push(0,0,1),m.push(n/a),m.push(1-t/s)}}for(let t=0;t<s;t++)for(let e=0;e<a;e++){const n=e+u*t,r=e+u*(t+1),i=e+1+u*(t+1),o=e+1+u*t;p.push(n,r,o),p.push(r,i,o)}this.setIndex(p),this.setAttribute("position",new Nr(f,3)),this.setAttribute("normal",new Nr(d,3)),this.setAttribute("uv",new Nr(m,2))}static fromJSON(t){return new Pi(t.width,t.height,t.widthSegments,t.heightSegments)}}const ki={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},Li={common:{diffuse:{value:new en(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ze},uv2Transform:{value:new Ze},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ue(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new en(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new en(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Ze}},sprite:{diffuse:{value:new en(16777215)},opacity:{value:1},center:{value:new Ue(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Ze}}},Ii={basic:{uniforms:pi([Li.common,Li.specularmap,Li.envmap,Li.aomap,Li.lightmap,Li.fog]),vertexShader:ki.meshbasic_vert,fragmentShader:ki.meshbasic_frag},lambert:{uniforms:pi([Li.common,Li.specularmap,Li.envmap,Li.aomap,Li.lightmap,Li.emissivemap,Li.fog,Li.lights,{emissive:{value:new en(0)}}]),vertexShader:ki.meshlambert_vert,fragmentShader:ki.meshlambert_frag},phong:{uniforms:pi([Li.common,Li.specularmap,Li.envmap,Li.aomap,Li.lightmap,Li.emissivemap,Li.bumpmap,Li.normalmap,Li.displacementmap,Li.fog,Li.lights,{emissive:{value:new en(0)},specular:{value:new en(1118481)},shininess:{value:30}}]),vertexShader:ki.meshphong_vert,fragmentShader:ki.meshphong_frag},standard:{uniforms:pi([Li.common,Li.envmap,Li.aomap,Li.lightmap,Li.emissivemap,Li.bumpmap,Li.normalmap,Li.displacementmap,Li.roughnessmap,Li.metalnessmap,Li.fog,Li.lights,{emissive:{value:new en(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ki.meshphysical_vert,fragmentShader:ki.meshphysical_frag},toon:{uniforms:pi([Li.common,Li.aomap,Li.lightmap,Li.emissivemap,Li.bumpmap,Li.normalmap,Li.displacementmap,Li.gradientmap,Li.fog,Li.lights,{emissive:{value:new en(0)}}]),vertexShader:ki.meshtoon_vert,fragmentShader:ki.meshtoon_frag},matcap:{uniforms:pi([Li.common,Li.bumpmap,Li.normalmap,Li.displacementmap,Li.fog,{matcap:{value:null}}]),vertexShader:ki.meshmatcap_vert,fragmentShader:ki.meshmatcap_frag},points:{uniforms:pi([Li.points,Li.fog]),vertexShader:ki.points_vert,fragmentShader:ki.points_frag},dashed:{uniforms:pi([Li.common,Li.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ki.linedashed_vert,fragmentShader:ki.linedashed_frag},depth:{uniforms:pi([Li.common,Li.displacementmap]),vertexShader:ki.depth_vert,fragmentShader:ki.depth_frag},normal:{uniforms:pi([Li.common,Li.bumpmap,Li.normalmap,Li.displacementmap,{opacity:{value:1}}]),vertexShader:ki.meshnormal_vert,fragmentShader:ki.meshnormal_frag},sprite:{uniforms:pi([Li.sprite,Li.fog]),vertexShader:ki.sprite_vert,fragmentShader:ki.sprite_frag},background:{uniforms:{uvTransform:{value:new Ze},t2D:{value:null}},vertexShader:ki.background_vert,fragmentShader:ki.background_frag},cube:{uniforms:pi([Li.envmap,{opacity:{value:1}}]),vertexShader:ki.cube_vert,fragmentShader:ki.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ki.equirect_vert,fragmentShader:ki.equirect_frag},distanceRGBA:{uniforms:pi([Li.common,Li.displacementmap,{referencePosition:{value:new dn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ki.distanceRGBA_vert,fragmentShader:ki.distanceRGBA_frag},shadow:{uniforms:pi([Li.lights,Li.fog,{color:{value:new en(0)},opacity:{value:1}}]),vertexShader:ki.shadow_vert,fragmentShader:ki.shadow_frag}};function Ri(t,e,n,r,i,o){const a=new en(0);let s,u,l=!0===i?0:1,c=null,h=0,p=null;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,o)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),l=e,f(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t,f(a,l)},render:function(n,i){let o=!1,d=!0===i.isScene?i.background:null;d&&d.isTexture&&(d=e.get(d));const m=t.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(d=null),null===d?f(a,l):d&&d.isColor&&(f(d,1),o=!0),(t.autoClear||o)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),d&&(d.isCubeTexture||d.mapping===lt)?(void 0===u&&(u=new ui(new ci(1,1,1),new di({name:"BackgroundCubeMaterial",uniforms:hi(Ii.cube.uniforms),vertexShader:Ii.cube.vertexShader,fragmentShader:Ii.cube.fragmentShader,side:v,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=d,u.material.uniforms.flipEnvMap.value=d.isCubeTexture&&!1===d.isRenderTargetTexture?-1:1,c===d&&h===d.version&&p===t.toneMapping||(u.material.needsUpdate=!0,c=d,h=d.version,p=t.toneMapping),n.unshift(u,u.geometry,u.material,0,0,null)):d&&d.isTexture&&(void 0===s&&(s=new ui(new Pi(2,2),new di({name:"BackgroundMaterial",uniforms:hi(Ii.background.uniforms),vertexShader:Ii.background.vertexShader,fragmentShader:Ii.background.fragmentShader,side:y,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(s)),s.material.uniforms.t2D.value=d,!0===d.matrixAutoUpdate&&d.updateMatrix(),s.material.uniforms.uvTransform.value.copy(d.matrix),c===d&&h===d.version&&p===t.toneMapping||(s.material.needsUpdate=!0,c=d,h=d.version,p=t.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null))}}}function Di(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},u=f(null);let l=u,c=!1;function h(e){return r.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function p(e){return r.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function f(t){const e=[],n=[],r=[];for(let t=0;t<i;t++)e[t]=0,n[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:r,object:t,attributes:{},index:null}}function d(){const t=l.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function m(t){g(t,0)}function g(n,i){const o=l.newAttributes,a=l.enabledAttributes,s=l.attributeDivisors;o[n]=1,0===a[n]&&(t.enableVertexAttribArray(n),a[n]=1),s[n]!==i&&((r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i)}function y(){const e=l.newAttributes,n=l.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0)}function v(e,n,i,o,a,s){!0!==r.isWebGL2||5124!==i&&5125!==i?t.vertexAttribPointer(e,n,i,o,a,s):t.vertexAttribIPointer(e,n,i,a,s)}function _(){b(),c=!0,l!==u&&(l=u,h(l.object))}function b(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:function(i,u,p,_,b){let x=!1;if(a){const e=function(e,n,i){const a=!0===i.wireframe;let u=s[e.id];void 0===u&&(u={},s[e.id]=u);let l=u[n.id];void 0===l&&(l={},u[n.id]=l);let c=l[a];return void 0===c&&(c=f(r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),l[a]=c),c}(_,p,u);l!==e&&(l=e,h(l.object)),x=function(t,e){const n=l.attributes,r=t.attributes;let i=0;for(const t in r){const e=n[t],o=r[t];if(void 0===e)return!0;if(e.attribute!==o)return!0;if(e.data!==o.data)return!0;i++}return l.attributesNum!==i||l.index!==e}(_,b),x&&function(t,e){const n={},r=t.attributes;let i=0;for(const t in r){const e=r[t],o={};o.attribute=e,e.data&&(o.data=e.data),n[t]=o,i++}l.attributes=n,l.attributesNum=i,l.index=e}(_,b)}else{const t=!0===u.wireframe;l.geometry===_.id&&l.program===p.id&&l.wireframe===t||(l.geometry=_.id,l.program=p.id,l.wireframe=t,x=!0)}!0===i.isInstancedMesh&&(x=!0),null!==b&&n.update(b,34963),(x||c)&&(c=!1,function(i,o,a,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;d();const u=s.attributes,l=a.getAttributes(),c=o.defaultAttributeValues;for(const e in l){const r=l[e];if(r.location>=0){let o=u[e];if(void 0===o&&("instanceMatrix"===e&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===e&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const e=o.normalized,a=o.itemSize,u=n.get(o);if(void 0===u)continue;const l=u.buffer,c=u.type,h=u.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,u=n.stride,p=o.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<r.locationSize;t++)g(r.location+t,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let t=0;t<r.locationSize;t++)m(r.location+t);t.bindBuffer(34962,l);for(let t=0;t<r.locationSize;t++)v(r.location+t,a/r.locationSize,c,e,u*h,(p+a/r.locationSize*t)*h)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<r.locationSize;t++)g(r.location+t,o.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<r.locationSize;t++)m(r.location+t);t.bindBuffer(34962,l);for(let t=0;t<r.locationSize;t++)v(r.location+t,a/r.locationSize,c,e,a*h,a/r.locationSize*t*h)}}else if(void 0!==c){const n=c[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(r.location,n);break;case 3:t.vertexAttrib3fv(r.location,n);break;case 4:t.vertexAttrib4fv(r.location,n);break;default:t.vertexAttrib1fv(r.location,n)}}}}y()}(i,u,p,_),null!==b&&t.bindBuffer(34963,n.get(b).buffer))},reset:_,resetDefaultState:b,dispose:function(){_();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)p(n[t].object),delete n[t];delete e[t]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0===s[t.id])return;const e=s[t.id];for(const t in e){const n=e[t];for(const t in n)p(n[t].object),delete n[t];delete e[t]}delete s[t.id]},releaseStatesOfProgram:function(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)p(r[t].object),delete r[t];delete n[t.id]}},initAttributes:d,enableAttribute:m,disableUnusedAttributes:y}}function Ni(t,e,n,r){const i=r.isWebGL2;let o;this.setMode=function(t){o=t},this.render=function(e,r){t.drawArrays(o,e,r),n.update(r,o,1)},this.renderInstances=function(r,a,s){if(0===s)return;let u,l;if(i)u=t,l="drawArraysInstanced";else if(u=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===u)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](o,r,a,s),n.update(a,o,s)}}function Fi(t,e,n){let r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);const u=o||e.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),h=t.getParameter(35660),p=t.getParameter(3379),f=t.getParameter(34076),d=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),y=t.getParameter(36349),v=h>0,_=o||e.has("OES_texture_float");return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:f,maxAttributes:d,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:v&&_,maxSamples:o?t.getParameter(36183):0}}function zi(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new Ei,s=new Ze,u={value:null,needsUpdate:!1};function l(){u.value!==n&&(u.value=n,u.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(t,n,r,i){const o=null!==t?t.length:0;let l=null;if(0!==o){if(l=u.value,!0!==i||null===l){const e=r+4*o,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===l||l.length<e)&&(l=new Float32Array(e));for(let e=0,n=r;e!==o;++e,n+=4)a.copy(t[e]).applyMatrix4(i,s),a.normal.toArray(l,n),l[n+3]=a.constant}u.value=l,u.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,l}this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,o){const a=0!==t.length||e||0!==r||i;return i=e,n=c(t,o,0),r=t.length,a},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1,l()},this.setState=function(e,a,s){const h=e.clippingPlanes,p=e.clipIntersection,f=e.clipShadows,d=t.get(e);if(!i||null===h||0===h.length||o&&!f)o?c(null):l();else{const t=o?0:r,e=4*t;let i=d.clippingState||null;u.value=i,i=c(h,a,e,s);for(let t=0;t!==e;++t)i[t]=n[t];d.clippingState=i,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=t}}}function Bi(t){let e=new WeakMap;function n(t,e){return e===st?t.mapping=ot:e===ut&&(t.mapping=at),t}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const o=i.mapping;if(o===st||o===ut){if(e.has(i))return n(e.get(i).texture,i.mapping);{const o=i.image;if(o&&o.height>0){const a=new bi(o.height/2);return a.fromEquirectangularTexture(t,i),e.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}Ii.physical={uniforms:pi([Ii.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ue(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new en(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ue},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new en(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new en(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ki.meshphysical_vert,fragmentShader:ki.meshphysical_frag};class ji extends mi{constructor(t=-1,e=1,n=1,r=-1,i=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=i,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-t,o=n+t,a=r+e,s=r-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=t*this.view.offsetX,o=i+t*this.view.width,a-=e*this.view.offsetY,s=a-e*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}ji.prototype.isOrthographicCamera=!0;const Ui=[.125,.215,.35,.446,.526,.582],Zi=new ji,Vi=new en;let Gi=null;const Hi=(1+Math.sqrt(5))/2,Wi=1/Hi,qi=[new dn(1,1,1),new dn(-1,1,1),new dn(1,1,-1),new dn(-1,1,-1),new dn(0,Hi,Wi),new dn(0,Hi,-Wi),new dn(Wi,0,Hi),new dn(-Wi,0,Hi),new dn(Hi,Wi,0),new dn(-Hi,Wi,0)];class Yi{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,r=100){Gi=this._renderer.getRenderTarget(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Ji(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Ki(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Gi),t.scissorTest=!1,$i(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===ot||t.mapping===at?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Gi=this._renderer.getRenderTarget();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize-32,n={magFilter:gt,minFilter:gt,generateMipmaps:!1,type:Tt,format:Lt,encoding:be,depthBuffer:!1},r=Xi(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Xi(t,e,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],r=[];let i=t;const o=t-4+1+Ui.length;for(let a=0;a<o;a++){const o=Math.pow(2,i);n.push(o);let s=1/o;a>t-4?s=Ui[a-t+4-1]:0===a&&(s=0),r.push(s);const u=1/(o-1),l=-u/2,c=1+u/2,h=[l,l,c,l,c,c,l,l,c,c,l,c],p=6,f=6,d=3,m=2,g=1,y=new Float32Array(d*f*p),v=new Float32Array(m*f*p),_=new Float32Array(g*f*p);for(let t=0;t<p;t++){const e=t%3*2/3-1,n=t>2?0:-1,r=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];y.set(r,d*f*t),v.set(h,m*f*t);const i=[t,t,t,t,t,t];_.set(i,g*f*t)}const b=new Gr;b.setAttribute("position",new Ir(y,d)),b.setAttribute("uv",new Ir(v,m)),b.setAttribute("faceIndex",new Ir(_,g)),e.push(b),i>4&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(t,e,n){const r=new Float32Array(20),i=new dn(0,1,0);return new di({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:b,depthTest:!1,depthWrite:!1})}(r,t,e)}return r}_compileMaterial(t){const e=new ui(this._lodPlanes[0],t);this._renderer.compile(e,Zi)}_sceneToCubeUV(t,e,n,r){const i=new gi(90,1,e,n),o=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],s=this._renderer,u=s.autoClear,l=s.toneMapping;s.getClearColor(Vi),s.toneMapping=Q,s.autoClear=!1;const c=new Pr({name:"PMREM.Background",side:v,depthWrite:!1,depthTest:!1}),h=new ui(new ci,c);let p=!1;const f=t.background;f?f.isColor&&(c.color.copy(f),t.background=null,p=!0):(c.color.copy(Vi),p=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(i.up.set(0,o[e],0),i.lookAt(a[e],0,0)):1===n?(i.up.set(0,0,o[e]),i.lookAt(0,a[e],0)):(i.up.set(0,o[e],0),i.lookAt(0,0,a[e]));const u=this._cubeSize;$i(r,n*u,e>2?u:0,u,u),s.setRenderTarget(r),p&&s.render(h,i),s.render(t,i)}h.geometry.dispose(),h.material.dispose(),s.toneMapping=l,s.autoClear=u,t.background=f}_textureToCubeUV(t,e){const n=this._renderer,r=t.mapping===ot||t.mapping===at;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=Ji()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Ki());const i=r?this._cubemapMaterial:this._equirectMaterial,o=new ui(this._lodPlanes[0],i);i.uniforms.envMap.value=t;const a=this._cubeSize;$i(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(o,Zi)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=qi[(e-1)%qi.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,r,i){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,r,"latitudinal",i),this._halfBlur(o,t,n,n,r,"longitudinal",i)}_halfBlur(t,e,n,r,i,o,a){const s=this._renderer,u=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const l=new ui(this._lodPlanes[r],u),c=u.uniforms,h=this._sizeLods[n]-1,p=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,f=i/p,d=isFinite(i)?1+Math.floor(3*f):20;d>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${d} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/f,n=Math.exp(-e*e/2);m.push(n),0===t?g+=n:t<d&&(g+=2*n)}for(let t=0;t<m.length;t++)m[t]=m[t]/g;c.envMap.value=t.texture,c.samples.value=d,c.weights.value=m,c.latitudinal.value="latitudinal"===o,a&&(c.poleAxis.value=a);const{_lodMax:y}=this;c.dTheta.value=p,c.mipInt.value=y-n;const v=this._sizeLods[r];$i(e,3*v*(r>y-4?r-y+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(e),s.render(l,Zi)}}function Xi(t,e,n){const r=new cn(t,e,n);return r.texture.mapping=lt,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function $i(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Ki(){return new di({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:b,depthTest:!1,depthWrite:!1})}function Ji(){return new di({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:b,depthTest:!1,depthWrite:!1})}function Qi(t){let e=new WeakMap,n=null;function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping,a=o===st||o===ut,s=o===ot||o===at;if(a||s){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=e.get(i);return null===n&&(n=new Yi(t)),r=a?n.fromEquirectangular(i,r):n.fromCubemap(i,r),e.set(i,r),r.texture}if(e.has(i))return e.get(i).texture;{const o=i.image;if(a&&o&&o.height>0||s&&o&&function(t){let e=0;for(let n=0;n<6;n++)void 0!==t[n]&&e++;return 6===e}(o)){null===n&&(n=new Yi(t));const o=a?n.fromEquirectangular(i):n.fromCubemap(i);return e.set(i,o),i.addEventListener("dispose",r),o.texture}return null}}}return i},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function to(t){const e={};function n(n){if(void 0!==e[n])return e[n];let r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,r}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function eo(t,e,n,r){const i={},o=new WeakMap;function a(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const t in s.attributes)e.remove(s.attributes[t]);s.removeEventListener("dispose",a),delete i[s.id];const u=o.get(s);u&&(e.remove(u),o.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){const n=[],r=t.index,i=t.attributes.position;let a=0;if(null!==r){const t=r.array;a=r.version;for(let e=0,r=t.length;e<r;e+=3){const r=t[e+0],i=t[e+1],o=t[e+2];n.push(r,i,i,o,o,r)}}else{const t=i.array;a=i.version;for(let e=0,r=t.length/3-1;e<r;e+=3){const t=e+0,r=e+1,i=e+2;n.push(t,r,r,i,i,t)}}const s=new(Ve(n)?Dr:Rr)(n,1);s.version=a;const u=o.get(t);u&&e.remove(u),o.set(t,s)}return{get:function(t,e){return!0===i[e.id]||(e.addEventListener("dispose",a),i[e.id]=!0,n.memory.geometries++),e},update:function(t){const n=t.attributes;for(const t in n)e.update(n[t],34962);const r=t.morphAttributes;for(const t in r){const n=r[t];for(let t=0,r=n.length;t<r;t++)e.update(n[t],34962)}},getWireframeAttribute:function(t){const e=o.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&s(t)}else s(t);return o.get(t)}}}function no(t,e,n,r){const i=r.isWebGL2;let o,a,s;this.setMode=function(t){o=t},this.setIndex=function(t){a=t.type,s=t.bytesPerElement},this.render=function(e,r){t.drawElements(o,r,a,e*s),n.update(r,o,1)},this.renderInstances=function(r,u,l){if(0===l)return;let c,h;if(i)c=t,h="drawElementsInstanced";else if(c=e.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===c)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[h](o,u,a,r*s,l),n.update(u,o,l)}}function ro(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,r){switch(e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function io(t,e){return t[0]-e[0]}function oo(t,e){return Math.abs(e[1])-Math.abs(t[1])}function ao(t,e){let n=1;const r=e.isInterleavedBufferAttribute?e.data.array:e.array;r instanceof Int8Array?n=127:r instanceof Int16Array?n=32767:r instanceof Int32Array?n=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",r),t.divideScalar(n)}function so(t,e,n){const r={},i=new Float32Array(8),o=new WeakMap,a=new ln,s=[];for(let t=0;t<8;t++)s[t]=[t,0];return{update:function(u,l,c,h){const p=u.morphTargetInfluences;if(!0===e.isWebGL2){const f=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,d=void 0!==f?f.length:0;let m=o.get(l);if(void 0===m||m.count!==d){void 0!==m&&m.texture.dispose();const v=void 0!==l.morphAttributes.position,_=void 0!==l.morphAttributes.normal,b=void 0!==l.morphAttributes.color,x=l.morphAttributes.position||[],w=l.morphAttributes.normal||[],S=l.morphAttributes.color||[];let E=0;!0===v&&(E=1),!0===_&&(E=2),!0===b&&(E=3);let M=l.attributes.position.count*E,T=1;M>e.maxTextureSize&&(T=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const A=new Float32Array(M*T*4*d),C=new hn(A,M,T,d);C.type=Mt,C.needsUpdate=!0;const O=4*E;for(let k=0;k<d;k++){const L=x[k],I=w[k],R=S[k],D=M*T*4*k;for(let N=0;N<L.count;N++){const F=N*O;!0===v&&(a.fromBufferAttribute(L,N),!0===L.normalized&&ao(a,L),A[D+F+0]=a.x,A[D+F+1]=a.y,A[D+F+2]=a.z,A[D+F+3]=0),!0===_&&(a.fromBufferAttribute(I,N),!0===I.normalized&&ao(a,I),A[D+F+4]=a.x,A[D+F+5]=a.y,A[D+F+6]=a.z,A[D+F+7]=0),!0===b&&(a.fromBufferAttribute(R,N),!0===R.normalized&&ao(a,R),A[D+F+8]=a.x,A[D+F+9]=a.y,A[D+F+10]=a.z,A[D+F+11]=4===R.itemSize?a.w:1)}}function P(){C.dispose(),o.delete(l),l.removeEventListener("dispose",P)}m={count:d,texture:C,size:new Ue(M,T)},o.set(l,m),l.addEventListener("dispose",P)}let g=0;for(let z=0;z<p.length;z++)g+=p[z];const y=l.morphTargetsRelative?1:1-g;h.getUniforms().setValue(t,"morphTargetBaseInfluence",y),h.getUniforms().setValue(t,"morphTargetInfluences",p),h.getUniforms().setValue(t,"morphTargetsTexture",m.texture,n),h.getUniforms().setValue(t,"morphTargetsTextureSize",m.size)}else{const B=void 0===p?0:p.length;let j=r[l.id];if(void 0===j||j.length!==B){j=[];for(let H=0;H<B;H++)j[H]=[H,0];r[l.id]=j}for(let W=0;W<B;W++){const q=j[W];q[0]=W,q[1]=p[W]}j.sort(oo);for(let Y=0;Y<8;Y++)Y<B&&j[Y][1]?(s[Y][0]=j[Y][0],s[Y][1]=j[Y][1]):(s[Y][0]=Number.MAX_SAFE_INTEGER,s[Y][1]=0);s.sort(io);const U=l.morphAttributes.position,Z=l.morphAttributes.normal;let V=0;for(let X=0;X<8;X++){const $=s[X],K=$[0],J=$[1];K!==Number.MAX_SAFE_INTEGER&&J?(U&&l.getAttribute("morphTarget"+X)!==U[K]&&l.setAttribute("morphTarget"+X,U[K]),Z&&l.getAttribute("morphNormal"+X)!==Z[K]&&l.setAttribute("morphNormal"+X,Z[K]),i[X]=J,V+=J):(U&&!0===l.hasAttribute("morphTarget"+X)&&l.deleteAttribute("morphTarget"+X),Z&&!0===l.hasAttribute("morphNormal"+X)&&l.deleteAttribute("morphNormal"+X),i[X]=0)}const G=l.morphTargetsRelative?1:1-V;h.getUniforms().setValue(t,"morphTargetBaseInfluence",G),h.getUniforms().setValue(t,"morphTargetInfluences",i)}}}}function uo(t,e,n,r){let i=new WeakMap;function o(t){const e=t.target;e.removeEventListener("dispose",o),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(t){const a=r.render.frame,s=t.geometry,u=e.get(t,s);return i.get(u)!==a&&(e.update(u),i.set(u,a)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",o)&&t.addEventListener("dispose",o),n.update(t.instanceMatrix,34962),null!==t.instanceColor&&n.update(t.instanceColor,34962)),u},dispose:function(){i=new WeakMap}}}const lo=new un,co=new hn,ho=new pn,po=new _i,fo=[],mo=[],go=new Float32Array(16),yo=new Float32Array(9),vo=new Float32Array(4);function _o(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let o=fo[i];if(void 0===o&&(o=new Float32Array(i),fo[i]=o),0!==e){r.toArray(o,0);for(let r=1,i=0;r!==e;++r)i+=n,t[r].toArray(o,i)}return o}function bo(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function xo(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function wo(t,e){let n=mo[e];void 0===n&&(n=new Int32Array(e),mo[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function So(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Eo(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(bo(n,e))return;t.uniform2fv(this.addr,e),xo(n,e)}}function Mo(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(bo(n,e))return;t.uniform3fv(this.addr,e),xo(n,e)}}function To(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(bo(n,e))return;t.uniform4fv(this.addr,e),xo(n,e)}}function Ao(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(bo(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),xo(n,e)}else{if(bo(n,r))return;vo.set(r),t.uniformMatrix2fv(this.addr,!1,vo),xo(n,r)}}function Co(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(bo(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),xo(n,e)}else{if(bo(n,r))return;yo.set(r),t.uniformMatrix3fv(this.addr,!1,yo),xo(n,r)}}function Oo(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(bo(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),xo(n,e)}else{if(bo(n,r))return;go.set(r),t.uniformMatrix4fv(this.addr,!1,go),xo(n,r)}}function Po(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function ko(t,e){const n=this.cache;bo(n,e)||(t.uniform2iv(this.addr,e),xo(n,e))}function Lo(t,e){const n=this.cache;bo(n,e)||(t.uniform3iv(this.addr,e),xo(n,e))}function Io(t,e){const n=this.cache;bo(n,e)||(t.uniform4iv(this.addr,e),xo(n,e))}function Ro(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Do(t,e){const n=this.cache;bo(n,e)||(t.uniform2uiv(this.addr,e),xo(n,e))}function No(t,e){const n=this.cache;bo(n,e)||(t.uniform3uiv(this.addr,e),xo(n,e))}function Fo(t,e){const n=this.cache;bo(n,e)||(t.uniform4uiv(this.addr,e),xo(n,e))}function zo(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(e||lo,i)}function Bo(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||ho,i)}function jo(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||po,i)}function Uo(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||co,i)}function Zo(t,e){t.uniform1fv(this.addr,e)}function Vo(t,e){const n=_o(e,this.size,2);t.uniform2fv(this.addr,n)}function Go(t,e){const n=_o(e,this.size,3);t.uniform3fv(this.addr,n)}function Ho(t,e){const n=_o(e,this.size,4);t.uniform4fv(this.addr,n)}function Wo(t,e){const n=_o(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function qo(t,e){const n=_o(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Yo(t,e){const n=_o(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Xo(t,e){t.uniform1iv(this.addr,e)}function $o(t,e){t.uniform2iv(this.addr,e)}function Ko(t,e){t.uniform3iv(this.addr,e)}function Jo(t,e){t.uniform4iv(this.addr,e)}function Qo(t,e){t.uniform1uiv(this.addr,e)}function ta(t,e){t.uniform2uiv(this.addr,e)}function ea(t,e){t.uniform3uiv(this.addr,e)}function na(t,e){t.uniform4uiv(this.addr,e)}function ra(t,e,n){const r=e.length,i=wo(n,r);t.uniform1iv(this.addr,i);for(let t=0;t!==r;++t)n.setTexture2D(e[t]||lo,i[t])}function ia(t,e,n){const r=e.length,i=wo(n,r);t.uniform1iv(this.addr,i);for(let t=0;t!==r;++t)n.setTexture3D(e[t]||ho,i[t])}function oa(t,e,n){const r=e.length,i=wo(n,r);t.uniform1iv(this.addr,i);for(let t=0;t!==r;++t)n.setTextureCube(e[t]||po,i[t])}function aa(t,e,n){const r=e.length,i=wo(n,r);t.uniform1iv(this.addr,i);for(let t=0;t!==r;++t)n.setTexture2DArray(e[t]||co,i[t])}function sa(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return So;case 35664:return Eo;case 35665:return Mo;case 35666:return To;case 35674:return Ao;case 35675:return Co;case 35676:return Oo;case 5124:case 35670:return Po;case 35667:case 35671:return ko;case 35668:case 35672:return Lo;case 35669:case 35673:return Io;case 5125:return Ro;case 36294:return Do;case 36295:return No;case 36296:return Fo;case 35678:case 36198:case 36298:case 36306:case 35682:return zo;case 35679:case 36299:case 36307:return Bo;case 35680:case 36300:case 36308:case 36293:return jo;case 36289:case 36303:case 36311:case 36292:return Uo}}(e.type)}function ua(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Zo;case 35664:return Vo;case 35665:return Go;case 35666:return Ho;case 35674:return Wo;case 35675:return qo;case 35676:return Yo;case 5124:case 35670:return Xo;case 35667:case 35671:return $o;case 35668:case 35672:return Ko;case 35669:case 35673:return Jo;case 5125:return Qo;case 36294:return ta;case 36295:return ea;case 36296:return na;case 35678:case 36198:case 36298:case 36306:case 35682:return ra;case 35679:case 36299:case 36307:return ia;case 35680:case 36300:case 36308:case 36293:return oa;case 36289:case 36303:case 36311:case 36292:return aa}}(e.type)}function la(t){this.id=t,this.seq=[],this.map={}}ua.prototype.updateCache=function(t){const e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),xo(e,t)},la.prototype.setValue=function(t,e,n){const r=this.seq;for(let i=0,o=r.length;i!==o;++i){const o=r[i];o.setValue(t,e[o.id],n)}};const ca=/(\w+)(\])?(\[|\.)?/g;function ha(t,e){t.seq.push(e),t.map[e.id]=e}function pa(t,e,n){const r=t.name,i=r.length;for(ca.lastIndex=0;;){const o=ca.exec(r),a=ca.lastIndex;let s=o[1];const u="]"===o[2],l=o[3];if(u&&(s|=0),void 0===l||"["===l&&a+2===i){ha(n,void 0===l?new sa(s,t,e):new ua(s,t,e));break}{let t=n.map[s];void 0===t&&(t=new la(s),ha(n,t)),n=t}}}function fa(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,35718);for(let r=0;r<n;++r){const n=t.getActiveUniform(e,r);pa(n,t.getUniformLocation(e,n.name),this)}}function da(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}fa.prototype.setValue=function(t,e,n,r){const i=this.map[e];void 0!==i&&i.setValue(t,n,r)},fa.prototype.setOptional=function(t,e,n){const r=e[n];void 0!==r&&this.setValue(t,n,r)},fa.upload=function(t,e,n,r){for(let i=0,o=e.length;i!==o;++i){const o=e[i],a=n[o.id];!1!==a.needsUpdate&&o.setValue(t,a.value,r)}},fa.seqWithValue=function(t,e){const n=[];for(let r=0,i=t.length;r!==i;++r){const i=t[r];i.id in e&&n.push(i)}return n};let ma=0;function ga(t,e,n){const r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();if(r&&""===i)return"";const o=parseInt(/ERROR: 0:(\d+)/.exec(i)[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(t,e){const n=t.split("\n"),r=[],i=Math.max(e-6,0),o=Math.min(e+6,n.length);for(let t=i;t<o;t++)r.push(t+1+": "+n[t]);return r.join("\n")}(t.getShaderSource(e),o)}function ya(t,e){const n=function(t){switch(t){case be:return["Linear","( value )"];case xe:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function va(t,e){let n;switch(e){case tt:n="Linear";break;case et:n="Reinhard";break;case nt:n="OptimizedCineon";break;case rt:n="ACESFilmic";break;case it:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function _a(t){return""!==t}function ba(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function xa(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const wa=/^[ \t]*#include +<([\w\d./]+)>/gm;function Sa(t){return t.replace(wa,Ea)}function Ea(t,e){const n=ki[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Sa(n)}const Ma=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ta=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Aa(t){return t.replace(Ta,Oa).replace(Ma,Ca)}function Ca(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Oa(0,e,n,r)}function Oa(t,e,n,r){let i="";for(let t=parseInt(e);t<parseInt(n);t++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return i}function Pa(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function ka(t,e,n,r){const i=t.getContext(),o=n.defines;let a=n.vertexShader,s=n.fragmentShader;const u=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===d?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===m?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===g&&(e="SHADOWMAP_TYPE_VSM"),e}(n),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case ot:case at:e="ENVMAP_TYPE_CUBE";break;case lt:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),c=function(t){let e="ENVMAP_MODE_REFLECTION";return t.envMap&&t.envMapMode===at&&(e="ENVMAP_MODE_REFRACTION"),e}(n),h=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case $:e="ENVMAP_BLENDING_MULTIPLY";break;case K:e="ENVMAP_BLENDING_MIX";break;case J:e="ENVMAP_BLENDING_ADD"}return e}(n),p=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e/32+1)+3,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),f=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(_a).join("\n")}(n),y=function(t){const e=[];for(const n in t){const r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(o),v=i.createProgram();let _,b,x=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(_=[y].filter(_a).join("\n"),_.length>0&&(_+="\n"),b=[f,y].filter(_a).join("\n"),b.length>0&&(b+="\n")):(_=[Pa(n),"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(_a).join("\n"),b=[f,Pa(n),"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+c:"",n.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Q?"#define TONE_MAPPING":"",n.toneMapping!==Q?ki.tonemapping_pars_fragment:"",n.toneMapping!==Q?va("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",ki.encodings_pars_fragment,ya("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(_a).join("\n")),a=Sa(a),a=ba(a,n),a=xa(a,n),s=Sa(s),s=ba(s,n),s=xa(s,n),a=Aa(a),s=Aa(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(x="#version 300 es\n",_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+_,b=["#define varying in",n.glslVersion===Pe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Pe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+b);const w=x+b+s,S=da(i,35633,x+_+a),E=da(i,35632,w);if(i.attachShader(v,S),i.attachShader(v,E),void 0!==n.index0AttributeName?i.bindAttribLocation(v,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v),t.debug.checkShaderErrors){const t=i.getProgramInfoLog(v).trim(),e=i.getShaderInfoLog(S).trim(),n=i.getShaderInfoLog(E).trim();let r=!0,o=!0;if(!1===i.getProgramParameter(v,35714)){r=!1;const e=ga(i,S,"vertex"),n=ga(i,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+n)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==n||(o=!1);o&&(this.diagnostics={runnable:r,programLog:t,vertexShader:{log:e,prefix:_},fragmentShader:{log:n,prefix:b}})}let M,T;return i.deleteShader(S),i.deleteShader(E),this.getUniforms=function(){return void 0===M&&(M=new fa(i,v)),M},this.getAttributes=function(){return void 0===T&&(T=function(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i<r;i++){const r=t.getActiveAttrib(e,i),o=r.name;let a=1;35674===r.type&&(a=2),35675===r.type&&(a=3),35676===r.type&&(a=4),n[o]={type:r.type,location:t.getAttribLocation(e,o),locationSize:a}}return n}(i,v)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.name=n.shaderName,this.id=ma++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=E,this}let La=0;class Ia{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,r=this._getShaderStage(e),i=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return!1===o.has(r)&&(o.add(r),r.usedTimes++),!1===o.has(i)&&(o.add(i),i.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;return!1===e.has(t)&&e.set(t,new Set),e.get(t)}_getShaderStage(t){const e=this.shaderCache;if(!1===e.has(t)){const n=new Ra(t);e.set(t,n)}return e.get(t)}}class Ra{constructor(t){this.id=La++,this.code=t,this.usedTimes=0}}function Da(t,e,n,r,i,o,a){const s=new nr,u=new Ia,l=[],c=i.isWebGL2,h=i.logarithmicDepthBuffer,p=i.floatVertexTextures,f=i.maxVertexUniforms,d=i.vertexTextures;let m=i.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(o,s,l,y,b){const w=y.fog,S=b.geometry,E=o.isMeshStandardMaterial?y.environment:null,M=(o.isMeshStandardMaterial?n:e).get(o.envMap||E),T=M&&M.mapping===lt?M.image.height:null,A=g[o.type],C=b.isSkinnedMesh?function(t){const e=t.skeleton.bones;if(p)return 1024;{const t=f,n=Math.floor((t-20)/4),r=Math.min(n,e.length);return r<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+r+"."),0):r}}(b):0;null!==o.precision&&(m=i.getMaxPrecision(o.precision),m!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",m,"instead."));const O=S.morphAttributes.position||S.morphAttributes.normal||S.morphAttributes.color,P=void 0!==O?O.length:0;let k,L,I,R,D=0;if(void 0!==S.morphAttributes.position&&(D=1),void 0!==S.morphAttributes.normal&&(D=2),void 0!==S.morphAttributes.color&&(D=3),A){const t=Ii[A];k=t.vertexShader,L=t.fragmentShader}else k=o.vertexShader,L=o.fragmentShader,u.update(o),I=u.getVertexShaderID(o),R=u.getFragmentShaderID(o);const N=t.getRenderTarget(),F=o.alphaTest>0,z=o.clearcoat>0;return{isWebGL2:c,shaderID:A,shaderName:o.type,vertexShader:k,fragmentShader:L,defines:o.defines,customVertexShaderID:I,customFragmentShaderID:R,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:m,instancing:!0===b.isInstancedMesh,instancingColor:!0===b.isInstancedMesh&&null!==b.instanceColor,supportsVertexTextures:d,outputEncoding:null===N?t.outputEncoding:!0===N.isXRRenderTarget?N.texture.encoding:be,map:!!o.map,matcap:!!o.matcap,envMap:!!M,envMapMode:M&&M.mapping,envMapCubeUVHeight:T,lightMap:!!o.lightMap,aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,objectSpaceNormalMap:o.normalMapType===Ee,tangentSpaceNormalMap:o.normalMapType===Se,decodeVideoTexture:!!o.map&&!0===o.map.isVideoTexture&&o.map.encoding===xe,clearcoat:z,clearcoatMap:z&&!!o.clearcoatMap,clearcoatRoughnessMap:z&&!!o.clearcoatRoughnessMap,clearcoatNormalMap:z&&!!o.clearcoatNormalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,specularIntensityMap:!!o.specularIntensityMap,specularColorMap:!!o.specularColorMap,opaque:!1===o.transparent&&o.blending===x,alphaMap:!!o.alphaMap,alphaTest:F,gradientMap:!!o.gradientMap,sheen:o.sheen>0,sheenColorMap:!!o.sheenColorMap,sheenRoughnessMap:!!o.sheenRoughnessMap,transmission:o.transmission>0,transmissionMap:!!o.transmissionMap,thicknessMap:!!o.thicknessMap,combine:o.combine,vertexTangents:!!o.normalMap&&!!S.attributes.tangent,vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!S.attributes.color&&4===S.attributes.color.itemSize,vertexUvs:!!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatMap||o.clearcoatRoughnessMap||o.clearcoatNormalMap||o.displacementMap||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularColorMap||o.sheenColorMap||o.sheenRoughnessMap),uvsVertexOnly:!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||o.transmission>0||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularColorMap||o.sheen>0||o.sheenColorMap||o.sheenRoughnessMap||!o.displacementMap),fog:!!w,useFog:o.fog,fogExp2:w&&w.isFogExp2,flatShading:!!o.flatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===b.isSkinnedMesh&&C>0,maxBones:C,useVertexTexture:p,morphTargets:void 0!==S.morphAttributes.position,morphNormals:void 0!==S.morphAttributes.normal,morphColors:void 0!==S.morphAttributes.color,morphTargetsCount:P,morphTextureStride:D,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:o.dithering,shadowMapEnabled:t.shadowMap.enabled&&l.length>0,shadowMapType:t.shadowMap.type,toneMapping:o.toneMapped?t.toneMapping:Q,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,doubleSided:o.side===_,flipSided:o.side===v,depthPacking:void 0!==o.depthPacking&&o.depthPacking,index0AttributeName:o.index0AttributeName,extensionDerivatives:o.extensions&&o.extensions.derivatives,extensionFragDepth:o.extensions&&o.extensions.fragDepth,extensionDrawBuffers:o.extensions&&o.extensions.drawBuffers,extensionShaderTextureLOD:o.extensions&&o.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||r.has("EXT_shader_texture_lod"),customProgramCacheKey:o.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(function(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.maxBones),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection)}(n,e),function(t,e){s.disableAll(),e.isWebGL2&&s.enable(0),e.supportsVertexTextures&&s.enable(1),e.instancing&&s.enable(2),e.instancingColor&&s.enable(3),e.map&&s.enable(4),e.matcap&&s.enable(5),e.envMap&&s.enable(6),e.lightMap&&s.enable(7),e.aoMap&&s.enable(8),e.emissiveMap&&s.enable(9),e.bumpMap&&s.enable(10),e.normalMap&&s.enable(11),e.objectSpaceNormalMap&&s.enable(12),e.tangentSpaceNormalMap&&s.enable(13),e.clearcoat&&s.enable(14),e.clearcoatMap&&s.enable(15),e.clearcoatRoughnessMap&&s.enable(16),e.clearcoatNormalMap&&s.enable(17),e.displacementMap&&s.enable(18),e.specularMap&&s.enable(19),e.roughnessMap&&s.enable(20),e.metalnessMap&&s.enable(21),e.gradientMap&&s.enable(22),e.alphaMap&&s.enable(23),e.alphaTest&&s.enable(24),e.vertexColors&&s.enable(25),e.vertexAlphas&&s.enable(26),e.vertexUvs&&s.enable(27),e.vertexTangents&&s.enable(28),e.uvsVertexOnly&&s.enable(29),e.fog&&s.enable(30),t.push(s.mask),s.disableAll(),e.useFog&&s.enable(0),e.flatShading&&s.enable(1),e.logarithmicDepthBuffer&&s.enable(2),e.skinning&&s.enable(3),e.useVertexTexture&&s.enable(4),e.morphTargets&&s.enable(5),e.morphNormals&&s.enable(6),e.morphColors&&s.enable(7),e.premultipliedAlpha&&s.enable(8),e.shadowMapEnabled&&s.enable(9),e.physicallyCorrectLights&&s.enable(10),e.doubleSided&&s.enable(11),e.flipSided&&s.enable(12),e.depthPacking&&s.enable(13),e.dithering&&s.enable(14),e.specularIntensityMap&&s.enable(15),e.specularColorMap&&s.enable(16),e.transmission&&s.enable(17),e.transmissionMap&&s.enable(18),e.thicknessMap&&s.enable(19),e.sheen&&s.enable(20),e.sheenColorMap&&s.enable(21),e.sheenRoughnessMap&&s.enable(22),e.decodeVideoTexture&&s.enable(23),e.opaque&&s.enable(24),t.push(s.mask)}(n,e),n.push(t.outputEncoding)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=g[t.type];let n;if(e){const t=Ii[e];n=fi.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let r;for(let t=0,e=l.length;t<e;t++){const e=l[t];if(e.cacheKey===n){r=e,++r.usedTimes;break}}return void 0===r&&(r=new ka(t,n,e,o),l.push(r)),r},releaseProgram:function(t){if(0==--t.usedTimes){const e=l.indexOf(t);l[e]=l[l.length-1],l.pop(),t.destroy()}},releaseShaderCache:function(t){u.remove(t)},programs:l,dispose:function(){u.dispose()}}}function Na(){let t=new WeakMap;return{get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}}function Fa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function za(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ba(){const t=[];let e=0;const n=[],r=[],i=[];function o(n,r,i,o,a,s){let u=t[e];return void 0===u?(u={id:n.id,object:n,geometry:r,material:i,groupOrder:o,renderOrder:n.renderOrder,z:a,group:s},t[e]=u):(u.id=n.id,u.object=n,u.geometry=r,u.material=i,u.groupOrder=o,u.renderOrder=n.renderOrder,u.z=a,u.group=s),e++,u}return{opaque:n,transmissive:r,transparent:i,init:function(){e=0,n.length=0,r.length=0,i.length=0},push:function(t,e,a,s,u,l){const c=o(t,e,a,s,u,l);a.transmission>0?r.push(c):!0===a.transparent?i.push(c):n.push(c)},unshift:function(t,e,a,s,u,l){const c=o(t,e,a,s,u,l);a.transmission>0?r.unshift(c):!0===a.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=e,r=t.length;n<r;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||Fa),r.length>1&&r.sort(e||za),i.length>1&&i.sort(e||za)}}}function ja(){let t=new WeakMap;return{get:function(e,n){let r;return!1===t.has(e)?(r=new Ba,t.set(e,[r])):n>=t.get(e).length?(r=new Ba,t.get(e).push(r)):r=t.get(e)[n],r},dispose:function(){t=new WeakMap}}}function Ua(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new dn,color:new en};break;case"SpotLight":n={position:new dn,direction:new dn,color:new en,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new dn,color:new en,distance:0,decay:0};break;case"HemisphereLight":n={direction:new dn,skyColor:new en,groundColor:new en};break;case"RectAreaLight":n={color:new en,position:new dn,halfWidth:new dn,halfHeight:new dn}}return t[e.id]=n,n}}}let Za=0;function Va(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Ga(t,e){const n=new Ua,r=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ue};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ue,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)i.probe.push(new dn);const o=new dn,a=new Hn,s=new Hn;return{setup:function(o,a){let s=0,u=0,l=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let c=0,h=0,p=0,f=0,d=0,m=0,g=0,y=0;o.sort(Va);const v=!0!==a?Math.PI:1;for(let t=0,e=o.length;t<e;t++){const e=o[t],a=e.color,_=e.intensity,b=e.distance,x=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)s+=a.r*_*v,u+=a.g*_*v,l+=a.b*_*v;else if(e.isLightProbe)for(let t=0;t<9;t++)i.probe[t].addScaledVector(e.sh.coefficients[t],_);else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*v),e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.directionalShadow[c]=n,i.directionalShadowMap[c]=x,i.directionalShadowMatrix[c]=e.shadow.matrix,m++}i.directional[c]=t,c++}else if(e.isSpotLight){const t=n.get(e);if(t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(a).multiplyScalar(_*v),t.distance=b,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.spotShadow[p]=n,i.spotShadowMap[p]=x,i.spotShadowMatrix[p]=e.shadow.matrix,y++}i.spot[p]=t,p++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(a).multiplyScalar(_),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),i.rectArea[f]=t,f++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*v),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,i.pointShadow[h]=n,i.pointShadowMap[h]=x,i.pointShadowMatrix[h]=e.shadow.matrix,g++}i.point[h]=t,h++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(_*v),t.groundColor.copy(e.groundColor).multiplyScalar(_*v),i.hemi[d]=t,d++}}f>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=Li.LTC_FLOAT_1,i.rectAreaLTC2=Li.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Li.LTC_HALF_1,i.rectAreaLTC2=Li.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=s,i.ambient[1]=u,i.ambient[2]=l;const _=i.hash;_.directionalLength===c&&_.pointLength===h&&_.spotLength===p&&_.rectAreaLength===f&&_.hemiLength===d&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===y||(i.directional.length=c,i.spot.length=p,i.rectArea.length=f,i.point.length=h,i.hemi.length=d,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=y,i.spotShadowMap.length=y,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=g,i.spotShadowMatrix.length=y,_.directionalLength=c,_.pointLength=h,_.spotLength=p,_.rectAreaLength=f,_.hemiLength=d,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=y,i.version=Za++)},setupView:function(t,e){let n=0,r=0,u=0,l=0,c=0;const h=e.matrixWorldInverse;for(let e=0,p=t.length;e<p;e++){const p=t[e];if(p.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(p.matrixWorld),o.setFromMatrixPosition(p.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(h),n++}else if(p.isSpotLight){const t=i.spot[u];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(h),t.direction.setFromMatrixPosition(p.matrixWorld),o.setFromMatrixPosition(p.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(h),u++}else if(p.isRectAreaLight){const t=i.rectArea[l];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(h),s.identity(),a.copy(p.matrixWorld),a.premultiply(h),s.extractRotation(a),t.halfWidth.set(.5*p.width,0,0),t.halfHeight.set(0,.5*p.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),l++}else if(p.isPointLight){const t=i.point[r];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(h),r++}else if(p.isHemisphereLight){const t=i.hemi[c];t.direction.setFromMatrixPosition(p.matrixWorld),t.direction.transformDirection(h),t.direction.normalize(),c++}}},state:i}}function Ha(t,e){const n=new Ga(t,e),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(t){n.setup(r,t)},setupLightsView:function(t){n.setupView(r,t)},pushLight:function(t){r.push(t)},pushShadow:function(t){i.push(t)}}}function Wa(t,e){let n=new WeakMap;return{get:function(r,i=0){let o;return!1===n.has(r)?(o=new Ha(t,e),n.set(r,[o])):i>=n.get(r).length?(o=new Ha(t,e),n.get(r).push(o)):o=n.get(r)[i],o},dispose:function(){n=new WeakMap}}}class qa extends Or{constructor(t){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}qa.prototype.isMeshDepthMaterial=!0;class Ya extends Or{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new dn,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}Ya.prototype.isMeshDistanceMaterial=!0;const Xa="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",$a="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function Ka(t,e,n){let r=new Ai;const i=new Ue,o=new Ue,a=new ln,s=new qa({depthPacking:we}),u=new Ya,l={},c=n.maxTextureSize,h={0:v,1:y,2:_},p=new di({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ue},radius:{value:4}},vertexShader:Xa,fragmentShader:$a}),f=p.clone();f.defines.HORIZONTAL_PASS=1;const m=new Gr;m.setAttribute("position",new Ir(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new ui(m,p),w=this;function S(n,r){const i=e.update(x);p.defines.VSM_SAMPLES!==n.blurSamples&&(p.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,p.needsUpdate=!0,f.needsUpdate=!0),p.uniforms.shadow_pass.value=n.map.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,p,x,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,f,x,null)}function E(e,n,r,i,o,a){let c=null;const p=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(c=void 0!==p?p:!0===r.isPointLight?u:s,t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const t=c.uuid,e=n.uuid;let r=l[t];void 0===r&&(r={},l[t]=r);let i=r[e];void 0===i&&(i=c.clone(),r[e]=i),c=i}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=a===g?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],c.alphaMap=n.alphaMap,c.alphaTest=n.alphaTest,c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.displacementMap=n.displacementMap,c.displacementScale=n.displacementScale,c.displacementBias=n.displacementBias,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,!0===r.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(r.matrixWorld),c.nearDistance=i,c.farDistance=o),c}function M(n,i,o,a,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===g)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const r=e.update(n),i=n.material;if(Array.isArray(i)){const e=r.groups;for(let u=0,l=e.length;u<l;u++){const l=e[u],c=i[l.materialIndex];if(c&&c.visible){const e=E(n,c,a,o.near,o.far,s);t.renderBufferDirect(o,null,r,e,n,l)}}}else if(i.visible){const e=E(n,i,a,o.near,o.far,s);t.renderBufferDirect(o,null,r,e,n,null)}}const u=n.children;for(let t=0,e=u.length;t<e;t++)M(u[t],i,o,a,s)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=d,this.render=function(e,n,s){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===e.length)return;const u=t.getRenderTarget(),l=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),p=t.state;p.setBlending(b),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(let u=0,l=e.length;u<l;u++){const l=e[u],h=l.shadow;if(void 0===h){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;i.copy(h.mapSize);const f=h.getFrameExtents();if(i.multiply(f),o.copy(h.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/f.x),i.x=o.x*f.x,h.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/f.y),i.y=o.y*f.y,h.mapSize.y=o.y)),null!==h.map||h.isPointLightShadow||this.type!==g||(h.map=new cn(i.x,i.y),h.map.texture.name=l.name+".shadowMap",h.mapPass=new cn(i.x,i.y),h.camera.updateProjectionMatrix()),null===h.map){const t={minFilter:ft,magFilter:ft,format:Lt};h.map=new cn(i.x,i.y,t),h.map.texture.name=l.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const d=h.getViewportCount();for(let t=0;t<d;t++){const e=h.getViewport(t);a.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),p.viewport(a),h.updateMatrices(l,t),r=h.getFrustum(),M(n,s,h.camera,l,this.type)}h.isPointLightShadow||this.type!==g||S(h,s),h.needsUpdate=!1}w.needsUpdate=!1,t.setRenderTarget(u,l,h)}}function Ja(t,e,n){const r=n.isWebGL2,i=new function(){let e=!1;const n=new ln;let r=null;const i=new ln(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,o,a,s){!0===s&&(e*=a,r*=a,o*=a),n.set(e,r,o,a),!1===i.equals(n)&&(t.clearColor(e,r,o,a),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},o=new function(){let e=!1,n=null,r=null,i=null;return{setTest:function(t){t?_t(2929):bt(2929)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case Z:t.depthFunc(512);break;case V:t.depthFunc(519);break;case G:t.depthFunc(513);break;case H:t.depthFunc(515);break;case W:t.depthFunc(514);break;case q:t.depthFunc(518);break;case Y:t.depthFunc(516);break;case X:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},a=new function(){let e=!1,n=null,r=null,i=null,o=null,a=null,s=null,u=null,l=null;return{setTest:function(t){e||(t?_t(2960):bt(2960))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&u===r||(t.stencilOp(e,n,r),a=e,s=n,u=r)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,r=null,i=null,o=null,a=null,s=null,u=null,l=null}}};let s={},u={},l=new WeakMap,c=[],d=null,m=!1,g=null,y=null,$=null,K=null,J=null,Q=null,tt=null,et=!1,nt=null,rt=null,it=null,ot=null,at=null;const st=t.getParameter(35661);let ut=!1,lt=0;const ct=t.getParameter(7938);-1!==ct.indexOf("WebGL")?(lt=parseFloat(/^WebGL (\d)/.exec(ct)[1]),ut=lt>=1):-1!==ct.indexOf("OpenGL ES")&&(lt=parseFloat(/^OpenGL ES (\d)/.exec(ct)[1]),ut=lt>=2);let ht=null,pt={};const ft=t.getParameter(3088),dt=t.getParameter(2978),mt=(new ln).fromArray(ft),gt=(new ln).fromArray(dt);function yt(e,n,r){const i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;e<r;e++)t.texImage2D(n+e,0,6408,1,1,0,6408,5121,i);return o}const vt={};function _t(e){!0!==s[e]&&(t.enable(e),s[e]=!0)}function bt(e){!1!==s[e]&&(t.disable(e),s[e]=!1)}vt[3553]=yt(3553,3553,1),vt[34067]=yt(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),a.setClear(0),_t(2929),o.setFunc(H),Et(!1),Mt(p),_t(2884),St(b);const xt={[T]:32774,[A]:32778,[C]:32779};if(r)xt[O]=32775,xt[P]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(xt[O]=t.MIN_EXT,xt[P]=t.MAX_EXT)}const wt={[k]:0,[L]:1,[I]:768,[D]:770,[U]:776,[B]:774,[F]:772,[R]:769,[N]:771,[j]:775,[z]:773};function St(e,n,r,i,o,a,s,u){if(e!==b){if(!1===m&&(_t(3042),m=!0),e===M)o=o||n,a=a||r,s=s||i,n===y&&o===J||(t.blendEquationSeparate(xt[n],xt[o]),y=n,J=o),r===$&&i===K&&a===Q&&s===tt||(t.blendFuncSeparate(wt[r],wt[i],wt[a],wt[s]),$=r,K=i,Q=a,tt=s),g=e,et=null;else if(e!==g||u!==et){if(y===T&&J===T||(t.blendEquation(32774),y=T,J=T),u)switch(e){case x:t.blendFuncSeparate(1,771,1,771);break;case w:t.blendFunc(1,1);break;case S:t.blendFuncSeparate(0,769,0,1);break;case E:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case x:t.blendFuncSeparate(770,771,1,771);break;case w:t.blendFunc(770,1);break;case S:t.blendFuncSeparate(0,769,0,1);break;case E:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}$=null,K=null,Q=null,tt=null,g=e,et=u}}else!0===m&&(bt(3042),m=!1)}function Et(e){nt!==e&&(e?t.frontFace(2304):t.frontFace(2305),nt=e)}function Mt(e){e!==h?(_t(2884),e!==rt&&(e===p?t.cullFace(1029):e===f?t.cullFace(1028):t.cullFace(1032))):bt(2884),rt=e}function Tt(e,n,r){e?(_t(32823),ot===n&&at===r||(t.polygonOffset(n,r),ot=n,at=r)):bt(32823)}function At(e){void 0===e&&(e=33984+st-1),ht!==e&&(t.activeTexture(e),ht=e)}return{buffers:{color:i,depth:o,stencil:a},enable:_t,disable:bt,bindFramebuffer:function(e,n){return u[e]!==n&&(t.bindFramebuffer(e,n),u[e]=n,r&&(36009===e&&(u[36160]=n),36160===e&&(u[36009]=n)),!0)},drawBuffers:function(r,i){let o=c,a=!1;if(r)if(o=l.get(i),void 0===o&&(o=[],l.set(i,o)),r.isWebGLMultipleRenderTargets){const t=r.texture;if(o.length!==t.length||36064!==o[0]){for(let e=0,n=t.length;e<n;e++)o[e]=36064+e;o.length=t.length,a=!0}}else 36064!==o[0]&&(o[0]=36064,a=!0);else 1029!==o[0]&&(o[0]=1029,a=!0);a&&(n.isWebGL2?t.drawBuffers(o):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(o))},useProgram:function(e){return d!==e&&(t.useProgram(e),d=e,!0)},setBlending:St,setMaterial:function(t,e){t.side===_?bt(2884):_t(2884);let n=t.side===v;e&&(n=!n),Et(n),t.blending===x&&!1===t.transparent?St(b):St(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),i.setMask(t.colorWrite);const r=t.stencilWrite;a.setTest(r),r&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Tt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?_t(32926):bt(32926)},setFlipSided:Et,setCullFace:Mt,setLineWidth:function(e){e!==it&&(ut&&t.lineWidth(e),it=e)},setPolygonOffset:Tt,setScissorTest:function(t){t?_t(3089):bt(3089)},activeTexture:At,bindTexture:function(e,n){null===ht&&At();let r=pt[ht];void 0===r&&(r={type:void 0,texture:void 0},pt[ht]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||vt[e]),r.type=e,r.texture=n)},unbindTexture:function(){const e=pt[ht];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===mt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),mt.copy(e))},viewport:function(e){!1===gt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),gt.copy(e))},reset:function(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),!0===r&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),s={},ht=null,pt={},u={},l=new WeakMap,c=[],d=null,m=!1,g=null,y=null,$=null,K=null,J=null,Q=null,tt=null,et=!1,nt=null,rt=null,it=null,ot=null,at=null,mt.set(0,0,t.canvas.width,t.canvas.height),gt.set(0,0,t.canvas.width,t.canvas.height),i.reset(),o.reset(),a.reset()}}}function Qa(t,e,n,r,i,o,a){const s=i.isWebGL2,u=i.maxTextures,l=i.maxCubemapSize,c=i.maxTextureSize,h=i.maxSamples,p=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,f=/OculusBrowser/g.test(navigator.userAgent),d=new WeakMap;let m;const g=new WeakMap;let y=!1;try{y="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function v(t,e){return y?new OffscreenCanvas(t,e):Ge("canvas")}function _(t,e,n,r){let i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const r=e?je:Math.floor,o=r(i*t.width),a=r(i*t.height);void 0===m&&(m=v(o,a));const s=n?v(o,a):m;return s.width=o,s.height=a,s.getContext("2d").drawImage(t,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+a+")."),s}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function b(t){return Be(t.width)&&Be(t.height)}function x(t,e){return t.generateMipmaps&&e&&t.minFilter!==ft&&t.minFilter!==gt}function w(e){t.generateMipmap(e)}function S(n,r,i,o,a=!1){if(!1===s)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let u=r;return 6403===r&&(5126===i&&(u=33326),5131===i&&(u=33325),5121===i&&(u=33321)),33319===r&&(5126===i&&(u=33328),5131===i&&(u=33327),5121===i&&(u=33323)),6408===r&&(5126===i&&(u=34836),5131===i&&(u=34842),5121===i&&(u=o===xe&&!1===a?35907:32856),32819===i&&(u=32854),32820===i&&(u=32855)),33325!==u&&33326!==u&&33327!==u&&33328!==u&&34842!==u&&34836!==u||e.get("EXT_color_buffer_float"),u}function E(t,e,n){return!0===x(t,n)||t.isFramebufferTexture&&t.minFilter!==ft&&t.minFilter!==gt?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function M(t){return t===ft||t===dt||t===mt?9728:9729}function T(t){const e=t.target;e.removeEventListener("dispose",T),function(t){const e=r.get(t);if(void 0===e.__webglInit)return;const n=t.source,i=g.get(n);if(i){const r=i[e.__cacheKey];r.usedTimes--,0===r.usedTimes&&C(t),0===Object.keys(i).length&&g.delete(n)}r.remove(t)}(e),e.isVideoTexture&&d.delete(e)}function A(e){const n=e.target;n.removeEventListener("dispose",A),function(e){const n=e.texture,i=r.get(e),o=r.get(n);if(void 0!==o.__webglTexture&&(t.deleteTexture(o.__webglTexture),a.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(i.__webglFramebuffer[e]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[e]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&t.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,i=n.length;e<i;e++){const i=r.get(n[e]);i.__webglTexture&&(t.deleteTexture(i.__webglTexture),a.memory.textures--),r.remove(n[e])}r.remove(n),r.remove(e)}(n)}function C(e){const n=r.get(e);t.deleteTexture(n.__webglTexture);const i=e.source;delete g.get(i)[n.__cacheKey],a.memory.textures--}let O=0;function P(t,e){const i=r.get(t);if(t.isVideoTexture&&function(t){const e=a.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&i.__version!==t.version){const n=t.image;if(null===n)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==n.complete)return void D(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}const k={[ct]:10497,[ht]:33071,[pt]:33648},L={[ft]:9728,[dt]:9984,[mt]:9986,[gt]:9729,[yt]:9985,[vt]:9987};function I(n,o,a){if(a?(t.texParameteri(n,10242,k[o.wrapS]),t.texParameteri(n,10243,k[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,k[o.wrapR]),t.texParameteri(n,10240,L[o.magFilter]),t.texParameteri(n,10241,L[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),o.wrapS===ht&&o.wrapT===ht||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,M(o.magFilter)),t.texParameteri(n,10241,M(o.minFilter)),o.minFilter!==ft&&o.minFilter!==gt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(o.type===Mt&&!1===e.has("OES_texture_float_linear"))return;if(!1===s&&o.type===Tt&&!1===e.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function R(e,n){let r=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",T));const i=n.source;let o=g.get(i);void 0===o&&(o={},g.set(i,o));const s=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.encoding),e.join()}(n);if(s!==e.__cacheKey){void 0===o[s]&&(o[s]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,r=!0),o[s].usedTimes++;const i=o[e.__cacheKey];void 0!==i&&(o[e.__cacheKey].usedTimes--,0===i.usedTimes&&C(n)),e.__cacheKey=s,e.__webglTexture=o[s].texture}return r}function D(e,r,i){let a=3553;r.isDataArrayTexture&&(a=35866),r.isData3DTexture&&(a=32879);const u=R(e,r),l=r.source;if(n.activeTexture(33984+i),n.bindTexture(a,e.__webglTexture),l.version!==l.__currentVersion||!0===u){t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);const i=function(t){return!s&&(t.wrapS!==ht||t.wrapT!==ht||t.minFilter!==ft&&t.minFilter!==gt)}(r)&&!1===b(r.image);let u=_(r.image,i,!1,c);u=U(r,u);const h=b(u)||s,p=o.convert(r.format,r.encoding);let f,d=o.convert(r.type),m=S(r.internalFormat,p,d,r.encoding,r.isVideoTexture);I(a,r,h);const g=r.mipmaps,y=s&&!0!==r.isVideoTexture,v=void 0===e.__version,M=E(r,u,h);if(r.isDepthTexture)m=6402,s?m=r.type===Mt?36012:r.type===Et?33190:r.type===Ot?35056:33189:r.type===Mt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Dt&&6402===m&&r.type!==wt&&r.type!==Et&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=wt,d=o.convert(r.type)),r.format===Nt&&6402===m&&(m=34041,r.type!==Ot&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ot,d=o.convert(r.type))),y&&v?n.texStorage2D(3553,1,m,u.width,u.height):n.texImage2D(3553,0,m,u.width,u.height,0,p,d,null);else if(r.isDataTexture)if(g.length>0&&h){y&&v&&n.texStorage2D(3553,M,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)f=g[t],y?n.texSubImage2D(3553,t,0,0,f.width,f.height,p,d,f.data):n.texImage2D(3553,t,m,f.width,f.height,0,p,d,f.data);r.generateMipmaps=!1}else y?(v&&n.texStorage2D(3553,M,m,u.width,u.height),n.texSubImage2D(3553,0,0,0,u.width,u.height,p,d,u.data)):n.texImage2D(3553,0,m,u.width,u.height,0,p,d,u.data);else if(r.isCompressedTexture){y&&v&&n.texStorage2D(3553,M,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)f=g[t],r.format!==Lt?null!==p?y?n.compressedTexSubImage2D(3553,t,0,0,f.width,f.height,p,f.data):n.compressedTexImage2D(3553,t,m,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):y?n.texSubImage2D(3553,t,0,0,f.width,f.height,p,d,f.data):n.texImage2D(3553,t,m,f.width,f.height,0,p,d,f.data)}else if(r.isDataArrayTexture)y?(v&&n.texStorage3D(35866,M,m,u.width,u.height,u.depth),n.texSubImage3D(35866,0,0,0,0,u.width,u.height,u.depth,p,d,u.data)):n.texImage3D(35866,0,m,u.width,u.height,u.depth,0,p,d,u.data);else if(r.isData3DTexture)y?(v&&n.texStorage3D(32879,M,m,u.width,u.height,u.depth),n.texSubImage3D(32879,0,0,0,0,u.width,u.height,u.depth,p,d,u.data)):n.texImage3D(32879,0,m,u.width,u.height,u.depth,0,p,d,u.data);else if(r.isFramebufferTexture)y&&v?n.texStorage2D(3553,M,m,u.width,u.height):n.texImage2D(3553,0,m,u.width,u.height,0,p,d,null);else if(g.length>0&&h){y&&v&&n.texStorage2D(3553,M,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)f=g[t],y?n.texSubImage2D(3553,t,0,0,p,d,f):n.texImage2D(3553,t,m,p,d,f);r.generateMipmaps=!1}else y?(v&&n.texStorage2D(3553,M,m,u.width,u.height),n.texSubImage2D(3553,0,0,0,p,d,u)):n.texImage2D(3553,0,m,p,d,u);x(r,h)&&w(a),l.__currentVersion=l.version,r.onUpdate&&r.onUpdate(r)}e.__version=r.version}function N(e,i,a,s,u){const l=o.convert(a.format,a.encoding),c=o.convert(a.type),h=S(a.internalFormat,l,c,a.encoding);r.get(i).__hasExternalTextures||(32879===u||35866===u?n.texImage3D(u,0,h,i.width,i.height,i.depth,0,l,c,null):n.texImage2D(u,0,h,i.width,i.height,0,l,c,null)),n.bindFramebuffer(36160,e),j(i)?p.framebufferTexture2DMultisampleEXT(36160,s,u,r.get(a).__webglTexture,0,B(i)):t.framebufferTexture2D(36160,s,u,r.get(a).__webglTexture,0),n.bindFramebuffer(36160,null)}function F(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){let i=33189;if(r||j(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===Mt?i=36012:e.type===Et&&(i=33190));const r=B(n);j(n)?p.renderbufferStorageMultisampleEXT(36161,r,i,n.width,n.height):t.renderbufferStorageMultisample(36161,r,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){const i=B(n);r&&!1===j(n)?t.renderbufferStorageMultisample(36161,i,35056,n.width,n.height):j(n)?p.renderbufferStorageMultisampleEXT(36161,i,35056,n.width,n.height):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture[0]:n.texture,i=o.convert(e.format,e.encoding),a=o.convert(e.type),s=S(e.internalFormat,i,a,e.encoding),u=B(n);r&&!1===j(n)?t.renderbufferStorageMultisample(36161,u,s,n.width,n.height):j(n)?p.renderbufferStorageMultisampleEXT(36161,u,s,n.width,n.height):t.renderbufferStorage(36161,s,n.width,n.height)}t.bindRenderbuffer(36161,null)}function z(e){const i=r.get(e),o=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!i.__autoAllocateDepthBuffer){if(o)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),P(i.depthTexture,0);const o=r.get(i.depthTexture).__webglTexture,a=B(i);if(i.depthTexture.format===Dt)j(i)?p.framebufferTexture2DMultisampleEXT(36160,36096,3553,o,0,a):t.framebufferTexture2D(36160,36096,3553,o,0);else{if(i.depthTexture.format!==Nt)throw new Error("Unknown depthTexture format");j(i)?p.framebufferTexture2DMultisampleEXT(36160,33306,3553,o,0,a):t.framebufferTexture2D(36160,33306,3553,o,0)}}(i.__webglFramebuffer,e)}else if(o){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(36160,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=t.createRenderbuffer(),F(i.__webglDepthbuffer[r],e,!1)}else n.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),F(i.__webglDepthbuffer,e,!1);n.bindFramebuffer(36160,null)}function B(t){return Math.min(h,t.samples)}function j(t){const n=r.get(t);return s&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function U(t,n){const r=t.encoding,i=t.format,o=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===ke||r!==be&&(r===xe?!1===s?!0===e.has("EXT_sRGB")&&i===Lt?(t.format=ke,t.minFilter=gt,t.generateMipmaps=!1):n=rn.sRGBToLinear(n):i===Lt&&o===_t||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",r)),n}this.allocateTextureUnit=function(){const t=O;return t>=u&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+u),O+=1,t},this.resetTextureUnits=function(){O=0},this.setTexture2D=P,this.setTexture2DArray=function(t,e){const i=r.get(t);t.version>0&&i.__version!==t.version?D(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){const i=r.get(t);t.version>0&&i.__version!==t.version?D(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?function(e,r,i){if(6!==r.image.length)return;const a=R(e,r),u=r.source;if(n.activeTexture(33984+i),n.bindTexture(34067,e.__webglTexture),u.version!==u.__currentVersion||!0===a){t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);const i=r.isCompressedTexture||r.image[0].isCompressedTexture,a=r.image[0]&&r.image[0].isDataTexture,c=[];for(let t=0;t<6;t++)c[t]=i||a?a?r.image[t].image:r.image[t]:_(r.image[t],!1,!0,l),c[t]=U(r,c[t]);const h=c[0],p=b(h)||s,f=o.convert(r.format,r.encoding),d=o.convert(r.type),m=S(r.internalFormat,f,d,r.encoding),g=s&&!0!==r.isVideoTexture,y=void 0===e.__version;let v,M=E(r,h,p);if(I(34067,r,p),i){g&&y&&n.texStorage2D(34067,M,m,h.width,h.height);for(let t=0;t<6;t++){v=c[t].mipmaps;for(let e=0;e<v.length;e++){const i=v[e];r.format!==Lt?null!==f?g?n.compressedTexSubImage2D(34069+t,e,0,0,i.width,i.height,f,i.data):n.compressedTexImage2D(34069+t,e,m,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g?n.texSubImage2D(34069+t,e,0,0,i.width,i.height,f,d,i.data):n.texImage2D(34069+t,e,m,i.width,i.height,0,f,d,i.data)}}}else{v=r.mipmaps,g&&y&&(v.length>0&&M++,n.texStorage2D(34067,M,m,c[0].width,c[0].height));for(let t=0;t<6;t++)if(a){g?n.texSubImage2D(34069+t,0,0,0,c[t].width,c[t].height,f,d,c[t].data):n.texImage2D(34069+t,0,m,c[t].width,c[t].height,0,f,d,c[t].data);for(let e=0;e<v.length;e++){const r=v[e].image[t].image;g?n.texSubImage2D(34069+t,e+1,0,0,r.width,r.height,f,d,r.data):n.texImage2D(34069+t,e+1,m,r.width,r.height,0,f,d,r.data)}}else{g?n.texSubImage2D(34069+t,0,0,0,f,d,c[t]):n.texImage2D(34069+t,0,m,f,d,c[t]);for(let e=0;e<v.length;e++){const r=v[e];g?n.texSubImage2D(34069+t,e+1,0,0,f,d,r.image[t]):n.texImage2D(34069+t,e+1,m,f,d,r.image[t])}}}x(r,p)&&w(34067),u.__currentVersion=u.version,r.onUpdate&&r.onUpdate(r)}e.__version=r.version}(a,e,i):(n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture))},this.rebindTextures=function(t,e,n){const i=r.get(t);void 0!==e&&N(i.__webglFramebuffer,t,t.texture,36064,3553),void 0!==n&&z(t)},this.setupRenderTarget=function(e){const u=e.texture,l=r.get(e),c=r.get(u);e.addEventListener("dispose",A),!0!==e.isWebGLMultipleRenderTargets&&(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=u.version,a.memory.textures++);const h=!0===e.isWebGLCubeRenderTarget,p=!0===e.isWebGLMultipleRenderTargets,f=b(e)||s;if(h){l.__webglFramebuffer=[];for(let e=0;e<6;e++)l.__webglFramebuffer[e]=t.createFramebuffer()}else if(l.__webglFramebuffer=t.createFramebuffer(),p)if(i.drawBuffers){const n=e.texture;for(let e=0,i=n.length;e<i;e++){const i=r.get(n[e]);void 0===i.__webglTexture&&(i.__webglTexture=t.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(s&&e.samples>0&&!1===j(e)){l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,l.__webglColorRenderbuffer);const r=o.convert(u.format,u.encoding),i=o.convert(u.type),a=S(u.internalFormat,r,i,u.encoding),s=B(e);t.renderbufferStorageMultisample(36161,s,a,e.width,e.height),n.bindFramebuffer(36160,l.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,l.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),F(l.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(36160,null)}if(h){n.bindTexture(34067,c.__webglTexture),I(34067,u,f);for(let t=0;t<6;t++)N(l.__webglFramebuffer[t],e,u,36064,34069+t);x(u,f)&&w(34067),n.unbindTexture()}else if(p){const t=e.texture;for(let i=0,o=t.length;i<o;i++){const o=t[i],a=r.get(o);n.bindTexture(3553,a.__webglTexture),I(3553,o,f),N(l.__webglFramebuffer,e,o,36064+i,3553),x(o,f)&&w(3553)}n.unbindTexture()}else{let t=3553;(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(s?t=e.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(t,c.__webglTexture),I(t,u,f),N(l.__webglFramebuffer,e,u,36064,t),x(u,f)&&w(t),n.unbindTexture()}e.depthBuffer&&z(e)},this.updateRenderTargetMipmap=function(t){const e=b(t)||s,i=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let o=0,a=i.length;o<a;o++){const a=i[o];if(x(a,e)){const e=t.isWebGLCubeRenderTarget?34067:3553,i=r.get(a).__webglTexture;n.bindTexture(e,i),w(e),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(s&&e.samples>0&&!1===j(e)){const i=e.width,o=e.height;let a=16384;const s=[36064],u=e.stencilBuffer?33306:36096;e.depthBuffer&&s.push(u);const l=r.get(e),c=void 0!==l.__ignoreDepthValues&&l.__ignoreDepthValues;!1===c&&(e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024)),n.bindFramebuffer(36008,l.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,l.__webglFramebuffer),!0===c&&(t.invalidateFramebuffer(36008,[u]),t.invalidateFramebuffer(36009,[u])),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),f&&t.invalidateFramebuffer(36008,s),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,l.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=z,this.setupFrameBufferTexture=N,this.useMultisampledRTT=j}function ts(t,e,n){const r=n.isWebGL2;return{convert:function(t,n=null){let i;if(t===_t)return 5121;if(t===At)return 32819;if(t===Ct)return 32820;if(t===bt)return 5120;if(t===xt)return 5122;if(t===wt)return 5123;if(t===St)return 5124;if(t===Et)return 5125;if(t===Mt)return 5126;if(t===Tt)return r?5131:(i=e.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(t===Pt)return 6406;if(t===Lt)return 6408;if(t===It)return 6409;if(t===Rt)return 6410;if(t===Dt)return 6402;if(t===Nt)return 34041;if(t===Ft)return 6403;if(t===kt)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(t===ke)return i=e.get("EXT_sRGB"),null!==i?i.SRGB_ALPHA_EXT:null;if(t===zt)return 36244;if(t===Bt)return 33319;if(t===jt)return 33320;if(t===Ut)return 36249;if(t===Zt||t===Vt||t===Gt||t===Ht)if(n===xe){if(i=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(t===Zt)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(t===Vt)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(t===Gt)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(t===Ht)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=e.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(t===Zt)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Vt)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Gt)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Ht)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===Wt||t===qt||t===Yt||t===Xt){if(i=e.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(t===Wt)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===qt)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Yt)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Xt)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===$t)return i=e.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if(t===Kt||t===Jt){if(i=e.get("WEBGL_compressed_texture_etc"),null===i)return null;if(t===Kt)return n===xe?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(t===Jt)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(t===Qt||t===te||t===ee||t===ne||t===re||t===ie||t===oe||t===ae||t===se||t===ue||t===le||t===ce||t===he||t===pe){if(i=e.get("WEBGL_compressed_texture_astc"),null===i)return null;if(t===Qt)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(t===te)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(t===ee)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(t===ne)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(t===re)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(t===ie)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(t===oe)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(t===ae)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(t===se)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(t===ue)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(t===le)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(t===ce)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(t===he)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(t===pe)return n===xe?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(t===fe){if(i=e.get("EXT_texture_compression_bptc"),null===i)return null;if(t===fe)return n===xe?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT}return t===Ot?r?34042:(i=e.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class es extends gi{constructor(t=[]){super(),this.cameras=t}}es.prototype.isArrayCamera=!0;class ns extends gr{constructor(){super(),this.type="Group"}}ns.prototype.isGroup=!0;const rs={type:"move"};class is{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ns,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ns,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new dn,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new dn),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ns,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new dn,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new dn),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let r=null,i=null,o=null;const a=this._targetRay,s=this._grip,u=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(null!==a&&(r=e.getPose(t.targetRaySpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(rs))),u&&t.hand){o=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,n);if(void 0===u.joints[r.jointName]){const t=new ns;t.matrixAutoUpdate=!1,t.visible=!1,u.joints[r.jointName]=t,u.add(t)}const i=u.joints[r.jointName];null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=t.radius),i.visible=null!==t}const r=u.joints["index-finger-tip"],i=u.joints["thumb-tip"],a=r.position.distanceTo(i.position),s=.02,l=.005;u.inputState.pinching&&a>s+l?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&a<=s-l&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==s&&t.gripSpace&&(i=e.getPose(t.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==o),this}}class os extends un{constructor(t,e,n,r,i,o,a,s,u,l){if((l=void 0!==l?l:Dt)!==Dt&&l!==Nt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Dt&&(n=wt),void 0===n&&l===Nt&&(n=Ot),super(null,r,i,o,a,s,l,n,u),this.image={width:t,height:e},this.magFilter=void 0!==a?a:ft,this.minFilter=void 0!==s?s:ft,this.flipY=!1,this.generateMipmaps=!1}}os.prototype.isDepthTexture=!0;class as extends Le{constructor(t,e){super();const n=this;let r=null,i=1,o=null,a="local-floor",s=null,u=null,l=null,c=null,h=null;const p=e.getContextAttributes();let f=null,d=null;const m=[],g=new Map,y=new gi;y.layers.enable(1),y.viewport=new ln;const v=new gi;v.layers.enable(2),v.viewport=new ln;const _=[y,v],b=new es;b.layers.enable(1),b.layers.enable(2);let x=null,w=null;function S(t){const e=g.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function E(){g.forEach((function(t,e){t.disconnect(e)})),g.clear(),x=null,w=null,t.setRenderTarget(f),c=null,l=null,u=null,r=null,d=null,P.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function M(t){const e=r.inputSources;for(let t=0;t<m.length;t++)g.set(e[t],m[t]);for(let e=0;e<t.removed.length;e++){const n=t.removed[e],r=g.get(n);r&&(r.dispatchEvent({type:"disconnected",data:n}),g.delete(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e],r=g.get(n);r&&r.dispatchEvent({type:"connected",data:n})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=m[t];return void 0===e&&(e=new is,m[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=m[t];return void 0===e&&(e=new is,m[t]=e),e.getGripSpace()},this.getHand=function(t){let e=m[t];return void 0===e&&(e=new is,m[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return null!==l?l:c},this.getBinding=function(){return u},this.getFrame=function(){return h},this.getSession=function(){return r},this.setSession=async function(s){if(r=s,null!==r){if(f=t.getRenderTarget(),r.addEventListener("select",S),r.addEventListener("selectstart",S),r.addEventListener("selectend",S),r.addEventListener("squeeze",S),r.addEventListener("squeezestart",S),r.addEventListener("squeezeend",S),r.addEventListener("end",E),r.addEventListener("inputsourceschange",M),!0!==p.xrCompatible&&await e.makeXRCompatible(),void 0===r.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||p.antialias,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:i};c=new XRWebGLLayer(r,e,n),r.updateRenderState({baseLayer:c}),d=new cn(c.framebufferWidth,c.framebufferHeight,{format:Lt,type:_t,encoding:t.outputEncoding})}else{let n=null,o=null,a=null;p.depth&&(a=p.stencil?35056:33190,n=p.stencil?Nt:Dt,o=p.stencil?Ot:wt);const s={colorFormat:t.outputEncoding===xe?35907:32856,depthFormat:a,scaleFactor:i};u=new XRWebGLBinding(r,e),l=u.createProjectionLayer(s),r.updateRenderState({layers:[l]}),d=new cn(l.textureWidth,l.textureHeight,{format:Lt,type:_t,depthTexture:new os(l.textureWidth,l.textureHeight,o,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0}),t.properties.get(d).__ignoreDepthValues=l.ignoreDepthValues}d.isXRRenderTarget=!0,this.setFoveation(1),o=await r.requestReferenceSpace(a),P.setContext(r),P.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const T=new dn,A=new dn;function C(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===r)return;b.near=v.near=y.near=t.near,b.far=v.far=y.far=t.far,x===b.near&&w===b.far||(r.updateRenderState({depthNear:b.near,depthFar:b.far}),x=b.near,w=b.far);const e=t.parent,n=b.cameras;C(b,e);for(let t=0;t<n.length;t++)C(n[t],e);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),t.position.copy(b.position),t.quaternion.copy(b.quaternion),t.scale.copy(b.scale),t.matrix.copy(b.matrix),t.matrixWorld.copy(b.matrixWorld);const i=t.children;for(let t=0,e=i.length;t<e;t++)i[t].updateMatrixWorld(!0);2===n.length?function(t,e,n){T.setFromMatrixPosition(e.matrixWorld),A.setFromMatrixPosition(n.matrixWorld);const r=T.distanceTo(A),i=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),u=(i[9]+1)/i[5],l=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(o[8]+1)/o[0],p=a*c,f=a*h,d=r/(-c+h),m=d*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(d),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=a+d,y=s+d,v=p-m,_=f+(r-m),b=u*s/y*g,x=l*s/y*g;t.projectionMatrix.makePerspective(v,_,b,x,g,y)}(b,y,v):b.projectionMatrix.copy(y.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){return null!==l?l.fixedFoveation:null!==c?c.fixedFoveation:void 0},this.setFoveation=function(t){null!==l&&(l.fixedFoveation=t),null!==c&&void 0!==c.fixedFoveation&&(c.fixedFoveation=t)};let O=null;const P=new Ci;P.setAnimationLoop((function(e,n){if(s=n.getViewerPose(o),h=n,null!==s){const e=s.views;null!==c&&(t.setRenderTargetFramebuffer(d,c.framebuffer),t.setRenderTarget(d));let n=!1;e.length!==b.cameras.length&&(b.cameras.length=0,n=!0);for(let r=0;r<e.length;r++){const i=e[r];let o=null;if(null!==c)o=c.getViewport(i);else{const e=u.getViewSubImage(l,i);o=e.viewport,0===r&&(t.setRenderTargetTextures(d,e.colorTexture,l.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(d))}const a=_[r];a.matrix.fromArray(i.transform.matrix),a.projectionMatrix.fromArray(i.projectionMatrix),a.viewport.set(o.x,o.y,o.width,o.height),0===r&&b.matrix.copy(a.matrix),!0===n&&b.cameras.push(a)}}const i=r.inputSources;for(let t=0;t<m.length;t++){const e=m[t],r=i[t];e.update(r,n,o)}O&&O(e,n),h=null})),this.setAnimationLoop=function(t){O=t},this.dispose=function(){}}}function ss(t,e){function n(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,r.side===v&&(n.bumpScale.value*=-1)),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),r.side===v&&n.normalScale.value.negate()),r.specularMap&&(n.specularMap.value=r.specularMap),r.alphaTest>0&&(n.alphaTest.value=r.alphaTest);const i=e.get(r).envMap;if(i&&(n.envMap.value=i,n.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,n.reflectivity.value=r.reflectivity,n.ior.value=r.ior,n.refractionRatio.value=r.refractionRatio),r.lightMap){n.lightMap.value=r.lightMap;const e=!0!==t.physicallyCorrectLights?Math.PI:1;n.lightMapIntensity.value=r.lightMapIntensity*e}let o,a;r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?o=r.map:r.specularMap?o=r.specularMap:r.displacementMap?o=r.displacementMap:r.normalMap?o=r.normalMap:r.bumpMap?o=r.bumpMap:r.roughnessMap?o=r.roughnessMap:r.metalnessMap?o=r.metalnessMap:r.alphaMap?o=r.alphaMap:r.emissiveMap?o=r.emissiveMap:r.clearcoatMap?o=r.clearcoatMap:r.clearcoatNormalMap?o=r.clearcoatNormalMap:r.clearcoatRoughnessMap?o=r.clearcoatRoughnessMap:r.specularIntensityMap?o=r.specularIntensityMap:r.specularColorMap?o=r.specularColorMap:r.transmissionMap?o=r.transmissionMap:r.thicknessMap?o=r.thicknessMap:r.sheenColorMap?o=r.sheenColorMap:r.sheenRoughnessMap&&(o=r.sheenRoughnessMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),n.uvTransform.value.copy(o.matrix)),r.aoMap?a=r.aoMap:r.lightMap&&(a=r.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,r,i,o,a){r.isMeshBasicMaterial||r.isMeshLambertMaterial?n(t,r):r.isMeshToonMaterial?(n(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(n(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(n(t,r),function(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap);e.get(n).envMap&&(t.envMapIntensity.value=n.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,n){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap)),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===v&&t.clearcoatNormalScale.value.negate())),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}(t,r,a)):r.isMeshMatcapMaterial?(n(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?n(t,r):r.isMeshDistanceMaterial?(n(t,r),function(t,e){t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,r)):r.isMeshNormalMaterial?n(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,n,r){let i;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*r,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?i=e.map:e.alphaMap&&(i=e.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,r,i,o):r.isSpriteMaterial?function(t,e){let n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function us(t={}){const e=void 0!==t.canvas?t.canvas:function(){const t=Ge("canvas");return t.style.display="block",t}(),n=void 0!==t.context?t.context:null,r=void 0===t.depth||t.depth,i=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,s=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let h;h=void 0!==t.context?n.getContextAttributes().alpha:void 0!==t.alpha&&t.alpha;let p=null,f=null;const d=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=be,this.physicallyCorrectLights=!1,this.toneMapping=Q,this.toneMappingExposure=1;const g=this;let b=!1,x=0,w=0,S=null,E=-1,M=null;const T=new ln,A=new ln;let C=null,O=e.width,P=e.height,k=1,L=null,I=null;const R=new ln(0,0,O,P),D=new ln(0,0,O,P);let N=!1;const F=new Ai;let z=!1,B=!1,j=null;const U=new Hn,Z=new Ue,V=new dn,G={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function H(){return null===S?k:1}let W,q,Y,X,$,K,J,tt,et,nt,rt,it,ot,at,st,ut,lt,ct,ht,pt,ft,dt,mt,gt=n;function yt(t,n){for(let r=0;r<t.length;r++){const i=t[r],o=e.getContext(i,n);if(null!==o)return o}return null}try{const t={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:s,powerPreference:u,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${l}`),e.addEventListener("webglcontextlost",wt,!1),e.addEventListener("webglcontextrestored",St,!1),null===gt){const e=["webgl2","webgl","experimental-webgl"];if(!0===g.isWebGL1Renderer&&e.shift(),gt=yt(e,t),null===gt)throw yt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===gt.getShaderPrecisionFormat&&(gt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function bt(){W=new to(gt),q=new Fi(gt,W,t),W.init(q),dt=new ts(gt,W,q),Y=new Ja(gt,W,q),X=new ro(gt),$=new Na,K=new Qa(gt,W,Y,$,q,dt,X),J=new Bi(g),tt=new Qi(g),et=new Oi(gt,q),mt=new Di(gt,W,et,q),nt=new eo(gt,et,X,mt),rt=new uo(gt,nt,et,X),ht=new so(gt,q,K),ut=new zi($),it=new Da(g,J,tt,W,q,mt,ut),ot=new ss(g,$),at=new ja,st=new Wa(W,q),ct=new Ri(g,J,Y,rt,h,a),lt=new Ka(g,rt,q),pt=new Ni(gt,W,X,q),ft=new no(gt,W,X,q),X.programs=it.programs,g.capabilities=q,g.extensions=W,g.properties=$,g.renderLists=at,g.shadowMap=lt,g.state=Y,g.info=X}bt();const xt=new as(g,gt);function wt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function St(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const t=X.autoReset,e=lt.enabled,n=lt.autoUpdate,r=lt.needsUpdate,i=lt.type;bt(),X.autoReset=t,lt.enabled=e,lt.autoUpdate=n,lt.needsUpdate=r,lt.type=i}function Et(t){const e=t.target;e.removeEventListener("dispose",Et),function(t){(function(t){const e=$.get(t).programs;void 0!==e&&(e.forEach((function(t){it.releaseProgram(t)})),t.isShaderMaterial&&it.releaseShaderCache(t))})(t),$.remove(t)}(e)}this.xr=xt,this.getContext=function(){return gt},this.getContextAttributes=function(){return gt.getContextAttributes()},this.forceContextLoss=function(){const t=W.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=W.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return k},this.setPixelRatio=function(t){void 0!==t&&(k=t,this.setSize(O,P,!1))},this.getSize=function(t){return t.set(O,P)},this.setSize=function(t,n,r){xt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(O=t,P=n,e.width=Math.floor(t*k),e.height=Math.floor(n*k),!1!==r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(O*k,P*k).floor()},this.setDrawingBufferSize=function(t,n,r){O=t,P=n,k=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(T)},this.getViewport=function(t){return t.copy(R)},this.setViewport=function(t,e,n,r){t.isVector4?R.set(t.x,t.y,t.z,t.w):R.set(t,e,n,r),Y.viewport(T.copy(R).multiplyScalar(k).floor())},this.getScissor=function(t){return t.copy(D)},this.setScissor=function(t,e,n,r){t.isVector4?D.set(t.x,t.y,t.z,t.w):D.set(t,e,n,r),Y.scissor(A.copy(D).multiplyScalar(k).floor())},this.getScissorTest=function(){return N},this.setScissorTest=function(t){Y.setScissorTest(N=t)},this.setOpaqueSort=function(t){L=t},this.setTransparentSort=function(t){I=t},this.getClearColor=function(t){return t.copy(ct.getClearColor())},this.setClearColor=function(){ct.setClearColor.apply(ct,arguments)},this.getClearAlpha=function(){return ct.getClearAlpha()},this.setClearAlpha=function(){ct.setClearAlpha.apply(ct,arguments)},this.clear=function(t=!0,e=!0,n=!0){let r=0;t&&(r|=16384),e&&(r|=256),n&&(r|=1024),gt.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",wt,!1),e.removeEventListener("webglcontextrestored",St,!1),at.dispose(),st.dispose(),$.dispose(),J.dispose(),tt.dispose(),rt.dispose(),mt.dispose(),it.dispose(),xt.dispose(),xt.removeEventListener("sessionstart",Ct),xt.removeEventListener("sessionend",Ot),j&&(j.dispose(),j=null),Pt.stop()},this.renderBufferDirect=function(t,e,n,r,i,o){null===e&&(e=G);const a=i.isMesh&&i.matrixWorld.determinant()<0,s=function(t,e,n,r,i){!0!==e.isScene&&(e=G),K.resetTextureUnits();const o=e.fog,a=r.isMeshStandardMaterial?e.environment:null,s=null===S?g.outputEncoding:!0===S.isXRRenderTarget?S.texture.encoding:be,u=(r.isMeshStandardMaterial?tt:J).get(r.envMap||a),l=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!r.normalMap&&!!n.attributes.tangent,h=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,d=!!n.morphAttributes.color,m=r.toneMapped?g.toneMapping:Q,y=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==y?y.length:0,_=$.get(r),b=f.state.lights;if(!0===z&&(!0===B||t!==M)){const e=t===M&&r.id===E;ut.setState(r,t,e)}let x=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==b.state.version||_.outputEncoding!==s||i.isInstancedMesh&&!1===_.instancing?x=!0:i.isInstancedMesh||!0!==_.instancing?i.isSkinnedMesh&&!1===_.skinning?x=!0:i.isSkinnedMesh||!0!==_.skinning?_.envMap!==u||r.fog&&_.fog!==o?x=!0:void 0===_.numClippingPlanes||_.numClippingPlanes===ut.numPlanes&&_.numIntersection===ut.numIntersection?(_.vertexAlphas!==l||_.vertexTangents!==c||_.morphTargets!==h||_.morphNormals!==p||_.morphColors!==d||_.toneMapping!==m||!0===q.isWebGL2&&_.morphTargetsCount!==v)&&(x=!0):x=!0:x=!0:x=!0:(x=!0,_.__version=r.version);let w=_.currentProgram;!0===x&&(w=Nt(r,e,i));let T=!1,A=!1,C=!1;const O=w.getUniforms(),L=_.uniforms;if(Y.useProgram(w.program)&&(T=!0,A=!0,C=!0),r.id!==E&&(E=r.id,A=!0),T||M!==t){if(O.setValue(gt,"projectionMatrix",t.projectionMatrix),q.logarithmicDepthBuffer&&O.setValue(gt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),M!==t&&(M=t,A=!0,C=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){const e=O.map.cameraPosition;void 0!==e&&e.setValue(gt,V.setFromMatrixPosition(t.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&O.setValue(gt,"isOrthographic",!0===t.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||i.isSkinnedMesh)&&O.setValue(gt,"viewMatrix",t.matrixWorldInverse)}if(i.isSkinnedMesh){O.setOptional(gt,i,"bindMatrix"),O.setOptional(gt,i,"bindMatrixInverse");const t=i.skeleton;t&&(q.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),O.setValue(gt,"boneTexture",t.boneTexture,K),O.setValue(gt,"boneTextureSize",t.boneTextureSize)):O.setOptional(gt,t,"boneMatrices"))}const I=n.morphAttributes;return(void 0!==I.position||void 0!==I.normal||void 0!==I.color&&!0===q.isWebGL2)&&ht.update(i,n,r,w),(A||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,O.setValue(gt,"receiveShadow",i.receiveShadow)),A&&(O.setValue(gt,"toneMappingExposure",g.toneMappingExposure),_.needsLights&&function(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.directionalLightShadows.needsUpdate=e,t.pointLights.needsUpdate=e,t.pointLightShadows.needsUpdate=e,t.spotLights.needsUpdate=e,t.spotLightShadows.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}(L,C),o&&r.fog&&ot.refreshFogUniforms(L,o),ot.refreshMaterialUniforms(L,r,k,P,j),fa.upload(gt,_.uniformsList,L,K)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(fa.upload(gt,_.uniformsList,L,K),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&O.setValue(gt,"center",i.center),O.setValue(gt,"modelViewMatrix",i.modelViewMatrix),O.setValue(gt,"normalMatrix",i.normalMatrix),O.setValue(gt,"modelMatrix",i.matrixWorld),w}(t,e,n,r,i);Y.setMaterial(r,a);let u=n.index;const l=n.attributes.position;if(null===u){if(void 0===l||0===l.count)return}else if(0===u.count)return;let c,h=1;!0===r.wireframe&&(u=nt.getWireframeAttribute(n),h=2),mt.setup(i,r,s,n,u);let p=pt;null!==u&&(c=et.get(u),p=ft,p.setIndex(c));const d=null!==u?u.count:l.count,m=n.drawRange.start*h,y=n.drawRange.count*h,v=null!==o?o.start*h:0,_=null!==o?o.count*h:1/0,b=Math.max(m,v),x=Math.min(d,m+y,v+_)-1,w=Math.max(0,x-b+1);if(0!==w){if(i.isMesh)!0===r.wireframe?(Y.setLineWidth(r.wireframeLinewidth*H()),p.setMode(1)):p.setMode(4);else if(i.isLine){let t=r.linewidth;void 0===t&&(t=1),Y.setLineWidth(t*H()),i.isLineSegments?p.setMode(1):i.isLineLoop?p.setMode(2):p.setMode(3)}else i.isPoints?p.setMode(0):i.isSprite&&p.setMode(4);if(i.isInstancedMesh)p.renderInstances(b,w,i.count);else if(n.isInstancedBufferGeometry){const t=Math.min(n.instanceCount,n._maxInstanceCount);p.renderInstances(b,w,t)}else p.render(b,w)}},this.compile=function(t,e){f=st.get(t),f.init(),m.push(f),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(f.pushLight(t),t.castShadow&&f.pushShadow(t))})),f.setupLights(g.physicallyCorrectLights),t.traverse((function(e){const n=e.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++)Nt(n[r],t,e);else Nt(n,t,e)})),m.pop(),f=null};let At=null;function Ct(){Pt.stop()}function Ot(){Pt.start()}const Pt=new Ci;function kt(t,e,n,r){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)f.pushLight(t),t.castShadow&&f.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||F.intersectsSprite(t)){r&&V.setFromMatrixPosition(t.matrixWorld).applyMatrix4(U);const e=rt.update(t),i=t.material;i.visible&&p.push(t,e,i,n,V.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==X.render.frame&&(t.skeleton.update(),t.skeleton.frame=X.render.frame),!t.frustumCulled||F.intersectsObject(t))){r&&V.setFromMatrixPosition(t.matrixWorld).applyMatrix4(U);const e=rt.update(t),i=t.material;if(Array.isArray(i)){const r=e.groups;for(let o=0,a=r.length;o<a;o++){const a=r[o],s=i[a.materialIndex];s&&s.visible&&p.push(t,e,s,n,V.z,a)}}else i.visible&&p.push(t,e,i,n,V.z,null)}const i=t.children;for(let t=0,o=i.length;t<o;t++)kt(i[t],e,n,r)}function It(t,e,n,r){const i=t.opaque,a=t.transmissive,s=t.transparent;f.setupLightsView(n),a.length>0&&function(t,e,n){const r=q.isWebGL2;null===j&&(j=new cn(1,1,{generateMipmaps:!0,type:null!==dt.convert(Tt)?Tt:_t,minFilter:vt,samples:r&&!0===o?4:0})),g.getDrawingBufferSize(Z),r?j.setSize(Z.x,Z.y):j.setSize(je(Z.x),je(Z.y));const i=g.getRenderTarget();g.setRenderTarget(j),g.clear();const a=g.toneMapping;g.toneMapping=Q,Rt(t,e,n),g.toneMapping=a,K.updateMultisampleRenderTarget(j),K.updateRenderTargetMipmap(j),g.setRenderTarget(i)}(i,e,n),r&&Y.viewport(T.copy(r)),i.length>0&&Rt(i,e,n),a.length>0&&Rt(a,e,n),s.length>0&&Rt(s,e,n),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Rt(t,e,n){const r=!0===e.isScene?e.overrideMaterial:null;for(let i=0,o=t.length;i<o;i++){const o=t[i],a=o.object,s=o.geometry,u=null===r?o.material:r,l=o.group;a.layers.test(n.layers)&&Dt(a,e,n,s,u,l)}}function Dt(t,e,n,r,i,o){t.onBeforeRender(g,e,n,r,i,o),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),i.onBeforeRender(g,e,n,r,t,o),!0===i.transparent&&i.side===_?(i.side=v,i.needsUpdate=!0,g.renderBufferDirect(n,e,r,i,t,o),i.side=y,i.needsUpdate=!0,g.renderBufferDirect(n,e,r,i,t,o),i.side=_):g.renderBufferDirect(n,e,r,i,t,o),t.onAfterRender(g,e,n,r,i,o)}function Nt(t,e,n){!0!==e.isScene&&(e=G);const r=$.get(t),i=f.state.lights,o=f.state.shadowsArray,a=i.state.version,s=it.getParameters(t,i.state,o,e,n),u=it.getProgramCacheKey(s);let l=r.programs;r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=(t.isMeshStandardMaterial?tt:J).get(t.envMap||r.environment),void 0===l&&(t.addEventListener("dispose",Et),l=new Map,r.programs=l);let c=l.get(u);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===a)return Ft(t,s),c}else s.uniforms=it.getUniforms(t),t.onBuild(n,s,g),t.onBeforeCompile(s,g),c=it.acquireProgram(s,u),l.set(u,c),r.uniforms=s.uniforms;const h=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(h.clippingPlanes=ut.uniform),Ft(t,s),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=a,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotShadowMatrix.value=i.state.spotShadowMatrix,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);const p=c.getUniforms(),d=fa.seqWithValue(p.seq,h);return r.currentProgram=c,r.uniformsList=d,c}function Ft(t,e){const n=$.get(t);n.outputEncoding=e.outputEncoding,n.instancing=e.instancing,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Pt.setAnimationLoop((function(t){At&&At(t)})),"undefined"!=typeof self&&Pt.setContext(self),this.setAnimationLoop=function(t){At=t,xt.setAnimationLoop(t),null===t?Pt.stop():Pt.start()},xt.addEventListener("sessionstart",Ct),xt.addEventListener("sessionend",Ot),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===b)return;!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===xt.enabled&&!0===xt.isPresenting&&(!0===xt.cameraAutoUpdate&&xt.updateCamera(e),e=xt.getCamera()),!0===t.isScene&&t.onBeforeRender(g,t,e,S),f=st.get(t,m.length),f.init(),m.push(f),U.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),F.setFromProjectionMatrix(U),B=this.localClippingEnabled,z=ut.init(this.clippingPlanes,B,e),p=at.get(t,d.length),p.init(),d.push(p),kt(t,e,0,g.sortObjects),p.finish(),!0===g.sortObjects&&p.sort(L,I),!0===z&&ut.beginShadows();const n=f.state.shadowsArray;if(lt.render(n,t,e),!0===z&&ut.endShadows(),!0===this.info.autoReset&&this.info.reset(),ct.render(p,t),f.setupLights(g.physicallyCorrectLights),e.isArrayCamera){const n=e.cameras;for(let e=0,r=n.length;e<r;e++){const r=n[e];It(p,t,r,r.viewport)}}else It(p,t,e);null!==S&&(K.updateMultisampleRenderTarget(S),K.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(g,t,e),mt.resetDefaultState(),E=-1,M=null,m.pop(),f=m.length>0?m[m.length-1]:null,d.pop(),p=d.length>0?d[d.length-1]:null},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return w},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){$.get(t.texture).__webglTexture=e,$.get(t.depthTexture).__webglTexture=n;const r=$.get(t);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===W.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=$.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,x=e,w=n;let r=!0;if(t){const e=$.get(t);void 0!==e.__useDefaultFramebuffer?(Y.bindFramebuffer(36160,null),r=!1):void 0===e.__webglFramebuffer?K.setupRenderTarget(t):e.__hasExternalTextures&&K.rebindTextures(t,$.get(t.texture).__webglTexture,$.get(t.depthTexture).__webglTexture)}let i=null,o=!1,a=!1;if(t){const n=t.texture;(n.isData3DTexture||n.isDataArrayTexture)&&(a=!0);const r=$.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=r[e],o=!0):i=q.isWebGL2&&t.samples>0&&!1===K.useMultisampledRTT(t)?$.get(t).__webglMultisampledFramebuffer:r,T.copy(t.viewport),A.copy(t.scissor),C=t.scissorTest}else T.copy(R).multiplyScalar(k).floor(),A.copy(D).multiplyScalar(k).floor(),C=N;if(Y.bindFramebuffer(36160,i)&&q.drawBuffers&&r&&Y.drawBuffers(t,i),Y.viewport(T),Y.scissor(A),Y.setScissorTest(C),o){const r=$.get(t.texture);gt.framebufferTexture2D(36160,36064,34069+e,r.__webglTexture,n)}else if(a){const r=$.get(t.texture),i=e||0;gt.framebufferTextureLayer(36160,36064,r.__webglTexture,n||0,i)}E=-1},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=$.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){Y.bindFramebuffer(36160,s);try{const a=t.texture,s=a.format,u=a.type;if(s!==Lt&&dt.convert(s)!==gt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const l=u===Tt&&(W.has("EXT_color_buffer_half_float")||q.isWebGL2&&W.has("EXT_color_buffer_float"));if(!(u===_t||dt.convert(u)===gt.getParameter(35738)||u===Mt&&(q.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float"))||l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&>.readPixels(e,n,r,i,dt.convert(s),dt.convert(u),o)}finally{const t=null!==S?$.get(S).__webglFramebuffer:null;Y.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){if(!0!==e.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r);K.setTexture2D(e,0),gt.copyTexSubImage2D(3553,n,0,0,t.x,t.y,i,o),Y.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r=0){const i=e.image.width,o=e.image.height,a=dt.convert(n.format),s=dt.convert(n.type);K.setTexture2D(n,0),gt.pixelStorei(37440,n.flipY),gt.pixelStorei(37441,n.premultiplyAlpha),gt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?gt.texSubImage2D(3553,r,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?gt.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):gt.texSubImage2D(3553,r,t.x,t.y,a,s,e.image),0===r&&n.generateMipmaps&>.generateMipmap(3553),Y.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,r,i=0){if(g.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,s=t.max.z-t.min.z+1,u=dt.convert(r.format),l=dt.convert(r.type);let c;if(r.isData3DTexture)K.setTexture3D(r,0),c=32879;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");K.setTexture2DArray(r,0),c=35866}gt.pixelStorei(37440,r.flipY),gt.pixelStorei(37441,r.premultiplyAlpha),gt.pixelStorei(3317,r.unpackAlignment);const h=gt.getParameter(3314),p=gt.getParameter(32878),f=gt.getParameter(3316),d=gt.getParameter(3315),m=gt.getParameter(32877),y=n.isCompressedTexture?n.mipmaps[0]:n.image;gt.pixelStorei(3314,y.width),gt.pixelStorei(32878,y.height),gt.pixelStorei(3316,t.min.x),gt.pixelStorei(3315,t.min.y),gt.pixelStorei(32877,t.min.z),n.isDataTexture||n.isData3DTexture?gt.texSubImage3D(c,i,e.x,e.y,e.z,o,a,s,u,l,y.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),gt.compressedTexSubImage3D(c,i,e.x,e.y,e.z,o,a,s,u,y.data)):gt.texSubImage3D(c,i,e.x,e.y,e.z,o,a,s,u,l,y),gt.pixelStorei(3314,h),gt.pixelStorei(32878,p),gt.pixelStorei(3316,f),gt.pixelStorei(3315,d),gt.pixelStorei(32877,m),0===i&&r.generateMipmaps&>.generateMipmap(c),Y.unbindTexture()},this.initTexture=function(t){K.setTexture2D(t,0),Y.unbindTexture()},this.resetState=function(){x=0,w=0,S=null,Y.reset(),mt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}us.prototype.isWebGLRenderer=!0,class extends us{}.prototype.isWebGL1Renderer=!0;class ls{constructor(t,e=25e-5){this.name="",this.color=new en(t),this.density=e}clone(){return new ls(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ls.prototype.isFogExp2=!0;class cs{constructor(t,e=1,n=1e3){this.name="",this.color=new en(t),this.near=e,this.far=n}clone(){return new cs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}cs.prototype.isFog=!0;class hs extends gr{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}hs.prototype.isScene=!0;class ps{constructor(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ce,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ne()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ne()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ne()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}ps.prototype.isInterleavedBuffer=!0;const fs=new dn;class ds{constructor(t,e,n,r=!1){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)fs.fromBufferAttribute(this,e),fs.applyMatrix4(t),this.setXYZ(e,fs.x,fs.y,fs.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)fs.fromBufferAttribute(this,e),fs.applyNormalMatrix(t),this.setXYZ(e,fs.x,fs.y,fs.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)fs.fromBufferAttribute(this,e),fs.transformDirection(t),this.setXYZ(e,fs.x,fs.y,fs.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new Ir(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new ds(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}ds.prototype.isInterleavedBufferAttribute=!0;class ms extends Or{constructor(t){super(),this.type="SpriteMaterial",this.color=new en(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this}}let gs;ms.prototype.isSpriteMaterial=!0;const ys=new dn,vs=new dn,_s=new dn,bs=new Ue,xs=new Ue,ws=new Hn,Ss=new dn,Es=new dn,Ms=new dn,Ts=new Ue,As=new Ue,Cs=new Ue;class Os extends gr{constructor(t){if(super(),this.type="Sprite",void 0===gs){gs=new Gr;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new ps(t,5);gs.setIndex([0,1,2,0,2,3]),gs.setAttribute("position",new ds(e,3,0,!1)),gs.setAttribute("uv",new ds(e,2,3,!1))}this.geometry=gs,this.material=void 0!==t?t:new ms,this.center=new Ue(.5,.5)}raycast(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),vs.setFromMatrixScale(this.matrixWorld),ws.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),_s.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&vs.multiplyScalar(-_s.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const o=this.center;Ps(Ss.set(-.5,-.5,0),_s,o,vs,r,i),Ps(Es.set(.5,-.5,0),_s,o,vs,r,i),Ps(Ms.set(.5,.5,0),_s,o,vs,r,i),Ts.set(0,0),As.set(1,0),Cs.set(1,1);let a=t.ray.intersectTriangle(Ss,Es,Ms,!1,ys);if(null===a&&(Ps(Es.set(-.5,.5,0),_s,o,vs,r,i),As.set(0,1),a=t.ray.intersectTriangle(Ss,Ms,Es,!1,ys),null===a))return;const s=t.ray.origin.distanceTo(ys);s<t.near||s>t.far||e.push({distance:s,point:ys.clone(),uv:Ar.getUV(ys,Ss,Es,Ms,Ts,As,Cs,new Ue),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function Ps(t,e,n,r,i,o){bs.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(xs.x=o*bs.x-i*bs.y,xs.y=i*bs.x+o*bs.y):xs.copy(bs),t.copy(e),t.x+=xs.x,t.y+=xs.y,t.applyMatrix4(ws)}Os.prototype.isSprite=!0;const ks=new dn,Ls=new ln,Is=new ln,Rs=new dn,Ds=new Hn;class Ns extends ui{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Hn,this.bindMatrixInverse=new Hn}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new ln,e=this.geometry.attributes.skinWeight;for(let n=0,r=e.count;n<r;n++){t.fromBufferAttribute(e,n);const r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const n=this.skeleton,r=this.geometry;Ls.fromBufferAttribute(r.attributes.skinIndex,t),Is.fromBufferAttribute(r.attributes.skinWeight,t),ks.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const r=Is.getComponent(t);if(0!==r){const i=Ls.getComponent(t);Ds.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),e.addScaledVector(Rs.copy(ks).applyMatrix4(Ds),r)}}return e.applyMatrix4(this.bindMatrixInverse)}}Ns.prototype.isSkinnedMesh=!0;(class extends gr{constructor(){super(),this.type="Bone"}}).prototype.isBone=!0;(class extends un{constructor(t=null,e=1,n=1,r,i,o,a,s,u=ft,l=ft,c,h){super(null,o,a,s,u,l,r,i,c,h),this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}).prototype.isDataTexture=!0;class Fs extends Ir{constructor(t,e,n,r=1){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,n),this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}Fs.prototype.isInstancedBufferAttribute=!0;const zs=new Hn,Bs=new Hn,js=[],Us=new ui;(class extends ui{constructor(t,e,n){super(t,e),this.instanceMatrix=new Fs(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const n=this.matrixWorld,r=this.count;if(Us.geometry=this.geometry,Us.material=this.material,void 0!==Us.material)for(let i=0;i<r;i++){this.getMatrixAt(i,zs),Bs.multiplyMatrices(n,zs),Us.matrixWorld=Bs,Us.raycast(t,js);for(let t=0,n=js.length;t<n;t++){const n=js[t];n.instanceId=i,n.object=this,e.push(n)}js.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new Fs(new Float32Array(3*this.instanceMatrix.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}).prototype.isInstancedMesh=!0;class Zs extends Or{constructor(t){super(),this.type="LineBasicMaterial",this.color=new en(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this}}Zs.prototype.isLineBasicMaterial=!0;const Vs=new dn,Gs=new dn,Hs=new Hn,Ws=new Gn,qs=new Nn;class Ys extends gr{constructor(t=new Gr,e=new Zs){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,r=e.count;t<r;t++)Vs.fromBufferAttribute(e,t-1),Gs.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=Vs.distanceTo(Gs);t.setAttribute("lineDistance",new Nr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),qs.copy(n.boundingSphere),qs.applyMatrix4(r),qs.radius+=i,!1===t.ray.intersectsSphere(qs))return;Hs.copy(r).invert(),Ws.copy(t.ray).applyMatrix4(Hs);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a,u=new dn,l=new dn,c=new dn,h=new dn,p=this.isLineSegments?2:1;if(n.isBufferGeometry){const r=n.index,i=n.attributes.position;if(null!==r)for(let n=Math.max(0,o.start),a=Math.min(r.count,o.start+o.count)-1;n<a;n+=p){const o=r.getX(n),a=r.getX(n+1);if(u.fromBufferAttribute(i,o),l.fromBufferAttribute(i,a),Ws.distanceSqToSegment(u,l,h,c)>s)continue;h.applyMatrix4(this.matrixWorld);const p=t.ray.origin.distanceTo(h);p<t.near||p>t.far||e.push({distance:p,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}else for(let n=Math.max(0,o.start),r=Math.min(i.count,o.start+o.count)-1;n<r;n+=p){if(u.fromBufferAttribute(i,n),l.fromBufferAttribute(i,n+1),Ws.distanceSqToSegment(u,l,h,c)>s)continue;h.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(h);r<t.near||r>t.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Ys.prototype.isLine=!0;const Xs=new dn,$s=new dn;class Ks extends Ys{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,r=e.count;t<r;t+=2)Xs.fromBufferAttribute(e,t),$s.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+Xs.distanceTo($s);t.setAttribute("lineDistance",new Nr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Ks.prototype.isLineSegments=!0;(class extends Ys{constructor(t,e){super(t,e),this.type="LineLoop"}}).prototype.isLineLoop=!0;class Js extends Or{constructor(t){super(),this.type="PointsMaterial",this.color=new en(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this}}Js.prototype.isPointsMaterial=!0;const Qs=new Hn,tu=new Gn,eu=new Nn,nu=new dn;function ru(t,e,n,r,i,o,a){const s=tu.distanceSqToPoint(t);if(s<n){const n=new dn;tu.closestPointToPoint(t,n),n.applyMatrix4(r);const u=i.ray.origin.distanceTo(n);if(u<i.near||u>i.far)return;o.push({distance:u,distanceToRay:Math.sqrt(s),point:n,index:e,face:null,object:a})}}(class extends gr{constructor(t=new Gr,e=new Js){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),eu.copy(n.boundingSphere),eu.applyMatrix4(r),eu.radius+=i,!1===t.ray.intersectsSphere(eu))return;Qs.copy(r).invert(),tu.copy(t.ray).applyMatrix4(Qs);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position;if(null!==i)for(let n=Math.max(0,o.start),u=Math.min(i.count,o.start+o.count);n<u;n++){const o=i.getX(n);nu.fromBufferAttribute(a,o),ru(nu,o,s,r,t,e,this)}else for(let n=Math.max(0,o.start),i=Math.min(a.count,o.start+o.count);n<i;n++)nu.fromBufferAttribute(a,n),ru(nu,n,s,r,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}).prototype.isPoints=!0,class extends un{constructor(t,e,n,r,i,o,a,s,u){super(t,e,n,r,i,o,a,s,u),this.minFilter=void 0!==o?o:gt,this.magFilter=void 0!==i?i:gt,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){l.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}.prototype.isVideoTexture=!0,class extends un{constructor(t,e,n){super({width:t,height:e}),this.format=n,this.magFilter=ft,this.minFilter=ft,this.generateMipmaps=!1,this.needsUpdate=!0}}.prototype.isFramebufferTexture=!0;(class extends un{constructor(t,e,n,r,i,o,a,s,u,l,c,h){super(null,o,a,s,u,l,r,i,c,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}).prototype.isCompressedTexture=!0,class extends un{constructor(t,e,n,r,i,o,a,s,u){super(t,e,n,r,i,o,a,s,u),this.needsUpdate=!0}}.prototype.isCanvasTexture=!0;class iu{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),i=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),i+=n.distanceTo(r),e.push(i),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const i=n.length;let o;o=e||t*n[i-1];let a,s=0,u=i-1;for(;s<=u;)if(r=Math.floor(s+(u-s)/2),a=n[r]-o,a<0)s=r+1;else{if(!(a>0)){u=r;break}u=r-1}if(r=u,n[r]===o)return r/(i-1);const l=n[r];return(r+(o-l)/(n[r+1]-l))/(i-1)}getTangent(t,e){const n=1e-4;let r=t-n,i=t+n;r<0&&(r=0),i>1&&(i=1);const o=this.getPoint(r),a=this.getPoint(i),s=e||(o.isVector2?new Ue:new dn);return s.copy(a).sub(o).normalize(),s}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new dn,r=[],i=[],o=[],a=new dn,s=new Hn;for(let e=0;e<=t;e++){const n=e/t;r[e]=this.getTangentAt(n,new dn)}i[0]=new dn,o[0]=new dn;let u=Number.MAX_VALUE;const l=Math.abs(r[0].x),c=Math.abs(r[0].y),h=Math.abs(r[0].z);l<=u&&(u=l,n.set(1,0,0)),c<=u&&(u=c,n.set(0,1,0)),h<=u&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(let e=1;e<=t;e++){if(i[e]=i[e-1].clone(),o[e]=o[e-1].clone(),a.crossVectors(r[e-1],r[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(Fe(r[e-1].dot(r[e]),-1,1));i[e].applyMatrix4(s.makeRotationAxis(a,t))}o[e].crossVectors(r[e],i[e])}if(!0===e){let e=Math.acos(Fe(i[0].dot(i[t]),-1,1));e/=t,r[0].dot(a.crossVectors(i[0],i[t]))>0&&(e=-e);for(let n=1;n<=t;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],e*n)),o[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ou extends iu{constructor(t=0,e=0,n=1,r=1,i=0,o=2*Math.PI,a=!1,s=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s}getPoint(t,e){const n=e||new Ue,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);const a=this.aStartAngle+t*i;let s=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=s-this.aX,r=u-this.aY;s=n*t-r*e+this.aX,u=n*e+r*t+this.aY}return n.set(s,u)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}ou.prototype.isEllipseCurve=!0;class au extends ou{constructor(t,e,n,r,i,o){super(t,e,n,n,r,i,o),this.type="ArcCurve"}}function su(){let t=0,e=0,n=0,r=0;function i(i,o,a,s){t=i,e=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(t,e,n,r,o){i(e,n,o*(n-t),o*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,o,a,s){let u=(e-t)/o-(n-t)/(o+a)+(n-e)/a,l=(n-e)/a-(r-e)/(a+s)+(r-n)/s;u*=a,l*=a,i(e,n,u,l)},calc:function(i){const o=i*i;return t+e*i+n*o+r*(o*i)}}}au.prototype.isArcCurve=!0;const uu=new dn,lu=new su,cu=new su,hu=new su;class pu extends iu{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new dn){const n=e,r=this.points,i=r.length,o=(i-(this.closed?0:1))*t;let a,s,u=Math.floor(o),l=o-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/i)+1)*i:0===l&&u===i-1&&(u=i-2,l=1),this.closed||u>0?a=r[(u-1)%i]:(uu.subVectors(r[0],r[1]).add(r[0]),a=uu);const c=r[u%i],h=r[(u+1)%i];if(this.closed||u+2<i?s=r[(u+2)%i]:(uu.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=uu),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(a.distanceToSquared(c),t),n=Math.pow(c.distanceToSquared(h),t),r=Math.pow(h.distanceToSquared(s),t);n<1e-4&&(n=1),e<1e-4&&(e=n),r<1e-4&&(r=n),lu.initNonuniformCatmullRom(a.x,c.x,h.x,s.x,e,n,r),cu.initNonuniformCatmullRom(a.y,c.y,h.y,s.y,e,n,r),hu.initNonuniformCatmullRom(a.z,c.z,h.z,s.z,e,n,r)}else"catmullrom"===this.curveType&&(lu.initCatmullRom(a.x,c.x,h.x,s.x,this.tension),cu.initCatmullRom(a.y,c.y,h.y,s.y,this.tension),hu.initCatmullRom(a.z,c.z,h.z,s.z,this.tension));return n.set(lu.calc(l),cu.calc(l),hu.calc(l)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new dn).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function fu(t,e,n,r,i){const o=.5*(r-e),a=.5*(i-n),s=t*t;return(2*n-2*r+o+a)*(t*s)+(-3*n+3*r-2*o-a)*s+o*t+n}function du(t,e,n,r){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function mu(t,e,n,r,i){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}pu.prototype.isCatmullRomCurve3=!0;class gu extends iu{constructor(t=new Ue,e=new Ue,n=new Ue,r=new Ue){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new Ue){const n=e,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(mu(t,r.x,i.x,o.x,a.x),mu(t,r.y,i.y,o.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}gu.prototype.isCubicBezierCurve=!0;class yu extends iu{constructor(t=new dn,e=new dn,n=new dn,r=new dn){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new dn){const n=e,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(mu(t,r.x,i.x,o.x,a.x),mu(t,r.y,i.y,o.y,a.y),mu(t,r.z,i.z,o.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}yu.prototype.isCubicBezierCurve3=!0;class vu extends iu{constructor(t=new Ue,e=new Ue){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ue){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const n=e||new Ue;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}vu.prototype.isLineCurve=!0;class _u extends iu{constructor(t=new Ue,e=new Ue,n=new Ue){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Ue){const n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(du(t,r.x,i.x,o.x),du(t,r.y,i.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}_u.prototype.isQuadraticBezierCurve=!0;class bu extends iu{constructor(t=new dn,e=new dn,n=new dn){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new dn){const n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(du(t,r.x,i.x,o.x),du(t,r.y,i.y,o.y),du(t,r.z,i.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}bu.prototype.isQuadraticBezierCurve3=!0;class xu extends iu{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new Ue){const n=e,r=this.points,i=(r.length-1)*t,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],u=r[o],l=r[o>r.length-2?r.length-1:o+1],c=r[o>r.length-3?r.length-1:o+2];return n.set(fu(a,s.x,u.x,l.x,c.x),fu(a,s.y,u.y,l.y,c.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Ue).fromArray(n))}return this}}xu.prototype.isSplineCurve=!0;var wu=Object.freeze({__proto__:null,ArcCurve:au,CatmullRomCurve3:pu,CubicBezierCurve:gu,CubicBezierCurve3:yu,EllipseCurve:ou,LineCurve:vu,LineCurve3:class extends iu{constructor(t=new dn,e=new dn){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=t,this.v2=e}getPoint(t,e=new dn){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:_u,QuadraticBezierCurve3:bu,SplineCurve:xu});class Su extends iu{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new vu(e,t))}getPoint(t,e){const n=t*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const t=r[i]-n,o=this.curves[i],a=o.getLength(),s=0===a?0:1-t/a;return o.getPointAt(s,e)}i++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const o=i[r],a=o.isEllipseCurve?2*t:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a);for(let t=0;t<s.length;t++){const r=s[t];n&&n.equals(r)||(e.push(r),n=r)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new wu[n.type]).fromJSON(n))}return this}}class Eu extends Su{constructor(t){super(),this.type="Path",this.currentPoint=new Ue,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new vu(this.currentPoint.clone(),new Ue(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const i=new _u(this.currentPoint.clone(),new Ue(t,e),new Ue(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,i,o){const a=new gu(this.currentPoint.clone(),new Ue(t,e),new Ue(n,r),new Ue(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new xu(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,i,o){const a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+a,e+s,n,r,i,o),this}absarc(t,e,n,r,i,o){return this.absellipse(t,e,n,n,r,i,o),this}ellipse(t,e,n,r,i,o,a,s){const u=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+u,e+l,n,r,i,o,a,s),this}absellipse(t,e,n,r,i,o,a,s){const u=new ou(t,e,n,r,i,o,a,s);if(this.curves.length>0){const t=u.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(u);const l=u.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Mu extends Gr{constructor(t=1,e=1,n=1,r=8,i=1,o=!1,a=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};const u=this;r=Math.floor(r),i=Math.floor(i);const l=[],c=[],h=[],p=[];let f=0;const d=[],m=n/2;let g=0;function y(n){const i=f,o=new Ue,d=new dn;let y=0;const v=!0===n?t:e,_=!0===n?1:-1;for(let t=1;t<=r;t++)c.push(0,m*_,0),h.push(0,_,0),p.push(.5,.5),f++;const b=f;for(let t=0;t<=r;t++){const e=t/r*s+a,n=Math.cos(e),i=Math.sin(e);d.x=v*i,d.y=m*_,d.z=v*n,c.push(d.x,d.y,d.z),h.push(0,_,0),o.x=.5*n+.5,o.y=.5*i*_+.5,p.push(o.x,o.y),f++}for(let t=0;t<r;t++){const e=i+t,r=b+t;!0===n?l.push(r,r+1,e):l.push(r+1,r,e),y+=3}u.addGroup(g,y,!0===n?1:2),g+=y}!function(){const o=new dn,y=new dn;let v=0;const _=(e-t)/n;for(let u=0;u<=i;u++){const l=[],g=u/i,v=g*(e-t)+t;for(let t=0;t<=r;t++){const e=t/r,i=e*s+a,u=Math.sin(i),d=Math.cos(i);y.x=v*u,y.y=-g*n+m,y.z=v*d,c.push(y.x,y.y,y.z),o.set(u,_,d).normalize(),h.push(o.x,o.y,o.z),p.push(e,1-g),l.push(f++)}d.push(l)}for(let t=0;t<r;t++)for(let e=0;e<i;e++){const n=d[e][t],r=d[e+1][t],i=d[e+1][t+1],o=d[e][t+1];l.push(n,r,o),l.push(r,i,o),v+=6}u.addGroup(g,v,0),g+=v}(),!1===o&&(t>0&&y(!0),e>0&&y(!1)),this.setIndex(l),this.setAttribute("position",new Nr(c,3)),this.setAttribute("normal",new Nr(h,3)),this.setAttribute("uv",new Nr(p,2))}static fromJSON(t){return new Mu(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Tu extends Mu{constructor(t=1,e=1,n=8,r=1,i=!1,o=0,a=2*Math.PI){super(0,t,e,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}static fromJSON(t){return new Tu(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}new dn,new dn,new dn,new Ar;class Au extends Eu{constructor(t){super(t),this.uuid=Ne(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new Eu).fromJSON(n))}return this}}function Cu(t,e,n,r,i){let o,a;if(i===function(t,e,n,r){let i=0;for(let o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}(t,e,n,r)>0)for(o=e;o<n;o+=r)a=Xu(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=Xu(o,t[o],t[o+1],a);return a&&Vu(a,a.next)&&($u(a),a=a.next),a}function Ou(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Vu(r,r.next)&&0!==Zu(r.prev,r,r.next))r=r.next;else{if($u(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function Pu(t,e,n,r,i,o,a){if(!t)return;!a&&o&&function(t,e,n,r){let i=t;do{null===i.z&&(i.z=zu(i.x,i.y,e,n,r)),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,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ,r);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,o);let s,u,l=t;for(;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Lu(t,r,i,o):ku(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),$u(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?Pu(t=Iu(Ou(t),e,n),e,n,r,i,o,2):2===a&&Ru(t,e,n,r,i,o):Pu(Ou(t),e,n,r,i,o,1);break}}function ku(t){const e=t.prev,n=t,r=t.next;if(Zu(e,n,r)>=0)return!1;let i=t.next.next;for(;i!==t.prev;){if(ju(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Zu(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Lu(t,e,n,r){const i=t.prev,o=t,a=t.next;if(Zu(i,o,a)>=0)return!1;const s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=zu(s,u,e,n,r),p=zu(l,c,e,n,r);let f=t.prevZ,d=t.nextZ;for(;f&&f.z>=h&&d&&d.z<=p;){if(f!==t.prev&&f!==t.next&&ju(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Zu(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&ju(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Zu(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&ju(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Zu(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&ju(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Zu(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Iu(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!Vu(i,o)&&Gu(i,r,r.next,o)&&qu(i,o)&&qu(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),$u(r),$u(r.next),r=t=o),r=r.next}while(r!==t);return Ou(r)}function Ru(t,e,n,r,i,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&Uu(a,t)){let s=Yu(a,t);return a=Ou(a,a.next),s=Ou(s,s.next),Pu(a,e,n,r,i,o),void Pu(s,e,n,r,i,o)}t=t.next}a=a.next}while(a!==t)}function Du(t,e){return t.x-e.x}function Nu(t,e){if(e=function(t,e){let n=e;const r=t.x,i=t.y;let o,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>a){if(a=t,t===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!o)return null;if(r===a)return o;const s=o,u=o.x,l=o.y;let c,h=1/0;n=o;do{r>=n.x&&n.x>=u&&r!==n.x&&ju(i<l?r:a,i,u,l,i<l?a:r,i,n.x,n.y)&&(c=Math.abs(i-n.y)/(r-n.x),qu(n,t)&&(c<h||c===h&&(n.x>o.x||n.x===o.x&&Fu(o,n)))&&(o=n,h=c)),n=n.next}while(n!==s);return o}(t,e),e){const n=Yu(e,t);Ou(e,e.next),Ou(n,n.next)}}function Fu(t,e){return Zu(t.prev,t,e.prev)<0&&Zu(e.next,t,t.next)<0}function zu(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Bu(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function ju(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Uu(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Gu(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(qu(t,e)&&qu(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(Zu(t.prev,t,e.prev)||Zu(t,e.prev,e))||Vu(t,e)&&Zu(t.prev,t,t.next)>0&&Zu(e.prev,e,e.next)>0)}function Zu(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Vu(t,e){return t.x===e.x&&t.y===e.y}function Gu(t,e,n,r){const i=Wu(Zu(t,e,n)),o=Wu(Zu(t,e,r)),a=Wu(Zu(n,r,t)),s=Wu(Zu(n,r,e));return i!==o&&a!==s||!(0!==i||!Hu(t,n,e))||!(0!==o||!Hu(t,r,e))||!(0!==a||!Hu(n,t,r))||!(0!==s||!Hu(n,e,r))}function Hu(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Wu(t){return t>0?1:t<0?-1:0}function qu(t,e){return Zu(t.prev,t,t.next)<0?Zu(t,e,t.next)>=0&&Zu(t,t.prev,e)>=0:Zu(t,e,t.prev)<0||Zu(t,t.next,e)<0}function Yu(t,e){const n=new Ku(t.i,t.x,t.y),r=new Ku(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Xu(t,e,n,r){const i=new Ku(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function $u(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 Ku(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ju{static area(t){const e=t.length;let n=0;for(let r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n}static isClockWise(t){return Ju.area(t)<0}static triangulateShape(t,e){const n=[],r=[],i=[];Qu(t),tl(n,t);let o=t.length;e.forEach(Qu);for(let t=0;t<e.length;t++)r.push(o),o+=e[t].length,tl(n,e[t]);const a=function(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let o=Cu(t,0,i,n,!0);const a=[];if(!o||o.next===o.prev)return a;let s,u,l,c,h,p,f;if(r&&(o=function(t,e,n,r){const i=[];let o,a,s,u,l;for(o=0,a=e.length;o<a;o++)s=e[o]*r,u=o<a-1?e[o+1]*r:t.length,l=Cu(t,s,u,r,!1),l===l.next&&(l.steiner=!0),i.push(Bu(l));for(i.sort(Du),o=0;o<i.length;o++)Nu(i[o],n),n=Ou(n,n.next);return n}(t,e,o,n)),t.length>80*n){s=l=t[0],u=c=t[1];for(let e=n;e<i;e+=n)h=t[e],p=t[e+1],h<s&&(s=h),p<u&&(u=p),h>l&&(l=h),p>c&&(c=p);f=Math.max(l-s,c-u),f=0!==f?1/f:0}return Pu(o,a,n,s,u,f),a}(n,r);for(let t=0;t<a.length;t+=3)i.push(a.slice(t,t+3));return i}}function Qu(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function tl(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class el extends Gr{constructor(t=new Au([new Ue(.5,.5),new Ue(-.5,.5),new Ue(-.5,-.5),new Ue(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],i=[];for(let e=0,n=t.length;e<n;e++)o(t[e]);function o(t){const o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1;let u=void 0!==e.depth?e.depth:1,l=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:.2,h=void 0!==e.bevelSize?e.bevelSize:c-.1,p=void 0!==e.bevelOffset?e.bevelOffset:0,f=void 0!==e.bevelSegments?e.bevelSegments:3;const d=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:nl;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=e.amount);let g,y,v,_,b,x=!1;d&&(g=d.getSpacedPoints(s),x=!0,l=!1,y=d.computeFrenetFrames(s,!1),v=new dn,_=new dn,b=new dn),l||(f=0,c=0,h=0,p=0);const w=t.extractPoints(a);let S=w.shape;const E=w.holes;if(!Ju.isClockWise(S)){S=S.reverse();for(let t=0,e=E.length;t<e;t++){const e=E[t];Ju.isClockWise(e)&&(E[t]=e.reverse())}}const M=Ju.triangulateShape(S,E),T=S;for(let t=0,e=E.length;t<e;t++){const e=E[t];S=S.concat(e)}function A(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}const C=S.length,O=M.length;function P(t,e,n){let r,i,o;const a=t.x-e.x,s=t.y-e.y,u=n.x-t.x,l=n.y-t.y,c=a*a+s*s,h=a*l-s*u;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(c),p=Math.sqrt(u*u+l*l),f=e.x-s/h,d=e.y+a/h,m=((n.x-l/p-f)*l-(n.y+u/p-d)*u)/(a*l-s*u);r=f+a*m-t.x,i=d+s*m-t.y;const g=r*r+i*i;if(g<=2)return new Ue(r,i);o=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?u>Number.EPSILON&&(t=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(t=!0):Math.sign(s)===Math.sign(l)&&(t=!0),t?(r=-s,i=a,o=Math.sqrt(c)):(r=a,i=s,o=Math.sqrt(c/2))}return new Ue(r/o,i/o)}const k=[];for(let t=0,e=T.length,n=e-1,r=t+1;t<e;t++,n++,r++)n===e&&(n=0),r===e&&(r=0),k[t]=P(T[t],T[n],T[r]);const L=[];let I,R=k.concat();for(let t=0,e=E.length;t<e;t++){const e=E[t];I=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),I[t]=P(e[t],e[r],e[i]);L.push(I),R=R.concat(I)}for(let t=0;t<f;t++){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=h*Math.sin(e*Math.PI/2)+p;for(let t=0,e=T.length;t<e;t++){const e=A(T[t],k[t],r);F(e.x,e.y,-n)}for(let t=0,e=E.length;t<e;t++){const e=E[t];I=L[t];for(let t=0,i=e.length;t<i;t++){const i=A(e[t],I[t],r);F(i.x,i.y,-n)}}}const D=h+p;for(let t=0;t<C;t++){const e=l?A(S[t],R[t],D):S[t];x?(_.copy(y.normals[0]).multiplyScalar(e.x),v.copy(y.binormals[0]).multiplyScalar(e.y),b.copy(g[0]).add(_).add(v),F(b.x,b.y,b.z)):F(e.x,e.y,0)}for(let t=1;t<=s;t++)for(let e=0;e<C;e++){const n=l?A(S[e],R[e],D):S[e];x?(_.copy(y.normals[t]).multiplyScalar(n.x),v.copy(y.binormals[t]).multiplyScalar(n.y),b.copy(g[t]).add(_).add(v),F(b.x,b.y,b.z)):F(n.x,n.y,u/s*t)}for(let t=f-1;t>=0;t--){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=h*Math.sin(e*Math.PI/2)+p;for(let t=0,e=T.length;t<e;t++){const e=A(T[t],k[t],r);F(e.x,e.y,u+n)}for(let t=0,e=E.length;t<e;t++){const e=E[t];I=L[t];for(let t=0,i=e.length;t<i;t++){const i=A(e[t],I[t],r);x?F(i.x,i.y+g[s-1].y,g[s-1].x+n):F(i.x,i.y,u+n)}}}function N(t,e){let n=t.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=t.length-1);for(let t=0,n=s+2*f;t<n;t++){const n=C*t,o=C*(t+1);B(e+r+n,e+i+n,e+i+o,e+r+o)}}}function F(t,e,n){o.push(t),o.push(e),o.push(n)}function z(t,e,i){j(t),j(e),j(i);const o=r.length/3,a=m.generateTopUV(n,r,o-3,o-2,o-1);U(a[0]),U(a[1]),U(a[2])}function B(t,e,i,o){j(t),j(e),j(o),j(e),j(i),j(o);const a=r.length/3,s=m.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);U(s[0]),U(s[1]),U(s[3]),U(s[1]),U(s[2]),U(s[3])}function j(t){r.push(o[3*t+0]),r.push(o[3*t+1]),r.push(o[3*t+2])}function U(t){i.push(t.x),i.push(t.y)}!function(){const t=r.length/3;if(l){let t=0,e=C*t;for(let t=0;t<O;t++){const n=M[t];z(n[2]+e,n[1]+e,n[0]+e)}t=s+2*f,e=C*t;for(let t=0;t<O;t++){const n=M[t];z(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<O;t++){const e=M[t];z(e[2],e[1],e[0])}for(let t=0;t<O;t++){const e=M[t];z(e[0]+C*s,e[1]+C*s,e[2]+C*s)}}n.addGroup(t,r.length/3-t,0)}(),function(){const t=r.length/3;let e=0;N(T,e),e+=T.length;for(let t=0,n=E.length;t<n;t++){const n=E[t];N(n,e),e+=n.length}n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new Nr(r,3)),this.setAttribute("uv",new Nr(i,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){const r=t[e];n.shapes.push(r.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let r=0,i=t.shapes.length;r<i;r++){const i=e[t.shapes[r]];n.push(i)}const r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=(new wu[r.type]).fromJSON(r)),new el(n,t.options)}}const nl={generateTopUV:function(t,e,n,r,i){const o=e[3*n],a=e[3*n+1],s=e[3*r],u=e[3*r+1],l=e[3*i],c=e[3*i+1];return[new Ue(o,a),new Ue(s,u),new Ue(l,c)]},generateSideWallUV:function(t,e,n,r,i,o){const a=e[3*n],s=e[3*n+1],u=e[3*n+2],l=e[3*r],c=e[3*r+1],h=e[3*r+2],p=e[3*i],f=e[3*i+1],d=e[3*i+2],m=e[3*o],g=e[3*o+1],y=e[3*o+2];return Math.abs(s-c)<Math.abs(a-l)?[new Ue(a,1-u),new Ue(l,1-h),new Ue(p,1-d),new Ue(m,1-y)]:[new Ue(s,1-u),new Ue(c,1-h),new Ue(f,1-d),new Ue(g,1-y)]}};class rl extends Gr{constructor(t=new Au([new Ue(0,.5),new Ue(-.5,-.5),new Ue(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],r=[],i=[],o=[];let a=0,s=0;if(!1===Array.isArray(t))u(t);else for(let e=0;e<t.length;e++)u(t[e]),this.addGroup(a,s,e),a+=s,s=0;function u(t){const a=r.length/3,u=t.extractPoints(e);let l=u.shape;const c=u.holes;!1===Ju.isClockWise(l)&&(l=l.reverse());for(let t=0,e=c.length;t<e;t++){const e=c[t];!0===Ju.isClockWise(e)&&(c[t]=e.reverse())}const h=Ju.triangulateShape(l,c);for(let t=0,e=c.length;t<e;t++){const e=c[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){const e=l[t];r.push(e.x,e.y,0),i.push(0,0,1),o.push(e.x,e.y)}for(let t=0,e=h.length;t<e;t++){const e=h[t],r=e[0]+a,i=e[1]+a,o=e[2]+a;n.push(r,i,o),s+=3}}this.setIndex(n),this.setAttribute("position",new Nr(r,3)),this.setAttribute("normal",new Nr(i,3)),this.setAttribute("uv",new Nr(o,2))}toJSON(){const t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,r=t.length;n<r;n++){const r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){const n=[];for(let r=0,i=t.shapes.length;r<i;r++){const i=e[t.shapes[r]];n.push(i)}return new rl(n,t.curveSegments)}}class il extends Gr{constructor(t=1,e=32,n=16,r=0,i=2*Math.PI,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const s=Math.min(o+a,Math.PI);let u=0;const l=[],c=new dn,h=new dn,p=[],f=[],d=[],m=[];for(let p=0;p<=n;p++){const g=[],y=p/n;let v=0;0==p&&0==o?v=.5/e:p==n&&s==Math.PI&&(v=-.5/e);for(let n=0;n<=e;n++){const s=n/e;c.x=-t*Math.cos(r+s*i)*Math.sin(o+y*a),c.y=t*Math.cos(o+y*a),c.z=t*Math.sin(r+s*i)*Math.sin(o+y*a),f.push(c.x,c.y,c.z),h.copy(c).normalize(),d.push(h.x,h.y,h.z),m.push(s+v,1-y),g.push(u++)}l.push(g)}for(let t=0;t<n;t++)for(let r=0;r<e;r++){const e=l[t][r+1],i=l[t][r],a=l[t+1][r],u=l[t+1][r+1];(0!==t||o>0)&&p.push(e,i,u),(t!==n-1||s<Math.PI)&&p.push(i,a,u)}this.setIndex(p),this.setAttribute("position",new Nr(f,3)),this.setAttribute("normal",new Nr(d,3)),this.setAttribute("uv",new Nr(m,2))}static fromJSON(t){return new il(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class ol extends Gr{constructor(t=new bu(new dn(-1,-1,0),new dn(-1,1,0),new dn(1,1,0)),e=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i};const o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new dn,s=new dn,u=new Ue;let l=new dn;const c=[],h=[],p=[],f=[];function d(i){l=t.getPointAt(i/e,l);const u=o.normals[i],p=o.binormals[i];for(let t=0;t<=r;t++){const e=t/r*Math.PI*2,i=Math.sin(e),o=-Math.cos(e);s.x=o*u.x+i*p.x,s.y=o*u.y+i*p.y,s.z=o*u.z+i*p.z,s.normalize(),h.push(s.x,s.y,s.z),a.x=l.x+n*s.x,a.y=l.y+n*s.y,a.z=l.z+n*s.z,c.push(a.x,a.y,a.z)}}!function(){for(let t=0;t<e;t++)d(t);d(!1===i?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=r;n++)u.x=t/e,u.y=n/r,p.push(u.x,u.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=r;e++){const n=(r+1)*(t-1)+(e-1),i=(r+1)*t+(e-1),o=(r+1)*t+e,a=(r+1)*(t-1)+e;f.push(n,i,a),f.push(i,o,a)}}()}(),this.setIndex(f),this.setAttribute("position",new Nr(c,3)),this.setAttribute("normal",new Nr(h,3)),this.setAttribute("uv",new Nr(p,2))}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new ol((new wu[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class al extends Or{constructor(t){super(),this.type="ShadowMaterial",this.color=new en(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}al.prototype.isShadowMaterial=!0;class sl extends di{constructor(t){super(t),this.type="RawShaderMaterial"}}sl.prototype.isRawShaderMaterial=!0;class ul extends Or{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new en(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Se,this.normalScale=new Ue(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this}}ul.prototype.isMeshStandardMaterial=!0;class ll extends ul{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ue(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Fe(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new en(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new en(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new en(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(t)}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}ll.prototype.isMeshPhysicalMaterial=!0;class cl extends Or{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new en(16777215),this.specular=new en(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Se,this.normalScale=new Ue(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this}}cl.prototype.isMeshPhongMaterial=!0;class hl extends Or{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new en(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Se,this.normalScale=new Ue(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}hl.prototype.isMeshToonMaterial=!0;class pl extends Or{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Se,this.normalScale=new Ue(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}pl.prototype.isMeshNormalMaterial=!0;class fl extends Or{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new en(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new en(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}fl.prototype.isMeshLambertMaterial=!0;class dl extends Or{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new en(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Se,this.normalScale=new Ue(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this}}dl.prototype.isMeshMatcapMaterial=!0;class ml extends Zs{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}ml.prototype.isLineDashedMaterial=!0;const gl={ShadowMaterial:al,SpriteMaterial:ms,RawShaderMaterial:sl,ShaderMaterial:di,PointsMaterial:Js,MeshPhysicalMaterial:ll,MeshStandardMaterial:ul,MeshPhongMaterial:cl,MeshToonMaterial:hl,MeshNormalMaterial:pl,MeshLambertMaterial:fl,MeshDepthMaterial:qa,MeshDistanceMaterial:Ya,MeshBasicMaterial:Pr,MeshMatcapMaterial:dl,LineDashedMaterial:ml,LineBasicMaterial:Zs,Material:Or};Or.fromType=function(t){return new gl[t]};const yl={arraySlice:function(t,e,n){return yl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const r=n[o]*e;for(let n=0;n!==e;++n)i[a++]=t[r+n]}return i},flattenJSON:function(t,e,n,r){let i=1,o=t[0];for(;void 0!==o&&void 0===o[r];)o=t[i++];if(void 0===o)return;let a=o[r];if(void 0!==a)if(Array.isArray(a))do{a=o[r],void 0!==a&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{a=o[r],void 0!==a&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{a=o[r],void 0!==a&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)},subclip:function(t,e,n,r,i=30){const o=t.clone();o.name=e;const a=[];for(let t=0;t<o.tracks.length;++t){const e=o.tracks[t],s=e.getValueSize(),u=[],l=[];for(let t=0;t<e.times.length;++t){const o=e.times[t]*i;if(!(o<n||o>=r)){u.push(e.times[t]);for(let n=0;n<s;++n)l.push(e.values[t*s+n])}}0!==u.length&&(e.times=yl.convertArray(u,e.times.constructor),e.values=yl.convertArray(l,e.values.constructor),a.push(e))}o.tracks=a;let s=1/0;for(let t=0;t<o.tracks.length;++t)s>o.tracks[t].times[0]&&(s=o.tracks[t].times[0]);for(let t=0;t<o.tracks.length;++t)o.tracks[t].shift(-1*s);return o.resetDuration(),o},makeClipAdditive:function(t,e=0,n=t,r=30){r<=0&&(r=30);const i=n.tracks.length,o=e/r;for(let e=0;e<i;++e){const r=n.tracks[e],i=r.ValueTypeName;if("bool"===i||"string"===i)continue;const a=t.tracks.find((function(t){return t.name===r.name&&t.ValueTypeName===i}));if(void 0===a)continue;let s=0;const u=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=u/3);let l=0;const c=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=c/3);const h=r.times.length-1;let p;if(o<=r.times[0]){const t=s,e=u-s;p=yl.arraySlice(r.values,t,e)}else if(o>=r.times[h]){const t=h*u+s,e=t+u-s;p=yl.arraySlice(r.values,t,e)}else{const t=r.createInterpolant(),e=s,n=u-s;t.evaluate(o),p=yl.arraySlice(t.resultBuffer,e,n)}"quaternion"===i&&(new fn).fromArray(p).normalize().conjugate().toArray(p);const f=a.times.length;for(let t=0;t<f;++t){const e=t*c+l;if("quaternion"===i)fn.multiplyQuaternionsFlat(a.values,e,p,0,a.values,e);else{const t=c-2*l;for(let n=0;n<t;++n)a.values[e+n]-=p[n]}}}return t.blendMode=2501,t}};class vl{constructor(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{let o;n:{r:if(!(t<r)){for(let o=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===o)break;if(i=r,r=e[++n],t<r)break e}o=e.length;break n}if(t>=i)break t;{const a=e[1];t<a&&(n=2,i=a);for(let o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===o)break;if(r=i,i=e[--n-1],t>=i)break e}o=n,n=0}}for(;n<o;){const r=n+o>>>1;t<e[r]?o=r:n=r+1}if(r=e[n],i=e[n-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r;for(let t=0;t!==r;++t)e[t]=n[i+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}vl.prototype.beforeStart_=vl.prototype.copySampleValue_,vl.prototype.afterEnd_=vl.prototype.copySampleValue_;class _l extends vl{constructor(t,e,n,r){super(t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ye,endingEnd:ye}}intervalChanged_(t,e,n){const r=this.parameterPositions;let i=t-2,o=t+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case ve:i=t,a=2*e-n;break;case _e:i=r.length-2,a=e+r[i]-r[i+1];break;default:i=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case ve:o=t,s=2*n-e;break;case _e:o=1,s=n+r[1]-r[0];break;default:o=t-1,s=e}const u=.5*(n-e),l=this.valueSize;this._weightPrev=u/(e-a),this._weightNext=u/(s-n),this._offsetPrev=i*l,this._offsetNext=o*l}interpolate_(t,e,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,u=s-a,l=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,p=this._weightNext,f=(n-e)/(r-e),d=f*f,m=d*f,g=-h*m+2*h*d-h*f,y=(1+h)*m+(-1.5-2*h)*d+(-.5+h)*f+1,v=(-1-p)*m+(1.5+p)*d+.5*f,_=p*m-p*d;for(let t=0;t!==a;++t)i[t]=g*o[l+t]+y*o[u+t]+v*o[s+t]+_*o[c+t];return i}}class bl extends vl{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,u=s-a,l=(n-e)/(r-e),c=1-l;for(let t=0;t!==a;++t)i[t]=o[u+t]*c+o[s+t]*l;return i}}class xl extends vl{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class wl{constructor(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=yl.convertArray(e,this.TimeBufferType),this.values=yl.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:yl.convertArray(t.times,Array),values:yl.convertArray(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(n.interpolation=e)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new xl(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new bl(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new _l(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case de:e=this.InterpolantFactoryMethodDiscrete;break;case me:e=this.InterpolantFactoryMethodLinear;break;case ge:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return de;case this.InterpolantFactoryMethodLinear:return me;case this.InterpolantFactoryMethodSmooth:return ge}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]*=t}return this}trim(t,e){const n=this.times,r=n.length;let i=0,o=r-1;for(;i!==r&&n[i]<t;)++i;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==i||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const t=this.getValueSize();this.times=yl.arraySlice(n,i,o),this.values=yl.arraySlice(this.values,i*t,o*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==i;e++){const r=n[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==o&&o>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,o),t=!1;break}o=r}if(void 0!==r&&yl.isTypedArray(r))for(let e=0,n=r.length;e!==n;++e){const n=r[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=yl.arraySlice(this.times),e=yl.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===ge,i=t.length-1;let o=1;for(let a=1;a<i;++a){let i=!1;const s=t[a];if(s!==t[a+1]&&(1!==a||s!==t[0]))if(r)i=!0;else{const t=a*n,r=t-n,o=t+n;for(let a=0;a!==n;++a){const n=e[t+a];if(n!==e[r+a]||n!==e[o+a]){i=!0;break}}}if(i){if(a!==o){t[o]=t[a];const r=a*n,i=o*n;for(let t=0;t!==n;++t)e[i+t]=e[r+t]}++o}}if(i>0){t[o]=t[i];for(let t=i*n,r=o*n,a=0;a!==n;++a)e[r+a]=e[t+a];++o}return o!==t.length?(this.times=yl.arraySlice(t,0,o),this.values=yl.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this}clone(){const t=yl.arraySlice(this.times,0),e=yl.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}wl.prototype.TimeBufferType=Float32Array,wl.prototype.ValueBufferType=Float32Array,wl.prototype.DefaultInterpolation=me;class Sl extends wl{}Sl.prototype.ValueTypeName="bool",Sl.prototype.ValueBufferType=Array,Sl.prototype.DefaultInterpolation=de,Sl.prototype.InterpolantFactoryMethodLinear=void 0,Sl.prototype.InterpolantFactoryMethodSmooth=void 0;class El extends wl{}El.prototype.ValueTypeName="color";class Ml extends wl{}Ml.prototype.ValueTypeName="number";class Tl extends vl{constructor(t,e,n,r){super(t,e,n,r)}interpolate_(t,e,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-e)/(r-e);let u=t*a;for(let t=u+a;u!==t;u+=4)fn.slerpFlat(i,0,o,u-a,o,u,s);return i}}class Al extends wl{InterpolantFactoryMethodLinear(t){return new Tl(this.times,this.values,this.getValueSize(),t)}}Al.prototype.ValueTypeName="quaternion",Al.prototype.DefaultInterpolation=me,Al.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends wl{}Cl.prototype.ValueTypeName="string",Cl.prototype.ValueBufferType=Array,Cl.prototype.DefaultInterpolation=de,Cl.prototype.InterpolantFactoryMethodLinear=void 0,Cl.prototype.InterpolantFactoryMethodSmooth=void 0;class Ol extends wl{}Ol.prototype.ValueTypeName="vector";class Pl{constructor(t,e=-1,n,r=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=r,this.uuid=Ne(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,r=1/(t.fps||1);for(let t=0,i=n.length;t!==i;++t)e.push(kl(n[t]).scale(r));const i=new this(t.name,t.duration,e,t.blendMode);return i.uuid=t.uuid,i}static toJSON(t){const e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,r=n.length;t!==r;++t)e.push(wl.toJSON(n[t]));return r}static CreateFromMorphTargetSequence(t,e,n,r){const i=e.length,o=[];for(let t=0;t<i;t++){let a=[],s=[];a.push((t+i-1)%i,t,(t+1)%i),s.push(0,1,0);const u=yl.getKeyframeOrder(a);a=yl.sortedArray(a,1,u),s=yl.sortedArray(s,1,u),r||0!==a[0]||(a.push(i),s.push(s[0])),o.push(new Ml(".morphTargetInfluences["+e[t].name+"]",a,s).scale(1/n))}return new this(t,-1,o)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const e=t;n=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<n.length;t++)if(n[t].name===e)return n[t];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let e=0,n=t.length;e<n;e++){const n=t[e],o=n.name.match(i);if(o&&o.length>1){const t=o[1];let e=r[t];e||(r[t]=e=[]),e.push(n)}}const o=[];for(const t in r)o.push(this.CreateFromMorphTargetSequence(t,r[t],e,n));return o}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,r,i){if(0!==n.length){const o=[],a=[];yl.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.fps||30,a=t.blendMode;let s=t.length||-1;const u=t.hierarchy||[];for(let t=0;t<u.length;t++){const i=u[t].keys;if(i&&0!==i.length)if(i[0].morphTargets){const t={};let e;for(e=0;e<i.length;e++)if(i[e].morphTargets)for(let n=0;n<i[e].morphTargets.length;n++)t[i[e].morphTargets[n]]=-1;for(const n in t){const t=[],o=[];for(let r=0;r!==i[e].morphTargets.length;++r){const r=i[e];t.push(r.time),o.push(r.morphTarget===n?1:0)}r.push(new Ml(".morphTargetInfluence["+n+"]",t,o))}s=t.length*o}else{const o=".bones["+e[t].name+"]";n(Ol,o+".position",i,"pos",r),n(Al,o+".quaternion",i,"rot",r),n(Ol,o+".scale",i,"scl",r)}}return 0===r.length?null:new this(i,s,r,a)}resetDuration(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function kl(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ml;case"vector":case"vector2":case"vector3":case"vector4":return Ol;case"color":return El;case"quaternion":return Al;case"bool":case"boolean":return Sl;case"string":return Cl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],n=[];yl.flattenJSON(t.keys,e,n,"value"),t.times=e,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Ll={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};const Il=new class{constructor(t,e,n){const r=this;let i,o=!1,a=0,s=0;const u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===o&&void 0!==r.onStart&&r.onStart(t,a,s),o=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,s),a===s&&(o=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return i?i(t):t},this.setURLModifier=function(t){return i=t,this},this.addHandler=function(t,e){return u.push(t,e),this},this.removeHandler=function(t){const e=u.indexOf(t);return-1!==e&&u.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=u.length;e<n;e+=2){const n=u[e],r=u[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}};class Rl{constructor(t){this.manager=void 0!==t?t:Il,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Dl={};class Nl extends Rl{constructor(t){super(t)}load(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=Ll.get(t);if(void 0!==i)return this.manager.itemStart(t),setTimeout((()=>{e&&e(i),this.manager.itemEnd(t)}),0),i;if(void 0!==Dl[t])return void Dl[t].push({onLoad:e,onProgress:n,onError:r});Dl[t]=[],Dl[t].push({onLoad:e,onProgress:n,onError:r});const o=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,s=this.responseType;fetch(o).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=Dl[t],r=e.body.getReader(),i=e.headers.get("Content-Length"),o=i?parseInt(i):0,a=0!==o;let s=0;const u=new ReadableStream({start(t){!function e(){r.read().then((({done:r,value:i})=>{if(r)t.close();else{s+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:a,loaded:s,total:o});for(let t=0,e=n.length;t<e;t++){const e=n[t];e.onProgress&&e.onProgress(r)}t.enqueue(i),e()}}))}()}});return new Response(u)}throw Error(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`)})).then((t=>{switch(s){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),n=e&&e[1]?e[1].toLowerCase():void 0,r=new TextDecoder(n);return t.arrayBuffer().then((t=>r.decode(t)))}}})).then((e=>{Ll.add(t,e);const n=Dl[t];delete Dl[t];for(let t=0,r=n.length;t<r;t++){const r=n[t];r.onLoad&&r.onLoad(e)}})).catch((e=>{const n=Dl[t];if(void 0===n)throw this.manager.itemError(t),e;delete Dl[t];for(let t=0,r=n.length;t<r;t++){const r=n[t];r.onError&&r.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Fl extends Rl{constructor(t){super(t)}load(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,o=Ll.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;const a=Ge("img");function s(){l(),Ll.add(t,this),e&&e(this),i.manager.itemEnd(t)}function u(e){l(),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}function l(){a.removeEventListener("load",s,!1),a.removeEventListener("error",u,!1)}return a.addEventListener("load",s,!1),a.addEventListener("error",u,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(t),a.src=t,a}}class zl extends Rl{constructor(t){super(t)}load(t,e,n,r){const i=new _i,o=new Fl(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function s(n){o.load(t[n],(function(t){i.images[n]=t,a++,6===a&&(i.needsUpdate=!0,e&&e(i))}),void 0,r)}for(let e=0;e<t.length;++e)s(e);return i}}class Bl extends Rl{constructor(t){super(t)}load(t,e,n,r){const i=new un,o=new Fl(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(t){i.image=t,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}class jl extends gr{constructor(t,e=1){super(),this.type="Light",this.color=new en(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}jl.prototype.isLight=!0;(class extends jl{constructor(t,e,n){super(t,n),this.type="HemisphereLight",this.position.copy(gr.DefaultUp),this.updateMatrix(),this.groundColor=new en(e)}copy(t){return jl.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}).prototype.isHemisphereLight=!0;const Ul=new Hn,Zl=new dn,Vl=new dn;class Gl{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ue(512,512),this.map=null,this.mapPass=null,this.matrix=new Hn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ai,this._frameExtents=new Ue(1,1),this._viewportCount=1,this._viewports=[new ln(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Zl.setFromMatrixPosition(t.matrixWorld),e.position.copy(Zl),Vl.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Vl),e.updateMatrixWorld(),Ul.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ul),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Hl extends Gl{constructor(){super(new gi(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,n=2*De*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Hl.prototype.isSpotLightShadow=!0;(class extends jl{constructor(t,e,n=0,r=Math.PI/3,i=0,o=1){super(t,e),this.type="SpotLight",this.position.copy(gr.DefaultUp),this.updateMatrix(),this.target=new gr,this.distance=n,this.angle=r,this.penumbra=i,this.decay=o,this.shadow=new Hl}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}).prototype.isSpotLight=!0;const Wl=new Hn,ql=new dn,Yl=new dn;class Xl extends Gl{constructor(){super(new gi(90,1,.5,500)),this._frameExtents=new Ue(4,2),this._viewportCount=6,this._viewports=[new ln(2,1,1,1),new ln(0,1,1,1),new ln(3,1,1,1),new ln(1,1,1,1),new ln(3,0,1,1),new ln(1,0,1,1)],this._cubeDirections=[new dn(1,0,0),new dn(-1,0,0),new dn(0,0,1),new dn(0,0,-1),new dn(0,1,0),new dn(0,-1,0)],this._cubeUps=[new dn(0,1,0),new dn(0,1,0),new dn(0,1,0),new dn(0,1,0),new dn(0,0,1),new dn(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,r=this.matrix,i=t.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),ql.setFromMatrixPosition(t.matrixWorld),n.position.copy(ql),Yl.copy(n.position),Yl.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Yl),n.updateMatrixWorld(),r.makeTranslation(-ql.x,-ql.y,-ql.z),Wl.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Wl)}}Xl.prototype.isPointLightShadow=!0;(class extends jl{constructor(t,e,n=0,r=1){super(t,e),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new Xl}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}).prototype.isPointLight=!0;class $l extends Gl{constructor(){super(new ji(-5,5,5,-5,.5,500))}}$l.prototype.isDirectionalLightShadow=!0;class Kl extends jl{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(gr.DefaultUp),this.updateMatrix(),this.target=new gr,this.shadow=new $l}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}Kl.prototype.isDirectionalLight=!0;class Jl extends jl{constructor(t,e){super(t,e),this.type="AmbientLight"}}Jl.prototype.isAmbientLight=!0;(class extends jl{constructor(t,e,n=10,r=10){super(t,e),this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}).prototype.isRectAreaLight=!0;class Ql{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new dn)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*r),e.addScaledVector(o[2],.488603*i),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*r*1.092548),e.addScaledVector(o[5],r*i*1.092548),e.addScaledVector(o[6],.315392*(3*i*i-1)),e.addScaledVector(o[7],n*i*1.092548),e.addScaledVector(o[8],.546274*(n*n-r*r)),e}getIrradianceAt(t,e){const n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*r),e.addScaledVector(o[2],1.023328*i),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*r),e.addScaledVector(o[5],.858086*r*i),e.addScaledVector(o[6],.743125*i*i-.247708),e.addScaledVector(o[7],.858086*n*i),e.addScaledVector(o[8],.429043*(n*n-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)}}Ql.prototype.isSphericalHarmonics3=!0;class tc extends jl{constructor(t=new Ql,e=1){super(void 0,e),this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}tc.prototype.isLightProbe=!0;class ec{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}}let nc;(class extends Gr{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}).prototype.isInstancedBufferGeometry=!0,class extends Rl{constructor(t){super(t),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,o=Ll.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;const a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(t,a).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){Ll.add(t,n),e&&e(n),i.manager.itemEnd(t)})).catch((function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)})),i.manager.itemStart(t)}}.prototype.isImageBitmapLoader=!0;class rc extends Rl{constructor(t){super(t)}load(t,e,n,r){const i=this,o=new Nl(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(n){try{const t=n.slice(0);(void 0===nc&&(nc=new(window.AudioContext||window.webkitAudioContext)),nc).decodeAudioData(t,(function(t){e(t)}))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)}}(class extends tc{constructor(t,e,n=1){super(void 0,n);const r=(new en).set(t),i=(new en).set(e),o=new dn(r.r,r.g,r.b),a=new dn(i.r,i.g,i.b),s=Math.sqrt(Math.PI),u=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(u)}}).prototype.isHemisphereLightProbe=!0,class extends tc{constructor(t,e=1){super(void 0,e);const n=(new en).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}.prototype.isAmbientLightProbe=!0;class ic{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=oc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=oc();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function oc(){return("undefined"==typeof performance?Date:performance).now()}class ac{constructor(t,e,n){let r,i,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const n=this.buffer,r=this.valueSize,i=t*r+r;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==r;++t)n[i+t]=n[t];o=e}else{o+=e;const t=e/o;this._mixBufferRegion(n,i,0,t,r)}this.cumulativeWeight=o}accumulateAdditive(t){const e=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const t=e*this._origIndex;this._mixBufferRegion(n,r,t,1-i,e)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(let t=e,i=e+e;t!==i;++t)if(n[t]!==n[t+e]){a.setValue(n,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(let t=n,i=r;t!==i;++t)e[t]=e[r+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}_select(t,e,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)t[e+r]=t[n+r]}_slerp(t,e,n,r){fn.slerpFlat(t,e,t,e,t,n,r)}_slerpAdditive(t,e,n,r,i){const o=this._workIndex*i;fn.multiplyQuaternionsFlat(t,o,t,e,t,n),fn.slerpFlat(t,e,t,e,t,o,r)}_lerp(t,e,n,r,i){const o=1-r;for(let a=0;a!==i;++a){const i=e+a;t[i]=t[i]*o+t[n+a]*r}}_lerpAdditive(t,e,n,r,i){for(let o=0;o!==i;++o){const i=e+o;t[i]=t[i]+t[n+o]*r}}}const sc="\\[\\]\\.:\\/",uc=new RegExp("["+sc+"]","g"),lc="[^"+sc+"]",cc="[^"+sc.replace("\\.","")+"]",hc=/((?:WC+[\/:])*)/.source.replace("WC",lc),pc=/(WCOD+)?/.source.replace("WCOD",cc),fc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",lc),dc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",lc),mc=new RegExp("^"+hc+pc+fc+dc+"$"),gc=["material","materials","bones"];class yc{constructor(t,e,n){this.path=e,this.parsedPath=n||yc.parseTrackName(e),this.node=yc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new yc.Composite(t,e,n):new yc(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(uc,"")}static parseTrackName(t){const e=mc.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const t=n.nodeName.substring(r+1);-1!==gc.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.name===e||i.uuid===e)return i;const o=n(i.children);if(o)return o}return null},r=n(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)t[e++]=n[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let i=e.propertyIndex;if(t||(t=yc.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===r){r=e;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==r){if(void 0===t[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[r]}}const o=t[r];if(void 0===o){const n=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[i]&&(i=t.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=i}else void 0!==o.fromArray&&void 0!==o.toArray?(s=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(s=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}yc.Composite=class{constructor(t,e,n){const r=n||yc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}getValue(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)}setValue(t,e){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},yc.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},yc.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},yc.prototype.GetterByBindingType=[yc.prototype._getValue_direct,yc.prototype._getValue_array,yc.prototype._getValue_arrayElement,yc.prototype._getValue_toArray],yc.prototype.SetterByBindingTypeAndVersioning=[[yc.prototype._setValue_direct,yc.prototype._setValue_direct_setNeedsUpdate,yc.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[yc.prototype._setValue_array,yc.prototype._setValue_array_setNeedsUpdate,yc.prototype._setValue_array_setMatrixWorldNeedsUpdate],[yc.prototype._setValue_arrayElement,yc.prototype._setValue_arrayElement_setNeedsUpdate,yc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[yc.prototype._setValue_fromArray,yc.prototype._setValue_fromArray_setNeedsUpdate,yc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class vc{constructor(t,e,n=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=r;const i=e.tracks,o=i.length,a=new Array(o),s={endingStart:ye,endingEnd:ye};for(let t=0;t!==o;++t){const e=i[t].createInterpolant(null);a[t]=e,e.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,r=t._clip.duration,i=r/n,o=n/r;t.warp(1,i,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const r=this._mixer,i=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+n,u[0]=t/o,u[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);const i=this._startTime;if(null!==i){const r=(t-i)*n;if(r<0||0===n)return;this._startTime=null,e=n*r}e*=this._updateTimeScale(t);const o=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(o),e[n].accumulateAdditive(a);else for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(o),e[n].accumulate(r,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;null!==n&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let r=this.time+t,i=this._loopCount;const o=2202===n;if(0===t)return-1===i?r:o&&1==(1&i)?e-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=e||r<0){const n=Math.floor(r/e);r-=e*n,i+=Math.abs(n);const a=this.repetitions-i;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(o&&1==(1&i))return e-r}return r}_setEndings(t,e,n){const r=this._interpolantSettings;n?(r.endingStart=ve,r.endingEnd=ve):(r.endingStart=t?this.zeroSlopeAtStart?ve:ye:_e,r.endingEnd=e?this.zeroSlopeAtEnd?ve:ye:_e)}_scheduleFading(t,e,n){const r=this._mixer,i=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}(class extends Le{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,u=this._bindingsByRootAndName;let l=u[s];void 0===l&&(l={},u[s]=l);for(let t=0;t!==i;++t){const i=r[t],u=i.name;let c=l[u];if(void 0!==c)++c.referenceCount,o[t]=c;else{if(c=o[t],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,s,u));continue}const r=e&&e._propertyBindings[t].binding.parsedPath;c=new ac(yc.create(n,u,r),i.ValueTypeName,i.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,s,u),o[t]=c}a[t].resultBuffer=c.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,n){const r=this._actions,i=this._actionsByClip;let o=i[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[n]=t}_removeInactiveAction(t){const e=this._actions,n=e[e.length-1],r=t._cacheIndex;n._cacheIndex=r,e[r]=n,e.pop(),t._cacheIndex=null;const i=t._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,u=s[s.length-1],l=t._byClipCacheIndex;u._byClipCacheIndex=l,s[l]=u,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(t){const e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}_takeBackAction(t){const e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}_addInactiveBinding(t,e,n){const r=this._bindingsByRootAndName,i=this._bindings;let o=r[e];void 0===o&&(o={},r[e]=o),o[n]=t,t._cacheIndex=i.length,i.push(t)}_removeInactiveBinding(t){const e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],u=t._cacheIndex;s._cacheIndex=u,e[u]=s,e.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]}_lendBinding(t){const e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}_takeBackBinding(t){const e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let n=t[e];return void 0===n&&(n=new bl(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=e,t[e]=n),n}_takeBackControlInterpolant(t){const e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];t.__cacheIndex=r,e[r]=t,i.__cacheIndex=n,e[n]=i}clipAction(t,e,n){const r=e||this._root,i=r.uuid;let o="string"==typeof t?Pl.findByName(r,t):t;const a=null!==o?o.uuid:t,s=this._actionsByClip[a];let u=null;if(void 0===n&&(n=null!==o?o.blendMode:2500),void 0!==s){const t=s.actionByRoot[i];if(void 0!==t&&t.blendMode===n)return t;u=s.knownActions[0],null===o&&(o=u._clip)}if(null===o)return null;const l=new vc(this,o,e,n);return this._bindAction(l,u),this._addInactiveAction(l,a,i),l}existingAction(t,e){const n=e||this._root,r=n.uuid,i="string"==typeof t?Pl.findByName(n,t):t,o=i?i.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1;for(let a=0;a!==n;++a)e[a]._update(r,t,i,o);const a=this._bindings,s=this._nActiveBindings;for(let t=0;t!==s;++t)a[t].apply(o);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const t=i.knownActions;for(let n=0,r=t.length;n!==r;++n){const r=t[n];this._deactivateAction(r);const i=r._cacheIndex,o=e[e.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,o._cacheIndex=i,e[i]=o,e.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(t){const e=t.uuid,n=this._actionsByClip;for(const t in n){const r=n[t].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}const r=this._bindingsByRootAndName[e];if(void 0!==r)for(const t in r){const e=r[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}).prototype._controlInterpolantsResultBuffer=new Float32Array(1);class _c{constructor(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}clone(){return new _c(void 0===this.value.clone?this.value:this.value.clone())}}(class extends ps{constructor(t,e,n=1){super(t,e),this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}).prototype.isInstancedInterleavedBuffer=!0;class bc{constructor(t,e,n=0,r=1/0){this.ray=new Gn(t,e),this.near=n,this.far=r,this.camera=null,this.layers=new nr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}intersectObject(t,e=!0,n=[]){return wc(t,this,n,e),n.sort(xc),n}intersectObjects(t,e=!0,n=[]){for(let r=0,i=t.length;r<i;r++)wc(t[r],this,n,e);return n.sort(xc),n}}function xc(t,e){return t.distance-e.distance}function wc(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r){const r=t.children;for(let t=0,i=r.length;t<i;t++)wc(r[t],e,n,!0)}}class Sc{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Fe(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const Ec=new Ue;class Mc{constructor(t=new Ue(1/0,1/0),e=new Ue(-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Ec.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Ec.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}Mc.prototype.isBox2=!0;const Tc=new dn,Ac=new Hn,Cc=new Hn;function Oc(t){const e=[];!0===t.isBone&&e.push(t);for(let n=0;n<t.children.length;n++)e.push.apply(e,Oc(t.children[n]));return e}const Pc=new ArrayBuffer(4),kc=(new Float32Array(Pc),new Uint32Array(Pc),new Uint32Array(512)),Lc=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(kc[t]=0,kc[256|t]=32768,Lc[t]=24,Lc[256|t]=24):e<-14?(kc[t]=1024>>-e-14,kc[256|t]=1024>>-e-14|32768,Lc[t]=-e-1,Lc[256|t]=-e-1):e<=15?(kc[t]=e+15<<10,kc[256|t]=e+15<<10|32768,Lc[t]=13,Lc[256|t]=13):e<128?(kc[t]=31744,kc[256|t]=64512,Lc[t]=24,Lc[256|t]=24):(kc[t]=31744,kc[256|t]=64512,Lc[t]=13,Lc[256|t]=13)}const Ic=new Uint32Array(2048),Rc=new Uint32Array(64),Dc=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,Ic[t]=e|n}for(let t=1024;t<2048;++t)Ic[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)Rc[t]=t<<23;Rc[31]=1199570944,Rc[32]=2147483648;for(let t=33;t<63;++t)Rc[t]=2147483648+(t-32<<23);Rc[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(Dc[t]=1024);iu.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(iu.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Eu.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},class extends Ks{constructor(t=10,e=10,n=4473924,r=8947848){n=new en(n),r=new en(r);const i=e/2,o=t/e,a=t/2,s=[],u=[];for(let t=0,l=0,c=-a;t<=e;t++,c+=o){s.push(-a,0,c,a,0,c),s.push(c,0,-a,c,0,a);const e=t===i?n:r;e.toArray(u,l),l+=3,e.toArray(u,l),l+=3,e.toArray(u,l),l+=3,e.toArray(u,l),l+=3}const l=new Gr;l.setAttribute("position",new Nr(s,3)),l.setAttribute("color",new Nr(u,3)),super(l,new Zs({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Ks{constructor(t){const e=Oc(t),n=new Gr,r=[],i=[],o=new en(0,0,1),a=new en(0,1,0);for(let t=0;t<e.length;t++){const n=e[t];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new Nr(r,3)),n.setAttribute("color",new Nr(i,3)),super(n,new Zs({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,n=this.geometry,r=n.getAttribute("position");Cc.copy(this.root.matrixWorld).invert();for(let t=0,n=0;t<e.length;t++){const i=e[t];i.parent&&i.parent.isBone&&(Ac.multiplyMatrices(Cc,i.matrixWorld),Tc.setFromMatrixPosition(Ac),r.setXYZ(n,Tc.x,Tc.y,Tc.z),Ac.multiplyMatrices(Cc,i.parent.matrixWorld),Tc.setFromMatrixPosition(Ac),r.setXYZ(n+1,Tc.x,Tc.y,Tc.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}}.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Rl.prototype.extractUrlBase=function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),ec.extractUrlBase(t)},Rl.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Mc.prototype.center=function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},Mc.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Mc.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},Mc.prototype.size=function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)},yn.prototype.center=function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},yn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},yn.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},yn.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},yn.prototype.size=function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)},er.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")},Nn.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Ai.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Ze.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},Ze.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},Ze.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Ze.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},Ze.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Ze.prototype.getInverse=function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},Hn.prototype.extractPosition=function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},Hn.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},Hn.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new dn).setFromMatrixColumn(this,3)},Hn.prototype.setRotationFromQuaternion=function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},Hn.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Hn.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},Hn.prototype.multiplyVector4=function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},Hn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Hn.prototype.rotateAxis=function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},Hn.prototype.crossVector=function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},Hn.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Hn.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Hn.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Hn.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Hn.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Hn.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},Hn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Hn.prototype.makeFrustum=function(t,e,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)},Hn.prototype.getInverse=function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},Ei.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},fn.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},fn.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},Gn.prototype.isIntersectionBox=function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},Gn.prototype.isIntersectionPlane=function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},Gn.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},Ar.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Ar.prototype.barycoordFromPoint=function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},Ar.prototype.midpoint=function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},Ar.prototypenormal=function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},Ar.prototype.plane=function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)},Ar.barycoordFromPoint=function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ar.getBarycoord(t,e,n,r,i)},Ar.normal=function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ar.getNormal(t,e,n,r)},Au.prototype.extractAllPoints=function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},Au.prototype.extrude=function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new el(this,t)},Au.prototype.makeGeometry=function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new rl(this,t)},Ue.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},Ue.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},Ue.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},dn.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},dn.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},dn.prototype.getPositionFromMatrix=function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},dn.prototype.getScaleFromMatrix=function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},dn.prototype.getColumnFromMatrix=function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},dn.prototype.applyProjection=function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},dn.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},dn.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},dn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ln.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},ln.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},gr.prototype.getChildByName=function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},gr.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},gr.prototype.translate=function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},gr.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},gr.prototype.applyMatrix=function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(gr.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),ui.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(ui.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Ns.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},gi.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(jl.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Ir.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Oe},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Oe)}}}),Ir.prototype.setDynamic=function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Oe:Ce),this},Ir.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Ir.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Gr.prototype.addIndex=function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},Gr.prototype.addAttribute=function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Ir(arguments[1],arguments[2])))},Gr.prototype.addDrawCall=function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},Gr.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},Gr.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},Gr.prototype.removeAttribute=function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},Gr.prototype.applyMatrix=function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(Gr.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),ps.prototype.setDynamic=function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Oe:Ce),this},ps.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},el.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},el.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},el.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},hs.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},_c.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Or.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new en}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(di.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),us.prototype.clearTarget=function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},us.prototype.animate=function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},us.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},us.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},us.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},us.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},us.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},us.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},us.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},us.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},us.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},us.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},us.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},us.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},us.prototype.enableScissorTest=function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},us.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},us.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},us.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},us.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},us.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},us.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},us.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},us.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},us.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},us.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(us.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?xe:be}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}}),Object.defineProperties(Ka.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(cn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),class extends gr{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new rc).load(t,(function(t){e.setBuffer(t)})),this},vi.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},vi.prototype.clear=function(t,e,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,n,r)},rn.crossOrigin=void 0,rn.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new Bl;i.setCrossOrigin(this.crossOrigin);const o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},rn.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new zl;i.setCrossOrigin(this.crossOrigin);const o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},rn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},rn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:l}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=l);const Nc=new Ei,Fc=new bc,zc=new Ue,Bc=new dn,jc=new dn,Uc=new dn,Zc=new Hn;class Vc extends Le{constructor(t,e,n){super(),n.style.touchAction="none";let r=null,i=null;const o=[],a=this;function s(){n.addEventListener("pointermove",l),n.addEventListener("pointerdown",c),n.addEventListener("pointerup",h),n.addEventListener("pointerleave",h)}function u(){n.removeEventListener("pointermove",l),n.removeEventListener("pointerdown",c),n.removeEventListener("pointerup",h),n.removeEventListener("pointerleave",h),n.style.cursor=""}function l(s){if(!1!==a.enabled){if(p(s),Fc.setFromCamera(zc,e),r)return Fc.ray.intersectPlane(Nc,jc)&&r.position.copy(jc.sub(Bc).applyMatrix4(Zc)),void a.dispatchEvent({type:"drag",object:r});if("mouse"===s.pointerType||"pen"===s.pointerType)if(o.length=0,Fc.setFromCamera(zc,e),Fc.intersectObjects(t,!0,o),o.length>0){const t=o[0].object;Nc.setFromNormalAndCoplanarPoint(e.getWorldDirection(Nc.normal),Uc.setFromMatrixPosition(t.matrixWorld)),i!==t&&null!==i&&(a.dispatchEvent({type:"hoveroff",object:i}),n.style.cursor="auto",i=null),i!==t&&(a.dispatchEvent({type:"hoveron",object:t}),n.style.cursor="pointer",i=t)}else null!==i&&(a.dispatchEvent({type:"hoveroff",object:i}),n.style.cursor="auto",i=null)}}function c(i){!1!==a.enabled&&(p(i),o.length=0,Fc.setFromCamera(zc,e),Fc.intersectObjects(t,!0,o),o.length>0&&(r=!0===a.transformGroup?t[0]:o[0].object,Nc.setFromNormalAndCoplanarPoint(e.getWorldDirection(Nc.normal),Uc.setFromMatrixPosition(r.matrixWorld)),Fc.ray.intersectPlane(Nc,jc)&&(Zc.copy(r.parent.matrixWorld).invert(),Bc.copy(jc).sub(Uc.setFromMatrixPosition(r.matrixWorld))),n.style.cursor="move",a.dispatchEvent({type:"dragstart",object:r})))}function h(){!1!==a.enabled&&(r&&(a.dispatchEvent({type:"dragend",object:r}),r=null),n.style.cursor=i?"pointer":"auto")}function p(t){const e=n.getBoundingClientRect();zc.x=(t.clientX-e.left)/e.width*2-1,zc.y=-(t.clientY-e.top)/e.height*2+1}s(),this.enabled=!0,this.transformGroup=!1,this.activate=s,this.deactivate=u,this.dispose=function(){u()},this.getObjects=function(){return t},this.getRaycaster=function(){return Fc}}}var Gc={value:()=>{}};function Hc(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Wc(r)}function Wc(t){this._=t}function qc(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Yc(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Gc,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Wc.prototype=Hc.prototype={constructor:Wc,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=Yc(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Yc(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=qc(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Wc(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const Xc=Hc;var $c,Kc,Jc=0,Qc=0,th=0,eh=1e3,nh=0,rh=0,ih=0,oh="object"==typeof performance&&performance.now?performance:Date,ah="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function sh(){return rh||(ah(uh),rh=oh.now()+ih)}function uh(){rh=0}function lh(){this._call=this._time=this._next=null}function ch(t,e,n){var r=new lh;return r.restart(t,e,n),r}function hh(){rh=(nh=oh.now())+ih,Jc=Qc=0;try{!function(){sh(),++Jc;for(var t,e=$c;e;)(t=rh-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Jc}()}finally{Jc=0,function(){for(var t,e,n=$c,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:$c=e);Kc=t,fh(r)}(),rh=0}}function ph(){var t=oh.now(),e=t-nh;e>eh&&(ih-=e,nh=t)}function fh(t){Jc||(Qc&&(Qc=clearTimeout(Qc)),t-rh>24?(t<1/0&&(Qc=setTimeout(hh,t-oh.now()-ih)),th&&(th=clearInterval(th))):(th||(nh=oh.now(),th=setInterval(ph,eh)),Jc=1,ah(hh)))}lh.prototype=ch.prototype={constructor:lh,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?sh():+n)+(null==e?0:+e),this._next||Kc===this||(Kc?Kc._next=this:$c=this,Kc=this),this._call=t,this._time=n,fh()},stop:function(){this._call&&(this._call=null,this._time=1/0,fh())}};const dh=4294967296;function mh(t){return t.x}function gh(t){return t.y}function yh(t){return t.z}var vh=Math.PI*(3-Math.sqrt(5)),_h=20*Math.PI/(9+Math.sqrt(221));function bh(t,e){e=e||2;var n,r=Math.min(3,Math.max(1,Math.round(e))),i=1,o=.001,a=1-Math.pow(o,1/300),s=0,u=.6,l=new Map,c=ch(f),h=Xc("tick","end"),p=function(){let t=1;return()=>(t=(1664525*t+1013904223)%dh)/dh}();function f(){d(),h.call("tick",n),i<o&&(c.stop(),h.call("end",n))}function d(e){var o,c,h=t.length;void 0===e&&(e=1);for(var p=0;p<e;++p)for(i+=(s-i)*a,l.forEach((function(t){t(i)})),o=0;o<h;++o)null==(c=t[o]).fx?c.x+=c.vx*=u:(c.x=c.fx,c.vx=0),r>1&&(null==c.fy?c.y+=c.vy*=u:(c.y=c.fy,c.vy=0)),r>2&&(null==c.fz?c.z+=c.vz*=u:(c.z=c.fz,c.vz=0));return n}function m(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),null!=e.fz&&(e.z=e.fz),isNaN(e.x)||r>1&&isNaN(e.y)||r>2&&isNaN(e.z)){var o=10*(r>2?Math.cbrt(.5+n):r>1?Math.sqrt(.5+n):n),a=n*vh,s=n*_h;1===r?e.x=o:2===r?(e.x=o*Math.cos(a),e.y=o*Math.sin(a)):(e.x=o*Math.sin(a)*Math.cos(s),e.y=o*Math.cos(a),e.z=o*Math.sin(a)*Math.sin(s))}(isNaN(e.vx)||r>1&&isNaN(e.vy)||r>2&&isNaN(e.vz))&&(e.vx=0,r>1&&(e.vy=0),r>2&&(e.vz=0))}}function g(e){return e.initialize&&e.initialize(t,p,r),e}return null==t&&(t=[]),m(),n={tick:d,restart:function(){return c.restart(f),n},stop:function(){return c.stop(),n},numDimensions:function(t){return arguments.length?(r=Math.min(3,Math.max(1,Math.round(t))),l.forEach(g),n):r},nodes:function(e){return arguments.length?(t=e,m(),l.forEach(g),n):t},alpha:function(t){return arguments.length?(i=+t,n):i},alphaMin:function(t){return arguments.length?(o=+t,n):o},alphaDecay:function(t){return arguments.length?(a=+t,n):+a},alphaTarget:function(t){return arguments.length?(s=+t,n):s},velocityDecay:function(t){return arguments.length?(u=1-t,n):1-u},randomSource:function(t){return arguments.length?(p=t,l.forEach(g),n):p},force:function(t,e){return arguments.length>1?(null==e?l.delete(t):l.set(t,g(e)),n):l.get(t)},find:function(){var e,n,i,o,a,s,u=Array.prototype.slice.call(arguments),l=u.shift()||0,c=(r>1?u.shift():null)||0,h=(r>2?u.shift():null)||0,p=u.shift()||1/0,f=0,d=t.length;for(p*=p,f=0;f<d;++f)(o=(e=l-(a=t[f]).x)*e+(n=c-(a.y||0))*n+(i=h-(a.z||0))*i)<p&&(s=a,p=o);return s},on:function(t,e){return arguments.length>1?(h.on(t,e),n):h.on(t)}}}function xh(t){return function(){return t}}function wh(t){return 1e-6*(t()-.5)}function Sh(t){return t.index}function Eh(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Mh(t){var e,n,r,i,o,a,s,u=Sh,l=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},c=xh(30),h=1;function p(r){for(var o=0,u=t.length;o<h;++o)for(var l,c,p,f,d,m=0,g=0,y=0,v=0;m<u;++m)c=(l=t[m]).source,g=(p=l.target).x+p.vx-c.x-c.vx||wh(s),i>1&&(y=p.y+p.vy-c.y-c.vy||wh(s)),i>2&&(v=p.z+p.vz-c.z-c.vz||wh(s)),g*=f=((f=Math.sqrt(g*g+y*y+v*v))-n[m])/f*r*e[m],y*=f,v*=f,p.vx-=g*(d=a[m]),i>1&&(p.vy-=y*d),i>2&&(p.vz-=v*d),c.vx+=g*(d=1-d),i>1&&(c.vy+=y*d),i>2&&(c.vz+=v*d)}function f(){if(r){var i,s,l=r.length,c=t.length,h=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(i=0,o=new Array(l);i<c;++i)(s=t[i]).index=i,"object"!=typeof s.source&&(s.source=Eh(h,s.source)),"object"!=typeof s.target&&(s.target=Eh(h,s.target)),o[s.source.index]=(o[s.source.index]||0)+1,o[s.target.index]=(o[s.target.index]||0)+1;for(i=0,a=new Array(c);i<c;++i)s=t[i],a[i]=o[s.source.index]/(o[s.source.index]+o[s.target.index]);e=new Array(c),d(),n=new Array(c),m()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+l(t[n],n,t)}function m(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),p.initialize=function(t,...e){r=t,s=e.find((t=>"function"==typeof t))||Math.random,i=e.find((t=>[1,2,3].includes(t)))||2,f()},p.links=function(e){return arguments.length?(t=e,f(),p):t},p.id=function(t){return arguments.length?(u=t,p):u},p.iterations=function(t){return arguments.length?(h=+t,p):h},p.strength=function(t){return arguments.length?(l="function"==typeof t?t:xh(+t),d(),p):l},p.distance=function(t){return arguments.length?(c="function"==typeof t?t:xh(+t),m(),p):c},p}function Th(t,e,n){if(isNaN(e))return t;var r,i,o,a,s,u,l=t._root,c={data:n},h=t._x0,p=t._x1;if(!l)return t._root=c,t;for(;l.length;)if((a=e>=(i=(h+p)/2))?h=i:p=i,r=l,!(l=l[s=+a]))return r[s]=c,t;if(e===(o=+t._x.call(null,l.data)))return c.next=l,r?r[s]=c:t._root=c,t;do{r=r?r[s]=new Array(2):t._root=new Array(2),(a=e>=(i=(h+p)/2))?h=i:p=i}while((s=+a)==(u=+(o>=i)));return r[u]=l,r[s]=c,t}function Ah(t,e,n){this.node=t,this.x0=e,this.x1=n}function Ch(t){return t[0]}function Oh(t,e){var n=new Ph(null==e?Ch:e,NaN,NaN);return null==t?n:n.addAll(t)}function Ph(t,e,n){this._x=t,this._x0=e,this._x1=n,this._root=void 0}function kh(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Lh=Oh.prototype=Ph.prototype;function Ih(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,h,p,f=t._root,d={data:r},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!f)return t._root=d,t;for(;f.length;)if((l=e>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a,i=f,!(f=f[h=c<<1|l]))return i[h]=d,t;if(s=+t._x.call(null,f.data),u=+t._y.call(null,f.data),e===s&&n===u)return d.next=f,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(l=e>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a}while((h=c<<1|l)==(p=(u>=a)<<1|s>=o));return i[p]=f,i[h]=d,t}function Rh(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Dh(t){return t[0]}function Nh(t){return t[1]}function Fh(t,e,n){var r=new zh(null==e?Dh:e,null==n?Nh:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function zh(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Bh(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}Lh.copy=function(){var t,e,n=new Ph(this._x,this._x0,this._x1),r=this._root;if(!r)return n;if(!r.length)return n._root=kh(r),n;for(t=[{source:r,target:n._root=new Array(2)}];r=t.pop();)for(var i=0;i<2;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(2)}):r.target[i]=kh(e));return n},Lh.add=function(t){const e=+this._x.call(null,t);return Th(this.cover(e),e,t)},Lh.addAll=function(t){Array.isArray(t)||(t=Array.from(t));const e=t.length,n=new Float64Array(e);let r=1/0,i=-1/0;for(let o,a=0;a<e;++a)isNaN(o=+this._x.call(null,t[a]))||(n[a]=o,o<r&&(r=o),o>i&&(i=o));if(r>i)return this;this.cover(r).cover(i);for(let r=0;r<e;++r)Th(this,n[r],t[r]);return this},Lh.cover=function(t){if(isNaN(t=+t))return this;var e=this._x0,n=this._x1;if(isNaN(e))n=(e=Math.floor(t))+1;else{for(var r,i,o=n-e||1,a=this._root;e>t||t>=n;)switch(i=+(t<e),(r=new Array(2))[i]=a,a=r,o*=2,i){case 0:n=e+o;break;case 1:e=n-o}this._root&&this._root.length&&(this._root=a)}return this._x0=e,this._x1=n,this},Lh.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Lh.extent=function(t){return arguments.length?this.cover(+t[0][0]).cover(+t[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]},Lh.find=function(t,e){var n,r,i,o,a,s=this._x0,u=this._x1,l=[],c=this._root;for(c&&l.push(new Ah(c,s,u)),null==e?e=1/0:(s=t-e,u=t+e);o=l.pop();)if(!(!(c=o.node)||(r=o.x0)>u||(i=o.x1)<s))if(c.length){var h=(r+i)/2;l.push(new Ah(c[1],h,i),new Ah(c[0],r,h)),(a=+(t>=h))&&(o=l[l.length-1],l[l.length-1]=l[l.length-1-a],l[l.length-1-a]=o)}else{var p=Math.abs(t-+this._x.call(null,c.data));p<e&&(e=p,s=t-p,u=t+p,n=c.data)}return n},Lh.remove=function(t){if(isNaN(o=+this._x.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c=this._root,h=this._x0,p=this._x1;if(!c)return this;if(c.length)for(;;){if((s=o>=(a=(h+p)/2))?h=a:p=a,e=c,!(c=c[u=+s]))return this;if(!c.length)break;e[u+1&1]&&(n=e,l=u)}for(;c.data!==t;)if(r=c,!(c=c.next))return this;return(i=c.next)&&delete c.next,r?(i?r.next=i:delete r.next,this):e?(i?e[u]=i:delete e[u],(c=e[0]||e[1])&&c===(e[1]||e[0])&&!c.length&&(n?n[l]=c:this._root=c),this):(this._root=i,this)},Lh.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Lh.root=function(){return this._root},Lh.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Lh.visit=function(t){var e,n,r,i,o=[],a=this._root;for(a&&o.push(new Ah(a,this._x0,this._x1));e=o.pop();)if(!t(a=e.node,r=e.x0,i=e.x1)&&a.length){var s=(r+i)/2;(n=a[1])&&o.push(new Ah(n,s,i)),(n=a[0])&&o.push(new Ah(n,r,s))}return this},Lh.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Ah(this._root,this._x0,this._x1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.x1,u=(a+s)/2;(o=i[0])&&n.push(new Ah(o,a,u)),(o=i[1])&&n.push(new Ah(o,u,s))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.x1);return this},Lh.x=function(t){return arguments.length?(this._x=t,this):this._x};var jh=Fh.prototype=zh.prototype;function Uh(t,e,n,r,i){if(isNaN(e)||isNaN(n)||isNaN(r))return t;var o,a,s,u,l,c,h,p,f,d,m,g,y=t._root,v={data:i},_=t._x0,b=t._y0,x=t._z0,w=t._x1,S=t._y1,E=t._z1;if(!y)return t._root=v,t;for(;y.length;)if((p=e>=(a=(_+w)/2))?_=a:w=a,(f=n>=(s=(b+S)/2))?b=s:S=s,(d=r>=(u=(x+E)/2))?x=u:E=u,o=y,!(y=y[m=d<<2|f<<1|p]))return o[m]=v,t;if(l=+t._x.call(null,y.data),c=+t._y.call(null,y.data),h=+t._z.call(null,y.data),e===l&&n===c&&r===h)return v.next=y,o?o[m]=v:t._root=v,t;do{o=o?o[m]=new Array(8):t._root=new Array(8),(p=e>=(a=(_+w)/2))?_=a:w=a,(f=n>=(s=(b+S)/2))?b=s:S=s,(d=r>=(u=(x+E)/2))?x=u:E=u}while((m=d<<2|f<<1|p)==(g=(h>=u)<<2|(c>=s)<<1|l>=a));return o[g]=y,o[m]=v,t}function Zh(t,e,n,r,i,o,a){this.node=t,this.x0=e,this.y0=n,this.z0=r,this.x1=i,this.y1=o,this.z1=a}function Vh(t){return t[0]}function Gh(t){return t[1]}function Hh(t){return t[2]}function Wh(t,e,n,r){var i=new qh(null==e?Vh:e,null==n?Gh:n,null==r?Hh:r,NaN,NaN,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function qh(t,e,n,r,i,o,a,s,u){this._x=t,this._y=e,this._z=n,this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this._root=void 0}function Yh(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}jh.copy=function(){var t,e,n=new zh(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Bh(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Bh(e));return n},jh.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Ih(this.cover(e,n),e,n,t)},jh.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>c&&(c=r),i<l&&(l=i),i>h&&(h=i));if(u>c||l>h)return this;for(this.cover(u,l).cover(c,h),n=0;n<o;++n)Ih(this,a[n],s[n],t[n]);return this},jh.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},jh.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},jh.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]]},jh.find=function(t,e,n){var r,i,o,a,s,u,l,c=this._x0,h=this._y0,p=this._x1,f=this._y1,d=[],m=this._root;for(m&&d.push(new Rh(m,c,h,p,f)),null==n?n=1/0:(c=t-n,h=e-n,p=t+n,f=e+n,n*=n);u=d.pop();)if(!(!(m=u.node)||(i=u.x0)>p||(o=u.y0)>f||(a=u.x1)<c||(s=u.y1)<h))if(m.length){var g=(i+a)/2,y=(o+s)/2;d.push(new Rh(m[3],g,y,a,s),new Rh(m[2],i,y,g,s),new Rh(m[1],g,o,a,y),new Rh(m[0],i,o,g,y)),(l=(e>=y)<<1|t>=g)&&(u=d[d.length-1],d[d.length-1]=d[d.length-1-l],d[d.length-1-l]=u)}else{var v=t-+this._x.call(null,m.data),_=e-+this._y.call(null,m.data),b=v*v+_*_;if(b<n){var x=Math.sqrt(n=b);c=t-x,h=e-x,p=t+x,f=e+x,r=m.data}}return r},jh.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,h,p,f=this._root,d=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((l=o>=(s=(d+g)/2))?d=s:g=s,(c=a>=(u=(m+y)/2))?m=u:y=u,e=f,!(f=f[h=c<<1|l]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,p=h)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[p]=f:this._root=f),this):(this._root=i,this)},jh.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},jh.root=function(){return this._root},jh.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},jh.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new Rh(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var l=(r+o)/2,c=(i+a)/2;(n=u[3])&&s.push(new Rh(n,l,c,o,a)),(n=u[2])&&s.push(new Rh(n,r,c,l,a)),(n=u[1])&&s.push(new Rh(n,l,i,o,c)),(n=u[0])&&s.push(new Rh(n,r,i,l,c))}return this},jh.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Rh(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,l=e.y1,c=(a+u)/2,h=(s+l)/2;(o=i[0])&&n.push(new Rh(o,a,s,c,h)),(o=i[1])&&n.push(new Rh(o,c,s,u,h)),(o=i[2])&&n.push(new Rh(o,a,h,c,l)),(o=i[3])&&n.push(new Rh(o,c,h,u,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},jh.x=function(t){return arguments.length?(this._x=t,this):this._x},jh.y=function(t){return arguments.length?(this._y=t,this):this._y};var Xh=Wh.prototype=qh.prototype;function $h(){var t,e,n,r,i,o,a=xh(-30),s=1,u=1/0,l=.81;function c(r){var o,a=t.length,s=(1===e?Oh(t,mh):2===e?Fh(t,mh,gh):3===e?Wh(t,mh,gh,yh):null).visitAfter(p);for(i=r,o=0;o<a;++o)n=t[o],s.visit(f)}function h(){if(t){var e,n,r=t.length;for(o=new Array(r),e=0;e<r;++e)n=t[e],o[n.index]=+a(n,e,t)}}function p(t){var n,r,i,a,s,u,l=0,c=0,h=t.length;if(h){for(i=a=s=u=0;u<h;++u)(n=t[u])&&(r=Math.abs(n.value))&&(l+=n.value,c+=r,i+=r*(n.x||0),a+=r*(n.y||0),s+=r*(n.z||0));l*=Math.sqrt(4/h),t.x=i/c,e>1&&(t.y=a/c),e>2&&(t.z=s/c)}else{(n=t).x=n.data.x,e>1&&(n.y=n.data.y),e>2&&(n.z=n.data.z);do{l+=o[n.data.index]}while(n=n.next)}t.value=l}function f(t,a,c,h,p){if(!t.value)return!0;var f=[c,h,p][e-1],d=t.x-n.x,m=e>1?t.y-n.y:0,g=e>2?t.z-n.z:0,y=f-a,v=d*d+m*m+g*g;if(y*y/l<v)return v<u&&(0===d&&(v+=(d=wh(r))*d),e>1&&0===m&&(v+=(m=wh(r))*m),e>2&&0===g&&(v+=(g=wh(r))*g),v<s&&(v=Math.sqrt(s*v)),n.vx+=d*t.value*i/v,e>1&&(n.vy+=m*t.value*i/v),e>2&&(n.vz+=g*t.value*i/v)),!0;if(!(t.length||v>=u)){(t.data!==n||t.next)&&(0===d&&(v+=(d=wh(r))*d),e>1&&0===m&&(v+=(m=wh(r))*m),e>2&&0===g&&(v+=(g=wh(r))*g),v<s&&(v=Math.sqrt(s*v)));do{t.data!==n&&(y=o[t.data.index]*i/v,n.vx+=d*y,e>1&&(n.vy+=m*y),e>2&&(n.vz+=g*y))}while(t=t.next)}}return c.initialize=function(n,...i){t=n,r=i.find((t=>"function"==typeof t))||Math.random,e=i.find((t=>[1,2,3].includes(t)))||2,h()},c.strength=function(t){return arguments.length?(a="function"==typeof t?t:xh(+t),h(),c):a},c.distanceMin=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(l=t*t,c):Math.sqrt(l)},c}function Kh(t,e,n){var r,i=1;function o(){var o,a,s=r.length,u=0,l=0,c=0;for(o=0;o<s;++o)u+=(a=r[o]).x||0,l+=a.y||0,c+=a.z||0;for(u=(u/s-t)*i,l=(l/s-e)*i,c=(c/s-n)*i,o=0;o<s;++o)a=r[o],u&&(a.x-=u),l&&(a.y-=l),c&&(a.z-=c)}return null==t&&(t=0),null==e&&(e=0),null==n&&(n=0),o.initialize=function(t){r=t},o.x=function(e){return arguments.length?(t=+e,o):t},o.y=function(t){return arguments.length?(e=+t,o):e},o.z=function(t){return arguments.length?(n=+t,o):n},o.strength=function(t){return arguments.length?(i=+t,o):i},o}Xh.copy=function(){var t,e,n=new qh(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root;if(!r)return n;if(!r.length)return n._root=Yh(r),n;for(t=[{source:r,target:n._root=new Array(8)}];r=t.pop();)for(var i=0;i<8;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(8)}):r.target[i]=Yh(e));return n},Xh.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t),r=+this._z.call(null,t);return Uh(this.cover(e,n,r),e,n,r,t)},Xh.addAll=function(t){Array.isArray(t)||(t=Array.from(t));const e=t.length,n=new Float64Array(e),r=new Float64Array(e),i=new Float64Array(e);let o=1/0,a=1/0,s=1/0,u=-1/0,l=-1/0,c=-1/0;for(let h,p,f,d,m=0;m<e;++m)isNaN(p=+this._x.call(null,h=t[m]))||isNaN(f=+this._y.call(null,h))||isNaN(d=+this._z.call(null,h))||(n[m]=p,r[m]=f,i[m]=d,p<o&&(o=p),p>u&&(u=p),f<a&&(a=f),f>l&&(l=f),d<s&&(s=d),d>c&&(c=d));if(o>u||a>l||s>c)return this;this.cover(o,a,s).cover(u,l,c);for(let o=0;o<e;++o)Uh(this,n[o],r[o],i[o],t[o]);return this},Xh.cover=function(t,e,n){if(isNaN(t=+t)||isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,o=this._z0,a=this._x1,s=this._y1,u=this._z1;if(isNaN(r))a=(r=Math.floor(t))+1,s=(i=Math.floor(e))+1,u=(o=Math.floor(n))+1;else{for(var l,c,h=a-r||1,p=this._root;r>t||t>=a||i>e||e>=s||o>n||n>=u;)switch(c=(n<o)<<2|(e<i)<<1|t<r,(l=new Array(8))[c]=p,p=l,h*=2,c){case 0:a=r+h,s=i+h,u=o+h;break;case 1:r=a-h,s=i+h,u=o+h;break;case 2:a=r+h,i=s-h,u=o+h;break;case 3:r=a-h,i=s-h,u=o+h;break;case 4:a=r+h,s=i+h,o=u-h;break;case 5:r=a-h,s=i+h,o=u-h;break;case 6:a=r+h,i=s-h,o=u-h;break;case 7:r=a-h,i=s-h,o=u-h}this._root&&this._root.length&&(this._root=p)}return this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this},Xh.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Xh.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1],+t[0][2]).cover(+t[1][0],+t[1][1],+t[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]},Xh.find=function(t,e,n,r){var i,o,a,s,u,l,c,h,p,f=this._x0,d=this._y0,m=this._z0,g=this._x1,y=this._y1,v=this._z1,_=[],b=this._root;for(b&&_.push(new Zh(b,f,d,m,g,y,v)),null==r?r=1/0:(f=t-r,d=e-r,m=n-r,g=t+r,y=e+r,v=n+r,r*=r);h=_.pop();)if(!(!(b=h.node)||(o=h.x0)>g||(a=h.y0)>y||(s=h.z0)>v||(u=h.x1)<f||(l=h.y1)<d||(c=h.z1)<m))if(b.length){var x=(o+u)/2,w=(a+l)/2,S=(s+c)/2;_.push(new Zh(b[7],x,w,S,u,l,c),new Zh(b[6],o,w,S,x,l,c),new Zh(b[5],x,a,S,u,w,c),new Zh(b[4],o,a,S,x,w,c),new Zh(b[3],x,w,s,u,l,S),new Zh(b[2],o,w,s,x,l,S),new Zh(b[1],x,a,s,u,w,S),new Zh(b[0],o,a,s,x,w,S)),(p=(n>=S)<<2|(e>=w)<<1|t>=x)&&(h=_[_.length-1],_[_.length-1]=_[_.length-1-p],_[_.length-1-p]=h)}else{var E=t-+this._x.call(null,b.data),M=e-+this._y.call(null,b.data),T=n-+this._z.call(null,b.data),A=E*E+M*M+T*T;if(A<r){var C=Math.sqrt(r=A);f=t-C,d=e-C,m=n-C,g=t+C,y=e+C,v=n+C,i=b.data}}return i},Xh.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t))||isNaN(s=+this._z.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,h,p,f,d,m,g=this._root,y=this._x0,v=this._y0,_=this._z0,b=this._x1,x=this._y1,w=this._z1;if(!g)return this;if(g.length)for(;;){if((h=o>=(u=(y+b)/2))?y=u:b=u,(p=a>=(l=(v+x)/2))?v=l:x=l,(f=s>=(c=(_+w)/2))?_=c:w=c,e=g,!(g=g[d=f<<2|p<<1|h]))return this;if(!g.length)break;(e[d+1&7]||e[d+2&7]||e[d+3&7]||e[d+4&7]||e[d+5&7]||e[d+6&7]||e[d+7&7])&&(n=e,m=d)}for(;g.data!==t;)if(r=g,!(g=g.next))return this;return(i=g.next)&&delete g.next,r?(i?r.next=i:delete r.next,this):e?(i?e[d]=i:delete e[d],(g=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&g===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!g.length&&(n?n[m]=g:this._root=g),this):(this._root=i,this)},Xh.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Xh.root=function(){return this._root},Xh.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Xh.visit=function(t){var e,n,r,i,o,a,s,u,l=[],c=this._root;for(c&&l.push(new Zh(c,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=l.pop();)if(!t(c=e.node,r=e.x0,i=e.y0,o=e.z0,a=e.x1,s=e.y1,u=e.z1)&&c.length){var h=(r+a)/2,p=(i+s)/2,f=(o+u)/2;(n=c[7])&&l.push(new Zh(n,h,p,f,a,s,u)),(n=c[6])&&l.push(new Zh(n,r,p,f,h,s,u)),(n=c[5])&&l.push(new Zh(n,h,i,f,a,p,u)),(n=c[4])&&l.push(new Zh(n,r,i,f,h,p,u)),(n=c[3])&&l.push(new Zh(n,h,p,o,a,s,f)),(n=c[2])&&l.push(new Zh(n,r,p,o,h,s,f)),(n=c[1])&&l.push(new Zh(n,h,i,o,a,p,f)),(n=c[0])&&l.push(new Zh(n,r,i,o,h,p,f))}return this},Xh.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Zh(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.z0,l=e.x1,c=e.y1,h=e.z1,p=(a+l)/2,f=(s+c)/2,d=(u+h)/2;(o=i[0])&&n.push(new Zh(o,a,s,u,p,f,d)),(o=i[1])&&n.push(new Zh(o,p,s,u,l,f,d)),(o=i[2])&&n.push(new Zh(o,a,f,u,p,c,d)),(o=i[3])&&n.push(new Zh(o,p,f,u,l,c,d)),(o=i[4])&&n.push(new Zh(o,a,s,d,p,f,h)),(o=i[5])&&n.push(new Zh(o,p,s,d,l,f,h)),(o=i[6])&&n.push(new Zh(o,a,f,d,p,c,h)),(o=i[7])&&n.push(new Zh(o,p,f,d,l,c,h))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.z0,e.x1,e.y1,e.z1);return this},Xh.x=function(t){return arguments.length?(this._x=t,this):this._x},Xh.y=function(t){return arguments.length?(this._y=t,this):this._y},Xh.z=function(t){return arguments.length?(this._z=t,this):this._z};var Jh=s(7322),Qh=s(201),tp=s(9208);function ep(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key))?i:String(i)),r)}var i}function np(t,e,n){return e&&ep(t.prototype,e),n&&ep(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rp(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ip=np((function t(e,n){var r=n.default,i=void 0===r?null:r,o=n.triggerUpdate,a=void 0===o||o,s=n.onChange,u=void 0===s?function(t,e){}:s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=i,this.triggerUpdate=a,this.onChange=u}));function op(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,r=t.props,i=void 0===r?{}:r,o=t.methods,a=void 0===o?{}:o,s=t.aliases,u=void 0===s?{}:s,l=t.init,c=void 0===l?function(){}:l,h=t.update,p=void 0===h?function(){}:h,f=Object.keys(i).map((function(t){return new ip(t,i[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1}),r={};function i(e){return o(e,t),s(),i}var o=function(t,n){c.call(i,t,e,n),e.initialised=!0},s=(0,tp.Z)((function(){e.initialised&&(p.call(i,e,r),r={})}),1);return f.forEach((function(t){i[t.name]=function(t){var n=t.name,o=t.triggerUpdate,a=void 0!==o&&o,u=t.onChange,l=void 0===u?function(t,e){}:u,c=t.defaultVal,h=void 0===c?null:c;return function(t){var o=e[n];if(!arguments.length)return o;var u=void 0===t?h:t;return e[n]=u,l.call(i,u,e,o),!r.hasOwnProperty(n)&&(r[n]=o),a&&s(),i}}(t)})),Object.keys(a).forEach((function(t){i[t]=function(){for(var n,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return(n=a[t]).call.apply(n,[i,e].concat(o))}})),Object.entries(u).forEach((function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return rp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rp(t,e):void 0}}(e,n)||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.")}()),o=r[0],a=r[1];return i[o]=i[a]})),i.resetProps=function(){return f.forEach((function(t){i[t.name](t.defaultVal)})),i},i.resetProps(),e._rerender=s,i}}var ap=function(t){return"function"==typeof t?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}};function sp(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function up(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function lp(t,e){if(t){if("string"==typeof t)return cp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cp(t,e):void 0}}function cp(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function hp(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var pp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(e instanceof Array?e.length?e:[void 0]:[e]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),o=t.reduce((function(t,e){var r=t,o=e;return i.forEach((function(t,e){var a,s=t.keyAccessor;if(t.isProp){var u=o,l=u[s],c=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(u,[s].map(hp));a=l,o=c}else a=s(o,e);e+1<i.length?(r.hasOwnProperty(a)||(r[a]={}),r=r[a]):n?(r.hasOwnProperty(a)||(r[a]=[]),r[a].push(o)):r[a]=o})),t}),{});n instanceof Function&&function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(e).forEach((function(t){return e[t]=n(e[t])})):Object.values(e).forEach((function(e){return t(e,r+1)}))}(o);var a=o;return r&&(a=[],function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?a.push({keys:n,vals:e}):Object.entries(e).forEach((function(e){var r,i,o=(i=2,function(t){if(Array.isArray(t))return t}(r=e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(r,i)||lp(r,i)||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.")}()),a=o[0],s=o[1];return t(s,[].concat(function(t){return function(t){if(Array.isArray(t))return cp(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||lp(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.")}()}(n),[a]))}))}(o),e instanceof Array&&0===e.length&&1===a.length&&(a[0].keys=[])),a};function fp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dp(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mp(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||yp(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 gp(t){return function(t){if(Array.isArray(t))return vp(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||yp(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 yp(t,e){if(t){if("string"==typeof t)return vp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vp(t,e):void 0}}function vp(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var _p=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function bp(t,e,n,r,i){var o=i.createObj,a=void 0===o?function(t){return{}}:o,s=i.updateObj,u=void 0===s?function(t,e){}:s,l=i.exitObj,c=void 0===l?function(t){}:l,h=i.objBindAttr,p=void 0===h?"__obj":h,f=i.dataBindAttr,d=void 0===f?"__data":f,m=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(i,_p),g=function(t,e,n){var r=n.objBindAttr,i=void 0===r?"__obj":r,o=n.dataBindAttr,a=void 0===o?"__data":o,s=n.idAccessor,u=n.purge,l=void 0!==u&&u,c=function(t){return t.hasOwnProperty(a)},h=e.filter((function(t){return!c(t)})),p=e.filter(c).map((function(t){return t[a]})),f=l?{enter:t,exit:p,update:[]}:function(t,e,n){var r={enter:[],update:[],exit:[]};if(n){var i=pp(t,n,!1),o=pp(e,n,!1),a=Object.assign({},i,o);Object.entries(a).forEach((function(t){var e=mp(t,2),n=e[0],a=e[1],s=i.hasOwnProperty(n)?o.hasOwnProperty(n)?"update":"exit":"enter";r[s].push("update"===s?[i[n],o[n]]:a)}))}else{var s=new Set(t),u=new Set(e);new Set([].concat(gp(s),gp(u))).forEach((function(t){var e=s.has(t)?u.has(t)?"update":"exit":"enter";r[e].push("update"===e?[t,t]:t)}))}return r}(p,t,s);return f.update=f.update.map((function(t){var e=mp(t,2),n=e[0],r=e[1];return n!==r&&(r[i]=n[i],r[i][a]=r),r})),f.exit=f.exit.concat(h.map((function(t){return dp({},i,t)}))),f}(t,e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fp(Object(n),!0).forEach((function(e){dp(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({objBindAttr:p,dataBindAttr:d},m)),y=g.enter,v=g.update;g.exit.forEach((function(t){var e=t[p];delete t[p],c(e),r(e)}));var _=function(t){var e=[];return t.forEach((function(t){var n=a(t);n&&(n[d]=t,t[p]=n,e.push(n))})),e}(y);!function(t){t.forEach((function(t){var e=t[p];e&&(e[d]=t,u(e,t))}))}([].concat(gp(y),gp(v))),_.forEach(n)}class xp extends Map{constructor(t,e=Sp){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(wp(this,t))}has(t){return super.has(wp(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}(this,t))}}function wp({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Sp(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Ep(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}const Mp=Symbol("implicit");function Tp(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}const Ap=Tp("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function Cp(t){return Cp="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},Cp(t)}var Op=/^\s+/,Pp=/\s+$/;function kp(t,e){if(e=e||{},(t=t||"")instanceof kp)return t;if(!(this instanceof kp))return new kp(t,e);var n=function(t){var e,n,r,i={r:0,g:0,b:0},o=1,a=null,s=null,u=null,l=!1,c=!1;return"string"==typeof t&&(t=function(t){t=t.replace(Op,"").replace(Pp,"").toLowerCase();var e,n=!1;if(Yp[t])t=Yp[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=of.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=of.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=of.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=of.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=of.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=of.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=of.hex8.exec(t))?{r:Qp(e[1]),g:Qp(e[2]),b:Qp(e[3]),a:rf(e[4]),format:n?"name":"hex8"}:(e=of.hex6.exec(t))?{r:Qp(e[1]),g:Qp(e[2]),b:Qp(e[3]),format:n?"name":"hex"}:(e=of.hex4.exec(t))?{r:Qp(e[1]+""+e[1]),g:Qp(e[2]+""+e[2]),b:Qp(e[3]+""+e[3]),a:rf(e[4]+""+e[4]),format:n?"name":"hex8"}:!!(e=of.hex3.exec(t))&&{r:Qp(e[1]+""+e[1]),g:Qp(e[2]+""+e[2]),b:Qp(e[3]+""+e[3]),format:n?"name":"hex"}}(t)),"object"==Cp(t)&&(af(t.r)&&af(t.g)&&af(t.b)?(e=t.r,n=t.g,r=t.b,i={r:255*Kp(e,255),g:255*Kp(n,255),b:255*Kp(r,255)},l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):af(t.h)&&af(t.s)&&af(t.v)?(a=ef(t.s),s=ef(t.v),i=function(t,e,n){t=6*Kp(t,360),e=Kp(e,100),n=Kp(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),u=r%6;return{r:255*[n,a,o,o,s,n][u],g:255*[s,n,n,a,o,o][u],b:255*[o,o,s,n,n,a][u]}}(t.h,a,s),l=!0,c="hsv"):af(t.h)&&af(t.s)&&af(t.l)&&(a=ef(t.s),u=ef(t.l),i=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Kp(t,360),e=Kp(e,100),n=Kp(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,a,u),l=!0,c="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=$p(o),{ok:l,format:t.format||c,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Lp(t,e,n){t=Kp(t,255),e=Kp(e,255),n=Kp(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,l:s}}function Ip(t,e,n){t=Kp(t,255),e=Kp(e,255),n=Kp(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=o,u=o-a;if(i=0===o?0:u/o,o==a)r=0;else{switch(o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,v:s}}function Rp(t,e,n,r){var i=[tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16))];return r&&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 Dp(t,e,n,r){return[tf(nf(r)),tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16))].join("")}function Np(t,e){e=0===e?0:e||10;var n=kp(t).toHsl();return n.s-=e/100,n.s=Jp(n.s),kp(n)}function Fp(t,e){e=0===e?0:e||10;var n=kp(t).toHsl();return n.s+=e/100,n.s=Jp(n.s),kp(n)}function zp(t){return kp(t).desaturate(100)}function Bp(t,e){e=0===e?0:e||10;var n=kp(t).toHsl();return n.l+=e/100,n.l=Jp(n.l),kp(n)}function jp(t,e){e=0===e?0:e||10;var n=kp(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),kp(n)}function Up(t,e){e=0===e?0:e||10;var n=kp(t).toHsl();return n.l-=e/100,n.l=Jp(n.l),kp(n)}function Zp(t,e){var n=kp(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,kp(n)}function Vp(t){var e=kp(t).toHsl();return e.h=(e.h+180)%360,kp(e)}function Gp(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=kp(t).toHsl(),r=[kp(t)],i=360/e,o=1;o<e;o++)r.push(kp({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function Hp(t){var e=kp(t).toHsl(),n=e.h;return[kp(t),kp({h:(n+72)%360,s:e.s,l:e.l}),kp({h:(n+216)%360,s:e.s,l:e.l})]}function Wp(t,e,n){e=e||6,n=n||30;var r=kp(t).toHsl(),i=360/n,o=[kp(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(kp(r));return o}function qp(t,e){e=e||6;for(var n=kp(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(kp({h:r,s:i,v:o})),o=(o+s)%1;return a}kp.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 t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=$p(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Ip(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Ip(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=Lp(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Lp(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return Rp(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16)),tf(nf(r))];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:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Kp(this._r,255))+"%",g:Math.round(100*Kp(this._g,255))+"%",b:Math.round(100*Kp(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Kp(this._r,255))+"%, "+Math.round(100*Kp(this._g,255))+"%, "+Math.round(100*Kp(this._b,255))+"%)":"rgba("+Math.round(100*Kp(this._r,255))+"%, "+Math.round(100*Kp(this._g,255))+"%, "+Math.round(100*Kp(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Xp[Rp(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Dp(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=kp(t);n="#"+Dp(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return kp(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Bp,arguments)},brighten:function(){return this._applyModification(jp,arguments)},darken:function(){return this._applyModification(Up,arguments)},desaturate:function(){return this._applyModification(Np,arguments)},saturate:function(){return this._applyModification(Fp,arguments)},greyscale:function(){return this._applyModification(zp,arguments)},spin:function(){return this._applyModification(Zp,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(Wp,arguments)},complement:function(){return this._applyCombination(Vp,arguments)},monochromatic:function(){return this._applyCombination(qp,arguments)},splitcomplement:function(){return this._applyCombination(Hp,arguments)},triad:function(){return this._applyCombination(Gp,[3])},tetrad:function(){return this._applyCombination(Gp,[4])}},kp.fromRatio=function(t,e){if("object"==Cp(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:ef(t[r]));t=n}return kp(t,e)},kp.equals=function(t,e){return!(!t||!e)&&kp(t).toRgbString()==kp(e).toRgbString()},kp.random=function(){return kp.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},kp.mix=function(t,e,n){n=0===n?0:n||50;var r=kp(t).toRgb(),i=kp(e).toRgb(),o=n/100;return kp({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},kp.readability=function(t,e){var n=kp(t),r=kp(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},kp.isReadable=function(t,e,n){var r,i,o,a,s,u=kp.readability(t,e);switch(i=!1,"AA"!==(a=((o=(o=n)||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(s=(o.size||"small").toLowerCase())&&"large"!==s&&(s="small"),(r={level:a,size:s}).level+r.size){case"AAsmall":case"AAAlarge":i=u>=4.5;break;case"AAlarge":i=u>=3;break;case"AAAsmall":i=u>=7}return i},kp.mostReadable=function(t,e,n){var r,i,o,a,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var l=0;l<e.length;l++)(r=kp.readability(t,e[l]))>u&&(u=r,s=kp(e[l]));return kp.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,kp.mostReadable(t,["#fff","#000"],n))};var Yp=kp.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"},Xp=kp.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Yp);function $p(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Kp(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Jp(t){return Math.min(1,Math.max(0,t))}function Qp(t){return parseInt(t,16)}function tf(t){return 1==t.length?"0"+t:""+t}function ef(t){return t<=1&&(t=100*t+"%"),t}function nf(t){return Math.round(255*parseFloat(t)).toString(16)}function rf(t){return Qp(t)/255}var of=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function af(t){return!!of.CSS_UNIT.exec(t)}function sf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function uf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sf(Object(n),!0).forEach((function(e){cf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function lf(t){return lf="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},lf(t)}function cf(t,e,n){return(e=bf(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hf(t){return hf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hf(t)}function pf(t,e){return pf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pf(t,e)}function ff(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function df(t,e,n){return df=ff()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&pf(i,n.prototype),i},df.apply(null,arguments)}function mf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||vf(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 yf(t){return function(t){if(Array.isArray(t))return _f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||vf(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 vf(t,e){if(t){if("string"==typeof t)return _f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_f(t,e):void 0}}function _f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function bf(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var xf=function t(e){e instanceof Array?e.forEach(t):(e.map&&e.map.dispose(),e.dispose())},wf=function t(e){e.geometry&&e.geometry.dispose(),e.material&&xf(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(t)},Sf=function(t){for(;t.children.length;){var e=t.children[0];t.remove(e),wf(e)}},Ef=["objFilter"];function Mf(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.objFilter,i=void 0===r?function(){return!0}:r,o=function(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}(n,Ef);return bp(t,e.children.filter(i),(function(t){return e.add(t)}),(function(t){e.remove(t),Sf(t)}),uf({objBindAttr:"__threeObj"},o))}var Tf=function(t){return isNaN(t)?parseInt(kp(t).toHex(),16):t},Af=function(t){return isNaN(t)?kp(t).getAlpha():1},Cf=function t(){var e=new xp,n=[],r=[],i=Mp;function o(t){let o=e.get(t);if(void 0===o){if(i!==Mp)return i;e.set(t,o=n.push(t)-1)}return r[o%r.length]}return o.domain=function(t){if(!arguments.length)return n.slice();n=[],e=new xp;for(const r of t)e.has(r)||e.set(r,n.push(r)-1);return o},o.range=function(t){return arguments.length?(r=Array.from(t),o):r.slice()},o.unknown=function(t){return arguments.length?(i=t,o):i},o.copy=function(){return t(n,r).unknown(i)},Ep.apply(o,arguments),o}(Ap);function Of(t,e,n){e&&"string"==typeof n&&t.filter((function(t){return!t[n]})).forEach((function(t){t[n]=Cf(e(t))}))}var Pf=window.THREE?window.THREE:{Group:ns,Mesh:ui,MeshLambertMaterial:fl,Color:en,BufferGeometry:Gr,BufferAttribute:Ir,Matrix4:Hn,Vector3:dn,SphereGeometry:il,CylinderGeometry:Mu,TubeGeometry:ol,ConeGeometry:Tu,Line:Ys,LineBasicMaterial:Zs,QuadraticBezierCurve3:bu,CubicBezierCurve3:yu,Box3:yn},kf={graph:Jh,forcelayout:Qh},Lf=(new Pf.BufferGeometry).setAttribute?"setAttribute":"addAttribute",If=(new Pf.BufferGeometry).applyMatrix4?"applyMatrix4":"applyMatrix",Rf=op({props:{jsonUrl:{onChange:function(t,e){var n=this;t&&!e.fetchingJson&&(e.fetchingJson=!0,e.onLoading(),fetch(t).then((function(t){return t.json()})).then((function(t){e.fetchingJson=!1,e.onFinishLoading(t),n.graphData(t)})))},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(t,e){e.engineRunning=!1}},numDimensions:{default:3,onChange:function(t,e){var n=e.d3ForceLayout.force("charge");function r(t,e){t.forEach((function(t){delete t[e],delete t["v".concat(e)]}))}n&&n.strength(t>2?-60:-30),t<3&&r(e.graphData.nodes,"z"),t<2&&r(e.graphData.nodes,"y")}},dagMode:{onChange:function(t,e){!t&&"d3"===e.forceEngine&&(e.graphData.nodes||[]).forEach((function(t){return t.fx=t.fy=t.fz=void 0}))}},dagLevelDistance:{},dagNodeFilter:{default:function(t){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4},nodeId:{default:"id"},nodeVal:{default:"val"},nodeResolution:{default:8},nodeColor:{default:"color"},nodeAutoColorBy:{},nodeOpacity:{default:.75},nodeVisibility:{default:!0},nodeThreeObject:{},nodeThreeObjectExtend:{default:!1},nodePositionUpdate:{triggerUpdate:!1},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0},linkColor:{default:"color"},linkAutoColorBy:{},linkOpacity:{default:.2},linkWidth:{},linkResolution:{default:6},linkCurvature:{default:0,triggerUpdate:!1},linkCurveRotation:{default:0,triggerUpdate:!1},linkMaterial:{},linkThreeObject:{},linkThreeObjectExtend:{default:!1},linkPositionUpdate:{triggerUpdate:!1},linkDirectionalArrowLength:{default:0},linkDirectionalArrowColor:{},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1},linkDirectionalArrowResolution:{default:8},linkDirectionalParticles:{default:0},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleWidth:{default:.5},linkDirectionalParticleColor:{},linkDirectionalParticleResolution:{default:4},forceEngine:{default:"d3"},d3AlphaMin:{default:0},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(t,e){e.d3ForceLayout.alphaDecay(t)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(t,e){e.d3ForceLayout.alphaTarget(t)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(t,e){e.d3ForceLayout.velocityDecay(t)}},ngraphPhysics:{default:{timeStep:20,gravity:-1.2,theta:.8,springLength:30,springCoefficient:8e-4,dragCoefficient:.02}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onLoading:{default:function(){},triggerUpdate:!1},onFinishLoading:{default:function(){},triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1}},methods:{refresh:function(t){return t._flushObjects=!0,t._rerender(),this},d3Force:function(t,e,n){return void 0===n?t.d3ForceLayout.force(e):(t.d3ForceLayout.force(e,n),this)},d3ReheatSimulation:function(t){return t.d3ForceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(t){return t.cntTicks=0,t.startTickTime=new Date,t.engineRunning=!0,this},tickFrame:function(t){var e,n,r,i,o="ngraph"!==t.forceEngine;return t.engineRunning&&function(){++t.cntTicks>t.cooldownTicks||new Date-t.startTickTime>t.cooldownTime||o&&t.d3AlphaMin>0&&t.d3ForceLayout.alpha()<t.d3AlphaMin?(t.engineRunning=!1,t.onEngineStop()):(t.layout[o?"tick":"step"](),t.onEngineTick());var e=ap(t.nodeThreeObjectExtend);t.graphData.nodes.forEach((function(n){var r=n.__threeObj;if(r){var i=o?n:t.layout.getNodePosition(n[t.nodeId]),a=e(n);t.nodePositionUpdate&&t.nodePositionUpdate(a?r.children[0]:r,{x:i.x,y:i.y,z:i.z},n)&&!a||(r.position.x=i.x,r.position.y=i.y||0,r.position.z=i.z||0)}}));var n=ap(t.linkWidth),r=ap(t.linkCurvature),i=ap(t.linkCurveRotation),a=ap(t.linkThreeObjectExtend);t.graphData.links.forEach((function(e){var s=e.__lineObj;if(s){var u=o?e:t.layout.getLinkPosition(t.layout.graph.getLink(e.source,e.target).id),l=u[o?"source":"from"],c=u[o?"target":"to"];if(l&&c&&l.hasOwnProperty("x")&&c.hasOwnProperty("x")){!function(e){var n=o?e:t.layout.getLinkPosition(t.layout.graph.getLink(e.source,e.target).id),a=n[o?"source":"from"],s=n[o?"target":"to"];if(a&&s&&a.hasOwnProperty("x")&&s.hasOwnProperty("x")){var u=r(e);if(u){var l,c=new Pf.Vector3(a.x,a.y||0,a.z||0),h=new Pf.Vector3(s.x,s.y||0,s.z||0),p=c.distanceTo(h),f=i(e);if(p>0){var d=s.x-a.x,m=s.y-a.y||0,g=(new Pf.Vector3).subVectors(h,c),y=g.clone().multiplyScalar(u).cross(0!==d||0!==m?new Pf.Vector3(0,0,1):new Pf.Vector3(0,1,0)).applyAxisAngle(g.normalize(),f).add((new Pf.Vector3).addVectors(c,h).divideScalar(2));l=new Pf.QuadraticBezierCurve3(c,y,h)}else{var v=70*u,_=-f,b=_+Math.PI/2;l=new Pf.CubicBezierCurve3(c,new Pf.Vector3(v*Math.cos(b),v*Math.sin(b),0).add(c),new Pf.Vector3(v*Math.cos(_),v*Math.sin(_),0).add(c),h)}e.__curve=l}else e.__curve=null}}(e);var h=a(e);if(!t.linkPositionUpdate||!t.linkPositionUpdate(h?s.children[1]:s,{start:{x:l.x,y:l.y,z:l.z},end:{x:c.x,y:c.y,z:c.z}},e)||h){var p=e.__curve,f=s.children.length?s.children[0]:s;if("Line"===f.type){if(p)f.geometry.setFromPoints(p.getPoints(30));else{var d=f.geometry.getAttribute("position");d&&d.array&&6===d.array.length||f.geometry[Lf]("position",d=new Pf.BufferAttribute(new Float32Array(6),3)),d.array[0]=l.x,d.array[1]=l.y||0,d.array[2]=l.z||0,d.array[3]=c.x,d.array[4]=c.y||0,d.array[5]=c.z||0,d.needsUpdate=!0}f.geometry.computeBoundingSphere()}else if("Mesh"===f.type)if(p){f.geometry.type.match(/^Tube(Buffer)?Geometry$/)||(f.position.set(0,0,0),f.rotation.set(0,0,0),f.scale.set(1,1,1));var m=Math.ceil(10*n(e))/10/2,g=new Pf.TubeGeometry(p,30,m,t.linkResolution,!1);f.geometry.dispose(),f.geometry=g}else{if(!f.geometry.type.match(/^Cylinder(Buffer)?Geometry$/)){var y=Math.ceil(10*n(e))/10/2,v=new Pf.CylinderGeometry(y,y,1,t.linkResolution,1,!1);v[If]((new Pf.Matrix4).makeTranslation(0,.5,0)),v[If]((new Pf.Matrix4).makeRotationX(Math.PI/2)),f.geometry.dispose(),f.geometry=v}var _=new Pf.Vector3(l.x,l.y||0,l.z||0),b=new Pf.Vector3(c.x,c.y||0,c.z||0),x=_.distanceTo(b);f.position.x=_.x,f.position.y=_.y,f.position.z=_.z,f.scale.z=x,f.parent.localToWorld(b),f.lookAt(b)}}}}}))}(),e=ap(t.linkDirectionalArrowRelPos),n=ap(t.linkDirectionalArrowLength),r=ap(t.nodeVal),t.graphData.links.forEach((function(i){var a=i.__arrowObj;if(a){var s=o?i:t.layout.getLinkPosition(t.layout.graph.getLink(i.source,i.target).id),u=s[o?"source":"from"],l=s[o?"target":"to"];if(u&&l&&u.hasOwnProperty("x")&&l.hasOwnProperty("x")){var c=Math.cbrt(Math.max(0,r(u)||1))*t.nodeRelSize,h=Math.cbrt(Math.max(0,r(l)||1))*t.nodeRelSize,p=n(i),f=e(i),d=i.__curve?function(t){return i.__curve.getPoint(t)}:function(t){var e=function(t,e,n,r){return e[t]+(n[t]-e[t])*r||0};return{x:e("x",u,l,t),y:e("y",u,l,t),z:e("z",u,l,t)}},m=i.__curve?i.__curve.getLength():Math.sqrt(["x","y","z"].map((function(t){return Math.pow((l[t]||0)-(u[t]||0),2)})).reduce((function(t,e){return t+e}),0)),g=c+p+(m-c-h-p)*f,y=d(g/m),v=d((g-p)/m);["x","y","z"].forEach((function(t){return a.position[t]=v[t]}));var _=df(Pf.Vector3,yf(["x","y","z"].map((function(t){return y[t]}))));a.parent.localToWorld(_),a.lookAt(_)}}})),i=ap(t.linkDirectionalParticleSpeed),t.graphData.links.forEach((function(e){var n=e.__photonsObj&&e.__photonsObj.children,r=e.__singleHopPhotonsObj&&e.__singleHopPhotonsObj.children;if(r&&r.length||n&&n.length){var a=o?e:t.layout.getLinkPosition(t.layout.graph.getLink(e.source,e.target).id),s=a[o?"source":"from"],u=a[o?"target":"to"];if(s&&u&&s.hasOwnProperty("x")&&u.hasOwnProperty("x")){var l=i(e),c=e.__curve?function(t){return e.__curve.getPoint(t)}:function(t){var e=function(t,e,n,r){return e[t]+(n[t]-e[t])*r||0};return{x:e("x",s,u,t),y:e("y",s,u,t),z:e("z",s,u,t)}};[].concat(yf(n||[]),yf(r||[])).forEach((function(t,e){var r="singleHopPhotons"===t.parent.__linkThreeObjType;if(t.hasOwnProperty("__progressRatio")||(t.__progressRatio=r?0:e/n.length),t.__progressRatio+=l,t.__progressRatio>=1){if(r)return t.parent.remove(t),void Sf(t);t.__progressRatio=t.__progressRatio%1}var i=t.__progressRatio,o=c(i);["x","y","z"].forEach((function(e){return t.position[e]=o[e]}))}))}}})),this},emitParticle:function(t,e){if(e&&t.graphData.links.includes(e)){if(!e.__singleHopPhotonsObj){var n=new Pf.Group;n.__linkThreeObjType="singleHopPhotons",e.__singleHopPhotonsObj=n,t.graphScene.add(n)}var r=ap(t.linkDirectionalParticleWidth),i=Math.ceil(10*r(e))/10/2,o=t.linkDirectionalParticleResolution,a=new Pf.SphereGeometry(i,o,o),s=ap(t.linkColor),u=ap(t.linkDirectionalParticleColor)(e)||s(e)||"#f0f0f0",l=new Pf.Color(Tf(u)),c=3*t.linkOpacity,h=new Pf.MeshLambertMaterial({color:l,transparent:!0,opacity:c});e.__singleHopPhotonsObj.add(new Pf.Mesh(a,h))}return this},getGraphBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};if(!t.initialised)return null;var n=function t(n){var r=[];if(n.geometry){n.geometry.computeBoundingBox();var i=new Pf.Box3;i.copy(n.geometry.boundingBox).applyMatrix4(n.matrixWorld),r.push(i)}return r.concat.apply(r,yf((n.children||[]).filter((function(t){return!t.hasOwnProperty("__graphObjType")||"node"===t.__graphObjType&&e(t.__data)})).map(t)))}(t.graphScene);return n.length?Object.assign.apply(Object,yf(["x","y","z"].map((function(t){return cf({},t,[sp(n,(function(e){return e.min[t]})),up(n,(function(e){return e.max[t]}))])})))):null}},stateInit:function(){return{d3ForceLayout:bh().force("link",Mh()).force("charge",$h()).force("center",Kh()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(t,e){e.graphScene=t},update:function(t,e){var n=function(t){return t.some((function(t){return e.hasOwnProperty(t)}))};if(t.engineRunning=!1,t.onUpdate(),null!==t.nodeAutoColorBy&&n(["nodeAutoColorBy","graphData","nodeColor"])&&Of(t.graphData.nodes,ap(t.nodeAutoColorBy),t.nodeColor),null!==t.linkAutoColorBy&&n(["linkAutoColorBy","graphData","linkColor"])&&Of(t.graphData.links,ap(t.linkAutoColorBy),t.linkColor),t._flushObjects||n(["graphData","nodeThreeObject","nodeThreeObjectExtend","nodeVal","nodeColor","nodeVisibility","nodeRelSize","nodeResolution","nodeOpacity"])){var r=ap(t.nodeThreeObject),i=ap(t.nodeThreeObjectExtend),o=ap(t.nodeVal),a=ap(t.nodeColor),s=ap(t.nodeVisibility),u={},l={};Mf(t.graphData.nodes.filter(s),t.graphScene,{purge:t._flushObjects||n(["nodeThreeObject","nodeThreeObjectExtend"]),objFilter:function(t){return"node"===t.__graphObjType},createObj:function(e){var n,o=r(e),a=i(e);return o&&t.nodeThreeObject===o&&(o=o.clone()),o&&!a?n=o:((n=new Pf.Mesh).__graphDefaultObj=!0,o&&a&&n.add(o)),n.__graphObjType="node",n},updateObj:function(e,n){if(e.__graphDefaultObj){var r=o(n)||1,i=Math.cbrt(r)*t.nodeRelSize,s=t.nodeResolution;e.geometry.type.match(/^Sphere(Buffer)?Geometry$/)&&e.geometry.parameters.radius===i&&e.geometry.parameters.widthSegments===s||(u.hasOwnProperty(r)||(u[r]=new Pf.SphereGeometry(i,s,s)),e.geometry.dispose(),e.geometry=u[r]);var c=a(n),h=new Pf.Color(Tf(c||"#ffffaa")),p=t.nodeOpacity*Af(c);"MeshLambertMaterial"===e.material.type&&e.material.color.equals(h)&&e.material.opacity===p||(l.hasOwnProperty(c)||(l[c]=new Pf.MeshLambertMaterial({color:h,transparent:!0,opacity:p})),e.material.dispose(),e.material=l[c])}}})}if(t._flushObjects||n(["graphData","linkThreeObject","linkThreeObjectExtend","linkMaterial","linkColor","linkWidth","linkVisibility","linkResolution","linkOpacity","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowResolution","linkDirectionalParticles","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleResolution"])){var c=ap(t.linkThreeObject),h=ap(t.linkThreeObjectExtend),p=ap(t.linkMaterial),f=ap(t.linkVisibility),d=ap(t.linkColor),m=ap(t.linkWidth),g={},y={},v={},_=t.graphData.links.filter(f);if(Mf(_,t.graphScene,{objBindAttr:"__lineObj",purge:t._flushObjects||n(["linkThreeObject","linkThreeObjectExtend","linkWidth"]),objFilter:function(t){return"link"===t.__graphObjType},exitObj:function(t){var e=t.__data&&t.__data.__singleHopPhotonsObj;e&&(e.parent.remove(e),Sf(e),delete t.__data.__singleHopPhotonsObj)},createObj:function(e){var n,r,i=c(e),o=h(e);if(i&&t.linkThreeObject===i&&(i=i.clone()),!i||o)if(m(e))n=new Pf.Mesh;else{var a=new Pf.BufferGeometry;a[Lf]("position",new Pf.BufferAttribute(new Float32Array(6),3)),n=new Pf.Line(a)}return i?o?((r=new Pf.Group).__graphDefaultObj=!0,r.add(n),r.add(i)):r=i:(r=n).__graphDefaultObj=!0,r.renderOrder=10,r.__graphObjType="link",r},updateObj:function(e,n){if(e.__graphDefaultObj){var r=e.children.length?e.children[0]:e,i=Math.ceil(10*m(n))/10,o=!!i;if(o){var a=i/2,s=t.linkResolution;if(!r.geometry.type.match(/^Cylinder(Buffer)?Geometry$/)||r.geometry.parameters.radiusTop!==a||r.geometry.parameters.radialSegments!==s){if(!g.hasOwnProperty(i)){var u=new Pf.CylinderGeometry(a,a,1,s,1,!1);u[If]((new Pf.Matrix4).makeTranslation(0,.5,0)),u[If]((new Pf.Matrix4).makeRotationX(Math.PI/2)),g[i]=u}r.geometry.dispose(),r.geometry=g[i]}}var l=p(n);if(l)r.material=l;else{var c=d(n),h=new Pf.Color(Tf(c||"#f0f0f0")),f=t.linkOpacity*Af(c),_=o?"MeshLambertMaterial":"LineBasicMaterial";if(r.material.type!==_||!r.material.color.equals(h)||r.material.opacity!==f){var b=o?y:v;b.hasOwnProperty(c)||(b[c]=new Pf[_]({color:h,transparent:f<1,opacity:f,depthWrite:f>=1})),r.material.dispose(),r.material=b[c]}}}}}),t.linkDirectionalArrowLength||e.hasOwnProperty("linkDirectionalArrowLength")){var b=ap(t.linkDirectionalArrowLength),x=ap(t.linkDirectionalArrowColor);Mf(_.filter(b),t.graphScene,{objBindAttr:"__arrowObj",objFilter:function(t){return"arrow"===t.__linkThreeObjType},createObj:function(){var t=new Pf.Mesh(void 0,new Pf.MeshLambertMaterial({transparent:!0}));return t.__linkThreeObjType="arrow",t},updateObj:function(e,n){var r=b(n),i=t.linkDirectionalArrowResolution;if(!e.geometry.type.match(/^Cone(Buffer)?Geometry$/)||e.geometry.parameters.height!==r||e.geometry.parameters.radialSegments!==i){var o=new Pf.ConeGeometry(.25*r,r,i);o.translate(0,r/2,0),o.rotateX(Math.PI/2),e.geometry.dispose(),e.geometry=o}var a=x(n)||d(n)||"#f0f0f0";e.material.color=new Pf.Color(Tf(a)),e.material.opacity=3*t.linkOpacity*Af(a)}})}if(t.linkDirectionalParticles||e.hasOwnProperty("linkDirectionalParticles")){var w=ap(t.linkDirectionalParticles),S=ap(t.linkDirectionalParticleWidth),E=ap(t.linkDirectionalParticleColor),M={},T={};Mf(_.filter(w),t.graphScene,{objBindAttr:"__photonsObj",objFilter:function(t){return"photons"===t.__linkThreeObjType},createObj:function(){var t=new Pf.Group;return t.__linkThreeObjType="photons",t},updateObj:function(e,n){var r,i=Math.round(Math.abs(w(n))),o=!!e.children.length&&e.children[0],a=Math.ceil(10*S(n))/10/2,s=t.linkDirectionalParticleResolution;o&&o.geometry.parameters.radius===a&&o.geometry.parameters.widthSegments===s?r=o.geometry:(T.hasOwnProperty(a)||(T[a]=new Pf.SphereGeometry(a,s,s)),r=T[a],o&&o.geometry.dispose());var u,l=E(n)||d(n)||"#f0f0f0",c=new Pf.Color(Tf(l)),h=3*t.linkOpacity;o&&o.material.color.equals(c)&&o.material.opacity===h?u=o.material:(M.hasOwnProperty(l)||(M[l]=new Pf.MeshLambertMaterial({color:c,transparent:!0,opacity:h})),u=M[l],o&&o.material.dispose()),Mf(yf(new Array(i)).map((function(t,e){return{idx:e}})),e,{idAccessor:function(t){return t.idx},createObj:function(){return new Pf.Mesh(r,u)},updateObj:function(t){t.geometry=r,t.material=u}})}})}}if(t._flushObjects=!1,n(["graphData","nodeId","linkSource","linkTarget","numDimensions","forceEngine","dagMode","dagNodeFilter","dagLevelDistance"])){t.engineRunning=!1,t.graphData.links.forEach((function(e){e.source=e[t.linkSource],e.target=e[t.linkTarget]}));var A,C="ngraph"!==t.forceEngine;if(C){(A=t.d3ForceLayout).stop().alpha(1).numDimensions(t.numDimensions).nodes(t.graphData.nodes);var O=t.d3ForceLayout.force("link");O&&O.id((function(e){return e[t.nodeId]})).links(t.graphData.links);var P=t.dagMode&&function(t,e){var n=t.nodes,r=t.links,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.nodeFilter,a=void 0===o?function(){return!0}:o,s=i.onLoopError,u=void 0===s?function(t){throw"Invalid DAG structure! Found cycle in node path: ".concat(t.join(" -> "),".")}:s,l={};n.forEach((function(t){return l[e(t)]={data:t,out:[],depth:-1,skip:!a(t)}})),r.forEach((function(t){var n=t.source,r=t.target,i=u(n),o=u(r);if(!l.hasOwnProperty(i))throw"Missing source node with id: ".concat(i);if(!l.hasOwnProperty(o))throw"Missing target node with id: ".concat(o);var a=l[i],s=l[o];function u(t){return"object"===lf(t)?e(t):t}a.out.push(s)}));var c=[];return function t(n){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=function(){var o=n[a];if(-1!==r.indexOf(o)){var s=[].concat(yf(r.slice(r.indexOf(o))),[o]).map((function(t){return e(t.data)}));return c.some((function(t){return t.length===s.length&&t.every((function(t,e){return t===s[e]}))}))||(c.push(s),u(s)),"continue"}i>o.depth&&(o.depth=i,t(o.out,[].concat(yf(r),[o]),i+(o.skip?0:1)))},a=0,s=n.length;a<s;a++)o()}(Object.values(l)),Object.assign.apply(Object,[{}].concat(yf(Object.entries(l).filter((function(t){return!gf(t,2)[1].skip})).map((function(t){var e=gf(t,2);return cf({},e[0],e[1].depth)})))))}(t.graphData,(function(e){return e[t.nodeId]}),{nodeFilter:t.dagNodeFilter,onLoopError:t.onDagError||void 0}),k=Math.max.apply(Math,yf(Object.values(P||[]))),L=t.dagLevelDistance||t.graphData.nodes.length/(k||1)*2*(-1!==["radialin","radialout"].indexOf(t.dagMode)?.7:1);if(t.dagMode){var I=function(e,n){return function(r){return e?(P[r[t.nodeId]]-k/2)*L*(n?-1:1):void 0}},R=I(-1!==["lr","rl"].indexOf(t.dagMode),"rl"===t.dagMode),D=I(-1!==["td","bu"].indexOf(t.dagMode),"td"===t.dagMode),N=I(-1!==["zin","zout"].indexOf(t.dagMode),"zout"===t.dagMode);t.graphData.nodes.filter(t.dagNodeFilter).forEach((function(t){t.fx=R(t),t.fy=D(t),t.fz=N(t)}))}t.d3ForceLayout.force("dagRadial",-1!==["radialin","radialout"].indexOf(t.dagMode)?function(t,e,n,r){var i,o,a,s,u=xh(.1);function l(t){for(var u=0,l=i.length;u<l;++u){var c=i[u],h=c.x-e||1e-6,p=(c.y||0)-n||1e-6,f=(c.z||0)-r||1e-6,d=Math.sqrt(h*h+p*p+f*f),m=(s[u]-d)*a[u]*t/d;c.vx+=h*m,o>1&&(c.vy+=p*m),o>2&&(c.vz+=f*m)}}function c(){if(i){var e,n=i.length;for(a=new Array(n),s=new Array(n),e=0;e<n;++e)s[e]=+t(i[e],e,i),a[e]=isNaN(s[e])?0:+u(i[e],e,i)}}return"function"!=typeof t&&(t=xh(+t)),null==e&&(e=0),null==n&&(n=0),null==r&&(r=0),l.initialize=function(t,...e){i=t,o=e.find((t=>[1,2,3].includes(t)))||2,c()},l.strength=function(t){return arguments.length?(u="function"==typeof t?t:xh(+t),c(),l):u},l.radius=function(e){return arguments.length?(t="function"==typeof e?e:xh(+e),c(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(n=+t,l):n},l.z=function(t){return arguments.length?(r=+t,l):r},l}((function(e){var n=P[e[t.nodeId]]||-1;return("radialin"===t.dagMode?k-n:n)*L})).strength((function(e){return t.dagNodeFilter(e)?1:0})):null)}else{var F=kf.graph();t.graphData.nodes.forEach((function(e){F.addNode(e[t.nodeId])})),t.graphData.links.forEach((function(t){F.addLink(t.source,t.target)})),(A=kf.forcelayout(F,uf({dimensions:t.numDimensions},t.ngraphPhysics))).graph=F}for(var z=0;z<t.warmupTicks&&!(C&&t.d3AlphaMin>0&&t.d3ForceLayout.alpha()<t.d3AlphaMin);z++)A[C?"tick":"step"]();t.layout=A,this.resetCountdown()}t.engineRunning=!0,t.onFinishUpdate()}}),Df=function(t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){!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&&pf(t,e)}(s,n);var r,i,o,a=(i=s,o=ff(),function(){var t,e=hf(i);if(o){var n=hf(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return mf(t)}(this,t)});function s(){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(n=a.call.apply(a,[this].concat(i))).__kapsuleInstance=t().apply(void 0,[].concat(yf(e?[mf(n)]:[]),i)),n}return r=s,Object.defineProperty(r,"prototype",{writable:!1}),r}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(t()).forEach((function(t){return n.prototype[t]=function(){var e,n=(e=this.__kapsuleInstance)[t].apply(e,arguments);return n===this.__kapsuleInstance?this:n}})),n}(Rf,(window.THREE?window.THREE:{Group:ns}).Group,!0);const Nf={type:"change"},Ff={type:"start"},zf={type:"end"};class Bf extends Le{constructor(t,e){super(),void 0===e&&console.warn('THREE.TrackballControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.TrackballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.');const n=this,r=-1;this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:c.ROTATE,MIDDLE:c.DOLLY,RIGHT:c.PAN},this.target=new dn;const i=1e-6,o=new dn;let a=1,s=r,u=r,l=0,h=0,p=0;const f=new dn,d=new Ue,m=new Ue,g=new dn,y=new Ue,v=new Ue,_=new Ue,b=new Ue,x=[],w={};this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,this.handleResize=function(){const t=n.domElement.getBoundingClientRect(),e=n.domElement.ownerDocument.documentElement;n.screen.left=t.left+window.pageXOffset-e.clientLeft,n.screen.top=t.top+window.pageYOffset-e.clientTop,n.screen.width=t.width,n.screen.height=t.height};const S=function(){const t=new Ue;return function(e,r){return t.set((e-n.screen.left)/n.screen.width,(r-n.screen.top)/n.screen.height),t}}(),E=function(){const t=new Ue;return function(e,r){return t.set((e-.5*n.screen.width-n.screen.left)/(.5*n.screen.width),(n.screen.height+2*(n.screen.top-r))/n.screen.width),t}}();function M(t){!1!==n.enabled&&(0===x.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",T),n.domElement.addEventListener("pointerup",A)),function(t){x.push(t)}(t),"touch"===t.pointerType?function(t){if(1===(R(t),x.length))s=3,m.copy(E(x[0].pageX,x[0].pageY)),d.copy(m);else{s=4;const t=x[0].pageX-x[1].pageX,e=x[0].pageY-x[1].pageY;h=l=Math.sqrt(t*t+e*e);const n=(x[0].pageX+x[1].pageX)/2,r=(x[0].pageY+x[1].pageY)/2;_.copy(S(n,r)),b.copy(_)}n.dispatchEvent(Ff)}(t):function(t){if(s===r)switch(t.button){case n.mouseButtons.LEFT:s=0;break;case n.mouseButtons.MIDDLE:s=1;break;case n.mouseButtons.RIGHT:s=2}const e=u!==r?u:s;0!==e||n.noRotate?1!==e||n.noZoom?2!==e||n.noPan||(_.copy(S(t.pageX,t.pageY)),b.copy(_)):(y.copy(S(t.pageX,t.pageY)),v.copy(y)):(m.copy(E(t.pageX,t.pageY)),d.copy(m)),n.dispatchEvent(Ff)}(t))}function T(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){if(1===(R(t),x.length))d.copy(m),m.copy(E(t.pageX,t.pageY));else{const e=function(t){const e=t.pointerId===x[0].pointerId?x[1]:x[0];return w[e.pointerId]}(t),n=t.pageX-e.x,r=t.pageY-e.y;h=Math.sqrt(n*n+r*r);const i=(t.pageX+e.x)/2,o=(t.pageY+e.y)/2;b.copy(S(i,o))}}(t):function(t){const e=u!==r?u:s;0!==e||n.noRotate?1!==e||n.noZoom?2!==e||n.noPan||b.copy(S(t.pageX,t.pageY)):v.copy(S(t.pageX,t.pageY)):(d.copy(m),m.copy(E(t.pageX,t.pageY)))}(t))}function A(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(x.length){case 0:s=r;break;case 1:s=3,m.copy(E(t.pageX,t.pageY)),d.copy(m);break;case 2:s=4,m.copy(E(t.pageX-d.x,t.pageY-d.y)),d.copy(m)}n.dispatchEvent(zf)}(t):(s=r,n.dispatchEvent(zf)),I(t),0===x.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",T),n.domElement.removeEventListener("pointerup",A)))}function C(t){I(t)}function O(t){!1!==n.enabled&&(window.removeEventListener("keydown",O),u===r&&(t.code!==n.keys[0]||n.noRotate?t.code!==n.keys[1]||n.noZoom?t.code!==n.keys[2]||n.noPan||(u=2):u=1:u=0))}function P(){!1!==n.enabled&&(u=r,window.addEventListener("keydown",O))}function k(t){if(!1!==n.enabled&&!0!==n.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:y.y-=.025*t.deltaY;break;case 1:y.y-=.01*t.deltaY;break;default:y.y-=25e-5*t.deltaY}n.dispatchEvent(Ff),n.dispatchEvent(zf)}}function L(t){!1!==n.enabled&&t.preventDefault()}function I(t){delete w[t.pointerId];for(let e=0;e<x.length;e++)if(x[e].pointerId==t.pointerId)return void x.splice(e,1)}function R(t){let e=w[t.pointerId];void 0===e&&(e=new Ue,w[t.pointerId]=e),e.set(t.pageX,t.pageY)}this.rotateCamera=function(){const t=new dn,e=new fn,r=new dn,i=new dn,o=new dn,a=new dn;return function(){a.set(m.x-d.x,m.y-d.y,0);let s=a.length();s?(f.copy(n.object.position).sub(n.target),r.copy(f).normalize(),i.copy(n.object.up).normalize(),o.crossVectors(i,r).normalize(),i.setLength(m.y-d.y),o.setLength(m.x-d.x),a.copy(i.add(o)),t.crossVectors(a,f).normalize(),s*=n.rotateSpeed,e.setFromAxisAngle(t,s),f.applyQuaternion(e),n.object.up.applyQuaternion(e),g.copy(t),p=s):!n.staticMoving&&p&&(p*=Math.sqrt(1-n.dynamicDampingFactor),f.copy(n.object.position).sub(n.target),e.setFromAxisAngle(g,p),f.applyQuaternion(e),n.object.up.applyQuaternion(e)),d.copy(m)}}(),this.zoomCamera=function(){let t;4===s?(t=l/h,l=h,n.object.isPerspectiveCamera?f.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom/=t,n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(v.y-y.y)*n.zoomSpeed,1!==t&&t>0&&(n.object.isPerspectiveCamera?f.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom/=t,n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),n.staticMoving?y.copy(v):y.y+=(v.y-y.y)*this.dynamicDampingFactor)},this.panCamera=function(){const t=new Ue,e=new dn,r=new dn;return function(){if(t.copy(b).sub(_),t.lengthSq()){if(n.object.isOrthographicCamera){const e=(n.object.right-n.object.left)/n.object.zoom/n.domElement.clientWidth,r=(n.object.top-n.object.bottom)/n.object.zoom/n.domElement.clientWidth;t.x*=e,t.y*=r}t.multiplyScalar(f.length()*n.panSpeed),r.copy(f).cross(n.object.up).setLength(t.x),r.add(e.copy(n.object.up).setLength(t.y)),n.object.position.add(r),n.target.add(r),n.staticMoving?_.copy(b):_.add(t.subVectors(b,_).multiplyScalar(n.dynamicDampingFactor))}}}(),this.checkDistances=function(){n.noZoom&&n.noPan||(f.lengthSq()>n.maxDistance*n.maxDistance&&(n.object.position.addVectors(n.target,f.setLength(n.maxDistance)),y.copy(v)),f.lengthSq()<n.minDistance*n.minDistance&&(n.object.position.addVectors(n.target,f.setLength(n.minDistance)),y.copy(v)))},this.update=function(){f.subVectors(n.object.position,n.target),n.noRotate||n.rotateCamera(),n.noZoom||n.zoomCamera(),n.noPan||n.panCamera(),n.object.position.addVectors(n.target,f),n.object.isPerspectiveCamera?(n.checkDistances(),n.object.lookAt(n.target),o.distanceToSquared(n.object.position)>i&&(n.dispatchEvent(Nf),o.copy(n.object.position))):n.object.isOrthographicCamera?(n.object.lookAt(n.target),(o.distanceToSquared(n.object.position)>i||a!==n.object.zoom)&&(n.dispatchEvent(Nf),o.copy(n.object.position),a=n.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){s=r,u=r,n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.up.copy(n.up0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),f.subVectors(n.object.position,n.target),n.object.lookAt(n.target),n.dispatchEvent(Nf),o.copy(n.object.position),a=n.object.zoom},this.dispose=function(){n.domElement.removeEventListener("contextmenu",L),n.domElement.removeEventListener("pointerdown",M),n.domElement.removeEventListener("pointercancel",C),n.domElement.removeEventListener("wheel",k),n.domElement.removeEventListener("pointermove",T),n.domElement.removeEventListener("pointerup",A),window.removeEventListener("keydown",O),window.removeEventListener("keyup",P)},this.domElement.addEventListener("contextmenu",L),this.domElement.addEventListener("pointerdown",M),this.domElement.addEventListener("pointercancel",C),this.domElement.addEventListener("wheel",k,{passive:!1}),window.addEventListener("keydown",O),window.addEventListener("keyup",P),this.handleResize(),this.update()}}const jf={type:"change"},Uf={type:"start"},Zf={type:"end"};class Vf extends Le{constructor(t,e){super(),void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new dn,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:c.ROTATE,MIDDLE:c.DOLLY,RIGHT:c.PAN},this.touches={ONE:0,TWO:2},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",G),this._domElementKeyEvents=t},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(jf),n.update(),i=r.NONE},this.update=function(){const e=new dn,c=(new fn).setFromUnitVectors(t.up,new dn(0,1,0)),p=c.clone().invert(),f=new dn,d=new fn,m=2*Math.PI;return function(){const t=n.object.position;e.copy(t).sub(n.target),e.applyQuaternion(c),a.setFromVector3(e),n.autoRotate&&i===r.NONE&&E(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(a.theta+=s.theta*n.dampingFactor,a.phi+=s.phi*n.dampingFactor):(a.theta+=s.theta,a.phi+=s.phi);let g=n.minAzimuthAngle,y=n.maxAzimuthAngle;return isFinite(g)&&isFinite(y)&&(g<-Math.PI?g+=m:g>Math.PI&&(g-=m),y<-Math.PI?y+=m:y>Math.PI&&(y-=m),a.theta=g<=y?Math.max(g,Math.min(y,a.theta)):a.theta>(g+y)/2?Math.max(g,a.theta):Math.min(y,a.theta)),a.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=u,a.radius=Math.max(n.minDistance,Math.min(n.maxDistance,a.radius)),!0===n.enableDamping?n.target.addScaledVector(l,n.dampingFactor):n.target.add(l),e.setFromSpherical(a),e.applyQuaternion(p),t.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(s.theta*=1-n.dampingFactor,s.phi*=1-n.dampingFactor,l.multiplyScalar(1-n.dampingFactor)):(s.set(0,0,0),l.set(0,0,0)),u=1,!!(h||f.distanceToSquared(n.object.position)>o||8*(1-d.dot(n.object.quaternion))>o)&&(n.dispatchEvent(jf),f.copy(n.object.position),d.copy(n.object.quaternion),h=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",H),n.domElement.removeEventListener("pointerdown",B),n.domElement.removeEventListener("pointercancel",Z),n.domElement.removeEventListener("wheel",V),n.domElement.removeEventListener("pointermove",j),n.domElement.removeEventListener("pointerup",U),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",G)};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const o=1e-6,a=new Sc,s=new Sc;let u=1;const l=new dn;let h=!1;const p=new Ue,f=new Ue,d=new Ue,m=new Ue,g=new Ue,y=new Ue,v=new Ue,_=new Ue,b=new Ue,x=[],w={};function S(){return Math.pow(.95,n.zoomSpeed)}function E(t){s.theta-=t}function M(t){s.phi-=t}const T=function(){const t=new dn;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),l.add(t)}}(),A=function(){const t=new dn;return function(e,r){!0===n.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),l.add(t)}}(),C=function(){const t=new dn;return function(e,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const o=n.object.position;t.copy(o).sub(n.target);let a=t.length();a*=Math.tan(n.object.fov/2*Math.PI/180),T(2*e*a/i.clientHeight,n.object.matrix),A(2*r*a/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(T(e*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),A(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function O(t){n.object.isPerspectiveCamera?u/=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*t)),n.object.updateProjectionMatrix(),h=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function P(t){n.object.isPerspectiveCamera?u*=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/t)),n.object.updateProjectionMatrix(),h=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function k(t){p.set(t.clientX,t.clientY)}function L(t){m.set(t.clientX,t.clientY)}function I(){if(1===x.length)p.set(x[0].pageX,x[0].pageY);else{const t=.5*(x[0].pageX+x[1].pageX),e=.5*(x[0].pageY+x[1].pageY);p.set(t,e)}}function R(){if(1===x.length)m.set(x[0].pageX,x[0].pageY);else{const t=.5*(x[0].pageX+x[1].pageX),e=.5*(x[0].pageY+x[1].pageY);m.set(t,e)}}function D(){const t=x[0].pageX-x[1].pageX,e=x[0].pageY-x[1].pageY,n=Math.sqrt(t*t+e*e);v.set(0,n)}function N(t){if(1==x.length)f.set(t.pageX,t.pageY);else{const e=Y(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);f.set(n,r)}d.subVectors(f,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;E(2*Math.PI*d.x/e.clientHeight),M(2*Math.PI*d.y/e.clientHeight),p.copy(f)}function F(t){if(1===x.length)g.set(t.pageX,t.pageY);else{const e=Y(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);g.set(n,r)}y.subVectors(g,m).multiplyScalar(n.panSpeed),C(y.x,y.y),m.copy(g)}function z(t){const e=Y(t),r=t.pageX-e.x,i=t.pageY-e.y,o=Math.sqrt(r*r+i*i);_.set(0,o),b.set(0,Math.pow(_.y/v.y,n.zoomSpeed)),O(b.y),v.copy(_)}function B(t){!1!==n.enabled&&(0===x.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",j),n.domElement.addEventListener("pointerup",U)),function(t){x.push(t)}(t),"touch"===t.pointerType?function(t){switch(q(t),x.length){case 1:switch(n.touches.ONE){case 0:if(!1===n.enableRotate)return;I(),i=r.TOUCH_ROTATE;break;case 1:if(!1===n.enablePan)return;R(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case 2:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&D(),n.enablePan&&R(),i=r.TOUCH_DOLLY_PAN;break;case 3:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&D(),n.enableRotate&&I(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(Uf)}(t):function(t){let e;switch(t.button){case 0:e=n.mouseButtons.LEFT;break;case 1:e=n.mouseButtons.MIDDLE;break;case 2:e=n.mouseButtons.RIGHT;break;default:e=-1}switch(e){case c.DOLLY:if(!1===n.enableZoom)return;!function(t){v.set(t.clientX,t.clientY)}(t),i=r.DOLLY;break;case c.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;L(t),i=r.PAN}else{if(!1===n.enableRotate)return;k(t),i=r.ROTATE}break;case c.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enableRotate)return;k(t),i=r.ROTATE}else{if(!1===n.enablePan)return;L(t),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(Uf)}(t))}function j(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(q(t),i){case r.TOUCH_ROTATE:if(!1===n.enableRotate)return;N(t),n.update();break;case r.TOUCH_PAN:if(!1===n.enablePan)return;F(t),n.update();break;case r.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&z(t),n.enablePan&&F(t)}(t),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&z(t),n.enableRotate&&N(t)}(t),n.update();break;default:i=r.NONE}}(t):function(t){if(!1!==n.enabled)switch(i){case r.ROTATE:if(!1===n.enableRotate)return;!function(t){f.set(t.clientX,t.clientY),d.subVectors(f,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;E(2*Math.PI*d.x/e.clientHeight),M(2*Math.PI*d.y/e.clientHeight),p.copy(f),n.update()}(t);break;case r.DOLLY:if(!1===n.enableZoom)return;!function(t){_.set(t.clientX,t.clientY),b.subVectors(_,v),b.y>0?O(S()):b.y<0&&P(S()),v.copy(_),n.update()}(t);break;case r.PAN:if(!1===n.enablePan)return;!function(t){g.set(t.clientX,t.clientY),y.subVectors(g,m).multiplyScalar(n.panSpeed),C(y.x,y.y),m.copy(g),n.update()}(t)}}(t))}function U(t){W(t),0===x.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",j),n.domElement.removeEventListener("pointerup",U)),n.dispatchEvent(Zf),i=r.NONE}function Z(t){W(t)}function V(t){!1!==n.enabled&&!1!==n.enableZoom&&i===r.NONE&&(t.preventDefault(),n.dispatchEvent(Uf),function(t){t.deltaY<0?P(S()):t.deltaY>0&&O(S()),n.update()}(t),n.dispatchEvent(Zf))}function G(t){!1!==n.enabled&&!1!==n.enablePan&&function(t){let e=!1;switch(t.code){case n.keys.UP:C(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:C(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:C(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:C(-n.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),n.update())}(t)}function H(t){!1!==n.enabled&&t.preventDefault()}function W(t){delete w[t.pointerId];for(let e=0;e<x.length;e++)if(x[e].pointerId==t.pointerId)return void x.splice(e,1)}function q(t){let e=w[t.pointerId];void 0===e&&(e=new Ue,w[t.pointerId]=e),e.set(t.pageX,t.pageY)}function Y(t){const e=t.pointerId===x[0].pointerId?x[1]:x[0];return w[e.pointerId]}n.domElement.addEventListener("contextmenu",H),n.domElement.addEventListener("pointerdown",B),n.domElement.addEventListener("pointercancel",Z),n.domElement.addEventListener("wheel",V,{passive:!1}),this.update()}}const Gf={type:"change"};class Hf extends Le{constructor(t,e){super(),void 0===e&&(console.warn('THREE.FlyControls: The second parameter "domElement" is now mandatory.'),e=document),this.object=t,this.domElement=e,this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;const n=this,r=1e-6,i=new fn,o=new dn;this.tmpQuaternion=new fn,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new dn(0,0,0),this.rotationVector=new dn(0,0,0),this.keydown=function(t){if(!t.altKey){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(t){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(t){if(this.dragToLook)this.mouseStatus++;else{switch(t.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(t){if(!this.dragToLook||this.mouseStatus>0){const e=this.getContainerDimensions(),n=e.size[0]/2,r=e.size[1]/2;this.moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this.moveState.pitchDown=(t.pageY-e.offset[1]-r)/r,this.updateRotationVector()}},this.mouseup=function(t){if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(t.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(t){const e=t*n.movementSpeed,a=t*n.rollSpeed;n.object.translateX(n.moveVector.x*e),n.object.translateY(n.moveVector.y*e),n.object.translateZ(n.moveVector.z*e),n.tmpQuaternion.set(n.rotationVector.x*a,n.rotationVector.y*a,n.rotationVector.z*a,1).normalize(),n.object.quaternion.multiply(n.tmpQuaternion),(o.distanceToSquared(n.object.position)>r||8*(1-i.dot(n.object.quaternion))>r)&&(n.dispatchEvent(Gf),i.copy(n.object.quaternion),o.copy(n.object.position))},this.updateMovementVector=function(){const t=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-t+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",Wf),this.domElement.removeEventListener("mousedown",s),this.domElement.removeEventListener("mousemove",a),this.domElement.removeEventListener("mouseup",u),window.removeEventListener("keydown",l),window.removeEventListener("keyup",c)};const a=this.mousemove.bind(this),s=this.mousedown.bind(this),u=this.mouseup.bind(this),l=this.keydown.bind(this),c=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",Wf),this.domElement.addEventListener("mousemove",a),this.domElement.addEventListener("mousedown",s),this.domElement.addEventListener("mouseup",u),window.addEventListener("keydown",l),window.addEventListener("keyup",c),this.updateMovementVector(),this.updateRotationVector()}}function Wf(t){t.preventDefault()}const qf={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor.a *= opacity;\n\n\n\t\t}"};class Yf{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}const Xf=new ji(-1,1,1,-1,0,1),$f=new Gr;$f.setAttribute("position",new Nr([-1,3,0,-1,-1,0,3,-1,0],3)),$f.setAttribute("uv",new Nr([0,2,0,0,2,0],2));class Kf{constructor(t){this._mesh=new ui($f,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,Xf)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class Jf extends Yf{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof di?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=fi.clone(t.uniforms),this.material=new di({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new Kf(this.material)}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}}class Qf extends Yf{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,n){const r=t.getContext(),i=t.state;let o,a;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(o=0,a=1):(o=1,a=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,o,4294967295),i.buffers.stencil.setClear(a),i.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class td extends Yf{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class ed{constructor(t,e){if(this.renderer=t,void 0===e){const n=t.getSize(new Ue);this._pixelRatio=t.getPixelRatio(),this._width=n.width,this._height=n.height,(e=new cn(this._width*this._pixelRatio,this._height*this._pixelRatio)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===qf&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===Jf&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new Jf(qf),this.clock=new ic}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,r=this.passes.length;e<r;e++){const r=this.passes[e];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),r.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),r.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==Qf&&(r instanceof Qf?n=!0:r instanceof td&&(n=!1))}}this.renderer.setRenderTarget(e)}reset(t){if(void 0===t){const e=this.renderer.getSize(new Ue);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,r)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}}new ji(-1,1,1,-1,0,1);const nd=new Gr;nd.setAttribute("position",new Nr([-1,3,0,-1,-1,0,3,-1,0],3)),nd.setAttribute("uv",new Nr([0,2,0,0,2,0],2));class rd extends Yf{constructor(t,e,n,r,i){super(),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=void 0!==i?i:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new en}render(t,e,n){const r=t.autoClear;let i,o;t.autoClear=!1,void 0!==this.overrideMaterial&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(t.getClearColor(this._oldClearColor),i=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),this.clearColor&&t.setClearColor(this._oldClearColor,i),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=o),t.autoClear=r}}function id(){return id=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},id.apply(this,arguments)}var od=s(5161),ad=s(8535),sd=function(t){var e,n;function r(e){var n;return n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this,(0,od.Z)(n)}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,(0,ad.Z)(e,n),r}((0,s(6070).Z)(Error));function ud(t){return Math.round(255*t)}function ld(t,e,n){return ud(t)+","+ud(e)+","+ud(n)}function cd(t,e,n,r){if(void 0===r&&(r=ld),0===e)return r(n,n,n);var i=(t%360+360)%360/60,o=(1-Math.abs(2*n-1))*e,a=o*(1-Math.abs(i%2-1)),s=0,u=0,l=0;i>=0&&i<1?(s=o,u=a):i>=1&&i<2?(s=a,u=o):i>=2&&i<3?(u=o,l=a):i>=3&&i<4?(u=a,l=o):i>=4&&i<5?(s=a,l=o):i>=5&&i<6&&(s=o,l=a);var c=n-o/2;return r(s+c,u+c,l+c)}var hd={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",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:"ff00ff",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:"639",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"},pd=/^#[a-fA-F0-9]{6}$/,fd=/^#[a-fA-F0-9]{8}$/,dd=/^#[a-fA-F0-9]{3}$/,md=/^#[a-fA-F0-9]{4}$/,gd=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,yd=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,vd=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,_d=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function bd(t){if("string"!=typeof t)throw new sd(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return hd[e]?"#"+hd[e]:t}(t);if(e.match(pd))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(fd)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(dd))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(md)){var r=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:r}}var i=gd.exec(e);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=yd.exec(e.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])>1?parseFloat(""+o[4])/100:parseFloat(""+o[4])};var a=vd.exec(e);if(a){var s="rgb("+cd(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",u=gd.exec(s);if(!u)throw new sd(4,e,s);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10)}}var l=_d.exec(e.substring(0,50));if(l){var c="rgb("+cd(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",h=gd.exec(c);if(!h)throw new sd(4,e,c);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new sd(5)}var xd=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function wd(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function Sd(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return xd("#"+wd(t)+wd(e)+wd(n));if("object"==typeof t&&void 0===e&&void 0===n)return xd("#"+wd(t.red)+wd(t.green)+wd(t.blue));throw new sd(6)}function Ed(t,e,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=e?t.apply(this,r):Ed(t,e,r)}}function Md(t){return Ed(t,t.length,[])}function Td(t,e,n){return Math.max(t,Math.min(e,n))}function Ad(t,e){if("transparent"===e)return e;var n=bd(e);return function(t,e,n,r){if("string"==typeof t&&"number"==typeof e){var i=bd(t);return"rgba("+i.red+","+i.green+","+i.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Sd(t,e,n):"rgba("+t+","+e+","+n+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Sd(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new sd(7)}(id({},n,{alpha:Td(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))}var Cd=Md(Ad),Od=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return this.None(t)},Out:function(t){return this.None(t)},InOut:function(t){return this.None(t)}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-Od.Bounce.Out(1-t)},Out:function(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},InOut:function(t){return t<.5?.5*Od.Bounce.In(2*t):.5*Od.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),Pd=function(){return performance.now()},kd=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=Pd()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]],o=!e;i&&!1===i.update(t,o)&&!e&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),Ld={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),o=Ld.Utils.Linear;return e<0?o(t[0],t[1],r):e>1?o(t[n],t[n-1],n-r):o(t[i],t[i+1>n?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,o=Ld.Utils.Bernstein,a=0;a<=r;a++)n+=i(1-e,r-a)*i(e,a)*t[a]*o(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),o=Ld.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),o(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):o(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=Ld.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var r=e;r>1;r--)n*=r;return t[e]=n,n}}(),CatmullRom:function(t,e,n,r,i){var o=.5*(n-t),a=.5*(r-e),s=i*i;return(2*e-2*n+o+a)*(i*s)+(-3*e+3*n-2*o-a)*s+o*i+e}}},Id=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),Rd=new kd,Dd=function(){function t(t,e){void 0===e&&(e=Rd),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Od.Linear.None,this._interpolationFunction=Ld.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Id.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=Pd()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var i in this._valuesEnd)r[i]=this._valuesEnd[i];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,r,i){for(var o in n){var a=t[o],s=Array.isArray(a),u=s?"array":typeof a,l=!s&&Array.isArray(n[o]);if("undefined"!==u&&"function"!==u){if(l){if(0===(g=n[o]).length)continue;for(var c=[a],h=0,p=g.length;h<p;h+=1){var f=this._handleRelativeValue(a,g[h]);if(isNaN(f)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}c.push(f)}l&&(n[o]=c)}if("object"!==u&&!s||!a||l)(void 0===e[o]||i)&&(e[o]=a),s||(e[o]*=1),r[o]=l?n[o].slice().reverse():e[o]||0;else{e[o]=s?[]:{};var d=a;for(var m in d)e[o][m]=d[m];r[o]=s?[]:{};var g=n[o];if(!this._isDynamic){var y={};for(var m in g)y[m]=g[m];n[o]=g=y}this._setupProperties(d,e[o],g,r[o],i)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=Pd()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=Pd()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=Rd),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=Od.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=Ld.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){if(void 0===t&&(t=Pd()),void 0===e&&(e=!0),this._isPaused)return!0;var n,r,i=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>i)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),r=(t-this._startTime)/this._duration,r=0===this._duration||r>1?1:r;var o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),1===r){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,s=this._chainedTweens.length;a<s;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,r){for(var i in n)if(void 0!==e[i]){var o=e[i]||0,a=n[i],s=Array.isArray(t[i]),u=Array.isArray(a);!s&&u?t[i]=this._interpolationFunction(a,r):"object"==typeof a&&a?this._updateProperties(t[i],o,a,r):"number"==typeof(a=this._handleRelativeValue(o,a))&&(t[i]=o+(a-o)*r)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),Nd=(Id.nextId,Rd),Fd=(Nd.getAll.bind(Nd),Nd.removeAll.bind(Nd),Nd.add.bind(Nd),Nd.remove.bind(Nd),Nd.update.bind(Nd));function zd(t){return function(t){if(Array.isArray(t))return jd(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Bd(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 Bd(t,e){if(t){if("string"==typeof t)return jd(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jd(t,e):void 0}}function jd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}");var Ud=window.THREE?window.THREE:{WebGLRenderer:us,Scene:hs,PerspectiveCamera:gi,Raycaster:bc,SRGBColorSpace:Me,TextureLoader:Bl,Vector2:Ue,Vector3:dn,Box3:yn,Color:en,Mesh:ui,SphereGeometry:il,MeshBasicMaterial:Pr,BackSide:v,EventDispatcher:Le,MOUSE:c,Quaternion:fn,Spherical:Sc,Clock:ic},Zd=op({props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n)}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(t.clock.getDelta()),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),r=n.length?n[0]:null;e=r?r.object:null,t.intersectionPoint=r?r.point:null}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&ap(t.tooltipContent)(e)||"",t.hoverObj=e)}Fd()}return this},getPointerPos:function(t){var e=t.pointerPos;return{x:e.x,y:e.y}},cameraPosition:function(t,e,n,r){var i=t.camera;if(e&&t.initialised){var o=e,a=n||{x:0,y:0,z:0};if(r){var s=Object.assign({},i.position),u=h();new Dd(s).to(o,r).easing(Od.Quadratic.Out).onUpdate(l).start(),new Dd(u).to(a,r/3).easing(Od.Quadratic.Out).onUpdate(c).start()}else l(o),c(a);return this}return Object.assign({},i.position,{lookAt:h()});function l(t){var e=t.x,n=t.y,r=t.z;void 0!==e&&(i.position.x=e),void 0!==n&&(i.position.y=n),void 0!==r&&(i.position.z=r)}function c(e){var n=new Ud.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:i.lookAt(n)}function h(){return Object.assign(new Ud.Vector3(0,0,-1e3).applyQuaternion(i.quaternion).add(i.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return this.fitToBbox(this.getBbox.apply(this,i),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t.camera;if(e){var o=new Ud.Vector3(0,0,0),a=2*Math.max.apply(Math,zd(Object.entries(e).map((function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,n)||Bd(e,n)||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.")}()),i=r[0],a=r[1];return Math.max.apply(Math,zd(a.map((function(t){return Math.abs(o[i]-t)}))))})))),s=(1-2*r/t.height)*i.fov,u=a/Math.atan(s*Math.PI/180),l=u/i.aspect,c=Math.max(u,l);if(c>0){var h=o.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(h,o,n)}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new Ud.Box3(new Ud.Vector3(0,0,0),new Ud.Vector3(0,0,0)),r=t.objects.filter(e);return r.length?(r.forEach((function(t){return n.expandByObject(t)})),Object.assign.apply(Object,zd(["x","y","z"].map((function(t){return function(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},t,[n.min[t],n.max[t]])}))))):null},getScreenCoords:function(t,e,n,r){var i=new Ud.Vector3(e,n,r);return i.project(this.camera()),{x:(i.x+1)*t.width/2,y:-(i.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new Ud.Vector2(e/t.width*2-1,-n/t.height*2+1),o=new Ud.Raycaster;return o.setFromCamera(i,t.camera),Object.assign({},o.ray.at(r,new Ud.Vector3))},intersectingObjects:function(t,e,n){var r=new Ud.Vector2(e/t.width*2-1,-n/t.height*2+1),i=new Ud.Raycaster;return i.params.Line.threshold=t.lineHoverPrecision,i.setFromCamera(r,t.camera),i.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return{scene:new Ud.Scene,camera:new Ud.PerspectiveCamera,clock:new Ud.Clock}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,o=n.rendererConfig,a=void 0===o?{}:o,s=n.extraRenderers,u=void 0===s?[]:s,l=n.waitForLoadComplete,c=void 0===l||l;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new Ud.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var r=function(t){var e=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;return{top:e.top+r,left:e.left+n}}(e.container);e.pointerPos.x=n.pageX-r.left,e.pointerPos.y=n.pageY-r.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint)}))}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault()})),e.renderer=new Ud.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},a)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=u,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement)})),e.postProcessingComposer=new ed(e.renderer),e.postProcessingComposer.addPass(new rd(e.scene,e.camera)),e.controls=new{trackball:Bf,orbit:Vf,fly:Hf}[i](e.camera,e.renderer.domElement),"fly"===i&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0)})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1}))),[e.renderer,e.postProcessingComposer].concat(zd(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new Ud.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!c,window.scene=e.scene},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(zd(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new Ud.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=bd(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new Ud.Color(Cd(1,t.backgroundColor)),n)}function r(){t.loadComplete=t.scene.visible=!0}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new Ud.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=Ud.SRGBColorSpace,t.skysphere.material=new Ud.MeshBasicMaterial({map:e,side:Ud.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&r()})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&r())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})))}});function Vd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vd(Object(n),!0).forEach((function(e){Hd(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wd(t){return function(t){if(Array.isArray(t))return qd(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return qd(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qd(t,e):void 0}}(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 qd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yd(t,e){var n=new e;return{linkProp:function(e){return{default:n[e](),onChange:function(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];var s=r[e].apply(r,o);return s===r?this:s}}}}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".graph-info-msg {\n top: 50%;\n width: 100%;\n text-align: center;\n color: lavender;\n opacity: 0.7;\n font-size: 22px;\n position: absolute;\n font-family: Sans-serif;\n}\n\n.scene-container .clickable {\n cursor: pointer;\n}\n\n.scene-container .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n\n.scene-container .grabbable:active {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}");var Xd=window.THREE?window.THREE:{AmbientLight:Jl,DirectionalLight:Kl,Vector3:dn},$d=Yd("forceGraph",Df),Kd=Object.assign.apply(Object,Wd(["jsonUrl","graphData","numDimensions","dagMode","dagLevelDistance","dagNodeFilter","onDagError","nodeRelSize","nodeId","nodeVal","nodeResolution","nodeColor","nodeAutoColorBy","nodeOpacity","nodeVisibility","nodeThreeObject","nodeThreeObjectExtend","linkSource","linkTarget","linkVisibility","linkColor","linkAutoColorBy","linkOpacity","linkWidth","linkResolution","linkCurvature","linkCurveRotation","linkMaterial","linkThreeObject","linkThreeObjectExtend","linkPositionUpdate","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalArrowResolution","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleResolution","forceEngine","d3AlphaDecay","d3VelocityDecay","d3AlphaMin","ngraphPhysics","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map((function(t){return Hd({},t,$d.linkProp(t))})))),Jd=Object.assign.apply(Object,Wd(["refresh","getGraphBbox","d3Force","d3ReheatSimulation","emitParticle"].map((function(t){return Hd({},t,$d.linkMethod(t))})))),Qd=Yd("renderObjs",Zd),tm=Object.assign.apply(Object,Wd(["width","height","backgroundColor","showNavInfo","enablePointerInteraction"].map((function(t){return Hd({},t,Qd.linkProp(t))})))),em=Object.assign.apply(Object,Wd(["cameraPosition","postProcessingComposer"].map((function(t){return Hd({},t,Qd.linkMethod(t))}))).concat([{graph2ScreenCoords:Qd.linkMethod("getScreenCoords"),screen2GraphCoords:Qd.linkMethod("getSceneCoords")}])),nm=op({props:Gd(Gd({nodeLabel:{default:"name",triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:1,onChange:function(t,e){return e.renderObjs.lineHoverPrecision(t)},triggerUpdate:!1},enableNavigationControls:{default:!0,onChange:function(t,e){var n=e.renderObjs.controls();n&&(n.enabled=t)},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1}},Kd),tm),methods:Gd(Gd({zoomToFit:function(t,e,n){for(var r,i=arguments.length,o=new Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];return t.renderObjs.fitToBbox((r=t.forceGraph).getGraphBbox.apply(r,o),e,n),this},pauseAnimation:function(t){return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),this},resumeAnimation:function(t){return null===t.animationFrameRequestId&&this._animationCycle(),this},_animationCycle:function(t){t.enablePointerInteraction&&(this.renderer().domElement.style.cursor=null),t.forceGraph.tickFrame(),t.renderObjs.tick(),t.animationFrameRequestId=requestAnimationFrame(this._animationCycle)},scene:function(t){return t.renderObjs.scene()},camera:function(t){return t.renderObjs.camera()},renderer:function(t){return t.renderObjs.renderer()},controls:function(t){return t.renderObjs.controls()},tbControls:function(t){return t.renderObjs.tbControls()},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Jd),em),stateInit:function(t){var e=t.controlType,n=t.rendererConfig,r=t.extraRenderers;return{forceGraph:new Df,renderObjs:Zd({controlType:e,rendererConfig:n,extraRenderers:r})}},init:function(t,e){t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.style.position="relative";var n=document.createElement("div");e.container.appendChild(n),e.renderObjs(n);var r,i=e.renderObjs.camera(),o=e.renderObjs.renderer(),a=e.renderObjs.controls();a.enabled=!!e.enableNavigationControls,e.lastSetCameraZ=i.position.z,e.container.appendChild(r=document.createElement("div")),r.className="graph-info-msg",r.textContent="",e.forceGraph.onLoading((function(){r.textContent="Loading..."})).onFinishLoading((function(){r.textContent=""})).onUpdate((function(){e.graphData=e.forceGraph.graphData(),0===i.position.x&&0===i.position.y&&i.position.z===e.lastSetCameraZ&&e.graphData.nodes.length&&(i.lookAt(e.forceGraph.position),e.lastSetCameraZ=i.position.z=170*Math.cbrt(e.graphData.nodes.length))})).onFinishUpdate((function(){if(e._dragControls){var t=e.graphData.nodes.find((function(t){return t.__initialFixedPos&&!t.__disposeControlsAfterDrag}));t?t.__disposeControlsAfterDrag=!0:e._dragControls.dispose(),e._dragControls=void 0}if(e.enableNodeDrag&&e.enablePointerInteraction&&"d3"===e.forceEngine){var n=e._dragControls=new Vc(e.graphData.nodes.map((function(t){return t.__threeObj})).filter((function(t){return t})),i,o.domElement);n.addEventListener("dragstart",(function(t){a.enabled=!1,t.object.__initialPos=t.object.position.clone(),t.object.__prevPos=t.object.position.clone();var e=rm(t.object).__data;!e.__initialFixedPos&&(e.__initialFixedPos={fx:e.fx,fy:e.fy,fz:e.fz}),!e.__initialPos&&(e.__initialPos={x:e.x,y:e.y,z:e.z}),["x","y","z"].forEach((function(t){return e["f".concat(t)]=e[t]})),o.domElement.classList.add("grabbable")})),n.addEventListener("drag",(function(t){var n=rm(t.object);if(!t.object.hasOwnProperty("__graphObjType")){var r=t.object.__initialPos,i=t.object.__prevPos,o=t.object.position;n.position.add(o.clone().sub(i)),i.copy(o),o.copy(r)}var a=n.__data,s=n.position,u={x:s.x-a.x,y:s.y-a.y,z:s.z-a.z};["x","y","z"].forEach((function(t){return a["f".concat(t)]=a[t]=s[t]})),e.forceGraph.d3AlphaTarget(.3).resetCountdown(),a.__dragged=!0,e.onNodeDrag(a,u)})),n.addEventListener("dragend",(function(t){delete t.object.__initialPos,delete t.object.__prevPos;var r=rm(t.object).__data;r.__disposeControlsAfterDrag&&(n.dispose(),delete r.__disposeControlsAfterDrag);var i=r.__initialFixedPos,s=r.__initialPos,u={x:s.x-r.x,y:s.y-r.y,z:s.z-r.z};i&&(["x","y","z"].forEach((function(t){var e="f".concat(t);void 0===i[e]&&delete r[e]})),delete r.__initialFixedPos,delete r.__initialPos,r.__dragged&&(delete r.__dragged,e.onNodeDragEnd(r,u))),e.forceGraph.d3AlphaTarget(0).resetCountdown(),e.enableNavigationControls&&(a.enabled=!0,a.domElement&&a.domElement.ownerDocument&&a.domElement.ownerDocument.dispatchEvent(new PointerEvent("pointerup",{pointerType:"touch"}))),o.domElement.classList.remove("grabbable")}))}})),e.renderObjs.objects([new Xd.AmbientLight(12303291),new Xd.DirectionalLight(16777215,.6),e.forceGraph]).hoverOrderComparator((function(t,e){var n=rm(t);if(!n)return 1;var r=rm(e);if(!r)return-1;var i=function(t){return"node"===t.__graphObjType};return i(r)-i(n)})).tooltipContent((function(t){var n=rm(t);return n&&ap(e["".concat(n.__graphObjType,"Label")])(n.__data)||""})).hoverDuringDrag(!1).onHover((function(t){var n=rm(t);if(n!==e.hoverObj){var r=e.hoverObj?e.hoverObj.__graphObjType:null,i=e.hoverObj?e.hoverObj.__data:null,a=n?n.__graphObjType:null,s=n?n.__data:null;if(r&&r!==a){var u=e["on".concat("node"===r?"Node":"Link","Hover")];u&&u(null,i)}if(a){var l=e["on".concat("node"===a?"Node":"Link","Hover")];l&&l(s,r===a?i:null)}o.domElement.classList[n&&e["on".concat("node"===a?"Node":"Link","Click")]||!n&&e.onBackgroundClick?"add":"remove"]("clickable"),e.hoverObj=n}})).clickAfterDrag(!1).onClick((function(t,n){var r=rm(t);if(r){var i=e["on".concat("node"===r.__graphObjType?"Node":"Link","Click")];i&&i(r.__data,n)}else e.onBackgroundClick&&e.onBackgroundClick(n)})).onRightClick((function(t,n){var r=rm(t);if(r){var i=e["on".concat("node"===r.__graphObjType?"Node":"Link","RightClick")];i&&i(r.__data,n)}else e.onBackgroundRightClick&&e.onBackgroundRightClick(n)})),this._animationCycle()}});function rm(t){for(var e=t;e&&!e.hasOwnProperty("__graphObjType");)e=e.parent;return e}var im=s(314),om=s.n(im);let am=wm();const sm=t=>vm(t,am);let um=wm();sm.write=t=>vm(t,um);let lm=wm();sm.onStart=t=>vm(t,lm);let cm=wm();sm.onFrame=t=>vm(t,cm);let hm=wm();sm.onFinish=t=>vm(t,hm);let pm=[];sm.setTimeout=(t,e)=>{let n=sm.now()+e,r=()=>{let t=pm.findIndex((t=>t.cancel==r));~t&&pm.splice(t,1),gm-=~t?1:0},i={time:n,handler:t,cancel:r};return pm.splice(fm(n),0,i),gm+=1,_m(),i};let fm=t=>~(~pm.findIndex((e=>e.time>t))||~pm.length);sm.cancel=t=>{lm.delete(t),cm.delete(t),hm.delete(t),am.delete(t),um.delete(t)},sm.sync=t=>{ym=!0,sm.batchedUpdates(t),ym=!1},sm.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...t){e=t,sm.onStart(n)}return r.handler=t,r.cancel=()=>{lm.delete(n),e=null},r};let dm="undefined"!=typeof window?window.requestAnimationFrame:()=>{};sm.use=t=>dm=t,sm.now="undefined"!=typeof performance?()=>performance.now():Date.now,sm.batchedUpdates=t=>t(),sm.catch=console.error,sm.frameLoop="always",sm.advance=()=>{"demand"!==sm.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):xm()};let mm=-1,gm=0,ym=!1;function vm(t,e){ym?(e.delete(t),t(0)):(e.add(t),_m())}function _m(){mm<0&&(mm=0,"demand"!==sm.frameLoop&&dm(bm))}function bm(){~mm&&(dm(bm),sm.batchedUpdates(xm))}function xm(){let t=mm;mm=sm.now();let e=fm(mm);e&&(Sm(pm.splice(0,e),(t=>t.handler())),gm-=e),gm?(lm.flush(),am.flush(t?Math.min(64,mm-t):16.667),cm.flush(),um.flush(),hm.flush()):mm=-1}function wm(){let t=new Set,e=t;return{add(n){gm+=e!=t||t.has(n)?0:1,t.add(n)},delete:n=>(gm-=e==t&&t.has(n)?1:0,t.delete(n)),flush(n){e.size&&(t=new Set,gm-=e.size,Sm(e,(e=>e(n)&&t.add(e))),gm+=t.size,e=t)}}}function Sm(t,e){t.forEach((t=>{try{e(t)}catch(t){sm.catch(t)}}))}function Em(){}const Mm={arr:Array.isArray,obj:t=>!!t&&"Object"===t.constructor.name,fun:t=>"function"==typeof t,str:t=>"string"==typeof t,num:t=>"number"==typeof t,und:t=>void 0===t};function Tm(t,e){if(Mm.arr(t)){if(!Mm.arr(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}const Am=(t,e)=>t.forEach(e);function Cm(t,e,n){if(Mm.arr(t))for(let r=0;r<t.length;r++)e.call(n,t[r],`${r}`);else for(const r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r)}const Om=t=>Mm.und(t)?[]:Mm.arr(t)?t:[t];function Pm(t,e){if(t.size){const n=Array.from(t);t.clear(),Am(n,e)}}const km=(t,...e)=>Pm(t,(t=>t(...e))),Lm=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Im,Rm,Dm=null,Nm=!1,Fm=Em;var zm=Object.freeze({__proto__:null,get createStringInterpolator(){return Im},get to(){return Rm},get colors(){return Dm},get skipAnimation(){return Nm},get willAdvance(){return Fm},assign:t=>{t.to&&(Rm=t.to),t.now&&(sm.now=t.now),void 0!==t.colors&&(Dm=t.colors),null!=t.skipAnimation&&(Nm=t.skipAnimation),t.createStringInterpolator&&(Im=t.createStringInterpolator),t.requestAnimationFrame&&sm.use(t.requestAnimationFrame),t.batchedUpdates&&(sm.batchedUpdates=t.batchedUpdates),t.willAdvance&&(Fm=t.willAdvance),t.frameLoop&&(sm.frameLoop=t.frameLoop)}});const Bm=new Set;let jm=[],Um=[],Zm=0;const Vm={get idle(){return!Bm.size&&!jm.length},start(t){Zm>t.priority?(Bm.add(t),sm.onStart(Gm)):(Hm(t),sm(qm))},advance:qm,sort(t){if(Zm)sm.onFrame((()=>Vm.sort(t)));else{const e=jm.indexOf(t);~e&&(jm.splice(e,1),Wm(t))}},clear(){jm=[],Bm.clear()}};function Gm(){Bm.forEach(Hm),Bm.clear(),sm(qm)}function Hm(t){jm.includes(t)||Wm(t)}function Wm(t){jm.splice(function(e,n){const r=e.findIndex((e=>e.priority>t.priority));return r<0?e.length:r}(jm),0,t)}function qm(t){const e=Um;for(let n=0;n<jm.length;n++){const r=jm[n];Zm=r.priority,r.idle||(Fm(r),r.advance(t),r.idle||e.push(r))}return Zm=0,Um=jm,Um.length=0,jm=e,jm.length>0}const Ym="[-+]?\\d*\\.?\\d+",Xm=Ym+"%";function $m(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const Km=new RegExp("rgb"+$m(Ym,Ym,Ym)),Jm=new RegExp("rgba"+$m(Ym,Ym,Ym,Ym)),Qm=new RegExp("hsl"+$m(Ym,Xm,Xm)),tg=new RegExp("hsla"+$m(Ym,Xm,Xm,Ym)),eg=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ng=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,rg=/^#([0-9a-fA-F]{6})$/,ig=/^#([0-9a-fA-F]{8})$/;function og(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ag(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=og(i,r,t+1/3),a=og(i,r,t),s=og(i,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function sg(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function ug(t){return(parseFloat(t)%360+360)%360/360}function lg(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function cg(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function hg(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=rg.exec(t))?parseInt(e[1]+"ff",16)>>>0:Dm&&void 0!==Dm[t]?Dm[t]:(e=Km.exec(t))?(sg(e[1])<<24|sg(e[2])<<16|sg(e[3])<<8|255)>>>0:(e=Jm.exec(t))?(sg(e[1])<<24|sg(e[2])<<16|sg(e[3])<<8|lg(e[4]))>>>0:(e=eg.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=ig.exec(t))?parseInt(e[1],16)>>>0:(e=ng.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=Qm.exec(t))?(255|ag(ug(e[1]),cg(e[2]),cg(e[3])))>>>0:(e=tg.exec(t))?(ag(ug(e[1]),cg(e[2]),cg(e[3]))|lg(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/255})`)}const pg=(t,e,n)=>{if(Mm.fun(t))return t;if(Mm.arr(t))return pg({range:t,output:e,extrapolate:n});if(Mm.str(t.output[0]))return Im(t);const r=t,i=r.output,o=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}(t,o);return function(t,e,n,r,i,o,a,s,u){let l=u?u(t):t;if(l<e){if("identity"===a)return l;"clamp"===a&&(l=e)}if(l>n){if("identity"===s)return l;"clamp"===s&&(l=n)}return r===i?r:e===n?t<=e?r:i:(e===-1/0?l=-l:n===1/0?l-=e:l=(l-e)/(n-e),l=o(l),r===-1/0?l=-l:i===1/0?l+=r:l=l*(i-r)+r,l)}(t,o[e],o[e+1],i[e],i[e+1],u,a,s,r.map)}},fg=1.70158,dg=1.525*fg,mg=fg+1,gg=2*Math.PI/3,yg=2*Math.PI/4.5,vg=t=>{const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},_g={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>0===t?0:Math.pow(2,10*t-10),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>mg*t*t*t-fg*t*t,easeOutBack:t=>1+mg*Math.pow(t-1,3)+fg*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*(7.189819*t-dg)/2:(Math.pow(2*t-2,2)*((dg+1)*(2*t-2)+dg)+2)/2,easeInElastic:t=>0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*gg),easeOutElastic:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*gg)+1,easeInOutElastic:t=>0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*yg)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*yg)/2+1,easeInBounce:t=>1-vg(1-t),easeOutBounce:vg,easeInOutBounce:t=>t<.5?(1-vg(1-2*t))/2:(1+vg(2*t-1))/2,steps:(t,e="end")=>n=>{const r=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t;return i=("end"===e?Math.floor(r):Math.ceil(r))/t,Math.min(Math.max(i,0),1);var i}};function bg(){return bg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bg.apply(this,arguments)}const xg=Symbol.for("FluidValue.get"),wg=Symbol.for("FluidValue.observers"),Sg=t=>Boolean(t&&t[xg]),Eg=t=>t&&t[xg]?t[xg]():t,Mg=t=>t[wg]||null;function Tg(t,e){let n=t[wg];n&&n.forEach((t=>{!function(t,e){t.eventObserved?t.eventObserved(e):t(e)}(t,e)}))}class Ag{constructor(t){if(this[xg]=void 0,this[wg]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");Cg(this,t)}}const Cg=(t,e)=>kg(t,xg,e);function Og(t,e){if(t[xg]){let n=t[wg];n||kg(t,wg,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function Pg(t,e){let n=t[wg];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[wg]=null,t.observerRemoved&&t.observerRemoved(r,e)}}const kg=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),Lg=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ig=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Rg=new RegExp(`(${Lg.source})(%|[a-z]+)`,"i"),Dg=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ng=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Fg=t=>{const[e,n]=zg(t);if(!e||Lm())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||t}return n&&Ng.test(n)?Fg(n):n||t},zg=t=>{const e=Ng.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]};let Bg;const jg=(t,e,n,r,i)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,Ug=t=>{Bg||(Bg=Dm?new RegExp(`(${Object.keys(Dm).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map((t=>Eg(t).replace(Ng,Fg).replace(Ig,hg).replace(Bg,hg))),n=e.map((t=>t.match(Lg).map(Number))),r=n[0].map(((t,e)=>n.map((t=>{if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]})))).map((e=>pg(bg({},t,{output:e}))));return t=>{var n;const i=!Rg.test(e[0])&&(null==(n=e.find((t=>Rg.test(t))))?void 0:n.replace(Lg,""));let o=0;return e[0].replace(Lg,(()=>`${r[o++](t)}${i||""}`)).replace(Dg,jg)}},Zg="react-spring: ",Vg=t=>{const e=t;let n=!1;if("function"!=typeof e)throw new TypeError(`${Zg}once requires a function parameter`);return(...t)=>{n||(e(...t),n=!0)}},Gg=Vg(console.warn),Hg=Vg(console.warn);function Wg(t){return Mm.str(t)&&("#"==t[0]||/\d/.test(t)||!Lm()&&Ng.test(t)||t in(Dm||{}))}new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;const qg=Lm()?o.useEffect:o.useLayoutEffect,Yg=()=>{const t=(0,o.useRef)(!1);return qg((()=>(t.current=!0,()=>{t.current=!1})),[]),t};function Xg(){const t=(0,o.useState)()[1],e=Yg();return()=>{e.current&&t(Math.random())}}const $g=t=>(0,o.useEffect)(t,Kg),Kg=[];function Jg(t){const e=(0,o.useRef)();return(0,o.useEffect)((()=>{e.current=t})),e.current}const Qg=Symbol.for("Animated:node"),ty=t=>t&&t[Qg],ey=(t,e)=>((t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}))(t,Qg,e),ny=t=>t&&t[Qg]&&t[Qg].getPayload();class ry{constructor(){this.payload=void 0,ey(this,this)}getPayload(){return this.payload||[]}}class iy extends ry{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,Mm.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new iy(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return Mm.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Mm.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class oy extends iy{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=pg({output:[t,t]})}static create(t){return new oy(t)}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(Mm.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else{if(!super.setValue(t))return!1;this._string=null}return!0}reset(t){t&&(this._toString=pg({output:[this.getValue(),t]})),this._value=0,super.reset()}}const ay={dependencies:null};class sy extends ry{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Cm(this.source,((n,r)=>{(t=>!!t&&t[Qg]===t)(n)?e[r]=n.getValue(t):Sg(n)?e[r]=Eg(n):t||(e[r]=n)})),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Am(this.payload,(t=>t.reset()))}_makePayload(t){if(t){const e=new Set;return Cm(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){ay.dependencies&&Sg(t)&&ay.dependencies.add(t);const e=ny(t);e&&Am(e,(t=>this.add(t)))}}class uy extends sy{constructor(t){super(t)}static create(t){return new uy(t)}getValue(){return this.source.map((t=>t.getValue()))}setValue(t){const e=this.getPayload();return t.length==e.length?e.map(((e,n)=>e.setValue(t[n]))).some(Boolean):(super.setValue(t.map(ly)),!0)}}function ly(t){return(Wg(t)?oy:iy).create(t)}function cy(t){const e=ty(t);return e?e.constructor:Mm.arr(t)?uy:Wg(t)?oy:iy}function hy(){return hy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},hy.apply(this,arguments)}const py=(t,e)=>{const n=!Mm.fun(t)||t.prototype&&t.prototype.isReactComponent;return(0,o.forwardRef)(((r,i)=>{const a=(0,o.useRef)(null),s=n&&(0,o.useCallback)((t=>{a.current=function(t,e){return t&&(Mm.fun(t)?t(e):t.current=e),e}(i,t)}),[i]),[u,l]=function(t,e){const n=new Set;return ay.dependencies=n,t.style&&(t=hy({},t,{style:e.createAnimatedStyle(t.style)})),t=new sy(t),ay.dependencies=null,[t,n]}(r,e),c=Xg(),h=()=>{const t=a.current;n&&!t||!1===(!!t&&e.applyAnimatedValues(t,u.getValue(!0)))&&c()},p=new fy(h,l),f=(0,o.useRef)();qg((()=>(f.current=p,Am(l,(t=>Og(t,p))),()=>{f.current&&(Am(f.current.deps,(t=>Pg(t,f.current))),sm.cancel(f.current.update))}))),(0,o.useEffect)(h,[]),$g((()=>()=>{const t=f.current;Am(t.deps,(e=>Pg(e,t)))}));const d=e.getComponentProps(u.getValue());return o.createElement(t,hy({},d,{ref:s}))}))};class fy{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){"change"==t.type&&sm.write(this.update)}}const dy=Symbol.for("AnimatedComponent"),my=t=>Mm.str(t)?t:t&&Mm.str(t.displayName)?t.displayName:Mm.fun(t)&&t.name||null;function gy(){return gy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gy.apply(this,arguments)}function yy(t,...e){return Mm.fun(t)?t(...e):t}const vy=(t,e)=>!0===t||!!(e&&t&&(Mm.fun(t)?t(e):Om(t).includes(e))),_y=(t,e)=>Mm.obj(t)?e&&t[e]:t,by=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,xy=t=>t,wy=(t,e=xy)=>{let n=Sy;t.default&&!0!==t.default&&(t=t.default,n=Object.keys(t));const r={};for(const i of n){const n=e(t[i],i);Mm.und(n)||(r[i]=n)}return r},Sy=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ey={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function My(t){const e=function(t){const e={};let n=0;if(Cm(t,((t,r)=>{Ey[r]||(e[r]=t,n++)})),n)return e}(t);if(e){const n={to:e};return Cm(t,((t,r)=>r in e||(n[r]=t))),n}return gy({},t)}function Ty(t){return t=Eg(t),Mm.arr(t)?t.map(Ty):Wg(t)?zm.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function Ay(t){return Mm.fun(t)||Mm.arr(t)&&Mm.obj(t[0])}const Cy=gy({},{tension:170,friction:26},{mass:1,damping:1,easing:_g.linear,clamp:!1});class Oy{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Cy)}}function Py(t,e){if(Mm.und(e.decay)){const n=!Mm.und(e.tension)||!Mm.und(e.friction);!n&&Mm.und(e.frequency)&&Mm.und(e.damping)&&Mm.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const ky=[];class Ly{constructor(){this.changed=!1,this.values=ky,this.toValues=null,this.fromValues=ky,this.to=void 0,this.from=void 0,this.config=new Oy,this.immediate=!1}}function Iy(t,{key:e,props:n,defaultProps:r,state:i,actions:o}){return new Promise(((a,s)=>{var u;let l,c,h=vy(null!=(u=n.cancel)?u:null==r?void 0:r.cancel,e);if(h)d();else{Mm.und(n.pause)||(i.paused=vy(n.pause,e));let t=null==r?void 0:r.pause;!0!==t&&(t=i.paused||vy(t,e)),l=yy(n.delay||0,e),t?(i.resumeQueue.add(f),o.pause()):(o.resume(),f())}function p(){i.resumeQueue.add(f),i.timeouts.delete(c),c.cancel(),l=c.time-sm.now()}function f(){l>0&&!zm.skipAnimation?(i.delayed=!0,c=sm.setTimeout(d,l),i.pauseQueue.add(p),i.timeouts.add(c)):d()}function d(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(p),i.timeouts.delete(c),t<=(i.cancelId||0)&&(h=!0);try{o.start(gy({},n,{callId:t,cancel:h}),a)}catch(t){s(t)}}}))}const Ry=(t,e)=>1==e.length?e[0]:e.some((t=>t.cancelled))?Fy(t.get()):e.every((t=>t.noop))?Dy(t.get()):Ny(t.get(),e.every((t=>t.finished))),Dy=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),Ny=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),Fy=t=>({value:t,cancelled:!0,finished:!1});function zy(t,e,n,r){const{callId:i,parentId:o,onRest:a}=e,{asyncTo:s,promise:u}=n;return o||t!==s||e.reset?n.promise=(async()=>{n.asyncId=i,n.asyncTo=t;const l=wy(e,((t,e)=>"onRest"===e?void 0:t));let c,h;const p=new Promise(((t,e)=>(c=t,h=e))),f=t=>{const e=i<=(n.cancelId||0)&&Fy(r)||i!==n.asyncId&&Ny(r,!1);if(e)throw t.result=e,h(t),t},d=(t,e)=>{const o=new jy,a=new Uy;return(async()=>{if(zm.skipAnimation)throw By(n),a.result=Ny(r,!1),h(a),a;f(o);const s=Mm.obj(t)?gy({},t):gy({},e,{to:t});s.parentId=i,Cm(l,((t,e)=>{Mm.und(s[e])&&(s[e]=t)}));const u=await r.start(s);return f(o),n.paused&&await new Promise((t=>{n.resumeQueue.add(t)})),u})()};let m;if(zm.skipAnimation)return By(n),Ny(r,!1);try{let e;e=Mm.arr(t)?(async t=>{for(const e of t)await d(e)})(t):Promise.resolve(t(d,r.stop.bind(r))),await Promise.all([e.then(c),p]),m=Ny(r.get(),!0,!1)}catch(t){if(t instanceof jy)m=t.result;else{if(!(t instanceof Uy))throw t;m=t.result}}finally{i==n.asyncId&&(n.asyncId=o,n.asyncTo=o?s:void 0,n.promise=o?u:void 0)}return Mm.fun(a)&&sm.batchedUpdates((()=>{a(m,r,r.item)})),m})():u}function By(t,e){Pm(t.timeouts,(t=>t.cancel())),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}class jy extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class Uy extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Zy=t=>t instanceof Gy;let Vy=1;class Gy extends Ag{constructor(...t){super(...t),this.id=Vy++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=ty(this);return t&&t.getValue()}to(...t){return zm.to(this,t)}interpolate(...t){return Gg(`${Zg}The "interpolate" function is deprecated in v9 (use "to" instead)`),zm.to(this,t)}toJSON(){return this.get()}observerAdded(t){1==t&&this._attach()}observerRemoved(t){0==t&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Tg(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||Vm.sort(this),Tg(this,{type:"priority",parent:this,priority:t})}}const Hy=Symbol.for("SpringPhase"),Wy=t=>(1&t[Hy])>0,qy=t=>(2&t[Hy])>0,Yy=t=>(4&t[Hy])>0,Xy=(t,e)=>e?t[Hy]|=3:t[Hy]&=-3,$y=(t,e)=>e?t[Hy]|=4:t[Hy]&=-5;class Ky extends Gy{constructor(t,e){if(super(),this.key=void 0,this.animation=new Ly,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Mm.und(t)||!Mm.und(e)){const n=Mm.obj(t)?gy({},t):gy({},e,{from:t});Mm.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(qy(this)||this._state.asyncTo)||Yy(this)}get goal(){return Eg(this.animation.to)}get velocity(){const t=ty(this);return t instanceof iy?t.lastVelocity||0:t.getPayload().map((t=>t.lastVelocity||0))}get hasAnimated(){return Wy(this)}get isAnimating(){return qy(this)}get isPaused(){return Yy(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const r=this.animation;let{config:i,toValues:o}=r;const a=ny(r.to);!a&&Sg(r.to)&&(o=Om(Eg(r.to))),r.values.forEach(((s,u)=>{if(s.done)return;const l=s.constructor==oy?1:a?a[u].lastPosition:o[u];let c=r.immediate,h=l;if(!c){if(h=s.lastPosition,i.tension<=0)return void(s.done=!0);let e=s.elapsedTime+=t;const n=r.fromValues[u],o=null!=s.v0?s.v0:s.v0=Mm.arr(i.velocity)?i.velocity[u]:i.velocity;let a;const p=i.precision||(n==l?.005:Math.min(1,.001*Math.abs(l-n)));if(Mm.und(i.duration))if(i.decay){const t=!0===i.decay?.998:i.decay,r=Math.exp(-(1-t)*e);h=n+o/(1-t)*(1-r),c=Math.abs(s.lastPosition-h)<=p,a=o*r}else{a=null==s.lastVelocity?o:s.lastVelocity;const e=i.restVelocity||p/10,r=i.clamp?0:i.bounce,u=!Mm.und(r),f=n==l?s.v0>0:n<l;let d,m=!1;const g=1,y=Math.ceil(t/g);for(let t=0;t<y&&(d=Math.abs(a)>e,d||(c=Math.abs(l-h)<=p,!c));++t)u&&(m=h==l||h>l==f,m&&(a=-a*r,h=l)),a+=(1e-6*-i.tension*(h-l)+.001*-i.friction*a)/i.mass*g,h+=a*g}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,s.durationProgress>0&&(s.elapsedTime=i.duration*s.durationProgress,e=s.elapsedTime+=t)),r=(i.progress||0)+e/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),h=n+i.easing(r)*(l-n),a=(h-s.lastPosition)/t,c=1==r}s.lastVelocity=a,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),c=!0)}a&&!a[u].done&&(c=!1),c?s.done=!0:e=!1,s.setValue(h,i.round)&&(n=!0)}));const s=ty(this),u=s.getValue();if(e){const t=Eg(r.to);u===t&&!n||i.decay?n&&i.decay&&this._onChange(u):(s.setValue(t),this._onChange(t)),this._stop()}else n&&this._onChange(u)}set(t){return sm.batchedUpdates((()=>{this._stop(),this._focus(t),this._set(t)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(qy(this)){const{to:t,config:e}=this.animation;sm.batchedUpdates((()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()}))}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return Mm.und(t)?(n=this.queue||[],this.queue=[]):n=[Mm.obj(t)?t:gy({},e,{to:t})],Promise.all(n.map((t=>this._update(t)))).then((t=>Ry(this,t)))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),By(this._state,t&&this._lastCallId),sm.batchedUpdates((()=>this._stop(e,t))),this}reset(){this._update({reset:!0})}eventObserved(t){"change"==t.type?this._start():"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:r}=t;n=Mm.obj(n)?n[e]:n,(null==n||Ay(n))&&(n=void 0),r=Mm.obj(r)?r[e]:r,null==r&&(r=void 0);const i={to:n,from:r};return Wy(this)||(t.reverse&&([n,r]=[r,n]),r=Eg(r),Mm.und(r)?ty(this)||this._set(n):this._set(r)),i}_update(t,e){let n=gy({},t);const{key:r,defaultProps:i}=this;n.default&&Object.assign(i,wy(n,((t,e)=>/^on/.test(e)?_y(t,r):t))),iv(this,n,"onProps"),ov(this,"onProps",n,this);const o=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const a=this._state;return Iy(++this._lastCallId,{key:r,props:n,defaultProps:i,state:a,actions:{pause:()=>{Yy(this)||($y(this,!0),km(a.pauseQueue),ov(this,"onPause",Ny(this,Jy(this,this.animation.to)),this))},resume:()=>{Yy(this)&&($y(this,!1),qy(this)&&this._resume(),km(a.resumeQueue),ov(this,"onResume",Ny(this,Jy(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then((t=>{if(n.loop&&t.finished&&(!e||!t.noop)){const t=Qy(n);if(t)return this._update(t,!0)}return t}))}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(Fy(this));const r=!Mm.und(t.to),i=!Mm.und(t.from);if(r||i){if(!(e.callId>this._lastToId))return n(Fy(this));this._lastToId=e.callId}const{key:o,defaultProps:a,animation:s}=this,{to:u,from:l}=s;let{to:c=u,from:h=l}=t;!i||r||e.default&&!Mm.und(c)||(c=h),e.reverse&&([c,h]=[h,c]);const p=!Tm(h,l);p&&(s.from=h),h=Eg(h);const f=!Tm(c,u);f&&this._focus(c);const d=Ay(e.to),{config:m}=s,{decay:g,velocity:y}=m;(r||i)&&(m.velocity=0),e.config&&!d&&function(t,e,n){n&&(Py(n=gy({},n),e),e=gy({},n,e)),Py(t,e),Object.assign(t,e);for(const e in Cy)null==t[e]&&(t[e]=Cy[e]);let{mass:r,frequency:i,damping:o}=t;Mm.und(i)||(i<.01&&(i=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/i,2)*r,t.friction=4*Math.PI*o*r/i)}(m,yy(e.config,o),e.config!==a.config?yy(a.config,o):void 0);let v=ty(this);if(!v||Mm.und(c))return n(Ny(this,!0));const _=Mm.und(e.reset)?i&&!e.default:!Mm.und(h)&&vy(e.reset,o),b=_?h:this.get(),x=Ty(c),w=Mm.num(x)||Mm.arr(x)||Wg(x),S=!d&&(!w||vy(a.immediate||e.immediate,o));if(f){const t=cy(c);if(t!==v.constructor){if(!S)throw Error(`Cannot animate between ${v.constructor.name} and ${t.name}, as the "to" prop suggests`);v=this._set(x)}}const E=v.constructor;let M=Sg(c),T=!1;if(!M){const t=_||!Wy(this)&&p;(f||t)&&(T=Tm(Ty(b),x),M=!T),(Tm(s.immediate,S)||S)&&Tm(m.decay,g)&&Tm(m.velocity,y)||(M=!0)}if(T&&qy(this)&&(s.changed&&!_?M=!0:M||this._stop(u)),!d&&((M||Sg(u))&&(s.values=v.getPayload(),s.toValues=Sg(c)?null:E==oy?[1]:Om(x)),s.immediate!=S&&(s.immediate=S,S||_||this._set(u)),M)){const{onRest:t}=s;Am(rv,(t=>iv(this,e,t)));const r=Ny(this,Jy(this,u));km(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&sm.batchedUpdates((()=>{s.changed=!_,null==t||t(r,this),_?yy(a.onRest,r):null==s.onStart||s.onStart(r,this)}))}_&&this._set(b),d?n(zy(e.to,e,this._state,this)):M?this._start():qy(this)&&!f?this._pendingCalls.add(n):n(Dy(b))}_focus(t){const e=this.animation;t!==e.to&&(Mg(this)&&this._detach(),e.to=t,Mg(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Sg(e)&&(Og(e,this),Zy(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Sg(t)&&Pg(t,this)}_set(t,e=!0){const n=Eg(t);if(!Mm.und(n)){const t=ty(this);if(!t||!Tm(n,t.getValue())){const r=cy(n);t&&t.constructor==r?t.setValue(n):ey(this,r.create(n)),t&&sm.batchedUpdates((()=>{this._onChange(n,e)}))}}return ty(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,ov(this,"onStart",Ny(this,Jy(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),yy(this.animation.onChange,t,this)),yy(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;ty(this).reset(Eg(t.to)),t.immediate||(t.fromValues=t.values.map((t=>t.lastPosition))),qy(this)||(Xy(this,!0),Yy(this)||this._resume())}_resume(){zm.skipAnimation?this.finish():Vm.start(this)}_stop(t,e){if(qy(this)){Xy(this,!1);const n=this.animation;Am(n.values,(t=>{t.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Tg(this,{type:"idle",parent:this});const r=e?Fy(this.get()):Ny(this.get(),Jy(this,null!=t?t:n.to));km(this._pendingCalls,r),n.changed&&(n.changed=!1,ov(this,"onRest",r,this))}}}function Jy(t,e){const n=Ty(e);return Tm(Ty(t.get()),n)}function Qy(t,e=t.loop,n=t.to){let r=yy(e);if(r){const i=!0!==r&&My(r),o=(i||t).reverse,a=!i||i.reset;return tv(gy({},t,{loop:e,default:!1,pause:void 0,to:!o||Ay(n)?n:void 0,from:a?t.from:void 0,reset:a},i))}}function tv(t){const{to:e,from:n}=t=My(t),r=new Set;return Mm.obj(e)&&nv(e,r),Mm.obj(n)&&nv(n,r),t.keys=r.size?Array.from(r):null,t}function ev(t){const e=tv(t);return Mm.und(e.default)&&(e.default=wy(e)),e}function nv(t,e){Cm(t,((t,n)=>null!=t&&e.add(n)))}const rv=["onStart","onRest","onChange","onPause","onResume"];function iv(t,e,n){t.animation[n]=e[n]!==by(e,n)?_y(e[n],t.key):void 0}function ov(t,e,...n){var r,i,o,a;null==(r=(i=t.animation)[e])||r.call(i,...n),null==(o=(a=t.defaultProps)[e])||o.call(a,...n)}const av=["onStart","onChange","onRest"];let sv=1;class uv{constructor(t,e){this.id=sv++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(gy({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((t=>t.idle&&!t.isDelayed&&!t.isPaused))}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each(((e,n)=>t[n]=e.get())),t}set(t){for(const e in t){const n=t[e];Mm.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(tv(t)),this}start(t){let{queue:e}=this;return t?e=Om(t).map(tv):this.queue=[],this._flush?this._flush(this,e):(mv(this,e),lv(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;Am(Om(e),(e=>n[e].stop(!!t)))}else By(this._state,this._lastAsyncId),this.each((e=>e.stop(!!t)));return this}pause(t){if(Mm.und(t))this.start({pause:!0});else{const e=this.springs;Am(Om(t),(t=>e[t].pause()))}return this}resume(t){if(Mm.und(t))this.start({pause:!1});else{const e=this.springs;Am(Om(t),(t=>e[t].resume()))}return this}each(t){Cm(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,Pm(t,(([t,e])=>{e.value=this.get(),t(e,this,this._item)})));const o=!r&&this._started,a=i||o&&n.size?this.get():null;i&&e.size&&Pm(e,(([t,e])=>{e.value=a,t(e,this,this._item)})),o&&(this._started=!1,Pm(n,(([t,e])=>{e.value=a,t(e,this,this._item)})))}eventObserved(t){if("change"==t.type)this._changed.add(t.parent),t.idle||this._active.add(t.parent);else{if("idle"!=t.type)return;this._active.delete(t.parent)}sm.onFrame(this._onFrame)}}function lv(t,e){return Promise.all(e.map((e=>cv(t,e)))).then((e=>Ry(t,e)))}async function cv(t,e,n){const{keys:r,to:i,from:o,loop:a,onRest:s,onResolve:u}=e,l=Mm.obj(e.default)&&e.default;a&&(e.loop=!1),!1===i&&(e.to=null),!1===o&&(e.from=null);const c=Mm.arr(i)||Mm.fun(i)?i:void 0;c?(e.to=void 0,e.onRest=void 0,l&&(l.onRest=void 0)):Am(av,(n=>{const r=e[n];if(Mm.fun(r)){const i=t._events[n];e[n]=({finished:t,cancelled:e})=>{const n=i.get(r);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):i.set(r,{value:null,finished:t||!1,cancelled:e||!1})},l&&(l[n]=e[n])}}));const h=t._state;e.pause===!h.paused?(h.paused=e.pause,km(e.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(e.pause=!0);const p=(r||Object.keys(t.springs)).map((n=>t.springs[n].start(e))),f=!0===e.cancel||!0===by(e,"cancel");(c||f&&h.asyncId)&&p.push(Iy(++t._lastAsyncId,{props:e,state:h,actions:{pause:Em,resume:Em,start(e,n){f?(By(h,t._lastAsyncId),n(Fy(t))):(e.onRest=s,n(zy(c,e,h,t)))}}})),h.paused&&await new Promise((t=>{h.resumeQueue.add(t)}));const d=Ry(t,await Promise.all(p));if(a&&d.finished&&(!n||!d.noop)){const n=Qy(e,a,i);if(n)return mv(t,[n]),cv(t,n,!0)}return u&&sm.batchedUpdates((()=>u(d,t,t.item))),d}function hv(t,e){const n=gy({},t.springs);return e&&Am(Om(e),(t=>{Mm.und(t.keys)&&(t=tv(t)),Mm.obj(t.to)||(t=gy({},t,{to:void 0})),dv(n,t,(t=>fv(t)))})),pv(t,n),n}function pv(t,e){Cm(e,((e,n)=>{t.springs[n]||(t.springs[n]=e,Og(e,t))}))}function fv(t,e){const n=new Ky;return n.key=t,e&&Og(n,e),n}function dv(t,e,n){e.keys&&Am(e.keys,(r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)}))}function mv(t,e){Am(e,(e=>{dv(t.springs,e,(e=>fv(e,t)))}))}const gv=["children"],yv=t=>{let{children:e}=t,n=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,gv);const r=(0,o.useContext)(vv),i=n.pause||!!r.pause,a=n.immediate||!!r.immediate;n=function(t,e){const[n]=(0,o.useState)((()=>({inputs:e,result:t()}))),r=(0,o.useRef)(),i=r.current;let a=i;return a?Boolean(e&&a.inputs&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(e,a.inputs))||(a={inputs:e,result:t()}):a=n,(0,o.useEffect)((()=>{r.current=a,i==n&&(n.inputs=n.result=void 0)}),[a]),a.result}((()=>({pause:i,immediate:a})),[i,a]);const{Provider:s}=vv;return o.createElement(s,{value:n},e)},vv=(_v=yv,bv={},Object.assign(_v,o.createContext(bv)),_v.Provider._context=_v,_v.Consumer._context=_v,_v);var _v,bv;yv.Provider=vv.Provider,yv.Consumer=vv.Consumer;const xv=()=>{const t=[],e=function(e){Hg(`${Zg}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const r=[];return Am(t,((t,i)=>{if(Mm.und(e))r.push(t.start());else{const o=n(e,t,i);o&&r.push(t.start(o))}})),r};e.current=t,e.add=function(e){t.includes(e)||t.push(e)},e.delete=function(e){const n=t.indexOf(e);~n&&t.splice(n,1)},e.pause=function(){return Am(t,(t=>t.pause(...arguments))),this},e.resume=function(){return Am(t,(t=>t.resume(...arguments))),this},e.set=function(e){Am(t,(t=>t.set(e)))},e.start=function(e){const n=[];return Am(t,((t,r)=>{if(Mm.und(e))n.push(t.start());else{const i=this._getProps(e,t,r);i&&n.push(t.start(i))}})),n},e.stop=function(){return Am(t,(t=>t.stop(...arguments))),this},e.update=function(e){return Am(t,((t,n)=>t.update(this._getProps(e,t,n)))),this};const n=function(t,e,n){return Mm.fun(t)?t(n,e):t};return e._getProps=n,e};function wv(t,e){const n=Mm.fun(t),[[r],i]=function(t,e,n){const r=Mm.fun(e)&&e;r&&!n&&(n=[]);const i=(0,o.useMemo)((()=>r||3==arguments.length?xv():void 0),[]),a=(0,o.useRef)(0),s=Xg(),u=(0,o.useMemo)((()=>({ctrls:[],queue:[],flush(t,e){const n=hv(t,e);return a.current>0&&!u.queue.length&&!Object.keys(n).some((e=>!t.springs[e]))?lv(t,e):new Promise((r=>{pv(t,n),u.queue.push((()=>{r(lv(t,e))})),s()}))}})),[]),l=(0,o.useRef)([...u.ctrls]),c=[],h=Jg(t)||0;function p(t,n){for(let i=t;i<n;i++){const t=l.current[i]||(l.current[i]=new uv(null,u.flush)),n=r?r(i,t):e[i];n&&(c[i]=ev(n))}}(0,o.useMemo)((()=>{Am(l.current.slice(t,h),(t=>{(function(t,e){var n;null==(n=t.ref)||n.delete(t),null==e||e.delete(t)})(t,i),t.stop(!0)})),l.current.length=t,p(h,t)}),[t]),(0,o.useMemo)((()=>{p(0,Math.min(h,t))}),n);const f=l.current.map(((t,e)=>hv(t,c[e]))),d=(0,o.useContext)(yv),m=Jg(d),g=d!==m&&function(t){for(const e in t)return!0;return!1}(d);qg((()=>{a.current++,u.ctrls=l.current;const{queue:t}=u;t.length&&(u.queue=[],Am(t,(t=>t()))),Am(l.current,((t,e)=>{null==i||i.add(t),g&&t.start({default:d});const n=c[e];n&&(function(t,e){var n;e&&t.ref!==e&&(null==(n=t.ref)||n.delete(t),e.add(t),t.ref=e)}(t,n.ref),t.ref?t.queue.push(n):t.start(n))}))})),$g((()=>()=>{Am(u.ctrls,(t=>t.stop(!0)))}));const y=f.map((t=>gy({},t)));return i?[y,i]:y}(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[r,i]:r}let Sv;!function(t){t.MOUNT="mount",t.ENTER="enter",t.UPDATE="update",t.LEAVE="leave"}(Sv||(Sv={}));class Ev extends Gy{constructor(t,e){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=pg(...e);const n=this._get(),r=cy(n);ey(this,r.create(n))}advance(t){const e=this._get();Tm(e,this.get())||(ty(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&Tv(this._active)&&Av(this)}_get(){const t=Mm.arr(this.source)?this.source.map(Eg):Om(Eg(this.source));return this.calc(...t)}_start(){this.idle&&!Tv(this._active)&&(this.idle=!1,Am(ny(this),(t=>{t.done=!1})),zm.skipAnimation?(sm.batchedUpdates((()=>this.advance())),Av(this)):Vm.start(this))}_attach(){let t=1;Am(Om(this.source),(e=>{Sg(e)&&Og(e,this),Zy(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))})),this.priority=t,this._start()}_detach(){Am(Om(this.source),(t=>{Sg(t)&&Pg(t,this)})),this._active.clear(),Av(this)}eventObserved(t){"change"==t.type?t.idle?this.advance():(this._active.add(t.parent),this._start()):"idle"==t.type?this._active.delete(t.parent):"priority"==t.type&&(this.priority=Om(this.source).reduce(((t,e)=>Math.max(t,(Zy(e)?e.priority:0)+1)),0))}}function Mv(t){return!1!==t.idle}function Tv(t){return!t.size||Array.from(t).every(Mv)}function Av(t){t.idle||(t.idle=!0,Am(ny(t),(t=>{t.done=!0})),Tg(t,{type:"idle",parent:t}))}function Cv(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}zm.assign({createStringInterpolator:Ug,to:(t,e)=>new Ev(t,e)}),Vm.advance;const Ov=["style","children","scrollTop","scrollLeft","viewBox"],Pv=/^--/;function kv(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||Pv.test(t)||Iv.hasOwnProperty(t)&&Iv[t]?(""+e).trim():e+"px"}const Lv={};let Iv={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Rv=["Webkit","Ms","Moz","O"];Iv=Object.keys(Iv).reduce(((t,e)=>(Rv.forEach((n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e])),t)),Iv);const Dv=["x","y","z"],Nv=/^(matrix|translate|scale|rotate|skew)/,Fv=/^(translate)/,zv=/^(rotate|skew)/,Bv=(t,e)=>Mm.num(t)&&0!==t?t+e:t,jv=(t,e)=>Mm.arr(t)?t.every((t=>jv(t,e))):Mm.num(t)?t===e:parseFloat(t)===e;class Uv extends sy{constructor(t){let{x:e,y:n,z:r}=t,i=Cv(t,Dv);const o=[],a=[];(e||n||r)&&(o.push([e||0,n||0,r||0]),a.push((t=>[`translate3d(${t.map((t=>Bv(t,"px"))).join(",")})`,jv(t,0)]))),Cm(i,((t,e)=>{if("transform"===e)o.push([t||""]),a.push((t=>[t,""===t]));else if(Nv.test(e)){if(delete i[e],Mm.und(t))return;const n=Fv.test(e)?"px":zv.test(e)?"deg":"";o.push(Om(t)),a.push("rotate3d"===e?([t,e,r,i])=>[`rotate3d(${t},${e},${r},${Bv(i,n)})`,jv(i,0)]:t=>[`${e}(${t.map((t=>Bv(t,n))).join(",")})`,jv(t,e.startsWith("scale")?1:0)])}})),o.length&&(i.transform=new Zv(o,a)),super(i)}}class Zv extends Ag{constructor(t,e){super(),this._value=null,this.inputs=t,this.transforms=e}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return Am(this.inputs,((n,r)=>{const i=Eg(n[0]),[o,a]=this.transforms[r](Mm.arr(i)?i:n.map(Eg));t+=" "+o,e=e&&a})),e?"none":t}observerAdded(t){1==t&&Am(this.inputs,(t=>Am(t,(t=>Sg(t)&&Og(t,this)))))}observerRemoved(t){0==t&&Am(this.inputs,(t=>Am(t,(t=>Sg(t)&&Pg(t,this)))))}eventObserved(t){"change"==t.type&&(this._value=null),Tg(this,t)}}const Vv=["scrollTop","scrollLeft"];zm.assign({batchedUpdates:im.unstable_batchedUpdates,createStringInterpolator:Ug,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const Gv=((t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new sy(t)),getComponentProps:r=(t=>t)}={})=>{const i={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},o=t=>{const e=my(t)||"Anonymous";return(t=Mm.str(t)?o[t]||(o[t]=py(t,i)):t[dy]||(t[dy]=py(t,i))).displayName=`Animated(${e})`,t};return Cm(t,((e,n)=>{Mm.arr(t)&&(n=my(e)),o[n]=o(e)})),{animated:o}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:i,children:o,scrollTop:a,scrollLeft:s,viewBox:u}=r,l=Cv(r,Ov),c=Object.values(l),h=Object.keys(l).map((e=>n||t.hasAttribute(e)?e:Lv[e]||(Lv[e]=e.replace(/([A-Z])/g,(t=>"-"+t.toLowerCase())))));void 0!==o&&(t.textContent=o);for(let e in i)if(i.hasOwnProperty(e)){const n=kv(e,i[e]);Pv.test(e)?t.style.setProperty(e,n):t.style[e]=n}h.forEach(((e,n)=>{t.setAttribute(e,c[n])})),void 0!==a&&(t.scrollTop=a),void 0!==s&&(t.scrollLeft=s),void 0!==u&&t.setAttribute("viewBox",u)},createAnimatedStyle:t=>new Uv(t),getComponentProps:t=>Cv(t,Vv)}),Hv=Gv.animated;const Wv=t=>{const{toggle:e,maxSize:n="100%",minSize:r="20%",placement:a="RB",offset:s=[8,8]}=t,u=wv({from:{size:n,background:"hotpink"},to:{size:e?r:n,background:e?"#ddd":"hotpink"}}),{size:l,background:c}=u,h=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(u,["size","background"]),p=i.utils.getPositionStyles(a,s);return o.createElement(Hv.div,{style:Object.assign(Object.assign(Object.assign({},p),{width:l,height:l,position:"absolute",zIndex:9,boxShadow:e?"0 0 10px rgba(0,0,0,0.5)":"none"}),h)},t.children)},qv={zIndex:999,background:"#fff",marginBlockEnd:"0px"},Yv=t=>{const{children:e,style:n={},direction:r="horizontal"}=t,i="horizontal"===r,o={position:"absolute"};return i?(o.right=0,o.top=0):(o.left=0,o.bottom=0),a().createElement("div",{style:Object.assign(Object.assign(Object.assign({},qv),o),n),className:"graphin-components-toolbar"},a().createElement("ul",{className:"graphin-components-toolbar-content",style:{display:i?"flex":"",marginBlockEnd:"0px"}},e))},Xv=t=>{const e=t.components.find((t=>"Toolbar"===t.id))||{id:"Toolbar",props:{direction:"horizontal",placement:"LT",offset:[10,10]}},{direction:n,placement:r,offset:o}=e.props;return{direction:n,positionStyles:i.utils.getPositionStyles(r,o)}};var $v=s(5558),Kv=s.n($v),Jv=s(4959),Qv=s(5802),t_=s.n(Qv);let e_,n_;function r_(){const{lang:t}=Kv().getLocale();e_=t,n_=Jv.ZP.init(t,t_(),{name:"scene"})}const i_=function(t,e={}){return n_||r_(),"string"==typeof t?Jv.ZP.format({id:t},e,{name:"scene"}):("object"==typeof t&&t.dm&&(t.defaultMessage=t.dm),Jv.ZP.format({id:t.id,defaultString:t.dm},e,{name:"scene"}))},{GIAComponent:o_,deepClone:a_}=i.extra,s_=t=>{const{GIAC:e,config:n,handleSwitchMap:r,handleToggleMap:i}=t,a=o.useMemo((()=>{const t=a_(e);return t.icon="icon-fullscreen",t.title=i_({id:"scene.LargeGraph.Toolbar.SmallWindow",dm:"小窗"}),t.tooltipPlacement="right",t}),[e]),{direction:s,positionStyles:u}=Xv(n);return o.createElement("div",null,o.createElement(Yv,{direction:s,style:u},o.createElement(o_,{GIAC:e,onClick:r}),o.createElement(o_,{GIAC:a,onClick:i})))},{deepClone:u_}=i.extra,l_=t=>{const{updateContext:e,source:n,largeGraphData:r,largeGraphLimit:a,data:s,GISDK_ID:u,apis:l,config:c,transform:h}=(0,i.useContext)(),{GIAC:p,handleClick:f,maxSize:d,minSize:m,placement:g,offset:y,highlightColor:v,backgroundColor:_}=t,b=o.useRef();let x=n,w=[],S=[];r&&(x=r,s.nodes.length>0&&(w=s.nodes.map((t=>t.id)),S=s.edges.map((t=>`${t.source}_${t.target}`))));const[E,M]=o.useState({toggle:!1}),{toggle:T}=E;return o.useLayoutEffect((()=>{const t=document.getElementById("gi-3d-graph"),e=t.offsetWidth,n=t.offsetHeight;console.time("cost deepclone");let r=u_(x.nodes),o=u_(x.edges);if(console.timeEnd("cost deepclone"),!i.utils.isStyles(x.nodes)){const t=h(x);r=t.nodes,o=t.edges}const a={nodes:r,links:o};try{b.current=nm()(t).width(e).height(n).graphData(a).enableNodeDrag(!1).nodeAutoColorBy("nodeType").nodeLabel((t=>(null==t?void 0:t.style.label.value)?t.style.label.value:t.id)).linkCurvature((t=>t.style&&t.style.keyshape&&t.style.keyshape.poly?.5:.1)).onNodeClick((t=>{const e=1+40/Math.hypot(t.x,t.y,t.z);b.current&&b.current.cameraPosition({x:t.x*e,y:t.y*e,z:t.z*e},t,3e3)}))}catch(t){console.log("error",t)}return()=>{b.current&&b.current._destructor()}}),[]),o.useEffect((()=>{const t=b.current;if(!t)return;const e=t=>{const e=`${t.source.id}_${t.target.id}`;return-1!==S.indexOf(e)?2:0},n=new Map;t.backgroundColor(_).linkWidth((t=>e(t))).linkDirectionalParticles((t=>e(t))).linkDirectionalParticleWidth(2).linkColor((t=>{const e=`${t.source.id}_${t.target.id}`;if(-1!==S.indexOf(e))return v;if(t.style&&t.style.keyshape){const{stroke:e}=t.style.keyshape;return e}})).nodeThreeObject((t=>{if(t.style.icon&&"image"===t.style.icon.type){const e=t.style.icon.value,n=(new Bl).load(e),r=new ms({map:n}),i=new Os(r);return i.scale.set(24,24),i}let{size:e,fill:r}=t.style.keyshape||{size:40,fill:"#ddd"};-1!==w.indexOf(t.id)&&(r=v,e*=1.5);const i=new il(3,e);let o=n.get(r);return o||(o=new fl({color:r,transparent:!0,opacity:.75}),n.set(r,o)),new ui(i,o)})),t.linkDirectionalArrowLength(1.5).linkDirectionalArrowRelPos(1),(S.length>0||S.length>0)&&(t=>{t.nodeColor(t.nodeColor()).linkWidth(t.linkWidth()).linkDirectionalParticles(t.linkDirectionalParticles())})(t)}),[S,w,b,!0,v,_]),om().createPortal(o.createElement(Wv,{toggle:T,maxSize:d,minSize:m,placement:g,offset:y},o.createElement(s_,{GIAC:p,config:c,handleSwitchMap:f,handleToggleMap:()=>{var t;t=!T,M((e=>Object.assign(Object.assign({},e),{toggle:t})))}}),o.createElement("div",{id:"gi-3d-graph",style:{position:"relative",width:"100%",height:"100%"}})),document.getElementById(`${u}-graphin-container`))},{GIAComponent:c_}=i.extra,h_={id:"LargeGraph",name:i_({id:"scene.src.LargeGraph.info.DBigPicture",dm:"3D大图"}),category:"scene-analysis",desc:i_({id:"scene.src.LargeGraph.info.EnableDViewAndRight",dm:"启用3D视图,可右键节点交互"}),icon:"icon-3d",cover:"http://xxxx.jpg",type:"GIAC",docs:"https://www.yuque.com/antv/gi/bhyhin"},{GIAC_METAS:p_,deepClone:f_}=i.extra,d_=f_(p_);d_.GIAC.properties.GIAC.properties.title.default=h_.name,d_.GIAC.properties.GIAC.properties.isShowTitle.default=!1,d_.GIAC.properties.GIAC.properties.icon.default=h_.icon,d_.GIAC.properties.GIAC.properties.isVertical.default=!0,d_.GIAC.properties.GIAC.properties.tooltipPlacement.default="right";const m_={info:h_,component:t=>{const e=Object.assign({},t.GIAC),{visible:n,maxSize:r,minSize:i,placement:a,offset:s,highlightColor:u,backgroundColor:l}=t,[c,h]=o.useState(n);return e.title=i_(c?{id:"scene.src.LargeGraph.Component.SwitchToD",dm:"切换至2D"}:{id:"scene.src.LargeGraph.Component.SwitchToD.1",dm:"切换至3D"}),o.createElement(o.Fragment,null,o.createElement(c_,{GIAC:e,onClick:()=>{h(!0)}}),c&&o.createElement(l_,{backgroundColor:l,highlightColor:u,minSize:i,maxSize:r,placement:a,offset:s,GIAC:e,handleClick:()=>{h(!1)}}))},registerMeta:()=>Object.assign({visible:{title:i_({id:"scene.src.LargeGraph.registerMeta.DefaultDisplay",dm:"默认显示"}),type:"string","x-decorator":"FormItem","x-component":"Switch",default:!1},backgroundColor:{title:i_({id:"scene.src.LargeGraph.registerMeta.BackgroundColor",dm:"背景颜色"}),type:"string","x-decorator":"FormItem","x-component":"ColorInput",default:"#fff"},highlightColor:{title:i_({id:"scene.src.LargeGraph.registerMeta.HighlightColor",dm:"高亮颜色"}),type:"string","x-decorator":"FormItem","x-component":"ColorInput",default:"red"},minSize:{type:"string",title:i_({id:"scene.src.LargeGraph.registerMeta.MinimumSize",dm:"最小尺寸"}),"x-decorator":"FormItem","x-component":"Input",default:"20%"},maxSize:{type:"string",title:i_({id:"scene.src.LargeGraph.registerMeta.MaximumSize",dm:"最大尺寸"}),"x-decorator":"FormItem","x-component":"Input",default:"100%"},placement:{title:i_({id:"scene.src.LargeGraph.registerMeta.PlacementOrientation",dm:"放置方位"}),type:"string",default:"RB","x-decorator":"FormItem","x-component":"Select","x-component-props":{options:[{value:"LT",label:i_({id:"scene.src.LargeGraph.registerMeta.TopLeftTop",dm:"左上 / top"})},{value:"RT",label:i_({id:"scene.src.LargeGraph.registerMeta.TopRightRight",dm:"右上 / right"})},{value:"LB",label:i_({id:"scene.src.LargeGraph.registerMeta.LowerLeftLeft",dm:"左下 / left"})},{value:"RB",label:i_({id:"scene.src.LargeGraph.registerMeta.BottomRightBottom",dm:"右下 / bottom"})}]}},offset:{title:i_({id:"scene.src.LargeGraph.registerMeta.OffsetDistance",dm:"偏移距离"}),type:"string","x-decorator":"FormItem","x-component":"Offset","x-component-props":{min:0,max:400},default:[0,0]}},d_)};s(8134);var g_=s(1522),y_=(s(108),s(1301)),v_=s(5619),__=s(3959),b_=s(2923),x_=s.n(b_);function w_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var S_=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"getInstance",value:function(){return this.instance||(this.instance=new this),this.instance}}],null&&w_(e.prototype,null),n&&w_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function E_(t){return E_="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},E_(t)}function M_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function T_(t,e){return T_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},T_(t,e)}function A_(t){return A_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},A_(t)}S_.instance=void 0;var C_=function(t){!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&&T_(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=A_(r);if(i){var n=A_(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===E_(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,t)});function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))).styleVariant="line",t}return e=a,(n=[{key:"execute",value:function(t,e){var n=e[this.styleVariant],r=new y_.LineLayer({pickingBuffer:3}).source(t).shape("line").color(n.color).size(n.size).style(n.style);return r.zIndex=n.zIndex,[r]}}])&&M_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(S_);function O_(t){return O_="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},O_(t)}function P_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function k_(t,e){return k_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},k_(t,e)}function L_(t){return L_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},L_(t)}var I_=function(t){!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&&k_(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=L_(r);if(i){var n=L_(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===O_(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,t)});function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))).styleVariant="point",t}return e=a,(n=[{key:"execute",value:function(t,e){var n,r,i=e[this.styleVariant];if(null===(n=t.features[0])||void 0===n||null===(r=n.properties)||void 0===r?void 0:r.value)return[];var o=new y_.PointLayer({zIndex:2,pickingBuffer:3}).source(t).shape("circle").color(i.color).size(i.size).style(i.style);return o.zIndex=i.zIndex,[o]}}])&&P_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(S_);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},R_(t)}function D_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N_(t,e){return N_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},N_(t,e)}function F_(t){return F_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},F_(t)}var z_=function(t){!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)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=F_(r);if(i){var n=F_(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.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,t)});function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))).styleVariant="polygon",t}return e=a,n=[{key:"execute",value:function(t,e){var n=e[this.styleVariant],r=(new y_.PolygonLayer).source(t).shape("fill").color(n.color).size(n.size).style({opacity:n.style.opacity});n.active&&r.active(n.active);var i=(new y_.PolygonLayer).source(t).shape("line").color(n.style.stroke).size(n.style.strokeWidth).style({opacity:n.style.strokeOpacity,lineType:n.style.lineType,dashArray:n.style.dashArray});return n.active&&i.active(n.active),r.zIndex=i.zIndex=n.zIndex,[r,i]}}],n&&D_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(S_);function B_(t){return B_="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},B_(t)}function j_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function U_(t,e){return U_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},U_(t,e)}function Z_(t){return Z_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Z_(t)}var V_=function(t){!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&&U_(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Z_(r);if(i){var n=Z_(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===B_(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,t)});function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))).styleVariant="point",t}return e=a,(n=[{key:"execute",value:function(t,e){var n,r,i=e[this.styleVariant];if(!(null===(n=t.features[0])||void 0===n||null===(r=n.properties)||void 0===r?void 0:r.value))return[];var o=new y_.PointLayer({zIndex:2,pickingBuffer:3}).source(t).style(i.style).shape("value","text").size(14).color(i.color);return o.zIndex=i.zIndex,[o]}}])&&j_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(S_);function G_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var H_=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.strategyMap=void 0,this.strategyMap={}}var e,n,r;return e=t,r=[{key:"defaultRenderer",value:function(){var e=new t;return e.setStrategy(I_.getInstance(),"Point"),e.setStrategy(V_.getInstance(),"Point"),e.setStrategy(z_.getInstance(),"Polygon"),e.setStrategy(C_.getInstance(),"LineString"),e}}],(n=[{key:"setStrategy",value:function(t,e){var n=this.strategyMap[e];this.strategyMap[e]=(n||[]).concat(t)}},{key:"renderFeature",value:function(t,e){var n,r,i=null===(n=t.features[0])||void 0===n||null===(r=n.geometry)||void 0===r?void 0:r.type,o=(this.strategyMap[i]||[]).map((function(n){return n.execute(t,e)}));return x_()(o)}}])&&G_(e.prototype,n),r&&G_(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function W_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var q_=H_.defaultRenderer(),Y_=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.drawLayers=[],this.draw=void 0,this.isEnableDrag=void 0,this.isEnableEdit=void 0,this.styleVariant="normal",this.draw=e}var e,n;return e=t,(n=[{key:"update",value:function(t){this.removeLayers(),this.drawLayers=q_.renderFeature(t,this.draw.getStyle(this.styleVariant)),this.addLayers()}},{key:"on",value:function(t,e){this.drawLayers[0].on(t,e)}},{key:"off",value:function(t,e){this.drawLayers[0].off(t,e)}},{key:"emit",value:function(t,e){this.drawLayers[0].emit(t,e)}},{key:"updateData",value:function(t){0===this.drawLayers.length&&this.update(t),this.drawLayers.forEach((function(e){return e.setData(t)}))}},{key:"destroy",value:function(){this.removeLayers()}},{key:"removeLayers",value:function(){var t=this;0!==this.drawLayers.length&&this.drawLayers.forEach((function(e){return t.draw.scene.removeLayer(e)}))}},{key:"addLayers",value:function(){var t=this;this.drawLayers.forEach((function(e){return t.draw.scene.addLayer(e)}))}},{key:"show",value:function(){this.drawLayers.forEach((function(t){return t.show()}))}},{key:"hide",value:function(){this.drawLayers.forEach((function(t){return t.hide()}))}}])&&W_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),X_=function(t){return"LineString"===t.geometry.type},$_=function(t){return"Polygon"===t.geometry.type},K_=s(601);var J_=s(8912),Q_=6378137;function tb(t){var e=0;if(t&&t.length>0){e+=Math.abs(eb(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(eb(t[n]))}return e}function eb(t){var e,n,r,i,o,a,s=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(r=u-2,i=u-1,o=0):a===u-1?(r=u-1,i=0,o=1):(r=a,i=a+1,o=a+2),e=t[r],n=t[i],s+=(nb(t[o][0])-nb(e[0]))*Math.sin(nb(n[1]));s=s*Q_*Q_/2}return s}function nb(t){return t*Math.PI/180}var rb=function(t,e){return function(t,e,n){void 0===n&&(n={});var r=(0,K_.c9)(t),i=(0,K_.c9)(e),o=(0,__.Ht)(i[1]-r[1]),a=(0,__.Ht)(i[0]-r[0]),s=(0,__.Ht)(r[1]),u=(0,__.Ht)(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(u);return(0,__.DL)(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)}(t,e,{units:"kilometers"}).toFixed(2)+"km"},ib=function(t){return(e=t,(0,J_.mm)(e,(function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return tb(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=tb(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)/1e6).toFixed(2)+"km²";var e};function ob(t){return ob="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},ob(t)}function ab(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ub(t,e,n){return e&&sb(t.prototype,e),n&&sb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function lb(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&&cb(t,e)}function cb(t,e){return cb=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},cb(t,e)}function hb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=pb(t);if(e){var i=pb(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===ob(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function pb(t){return pb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},pb(t)}var fb,db,mb,gb,yb,vb=new H_,_b=function(t){lb(n,t);var e=hb(n);function n(){var t;ab(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))).styleVariant="polygon",t}return ub(n,[{key:"execute",value:function(t,e){var n=e[this.styleVariant],r=(new y_.PolygonLayer).source(t).shape("fill").color(n.color).style({opacity:n.style.opacity}).active(n.active);r.zIndex=n.zIndex;var i=t.features[0],o=[];if($_(i)){var a=i.geometry.coordinates[0];o=(0,__.uf)(a.map((function(t,e){if(a[e+1])return(0,__.Tu)([t,a[e+1]])})).filter(Boolean))}var s=e.line,u=new y_.LineLayer({pickingBuffer:3}).source(o).color(s.style.stroke).size(s.style.strokeWidth).style({opacity:s.style.strokeOpacity,lineType:s.style.lineType,dashArray:s.style.dashArray}).active(s.active);return u.zIndex=s.zIndex,u.setBlend("max"),[r,u]}}]),n}(S_),bb=function(t){lb(n,t);var e=hb(n);function n(){var t;ab(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))).styleVariant="line",t}return ub(n,[{key:"execute",value:function(t,e){var n=e[this.styleVariant],r=t.features[0],i=[];if(X_(r)){var o=r.geometry.coordinates;i=(0,__.uf)(o.map((function(t,e){if(o[e+1])return(0,__.Tu)([t,o[e+1]])})).filter(Boolean))}var a=new y_.LineLayer({pickingBuffer:5}).source(i).color(n.style.stroke).size(n.style.strokeWidth).style({opacity:n.style.strokeOpacity,lineType:n.style.lineType,dashArray:n.style.dashArray}).active(n.active);return a.zIndex=n.zIndex,a.setBlend("max"),[a]}}]),n}(S_);function xb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wb(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xb(Object(n),!0).forEach((function(e){Sb(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xb(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Sb(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Eb(t){return Eb="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},Eb(t)}function Mb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Tb(t,e){return Tb=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Tb(t,e)}function Ab(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Cb(t){return Cb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Cb(t)}vb.setStrategy(_b.getInstance(),"Polygon"),vb.setStrategy(bb.getInstance(),"LineString"),(yb=fb||(fb={})).CREATE="draw.create",yb.DELETE="draw.delete",yb.Move="draw.move",yb.Edit="draw.edit",yb.UPDATE="draw.update",yb.CHANGE="draw.change",yb.SELECTION_CHANGE="draw.selectionchange",yb.MODE_CHANGE="draw.modechange",yb.ACTIONABLE="draw.actionable",yb.RENDER="draw.render",yb.COMBINE_FEATURES="draw.combine",yb.UNCOMBINE_FEATURES="draw.uncombine",yb.ADD_POINT="draw.addpoint",yb.MEASURE="draw.measure",yb.MULTI_SELECT="draw.multiselect",yb.BOX_SELECT="draw.boxselect",yb.ENABLE="draw.enable",yb.DISABLE="draw.disable",(gb=db||(db={})).DRAW_Circle="draw_circle",gb.DRAW_Rect="draw_rect",gb.DRAW_LINE_STRING="draw_line_string",gb.DRAW_POLYGON="draw_polygon",gb.DRAW_POINT="draw_point",gb.SIMPLE_SELECT="simple_select",gb.DIRECT_SELECT="direct_select",gb.STATIC="static",gb.RULER="ruler",function(t){t.FEATURE="Feature",t.POLYGON="Polygon",t.LINE_STRING="LineString",t.POINT="Point",t.FEATURE_COLLECTION="FeatureCollection",t.MULTI_PREFIX="Multi",t.MULTI_POINT="MultiPoint",t.MULTI_LINE_STRING="MultiLineString",t.MULTI_POLYGON="MultiPolygon"}(mb||(mb={}));var Ob=H_.defaultRenderer(),Pb=function(t){!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&&Tb(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Cb(r);if(i){var n=Cb(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Eb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ab(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t)).styleVariant="normal",(0,v_.bindAll)(["onDeleteClick","onClick"],Ab(e)),e}return e=a,(n=[{key:"update",value:function(t){if(this.drawLayers.length>0)this.updateData(t);else{this.removeLayers();var e=this.draw.getStyle(this.styleVariant);this.drawLayers=Ob.renderFeature(t,e),this.addFilter(),this.addLayers()}}},{key:"enableSelect",value:function(){if(!this.isEnableDrag&&this.draw.selectEnable){var t=this.drawLayers[0];t&&(t.on("click",this.onClick),this.isEnableDrag=!0)}}},{key:"disableSelect",value:function(){this.isEnableDrag&&(this.drawLayers[0].off("click",this.onClick),this.isEnableDrag=!1)}},{key:"enableDelete",value:function(){this.disableSelect(),this.drawLayers[0].on("click",this.onDeleteClick)}},{key:"disableDelete",value:function(){this.drawLayers[0].off("click",this.onDeleteClick)}},{key:"addFilter",value:function(){this.drawLayers.forEach((function(t){return t.filter("active",(function(t){return!t}))}))}},{key:"onClick",value:function(t){this.draw.getDrawable()&&(this.draw.source.setFeatureUnActive(this.draw.getCurrentFeature()),this.draw.setCurrentFeature(t.feature),this.draw.source.setFeatureActive(t.feature),this.updateData(this.draw.source.data),this.draw.emit(fb.MODE_CHANGE,db.SIMPLE_SELECT))}},{key:"onDeleteClick",value:function(t){this.draw.source.removeFeature(t.feature),this.updateData(this.draw.source.data)}}])&&Mb(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Y_);function kb(t){return kb="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},kb(t)}function Lb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ib(t,e){return Ib=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ib(t,e)}function Rb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Db(t){return Db=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Db(t)}var Nb=H_.defaultRenderer(),Fb=function(t){!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&&Ib(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Db(r);if(i){var n=Db(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===kb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Rb(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t)).styleVariant="active",(0,v_.bindAll)(["onMouseMove","onUnMouseMove","onClick","onUnClick"],Rb(e)),e}return e=a,(n=[{key:"update",value:function(t){this.removeLayers();var e=this.draw.getStyle(this.styleVariant);this.drawLayers=Nb.renderFeature(t,e),this.addLayers()}},{key:"enableSelect",value:function(){if(this.show(),!this.isEnableDrag){var t=this.drawLayers[0];t.on("mouseenter",this.onMouseMove),t.on("mouseout",this.onUnMouseMove),this.draw.editEnable&&t.on("click",this.onClick),t.on("unclick",this.onUnClick),this.isEnableDrag=!0}}},{key:"disableSelect",value:function(){if(this.isEnableDrag){var t=this.drawLayers[0];t.off("mouseenter",this.onMouseMove),t.off("mouseout",this.onUnMouseMove),t.off("click",this.onClick),t.off("unclick",this.onUnClick),this.isEnableDrag=!1}}},{key:"enableEdit",value:function(){this.isEnableEdit||(this.drawLayers[0].on("unclick",this.onUnClick),this.isEnableDrag=!0)}},{key:"disableEdit",value:function(){this.isEnableEdit&&(this.drawLayers[0].off("unclick",this.onUnClick),this.isEnableDrag=!1)}},{key:"onMouseMove",value:function(t){this.draw.setCursor("move"),this.draw.selectMode.enable(),this.draw.measureMode.enable()}},{key:"onUnMouseMove",value:function(t){this.draw.resetCursor(),this.draw.selectMode.disable()}},{key:"onClick",value:function(t){this.draw.getDrawable()&&(this.draw.selectMode.disable(),this.draw.editMode.enable(),this.disableSelect(),this.draw.resetCursor(),this.enableEdit(),this.draw.setCurrentFeature(t.feature),this.draw.emit(fb.MODE_CHANGE,db.DIRECT_SELECT))}},{key:"onUnClick",value:function(t){this.draw.selectMode.disable(),this.draw.editMode.disable(),this.draw.source.setFeatureUnActive(this.draw.getCurrentFeature()),this.disableSelect(),this.disableEdit(),this.hide(),this.draw.emit(fb.MODE_CHANGE,db.STATIC)}}])&&Lb(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Y_);function zb(t){return zb="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},zb(t)}function Bb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function jb(t,e){return jb=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},jb(t,e)}function Ub(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zb(t){return Zb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Zb(t)}var Vb=function(t){!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&&jb(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Zb(r);if(i){var n=Zb(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===zb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ub(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t)).styleVariant="active",(0,v_.bindAll)(["onMouseEnter","onMouseOut","onClick"],Ub(e)),e}return e=a,(n=[{key:"enableSelect",value:function(){}},{key:"disableSelect",value:function(){}},{key:"enableEdit",value:function(){if(!this.isEnableEdit){var t=this.drawLayers[0];t.on("mouseenter",this.onMouseEnter),t.on("mouseout",this.onMouseOut),t.on("click",this.onClick),this.isEnableEdit=!0}}},{key:"disableEdit",value:function(){if(this.isEnableEdit){var t=this.drawLayers[0];t.off("mouseenter",this.onMouseEnter),t.off("mouseout",this.onMouseOut),t.off("click",this.onClick),this.isEnableEdit=!1}}},{key:"onMouseEnter",value:function(t){this.draw.setCursor("move"),this.draw.setCurrentVertex(t.feature),this.draw.editMode.enable()}},{key:"onMouseOut",value:function(t){this.draw.resetCursor(),this.draw.editMode.disable()}},{key:"onClick",value:function(t){this.draw.getDrawable()&&(this.draw.setCurrentVertex(t.feature),this.draw.editMode.enable())}}])&&Bb(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Y_),Gb=6371008.8,Hb={meters:Gb,metres:Gb,millimeters:6371008800,millimetres:6371008800,centimeters:637100880,centimetres:637100880,kilometers:6371.0088,kilometres:6371.0088,miles:3958.761333810546,nauticalmiles:3440.069546436285,inches:250826616.45599997,yards:5825721.287490856,feet:20902260.511392,radians:1,degrees:57.22891354143274};function Wb(t,e,n){if(!$b(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&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((function(t){if(!Xb(t))throw new Error("bbox must only contain numbers")}))}(r),i&&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")}(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function qb(t){if(null==t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function Yb(t){if(null==t)throw new Error("degrees is required");return t%360*Math.PI/180}function Xb(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function $b(t){return!!t&&t.constructor===Object}function Kb(t){if(!t)throw new Error("coord is required");if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates;if(Array.isArray(t)&&t.length>=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}const Jb=function t(e,n,r){if(!$b(r=r||{}))throw new Error("options is invalid");if(!0===r.final)return function(e,n){var r=t(n,e);return(r+180)%360}(e,n);var i=Kb(e),o=Kb(n),a=Yb(i[0]),s=Yb(o[0]),u=Yb(i[1]),l=Yb(o[1]),c=Math.sin(s-a)*Math.cos(l),h=Math.cos(u)*Math.sin(l)-Math.sin(u)*Math.cos(l)*Math.cos(s-a);return qb(Math.atan2(c,h))},Qb=function(t,e,n,r){if(!$b(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.properties,a=Kb(t),s=Yb(a[0]),u=Yb(a[1]),l=Yb(n),c=function(t,e){if(null==t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=Hb[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}(e,i),h=Math.asin(Math.sin(u)*Math.cos(c)+Math.cos(u)*Math.sin(c)*Math.cos(l));return function(t,e,n){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(!Xb(t[0])||!Xb(t[1]))throw new Error("coordinates must contain numbers");return Wb({type:"Point",coordinates:t},e,n)}([qb(s+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(u),Math.cos(c)-Math.sin(u)*Math.sin(h))),qb(h)],o)},tx=function(t,e,n){if(!$b(n=n||{}))throw new Error("options is invalid");var r=n.units,i=Kb(t),o=Kb(e),a=Yb(o[1]-i[1]),s=Yb(o[0]-i[0]),u=Yb(i[1]),l=Yb(o[1]),c=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(u)*Math.cos(l);return function(t,e){if(null==t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=Hb[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r)};function ex(t){return ex="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},ex(t)}function nx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ix(t,e){return ix=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ix(t,e)}function ox(t){return ox=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ox(t)}var ax=H_.defaultRenderer(),sx=function(t){!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&&ix(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ox(r);if(i){var n=ox(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ex(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,t)});function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))).showLine=!0,t}return e=a,n=[{key:"update",value:function(t){if(!t.features.every(X_))throw new Error("All features must be LineString in order to calculate distance.");this.removeLayers();var e,n,r=t.features.map((function(t){var e,n,r=null==t||null===(e=t.geometry)||void 0===e?void 0:e.coordinates[0],i=null==t||null===(n=t.geometry)||void 0===n?void 0:n.coordinates[1],o=rb(r,i),a=function(t,e){var n=tx(t,e),r=Jb(t,e);return Qb(t,n/2,r)}(r,i);return a.properties.value=o,a})),i=this.draw.getStyle("active");this.drawLayers=ax.renderFeature((0,__.uf)(r),i),this.showLine&&(e=this.drawLayers).push.apply(e,function(t){if(Array.isArray(t))return nx(t)}(n=ax.renderFeature(t,i))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return nx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nx(t,e):void 0}}(n)||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.")}()),this.addLayers()}}],n&&rx(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Y_),ux=s(8304);const lx=function(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return(0,J_.pZ)(t,(function(t){n+=t[0],r+=t[1],i++}),!0),(0,__.xm)([n/i,r/i],e.properties)},cx=function t(e,n){switch(void 0===n&&(n={}),(0,K_.oL)(e)){case"Point":return(0,__.xm)((0,K_.c9)(e),n.properties);case"Polygon":var r=[];(0,J_.pZ)(e,(function(t){r.push(t)}));var i,o,a,s,u,l,c,h,p=lx(e,{properties:n.properties}),f=p.geometry.coordinates,d=0,m=0,g=0,y=r.map((function(t){return[t[0]-f[0],t[1]-f[1]]}));for(i=0;i<r.length-1;i++)s=(o=y[i])[0],l=o[1],u=(a=y[i+1])[0],g+=h=s*(c=a[1])-u*l,d+=(s+u)*h,m+=(l+c)*h;if(0===g)return p;var v=1/(.5*g*6);return(0,__.xm)([f[0]+v*d,f[1]+v*m],n.properties);default:var _=function(t,e){void 0===e&&(e={}),e.concavity=e.concavity||1/0;var n=[];if((0,J_.pZ)(t,(function(t){n.push([t[0],t[1]])})),!n.length)return null;var r=ux(n,e.concavity);return r.length>3?(0,__.yu)([r]):null}(e);return _?t(_,{properties:n.properties}):lx(e,{properties:n.properties})}};function hx(t){return hx="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},hx(t)}function px(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function dx(t,e){return dx=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},dx(t,e)}function mx(t){return mx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mx(t)}var gx=H_.defaultRenderer(),yx=function(t){!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&&dx(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=mx(r);if(i){var n=mx(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===hx(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,t)});function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))).showArea=!0,t}return e=a,(n=[{key:"update",value:function(t){if(!t.features.every($_))throw new Error("All features must be LineString in order to calculate distance.");this.removeLayers();var e,n,r=t.features.map((function(t){return cx(t,{properties:{value:ib(t.geometry)}})})),i=this.draw.getStyle("active");this.drawLayers=gx.renderFeature((0,__.uf)(r),i),this.showArea&&(e=this.drawLayers).push.apply(e,function(t){if(Array.isArray(t))return px(t)}(n=gx.renderFeature(t,i))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return px(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?px(t,e):void 0}}(n)||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.")}()),this.addLayers()}}])&&fx(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Y_),vx=s(1883),_x=s(8469),bx=s.n(_x),xx=s(2576),wx=s.n(xx),Sx=s(7179),Ex=s.n(Sx);function Mx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Tx=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=void 0,this.initData=void 0,"FeatureCollection"!==(null==e?void 0:e.type)?(e&&(this.initData=e),this.data=this.getDefaultData()):this.data=wx()(e||this.getDefaultData(),!0)}var e,n;return e=t,n=[{key:"addFeature",value:function(t){this.data.features.push(t)}},{key:"getData",value:function(){return{type:"FeatureCollection",features:Ex()(this.data.features)}}},{key:"getFeature",value:function(t){var e;return null===(e=this.data)||void 0===e?void 0:e.features.find((function(e){var n;return(null==e||null===(n=e.properties)||void 0===n?void 0:n.id)===t}))}},{key:"removeAllFeatures",value:function(){this.data=this.getDefaultData()}},{key:"removeFeature",value:function(t){var e=this.getFeatureIndex(t);void 0!==e&&this.data.features.splice(e,1)}},{key:"setFeatureActive",value:function(t){var e,n=this.getFeature(null==t||null===(e=t.properties)||void 0===e?void 0:e.id);n&&n.properties&&(n.properties.active=!0)}},{key:"setFeatureUnActive",value:function(t){var e,n=this.getFeature(null==t||null===(e=t.properties)||void 0===e?void 0:e.id);n&&n.properties&&(n.properties.active=!1)}},{key:"clearFeatureActive",value:function(){this.data.features.forEach((function(t){t&&t.properties&&(t.properties.active=!1)}))}},{key:"updateFeature",value:function(t){this.removeFeature(t),this.addFeature(t)}},{key:"destroy",value:function(){this.data=this.getDefaultData()}},{key:"getDefaultData",value:function(){return{type:"FeatureCollection",features:[]}}},{key:"getFeatureIndex",value:function(t){return this.data.features.findIndex((function(e){var n,r;return(null==e||null===(n=e.properties)||void 0===n?void 0:n.id)===(null==t||null===(r=t.properties)||void 0===r?void 0:r.id)}))}}],n&&Mx(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const Ax={boxSelect:{polygon:{shape:"fill",color:"#black",style:{stroke:"black",strokeWidth:1,strokeOpacity:1,lineType:"dash",dashArray:[1,1]},zIndex:0}},active:{point:{type:"PointLayer",shape:"circle",color:"#fbb03b",size:5,style:{stroke:"#fff",strokeWidth:2},zIndex:0},line:{type:"LineLayer",shape:"line",color:"#fbb03b",size:1,style:{opacity:1,lineType:"dash",dashArray:[2,2]},zIndex:0},polygon:{shape:"fill",color:"#fbb03b",style:{opacity:.1,stroke:"#fbb03b",strokeWidth:1,strokeOpacity:1,lineType:"dash",dashArray:[2,2]},zIndex:0}},normal:{polygon:{type:"PolygonLayer",shape:"fill",color:"#3bb2d0",style:{opacity:.1,stroke:"#3bb2d0",strokeWidth:1,strokeOpacity:1,lineType:"solid",dashArray:[2,2]},zIndex:0},line:{type:"LineLayer",shape:"line",size:1,color:"#3bb2d0",style:{opacity:1},zIndex:0},point:{type:"PointLayer",shape:"circle",color:"#3bb2d0",size:3,style:{stroke:"#fff",strokeWidth:2},zIndex:0}},normal_point:{type:"PointLayer",shape:"circle",color:"#3bb2d0",size:3,style:{stroke:"#fff",strokeWidth:2},zIndex:0},mid_point:{point:{type:"PointLayer",shape:"circle",color:"#fbb03b",size:3,style:{},zIndex:0}},ruler:{polygon:{type:"PolygonLayer",shape:"fill",active:{color:"#FB93FF"},color:"#883BF2",style:{opacity:.1,stroke:"#883BF2",strokeWidth:1,strokeOpacity:1,lineType:"solid",dashArray:[2,2]},zIndex:0},line:{type:"LineLayer",shape:"line",size:1,color:"#883BF2",active:{color:"#FB93FF"},style:{stroke:"#883BF2",strokeWidth:1,strokeOpacity:1,lineType:"solid"},zIndex:0},point:{type:"PointLayer",shape:"circle",color:"#883BF2",size:3,style:{stroke:"#fff",strokeWidth:2},zIndex:0}}};function Cx(t){return Cx="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},Cx(t)}function Ox(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Px(t,e){return Px=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Px(t,e)}function kx(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Lx(t){return Lx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Lx(t)}var Ix=0,Rx=function(t){!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&&Px(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Lx(r);if(i){var n=Lx(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Cx(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return kx(t)}(this,t)});function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this)).source=void 0,e.scene=void 0,e.type=void 0,e.title=void 0,e.isEnable=!1,e.options={style:Ax},e.drawStatus="Drawing",e.currentFeature=void 0,e.currentVertex=void 0,e.popup=void 0,e.drawMode=void 0,e.drawable=!0;var r=n.data;return e.scene=t,e.source=new Tx(r),e.options=bx()(e.options,e.getDefaultOptions(),n),e.title=e.getOption("title"),(0,v_.bindAll)(["onDragStart","onDragging","onDragEnd","onClick","onCheckDrawable"],kx(e)),e}return e=a,n=[{key:"getDrawMode",value:function(){return this.drawMode}},{key:"enable",value:function(){this.scene.setMapStatus({dragEnable:!1}),this.isEnable||(this.drawStatus="Drawing",this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.scene.on("click",this.onClick),this.scene.on("mousemove",this.onCheckDrawable),this.setCursor(this.getOption("cursor")),this.isEnable=!0,this.emit(fb.ENABLE,this))}},{key:"resetDraw",value:function(){}},{key:"disable",value:function(){this.isEnable&&(this.scene.off("dragstart",this.onDragStart),this.scene.off("dragging",this.onDragging),this.scene.off("dragend",this.onDragEnd),this.scene.off("click",this.onClick),this.scene.off("mousemove",this.onCheckDrawable),this.resetCursor(),this.scene.setMapStatus({dragEnable:!0}),this.isEnable=!1,this.drawStatus="DrawFinish",this.emit(fb.DISABLE,this))}},{key:"onCheckDrawable",value:function(t){var e=t.lnglat,n=this.getOption("checkDrawable");n&&"Drawing"===this.drawStatus&&(n(e,this)?(this.setCursor(this.getOption("cursor")),this.drawable=!0):(this.setCursor("not-allowed"),this.drawable=!1))}},{key:"setCurrentFeature",value:function(t){this.currentFeature=t,this.source.setFeatureActive(t)}},{key:"setCurrentVertex",value:function(t){this.currentVertex=t}},{key:"deleteCurrentFeature",value:function(){throw new Error("子类未实现该方法")}},{key:"getCurrentVertex",value:function(){return this.currentVertex}},{key:"getCurrentFeature",value:function(){return this.currentFeature}},{key:"getOption",value:function(t){return this.options[t]}},{key:"setOption",value:function(t,e){return this.options[t]=e}},{key:"getStyle",value:function(t){return this.getOption("style")[t]}},{key:"getUniqId",value:function(){return Ix++}},{key:"setCursor",value:function(t){var e=this.scene.getMapCanvasContainer();if(e){var n,r,i=null!==(n=this.getOption("rewriteCursor"))&&void 0!==n?n:{};e.style.cursor=null!==(r=i[t])&&void 0!==r?r:t}}},{key:"resetCursor",value:function(){var t=this.scene.getMapCanvasContainer();t&&t.removeAttribute("style")}},{key:"getCursor",value:function(){var t,e=this.scene.getMapCanvasContainer();if(e)return null!==(t=e.style.cursor)&&void 0!==t?t:""}},{key:"destroy",value:function(){Ix=0,this.removeAllListeners(),this.disable()}},{key:"getDrawable",value:function(){return this.drawable}},{key:"setDrawMode",value:function(t){this.drawMode=t}},{key:"getDefaultOptions",value:function(){return{}}},{key:"onClick",value:function(t){return null}}],n&&Ox(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(vx.EventEmitter);const Dx=Rx;function Nx(t){return Nx="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},Nx(t)}function Fx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zx(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fx(Object(n),!0).forEach((function(e){Bx(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fx(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bx(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ux(){return Ux="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vx(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ux.apply(this,arguments)}function Zx(t,e){return Zx=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Zx(t,e)}function Vx(t){return Vx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vx(t)}var Gx=function(t){!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&&Zx(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Vx(r);if(i){var n=Vx(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Nx(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,t)});function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,t,e)}return e=a,(n=[{key:"enable",value:function(){this.emit(fb.DELETE,"")}},{key:"disable",value:function(){return null}},{key:"getDefaultOptions",value:function(){return zx(zx({},Ux(Vx(a.prototype),"getDefaultOptions",this).call(this)),{},{title:"删除图形"})}},{key:"onDragStart",value:function(t){throw new Error("Method not implemented.")}},{key:"onDragging",value:function(t){}},{key:"onDragEnd",value:function(){throw new Error("Method not implemented.")}},{key:"onClick",value:function(){return null}}])&&jx(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Dx);function Hx(t){return Hx="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},Hx(t)}function Wx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function qx(t,e){return qx=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},qx(t,e)}function Yx(t){return Yx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Yx(t)}var Xx=function(t){!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&&qx(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Yx(r);if(i){var n=Yx(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Hx(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,t)});function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t,n)).endPoint=void 0,e.onDragStart=function(t){},e.onDragging=function(t){e.endPoint=t.lngLat,e.emit(fb.Edit,e.endPoint)},e.onDragEnd=function(){e.emit(fb.UPDATE,e.currentFeature),e.resetCursor(),e.disable()},e.onClick=function(){return null},e}return e=a,(n=[{key:"setEditFeature",value:function(t){this.currentFeature=t}},{key:"getDefaultOptions",value:function(){return{steps:64,units:"kilometers",cursor:"move"}}}])&&Wx(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Dx);function $x(t){return $x="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},$x(t)}function Kx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Jx(t,e){return Jx=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Jx(t,e)}function Qx(t){return Qx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Qx(t)}var tw=function(t){!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&&Jx(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Qx(r);if(i){var n=Qx(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===$x(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,t)});function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t,n)).center=void 0,e.dragStartPoint=void 0,e}return e=a,(n=[{key:"setSelectedFeature",value:function(t){this.currentFeature=t}},{key:"onDragStart",value:function(t){this.scene.setMapStatus({dragEnable:!1}),this.dragStartPoint=t.lngLat}},{key:"getDefaultOptions",value:function(){return{steps:64,units:"kilometers",cursor:"move"}}},{key:"onDragging",value:function(t){var e={lng:t.lngLat.lng-this.dragStartPoint.lng,lat:t.lngLat.lat-this.dragStartPoint.lat};this.emit(fb.Move,e),this.dragStartPoint=t.lngLat}},{key:"onDragEnd",value:function(){this.emit(fb.UPDATE,this.currentFeature)}},{key:"onClick",value:function(){return null}}])&&Kx(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Dx);function ew(t){return ew="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},ew(t)}function nw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rw(t,e){return rw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},rw(t,e)}function iw(t){return iw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},iw(t)}var ow=function(t){!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&&rw(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=iw(r);if(i){var n=iw(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ew(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,t)});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return e=a,(n=[{key:"update",value:function(t){}},{key:"on",value:function(t,e){}},{key:"off",value:function(t,e){}},{key:"emit",value:function(t,e){}},{key:"updateData",value:function(t){}},{key:"destroy",value:function(){}},{key:"removeLayers",value:function(){}},{key:"addLayers",value:function(){}},{key:"show",value:function(){}},{key:"hide",value:function(){}}])&&nw(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Y_);function aw(t){return aw="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},aw(t)}function sw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function uw(t,e){return uw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},uw(t,e)}function lw(t){return lw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},lw(t)}var cw=function(t){!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&&uw(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=lw(r);if(i){var n=lw(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===aw(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,t)});function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,t,e)}return e=a,(n=[{key:"setSelectedFeature",value:function(t){this.currentFeature=t,this.emit(fb.MEASURE,this.currentFeature)}},{key:"onDragStart",value:function(t){}},{key:"getDefaultOptions",value:function(){return{steps:64,units:"kilometers",cursor:"move"}}},{key:"onDragging",value:function(t){}},{key:"onDragEnd",value:function(){}},{key:"onClick",value:function(){}}])&&sw(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Dx);function hw(t){return hw="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},hw(t)}function pw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fw(t,e){return fw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},fw(t,e)}function dw(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mw(t){return mw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mw(t)}var gw=function(t){!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&&fw(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=mw(r);if(i){var n=mw(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===hw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return dw(t)}(this,t)});function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t,n)).selectMode=void 0,e.editMode=void 0,e.measureMode=void 0,e.deleteMode=void 0,e.editEnable=void 0,e.showDistance=void 0,e.showArea=void 0,e.dragEnable=void 0,e.selectEnable=void 0,e.normalLayer=void 0,e.drawLayer=void 0,e.drawVertexLayer=void 0,e.drawDistanceLayer=void 0,e.drawAreaLayer=void 0,e.onModeChange=function(t){var n,r,i,o;switch(e.setDrawMode(t),t){case db.DIRECT_SELECT:if(!e.editEnable)return;e.editMode.enable(),e.editMode.setEditFeature(e.currentFeature),e.drawLayer.updateData((0,__.uf)([e.currentFeature])),e.drawVertexLayer.updateData((0,__.uf)(null===(n=e.currentFeature)||void 0===n||null===(r=n.properties)||void 0===r?void 0:r.pointFeatures)),e.drawVertexLayer.show(),e.drawVertexLayer.enableEdit(),e.drawDistanceLayer.show(),e.drawAreaLayer.show(),e.showOtherLayer(),e.drawStatus="DrawEdit";break;case db.SIMPLE_SELECT:if(!e.selectEnable)return e.drawLayer.hide(),e.drawVertexLayer.hide(),e.hideOtherLayer(),void e.emit(fb.MODE_CHANGE,db.STATIC);e.selectMode.setSelectedFeature(e.currentFeature),e.selectMode.enable(),e.measureMode.setSelectedFeature(e.currentFeature),e.measureMode.enable(),e.drawLayer.updateData((0,__.uf)([e.currentFeature])),e.drawLayer.enableSelect(),e.drawVertexLayer.updateData((0,__.uf)(null===(i=e.currentFeature)||void 0===i||null===(o=i.properties)||void 0===o?void 0:o.pointFeatures)),e.drawVertexLayer.disableEdit(),e.drawVertexLayer.show(),e.drawDistanceLayer.show(),e.drawAreaLayer.show(),e.drawLayer.show(),e.showOtherLayer(),e.drawStatus="DrawSelected";break;case db.STATIC:if(!e.getOption("showFeature"))return;e.source.updateFeature(e.currentFeature),e.selectMode.disable(),e.editMode.disable(),e.measureMode.disable(),e.source.clearFeatureActive(),e.drawVertexLayer.hide(),e.drawDistanceLayer.hide(),e.drawAreaLayer.hide(),e.drawVertexLayer.disableEdit(),e.hideOtherLayer(),e.normalLayer.update(e.source.data),e.normalLayer.enableSelect(),e.drawStatus="DrawFinish"}},e.onDrawCreate=function(t){e.source.addFeature(t)},e.onDrawUpdate=function(t){e.source.updateFeature(e.currentFeature),e.emit(fb.UPDATE,e.currentFeature)},e.onDrawMove=function(t){"DrawSelected"!==e.drawStatus&&"DrawFinish"!==e.drawStatus||!e.dragEnable||e.moveFeature(t)},e.onDrawEdit=function(t){e.editFeature(t)},e.onDrawDelete=function(){"DrawSelected"===e.drawStatus&&(e.clear(),e.source.removeFeature(e.currentFeature),e.normalLayer.update(e.source.data),e.drawLayer.disableSelect(),e.selectMode.disable(),e.currentFeature=null)},e.addKeyDownEvent=function(t){var n=t||window.event;n&&8===n.keyCode&&e.deleteMode.enable(),n&&90===n.keyCode&&n.ctrlKey&&"Drawing"===e.drawStatus&&e.removeLatestVertex()},e.selectEnable=e.getOption("selectEnable"),e.editEnable=e.getOption("editEnable"),e.showDistance=e.getOption("showDistance"),e.showArea=e.getOption("showArea"),e.dragEnable=e.getOption("dragEnable"),e.drawLayer=new Fb(dw(e)),e.drawVertexLayer=new Vb(dw(e)),e.showDistance?e.drawDistanceLayer=new sx(dw(e)):e.drawDistanceLayer=new ow(dw(e)),e.showArea?e.drawAreaLayer=new yx(dw(e)):e.drawAreaLayer=new ow(dw(e)),e.normalLayer=new Pb(dw(e)),e.selectMode=new tw(e.scene,{}),e.editMode=new Xx(e.scene,{}),e.deleteMode=new Gx(e.scene,{}),e.measureMode=new cw(e.scene,{}),e.selectMode.on(fb.UPDATE,e.onDrawUpdate),e.selectMode.on(fb.Move,e.onDrawMove),e.editMode.on(fb.MODE_CHANGE,e.onModeChange),e.editMode.on(fb.UPDATE,e.onDrawUpdate),e.editMode.on(fb.Edit,e.onDrawEdit),e.selectMode.on(fb.MODE_CHANGE,e.onModeChange),e.deleteMode.on(fb.DELETE,e.onDrawDelete),e.on(fb.CREATE,e.onDrawCreate),e.on(fb.MODE_CHANGE,e.onModeChange),document.addEventListener("keydown",e.addKeyDownEvent),e.options.data&&e.initData()&&(e.normalLayer.update(e.source.data),e.normalLayer.enableSelect()),e}return e=a,(n=[{key:"setCurrentFeature",value:function(t){this.currentFeature=t,this.pointFeatures=t.properties.pointFeatures,this.source.setFeatureActive(t)}},{key:"deleteCurrentFeature",value:function(){this.deleteMode.enable()}},{key:"disableLayer",value:function(){this.drawLayer.disableSelect()}},{key:"enableLayer",value:function(){this.drawLayer.enableSelect()}},{key:"getData",value:function(){return this.source.getData()}},{key:"resetData",value:function(t){this.source=new Tx(t),this.options=bx()(this.options,this.getDefaultOptions(),{data:t}),this.initData(),this.normalLayer.update(this.source.data),this.normalLayer.enableSelect(),this.normalLayer.show()}},{key:"removeAllData",value:function(){this.resetData()}},{key:"clear",value:function(){this.drawLayer.disableSelect(),this.drawLayer.disableEdit(),this.drawLayer.hide(),this.drawVertexLayer.hide(),this.hideOtherLayer(),this.emit(fb.MODE_CHANGE,db.STATIC)}},{key:"reset",value:function(){this.drawLayer.show(),this.drawVertexLayer.show(),this.showOtherLayer()}},{key:"addVertex",value:function(t){throw new Error("子类未实现该方法")}},{key:"onRemove",value:function(){this.destroy(),this.selectMode.destroy(),this.editMode.destroy(),this.measureMode.destroy(),this.source.destroy(),this.drawLayer.destroy(),this.drawVertexLayer.destroy(),this.normalLayer.destroy(),document.removeEventListener("keydown",this.addKeyDownEvent)}},{key:"getDefaultOptions",value:function(){return{steps:64,units:"kilometers",cursor:"crosshair",editEnable:!0,selectEnable:!0,showFeature:!0,enableCustomDraw:!0,dragEnable:!0}}},{key:"initData",value:function(){return!1}},{key:"addDrawPopup",value:function(t,e){var n=new g_.Popup({anchor:"left",closeButton:!1}).setLnglat(t).setText("半径:".concat(e.toFixed(2),"千米"));this.scene.addPopup(n),this.popup=n}}])&&pw(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Dx);function yw(t){return yw="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},yw(t)}function vw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _w(t,e){return _w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_w(t,e)}function bw(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xw(t){return xw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},xw(t)}H_.defaultRenderer();var ww=function(t){!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&&_w(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=xw(r);if(i){var n=xw(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===yw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return bw(t)}(this,t)});function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t,n)).startPoint=void 0,e.endPoint=void 0,e.drawDistanceLayer=new ow(bw(e)),e.drawLayer.styleVariant="boxSelect",e}return e=a,n=[{key:"drawFinish",value:function(){}},{key:"moveFeature",value:function(t){}},{key:"editFeature",value:function(t){}},{key:"hideOtherLayer",value:function(){}},{key:"removeLatestVertex",value:function(){}},{key:"showOtherLayer",value:function(){}},{key:"onDragStart",value:function(t){"Drawing"!==this.drawStatus&&this.drawLayer.emit("unclick",null),this.startPoint=t.lngLat,this.setCursor("crosshair")}},{key:"onDragging",value:function(t){this.endPoint=t.lngLat;var e=this.createFeature();this.drawLayer.update((0,__.uf)([e]))}},{key:"onDragEnd",value:function(){this.drawLayer.update((0,__.uf)([])),this.emit(fb.BOX_SELECT,{startPoint:this.startPoint,endPoint:this.endPoint}),this.disable()}},{key:"createFeature",value:function(){var t,e,n,r,i,o,a,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0";return t=[this.startPoint.lng,this.startPoint.lat],e=[this.endPoint.lng,this.endPoint.lat],n={id:s,pointFeatures:[]},r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),a=Math.max(t[1],e[1]),{type:"Feature",properties:wb({type:"rect",active:!0,startPoint:{lng:t[0],lat:t[1]},endPoint:{lng:e[0],lat:e[1]}},n),geometry:{type:"Polygon",coordinates:[[[r,i],[r,a],[o,a],[o,i],[r,i]]]}}}}],n&&vw(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(gw),Sw=s(210),Ew=s(2512);function Mw(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=(0,K_.c9)(t),i=(0,K_.wA)(e),o=i.type,a=e.bbox,s=i.coordinates;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,a))return!1;"Polygon"===o&&(s=[s]);for(var u=!1,l=0;l<s.length&&!u;l++)if(Tw(r,s[l][0],n.ignoreBoundary)){for(var c=!1,h=1;h<s[l].length&&!c;)Tw(r,s[l][h],!n.ignoreBoundary)&&(c=!0),h++;c||(u=!0)}return u}function Tw(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var a=e[i][0],s=e[i][1],u=e[o][0],l=e[o][1];if(t[1]*(a-u)+s*(u-t[0])+l*(t[0]-a)==0&&(a-t[0])*(u-t[0])<=0&&(s-t[1])*(l-t[1])<=0)return!n;s>t[1]!=l>t[1]&&t[0]<(u-a)*(t[1]-s)/(l-s)+a&&(r=!r)}return r}s(2458),Object.prototype.hasOwnProperty;var Aw=new ArrayBuffer(16);new Float64Array(Aw),new Uint32Array(Aw),s(6690),function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}for(this.controls.push([this.points[0],this.points[0]]),e=0;e<this.centers.length-1;e++){var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,a=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+a)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+a)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}t.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}();var Cw=s(5203);s(6319),s(2399);var Ow=Math.PI/180,Pw=180/Math.PI,kw=function(t,e){this.lon=t,this.lat=e,this.x=Ow*t,this.y=Ow*e};kw.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},kw.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new kw(e,t)};var Lw=function(){this.coords=[],this.length=0};Lw.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Iw=function(t){this.properties=t||{},this.geometries=[]};Iw.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},Iw.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=function(t){e+=t[0]+" "+t[1]+","},r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var Rw=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new kw(t.x,t.y),this.end=new kw(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};Rw.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),a=Pw*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[Pw*Math.atan2(i,r),a]},Rw.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,a=this.interpolate(o);n.push(a)}for(var s=!1,u=0,l=e&&e.offset?e.offset:10,c=180-l,h=-180+l,p=360-l,f=1;f<n.length;++f){var d=n[f-1][0],m=n[f][0],g=Math.abs(m-d);g>p&&(m>c&&d<h||d>c&&m<h)?s=!0:g>u&&(u=g)}var y=[];if(s&&u<l){var v=[];y.push(v);for(var _=0;_<n.length;++_){var b=parseFloat(n[_][0]);if(_>0&&Math.abs(b-n[_-1][0])>p){var x=parseFloat(n[_-1][0]),w=parseFloat(n[_-1][1]),S=parseFloat(n[_][0]),E=parseFloat(n[_][1]);if(x>-180&&x<h&&180===S&&_+1<n.length&&n[_-1][0]>-180&&n[_-1][0]<h){v.push([-180,n[_][1]]),_++,v.push([n[_][0],n[_][1]]);continue}if(x>c&&x<180&&-180===S&&_+1<n.length&&n[_-1][0]>c&&n[_-1][0]<180){v.push([180,n[_][1]]),_++,v.push([n[_][0],n[_][1]]);continue}if(x<h&&S>c){var M=x;x=S,S=M;var T=w;w=E,E=T}if(x>c&&S<h&&(S+=360),x<=180&&S>=180&&x<S){var A=(180-x)/(S-x),C=A*E+(1-A)*w;v.push([n[_-1][0]>c?180:-180,C]),(v=[]).push([n[_-1][0]>c?-180:180,C]),y.push(v)}else v=[],y.push(v);v.push([b,n[_][1]])}else v.push([n[_][0],n[_][1]])}}else{var O=[];y.push(O);for(var P=0;P<n.length;++P)O.push([n[P][0],n[P][1]])}for(var k=new Iw(this.properties),L=0;L<y.length;++L){var I=new Lw;k.geometries.push(I);for(var R=y[L],D=0;D<R.length;++D)I.move_to(R[D])}return k},s(1374);var Dw=[],Nw=[],Fw=[],zw=[],Bw=[],jw=[],Uw=[],Zw=[],Vw=[],Gw=[],Hw=[],Ww=[],qw=[],Yw=[],Xw=[],$w=[],Kw=[],Jw=[],Qw=[],tS=[],eS=[],nS=[],rS=[],iS=[];Uw[85]=Gw[85]=-1,Zw[85]=Hw[85]=0,Vw[85]=Ww[85]=1,Qw[85]=nS[85]=1,tS[85]=rS[85]=0,eS[85]=iS[85]=1,Dw[85]=zw[85]=0,Nw[85]=Bw[85]=-1,Fw[85]=Xw[85]=0,$w[85]=qw[85]=0,Kw[85]=Yw[85]=1,jw[85]=Jw[85]=1,nS[1]=nS[169]=0,rS[1]=rS[169]=-1,iS[1]=iS[169]=0,qw[1]=qw[169]=-1,Yw[1]=Yw[169]=0,Xw[1]=Xw[169]=0,Gw[4]=Gw[166]=0,Hw[4]=Hw[166]=-1,Ww[4]=Ww[166]=1,$w[4]=$w[166]=1,Kw[4]=Kw[166]=0,Jw[4]=Jw[166]=0,Uw[16]=Uw[154]=0,Zw[16]=Zw[154]=1,Vw[16]=Vw[154]=1,zw[16]=zw[154]=1,Bw[16]=Bw[154]=0,jw[16]=jw[154]=1,Qw[64]=Qw[106]=0,tS[64]=tS[106]=1,eS[64]=eS[106]=0,Dw[64]=Dw[106]=-1,Nw[64]=Nw[106]=0,Fw[64]=Fw[106]=1,Qw[2]=Qw[168]=0,tS[2]=tS[168]=-1,eS[2]=eS[168]=1,nS[2]=nS[168]=0,rS[2]=rS[168]=-1,iS[2]=iS[168]=0,qw[2]=qw[168]=-1,Yw[2]=Yw[168]=0,Xw[2]=Xw[168]=0,$w[2]=$w[168]=-1,Kw[2]=Kw[168]=0,Jw[2]=Jw[168]=1,Uw[8]=Uw[162]=0,Zw[8]=Zw[162]=-1,Vw[8]=Vw[162]=0,Gw[8]=Gw[162]=0,Hw[8]=Hw[162]=-1,Ww[8]=Ww[162]=1,qw[8]=qw[162]=1,Yw[8]=Yw[162]=0,Xw[8]=Xw[162]=1,$w[8]=$w[162]=1,Kw[8]=Kw[162]=0,Jw[8]=Jw[162]=0,Uw[32]=Uw[138]=0,Zw[32]=Zw[138]=1,Vw[32]=Vw[138]=1,Gw[32]=Gw[138]=0,Hw[32]=Hw[138]=1,Ww[32]=Ww[138]=0,Dw[32]=Dw[138]=1,Nw[32]=Nw[138]=0,Fw[32]=Fw[138]=0,zw[32]=zw[138]=1,Bw[32]=Bw[138]=0,jw[32]=jw[138]=1,nS[128]=nS[42]=0,rS[128]=rS[42]=1,iS[128]=iS[42]=1,Qw[128]=Qw[42]=0,tS[128]=tS[42]=1,eS[128]=eS[42]=0,Dw[128]=Dw[42]=-1,Nw[128]=Nw[42]=0,Fw[128]=Fw[42]=1,zw[128]=zw[42]=-1,Bw[128]=Bw[42]=0,jw[128]=jw[42]=0,Gw[5]=Gw[165]=-1,Hw[5]=Hw[165]=0,Ww[5]=Ww[165]=0,nS[5]=nS[165]=1,rS[5]=rS[165]=0,iS[5]=iS[165]=0,$w[20]=$w[150]=0,Kw[20]=Kw[150]=1,Jw[20]=Jw[150]=1,zw[20]=zw[150]=0,Bw[20]=Bw[150]=-1,jw[20]=jw[150]=1,Uw[80]=Uw[90]=-1,Zw[80]=Zw[90]=0,Vw[80]=Vw[90]=1,Qw[80]=Qw[90]=1,tS[80]=tS[90]=0,eS[80]=eS[90]=1,qw[65]=qw[105]=0,Yw[65]=Yw[105]=1,Xw[65]=Xw[105]=0,Dw[65]=Dw[105]=0,Nw[65]=Nw[105]=-1,Fw[65]=Fw[105]=0,Uw[160]=Uw[10]=-1,Zw[160]=Zw[10]=0,Vw[160]=Vw[10]=1,Gw[160]=Gw[10]=-1,Hw[160]=Hw[10]=0,Ww[160]=Ww[10]=0,nS[160]=nS[10]=1,rS[160]=rS[10]=0,iS[160]=iS[10]=0,Qw[160]=Qw[10]=1,tS[160]=tS[10]=0,eS[160]=eS[10]=1,$w[130]=$w[40]=0,Kw[130]=Kw[40]=1,Jw[130]=Jw[40]=1,qw[130]=qw[40]=0,Yw[130]=Yw[40]=1,Xw[130]=Xw[40]=0,Dw[130]=Dw[40]=0,Nw[130]=Nw[40]=-1,Fw[130]=Fw[40]=0,zw[130]=zw[40]=0,Bw[130]=Bw[40]=-1,jw[130]=jw[40]=1,Gw[37]=Gw[133]=0,Hw[37]=Hw[133]=1,Ww[37]=Ww[133]=1,nS[37]=nS[133]=0,rS[37]=rS[133]=1,iS[37]=iS[133]=0,Dw[37]=Dw[133]=-1,Nw[37]=Nw[133]=0,Fw[37]=Fw[133]=0,zw[37]=zw[133]=1,Bw[37]=Bw[133]=0,jw[37]=jw[133]=0,$w[148]=$w[22]=-1,Kw[148]=Kw[22]=0,Jw[148]=Jw[22]=0,nS[148]=nS[22]=0,rS[148]=rS[22]=-1,iS[148]=iS[22]=1,Qw[148]=Qw[22]=0,tS[148]=tS[22]=1,eS[148]=eS[22]=1,zw[148]=zw[22]=-1,Bw[148]=Bw[22]=0,jw[148]=jw[22]=1,Uw[82]=Uw[88]=0,Zw[82]=Zw[88]=-1,Vw[82]=Vw[88]=1,$w[82]=$w[88]=1,Kw[82]=Kw[88]=0,Jw[82]=Jw[88]=1,qw[82]=qw[88]=-1,Yw[82]=Yw[88]=0,Xw[82]=Xw[88]=1,Qw[82]=Qw[88]=0,tS[82]=tS[88]=-1,eS[82]=eS[88]=0,Uw[73]=Uw[97]=0,Zw[73]=Zw[97]=1,Vw[73]=Vw[97]=0,Gw[73]=Gw[97]=0,Hw[73]=Hw[97]=-1,Ww[73]=Ww[97]=0,qw[73]=qw[97]=1,Yw[73]=Yw[97]=0,Xw[73]=Xw[97]=0,Dw[73]=Dw[97]=1,Nw[73]=Nw[97]=0,Fw[73]=Fw[97]=1,Uw[145]=Uw[25]=0,Zw[145]=Zw[25]=-1,Vw[145]=Vw[25]=0,qw[145]=qw[25]=1,Yw[145]=Yw[25]=0,Xw[145]=Xw[25]=1,nS[145]=nS[25]=0,rS[145]=rS[25]=1,iS[145]=iS[25]=1,zw[145]=zw[25]=-1,Bw[145]=Bw[25]=0,jw[145]=jw[25]=0,Gw[70]=Gw[100]=0,Hw[70]=Hw[100]=1,Ww[70]=Ww[100]=0,$w[70]=$w[100]=-1,Kw[70]=Kw[100]=0,Jw[70]=Jw[100]=1,Qw[70]=Qw[100]=0,tS[70]=tS[100]=-1,eS[70]=eS[100]=1,Dw[70]=Dw[100]=1,Nw[70]=Nw[100]=0,Fw[70]=Fw[100]=0,Gw[101]=Gw[69]=0,Hw[101]=Hw[69]=1,Ww[101]=Ww[69]=0,Dw[101]=Dw[69]=1,Nw[101]=Nw[69]=0,Fw[101]=Fw[69]=0,nS[149]=nS[21]=0,rS[149]=rS[21]=1,iS[149]=iS[21]=1,zw[149]=zw[21]=-1,Bw[149]=Bw[21]=0,jw[149]=jw[21]=0,$w[86]=$w[84]=-1,Kw[86]=Kw[84]=0,Jw[86]=Jw[84]=1,Qw[86]=Qw[84]=0,tS[86]=tS[84]=-1,eS[86]=eS[84]=1,Uw[89]=Uw[81]=0,Zw[89]=Zw[81]=-1,Vw[89]=Vw[81]=0,qw[89]=qw[81]=1,Yw[89]=Yw[81]=0,Xw[89]=Xw[81]=1,Uw[96]=Uw[74]=0,Zw[96]=Zw[74]=1,Vw[96]=Vw[74]=0,Gw[96]=Gw[74]=-1,Hw[96]=Hw[74]=0,Ww[96]=Ww[74]=1,Qw[96]=Qw[74]=1,tS[96]=tS[74]=0,eS[96]=eS[74]=0,Dw[96]=Dw[74]=1,Nw[96]=Nw[74]=0,Fw[96]=Fw[74]=1,Uw[24]=Uw[146]=0,Zw[24]=Zw[146]=-1,Vw[24]=Vw[146]=1,$w[24]=$w[146]=1,Kw[24]=Kw[146]=0,Jw[24]=Jw[146]=1,qw[24]=qw[146]=0,Yw[24]=Yw[146]=1,Xw[24]=Xw[146]=1,zw[24]=zw[146]=0,Bw[24]=Bw[146]=-1,jw[24]=jw[146]=0,Gw[6]=Gw[164]=-1,Hw[6]=Hw[164]=0,Ww[6]=Ww[164]=1,$w[6]=$w[164]=-1,Kw[6]=Kw[164]=0,Jw[6]=Jw[164]=0,nS[6]=nS[164]=0,rS[6]=rS[164]=-1,iS[6]=iS[164]=1,Qw[6]=Qw[164]=1,tS[6]=tS[164]=0,eS[6]=eS[164]=0,qw[129]=qw[41]=0,Yw[129]=Yw[41]=1,Xw[129]=Xw[41]=1,nS[129]=nS[41]=0,rS[129]=rS[41]=1,iS[129]=iS[41]=0,Dw[129]=Dw[41]=-1,Nw[129]=Nw[41]=0,Fw[129]=Fw[41]=0,zw[129]=zw[41]=0,Bw[129]=Bw[41]=-1,jw[129]=jw[41]=0,$w[66]=$w[104]=0,Kw[66]=Kw[104]=1,Jw[66]=Jw[104]=0,qw[66]=qw[104]=-1,Yw[66]=Yw[104]=0,Xw[66]=Xw[104]=1,Qw[66]=Qw[104]=0,tS[66]=tS[104]=-1,eS[66]=eS[104]=0,Dw[66]=Dw[104]=0,Nw[66]=Nw[104]=-1,Fw[66]=Fw[104]=1,Uw[144]=Uw[26]=-1,Zw[144]=Zw[26]=0,Vw[144]=Vw[26]=0,nS[144]=nS[26]=1,rS[144]=rS[26]=0,iS[144]=iS[26]=1,Qw[144]=Qw[26]=0,tS[144]=tS[26]=1,eS[144]=eS[26]=1,zw[144]=zw[26]=-1,Bw[144]=Bw[26]=0,jw[144]=jw[26]=1,Gw[36]=Gw[134]=0,Hw[36]=Hw[134]=1,Ww[36]=Ww[134]=1,$w[36]=$w[134]=0,Kw[36]=Kw[134]=1,Jw[36]=Jw[134]=0,Dw[36]=Dw[134]=0,Nw[36]=Nw[134]=-1,Fw[36]=Fw[134]=1,zw[36]=zw[134]=1,Bw[36]=Bw[134]=0,jw[36]=jw[134]=0,Uw[9]=Uw[161]=-1,Zw[9]=Zw[161]=0,Vw[9]=Vw[161]=0,Gw[9]=Gw[161]=0,Hw[9]=Hw[161]=-1,Ww[9]=Ww[161]=0,qw[9]=qw[161]=1,Yw[9]=Yw[161]=0,Xw[9]=Xw[161]=0,nS[9]=nS[161]=1,rS[9]=rS[161]=0,iS[9]=iS[161]=1,Uw[136]=0,Zw[136]=1,Vw[136]=1,Gw[136]=0,Hw[136]=1,Ww[136]=0,$w[136]=-1,Kw[136]=0,Jw[136]=1,qw[136]=-1,Yw[136]=0,Xw[136]=0,nS[136]=0,rS[136]=-1,iS[136]=0,Qw[136]=0,tS[136]=-1,eS[136]=1,Dw[136]=1,Nw[136]=0,Fw[136]=0,zw[136]=1,Bw[136]=0,jw[136]=1,Uw[34]=0,Zw[34]=-1,Vw[34]=0,Gw[34]=0,Hw[34]=-1,Ww[34]=1,$w[34]=1,Kw[34]=0,Jw[34]=0,qw[34]=1,Yw[34]=0,Xw[34]=1,nS[34]=0,rS[34]=1,iS[34]=1,Qw[34]=0,tS[34]=1,eS[34]=0,Dw[34]=-1,Nw[34]=0,Fw[34]=1,zw[34]=-1,Bw[34]=0,jw[34]=0,Uw[35]=0,Zw[35]=1,Vw[35]=1,Gw[35]=0,Hw[35]=-1,Ww[35]=1,$w[35]=1,Kw[35]=0,Jw[35]=0,qw[35]=-1,Yw[35]=0,Xw[35]=0,nS[35]=0,rS[35]=-1,iS[35]=0,Qw[35]=0,tS[35]=1,eS[35]=0,Dw[35]=-1,Nw[35]=0,Fw[35]=1,zw[35]=1,Bw[35]=0,jw[35]=1,Uw[153]=0,Zw[153]=1,Vw[153]=1,qw[153]=-1,Yw[153]=0,Xw[153]=0,nS[153]=0,rS[153]=-1,iS[153]=0,zw[153]=1,Bw[153]=0,jw[153]=1,Gw[102]=0,Hw[102]=-1,Ww[102]=1,$w[102]=1,Kw[102]=0,Jw[102]=0,Qw[102]=0,tS[102]=1,eS[102]=0,Dw[102]=-1,Nw[102]=0,Fw[102]=1,Uw[155]=0,Zw[155]=-1,Vw[155]=0,qw[155]=1,Yw[155]=0,Xw[155]=1,nS[155]=0,rS[155]=1,iS[155]=1,zw[155]=-1,Bw[155]=0,jw[155]=0,Gw[103]=0,Hw[103]=1,Ww[103]=0,$w[103]=-1,Kw[103]=0,Jw[103]=1,Qw[103]=0,tS[103]=-1,eS[103]=1,Dw[103]=1,Nw[103]=0,Fw[103]=0,Uw[152]=0,Zw[152]=1,Vw[152]=1,$w[152]=-1,Kw[152]=0,Jw[152]=1,qw[152]=-1,Yw[152]=0,Xw[152]=0,nS[152]=0,rS[152]=-1,iS[152]=0,Qw[152]=0,tS[152]=-1,eS[152]=1,zw[152]=1,Bw[152]=0,jw[152]=1,Uw[156]=0,Zw[156]=-1,Vw[156]=1,$w[156]=1,Kw[156]=0,Jw[156]=1,qw[156]=-1,Yw[156]=0,Xw[156]=0,nS[156]=0,rS[156]=-1,iS[156]=0,Qw[156]=0,tS[156]=1,eS[156]=1,zw[156]=-1,Bw[156]=0,jw[156]=1,Uw[137]=0,Zw[137]=1,Vw[137]=1,Gw[137]=0,Hw[137]=1,Ww[137]=0,qw[137]=-1,Yw[137]=0,Xw[137]=0,nS[137]=0,rS[137]=-1,iS[137]=0,Dw[137]=1,Nw[137]=0,Fw[137]=0,zw[137]=1,Bw[137]=0,jw[137]=1,Uw[139]=0,Zw[139]=1,Vw[139]=1,Gw[139]=0,Hw[139]=-1,Ww[139]=0,qw[139]=1,Yw[139]=0,Xw[139]=0,nS[139]=0,rS[139]=1,iS[139]=0,Dw[139]=-1,Nw[139]=0,Fw[139]=0,zw[139]=1,Bw[139]=0,jw[139]=1,Uw[98]=0,Zw[98]=-1,Vw[98]=0,Gw[98]=0,Hw[98]=-1,Ww[98]=1,$w[98]=1,Kw[98]=0,Jw[98]=0,qw[98]=1,Yw[98]=0,Xw[98]=1,Qw[98]=0,tS[98]=1,eS[98]=0,Dw[98]=-1,Nw[98]=0,Fw[98]=1,Uw[99]=0,Zw[99]=1,Vw[99]=0,Gw[99]=0,Hw[99]=-1,Ww[99]=1,$w[99]=1,Kw[99]=0,Jw[99]=0,qw[99]=-1,Yw[99]=0,Xw[99]=1,Qw[99]=0,tS[99]=-1,eS[99]=0,Dw[99]=1,Nw[99]=0,Fw[99]=1,Gw[38]=0,Hw[38]=-1,Ww[38]=1,$w[38]=1,Kw[38]=0,Jw[38]=0,nS[38]=0,rS[38]=1,iS[38]=1,Qw[38]=0,tS[38]=1,eS[38]=0,Dw[38]=-1,Nw[38]=0,Fw[38]=1,zw[38]=-1,Bw[38]=0,jw[38]=0,Gw[39]=0,Hw[39]=1,Ww[39]=1,$w[39]=-1,Kw[39]=0,Jw[39]=0,nS[39]=0,rS[39]=-1,iS[39]=1,Qw[39]=0,tS[39]=1,eS[39]=0,Dw[39]=-1,Nw[39]=0,Fw[39]=1,zw[39]=1,Bw[39]=0,jw[39]=0;var oS=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},aS=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},sS=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},uS=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},lS=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},cS=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},hS=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},pS=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},fS=[],dS=[],mS=[],gS=[],yS=[],vS=[],_S=[],bS=[];gS[1]=yS[1]=18,gS[169]=yS[169]=18,mS[4]=dS[4]=12,mS[166]=dS[166]=12,fS[16]=bS[16]=4,fS[154]=bS[154]=4,vS[64]=_S[64]=22,vS[106]=_S[106]=22,mS[2]=vS[2]=17,gS[2]=yS[2]=18,mS[168]=vS[168]=17,gS[168]=yS[168]=18,fS[8]=gS[8]=9,dS[8]=mS[8]=12,fS[162]=gS[162]=9,dS[162]=mS[162]=12,fS[32]=bS[32]=4,dS[32]=_S[32]=1,fS[138]=bS[138]=4,dS[138]=_S[138]=1,yS[128]=bS[128]=21,vS[128]=_S[128]=22,yS[42]=bS[42]=21,vS[42]=_S[42]=22,dS[5]=yS[5]=14,dS[165]=yS[165]=14,mS[20]=bS[20]=6,mS[150]=bS[150]=6,fS[80]=vS[80]=11,fS[90]=vS[90]=11,gS[65]=_S[65]=3,gS[105]=_S[105]=3,fS[160]=vS[160]=11,dS[160]=yS[160]=14,fS[10]=vS[10]=11,dS[10]=yS[10]=14,mS[130]=bS[130]=6,gS[130]=_S[130]=3,mS[40]=bS[40]=6,gS[40]=_S[40]=3,dS[101]=_S[101]=1,dS[69]=_S[69]=1,yS[149]=bS[149]=21,yS[21]=bS[21]=21,mS[86]=vS[86]=17,mS[84]=vS[84]=17,fS[89]=gS[89]=9,fS[81]=gS[81]=9,fS[96]=_S[96]=0,dS[96]=vS[96]=15,fS[74]=_S[74]=0,dS[74]=vS[74]=15,fS[24]=mS[24]=8,gS[24]=bS[24]=7,fS[146]=mS[146]=8,gS[146]=bS[146]=7,dS[6]=vS[6]=15,mS[6]=yS[6]=16,dS[164]=vS[164]=15,mS[164]=yS[164]=16,gS[129]=bS[129]=7,yS[129]=_S[129]=20,gS[41]=bS[41]=7,yS[41]=_S[41]=20,mS[66]=_S[66]=2,gS[66]=vS[66]=19,mS[104]=_S[104]=2,gS[104]=vS[104]=19,fS[144]=yS[144]=10,vS[144]=bS[144]=23,fS[26]=yS[26]=10,vS[26]=bS[26]=23,dS[36]=bS[36]=5,mS[36]=_S[36]=2,dS[134]=bS[134]=5,mS[134]=_S[134]=2,fS[9]=yS[9]=10,dS[9]=gS[9]=13,fS[161]=yS[161]=10,dS[161]=gS[161]=13,dS[37]=bS[37]=5,yS[37]=_S[37]=20,dS[133]=bS[133]=5,yS[133]=_S[133]=20,mS[148]=yS[148]=16,vS[148]=bS[148]=23,mS[22]=yS[22]=16,vS[22]=bS[22]=23,fS[82]=mS[82]=8,gS[82]=vS[82]=19,fS[88]=mS[88]=8,gS[88]=vS[88]=19,fS[73]=_S[73]=0,dS[73]=gS[73]=13,fS[97]=_S[97]=0,dS[97]=gS[97]=13,fS[145]=gS[145]=9,yS[145]=bS[145]=21,fS[25]=gS[25]=9,yS[25]=bS[25]=21,dS[70]=_S[70]=1,mS[70]=vS[70]=17,dS[100]=_S[100]=1,mS[100]=vS[100]=17,fS[34]=gS[34]=9,dS[34]=mS[34]=12,yS[34]=bS[34]=21,vS[34]=_S[34]=22,fS[136]=bS[136]=4,dS[136]=_S[136]=1,mS[136]=vS[136]=17,gS[136]=yS[136]=18,fS[35]=bS[35]=4,dS[35]=mS[35]=12,gS[35]=yS[35]=18,vS[35]=_S[35]=22,fS[153]=bS[153]=4,gS[153]=yS[153]=18,dS[102]=mS[102]=12,vS[102]=_S[102]=22,fS[155]=gS[155]=9,yS[155]=bS[155]=23,dS[103]=_S[103]=1,mS[103]=vS[103]=17,fS[152]=bS[152]=4,mS[152]=vS[152]=17,gS[152]=yS[152]=18,fS[156]=mS[156]=8,gS[156]=yS[156]=18,vS[156]=bS[156]=23,fS[137]=bS[137]=4,dS[137]=_S[137]=1,gS[137]=yS[137]=18,fS[139]=bS[139]=4,dS[139]=gS[139]=13,yS[139]=_S[139]=20,fS[98]=gS[98]=9,dS[98]=mS[98]=12,vS[98]=_S[98]=22,fS[99]=_S[99]=0,dS[99]=mS[99]=12,gS[99]=vS[99]=19,dS[38]=mS[38]=12,yS[38]=bS[38]=21,vS[38]=_S[38]=22,dS[39]=bS[39]=5,mS[39]=yS[39]=16,vS[39]=_S[39]=22;var xS=[];function wS(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return function(t){return(t>0)-(t<0)||+t}(r*(n[1]-e[1])-o*i)}function SS(t,e){return e.geometry.coordinates[0].every((function(e){return Mw((0,__.xm)(e),t)}))}xS[1]=xS[169]=oS,xS[4]=xS[166]=aS,xS[16]=xS[154]=sS,xS[64]=xS[106]=uS,xS[168]=xS[2]=lS,xS[162]=xS[8]=cS,xS[138]=xS[32]=hS,xS[42]=xS[128]=pS,xS[5]=xS[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},xS[20]=xS[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},xS[80]=xS[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},xS[65]=xS[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},xS[160]=xS[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},xS[130]=xS[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},xS[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},xS[101]=xS[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},xS[149]=xS[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},xS[86]=xS[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},xS[89]=xS[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},xS[96]=xS[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},xS[24]=xS[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},xS[6]=xS[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},xS[129]=xS[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},xS[66]=xS[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},xS[144]=xS[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},xS[36]=xS[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},xS[9]=xS[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},xS[37]=xS[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},xS[148]=xS[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},xS[82]=xS[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},xS[73]=xS[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},xS[145]=xS[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},xS[70]=xS[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},xS[34]=function(t){return[pS(t),cS(t)]},xS[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},xS[136]=function(t){return[hS(t),lS(t)]},xS[153]=function(t){return[sS(t),oS(t)]},xS[102]=function(t){return[aS(t),uS(t)]},xS[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},xS[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},xS[152]=function(t){return[sS(t),lS(t)]},xS[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},xS[137]=function(t){return[hS(t),oS(t)]},xS[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},xS[98]=function(t){return[cS(t),uS(t)]},xS[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},xS[38]=function(t){return[aS(t),pS(t)]},xS[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};var ES=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=wS(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}();const MS=ES;var TS=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return(0,__.Tu)([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return wS(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}();const AS=TS;var CS=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=wS(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return(0,__.ot)(this.edges.map((function(t){return t.from.coordinates})))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=(0,__.yu)([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=(t=this.toPolygon(),(0,Cw.Z)((0,Ew.Z)(t)));var t},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach((function(e){var o,a,s,u,l,c,h=e.getEnvelope();if(r&&(n=r.getEnvelope()),a=i,s=(o=h).geometry.coordinates[0].map((function(t){return t[0]})),u=o.geometry.coordinates[0].map((function(t){return t[1]})),l=a.geometry.coordinates[0].map((function(t){return t[0]})),c=a.geometry.coordinates[0].map((function(t){return t[1]})),(Math.max.apply(null,s)!==Math.max.apply(null,l)||Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.min.apply(null,s)!==Math.min.apply(null,l)||Math.min.apply(null,u)!==Math.min.apply(null,c))&&SS(h,i)){for(var p=t.map((function(t){return t.from.coordinates})),f=void 0,d=function(t){e.some((function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r}))||(f=t)},m=0,g=p;m<g.length;m++)d(g[m]);f&&e.inside((0,__.xm)(f))&&(r&&!SS(n,h)||(r=e))}})),r},t.prototype.inside=function(t){return Mw(t,this.toPolygon())},t}();const OS=CS;function PS(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}!function(){function t(){this.edges=[],this.nodes={}}t.fromGeoJson=function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var n=new t;return(0,J_.nG)(e,(function(t){(0,K_.nK)(t,"LineString","Graph::fromGeoJson"),(0,J_.Lo)(t,(function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e}))})),n},t.prototype.getNode=function(t){var e=MS.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new MS(t)),n},t.prototype.addEdge=function(t,e){var n=new AS(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),n.forEach((function(t){return e._removeIfDangle(t)}))}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},t.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e}))},t.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var a=i[o],s=a.symetric,u=void 0,l=void 0;a.label===e&&(u=a),s.label===e&&(l=s),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new OS;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()}}(),s(2950),s(8788),s(2087);var kS={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||kS.heuristics.manhattan,o=r.closest||!1,a=new RS((function(t){return t.f})),s=e;for(e.h=i(e,n),a.push(e);a.size()>0;){var u=a.pop();if(u===n)return PS(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c<h;++c){var p=l[c];if(!p.closed&&!p.isWall()){var f=u.g+p.getCost(u),d=p.visited;(!d||f<p.g)&&(p.visited=!0,p.parent=u,p.h=p.h||i(p,n),p.g=f,p.f=p.g+p.h,t.markDirty(p),o&&(p.h<s.h||p.h===s.h&&p.g<s.g)&&(s=p),d?a.rescoreElement(p):a.push(p))}}}return o?PS(s):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};function LS(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new IS(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function IS(t,e,n){this.x=t,this.y=e,this.weight=n}function RS(t){this.content=[],this.scoreFunction=t}function DS(){this._=null}function NS(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function FS(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function zS(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function BS(t){for(;t.L;)t=t.L;return t}LS.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)kS.cleanNode(this.nodes[t])},LS.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)kS.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},LS.prototype.markDirty=function(t){this.dirtyNodes.push(t)},LS.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},LS.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,a=0,s=o.length;a<s;a++){for(t=[],n=0,r=(e=o[a]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},IS.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},IS.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},IS.prototype.isWall=function(){return 0===this.weight},RS.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,a=o-1,s=null;if(a<e){var u=this.content[a];(i=this.scoreFunction(u))<r&&(s=a)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===s?r:i)&&(s=o)}if(null===s)break;this.content[t]=this.content[s],this.content[s]=n,t=s}}},DS.prototype={constructor:DS,insert:function(t,e){var n,r,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;n=t}else this._?(t=BS(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(FS(this,n),n=(t=n).U),n.C=!1,r.C=!0,zS(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(zS(this,n),n=(t=n).U),n.C=!1,r.C=!0,FS(this,r)),n=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,n,r,i=t.U,o=t.L,a=t.R;if(n=o?a?BS(a):o:a,i?i.L===t?i.L=n:i.R=n:this._=n,o&&a?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==a?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=a,a.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,FS(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,zS(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,FS(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,zS(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,FS(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,zS(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};const jS=DS;function US(t,e,n,r){var i=[null,null],o=hE.push(i)-1;return i.left=t,i.right=e,n&&VS(i,t,e,n),r&&VS(i,e,t,r),lE[t.index].halfedges.push(o),lE[e.index].halfedges.push(o),i}function ZS(t,e,n){var r=[e,n];return r.left=t,r}function VS(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function GS(t,e,n,r,i){var o,a=t[0],s=t[1],u=a[0],l=a[1],c=0,h=1,p=s[0]-u,f=s[1]-l;if(o=e-u,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<h&&(h=o)}if(o=n-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=i-l,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}return!(c>0||h<1)||(c>0&&(t[0]=[u+c*p,l+c*f]),h<1&&(t[1]=[u+h*p,l+h*f]),!0)}}}}}function HS(t,e,n,r,i){var o=t[1];if(o)return!0;var a,s,u=t[0],l=t.left,c=t.right,h=l[0],p=l[1],f=c[0],d=c[1],m=(h+f)/2,g=(p+d)/2;if(d===p){if(m<e||m>=r)return;if(h>f){if(u){if(u[1]>=i)return}else u=[m,n];o=[m,i]}else{if(u){if(u[1]<n)return}else u=[m,i];o=[m,n]}}else if(s=g-(a=(h-f)/(d-p))*m,a<-1||a>1)if(h>f){if(u){if(u[1]>=i)return}else u=[(n-s)/a,n];o=[(i-s)/a,i]}else{if(u){if(u[1]<n)return}else u=[(i-s)/a,i];o=[(n-s)/a,n]}else if(p<d){if(u){if(u[0]>=r)return}else u=[e,a*e+s];o=[r,a*r+s]}else{if(u){if(u[0]<e)return}else u=[r,a*r+s];o=[e,a*e+s]}return t[0]=u,t[1]=o,!0}function WS(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function qS(t,e){return e[+(e.left!==t.site)]}function YS(t,e){return e[+(e.left===t.site)]}var XS,$S=[];function KS(){NS(this),this.x=this.y=this.arc=this.site=this.cy=null}function JS(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i[0],s=i[1],u=r[0]-a,l=r[1]-s,c=o[0]-a,h=o[1]-s,p=2*(u*h-l*c);if(!(p>=-fE)){var f=u*u+l*l,d=c*c+h*h,m=(h*f-l*d)/p,g=(u*d-c*f)/p,y=$S.pop()||new KS;y.arc=t,y.site=i,y.x=m+a,y.y=(y.cy=g+s)+Math.sqrt(m*m+g*g),t.circle=y;for(var v=null,_=cE._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}cE.insert(v,y),v||(XS=y)}}}}function QS(t){var e=t.circle;e&&(e.P||(XS=e.N),cE.remove(e),$S.push(e),NS(e),t.circle=null)}var tE=[];function eE(){NS(this),this.edge=this.site=this.circle=null}function nE(t){var e=tE.pop()||new eE;return e.site=t,e}function rE(t){QS(t),uE.remove(t),tE.push(t),NS(t)}function iE(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,a=t.N,s=[t];rE(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<pE&&Math.abs(r-u.circle.cy)<pE;)o=u.P,s.unshift(u),rE(u),u=o;s.unshift(u),QS(u);for(var l=a;l.circle&&Math.abs(n-l.circle.x)<pE&&Math.abs(r-l.circle.cy)<pE;)a=l.N,s.push(l),rE(l),l=a;s.push(l),QS(l);var c,h=s.length;for(c=1;c<h;++c)l=s[c],u=s[c-1],VS(l.edge,u.site,l.site,i);u=s[0],(l=s[h-1]).edge=US(u.site,l.site,null,i),JS(u),JS(l)}function oE(t){for(var e,n,r,i,o=t[0],a=t[1],s=uE._;s;)if((r=aE(s,a)-o)>pE)s=s.L;else{if(!((i=o-sE(s,a))>pE)){r>-pE?(e=s.P,n=s):i>-pE?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){lE[t.index]={site:t,halfedges:[]}}(t);var u=nE(t);if(uE.insert(e,u),e||n){if(e===n)return QS(e),n=nE(e.site),uE.insert(u,n),u.edge=n.edge=US(e.site,u.site),JS(e),void JS(n);if(n){QS(e),QS(n);var l=e.site,c=l[0],h=l[1],p=t[0]-c,f=t[1]-h,d=n.site,m=d[0]-c,g=d[1]-h,y=2*(p*g-f*m),v=p*p+f*f,_=m*m+g*g,b=[(g*v-f*_)/y+c,(p*_-m*v)/y+h];VS(n.edge,l,d,b),u.edge=US(l,t,null,b),n.edge=US(t,d,null,b),JS(e),JS(n)}else u.edge=US(e.site,u.site)}}function aE(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var s=(n=a.site)[0],u=n[1],l=u-e;if(!l)return s;var c=s-r,h=1/o-1/l,p=c/l;return h?(-p+Math.sqrt(p*p-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+r:(r+s)/2}function sE(t,e){var n=t.N;if(n)return aE(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var uE,lE,cE,hE,pE=1e-6,fE=1e-12;function dE(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function mE(t,e){return e[1]-t[1]||e[0]-t[0]}function gE(t,e){var n,r,i,o=t.sort(mE).pop();for(hE=[],lE=new Array(t.length),uE=new jS,cE=new jS;;)if(i=XS,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(oE(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;iE(i.arc)}if(function(){for(var t,e,n,r,i=0,o=lE.length;i<o;++i)if((t=lE[i])&&(r=(e=t.halfedges).length)){var a=new Array(r),s=new Array(r);for(n=0;n<r;++n)a[n]=n,s[n]=WS(t,hE[e[n]]);for(a.sort((function(t,e){return s[e]-s[t]})),n=0;n<r;++n)s[n]=e[a[n]];for(n=0;n<r;++n)e[n]=s[n]}}(),e){var a=+e[0][0],s=+e[0][1],u=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,o=hE.length;o--;)HS(i=hE[o],t,e,n,r)&&GS(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>pE||Math.abs(i[0][1]-i[1][1])>pE)||delete hE[o]}(a,s,u,l),function(t,e,n,r){var i,o,a,s,u,l,c,h,p,f,d,m,g=lE.length,y=!0;for(i=0;i<g;++i)if(o=lE[i]){for(a=o.site,s=(u=o.halfedges).length;s--;)hE[u[s]]||u.splice(s,1);for(s=0,l=u.length;s<l;)d=(f=YS(o,hE[u[s]]))[0],m=f[1],h=(c=qS(o,hE[u[++s%l]]))[0],p=c[1],(Math.abs(d-h)>pE||Math.abs(m-p)>pE)&&(u.splice(s,0,hE.push(ZS(a,f,Math.abs(d-t)<pE&&r-m>pE?[t,Math.abs(h-t)<pE?p:r]:Math.abs(m-r)<pE&&n-d>pE?[Math.abs(p-r)<pE?h:n,r]:Math.abs(d-n)<pE&&m-e>pE?[n,Math.abs(h-n)<pE?p:e]:Math.abs(m-e)<pE&&d-t>pE?[Math.abs(p-e)<pE?h:t,e]:null))-1),++l);l&&(y=!1)}if(y){var v,_,b,x=1/0;for(i=0,y=null;i<g;++i)(o=lE[i])&&(b=(v=(a=o.site)[0]-t)*v+(_=a[1]-e)*_)<x&&(x=b,y=o);if(y){var w=[t,e],S=[t,r],E=[n,r],M=[n,e];y.halfedges.push(hE.push(ZS(a=y.site,w,S))-1,hE.push(ZS(a,S,E))-1,hE.push(ZS(a,E,M))-1,hE.push(ZS(a,M,w))-1)}}for(i=0;i<g;++i)(o=lE[i])&&(o.halfedges.length||delete lE[i])}(a,s,u,l)}this.edges=hE,this.cells=lE,uE=cE=hE=lE=null}function yE(){return new vE}function vE(){this.reset()}gE.prototype={constructor:gE,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return qS(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(o=(i=n.halfedges).length)for(var i,o,a,s=n.site,u=-1,l=e[i[o-1]],c=l.left===s?l.right:l.left;++u<o;)a=c,c=(l=e[i[u]]).left===s?l.right:l.left,a&&c&&r<a.index&&r<c.index&&dE(s,a,c)<0&&t.push([s.data,a.data,c.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,i,o=this,a=o._found||0,s=o.cells.length;!(i=o.cells[a]);)if(++a>=s)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[r=a],a=null,i.halfedges.forEach((function(n){var r=o.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=t-s[0],l=e-s[1],h=u*u+l*l;h<c&&(c=h,a=s.index)}}))}while(null!==a);return o._found=r,null==n||c<=n*n?i.site:null}},s(7516),s(9055),vE.prototype={constructor:vE,reset:function(){this.s=this.t=0},add:function(t){bE(_E,t,this.t),bE(this,_E.s,this.s),this.s?this.t+=_E.t:this.s=_E.t},valueOf:function(){return this.s}};var _E=new vE;function bE(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var xE=Math.PI,wE=xE/2,SE=2*xE,EE=xE/180,ME=(Math.abs,Math.atan),TE=Math.atan2,AE=Math.cos,CE=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),OE=(Math.sign,Math.sqrt);Math.tan;function PE(t){return t>1?wE:t<-1?-wE:Math.asin(t)}function kE(t,e){return[t>xE?t-SE:t<-xE?t+SE:t,e]}yE(),yE(),yE(),kE.invert=kE;s(937),yE();function LE(){}function IE(t){return function(e,n){var r=AE(e),i=AE(n),o=t(r*i);return[o*i*CE(e),o*CE(n)]}}function RE(t){return function(e,n){var r=OE(e*e+n*n),i=t(r),o=CE(i),a=AE(i);return[TE(e*o,r*a),PE(r&&n*o/r)]}}yE(),yE(),yE(),yE(),LE.prototype={constructor:LE,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()}},AE(30*EE),IE((function(t){return OE(2/(1+t))})).invert=RE((function(t){return 2*PE(t/2)}));var DE=IE((function(t){return(t=function(t){return t>1?0:t<-1?xE:Math.acos(t)}(t))&&t/CE(t)}));function NE(t,e){return[t,e]}DE.invert=RE((function(t){return t})),NE.invert=NE,RE(ME),RE(PE),RE((function(t){return 2*ME(t)})),s(9349);var FE=s(2721);const{Search:zE}=FE.Input,BE=t=>{const{data:e}=t;return o.createElement("div",{className:"gi-properties-pannel"},o.createElement("h3",null,e.id),o.createElement(zE,{placeholder:"Search in the properties",onSearch:()=>{},style:{width:"100%"}}),o.createElement("ul",null,Object.keys(e).map((t=>{let n=e[t],r=!1;return"object"==typeof n&&(n=JSON.stringify(n,null,2),r=!0),o.createElement("li",{key:t},o.createElement("div",{className:"key"},t),o.createElement("div",{className:"value"},r?o.createElement("pre",null,n):n))}))))};var jE=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const UE=t=>{const{mapInstance:e,geoData:n,updateState:r}=t,{config:o,services:s}=(0,i.useContext)(),u=a().useMemo((()=>{try{return o.components.find((t=>"PropertiesPanel"===t.id)).props.serviceId}catch(t){return}}),[o]);if(!u)return null;const l=i.utils.getService(s,u);if(!l)return null;const[c,h]=a().useState({visible:!1,detail:null,isLoading:!1});a().useLayoutEffect((()=>{const t=t=>jE(void 0,void 0,void 0,(function*(){h((t=>Object.assign(Object.assign({},t),{visible:!0,isLoading:!0})));const e=t.feature,n=yield l(e);h((t=>Object.assign(Object.assign({},t),{detail:n,isLoading:!1})))})),n=t=>jE(void 0,void 0,void 0,(function*(){h((t=>Object.assign(Object.assign({},t),{visible:!0,isLoading:!0})));const e=t.feature,n=yield l(e);h((t=>Object.assign(Object.assign({},t),{detail:n,isLoading:!1})))}));if(!e)return;const r=e.layerGroup.getLayerByName("node"),i=e.layerGroup.getLayerByName("edge");return r&&i&&(r.on("click",t),i.on("click",n)),()=>{r&&i&&(r.off("click",t),i.off("click",n))}}),[n]);const{visible:p,detail:f,isLoading:d}=c,m=!d&&f?a().createElement(BE,{data:f}):a().createElement(FE.Skeleton,{active:!0});return a().createElement(FE.Drawer,{visible:p,placement:"right",onClose:()=>{h((t=>t.visible?{visible:!1,isLoading:!1,detail:null}:t))},title:i_({id:"scene.MapMode.PropertiesPanel.Component.PropertiesPanel",dm:"属性面板"}),width:"356px",style:{marginTop:"61px"},mask:!1,bodyStyle:{padding:"12px 24px"}},m)},{GIAComponent:ZE,deepClone:VE}=i.extra,GE=t=>{const{GIAC:e,config:n,handleBrush:r,handleSwitchMap:i,handleToggleMap:a}=t,s=o.useMemo((()=>{const t=VE(e);return t.icon="icon-highlight",t.title=i_({id:"scene.MapMode.Toolbar.CircleSelection",dm:"圈选"}),t.tooltipPlacement="right",t}),[e]),u=o.useMemo((()=>{const t=VE(e);return t.icon="icon-location",t.title=i_({id:"scene.MapMode.Toolbar.ReturnToNetgraphMode",dm:"返回网图模式"}),t.tooltipPlacement="right",t}),[e]),l=o.useMemo((()=>{const t=VE(e);return t.icon="icon-fullscreen",t.title=i_({id:"scene.MapMode.Toolbar.SmallWindow",dm:"小窗"}),t.tooltipPlacement="right",t}),[e]),{direction:c,positionStyles:h}=Xv(n);return o.createElement("div",null,o.createElement(Yv,{direction:c,style:h},o.createElement(ZE,{GIAC:u,onClick:i}),o.createElement(ZE,{GIAC:l,onClick:a}),o.createElement(ZE,{GIAC:s,onClick:r})))},{deepClone:HE}=i.extra,WE=t=>{const{theme:e,type:n,maxSize:r,minSize:a,placement:s,offset:u,longitudeKey:l,latitudeKey:c,setVisible:h}=t,p=(0,i.useContext)(),{data:f,graph:d,config:m,GISDK_ID:g,apis:y}=p,{color:v}=m.nodes&&m.nodes[0].props||{},[_,b]=o.useState({isReady:!1,mapInstance:void 0,toggle:!1,drawbox:void 0}),{handleClick:x,GIAC:w}=t,S=o.useMemo((()=>f.nodes.filter((t=>{const e=t.data;return!(!e[l]||!e[c])})).map((t=>{const e=t.data;let n=e[l],r=e[c];if("string"==typeof n||"string"==typeof r)try{n=Number(JSON.parse(n)),r=Number(JSON.parse(r))}catch(t){console.log("error",t)}return Object.assign(Object.assign({},t),{location:[n,r]})}))),[f]),E=o.useMemo((()=>d.getEdges().filter((t=>{t.get("model");const e=t.get("source").get("model"),n=t.get("target").get("model");return!!(e.data[l]&&e.data[c]&&n.data[l]&&n.data[c])})).map((t=>{const e=t.get("model"),n=t.get("source").get("model"),r=t.get("target").get("model");let i=n.data[l],o=n.data[c],a=r.data[l],s=r.data[c];if("string"==typeof i||"string"==typeof o||"string"==typeof a||"string"==typeof s)try{i=Number(JSON.parse(i)),o=Number(JSON.parse(o)),a=Number(JSON.parse(a)),s=Number(JSON.parse(s))}catch(t){console.log("error",t)}return Object.assign(Object.assign({},e),{lnglat:[[i,o],[a,s]]})}))),[f]);if(0===S.length)return FE.notification.warn({message:i_({id:"scene.MapMode.L7Map.TheDataFormatDoesNot",dm:"数据格式不合要求"}),description:i_({id:"scene.MapMode.L7Map.CheckWhetherTheSourceData",dm:"请检查源数据是否有经纬度字段,或者检查「配置面板」,是否指定了经纬度坐标"})}),console.info("%c invalid data","color:red","nodes has no longitude or latitude field"),h(!1),null;console.log(S,E),o.useEffect((()=>{const t=S[0].location,r=0!==E.length,i={map:{type:n,style:e,center:t,zoom:15,pitch:0},layers:[...r?[{name:"edge",type:"pathLayer",source:{data:E,parser:{type:"json",coordinates:"lnglat"}},color:"#ddd",size:1,style:{opacity:1}}]:[],{name:"node",type:"dotLayer",shape:"circle",source:{data:S,parser:{type:"json",coordinates:"location"}},color:{field:"type",value:({type:t})=>v},state:{select:{color:"red",size:20}},size:10,style:{opacity:.8}},{name:"text",type:"textLayer",shape:"text",field:"id",source:{data:S,parser:{type:"json",coordinates:"location"}},style:{fontSize:20,fill:"#000",textAnchor:"bottom",textOffset:[0,-20]}}]},o=new Sw.L7Plot("map-container",i);return o.on("loaded",(()=>{const t=o.getScene(),e=new ww(t);e.on("draw.boxselect",(t=>{const{endPoint:e,startPoint:n}=t,r=Cw.Z([n.lng,n.lat,e.lng,e.lat]),i=S.filter((t=>Mw(__.xm(t.location),r)));b((t=>Object.assign(Object.assign({},t),{toggle:!0}))),setTimeout((()=>{const t=i.map((t=>t.id));y.focusNodeById(t[0]||""),f.nodes.forEach((e=>{t.includes(e.id)?d.setItemState(e.id,"selected",!0):d.setItemState(e.id,"inactive",!0)})),f.edges.forEach((e=>{const{source:n,target:r}=e;t.includes(n)&&t.includes(r)?d.setItemState(e.id,"selected",!0):d.setItemState(e.id,"inactive",!0)}))}),0)})),b((t=>Object.assign(Object.assign({},t),{isReady:!0,mapInstance:o,drawbox:e})))})),()=>{o.destroy()}}),[n,e]);const{isReady:M,mapInstance:T,toggle:A}=_,C=o.createElement(Wv,{toggle:A,maxSize:r,minSize:a,offset:u,placement:s},o.createElement("div",{id:"map-container",style:{position:"absolute",left:"0px",right:"0px",bottom:"0px",top:"0px"}},o.createElement("div",{style:{position:"absolute",left:"0px",top:"0px",zIndex:9999}},o.createElement(GE,{config:m,GIAC:w,handleBrush:()=>{const{drawbox:t}=_;t&&t.enable()},handleSwitchMap:x,handleToggleMap:()=>{b((t=>Object.assign(Object.assign({},t),{toggle:!t.toggle})))}}),M&&o.createElement(UE,{mapInstance:T,geoData:S,updateState:b})))),O=document.getElementById(`${g}-graphin-container`);return o.createElement("div",null,om().createPortal(C,O))},{GIAComponent:qE}=i.extra,YE={id:"MapMode",name:i_({id:"scene.src.MapMode.info.MapMode",dm:"地图模式"}),desc:i_({id:"scene.src.MapMode.info.MapTheGeographicCoordinatesOf",dm:"将节点的地理坐标映射到地图上"}),icon:"icon-global",cover:"http://xxxx.jpg",category:"scene-analysis",type:"GIAC",docs:"https://www.yuque.com/antv/gi/kbpiuu1inefxgdtg"},{GIAC_METAS:XE,deepClone:$E}=i.extra,KE=$E(XE);KE.GIAC.properties.GIAC.properties.title.default=YE.name,KE.GIAC.properties.GIAC.properties.isShowTitle.default=!1,KE.GIAC.properties.GIAC.properties.icon.default=YE.icon,KE.GIAC.properties.GIAC.properties.isVertical.default=!0,KE.GIAC.properties.GIAC.properties.tooltipPlacement.default="right";const JE={info:YE,component:t=>{const e=Object.assign({},t.GIAC),{visible:n,theme:r,type:i,minSize:a,maxSize:s,placement:u,offset:l,latitudeKey:c,longitudeKey:h}=t,[p,f]=o.useState(n);return e.title=i_(p?{id:"scene.src.MapMode.Component.SwitchToNetmap",dm:"切换至网图"}:{id:"scene.src.MapMode.Component.SwitchToMap",dm:"切换至地图"}),o.createElement("div",null,o.createElement(qE,{GIAC:e,onClick:()=>{f(!0)}}),p&&o.createElement(WE,{setVisible:f,latitudeKey:c,longitudeKey:h,minSize:a,maxSize:s,placement:u,offset:l,theme:r,type:i,GIAC:e,handleClick:()=>{f(!1)}}))},registerMeta:t=>{const{keys:e}=t,n=e.map((t=>({label:t,value:t})));return Object.assign({visible:{title:i_({id:"scene.src.MapMode.registerMeta.DefaultDisplay",dm:"默认显示"}),type:"string","x-decorator":"FormItem","x-component":"Switch",default:!1},type:{type:"string",title:i_({id:"scene.src.MapMode.registerMeta.MapType",dm:"地图类型"}),"x-decorator":"FormItem","x-component":"Select","x-component-props":{options:[{label:i_({id:"scene.src.MapMode.registerMeta.Amap",dm:"高德"}),value:"amap"},{label:"MapBox",value:"mapbox"}]},default:"amap"},theme:{type:"string",title:i_({id:"scene.src.MapMode.registerMeta.Theme",dm:"主题"}),"x-decorator":"FormItem","x-component":"Select","x-component-props":{options:[{label:i_({id:"scene.src.MapMode.registerMeta.Bright",dm:"明亮"}),value:"light"},{label:i_({id:"scene.src.MapMode.registerMeta.Darkness",dm:"黑暗"}),value:"dark"}]},default:"light"},minSize:{type:"string",title:i_({id:"scene.src.MapMode.registerMeta.MinimumSize",dm:"最小尺寸"}),"x-decorator":"FormItem","x-component":"Input",default:"20%"},maxSize:{type:"string",title:i_({id:"scene.src.MapMode.registerMeta.MaximumSize",dm:"最大尺寸"}),"x-decorator":"FormItem","x-component":"Input",default:"100%"},placement:{title:i_({id:"scene.src.MapMode.registerMeta.PlacementOrientation",dm:"放置方位"}),type:"string",default:"RB","x-decorator":"FormItem","x-component":"Select","x-component-props":{options:[{value:"LT",label:i_({id:"scene.src.MapMode.registerMeta.TopLeftTop",dm:"左上 / top"})},{value:"RT",label:i_({id:"scene.src.MapMode.registerMeta.TopRightRight",dm:"右上 / right"})},{value:"LB",label:i_({id:"scene.src.MapMode.registerMeta.LowerLeftLeft",dm:"左下 / left"})},{value:"RB",label:i_({id:"scene.src.MapMode.registerMeta.BottomRightBottom",dm:"右下 / bottom"})}]}},offset:{title:i_({id:"scene.src.MapMode.registerMeta.OffsetDistance",dm:"偏移距离"}),type:"string","x-decorator":"FormItem","x-component":"Offset","x-component-props":{min:0,max:400},default:[0,0]},longitudeKey:{type:"string",title:i_({id:"scene.src.MapMode.registerMeta.LongitudeField",dm:"经度字段"}),"x-decorator":"FormItem","x-component":"Select","x-component-props":{options:n},default:"longitude"},latitudeKey:{type:"string",title:i_({id:"scene.src.MapMode.registerMeta.LatitudeField",dm:"纬度字段"}),"x-decorator":"FormItem","x-component":"Select","x-component-props":{options:n},default:"latitude"}},KE)}},QE=[{label:i_({id:"scene.src.Timebar.constant.Seconds",dm:"秒"}),value:"second"},{label:i_({id:"scene.src.Timebar.constant.Days",dm:"天"}),value:"day"},{label:i_({id:"scene.src.Timebar.constant.Month",dm:"月"}),value:"month"},{label:i_({id:"scene.src.Timebar.constant.Year",dm:"年"}),value:"year"}],tM=[{label:i_({id:"scene.control.animation.constants.MovingTimeWindow",dm:"移动时间窗口"}),value:"moveTime"},{label:i_({id:"scene.control.animation.constants.CumulativeTimeWindow",dm:"累积时间窗口"}),value:"cumulativeTime"}],eM=[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}],nM={id:"Timebar",name:i_({id:"scene.src.Timebar.info.TimelineController",dm:"时间线控制器"}),desc:i_({id:"scene.src.Timebar.info.TimelineController",dm:"时间线控制器"}),cover:"http://xxx.jpg",category:"scene-analysis",icon:"icon-signal-fill",type:"GIAC_CONTENT"},{deepClone:rM,GIAC_CONTENT_METAS:iM}=i.extra,oM=rM(iM);oM.GIAC_CONTENT.properties.GIAC_CONTENT.properties.title.default=nM.name,oM.GIAC_CONTENT.properties.GIAC_CONTENT.properties.icon.default=nM.icon;var aM=s(7768),sM=s(4633),uM=s.n(sM);const lM=function(t){var e=(0,o.useRef)(t);return e.current=t,e},cM=function(t){var e=lM(t);(0,o.useEffect)((function(){return function(){e.current()}}),[])};var hM=s(7127),pM=s(3659);const fM={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"};var dM=s(5162),mM=s(6297),gM=s(2718),yM=s(1838),vM=s.n(yM);const _M=(0,o.createContext)({});var bM=s(7743);function xM(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function wM(t){return t<=1?"".concat(100*Number(t),"%"):t}function SM(t){return 1===t.length?"0"+t:String(t)}function EM(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*n*(e-t):n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function MM(t){return TM(t)/255}function TM(t){return parseInt(t,16)}var AM={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function CM(t){var e,n,r,i={r:0,g:0,b:0},o=1,a=null,s=null,u=null,l=!1,c=!1;return"string"==typeof t&&(t=function(t){if(0===(t=t.trim().toLowerCase()).length)return!1;var e=!1;if(AM[t])t=AM[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};var n=LM.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=LM.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=LM.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=LM.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=LM.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=LM.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=LM.hex8.exec(t))?{r:TM(n[1]),g:TM(n[2]),b:TM(n[3]),a:MM(n[4]),format:e?"name":"hex8"}:(n=LM.hex6.exec(t))?{r:TM(n[1]),g:TM(n[2]),b:TM(n[3]),format:e?"name":"hex"}:(n=LM.hex4.exec(t))?{r:TM(n[1]+n[1]),g:TM(n[2]+n[2]),b:TM(n[3]+n[3]),a:MM(n[4]+n[4]),format:e?"name":"hex8"}:!!(n=LM.hex3.exec(t))&&{r:TM(n[1]+n[1]),g:TM(n[2]+n[2]),b:TM(n[3]+n[3]),format:e?"name":"hex"}}(t)),"object"==typeof t&&(IM(t.r)&&IM(t.g)&&IM(t.b)?(e=t.r,n=t.g,r=t.b,i={r:255*xM(e,255),g:255*xM(n,255),b:255*xM(r,255)},l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):IM(t.h)&&IM(t.s)&&IM(t.v)?(a=wM(t.s),s=wM(t.v),i=function(t,e,n){t=6*xM(t,360),e=xM(e,100),n=xM(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),u=r%6;return{r:255*[n,a,o,o,s,n][u],g:255*[s,n,n,a,o,o][u],b:255*[o,o,s,n,n,a][u]}}(t.h,a,s),l=!0,c="hsv"):IM(t.h)&&IM(t.s)&&IM(t.l)&&(a=wM(t.s),u=wM(t.l),i=function(t,e,n){var r,i,o;if(t=xM(t,360),e=xM(e,100),n=xM(n,100),0===e)i=n,o=n,r=n;else{var a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;r=EM(s,a,t+1/3),i=EM(s,a,t),o=EM(s,a,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,a,u),l=!0,c="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(o=t.a)),o=function(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}(o),{ok:l,format:t.format||c,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}var OM="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),PM="[\\s|\\(]+(".concat(OM,")[,|\\s]+(").concat(OM,")[,|\\s]+(").concat(OM,")\\s*\\)?"),kM="[\\s|\\(]+(".concat(OM,")[,|\\s]+(").concat(OM,")[,|\\s]+(").concat(OM,")[,|\\s]+(").concat(OM,")\\s*\\)?"),LM={CSS_UNIT:new RegExp(OM),rgb:new RegExp("rgb"+PM),rgba:new RegExp("rgba"+kM),hsl:new RegExp("hsl"+PM),hsla:new RegExp("hsla"+kM),hsv:new RegExp("hsv"+PM),hsva:new RegExp("hsva"+kM),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 IM(t){return Boolean(LM.CSS_UNIT.exec(String(t)))}var RM=2,DM=.16,NM=.05,FM=.05,zM=.15,BM=5,jM=4,UM=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function ZM(t){var e=function(t,e,n){t=xM(t,255),e=xM(e,255),n=xM(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o=0,a=r,s=r-i,u=0===r?0:s/r;if(r===i)o=0;else{switch(r){case t:o=(e-n)/s+(e<n?6:0);break;case e:o=(n-t)/s+2;break;case n:o=(t-e)/s+4}o/=6}return{h:o,s:u,v:a}}(t.r,t.g,t.b);return{h:360*e.h,s:e.s,v:e.v}}function VM(t){var e=t.r,n=t.g,r=t.b;return"#".concat(function(t,e,n,r){var i=[SM(Math.round(t).toString(16)),SM(Math.round(e).toString(16)),SM(Math.round(n).toString(16))];return i.join("")}(e,n,r))}function GM(t,e,n){var r;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-RM*e:Math.round(t.h)+RM*e:n?Math.round(t.h)+RM*e:Math.round(t.h)-RM*e)<0?r+=360:r>=360&&(r-=360),r}function HM(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-DM*e:e===jM?t.s+DM:t.s+NM*e)>1&&(r=1),n&&e===BM&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function WM(t,e,n){var r;return(r=n?t.v+FM*e:t.v-zM*e)>1&&(r=1),Number(r.toFixed(2))}function qM(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=CM(t),i=BM;i>0;i-=1){var o=ZM(r),a=VM(CM({h:GM(o,i,!0),s:HM(o,i,!0),v:WM(o,i,!0)}));n.push(a)}n.push(VM(r));for(var s=1;s<=jM;s+=1){var u=ZM(r),l=VM(CM({h:GM(u,s),s:HM(u,s),v:WM(u,s)}));n.push(l)}return"dark"===e.theme?UM.map((function(t){var r=t.index,i=t.opacity,o=VM(function(t,e,n){var r=n/100;return{r:(e.r-t.r)*r+t.r,g:(e.g-t.g)*r+t.g,b:(e.b-t.b)*r+t.b}}(CM(e.backgroundColor||"#141414"),CM(n[r]),100*i));return o})):n}var YM={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},XM={},$M={};Object.keys(YM).forEach((function(t){XM[t]=qM(YM[t]),XM[t].primary=XM[t][5],$M[t]=qM(YM[t],{theme:"dark",backgroundColor:"#141414"}),$M[t].primary=$M[t][5]})),XM.red,XM.volcano,XM.gold,XM.orange,XM.yellow,XM.lime,XM.green,XM.cyan,XM.blue,XM.geekblue,XM.purple,XM.magenta,XM.grey;var KM={},JM=[];function QM(t,e){}function tT(t,e){}function eT(t,e,n){e||KM[n]||(t(!1,n),KM[n]=!0)}function nT(t,e){eT(QM,t,e)}nT.preMessage=function(t){JM.push(t)},nT.resetWarned=function(){KM={}},nT.noteOnce=function(t,e){eT(tT,t,e)};const rT=nT;var iT="data-rc-order",oT="rc-util-key",aT=new Map;function sT(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return t?t.startsWith("data-")?t:"data-".concat(t):oT}function uT(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function lT(t){return Array.from((aT.get(t)||t).children).filter((function(t){return"STYLE"===t.tagName}))}function cT(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof window||!window.document||!window.document.createElement)return null;var n=e.csp,r=e.prepend,i=document.createElement("style");i.setAttribute(iT,function(t){return"queue"===t?"prependQueue":t?"prepend":"append"}(r)),null!=n&&n.nonce&&(i.nonce=null==n?void 0:n.nonce),i.innerHTML=t;var o=uT(e),a=o.firstChild;if(r){if("queue"===r){var s=lT(o).filter((function(t){return["prepend","prependQueue"].includes(t.getAttribute(iT))}));if(s.length)return o.insertBefore(i,s[s.length-1].nextSibling),i}o.insertBefore(i,a)}else o.appendChild(i);return i}function hT(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(t,e){var n=aT.get(t);if(!n||!function(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}(document,n)){var r=cT("",e),i=r.parentNode;aT.set(t,i),t.removeChild(r)}}(uT(n),n);var r,i,o,a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return lT(uT(e)).find((function(n){return n.getAttribute(sT(e))===t}))}(e,n);if(a)return null!==(r=n.csp)&&void 0!==r&&r.nonce&&a.nonce!==(null===(i=n.csp)||void 0===i?void 0:i.nonce)&&(a.nonce=null===(o=n.csp)||void 0===o?void 0:o.nonce),a.innerHTML!==t&&(a.innerHTML=t),a;var s=cT(t,n);return s.setAttribute(sT(n),e),s}function pT(t){return"object"===(0,bM.Z)(t)&&"string"==typeof t.name&&"string"==typeof t.theme&&("object"===(0,bM.Z)(t.icon)||"function"==typeof t.icon)}function fT(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).reduce((function(e,n){var r=t[n];return"class"===n?(e.className=r,delete e.class):e[n]=r,e}),{})}function dT(t,e,n){return n?a().createElement(t.tag,(0,pM.Z)((0,pM.Z)({key:e},fT(t.attrs)),n),(t.children||[]).map((function(n,r){return dT(n,"".concat(e,"-").concat(t.tag,"-").concat(r))}))):a().createElement(t.tag,(0,pM.Z)({key:e},fT(t.attrs)),(t.children||[]).map((function(n,r){return dT(n,"".concat(e,"-").concat(t.tag,"-").concat(r))})))}function mT(t){return qM(t)[0]}function gT(t){return t?Array.isArray(t)?t:[t]:[]}var yT=["icon","className","onClick","style","primaryColor","secondaryColor"],vT={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},_T=function(t){var e,n,r=t.icon,i=t.className,a=t.onClick,s=t.style,u=t.primaryColor,l=t.secondaryColor,c=(0,gM.Z)(t,yT),h=vT;if(u&&(h={primaryColor:u,secondaryColor:l||mT(u)}),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",e=(0,o.useContext)(_M).csp;(0,o.useEffect)((function(){hT(t,"@ant-design-icons",{prepend:!0,csp:e})}),[])}(),e=pT(r),n="icon should be icon definiton, but got ".concat(r),rT(e,"[@ant-design/icons] ".concat(n)),!pT(r))return null;var p=r;return p&&"function"==typeof p.icon&&(p=(0,pM.Z)((0,pM.Z)({},p),{},{icon:p.icon(h.primaryColor,h.secondaryColor)})),dT(p.icon,"svg-".concat(p.name),(0,pM.Z)({className:i,onClick:a,style:s,"data-icon":p.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},c))};_T.displayName="IconReact",_T.getTwoToneColors=function(){return(0,pM.Z)({},vT)},_T.setTwoToneColors=function(t){var e=t.primaryColor,n=t.secondaryColor;vT.primaryColor=e,vT.secondaryColor=n||mT(e),vT.calculated=!!n};const bT=_T;function xT(t){var e=gT(t),n=(0,dM.Z)(e,2),r=n[0],i=n[1];return bT.setTwoToneColors({primaryColor:r,secondaryColor:i})}var wT=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];xT("#1890ff");var ST=o.forwardRef((function(t,e){var n,r=t.className,i=t.icon,a=t.spin,s=t.rotate,u=t.tabIndex,l=t.onClick,c=t.twoToneColor,h=(0,gM.Z)(t,wT),p=o.useContext(_M).prefixCls,f=void 0===p?"anticon":p,d=vM()(f,(n={},(0,mM.Z)(n,"".concat(f,"-").concat(i.name),!!i.name),(0,mM.Z)(n,"".concat(f,"-spin"),!!a||"loading"===i.name),n),r),m=u;void 0===m&&l&&(m=-1);var g=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,y=gT(c),v=(0,dM.Z)(y,2),_=v[0],b=v[1];return o.createElement("span",(0,pM.Z)((0,pM.Z)({role:"img","aria-label":i.name},h),{},{ref:e,tabIndex:m,onClick:l,className:d}),o.createElement(bT,{icon:i,primaryColor:_,secondaryColor:b,style:g}))}));ST.displayName="AntdIcon",ST.getTwoToneColor=function(){var t=bT.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},ST.setTwoToneColor=xT;const ET=ST;var MT=function(t,e){return o.createElement(ET,(0,pM.Z)((0,pM.Z)({},t),{},{ref:e,icon:fM}))};MT.displayName="ClockCircleOutlined";const TT=o.forwardRef(MT);const AT=(CT=o.useEffect,function(t,e){var n=(0,o.useRef)(!1);CT((function(){return function(){n.current=!1}}),[]),CT((function(){if(n.current)return t();n.current=!0}),e)});var CT;const OT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"}}]},name:"column-width",theme:"outlined"};var PT=function(t,e){return o.createElement(ET,(0,pM.Z)((0,pM.Z)({},t),{},{ref:e,icon:OT}))};PT.displayName="ColumnWidthOutlined";const kT=o.forwardRef(PT),LT={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28zm-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14 0-5.2-2.1-10.4-6.2-14z"}}]},name:"forward",theme:"outlined"};var IT=function(t,e){return o.createElement(ET,(0,pM.Z)((0,pM.Z)({},t),{},{ref:e,icon:LT}))};IT.displayName="ForwardOutlined";const RT=o.forwardRef(IT),DT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 176h80v672h-80zm408 0h-64c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8z"}}]},name:"pause",theme:"outlined"};var NT=function(t,e){return o.createElement(ET,(0,pM.Z)((0,pM.Z)({},t),{},{ref:e,icon:DT}))};NT.displayName="PauseOutlined";const FT=o.forwardRef(NT),zT={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};var BT=function(t,e){return o.createElement(ET,(0,pM.Z)((0,pM.Z)({},t),{},{ref:e,icon:zT}))};BT.displayName="CaretRightOutlined";const jT=o.forwardRef(BT),UT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};var ZT=function(t,e){return o.createElement(ET,(0,pM.Z)((0,pM.Z)({},t),{},{ref:e,icon:UT}))};ZT.displayName="ReloadOutlined";const VT=o.forwardRef(ZT),GT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M952 224h-52c-4.4 0-8 3.6-8 8v248h-92V304c0-4.4-3.6-8-8-8H232c-4.4 0-8 3.6-8 8v176h-92V232c0-4.4-3.6-8-8-8H72c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V548h92v172c0 4.4 3.6 8 8 8h560c4.4 0 8-3.6 8-8V548h92v244c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zM296 368h88v288h-88V368zm432 288H448V368h280v288z"}}]},name:"box-plot",theme:"outlined"};var HT=function(t,e){return o.createElement(ET,(0,pM.Z)((0,pM.Z)({},t),{},{ref:e,icon:GT}))};HT.displayName="BoxPlotOutlined";const WT=o.forwardRef(HT),qT=(t,e)=>{if((0,hM.Z)(t))return{startKey:0,endKey:0,steps:1};let n=0,r=0;for(let i=0;i<t.length;i++)t[i]===e[0]&&(n=i),t[i]===e[1]&&(r=i);return{startKey:n,endKey:r,steps:r-n}},YT=t=>{const{className:e,setSelection:n,selection:r,timebar:i,defaultSpeed:s=1,initialSelection:u,onReset:l}=t,[c,h]=(0,o.useState)("moveTime"),[p,f]=(0,o.useState)(1),[d,m]=(0,o.useState)(!1),g=(0,o.useRef)(null),y=(0,o.useMemo)((()=>{const{steps:t}=qT(i,u);return t}),[u,i]),v=t=>{g.current&&(window.cancelAnimationFrame(g.current),g.current=null);const{speed:e=1,timeWindowType:r,selection:o,playback:a}=t;if(e>0){const t=1e4/(y||1)/(e||1);let s=(new Date).getTime();const u=()=>{if((new Date).getTime()-s>=t){s=(new Date).getTime();const t=((t,e,n="moveTime",r=!1)=>{if(0===t.length)return;const{startKey:i,endKey:o,steps:a}=qT(t,e);return o===t.length-1?["moveTime"===n?t[0]:t[i],"moveTime"===n?t[a]:t[i+1]]:"moveTime"===n?r?[t[0],t[a]]:[t[i+1],t[o+1]]:r?[t[i],t[i+1]]:[t[i],t[o+1]]})(i,o,r,a);t&&n(t)}else g.current=window.requestAnimationFrame(u)};g.current=window.requestAnimationFrame(u)}},_=()=>{r&&(m(!d),d?g.current&&(window.cancelAnimationFrame(g.current),g.current=null):v({speed:p,timeWindowType:c,selection:r}))};(0,o.useEffect)((()=>{s&&f(s)}),[s]),(0,o.useEffect)((()=>{d&&r&&v({speed:p,timeWindowType:c,selection:r})}),[r]);const b=a().createElement(FE.Radio.Group,{onChange:t=>(t=>{h(t),d&&r&&v({speed:p,timeWindowType:t,selection:r})})(t.target.value),value:c},a().createElement(FE.Space,{direction:"vertical"},tM.map((t=>a().createElement(FE.Radio,{key:t.value,value:t.value},t.label))))),x=a().createElement(FE.Radio.Group,{onChange:t=>(t=>{f(t),d&&r&&v({speed:t,timeWindowType:c,selection:r})})(t.target.value),value:p},a().createElement(FE.Space,{direction:"vertical"},eM.map((t=>a().createElement(FE.Radio,{key:t.value,value:t.value},t.label)))));return a().createElement("div",{className:e},a().createElement(FE.Popover,{content:b,overlayStyle:{padding:0}},a().createElement("div",{className:"content-btn-item"},a().createElement(kT,null))),a().createElement(FE.Popover,{content:x,overlayStyle:{padding:0}},a().createElement("div",{className:"content-btn-item"},a().createElement(RT,null))),a().createElement("div",{className:"content-btn-item",onClick:_},a().createElement(FE.Button,{type:"link",onClick:_,disabled:!r},a().createElement(FE.Tooltip,{title:r?"":i_({id:"scene.control.animation.PleaseBoxTheSelectionArea",dm:"请先框选区间"})},d?a().createElement(FT,null):a().createElement(jT,null)))),a().createElement("div",{className:"content-btn-item"},a().createElement(FE.Button,{type:"link",onClick:()=>{d&&r?v({speed:p,timeWindowType:c,selection:r,playback:!0}):n(u)}},a().createElement(VT,null))),a().createElement("div",{className:"content-btn-item"},a().createElement(FE.Button,{type:"link",disabled:!r,onClick:()=>{l&&l(),d&&_()}},a().createElement(WT,null))))},XT=s(413);var $T=s(2329),KT=s(2401),JT=s(4249);function QT(){var t=new JT.WT(9);return JT.WT!=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}var tA=s(5512);function eA(){var t=new JT.WT(4);return JT.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function nA(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function rA(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-r*l,t[2]=o*c+a*l+r*u-i*s,t[3]=a*c-r*s-i*u-o*l,t}function iA(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function oA(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=o*u*c-a*s*l,t[1]=a*s*c+o*u*l,t[2]=a*u*l-o*s*c,t[3]=a*u*c+o*s*l,t}tA.d9;var aA=tA.al,sA=tA.JG,uA=(tA.t8,tA.IH,rA),lA=(tA.bA,tA.AK,tA.t7,tA.kE,tA.we,tA.Fv),cA=(tA.I6,tA.fS,$T.create(),$T.fromValues(1,0,0),$T.fromValues(0,1,0),eA(),eA(),QT(),s(9341)),hA={}.toString;const pA=function(t,e){return hA.call(t)==="[object "+e+"]"},fA=function(t){return pA(t,"Number")};function dA(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}const mA=function(t){return null==t},gA=function(t){return pA(t,"String")},yA=function(t,e,n){return t<e?e:t>n?n:t};var vA={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function _A(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return vA[e]===t.length-1&&"achlmqstvz".includes(e)}))}function bA(t){return _A(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function xA(t){return bA(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}var wA={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function SA(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}function EA(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=vA[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,vA[n]))),vA[n]););}function MA(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function TA(t){return t>=48&&t<=57}function AA(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),TA(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&TA(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&TA(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;TA(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&TA(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&TA(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number'}function CA(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function OA(t){for(var e=t.pathValue,n=t.max;t.index<n&&CA(e.charCodeAt(t.index));)t.index+=1}function PA(t){var e,n=t.max,r=t.pathValue,i=t.index,o=r.charCodeAt(i),a=vA[r[i].toLowerCase()];if(t.segmentStart=i,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(o))if(t.index+=1,OA(t),t.data=[],a){for(;;){for(var s=a;s>0;s-=1){if(97!=(32|o)||3!==s&&4!==s?AA(t):MA(t),t.err.length)return;t.data.push(t.param),OA(t),t.index<n&&44===r.charCodeAt(t.index)&&(t.index+=1,OA(t))}if(t.index>=t.max)break;if(!((e=r.charCodeAt(t.index))>=48&&e<=57||43===e||45===e||46===e))break}EA(t)}else EA(t);else t.err='[path-util]: Invalid path value "'+r[i]+'" is not a path command'}var kA=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function LA(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var l=2*r-o,c=2*i-a;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,p=2*i-e.qy;e.qx=h,e.qy=p,u=["Q",h,p].concat(s)}else if("Q"===n){var f=s[0],d=s[1];e.qx=f,e.qy=d}return u}function IA(t){if(xA(t))return SA(t);for(var e=function(t){if(bA(t))return SA(t);var e=function(t){if(_A(t))return SA(t);var e=new kA(t);for(OA(e);e.index<e.max&&!e.err.length;)PA(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(l)}else e=[u].concat(a);var c=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,o=r)}return e}))}(t),n=(0,aM.__assign)({},wA),r=0;r<e.length;r+=1){e[r]=LA(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function RA(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function DA(t,e,n,r,i){var o=dA([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=RA([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function NA(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function FA(t,e,n,r,i,o,a,s,u,l){var c=Math.abs,h=Math.sin,p=Math.cos,f=Math.sqrt,d=Math.PI,m=c(n),g=c(r),y=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===m||0===g)return DA(t,e,s,u,l).point;var v=(t-s)/2,_=(e-u)/2,b={x:p(y)*v+h(y)*_,y:-h(y)*v+p(y)*_},x=Math.pow(b.x,2)/Math.pow(m,2)+Math.pow(b.y,2)/Math.pow(g,2);x>1&&(m*=f(x),g*=f(x));var w=(Math.pow(m,2)*Math.pow(g,2)-Math.pow(m,2)*Math.pow(b.y,2)-Math.pow(g,2)*Math.pow(b.x,2))/(Math.pow(m,2)*Math.pow(b.y,2)+Math.pow(g,2)*Math.pow(b.x,2)),S=(o!==a?1:-1)*f(w=w<0?0:w),E=S*(m*b.y/g),M=S*(-g*b.x/m),T=p(y)*E-h(y)*M+(t+s)/2,A=h(y)*E+p(y)*M+(e+u)/2,C={x:(b.x-E)/m,y:(b.y-M)/g},O=NA({x:1,y:0},C),P=NA(C,{x:(-b.x-E)/m,y:(-b.y-M)/g});!a&&P>0?P-=2*d:a&&P<0&&(P+=2*d);var k=O+(P%=2*d)*l,L=m*p(k),I=g*h(k);return{x:p(y)*L-h(y)*I+T,y:h(y)*L+p(y)*I+A}}function zA(t,e,n,r,i,o,a,s,u,l,c){var h,p=c.bbox,f=void 0===p||p,d=c.length,m=void 0===d||d,g=c.sampleSize,y=void 0===g?30:g,v="number"==typeof l,_=t,b=e,x=0,w=[_,b,x],S=[_,b],E={x:0,y:0},M=[{x:_,y:b}];v&&l<=0&&(E={x:_,y:b});for(var T=0;T<=y;T+=1){if(_=(h=FA(t,e,n,r,i,o,a,s,u,T/y)).x,b=h.y,f&&M.push({x:_,y:b}),m&&(x+=dA(S,[_,b])),S=[_,b],v&&x>=l&&l>w[2]){var A=(x-l)/(x-w[2]);E={x:S[0]*(1-A)+w[0]*A,y:S[1]*(1-A)+w[1]*A}}w=[_,b,x]}return v&&l>=x&&(E={x:s,y:u}),{length:x,point:E,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function BA(t,e,n,r,i,o,a,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function jA(t,e,n,r,i,o,a,s,u,l){var c,h=l.bbox,p=void 0===h||h,f=l.length,d=void 0===f||f,m=l.sampleSize,g=void 0===m?10:m,y="number"==typeof u,v=t,_=e,b=0,x=[v,_,b],w=[v,_],S={x:0,y:0},E=[{x:v,y:_}];y&&u<=0&&(S={x:v,y:_});for(var M=0;M<=g;M+=1){if(v=(c=BA(t,e,n,r,i,o,a,s,M/g)).x,_=c.y,p&&E.push({x:v,y:_}),d&&(b+=dA(w,[v,_])),w=[v,_],y&&b>=u&&u>x[2]){var T=(b-u)/(b-x[2]);S={x:w[0]*(1-T)+x[0]*T,y:w[1]*(1-T)+x[1]*T}}x=[v,_,b]}return y&&u>=b&&(S={x:a,y:s}),{length:b,point:S,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function UA(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function ZA(t,e,n,r,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,p=void 0===h||h,f=s.sampleSize,d=void 0===f?10:f,m="number"==typeof a,g=t,y=e,v=0,_=[g,y,v],b=[g,y],x={x:0,y:0},w=[{x:g,y}];m&&a<=0&&(x={x:g,y});for(var S=0;S<=d;S+=1){if(g=(u=UA(t,e,n,r,i,o,S/d)).x,y=u.y,c&&w.push({x:g,y}),p&&(v+=dA(b,[g,y])),b=[g,y],m&&v>=a&&a>_[2]){var E=(v-a)/(v-_[2]);x={x:b[0]*(1-E)+_[0]*E,y:b[1]*(1-E)+_[1]*E}}_=[g,y,v]}return m&&a>=v&&(x={x:i,y:o}),{length:v,point:x,min:{x:Math.min.apply(null,w.map((function(t){return t.x}))),y:Math.min.apply(null,w.map((function(t){return t.y})))},max:{x:Math.max.apply(null,w.map((function(t){return t.x}))),y:Math.max.apply(null,w.map((function(t){return t.y})))}}}function VA(t,e,n){for(var r,i,o,a,s,u,l,c,h,p=IA(t),f="number"==typeof e,d=[],m=0,g=0,y=0,v=0,_=[],b=[],x=0,w={x:0,y:0},S=w,E=w,M=w,T=0,A=0,C=p.length;A<C;A+=1)d=(l="M"===(c=(h=p[A])[0]))?d:[m,g].concat(h.slice(1)),l?(S=w={x:y=h[1],y:v=h[2]},x=0,f&&e<.001&&(M=w)):"L"===c?(x=(r=DA(d[0],d[1],d[2],d[3],(e||0)-T)).length,w=r.min,S=r.max,E=r.point):"A"===c?(x=(i=zA(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-T,n||{})).length,w=i.min,S=i.max,E=i.point):"C"===c?(x=(o=jA(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-T,n||{})).length,w=o.min,S=o.max,E=o.point):"Q"===c?(x=(a=ZA(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-T,n||{})).length,w=a.min,S=a.max,E=a.point):"Z"===c&&(x=(s=DA((d=[m,g,y,v])[0],d[1],d[2],d[3],(e||0)-T)).length,w=s.min,S=s.max,E=s.point),f&&T<e&&T+x>=e&&(M=E),b.push(S),_.push(w),T+=x,m=(u="Z"!==c?h.slice(-2):[y,v])[0],g=u[1];return f&&e>=T&&(M={x:m,y:g}),{length:T,point:M,min:{x:Math.min.apply(null,_.map((function(t){return t.x}))),y:Math.min.apply(null,_.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}const GA=function(t){return Array.isArray?Array.isArray(t):pA(t,"Array")},HA=function(t){if(GA(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},WA=function(t){if(GA(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])};var qA=1e-5;function YA(t,e,n){return void 0===n&&(n=qA),Math.abs(t-e)<n}const XA=function(t,e){return(t%e+e)%e};function $A(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function KA(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function JA(t,e,n,r,i,o,a,s,u,l){var c,h,p,f,d,m=t,g=e,y=n,v=r,_=s,b=u,x=120*Math.PI/180,w=Math.PI/180*(+i||0),S=[];if(l)h=l[0],p=l[1],f=l[2],d=l[3];else{m=(c=KA(m,g,-w)).x,g=c.y;var E=(m-(_=(c=KA(_,b,-w)).x))/2,M=(g-(b=c.y))/2,T=E*E/(y*y)+M*M/(v*v);T>1&&(y*=T=Math.sqrt(T),v*=T);var A=y*y,C=v*v,O=(o===a?-1:1)*Math.sqrt(Math.abs((A*C-A*M*M-C*E*E)/(A*M*M+C*E*E)));f=O*y*M/v+(m+_)/2,d=O*-v*E/y+(g+b)/2,h=Math.asin(((g-d)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((b-d)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),h=m<f?Math.PI-h:h,p=_<f?Math.PI-p:p,h<0&&(h=2*Math.PI+h),p<0&&(p=2*Math.PI+p),a&&h>p&&(h-=2*Math.PI),!a&&p>h&&(p-=2*Math.PI)}var P=p-h;if(Math.abs(P)>x){var k=p,L=_,I=b;p=h+x*(a&&p>h?1:-1),S=JA(_=f+y*Math.cos(p),b=d+v*Math.sin(p),y,v,i,0,a,L,I,[p,k,f,d])}P=p-h;var R=Math.cos(h),D=Math.sin(h),N=Math.cos(p),F=Math.sin(p),z=Math.tan(P/4),B=4/3*y*z,j=4/3*v*z,U=[m,g],Z=[m+B*D,g-j*R],V=[_+B*F,b-j*N],G=[_,b];if(Z[0]=2*U[0]-Z[0],Z[1]=2*U[1]-Z[1],l)return Z.concat(V,G,S);for(var H=[],W=0,q=(S=Z.concat(V,G,S)).length;W<q;W+=1)H[W]=W%2?KA(S[W-1],S[W],w).y:KA(S[W],S[W+1],w).x;return H}function QA(t,e,n,r){var i=.5,o=[t,e],a=[n,r],s=RA(o,a,i),u=RA(a,s,i),l=RA(s,u,i),c=RA(u,l,i),h=RA(l,c,i),p=DA(o[0],o[1],s[0],s[1],l[0]).point,f=DA(h[0],h[1],c[0],c[1],u[0]).point;return[p.x,p.y,f.x,f.y,n,r]}function tC(t,e){var n,r,i,o,a,s,u,l,c,h=t[0],p=t.slice(1).map(Number),f=p[0],d=p[1],m=e.x1,g=e.y1,y=e.x,v=e.y;switch("TQ".includes(h)||(e.qx=null,e.qy=null),h){case"M":return e.x=f,e.y=d,t;case"A":return n=[m,g].concat(p),["C"].concat(JA(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=f,e.qy=d,n=[m,g].concat(p),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],[(l=1/3)*r+(c=2/3)*o,l*i+c*a,l*s+c*o,l*u+c*a,s,u]));case"L":return["C"].concat(QA(m,g,f,d));case"Z":return m===y&&g===v?["C",m,g,y,v,y,v]:["C"].concat(QA(m,g,y,v))}return t}function eC(t,e){if(void 0===e&&(e=!1),function(t){return xA(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=SA(t);return e?[n,[]]:n}for(var r,i,o=IA(t),a=(0,aM.__assign)({},wA),s=[],u="",l=o.length,c=[],h=0;h<l;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var p=tC(o[h],a);o[h]=p,$A(o,s,h),l=o.length,"Z"===u&&c.push(h),i=(r=o[h]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,c]:o}function nC(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?jA(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=RA(n,r,e),s=RA(r,i,e),u=RA(i,o,e),l=RA(a,s,e),c=RA(s,u,e),h=RA(l,c,e);return[["C"].concat(a,l,h),["C"].concat(c,u,o)]}(r):[t,t]:[t],l:i}}))}function rC(t,e,n){var r=nC(t),i=nC(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[l,c],f=[h-o,h-a],d=0,m=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return d=n&&f[e]&&t.l>=p[e],f[e]-=d?1:0,d?t.ss:[t.s]})).flat()}));return m[0].length===m[1].length?m:rC(m[0],m[1],h)}function iC(t){return function(t){var e=0,n=0,r=0;return eC(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],h=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,u,l,c,h),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function oC(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=dA(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}const aC=function(t){return pA(t,"Boolean")},sC=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},uC=function(t){return void 0===t};var lC=s(4537);function cC(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function hC(t,e){var n=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1)),r=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(e),!1));return{x:n,y:r,width:Math.max.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1))-n,height:Math.max.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(e),!1))-r}}function pC(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function fC(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function dC(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var p=s+h;o<a?o<p&&p<a&&c.push(p):a<p&&p<o&&c.push(p)}for(h=0;h<c.length;h++){var f=pC(t,0,n,r,i,c[h]);f<u&&(u=f),f>l&&(l=f)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,g=-1/0,y=[o,a];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var v=d+h;o<a?o<v&&v<a&&y.push(v):a<v&&v<o&&y.push(v)}for(h=0;h<y.length;h++){var _=fC(0,e,n,r,i,y[h]);_<m&&(m=_),_>g&&(g=_)}return{x:u,y:m,width:l-u,height:g-m}}var mC=1e-4;function gC(t,e,n,r,i,o){var a=-1,s=1/0,u=[n,r],l=20;o&&o>200&&(l=o/10);for(var c=1/l,h=c/10,p=0;p<=l;p++){var f=p*c,d=[i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(t.concat([f])),!1)),i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e.concat([f])),!1))];(v=cC(u[0],u[1],d[0],d[1]))<s&&(a=f,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var m=t.length;return{x:t[m-1],y:e[m-1]}}for(s=1/0,p=0;p<32&&!(h<mC);p++){var g=a-h,y=a+h,v=(d=[i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(t.concat([g])),!1)),i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e.concat([g])),!1))],cC(u[0],u[1],d[0],d[1]));if(g>=0&&v<s)a=g,s=v;else{var _=[i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(t.concat([y])),!1)),i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e.concat([y])),!1))],b=cC(u[0],u[1],_[0],_[1]);y<=1&&b<s?(a=y,s=b):h*=.5}}return{x:i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(t.concat([a])),!1)),y:i.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e.concat([a])),!1))}}function yC(t,e,n,r){return cC(t,e,n,r)}function vC(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function _C(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function bC(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(YA(s,0))YA(u,0)||(i=-l/u)>=0&&i<=1&&c.push(i);else{var h=u*u-4*s*l;YA(h,0)?c.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),(i=(-u+a)/(2*s))>=0&&i<=1&&c.push(i),o>=0&&o<=1&&c.push(o))}return c}function xC(t,e,n,r,i,o,a,s){for(var u=[t,a],l=[e,s],c=bC(t,n,i,a),h=bC(e,r,o,s),p=0;p<c.length;p++)u.push(_C(t,n,i,a,c[p]));for(p=0;p<h.length;p++)l.push(_C(e,r,o,s,h[p]));return hC(u,l)}function wC(t,e,n,r,i,o,a,s,u,l,c){var h=function(t,e,n,r,i,o,a,s,u,l,c){return gC([t,n,i,a],[e,r,o,s],u,l,_C,c)}(t,e,n,r,i,o,a,s,u,l,c);return cC(h.x,h.y,u,l)}function SC(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function EC(t,e,n){var r=t+n-2*e;if(YA(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function MC(t,e,n,r,i,o){var a=EC(t,n,i)[0],s=EC(e,r,o)[0],u=[t,i],l=[e,o];return void 0!==a&&u.push(SC(t,n,i,a)),void 0!==s&&l.push(SC(e,r,o,s)),hC(u,l)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==s.g?s.g:"undefined"!=typeof self&&self;var TC={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=t[r],f=i,d=o;for(n(t,i,r),a(t[o],p)>0&&n(t,i,o);f<d;){for(n(t,f,d),f++,d--;a(t[f],p)<0;)f++;for(;a(t[d],p)>0;)d--}0===a(t[i],p)?n(t,i,d):n(t,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return 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),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function m(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function g(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!g(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;g(t,s)&&(e.leaf?n.push(a):m(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!g(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(g(t,o)){if(e.leaf||m(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=l.pop(),i=!0),a.leaf){var c=o(t,a.children,e);if(-1!==c)return a.children.splice(c,1),u.push(a),this._condense(u),this}i||a.leaf||!m(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),l=u*Math.ceil(Math.sqrt(s));v(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var h=Math.min(c+l-1,n);v(t,c,h,u,this.compareMinY);for(var p=c;p<=h;p+=u){var f=Math.min(p+u-1,h);i.children.push(this._build(t,p,f,r-1))}}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var u=e.children[s],l=h(u),c=f(t,u)-l;c<o?(o=c,i=l<i?l:i,a=u):c===o&&l<i&&(i=l,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=y(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;a<=n-e;a++){var u=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),c=d(u,l),p=h(u)+h(l);c<i?(i=c,r=a,o=p<o?p:o):c===i&&p<o&&(o=p,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),l=p(o)+p(a),c=e;c<n-e;c++){var h=t.children[c];u(o,t.leaf?i(h):h),l+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];u(a,t.leaf?i(d):d),l+=p(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(TC);var AC,CC,OC=TC.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(AC||(AC={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(CC||(CC={}));var PC=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))},t}(),kC=function(){function t(t){this.clipSpaceNearZ=CC.NEGATIVE_ONE,this.plugins=[],this.config=(0,aM.__assign)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return t.prototype.registerPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function LC(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function IC(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function RC(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function DC(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function NC(t){return void 0===t?0:t>360||t<-360?t%360:t}function FC(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?$T.clone(t):fA(t)?$T.fromValues(t,e,n):$T.fromValues(t[0],t[1]||e,t[2]||n)}function zC(t){return t*(Math.PI/180)}function BC(t){return t*(180/Math.PI)}function jC(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=(0,aM.__read)(KT.getScaling($T.create(),e),3),a=o[0],s=o[1],u=o[2],l=Math.asin(-e[2]/a);return l<i?l>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,l=n*n+a+s+u,c=n*o-r*i;return c>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):c<-.499995*l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function UC(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=BC(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var ZC=KT.create(),VC=KT.create(),GC=tA.Ue(),HC=[$T.create(),$T.create(),$T.create()],WC=$T.create();function qC(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var YC,XC=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){LC(this.center,t),LC(this.halfExtents,e),IC(this.min,this.center,this.halfExtents),RC(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){RC(this.center,e,t),DC(this.center,this.center,.5),IC(this.halfExtents,e,t),DC(this.halfExtents,this.halfExtents,.5),LC(this.min,t),LC(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],l=a[2],c=r-s,h=r+s,p=i-u,f=i+u,d=o-l,m=o+l,g=e.center,y=g[0],v=g[1],_=g[2],b=e.halfExtents,x=b[0],w=b[1],S=b[2],E=y-x,M=y+x,T=v-w,A=v+w,C=_-S,O=_+S;E<c&&(c=E),M>h&&(h=M),T<p&&(p=T),A>f&&(f=A),C<d&&(d=C),O>m&&(m=O),n[0]=.5*(c+h),n[1]=.5*(p+f),n[2]=.5*(d+m),a[0]=.5*(h-c),a[1]=.5*(f-p),a[2]=.5*(m-d),this.min[0]=c,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=m}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],p=e[2],f=e[6],d=e[10],m=Math.abs(a),g=Math.abs(s),y=Math.abs(u),v=Math.abs(l),_=Math.abs(c),b=Math.abs(h),x=Math.abs(p),w=Math.abs(f),S=Math.abs(d);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+p*i[0]+f*i[1]+d*i[2],r[0]=m*o[0]+g*o[1]+y*o[2],r[1]=v*o[0]+_*o[1]+b*o[2],r[2]=x*o[0]+w*o[1]+S*o[2],IC(this.min,n,r),RC(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}([0,0,0],this.getMin(),e.getMin()),i=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?LC([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?LC([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),$C=function(){function t(t,e){this.distance=t||0,this.normal=e||$T.fromValues(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return $T.dot(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/$T.len(this.normal);$T.scale(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&$T.lerp(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(YC||(YC={}));var KC,JC,QC,tO=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new $C)}return t.prototype.extractFromVPMatrix=function(t){var e=(0,aM.__read)(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15];$T.set(this.planes[0].normal,o-n,l-a,f-c),this.planes[0].distance=y-d,$T.set(this.planes[1].normal,o+n,l+a,f+c),this.planes[1].distance=y+d,$T.set(this.planes[2].normal,o+r,l+s,f+h),this.planes[2].distance=y+m,$T.set(this.planes[3].normal,o-r,l-s,f-h),this.planes[3].distance=y-m,$T.set(this.planes[4].normal,o-i,l-u,f-p),this.planes[4].distance=y-g,$T.set(this.planes[5].normal,o+i,l+u,f+p),this.planes[5].distance=y+g,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),eO=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),nO=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),rO="Method not implemented.",iO="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(KC||(KC={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(JC||(JC={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(QC||(QC={}));var oO,aO,sO,uO,lO,cO="updated",hO=2e-4,pO=function(){function t(){this.clipSpaceNearZ=CC.NEGATIVE_ONE,this.eventEmitter=new XT,this.matrix=KT.create(),this.right=$T.fromValues(1,0,0),this.up=$T.fromValues(0,1,0),this.forward=$T.fromValues(0,0,1),this.position=$T.fromValues(0,0,1),this.focalPoint=$T.fromValues(0,0,0),this.distanceVector=$T.fromValues(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=KT.create(),this.projectionMatrixInverse=KT.create(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=KC.EXPLORING,this.trackingMode=JC.DEFAULT,this.projectionMode=QC.PERSPECTIVE,this.frustum=new tO,this.orthoMatrix=KT.create()}return t.prototype.isOrtho=function(){return this.projectionMode===QC.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.type===KC.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===KC.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==KC.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return KT.invert(KT.create(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=KT.fromTranslation(KT.create(),[t,e,0]);this.jitteredProjectionMatrix=KT.multiply(KT.create(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===QC.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===QC.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===QC.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===QC.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===QC.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===QC.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=a.x,u=a.y,l=$T.fromValues(s-r,u-i,0),c=$T.dot(l,this.right)/$T.length(this.right),h=$T.dot(l,this.up)/$T.length(this.up);return this.pan(-c,-h),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=QC.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(zC(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,u=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*s/l,o-=this.view.offsetY*a/c,s*=this.view.width/l,a*=this.view.height/c}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var u,l,c=2*o/(n-e),h=2*o/(r-i),p=(n+e)/(n-e),f=(r+i)/(r-i);s?(u=-a/(a-o),l=-a*o/(a-o)):(u=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=p,t[9]=f,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,u,u+s,o,o-a,t,this.far,this.clipSpaceNearZ===CC.ZERO),KT.scale(this.projectionMatrix,this.projectionMatrix,$T.fromValues(1,-1,1)),KT.invert(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=QC.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=l-s,p=l+s,f=c+u,d=c-u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var m=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(h+=m*this.view.offsetX)+m*this.view.width,d=(f-=g*this.view.offsetY)-g*this.view.height}return this.clipSpaceNearZ===CC.NEGATIVE_ONE?KT.ortho(this.projectionMatrix,h,p,d,f,i,o):KT.orthoZO(this.projectionMatrix,h,p,d,f,i,o),KT.scale(this.projectionMatrix,this.projectionMatrix,$T.fromValues(1,-1,1)),KT.invert(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=FC(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=$T.fromValues(0,1,0);if(this.focalPoint=FC(t,e,n),this.trackingMode===JC.CINEMATIC){var i=$T.subtract($T.create(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=$T.length(i),a=BC(Math.asin(e/o)),s=90+BC(Math.atan2(n,t)),u=KT.create();KT.rotateY(u,u,zC(s)),KT.rotateX(u,u,zC(a)),r=$T.transformMat4($T.create(),[0,1,0],u)}return KT.invert(this.matrix,KT.lookAt(KT.create(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<hO&&(this.distance=hO),this.dollyingStep=this.distance/100;var e=$T.create();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=NC(t),this.computeMatrix(),this._getAxes(),this.type===KC.ORBITING||this.type===KC.EXPLORING?this._getPosition():this.type===KC.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=NC(t),this.computeMatrix(),this._getAxes(),this.type===KC.ORBITING||this.type===KC.EXPLORING?this._getPosition():this.type===KC.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=NC(t),this.computeMatrix(),this._getAxes(),this.type===KC.ORBITING||this.type===KC.EXPLORING?this._getPosition():this.type===KC.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=nA(eA(),[0,0,1],zC(this.roll));KT.identity(this.matrix);var e=nA(eA(),[1,0,0],zC((this.rotateWorld&&this.type!==KC.TRACKING||this.type===KC.TRACKING?1:-1)*this.elevation)),n=nA(eA(),[0,1,0],zC((this.rotateWorld&&this.type!==KC.TRACKING||this.type===KC.TRACKING?1:-1)*this.azimuth)),r=rA(eA(),n,e);r=rA(eA(),r,t);var i=KT.fromQuat(KT.create(),r);this.type===KC.ORBITING||this.type===KC.EXPLORING?(KT.translate(this.matrix,this.matrix,this.focalPoint),KT.multiply(this.matrix,this.matrix,i),KT.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===KC.TRACKING&&(KT.translate(this.matrix,this.matrix,this.position),KT.multiply(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=FC(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){$T.copy(this.right,FC(tA.fF(tA.Ue(),[1,0,0,0],this.matrix))),$T.copy(this.up,FC(tA.fF(tA.Ue(),[0,1,0,0],this.matrix))),$T.copy(this.forward,FC(tA.fF(tA.Ue(),[0,0,1,0],this.matrix))),$T.normalize(this.right,this.right),$T.normalize(this.up,this.up),$T.normalize(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=$T.length(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===KC.TRACKING||this.rotateWorld?(this.elevation=BC(Math.asin(e/r)),this.azimuth=BC(Math.atan2(-t,-n))):(this.elevation=-BC(Math.asin(e/r)),this.azimuth=-BC(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){$T.copy(this.position,FC(tA.fF(tA.Ue(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){$T.transformMat3(this.distanceVector,[0,0,-this.distance],function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}(QT(),this.matrix)),$T.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=$T.subtract($T.create(),this.focalPoint,this.position),this.distance=$T.length(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===QC.ORTHOGRAPHIC){var t=this.position,e=nA(eA(),[0,0,1],-this.roll*Math.PI/180);KT.fromRotationTranslationScaleOrigin(this.orthoMatrix,e,$T.fromValues((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),$T.fromValues(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=KT.multiply(KT.create(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(cO)}},t.prototype.rotate=function(t,e,n){throw new Error(rO)},t.prototype.pan=function(t,e){throw new Error(rO)},t.prototype.dolly=function(t){throw new Error(rO)},t.prototype.createLandmark=function(t,e){throw new Error(rO)},t.prototype.gotoLandmark=function(t,e){throw new Error(rO)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(rO)},t}();function fO(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(fO.Cache||Map),n}fO.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(oO||(oO={})),function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(aO||(aO={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(sO||(sO={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(uO||(uO={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(lO||(lO={}));var dO,mO=[{name:"em",unit_type:oO.kEms},{name:"px",unit_type:oO.kPixels},{name:"deg",unit_type:oO.kDegrees},{name:"rad",unit_type:oO.kRadians},{name:"grad",unit_type:oO.kGradians},{name:"ms",unit_type:oO.kMilliseconds},{name:"s",unit_type:oO.kSeconds},{name:"rem",unit_type:oO.kRems},{name:"turn",unit_type:oO.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(dO||(dO={}));var gO,yO=function(t){var e=1;switch(t){case oO.kPixels:case oO.kDegrees:case oO.kSeconds:break;case oO.kMilliseconds:e=.001;break;case oO.kRadians:e=180/Math.PI;break;case oO.kGradians:e=.9;break;case oO.kTurns:e=360}return e},vO=function(t){switch(t){case oO.kNumber:case oO.kInteger:return"";case oO.kPercentage:return"%";case oO.kEms:return"em";case oO.kRems:return"rem";case oO.kPixels:return"px";case oO.kDegrees:return"deg";case oO.kRadians:return"rad";case oO.kGradians:return"grad";case oO.kMilliseconds:return"ms";case oO.kSeconds:return"s";case oO.kTurns:return"turn"}return""},_O=function(){function t(){}return t.isAngle=function(t){return t===oO.kDegrees||t===oO.kRadians||t===oO.kGradians||t===oO.kTurns},t.isLength=function(t){return t>=oO.kEms&&t<oO.kDegrees},t.isRelativeUnit=function(t){return t===oO.kPercentage||t===oO.kEms||t===oO.kRems},t.isTime=function(t){return t===oO.kSeconds||t===oO.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(uO.kNo,lO.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=dO.kUnitType&&this.getType()<=dO.kClampType},t}(),bO=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return(0,aM.__extends)(e,t),e.prototype.getType=function(){return dO.kColorType},e.prototype.to=function(t){return this},e}(_O);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(gO||(gO={}));var xO=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return(0,aM.__extends)(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return dO.kColorType},e}(_O),wO=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return(0,aM.__extends)(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return dO.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(_O),SO=fO((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),EO=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function MO(t){return"function"==typeof t}var TO={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},AO=fO((function(t){var e=SO(t),n=TO[e];return(null==n?void 0:n.alias)||e})),CO=function(t){return function(t){switch(t){case aO.kUNumber:return oO.kNumber;case aO.kULength:return oO.kPixels;case aO.kUPercent:return oO.kPercentage;case aO.kUTime:return oO.kSeconds;case aO.kUAngle:return oO.kDegrees;default:return oO.kUnknown}}(function(t){switch(t){case oO.kNumber:case oO.kInteger:return aO.kUNumber;case oO.kPercentage:return aO.kUPercent;case oO.kPixels:return aO.kULength;case oO.kMilliseconds:case oO.kSeconds:return aO.kUTime;case oO.kDegrees:case oO.kRadians:case oO.kGradians:case oO.kTurns:return aO.kUAngle;default:return aO.kUOther}}(t))},OO=function(t){function e(e,n){void 0===n&&(n=oO.kNumber);var r,i,o=t.call(this)||this;return r="string"==typeof n?(i=n)?"number"===i?oO.kNumber:"percent"===i||"%"===i?oO.kPercentage:function(t){return mO.find((function(e){return e.name===t})).unit_type}(i):oO.kUnknown:n,o.unit=r,o.value=e,o}return(0,aM.__extends)(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){var e=t;return this.value===e.value&&this.unit===e.unit},e.prototype.getType=function(){return dO.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=CO(this.unit);if(n!==CO(t)||n===oO.kUnknown)return null;var r=yO(this.unit)/yO(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case oO.kUnknown:break;case oO.kInteger:r=Number(this.value).toFixed(0);break;case oO.kNumber:case oO.kPercentage:case oO.kEms:case oO.kRems:case oO.kPixels:case oO.kDegrees:case oO.kRadians:case oO.kGradians:case oO.kMilliseconds:case oO.kSeconds:case oO.kTurns:var i=this.value,o=vO(this.unit);if(i<-999999||i>999999){var a=vO(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(function(t){if(!t)throw new Error}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e}(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+r},e}(_O),PO=new OO(0,"px");new OO(1,"px");var kO,LO,IO=new OO(0,"deg"),RO=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return(0,aM.__extends)(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(bO),DO=new wO("unset"),NO=new wO("initial"),FO=new wO("inherit"),zO={"":DO,unset:DO,initial:NO,inherit:FO},BO=function(t){return zO[t]||(zO[t]=new wO(t)),zO[t]},jO=new RO(0,0,0,0,!0),UO=new RO(0,0,0,0),ZO=fO((function(t,e,n,r){return new RO(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),VO=function(t,e){return void 0===e&&(e=oO.kNumber),new OO(t,e)},GO=new OO(50,"%");!function(t){t[t.Standard=0]="Standard"}(kO||(kO={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(LO||(LO={}));var HO,WO={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new nO(0,0,0,0)};function qO(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(HO||(HO={}));var YO=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw new Error(e+": "+t)}function r(){return i("linear-gradient",t.linearGradient,a)||i("repeating-linear-gradient",t.repeatingLinearGradient,a)||i("radial-gradient",t.radialGradient,s)||i("repeating-radial-gradient",t.repeatingRadialGradient,s)||i("conic-gradient",t.conicGradient,s)}function i(e,r,i){return o(r,(function(r){var o=i();return o&&(v(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:p(f)}}))}function o(e,r){var i=v(e);if(i){v(t.startCall)||n("Missing (");var o=r(i);return v(t.endCall)||n("Missing )"),o}}function a(){return y("directional",t.sideOrCorner,1)||y("angular",t.angleValue,1)}function s(){var n,r,i=u();return i&&((n=[]).push(i),r=e,v(t.comma)&&((i=u())?n.push(i):e=r)),n}function u(){var t,e,n=((e=y("shape",/^(circle)/i,0))&&(e.style=g()||l()),e||((t=y("shape",/^(ellipse)/i,0))&&(t.style=m()||l()),t));if(n)n.at=c();else{var r=l();if(r){n=r;var i=c();i&&(n.at=i)}else{var o=h();o&&(n={type:"default-radial",at:o})}}return n}function l(){return y("extent-keyword",t.extentKeywords,1)}function c(){if(y("position",/^at/,0)){var t=h();return t||n("Missing positioning value"),t}}function h(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function p(e){var r=e(),i=[];if(r)for(i.push(r);v(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function f(){var e=y("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:p(d)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:p(d)}}))||y("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function d(){return v(t.number)[1]}function m(){return y("%",t.percentageValue,1)||y("position-keyword",t.positionKeywords,1)||g()}function g(){return y("px",t.pixelValue,1)||y("em",t.emValue,1)}function y(t,e,n){var r=v(e);if(r)return{type:t,value:r[n]}}function v(t){var n=/^[\n\r\t\s]+/.exec(e);n&&_(n[0].length);var r=t.exec(e);return r&&_(r[0].length),r}function _(t){e=e.substring(t)}return function(t){return e=t,i=p(r),e.length>0&&n("Invalid input not EOF"),i;var i}}(),XO=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,$O=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,KO=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,JO=/[\d.]+:(#[^\s]+|[^\)]+\))/gi,QO={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},tP=fO((function(t){var e;return e="angular"===t.type?Number(t.value):QO[t.value]||0,VO(e,"deg")})),eP=fO((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:VO(e,r),cy:VO(n,i)}})),nP=fO((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return YO(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;s<i;s++){var u=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!mA(u)&&!mA(a)){for(var l=1;l<s-o;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(s-o))};o=s,a=Number(u)}}}(r);var i=r.map((function(t){return{offset:VO(Number(t.length.value),"%"),color:qO(t)}}));if("linear-gradient"===e)return new xO(gO.LinearGradient,{angle:n?tP(n):IO,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=eP(n[0].at),a=o.cx,s=o.cy,u=void 0;if(n[0].style){var l=n[0].style,c=l.type,h=l.value;u="extent-keyword"===c?BO(h):VO(h,c)}return new xO(gO.RadialGradient,{cx:a,cy:s,size:u,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=XO.exec(t);if(r){var i=(null===(e=r[2].match(JO))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new xO(gO.LinearGradient,{angle:VO(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=(0,aM.__read)(t,2),n=e[0],r=e[1];return{offset:VO(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=$O.exec(t);if(n){var r=(null===(e=n[4].match(JO))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:VO(50,"%"),cy:VO(50,"%"),steps:r.map((function(t){var e=(0,aM.__read)(t,2),n=e[0],r=e[1];return{offset:VO(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!gA(o))return[new xO(gO.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=KO.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function rP(t){return t&&!!t.image}function iP(t){return t&&!mA(t.r)&&!mA(t.g)&&!mA(t.b)}var oP=fO((function(t){if(rP(t))return(0,aM.__assign)({repetition:"repeat"},t);if(mA(t)&&(t=""),"transparent"===t)return UO;"currentColor"===t&&(t="black");var e=nP(t);if(e)return e;var n=lC.ZP(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),ZO.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(r),!1))}));function aP(t,e){if(iP(t)&&iP(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(yA(e[n],0,255));return e[3]=yA(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function sP(t,e){if(mA(e))return VO(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return VO(Number(e),"px");if("deg".search(t)>=0)return VO(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return VO(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var uP=fO((function(t){return sP(new RegExp("px","g"),t)}));fO((function(t){return sP(new RegExp("%","g"),t)}));var lP=function(t){return fA(t)||isFinite(Number(t))?VO(Number(t)||0,"px"):sP(new RegExp("px|%|em|rem","g"),t)},cP=fO((function(t){return sP(new RegExp("deg|rad|grad|turn","g"),t)}));function hP(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=CO(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(a=l.value,s=c.value,o=vO(t.unit)):(OO.isLength(t.unit)||OO.isLength(e.unit))&&(a=mP(t,i,n),s=mP(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function pP(t){var e=0;return t.unit===oO.kDegrees?e=t.value:t.unit===oO.kRadians?e=BC(Number(t.value)):t.unit===oO.kTurns&&(e=360*Number(t.value)),e}function fP(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):gA(t)?n=t.split(" ").map((function(t){return Number(t)})):fA(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function dP(t){return gA(t)?t.split(" ").map((function(t){return lP(t)})):t.map((function(t){return lP(t.toString())}))}function mP(t,e,n){if(0===t.value)return 0;if(t.unit===oO.kPixels)return Number(t.value);if(t.unit===oO.kPercentage&&n){var r=n.nodeName===AC.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var gP=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function yP(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,gP.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return sP(/deg|rad|grad|turn|px|%/g,t)||oP(t)}))}),n.lastIndex===t.length)return r}return[]}function vP(t){return t.toString()}var _P=fO((function(t){return"number"==typeof t?VO(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?VO(Number(t)):VO(0)}));function bP(t,e){return[t,e,vP]}function xP(t,e){return function(n,r){return[n,r,function(n){return vP(yA(n,t,e))}]}}function wP(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function SP(t){return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=VA(t.parsedStyle.path.absolutePath,void 0,(0,aM.__assign)((0,aM.__assign)({},undefined),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function EP(t,e){return t[0]===e[0]&&t[1]===e[1]}function MP(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||YA(u,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),c=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-l)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function TP(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}fO((function(t){return gA(t)?t.split(" ").map(_P):t.map(_P)}));var AP=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},CP=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=zC(r=XA(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-a.x)/2,c=(t.y-a.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},p=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);p>1&&(e=Math.sqrt(p)*e,n=Math.sqrt(p)*n);var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2));f=f<0?0:f;var d=(i!==o?1:-1)*Math.sqrt(f),m=d*(e*h.y/n),g=d*(-n*h.x/e),y={x:Math.cos(u)*m-Math.sin(u)*g+(t.x+a.x)/2,y:Math.sin(u)*m+Math.cos(u)*g+(t.y+a.y)/2},v={x:(h.x-m)/e,y:(h.y-g)/n},_=AP({x:1,y:0},v),b=AP(v,{x:(-h.x-m)/e,y:(-h.y-g)/n});!o&&b>0?b-=2*Math.PI:o&&b<0&&(b+=2*Math.PI);var x=_+(b%=2*Math.PI)*s,w=e*Math.cos(x),S=n*Math.sin(x);return{x:Math.cos(u)*w-Math.sin(u)*S+y.x,y:Math.sin(u)*w+Math.cos(u)*S+y.y,ellipticalArcStartAngle:_,ellipticalArcEndAngle:_+b,ellipticalArcAngle:x,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function OP(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=CP({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=CP({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=p.x-h.x,d=p.y-h.y,m=Math.sqrt(f*f+d*d);return{x:-f/m,y:-d/m}}function PP(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function kP(t,e){return PP(t)*PP(e)?(t[0]*e[0]+t[1]*e[1])/(PP(t)*PP(e)):1}function LP(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(kP(t,e))}function IP(t,e){var n=e[1],r=e[2],i=XA(zC(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,p=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,f=h*h/(n*n)+p*p/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var d=n*n*(p*p)+r*r*(h*h),m=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(m*=-1),isNaN(m)&&(m=0);var g=r?m*n*p/r:0,y=n?m*-r*h/n:0,v=(s+l)/2+Math.cos(i)*g-Math.sin(i)*y,_=(u+c)/2+Math.sin(i)*g+Math.cos(i)*y,b=[(h-g)/n,(p-y)/r],x=[(-1*h-g)/n,(-1*p-y)/r],w=LP([1,0],b),S=LP(b,x);return kP(b,x)<=-1&&(S=Math.PI),kP(b,x)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:v,cy:_,rx:EP(t,[l,c])?0:n,ry:EP(t,[l,c])?0:r,startAngle:w,endAngle:w+S,xRotation:i,arcFlag:o,sweepFlag:a}}function RP(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,u,r-a,u,r],["C",u,r+a,n+o,c,n,c],["C",n-o,c,s,r+a,s,r],["Z"]]}function DP(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,o,a,s,u,l=[];switch(t.nodeName){case AC.LINE:var c=t.parsedStyle;o=c.x1,a=c.y1,s=c.x2,u=c.y2,l=[["M",o,a],["L",s,u]];break;case AC.CIRCLE:var h=t.parsedStyle,p=h.r;l=RP(p,p,h.cx,h.cy);break;case AC.ELLIPSE:var f=t.parsedStyle;l=RP(f.rx,f.ry,f.cx,f.cy);break;case AC.POLYLINE:case AC.POLYGON:n=t.parsedStyle.points.points,r=t.nodeName===AC.POLYGON,i=n.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]})),r&&i.push(["Z"]),l=i;break;case AC.RECT:var d=t.parsedStyle,m=d.width,g=d.height,y=d.x,v=d.y,_=d.radius,b=_&&_.some((function(t){return 0!==t}));l=function(t,e,n,r,i){if(i){var o=(0,aM.__read)(i,4),a=o[0],s=o[1],u=o[2],l=o[3],c=t>0?1:-1,h=e>0?1:-1,p=c+h!==0?1:0;return[["M",c*a+n,r],["L",t-c*s+n,r],s?["A",s,s,0,0,p,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,p,t+n-c*u,e+r]:null,["L",n+c*l,e+r],l?["A",l,l,0,0,p,n,e+r-h*l]:null,["L",n,h*a+r],a?["A",a,a,0,0,p,c*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(m,g,y,v,b&&_.map((function(t){return yA(t,0,Math.min(Math.abs(m)/2,Math.abs(g)/2))})));break;case AC.PATH:var x=t.parsedStyle.path.absolutePath;l=(0,aM.__spreadArray)([],(0,aM.__read)(x),!1)}if(l.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=$T.fromValues(e[1]-o,e[2]-s,0);n&&$T.transformMat4(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=$T.fromValues(e[1]-o,e[2]-s,0),u=$T.fromValues(e[3]-o,e[4]-s,0),l=$T.fromValues(e[5]-o,e[6]-s,0);n&&($T.transformMat4(a,a,n),$T.transformMat4(u,u,n),$T.transformMat4(l,l,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(u[0],",").concat(u[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var c=$T.fromValues(e[6]-o,e[7]-s,0);n&&$T.transformMat4(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else"Q"===e[0]&&(a=$T.fromValues(e[1]-o,e[2]-s,0),u=$T.fromValues(e[3]-o,e[4]-s,0),n&&($T.transformMat4(a,a,n),$T.transformMat4(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(l,t,e)}var NP=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=IA(t)}catch(n){e=IA(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}var n=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;s<a;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=IP(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),c.currentPoint=n,e[o]&&EP(n,e[o].currentPoint)&&(e[o].prePoint=c.prePoint);var f=r?[r[r.length-2],r[r.length-1]]:null;c.nextPoint=f;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var m=[u[1],u[2]];c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]]}else if("T"===l)m=TP((v=e[s-1]).currentPoint,d),"Q"===v.command?(c.command="Q",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]]);else if("C"===l){var g=[u[1],u[2]],y=[u[3],u[4]];c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-y[0],g[1]-y[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===l){var v;g=TP((v=e[s-1]).currentPoint,d),y=[u[1],u[2]],"C"===v.command?(c.command="C",c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]]):(c.command="SQ",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var _=OP(c,0),b=_.x,x=_.y,w=OP(c,1,!1),S=w.x,E=w.y;c.startTangent=[b,x],c.endTangent=[S,E]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(m=t[o]).currentPoint,s=m.params,u=m.prePoint,l=void 0;switch(m.command){case"Q":l=MC(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":l=xC(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var c=m.arcParams;l=dC(c.cx,c.cy,c.rx,c.ry,c.xRotation,c.startAngle,c.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(m.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height))}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=HA(n),p=HA(r),f=WA(n),d=WA(r);if(0===i.length)return{x:h,y:p,width:f-h,height:d-p};for(o=0;o<i.length;o++){var m;(a=(m=i[o]).currentPoint)[0]===h?h-=MP(m,0).xExtra:a[0]===f&&(f+=MP(m,0).xExtra),a[1]===p?p-=MP(m,0).yExtra:a[1]===d&&(d+=MP(m,0).yExtra)}return{x:h,y:p,width:f-h,height:d-p}}(a),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},FP=fO(NP);function zP(t){return gA(t)?FP(t):NP(t)}function BP(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=eC(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=eC(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=rC(r,i));var a,s,u=iC(o[0])!==iC(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):SA(o[0]);return[u,oC(o[1],u),function(t){return t}]}function jP(t,e){var n;n=gA(t)?t.split(" ").map((function(t){var e=(0,aM.__read)(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t;var r,i,o=[],a=0,s=function(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=cC(r[0],r[1],i[0],i[1])}return e}(t)}(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=yC(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))}));var u=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(n.map((function(t){return t[0]}))),!1)),l=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:o}}function UP(t,e){return[t.points,e.points,function(t){return t}]}var ZP=null;function VP(t){return function(e){var n=0;return t.map((function(t){return t===ZP?e[n++]:t}))}}function GP(t){return t}var HP={matrix:["NNNNNN",[ZP,ZP,0,0,ZP,ZP,0,0,0,0,1,0,ZP,ZP,0,1],GP],matrix3d:["NNNNNNNNNNNNNNNN",GP],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",VP([ZP,ZP,new OO(1)]),GP],scalex:["N",VP([ZP,new OO(1),new OO(1)]),VP([ZP,new OO(1)])],scaley:["N",VP([new OO(1),ZP,new OO(1)]),VP([new OO(1),ZP])],scalez:["N",VP([new OO(1),new OO(1),ZP])],scale3d:["NNN",GP],skew:["Aa",null,GP],skewx:["A",null,VP([ZP,IO])],skewy:["A",null,VP([IO,ZP])],translate:["Tt",VP([ZP,ZP,PO]),GP],translatex:["T",VP([ZP,PO,PO]),VP([ZP,PO])],translatey:["T",VP([PO,ZP,PO]),VP([PO,ZP])],translatez:["L",VP([PO,PO,ZP])],translate3d:["TTL",GP]};function WP(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=HP[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(u.length<s.length)return[];for(var l=[],c=0;c<u.length;c++){var h,p=s[c],f=u[c];if(void 0===(h=p?{A:function(t){return"0"===t.trim()?IO:cP(t)},N:_P,T:lP,L:uP}[f.toUpperCase()](p):{a:IO,n:l[0],t:PO}[f]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function qP(t){var e,n,r,i;switch(t.t){case"rotatex":return i=zC(pP(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=zC(pP(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=zC(pP(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=zC(pP(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=zC(pP(t.d[0])),h=zC(pP(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=zC(pP(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=zC(pP(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=mP(t.d[0],0,null)||0,n=mP(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=mP(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=mP(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=mP(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=mP(t.d[0],0,null)||0,n=mP(t.d[1],0,null)||0,r=mP(t.d[2],0,null)||0,1];case"perspective":var p=mP(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,p?-1/p:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function YP(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function XP(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(ZC,t))return!1;if(KT.copy(VC,ZC),VC[3]=0,VC[7]=0,VC[11]=0,VC[15]=1,Math.abs(KT.determinant(VC))<1e-8)return!1;var a,s,u=ZC[3],l=ZC[7],c=ZC[11],h=ZC[12],p=ZC[13],f=ZC[14],d=ZC[15];if(0!==u||0!==l||0!==c){if(GC[0]=u,GC[1]=l,GC[2]=c,GC[3]=d,!KT.invert(VC,VC))return!1;KT.transpose(VC,VC),tA.fF(i,GC,VC)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=p,e[2]=f,s=ZC,(a=HC)[0][0]=s[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=$T.length(HC[0]),$T.normalize(HC[0],HC[0]),r[0]=$T.dot(HC[0],HC[1]),qC(HC[1],HC[1],HC[0],1,-r[0]),n[1]=$T.length(HC[1]),$T.normalize(HC[1],HC[1]),r[0]/=n[1],r[1]=$T.dot(HC[0],HC[2]),qC(HC[2],HC[2],HC[0],1,-r[1]),r[2]=$T.dot(HC[1],HC[2]),qC(HC[2],HC[2],HC[1],1,-r[2]),n[2]=$T.length(HC[2]),$T.normalize(HC[2],HC[2]),r[1]/=n[2],r[2]/=n[2],$T.cross(WC,HC[1],HC[2]),$T.dot(HC[0],WC)<0)for(var m=0;m<3;m++)n[m]*=-1,HC[m][0]*=-1,HC[m][1]*=-1,HC[m][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+HC[0][0]-HC[1][1]-HC[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-HC[0][0]+HC[1][1]-HC[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-HC[0][0]-HC[1][1]+HC[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+HC[0][0]+HC[1][1]+HC[2][2],0)),HC[2][1]>HC[1][2]&&(o[0]=-o[0]),HC[0][2]>HC[2][0]&&(o[1]=-o[1]),HC[1][0]>HC[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(qP).reduce(YP)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var $P=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)a[s][3]=o[s];for(s=0;s<3;s++)for(var u=0;u<3;u++)a[3][s]+=e[u]*a[u][s];var l=i[0],c=i[1],h=i[2],p=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(c*c+h*h),f[0][1]=2*(l*c-h*p),f[0][2]=2*(l*h+c*p),f[1][0]=2*(l*c+h*p),f[1][1]=1-2*(l*l+h*h),f[1][2]=2*(c*h-l*p),f[2][0]=2*(l*h-c*p),f[2][1]=2*(c*h+l*p),f[2][2]=1-2*(l*l+c*c),a=t(a,f);var d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(d[2][1]=r[2],a=t(a,d)),r[1]&&(d[2][1]=0,d[2][0]=r[0],a=t(a,d)),r[0]&&(d[2][0]=0,d[1][0]=r[0],a=t(a,d)),s=0;s<3;s++)for(u=0;u<3;u++)a[s][u]*=n[s];return function(t){return 0==t[0][2]&&0==t[0][3]&&0==t[1][2]&&0==t[1][3]&&0==t[2][0]&&0==t[2][1]&&1==t[2][2]&&0==t[2][3]&&0==t[3][2]&&1==t[3][3]}(a)?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function KP(t){return t.toFixed(6).replace(".000000","")}function JP(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=XP(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=XP(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e),i=[];if(1===(r=yA(r,-1,1)))i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return $P(t[0],t[1],t[2],e,t[4]).map(KP).join(",")}])}function QP(t){return t.replace(/[xy]/,"")}function tk(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function ek(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?VO(a):VO(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,u=[],l=[],c=[];if(t.length!==e.length)u=[(v=JP(t,e))[0]],l=[v[1]],c=[["matrix",[v[2]]]];else for(o=0;o<t.length;o++){var h=t[o].t,p=e[o].t,f=t[o].d,d=e[o].d,m=HP[h],g=HP[p],y=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=JP([t[o]],[e[o]]);u.push(v[0]),l.push(v[1]),c.push(["matrix",[v[2]]])}else{if(h===p)y=h;else if(m[2]&&g[2]&&QP(h)===QP(p))y=QP(h),f=m[2](f),d=g[2](d);else{if(!m[1]||!g[1]||tk(h)!==tk(p)){u=[(v=JP(t,e))[0]],l=[v[1]],c=[["matrix",[v[2]]]];break}y=tk(h),f=m[1](f),d=g[1](d)}for(var _=[],b=[],x=[],w=0;w<f.length;w++)v=hP(f[w],d[w],n,!1,w),_[w]=v[0],b[w]=v[1],x.push(v[2]);u.push(_),l.push(b),c.push([y,x])}}if(r){var S=u;u=l,l=S}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),c[e][0]+"("+n+")"})).join(" ")}]}var nk=fO((function(t){if(gA(t)){if("text-anchor"===t)return[VO(0,"px"),VO(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[lP(rk(e[0])),lP(rk(e[1]))]}return[VO(t[0]||0,"px"),VO(t[1]||0,"px")]}));function rk(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var ik=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:HO.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:HO.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:HO.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:HO.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:HO.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:HO.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:HO.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:HO.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:HO.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:HO.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:HO.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:HO.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:HO.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:HO.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:HO.FILTER},{n:"clipPath",syntax:HO.DEFINED_PATH},{n:"textPath",syntax:HO.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:HO.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===AC.CIRCLE||t===AC.ELLIPSE?"center":t===AC.TEXT?"text-anchor":"left top"},l:!0,syntax:HO.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===AC.CIRCLE||t===AC.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:HO.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:HO.COORDINATE},{n:"cy",int:!0,d:"0",syntax:HO.COORDINATE},{n:"cz",int:!0,d:"0",syntax:HO.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:HO.COORDINATE},{n:"y",int:!0,d:"0",syntax:HO.COORDINATE},{n:"z",int:!0,d:"0",syntax:HO.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:HO.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:HO.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:HO.COORDINATE},{n:"y1",int:!0,l:!0,syntax:HO.COORDINATE},{n:"z1",int:!0,l:!0,syntax:HO.COORDINATE},{n:"x2",int:!0,l:!0,syntax:HO.COORDINATE},{n:"y2",int:!0,l:!0,syntax:HO.COORDINATE},{n:"z2",int:!0,l:!0,syntax:HO.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:HO.PATH,p:50},{n:"points",int:!0,l:!0,syntax:HO.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:HO.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:HO.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:HO.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:HO.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:HO.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:HO.NUMBER,d:function(t){return t===AC.PATH||t===AC.POLYGON||t===AC.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:HO.MARKER},{n:"markerEnd",syntax:HO.MARKER},{n:"markerMid",syntax:HO.MARKER},{n:"markerStartOffset",syntax:HO.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:HO.LENGTH,l:!0,int:!0,d:"0"}],ok=ik.filter((function(t){return!!t.l})).map((function(t){return t.n})),ak={},sk=new WeakMap,uk=function(){function t(t){var e=this;this.runtime=t,ik.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){(0,aM.__spreadArray)([t.n],(0,aM.__read)(t.a||[]),!1).forEach((function(e){ak[e]=t}))},t.prototype.unregisterMetadata=function(t){delete ak[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var r=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(t.attributes,e);var i=Object.keys(e),o=t.parsedStyle.clipPath,a=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var s=!!n.forceUpdateGeometry;if(!s)for(var u=0;u<ok.length;u++)if(ok[u]in e){s=!0;break}return e.fill&&(t.parsedStyle.fill=oP(e.fill)),e.stroke&&(t.parsedStyle.stroke=oP(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=oP(e.shadowColor)),e.filter&&(t.parsedStyle.filter=yP(e.filter)),mA(e.radius)||(t.parsedStyle.radius=fP(e.radius,4)),mA(e.lineDash)||(t.parsedStyle.lineDash=fP(e.lineDash,2)),e.points&&(t.parsedStyle.points=jP(e.points,t)),""===e.path&&(t.parsedStyle.path=(0,aM.__assign)({},WO)),e.path&&(t.parsedStyle.path=zP(e.path),t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",a,e.offsetPath,t,this.runtime),e.anchor&&(t.parsedStyle.anchor=fP(e.anchor,2)),e.transform&&(t.parsedStyle.transform=WP(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=nk(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(t.nodeName!==AC.CIRCLE&&t.nodeName!==AC.ELLIPSE||mA(e.cx)&&mA(e.cy))&&(t.nodeName!==AC.RECT&&t.nodeName!==AC.IMAGE&&t.nodeName!==AC.GROUP&&t.nodeName!==AC.HTML&&t.nodeName!==AC.TEXT&&t.nodeName!==AC.MESH||mA(e.x)&&mA(e.y)&&mA(e.z))&&(t.nodeName!==AC.LINE||mA(e.x1)&&mA(e.y1)&&mA(e.z1)&&mA(e.x2)&&mA(e.y2)&&mA(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(t,i),mA(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,i),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(t,i),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(t,i),mA(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,i),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,i),void(s&&this.updateGeometry(t))}var l=n.skipUpdateAttribute,c=n.skipParse,h=n.forceUpdateGeometry,p=n.usedAttributes,f=h,d=Object.keys(e);d.forEach((function(n){var r;l||(t.attributes[n]=e[n]),!f&&(null===(r=ak[n])||void 0===r?void 0:r.l)&&(f=!0)})),c||d.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(null==p?void 0:p.length)&&(d=Array.from(new Set(d.concat(p)))),d.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),f&&this.updateGeometry(t),d.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t,d)})),this.runtime.enableCSSParsing&&t.children.length&&d.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},t.prototype.parseProperty=function(t,e,n){var r=ak[t],i=e;if((""===e||mA(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=BO(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=BO(e):s&&s.parser&&(i=s.parser(e,n))}return i},t.prototype.computeProperty=function(t,e,n){var r=ak[t],i="g-root"===n.id,o=e;if(r){var a=r.syntax,s=r.inh,u=r.d;if(e instanceof wO){var l=e.value;if("unset"===l&&(l=s&&!i?"inherit":"initial"),"initial"===l)mA(u)||(e=this.parseProperty(t,MO(u)?u(n.nodeName):u,n));else if("inherit"===l){var c=this.tryToResolveProperty(n,t,{inherited:!0});return mA(c)?void this.addUnresolveProperty(n,t):c}}var h=a&&this.getPropertySyntax(a);if(h&&h.calculator){var p=n.parsedStyle[t];o=h.calculator(t,p,e,n,this.runtime)}else o=e instanceof wO?e.value:e}return o},t.prototype.postProcessProperty=function(t,e,n){var r=ak[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=sk.get(t);n||(sk.set(t,[]),n=sk.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=sk.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},t.prototype.recalc=function(t){var e=sk.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),sk.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new XC),r.renderBounds||(r.renderBounds=new XC);var i=t.parsedStyle,o=n.update(i,t),a=o.width,s=o.height,u=o.depth,l=void 0===u?0:u,c=o.offsetX,h=void 0===c?0:c,p=o.offsetY,f=void 0===p?0:p,d=o.offsetZ,m=void 0===d?0:d,g=[Math.abs(a)/2,Math.abs(s)/2,l/2],y=i,v=y.stroke,_=y.lineWidth,b=y.increasedLineWidthForHitTesting,x=y.shadowType,w=y.shadowColor,S=y.filter,E=void 0===S?[]:S,M=y.transformOrigin,T=i.anchor;e===AC.TEXT?delete i.anchor:e===AC.MESH&&(i.anchor[2]=.5);var A=[(1-2*(T&&T[0]||0))*a/2+h,(1-2*(T&&T[1]||0))*s/2+f,(1-2*(T&&T[2]||0))*g[2]+m];r.contentBounds.update(A,g);var C=e===AC.POLYLINE||e===AC.POLYGON||e===AC.PATH?Math.SQRT2:.5;if(v&&!v.isNone){var O=((_||0)+(b||0))*C;g[0]+=O,g[1]+=O}if(r.renderBounds.update(A,g),w&&x&&"inner"!==x){var P=r.renderBounds,k=P.min,L=P.max,I=i,R=I.shadowBlur||0,D=I.shadowOffsetX||0,N=I.shadowOffsetY||0,F=k[0]-R+D,z=L[0]+R+D,B=k[1]-R+N,j=L[1]+R+N;k[0]=Math.min(k[0],F),L[0]=Math.max(L[0],z),k[1]=Math.min(k[1],B),L[1]=Math.max(L[1],j),r.renderBounds.setMinMax(k,L)}E.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,RC(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=l[0]-s+o,p=c[0]+s+o,f=l[1]-s+a,d=c[1]+s+a;l[0]=Math.min(l[0],h),c[0]=Math.max(c[0],p),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),r.renderBounds.setMinMax(l,c)}})),T=i.anchor;var U=a<0,Z=s<0,V=(U?-1:1)*(M?mP(M[0],0,t):0),G=(Z?-1:1)*(M?mP(M[1],1,t):0);V-=(U?-1:1)*(T&&T[0]||0)*r.contentBounds.halfExtents[0]*2,G-=(Z?-1:1)*(T&&T[1]||0)*r.contentBounds.halfExtents[1]*2,t.setOrigin(V,G),this.runtime.sceneGraphService.dirtifyToRoot(t)}},t.prototype.isPropertyInheritable=function(t){var e=ak[t];return!!e&&e.inh},t}(),lk=function(){function t(){this.parser=cP,this.parserWithCSSDisabled=null,this.mixer=bP}return t.prototype.calculator=function(t,e,n,r){return pP(n)},t}(),ck=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof wO&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),hk=function(){function t(){this.parser=oP,this.parserWithCSSDisabled=oP,this.mixer=aP}return t.prototype.calculator=function(t,e,n,r){return n instanceof wO?"none"===n.value?jO:UO:n},t}(),pk=function(){function t(){this.parser=yP}return t.prototype.calculator=function(t,e,n){return n instanceof wO?[]:n},t}();function fk(t){var e=t.parsedStyle.fontSize;return mA(e)?null:e}var dk=function(){function t(){this.parser=lP,this.parserWithCSSDisabled=null,this.mixer=bP}return t.prototype.calculator=function(t,e,n,r,i){var o;if(fA(n))return n;if(!OO.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===oO.kPercentage)return 0;if(n.unit===oO.kEms){if(r.parentNode){if(s=fk(r.parentNode))return s*n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===oO.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=fk(r.ownerDocument.documentElement))return s*n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),mk=function(){function t(){this.mixer=wP}return t.prototype.parser=function(t){var e=dP(fA(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),gk=function(){function t(){this.mixer=wP}return t.prototype.parser=function(t){var e=dP(fA(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),yk=KT.create();function vk(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i)a=(null==o?void 0:o.map((function(t){return t.value})))||[1],e.scaleLocal(a[0],1,1);else if("scaley"===i)a=(null==o?void 0:o.map((function(t){return t.value})))||[1],e.scaleLocal(1,a[0],1);else if("scalez"===i)a=(null==o?void 0:o.map((function(t){return t.value})))||[1],e.scaleLocal(1,1,a[0]);else if("scale3d"===i)a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1],e.scaleLocal(a[0],a[1],a[2]);else if("translate"===i){var s=o||[PO,PO];e.translateLocal(s[0].value,s[1].value,0)}else if("translatex"===i)s=o||[PO],e.translateLocal(s[0].value,0,0);else if("translatey"===i)s=o||[PO],e.translateLocal(0,s[0].value,0);else if("translatez"===i)s=o||[PO],e.translateLocal(0,0,s[0].value);else if("translate3d"===i)s=o||[PO,PO,PO],e.translateLocal(s[0].value,s[1].value,s[2].value);else if("rotate"===i){var u=o||[IO];e.rotateLocal(0,0,pP(u[0]))}else if("rotatex"===i)u=o||[IO],e.rotateLocal(pP(u[0]),0,0);else if("rotatey"===i)u=o||[IO],e.rotateLocal(0,pP(u[0]),0);else if("rotatez"===i)u=o||[IO],e.rotateLocal(0,0,pP(u[0]));else if("rotate3d"===i);else if("skew"===i){var l=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(zC(l[0]),zC(l[1]))}else if("skewx"===i)l=(null==o?void 0:o.map((function(t){return t.value})))||[0],e.setLocalSkew(zC(l[0]),e.getLocalSkew()[1]);else if("skewy"===i)l=(null==o?void 0:o.map((function(t){return t.value})))||[0],e.setLocalSkew(e.getLocalSkew()[0],zC(l[0]));else if("matrix"===i){var c=(0,aM.__read)(o.map((function(t){return t.value})),6),h=c[0],p=c[1],f=c[2],d=c[3],m=c[4],g=c[5];e.setLocalTransform(KT.set(yk,h,p,0,0,f,d,0,0,0,0,1,0,m+n,g+r,0,1))}else"matrix3d"===i&&(KT.set.apply(KT,(0,aM.__spreadArray)([yk],(0,aM.__read)(o.map((function(t){return t.value}))),!1)),yk[12]+=n,yk[13]+=r,e.setLocalTransform(yk))})),e.getLocalTransform()}var _k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,aM.__extends)(e,t),e.prototype.postProcessor=function(t,e){var n,r,i;switch(t.nodeName){case AC.CIRCLE:case AC.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy,u=o.cz;mA(a)||(n=a),mA(s)||(r=s),mA(u)||(i=u);break;case AC.LINE:var l=t.parsedStyle,c=l.x1,h=l.x2,p=l.y1,f=l.y2;n=Math.min(c,h),r=Math.min(p,f),i=0;break;case AC.RECT:case AC.IMAGE:case AC.GROUP:case AC.HTML:case AC.TEXT:case AC.MESH:mA(t.parsedStyle.x)||(n=t.parsedStyle.x),mA(t.parsedStyle.y)||(r=t.parsedStyle.y),mA(t.parsedStyle.z)||(i=t.parsedStyle.z)}if(t.nodeName!==AC.PATH&&t.nodeName!==AC.POLYLINE&&t.nodeName!==AC.POLYGON&&(t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0),!(mA(n)&&mA(r)&&mA(i)||-1!==e.indexOf("transform"))){var d=t.parsedStyle.transform;if(d&&d.length)vk(d,t);else{var m=(0,aM.__read)(t.getLocalPosition(),3),g=m[0],y=m[1],v=m[2];t.setLocalPosition(mA(n)?g:n,mA(r)?y:r,mA(i)?v:i)}}},e}(dk),bk=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof wO&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),xk=function(){function t(){this.mixer=bP,this.parser=_P,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),wk=function(){function t(){this.parser=_P,this.parserWithCSSDisabled=null,this.mixer=xP(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===AC.LINE||i===AC.PATH||i===AC.POLYLINE){var o=n.getPoint(r);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},t}(),Sk=function(){function t(){this.parser=_P,this.parserWithCSSDisabled=null,this.mixer=xP(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Ek=function(){function t(){this.parser=zP,this.parserWithCSSDisabled=zP,this.mixer=BP}return t.prototype.calculator=function(t,e,n){return n instanceof wO&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new nO(0,0,0,0)}:n},t.prototype.postProcessor=function(t,e){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===AC.PATH&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=void 0===r?0:r,o=n.defY,a=void 0===o?0:o;t.setLocalPosition(i,a)}},t}(),Mk=function(){function t(){this.parser=jP,this.mixer=UP}return t.prototype.postProcessor=function(t,e){if((t.nodeName===AC.POLYGON||t.nodeName===AC.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(r,i)}},t}(),Tk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=xP(0,1/0),e}return(0,aM.__extends)(e,t),e}(dk),Ak=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof wO?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),Ck=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),Ok={},Pk=0,kk="undefined"!=typeof window&&void 0!==window.document;function Lk(t){return!!t.getAttribute}function Ik(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Rk(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function Dk(t,e){if(kk)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Nk={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function Fk(t,e,n){var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var zk=1,Bk="object"==typeof self&&self.self==self?self:"object"==typeof s.g&&s.g.global==s.g?s.g:{},jk=Date.now(),Uk={},Zk=Date.now(),Vk=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Zk,r=n>16?0:16-n,i=zk++;return Uk[i]=t,Object.keys(Uk).length>1||setTimeout((function(){Zk=e;var t=Uk;Uk={},Object.keys(t).forEach((function(e){return t[e](Bk.performance&&"function"==typeof Bk.performance.now?Bk.performance.now():Date.now()-jk)}))}),r),i},Gk=function(t){delete Uk[t]},Hk=function(t){return"string"!=typeof t?Vk:""===t?Bk.requestAnimationFrame:Bk[t+"RequestAnimationFrame"]},Wk=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Hk(t)})),qk=Hk(Wk),Yk=function(t){return"string"!=typeof t?Gk:""===t?Bk.cancelAnimationFrame:Bk[t+"CancelAnimationFrame"]||Bk[t+"CancelRequestAnimationFrame"]}(Wk);Bk.requestAnimationFrame=qk,Bk.cancelAnimationFrame=Yk;var Xk,$k=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1))})))},t}(),Kk=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,aM.__awaiter)(this,void 0,void 0,(function(){var e,n,r;return(0,aM.__generator)(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),Jk=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Qk=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=arguments,e=this.callbacks[0].apply(void 0,t),n=0;n<this.callbacks.length-1;n++)e=(0,this.callbacks[n])(e);return e}return null},t}(),tL=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],eL=/([\"\'])[^\'\"]+\1/,nL=function(){function t(){this.parser=WP,this.parserWithCSSDisabled=WP,this.mixer=ek}return t.prototype.calculator=function(t,e,n,r){return n instanceof wO?[]:n},t.prototype.postProcessor=function(t){vk(t.parsedStyle.transform,t)},t}(),rL=function(){this.parser=nk},iL=function(){function t(){this.parser=_P}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=LO.Z_INDEX_CHANGED)}},t}(),oL=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),aL=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),sL=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),uL=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),lL=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:Math.max.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(e.map((function(t){return t[1]}))),!1))-i}},t}(),cL=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=void 0===r?0:r,o=t.height,a=i,s=void 0===o?0:o;return n&&!gA(n)&&(a||(a=n.width,t.width=a),s||(s=n.height,t.height=s)),{width:a,height:s}},t}(),hL=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,o=t.fontSize,a=t.fontStyle,s=t.fontWeight,u=t.fontVariant,l=t.lineWidth;return n&&o&&a&&s&&u&&r&&i&&!mA(l)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,l=t.dy,c=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.globalRuntime.textService.measureText(i,t,c);t.metrics=h;var p=h.width,f=h.height,d=h.lineHeight,m=h.fontProperties,g=[p/2,f/2,0],y=[0,1],v=0;"center"===o||"middle"===o?(v=a/2,y=[.5,1]):"right"!==o&&"end"!==o||(v=a,y=[1,1]);var _=0;return"middle"===s?_=g[1]:"top"===s||"hanging"===s?_=2*g[1]:"alphabetic"===s?_=this.globalRuntime.enableCSSParsing?d-m.ascent:0:"bottom"!==s&&"ideographic"!==s||(_=0),u&&(v+=u),l&&(_+=l),t.anchor=[y[0],y[1],0],{width:2*g[0],height:2*g[1],offsetX:v,offsetY:_}},t}(),pL=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new eO,this.page=new eO,this.canvas=new eO,this.viewport=new eO,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw new Error(rO)},t}(),fL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new eO,e.movement=new eO,e.offset=new eO,e.global=new eO,e.screen=new eO,e}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw new Error(rO)},e}(pL),dL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return(0,aM.__extends)(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(fL),mL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,aM.__extends)(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(fL),gL=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return(0,aM.__extends)(e,t),e}(pL),yL=function(){function t(){this.emitter=new XT}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=aC(n)&&n||sC(n)&&n.capture,i=sC(n)&&n.once,o=MO(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=(0,aM.__read)(t.split(":"),2),l=u[0];t=u[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=MO(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=aC(n)&&n||sC(n)&&n.capture,i=MO(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=MO(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new gL(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!function(t){return!!t.type}(t))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),vL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return(0,aM.__extends)(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===AC.TEXT&&(n+=this.style.text);try{for(var r=(0,aM.__values)(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===AC.TEXT?n+=o.nodeValue:n+=o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===AC.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error(rO)},e.prototype.lookupNamespaceURI=function(t){throw new Error(rO)},e.prototype.lookupPrefix=function(t){throw new Error(rO)},e.prototype.normalize=function(){throw new Error(rO)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,u=s===o?a:o;if(s[s.length-u.length]===u[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],p=s[l+c];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(yL),_L=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new XT,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=KT.create(),this.tmpVec3=$T.create(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var r=2===e.button;n.dispatchEvent(e,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=performance.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;n.dispatchEvent(i,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),u=s;if(s&&!i.composedPath().includes(s)){for(var l=s;l&&!i.composedPath().includes(l);)i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?n.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||(o=2===i.button,n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")),vL.isNode(l)&&(l=l.parentNode);delete a.pressTargetsByButton[t.button],u=l}if(u){var c=n.clonePointerEvent(i,"click");c.target=u,c.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:r});var h=a.clicksByButton[t.button];h.target===c.target&&r-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=c.target,h.timeStamp=r,c.detail=h.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==c.pointerType&&"touch"!==c.pointerType||n.dispatchEvent(c,"click"),n.dispatchEvent(c,"pointertap")),n.freeEvent(c)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=n.createPointerEvent(t,a,o||void 0);if(n.dispatchEvent(s,"pointerout"),r&&n.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var u=n.createPointerEvent(t,"pointerleave",o||void 0);for(u.eventPhase=u.AT_TARGET;u.target&&!e.composedPath().includes(u.target);)u.currentTarget=u.target,n.notifyTarget(u),r&&n.notifyTarget(u,"mouseleave"),vL.isNode(u.target)&&(u.target=u.target.parentNode);n.freeEvent(u)}n.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",c=n.clonePointerEvent(e,l);n.dispatchEvent(c,"pointerover"),r&&n.dispatchEvent(c,"mouseover");for(var h=o&&vL.isNode(o)&&o.parentNode;h&&h!==(vL.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&h!==e.target;)h=h.parentNode;if(!h||h===(vL.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var p=n.clonePointerEvent(e,"pointerenter");for(p.eventPhase=p.AT_TARGET;p.target&&p.target!==o&&p.target!==(vL.isNode(n.rootTarget)&&n.rootTarget.parentNode);)p.currentTarget=p.target,n.notifyTarget(p),r&&n.notifyTarget(p,"mouseenter"),vL.isNode(p.target)&&(p.target=p.target.parentNode);n.freeEvent(p)}n.freeEvent(c)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(vL.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),vL.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(vL.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),vL.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),vL.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new eO(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new eO(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=KT.multiply(this.tmpMatrix,u,s),c=$T.set(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return $T.transformMat4(c,c,l),new eO(c[0],c[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=KT.multiply(this.tmpMatrix,n,r),o=$T.set(this.tmpVec3,t.x,t.y,0);$T.transformMat4(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,u=a.height;return new eO((o[0]+1)/2*s,(1-(o[1]+1)/2)*u)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);for(t.eventPhase=t.BUBBLING_PHASE,r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)vL.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,o=r.height;return e<0||n<0||e>i||n>o?null:this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=(0,aM.__values)(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.globalRuntime.nativeHTMLMap.get(o);if(a)return a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(dL);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i);return i.target=null!=n?n:o||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(mL);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(mL);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(dL);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},t.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||vL.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Lk(e)&&e.getAttribute("cursor");if(n)return n;e=vL.isNode(e)&&e.parentNode}},t}(),bL=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(Xk||(Xk={}));var xL,wL=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Jk,initAsync:new $k,dirtycheck:new Qk,cull:new Qk,beginFrame:new Jk,beforeRender:new Jk,render:new Jk,afterRender:new Jk,endFrame:new Jk,destroy:new Jk,pick:new Kk,pickSync:new Qk,pointerDown:new Jk,pointerUp:new Jk,pointerMove:new Jk,pointerOut:new Jk,pointerOver:new Jk,pointerWheel:new Jk,pointerCancel:new Jk,click:new Jk}}return t.prototype.init=function(t){var e=this,n=(0,aM.__assign)((0,aM.__assign)({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Xk.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var l=t.sortable;l.dirty&&(this.sort(t,l),l.dirty=!1,l.dirtyChildren=[],l.dirtyReason=void 0),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==LO.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Ik(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Ik)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Xk.DISPLAY_OBJECT_CHANGED)},t}(),SL=/\[\s*(.*)=(.*)\s*\]/,EL=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(SL),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return mA(n)?"":n.toString?n.toString():""},t}(),ML=function(t){function e(e,n,r,i,o,a,s,u){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=u,l.type=e,l}return(0,aM.__extends)(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(pL);function TL(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(xL||(xL={}));var AL,CL,OL,PL=new ML(xL.REPARENT,null,"","","",0,"",""),kL=function(){function t(t){var e,n,r,i,o,a,s,u,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new gL(xL.BOUNDS_CHANGED),this.rotate=(e=eA(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=$T.fromValues(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=eA();oA(a,n[0],n[1],n[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);sA(e,u),iA(e,e),rA(a,e,a),rA(o.localRotation,a,s),lA(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,n)}),this.rotateLocal=(u=eA(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=$T.fromValues(e,n,r));var i=t.transformable;oA(u,e[0],e[1],e[2]),uA(i.localRotation,i.localRotation,u),l.dirtifyLocal(t,i)}),this.setEulerAngles=(n=eA(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=$T.fromValues(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){oA(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);sA(n,iA(eA(),a)),uA(o.localRotation,o.localRotation,n),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=$T.fromValues(e,n,r));var i=t.transformable;$T.equals(e,$T.create())||($T.transformQuat(e,e,i.localRotation),$T.add(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(r=KT.create(),i=$T.create(),function(t,e){var n=t.transformable;if(i[0]=e[0],i[1]=e[1],i[2]=e[2]||0,!$T.equals(l.getPosition(t),i)){if($T.copy(n.position,i),null!==t.parentNode&&t.parentNode.transformable){var o=t.parentNode.transformable;KT.copy(r,o.worldTransform),KT.invert(r,r),$T.transformMat4(n.localPosition,i,r)}else $T.copy(n.localPosition,i);l.dirtifyLocal(t,n)}}),this.setLocalPosition=function(){var t=$T.create();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,$T.equals(r.localPosition,t)||($T.copy(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(o=$T.create(),a=$T.create(),s=$T.create(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=$T.set(a,e,n,r)),$T.equals(e,o)||($T.add(s,l.getPosition(t),e),l.setPosition(t,s))}),this.setRotation=function(){var t=eA();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=aA(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);sA(t,s),iA(t,t),rA(a.localRotation,t,n),lA(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=KT.create(),e=$T.create(),n=aA(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(KT.fromRotationTranslationScaleOrigin(r.localTransform,r.localRotation,r.localPosition,$T.fromValues(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=KT.identity(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),KT.multiply(r.localTransform,r.localTransform,i)}var o=KT.fromRotationTranslationScaleOrigin(t,n,e,r.localScale,r.origin);KT.multiply(r.localTransform,r.localTransform,o)}else KT.fromRotationTranslationScaleOrigin(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,mA(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null===(r=null==a?void 0:a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(-1===a.dirtyChildren.indexOf(t)&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=LO.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(PL)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=LO.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=$T.fromValues(e,n,r));var i=t.transformable;oA(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.scaleLocal=function(t,e){var n=t.transformable;$T.multiply(n.localScale,n.localScale,$T.fromValues(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=$T.fromValues(e[0],e[1],e[2]||n.localScale[2]);$T.equals(r,n.localScale)||($T.copy(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=aA(e,n,r,i));var o=t.transformable;sA(o.localRotation,e),this.dirtifyLocal(t,o)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=cA.al(e,n));var r=t.transformable;cA.JG(r.localSkew,e),this.dirtifyLocal(t,r)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.prototype.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=(0,aM.__read)(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)TL(n),n=n.parentNode;e&&t.forEach((function(t){TL(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new ML(xL.ATTR_MODIFIED,n,e,e,t,ML.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return KT.getTranslation(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return KT.getRotation(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return KT.getScaling(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=KT.getTranslation($T.create(),e),r=KT.getRotation(eA(),e),i=KT.getScaling($T.create(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(XC.isEmpty(r))return null;var i=n||new XC;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new XC},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new XC).update(r.center,r.halfExtents))})),e){var a=Rk(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new XC),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=KT.create();t.parentNode.transformable&&(e=KT.invert(KT.create(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!XC.isEmpty(n)){var r=new XC;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);XC.isEmpty(i)||(r=new XC).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=(0,aM.__read)(r.getMin(),2),s=a[0],u=a[1],l=(0,aM.__read)(r.getMax(),2),c=l[0],h=l[1];return new nO(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c-s,h-u)}return new nO((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},t.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?KT.multiply(e.worldTransform,r.worldTransform,e.localTransform):KT.copy(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),LL={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},IL=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,RL=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),DL=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),NL=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!DL.exec(n)&&!RL.exec(t))},this.trimByKinsokuShorui=function(t){var e=(0,aM.__spreadArray)([],(0,aM.__read)(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),i=this.runtime.offscreenCanvas.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=LL.MetricsString+LL.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(LL.BaselineSymbol).width),u=LL.HeightMultiplier*s;s=s*LL.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,u||1).data,c=l.length,h=4*a,p=0,f=0,d=!1;for(p=0;p<s;++p){for(var m=0;m<h;m+=4)if(255!==l[f+m]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=c-h,d=!1,p=u;p>s;--p){for(m=0;m<h;m+=4)if(255!==l[f+m]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,l=e.letterSpacing,c=e.textPath;e.textPathSide,e.textPathStartOffset;var h=e.leading,p=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=fA(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var l=s[u].trim();!eL.test(l)&&tL.indexOf(l)<0&&(l='"'.concat(l,'"')),s[u]=l}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),d=this.measureFont(f,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var m=this.runtime.offscreenCanvas.getOrCreateContext(n);m.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),v=0;if(!c){for(S=0;S<g.length;S++){var _=m.measureText(g[S]).width+(g[S].length-1)*l;y[S]=_,v=Math.max(v,_)}E=v+a;var b=o||d.fontSize+a,x=Math.max(b,d.fontSize+a)+(g.length-1)*(b+p),w=0;return"middle"===s?w=-x/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-x:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:E,height:x,lines:g,lineWidths:y,lineHeight:b+=p,maxLineWidth:v,fontProperties:d,lineMetrics:y.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new nO(n-a/2,w+e*b,t+a,b)}))}}c.getTotalLength();for(var S=0;S<g.length;S++)var E=m.measureText(g[S]).width+(g[S].length-1)*l},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,l=e.textOverflow,c=this.runtime.offscreenCanvas.getOrCreateContext(n),h=o+a,p="";"ellipsis"===l?p="...":l&&"clip"!==l&&(p=l);for(var f=[],d=0,m=0,g={},y=function(t){return r.getFromCache(t,a,g,c)},v=Array.from(p).reduce((function(t,e){return t+y(e)}),0),_=Array.from(t),b=0;b<_.length;b++){var x=_[b],w=t[b-1],S=t[b+1],E=y(x);if(this.isNewline(x)){if(++d>=u){e.isOverflowing=!0;break}m=0,f[d]=""}else{if(m>0&&m+E>h){if(d+1>=u){if(e.isOverflowing=!0,v>0&&v<=h){for(var M=f[d].length,T=0,A=M,C=0;C<M;C++){var O=y(f[d][C]);if(T+O+v>h){A=C;break}T+=O}f[d]=(f[d]||"").slice(0,A)+p}break}if(m=0,f[++d]="",this.isBreakingSpace(x))continue;this.canBreakInLastChar(x)||(f=this.trimToBreakable(f),m=this.sumTextWidthByCache(f[d]||"",g)),this.shouldBreakByKinsokuShorui(x,S)&&(f=this.trimByKinsokuShorui(f),m+=y(w||""))}m+=E,f[d]=(f[d]||"")+x}}return f.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&LL.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&LL.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=(0,aM.__spreadArray)([],(0,aM.__read)(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!IL.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!IL.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),FL={},zL=(CL=new cL,OL=new lL,(AL={})[AC.CIRCLE]=new oL,AL[AC.ELLIPSE]=new aL,AL[AC.RECT]=CL,AL[AC.IMAGE]=CL,AL[AC.GROUP]=CL,AL[AC.LINE]=new sL,AL[AC.TEXT]=new hL(FL),AL[AC.POLYLINE]=OL,AL[AC.POLYGON]=OL,AL[AC.PATH]=new uL,AL[AC.HTML]=null,AL[AC.MESH]=null,AL),BL=function(){var t,e=new hk,n=new dk;return(t={})[HO.PERCENTAGE]=null,t[HO.NUMBER]=new xk,t[HO.ANGLE]=new lk,t[HO.DEFINED_PATH]=new ck,t[HO.PAINT]=e,t[HO.COLOR]=e,t[HO.FILTER]=new pk,t[HO.LENGTH]=n,t[HO.LENGTH_PERCENTAGE]=n,t[HO.LENGTH_PERCENTAGE_12]=new mk,t[HO.LENGTH_PERCENTAGE_14]=new gk,t[HO.COORDINATE]=new _k,t[HO.OFFSET_DISTANCE]=new wk,t[HO.OPACITY_VALUE]=new Sk,t[HO.PATH]=new Ek,t[HO.LIST_OF_POINTS]=new Mk,t[HO.SHADOW_BLUR]=new Tk,t[HO.TEXT]=new Ak,t[HO.TEXT_TRANSFORM]=new Ck,t[HO.TRANSFORM]=new nL,t[HO.TRANSFORM_ORIGIN]=new rL,t[HO.Z_INDEX]=new iL,t[HO.MARKER]=new bk,t}();FL.CameraContribution=pO,FL.AnimationTimeline=null,FL.EasingFunction=null,FL.offscreenCanvas=new bL,FL.nativeHTMLMap=new WeakMap,FL.sceneGraphSelector=new EL,FL.sceneGraphService=new kL(FL),FL.textService=new NL(FL),FL.geometryUpdaterFactory=zL,FL.CSSPropertySyntaxFactory=BL,FL.styleValueRegistry=new uk(FL),FL.layoutRegistry=null,FL.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==s.g)return s.g;throw new Error("Unable to locate global `this`")}(),FL.enableCSSParsing=!0,FL.enableDataset=!1,FL.enableStyleSyntax=!0;var jL=0,UL=new ML(xL.INSERTED,null,"","","",0,"",""),ZL=new ML(xL.REMOVED,null,"","","",0,"",""),VL=new gL(xL.DESTROY),GL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entity=jL++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},e.cullable={strategy:kO.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=FL.enableCSSParsing?{anchor:DO,opacity:DO,fillOpacity:DO,strokeOpacity:DO,fill:DO,stroke:DO,transform:DO,transformOrigin:DO,visibility:DO,pointerEvents:DO,lineWidth:DO,lineCap:DO,lineJoin:DO,increasedLineWidthForHitTesting:DO,fontSize:DO,fontFamily:DO,fontStyle:DO,fontWeight:DO,fontVariant:DO,textAlign:DO,textBaseline:DO,textTransform:DO,zIndex:DO,filter:DO,shadowType:DO}:null,e.parsedStyle={},e.attributes={},e}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw new Error(rO)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return FL.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),UL.relatedNode=this,t.dispatchEvent(UL),t},e.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return ZL.relatedNode=this,t.dispatchEvent(ZL),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),FL.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}},e.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.prototype.matches=function(t){return FL.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return FL.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return FL.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return FL.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return FL.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return FL.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return FL.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(FL.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r)||(n=r,0))})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=(0,aM.__read)(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,(0,aM.__spreadArray)([],(0,aM.__read)(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(VL),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return FL.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return FL.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return FL.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return FL.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return FL.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return FL.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=AO(t);return e=this.attributes[n],FL.enableCSSParsing&&mA(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw new Error(rO)},e.prototype.getAttributeNode=function(t){throw new Error(rO)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(rO)},e.prototype.hasAttributeNS=function(t,e){throw new Error(rO)},e.prototype.removeAttributeNS=function(t,e){throw new Error(rO)},e.prototype.removeAttributeNode=function(t){throw new Error(rO)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(rO)},e.prototype.setAttributeNode=function(t){throw new Error(rO)},e.prototype.setAttributeNodeNS=function(t){throw new Error(rO)},e.prototype.toggleAttribute=function(t,e){throw new Error(rO)},e}(vL);function HL(t){return!!(null==t?void 0:t.nodeName)}var WL,qL=new ML(xL.ATTR_MODIFIED,null,null,null,null,ML.MODIFICATION,null,null),YL={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},XL={anchor:[0,0],fill:jO,stroke:jO,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},$L=(0,aM.__assign)((0,aM.__assign)({},XL),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),KL=(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),JL="data-",QL=function(t){function e(e){var n,r=this;(r=t.call(this)||this).isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=e,r.config.interactive=null!==(n=r.config.capture)&&void 0!==n?n:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||AC.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,FL.enableCSSParsing?XL:$L,r.config.initialParsedStyle),FL.enableCSSParsing&&Object.assign(r.attributes,YL),r.initAttributes(r.config.style);var i=FL.globalThis.Proxy?FL.globalThis.Proxy:function(){};return FL.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(JL).concat(EO(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(JL).concat(EO(e)),n),!0}})),FL.enableStyleSyntax&&(r.style=new i({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return(0,aM.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=(0,aM.__assign)({},this.attributes);for(var r in n){var i=n[r];HL(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};FL.enableCSSParsing&&(n.usedAttributes=KL);var r={};for(var i in t)r[AO(i)]=t[i];FL.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=AO(e);uC(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),t.prototype.setAttribute.call(this,i,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];FL.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(qL.relatedNode=this,qL.prevValue=o,qL.newValue=e,qL.attrName=t,qL.prevParsedValue=a,qL.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(qL):(qL.target=this,this.ownerDocument.defaultView.dispatchEvent(qL,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=(0,aM.__read)(t.getMin(),2),n=e[0],r=e[1],i=(0,aM.__read)(t.getMax(),2),o=i[0],a=i[1];return new nO(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),FL.sceneGraphService.setOrigin(this,FC(t,e,n)),this},e.prototype.getOrigin=function(){return FL.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),FL.sceneGraphService.setPosition(this,FC(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),FL.sceneGraphService.setLocalPosition(this,FC(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),FL.sceneGraphService.translate(this,FC(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),FL.sceneGraphService.translateLocal(this,FC(t,e,n)),this},e.prototype.getPosition=function(){return FL.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return FL.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=FC(t,e=e||t,n=n||t)),FL.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=FC(t,e=e||t,n=n||t)),FL.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return FL.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return FL.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return BC((0,aM.__read)(jC($T.create(),FL.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return BC((0,aM.__read)(jC($T.create(),FL.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return FL.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return FL.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return mA(e)&&mA(n)?FL.sceneGraphService.rotateLocal(this,0,0,t):FL.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return mA(e)&&mA(n)?FL.sceneGraphService.rotate(this,0,0,t):FL.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return FL.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return FL.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return FL.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return FL.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return FL.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return FL.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return FL.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return FL.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return FL.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){FL.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},e.prototype.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=(0,aM.__read)(e,2),i=r[0],o=r[1];return i?sC(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=(0,aM.__read)(KT.getTranslation($T.create(),e),2),r=n[0],i=n[1],o=(0,aM.__read)(KT.getScaling($T.create(),e),2),a=o[0],s=o[1],u=KT.getRotation(eA(),e),l=(0,aM.__read)(jC($T.create(),u),3),c=l[0],h=l[2];return function(t,e,n,r,i){var o,a,s,u,l,c,h,p=Math.cos(t),f=Math.sin(t);return o=r*p,a=i*f,s=-r*f,u=i*p,l=e,c=n,(h=new JT.WT(9))[0]=o,h[1]=a,h[2]=0,h[3]=s,h[4]=u,h[5]=0,h[6]=l,h[7]=c,h[8]=1,h}(c||h,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=(0,aM.__read)(UC(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setEulerAngles(a).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=(0,aM.__read)(UC(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setLocalEulerAngles(a).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){FL.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){FL.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(GL),tI=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({type:AC.CIRCLE,style:FL.enableCSSParsing?(0,aM.__assign)({cx:"",cy:"",r:""},n):(0,aM.__assign)({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:FL.enableCSSParsing?null:[GO,GO]}},r))||this}return(0,aM.__extends)(e,t),e}(QL),eI=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,aM.__rest)(e,["style"]);return(n=t.call(this,(0,aM.__assign)({style:FL.enableCSSParsing?(0,aM.__assign)({x:"",y:""},r):(0,aM.__assign)({},r)},i))||this).isCustomElement=!0,n}return(0,aM.__extends)(e,t),e}(QL),nI=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({type:AC.ELLIPSE,style:FL.enableCSSParsing?(0,aM.__assign)({cx:"",cy:"",rx:"",ry:""},n):(0,aM.__assign)({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:FL.enableCSSParsing?null:[GO,GO]}},r))||this}return(0,aM.__extends)(e,t),e}(QL),rI=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({type:AC.GROUP,style:FL.enableCSSParsing?(0,aM.__assign)({x:"",y:"",width:"",height:""},n):(0,aM.__assign)({},n)},r))||this}return(0,aM.__extends)(e,t),e}(QL),iI=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,aM.__rest)(e,["style"]);return(n=t.call(this,(0,aM.__assign)({type:AC.HTML,style:FL.enableCSSParsing?(0,aM.__assign)({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):(0,aM.__assign)({},r)},i))||this).cullable.enable=!1,n}return(0,aM.__extends)(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new XC;return a.setMinMax([i,o,0],[i+n.width,o+n.height,0]),a}return null},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=KT.invert(KT.create(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!XC.isEmpty(e)){var n=new XC;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(QL),oI=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({type:AC.IMAGE,style:FL.enableCSSParsing?(0,aM.__assign)({x:"",y:"",img:"",width:"",height:""},n):(0,aM.__assign)({},n)},r))||this}return(0,aM.__extends)(e,t),e}(QL),aI=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,aM.__rest)(e,["style"]);(n=t.call(this,(0,aM.__assign)({type:AC.LINE,style:(0,aM.__assign)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},r)},i))||this).markerStartAngle=0,n.markerEndAngle=0;var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&HL(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&HL(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return(0,aM.__extends)(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&HL(r)&&(this.markerStartAngle=0,r.remove()),i&&HL(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&HL(r)&&(this.markerEndAngle=0,r.remove()),i&&HL(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e,n,r,i,o,a,s,u=this.parsedStyle,l=u.markerStart,c=u.markerEnd,h=u.markerStartOffset,p=u.markerEndOffset,f=u.x1,d=u.x2,m=u.y1,g=u.y2,y=u.defX,v=u.defY,_=t?l:c;_&&HL(_)&&(t?(i=f-y,o=m-v,n=d-f,r=g-m,a=h||0,s=this.markerStartAngle):(i=d-y,o=g-v,n=f-d,r=m-g,a=p||0,s=this.markerEndAngle),e=Math.atan2(r,n),_.setLocalEulerAngles(180*e/Math.PI+s),_.setLocalPosition(i+Math.cos(e)*a,o+Math.sin(e)*a))},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2,s=n.defX,u=n.defY,l=vC(r,i,o,a,t),c=l.x,h=l.y,p=$T.transformMat4($T.create(),$T.fromValues(c-s,h-u,0),e?this.getWorldTransform():this.getLocalTransform());return new eO(p[0],p[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return yC(t.x1,t.y1,t.x2,t.y2)},e}(QL),sI=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,aM.__rest)(e,["style"]);(n=t.call(this,(0,aM.__assign)({type:AC.PATH,style:FL.enableCSSParsing?(0,aM.__assign)({path:"",miterLimit:""},r):(0,aM.__assign)({},r),initialParsedStyle:FL.enableCSSParsing?null:{miterLimit:4,path:(0,aM.__assign)({},WO)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,u=o.markerMid;return a&&HL(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),u&&HL(u)&&n.placeMarkerMid(u),s&&HL(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return(0,aM.__extends)(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&HL(r)&&(this.markerStartAngle=0,r.remove()),i&&HL(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&HL(r)&&(this.markerEndAngle=0,r.remove()),i&&HL(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.defX,s=e.defY,u=t?n:r;if(u&&HL(u)){var l,c,h,p,f,d,m;if(t){var g=(0,aM.__read)(this.getStartTangent(),2),y=g[0];p=(v=g[1])[0]-a,f=v[1]-s,c=y[0]-v[0],h=y[1]-v[1],d=i||0,m=this.markerStartAngle}else{var v,_=(0,aM.__read)(this.getEndTangent(),2);y=_[0],p=(v=_[1])[0]-a,f=v[1]-s,c=y[0]-v[0],h=y[1]-v[1],d=o||0,m=this.markerEndAngle}l=Math.atan2(h,c),u.setLocalEulerAngles(180*l/Math.PI+m),u.setLocalPosition(p+Math.cos(l)*d,f+Math.sin(l)*d)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&HL(t))for(var o=1;o<n.length-1;o++){var a=(0,aM.__read)(n[o].currentPoint,2),s=a[0],u=a[1],l=1===o?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,u-i)}},e.prototype.getTotalLength=function(){return SP(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return VA(t,e,(0,aM.__assign)((0,aM.__assign)({},void 0),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,u=$T.transformMat4($T.create(),$T.fromValues(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new eO(u[0],u[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*SP(this),e)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(QL),uI=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,aM.__rest)(e,["style"]);(n=t.call(this,(0,aM.__assign)({type:AC.POLYGON,style:FL.enableCSSParsing?(0,aM.__assign)({points:"",miterLimit:"",isClosed:!0},r):(0,aM.__assign)({},r),initialParsedStyle:FL.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,u=o.markerMid;return a&&HL(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),u&&HL(u)&&n.placeMarkerMid(u),s&&HL(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return(0,aM.__extends)(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&HL(r)&&(this.markerStartAngle=0,r.remove()),i&&HL(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&HL(r)&&(this.markerEndAngle=0,r.remove()),i&&HL(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.points.points,s=e.defX,u=e.defY,l=t?n:r;if(l&&HL(l)){var c,h,p,f,d,m,g;if(f=a[0][0]-s,d=a[0][1]-u,t)h=a[1][0]-a[0][0],p=a[1][1]-a[0][1],m=i||0,g=this.markerStartAngle;else{var y=a.length;this.parsedStyle.isClosed?(h=a[y-1][0]-a[0][0],p=a[y-1][1]-a[0][1]):(f=a[y-1][0]-s,d=a[y-1][1]-u,h=a[y-2][0]-a[y-1][0],p=a[y-2][1]-a[y-1][1]),m=o||0,g=this.markerEndAngle}c=Math.atan2(p,h),l.setLocalEulerAngles(180*c/Math.PI+g),l.setLocalPosition(f+Math.cos(c)*m,d+Math.sin(c)*m)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&HL(t))for(var o=1;o<(this.parsedStyle.isClosed?n.length:n.length-1);o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},e}(QL),lI=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({type:AC.POLYLINE,style:FL.enableCSSParsing?(0,aM.__assign)({points:"",miterLimit:"",isClosed:!1},n):(0,aM.__assign)({},n),initialParsedStyle:FL.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return(0,aM.__extends)(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=o.segments,u=0,l=0;s.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(u=(t-e[0])/(e[1]-e[0]),l=n)}));var c=vC(a[l][0],a[l][1],a[l+1][0],a[l+1][1],u),h=c.x,p=c.y,f=$T.transformMat4($T.create(),$T.fromValues(h-r,p-i,0),e?this.getWorldTransform():this.getLocalTransform());return new eO(f[0],f[1])},e.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(uI),cI=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({type:AC.RECT,style:FL.enableCSSParsing?(0,aM.__assign)({x:"",y:"",width:"",height:"",radius:""},n):(0,aM.__assign)({},n)},r))||this}return(0,aM.__extends)(e,t),e}(QL),hI=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({type:AC.TEXT,style:FL.enableCSSParsing?(0,aM.__assign)({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0},n):(0,aM.__assign)({fill:"black"},n),initialParsedStyle:FL.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},r))||this}return(0,aM.__extends)(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(QL),pI=function(){function t(){this.registry={},this.define(AC.CIRCLE,tI),this.define(AC.ELLIPSE,nI),this.define(AC.RECT,cI),this.define(AC.IMAGE,oI),this.define(AC.LINE,aI),this.define(AC.GROUP,rI),this.define(AC.PATH,sI),this.define(AC.POLYGON,uI),this.define(AC.POLYLINE,lI),this.define(AC.TEXT,hI),this.define(AC.HTML,iI)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),fI=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new FL.AnimationTimeline(e)}catch(t){}var n={};return ik.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=MO(i)?i(AC.GROUP):i)})),e.documentElement=new rI({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?hI:rI);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw new Error(rO)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var u=this.defaultView.viewport2Client({x:r,y:i}),l=u.x,c=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:c},picked:[]}).picked;return h&&h[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return(0,aM.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,l,c,h;return(0,aM.__generator)(this,(function(p){switch(p.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,null]:(u=this.defaultView.viewport2Client({x:r,y:i}),l=u.x,c=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:c},picked:[]})]);case 1:return[2,(h=p.sent().picked)&&h[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var u=this.defaultView.viewport2Client({x:r,y:i}),l=u.x,c=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:c},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h},e.prototype.elementsFromPoint=function(t,e){return(0,aM.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,l,c,h;return(0,aM.__generator)(this,(function(p){switch(p.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,[]]:(u=this.defaultView.viewport2Client({x:r,y:i}),l=u.x,c=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:c},picked:[]})]);case 1:return(h=p.sent().picked)[h.length-1]!==this.documentElement&&h.push(this.documentElement),[2,h]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(iO)},e.prototype.insertBefore=function(t,e){throw new Error(iO)},e.prototype.removeChild=function(t,e){throw new Error(iO)},e.prototype.replaceChild=function(t,e,n){throw new Error(iO)},e.prototype.append=function(){throw new Error(iO)},e.prototype.prepend=function(){throw new Error(iO)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(vL),dI=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new gL(xL.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),mI=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t.tag="DirtyCheck",t}(),gI=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new dL(null),this.rootWheelEvent=new mL(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var u=(0,aM.__values)(s),l=u.next();!l.done;l=u.next()){var c=l.value,h=t.bootstrapEvent(t.rootPointerEvent,c,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var u=(0,aM.__values)(s),l=u.next();!l.done;l=u.next()){var c=l.value,h=t.bootstrapEvent(t.rootPointerEvent,c,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);n.autoPreventDefault&&o[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=(0,aM.__values)(o),s=a.next();!s.done;s=a.next()){var u=s.value,l=n.bootstrapEvent(n.rootPointerEvent,u,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a="outside";try{a=o&&t.target&&t.target!==o&&o.contains&&!o.contains(t.target)?"outside":""}catch(t){}var s=n.normalizeToPointerEvent(t,i);try{for(var u=(0,aM.__values)(s),l=u.next();!l.done;l=u.next()){var c=l.value,h=n.bootstrapEvent(n.rootPointerEvent,c,i,t);h.type+=a,n.context.eventService.mapEvent(h)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=(0,aM.__values)(o),s=a.next();!s.done;s=a.next()){var u=s.value,l=n.bootstrapEvent(n.rootPointerEvent,u,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||mA(r)||mA(i)){var s=this.context.eventService.client2Viewport(new eO(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.prototype.bootstrapEvent=function(t,e,n,r){var i,o;t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var a=(i=this.getViewportXY(e)).x,s=i.y;t.viewport.x=a,t.viewport.y=s;var u=(o=this.context.eventService.viewport2Canvas(t.viewport)).x,l=o.y;return t.canvas.x=u,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Nk[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e,n,r=this.rootWheelEvent;this.transferMouseData(r,t),r.deltaMode=t.deltaMode,r.deltaX=t.deltaX,r.deltaY=t.deltaY,r.deltaZ=t.deltaZ;var i=(e=this.getViewportXY(t)).x,o=e.y;r.viewport.x=i,r.viewport.y=o;var a=(n=this.context.eventService.viewport2Canvas(r.viewport)).x,s=n.y;return r.canvas.x=a,r.canvas.y=s,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.nativeEvent=t,r.type=t.type,r},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];uC(i.button)&&(i.button=0),uC(i.buttons)&&(i.buttons=1),uC(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),uC(i.width)&&(i.width=i.radiusX||1),uC(i.height)&&(i.height=i.radiusY||1),uC(i.tiltX)&&(i.tiltX=0),uC(i.tiltY)&&(i.tiltY=0),uC(i.pointerType)&&(i.pointerType="touch"),uC(i.pointerId)&&(i.pointerId=i.identifier||0),uC(i.pressure)&&(i.pressure=i.force||.5),uC(i.twist)&&(i.twist=0),uC(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;uC(o.isPrimary)&&(o.isPrimary=!0),uC(o.width)&&(o.width=1),uC(o.height)&&(o.height=1),uC(o.tiltX)&&(o.tiltX=0),uC(o.tiltY)&&(o.tiltY=0),uC(o.pointerType)&&(o.pointerType="mouse"),uC(o.pointerId)&&(o.pointerId=1),uC(o.pressure)&&(o.pressure=.5),uC(o.twist)&&(o.twist=0),uC(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),yI=[AC.CIRCLE,AC.ELLIPSE,AC.IMAGE,AC.RECT,AC.LINE,AC.POLYLINE,AC.POLYGON,AC.TEXT,AC.PATH,AC.HTML],vI=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(XC.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||YC.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==YC.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===YC.OUTSIDE||n===YC.INSIDE)return n;for(var i=YC.INSIDE,o=yI.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var u=1<<a;if(0!=(n&u)&&(!o||4!==a&&5!==a)){var l=r[a],c=l.normal,h=l.distance;if($T.dot(c,e.getPositiveFarPoint(r[a]))+h<0)return YC.OUTSIDE;$T.dot(c,e.getNegativeFarPoint(r[a]))+h<0&&(i|=u)}}return i},t}(),_I=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=e.rBushRoot,a=i.root.ownerDocument.defaultView;this.rBush=o;var s=function(t){t.target.renderable.dirty=!0,r.dirtify()},u=function(t){var e=t.detail.affectChildren,i=t.target;e&&i.forEach((function(t){n.toSync.add(t)}));for(var o=i;o;)o.renderable&&n.toSync.add(o),o=o.parentElement;r.dirtify()},l=function(t){var e=t.target;FL.enableCSSParsing&&FL.styleValueRegistry.recalc(e),FL.sceneGraphService.dirtifyToRoot(e),r.dirtify()},c=function(t){var e=t.target,i=e.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(e),FL.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){a.addEventListener(xL.MOUNTED,l),a.addEventListener(xL.UNMOUNTED,c),a.addEventListener(xL.ATTR_MODIFIED,s),a.addEventListener(xL.BOUNDS_CHANGED,u)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(xL.MOUNTED,l),a.removeEventListener(xL.UNMOUNTED,c),a.removeEventListener(xL.ATTR_MODIFIED,s),a.removeEventListener(xL.BOUNDS_CHANGED,u),n.toSync.clear()})),r.hooks.endFrame.tap(t.tag,(function(){n.syncRTree()}))},t.prototype.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r,i,o=n.rBushNode;o&&o.aabb&&t.rBush.remove(o.aabb);var a=n.getRenderBounds();if(a){var s=(r=(0,aM.__read)(a.getMin(),2))[0],u=r[1],l=(i=(0,aM.__read)(a.getMax(),2))[0],c=i[1];o.aabb||(o.aabb={}),o.aabb.displayObject=n,o.aabb.minX=s,o.aabb.minY=u,o.aabb.maxX=l,o.aabb.maxY=c}o.aabb&&(isNaN(o.aabb.maxX)||isNaN(o.aabb.maxX)||isNaN(o.aabb.minX)||isNaN(o.aabb.minY)||e.push(o.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(WL||(WL={}));var bI=new gL(xL.MOUNTED),xI=new gL(xL.UNMOUNTED),wI=new gL(WL.BEFORE_RENDER),SI=new gL(WL.RERENDER),EI=new gL(WL.AFTER_RENDER),MI=function(t){function e(e){var n=t.call(this)||this;n.Element=QL,n.inited=!1,n.context={},n.document=new fI,n.document.defaultView=n,n.customElements=new pI;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,u=e.devicePixelRatio,l=e.renderer,c=e.background,h=e.cursor,p=e.document,f=e.requestAnimationFrame,d=e.cancelAnimationFrame,m=e.createImage,g=e.supportsPointerEvents,y=e.supportsTouchEvents,v=e.supportsCSSTransform,_=e.useNativeClickEvent,b=e.alwaysTriggerPointerEventOnCanvas,x=e.isTouchEvent,w=e.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||Pk++;Ok[n]&&Ok[n].destroy(),Ok[n]=e}}(r,n);var S=a,E=s,M=u;return i&&(M=(M=u||kk&&window.devicePixelRatio||1)>=1?Math.ceil(M):1,S=a||function(t){var e=Dk(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/M,E=s||function(t){var e=Dk(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/M),n.devicePixelRatio=M,n.requestAnimationFrame=null!=f?f:qk.bind(FL.globalThis),n.cancelAnimationFrame=null!=d?d:Yk.bind(FL.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in FL.globalThis,n.supportsPointerEvents=null!=g?g:!!FL.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof FL.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!FL.globalThis.MouseEvent||t instanceof FL.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof FL.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:S,height:E,renderer:l,offscreenCanvas:o,devicePixelRatio:M,cursor:h||"default",background:c||"transparent",createImage:m,document:p,supportsCSSTransform:v,useNativeClickEvent:_,alwaysTriggerPointerEventOnCanvas:b}),n.initDefaultCamera(S,E,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return(0,aM.__extends)(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new FL.CameraContribution;i.clipSpaceNearZ=n,i.setType(KC.EXPLORING,JC.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(cO,(function(){r.context.renderingContext.renderReasons.add(Xk.CAMERA_CHANGED)})),this.context.camera=i},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new gL(WL.BEFORE_DESTROY)),this.frameId&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new gL(WL.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===QC.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new gL(WL.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(wI),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(SI)})),this.dispatchEvent(EI)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new OC,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new gI,new _I,new mI,new dI([new vI])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService((0,aM.__assign)((0,aM.__assign)({},FL),this.context)),this.context.renderingService=new wL(FL,this.context),this.context.eventService=new _L(FL,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new gL(WL.READY))})):r.dispatchEvent(new gL(WL.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new gL(WL.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(FL)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),(0,aM.__spreadArray)([],(0,aM.__read)(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(FL)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(xI):(xI.target=t,this.dispatchEvent(xI,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(bI):(bI.target=t,this.dispatchEvent(bI,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(yL),TI=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.landmarks=[],e}return(0,aM.__extends)(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=NC(e),this.relAzimuth=NC(t),this.relRoll=NC(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===KC.EXPLORING){var r=nA(eA(),[1,0,0],zC((this.rotateWorld?1:-1)*this.relElevation)),i=nA(eA(),[0,1,0],zC((this.rotateWorld?1:-1)*this.relAzimuth)),o=nA(eA(),[0,0,1],zC(this.relRoll)),a=rA(eA(),i,r);a=rA(eA(),a,o);var s=KT.fromQuat(KT.create(),a);KT.translate(this.matrix,this.matrix,[0,0,-this.distance]),KT.multiply(this.matrix,this.matrix,s),KT.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===KC.ORBITING||this.type===KC.EXPLORING?this._getPosition():this.type===KC.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=FC(t,e,0),r=$T.clone(this.position);return $T.add(r,r,$T.scale($T.create(),this.right,n[0])),$T.add(r,r,$T.scale($T.create(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=$T.clone(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===KC.ORBITING||this.type===KC.EXPLORING?this._getDistance():this.type===KC.TRACKING&&$T.add(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.prototype.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,s=void 0===a?this.position:a,u=e.focalPoint,l=void 0===u?this.focalPoint:u,c=e.roll,h=e.zoom,p=new FL.CameraContribution;p.setType(this.type,void 0),p.setPosition(s[0],null!==(n=s[1])&&void 0!==n?n:this.position[1],null!==(r=s[2])&&void 0!==r?r:this.position[2]),p.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),p.setRoll(null!=c?c:this.roll),p.setZoom(null!=h?h:this.zoom);var f={name:t,matrix:KT.clone(p.getWorldTransform()),right:$T.clone(p.right),up:$T.clone(p.up),forward:$T.clone(p.forward),position:$T.clone(p.getPosition()),focalPoint:$T.clone(p.getFocalPoint()),distanceVector:$T.clone(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(f),f},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=gA(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=fA(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,l=i.easingFunction,c=void 0===l?void 0:l,h=i.onfinish,p=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(p&&p());this.cancelLandmarkAnimation();var f,d=r.position,m=r.focalPoint,g=r.zoom,y=r.roll,v=c||FL.EasingFunction(a),_=function(){n.setFocalPoint(m),n.setPosition(d),n.setRoll(y),n.setZoom(g),n.computeMatrix(),n.triggerUpdate(),p&&p()},b=function(t){void 0===f&&(f=t);var e=t-f;if(e>u)_();else{var r,i,o=v(e/u),a=$T.create(),s=$T.create();$T.lerp(a,n.focalPoint,m,o),$T.lerp(s,n.position,d,o),i=n.roll*(1-o)+y*o,r=n.zoom*(1-o)+g*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),$T.dist(a,m)+$T.dist(s,d)<=.01&&null==g&&null==y?_():(n.computeMatrix(),n.triggerUpdate(),e<u&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(b)))}};this.canvas.requestAnimationFrame(b)}},e.prototype.syncFromLandmark=function(t){this.matrix=KT.copy(this.matrix,t.matrix),this.right=$T.copy(this.right,t.right),this.up=$T.copy(this.up,t.up),this.forward=$T.copy(this.forward,t.forward),this.position=$T.copy(this.position,t.position),this.focalPoint=$T.copy(this.focalPoint,t.focalPoint),this.distanceVector=$T.copy(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(pO);FL.CameraContribution=TI;var AI,CI,OI=function(){function t(t,e){this.type=t,this.target=e,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[]}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),PI=0,kI=new WeakMap,LI=function(){function t(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}return t.prototype.enqueue=function(t){var e,n,r=this.observer.records,i=r.length;if(r.length>0){var o=(n=r[i-1])===t?n:CI&&function(t){return t===CI||t===AI}(n)?CI:null;if(o)return void(r[i-1]=o)}else e=this.observer,NI.push(e),DI||(DI=!0,void 0!==FL.globalThis?FL.globalThis.setTimeout(FI):FI());r[i]=t},t.prototype.addListeners=function(){this.addListeners_(this.target)},t.prototype.addListeners_=function(t){var e=this.options;e.attributes&&t.addEventListener(xL.ATTR_MODIFIED,this,!0),e.childList&&t.addEventListener(xL.INSERTED,this,!0),(e.childList||e.subtree)&&t.addEventListener(xL.REMOVED,this,!0)},t.prototype.removeListeners=function(){this.removeListeners_(this.target)},t.prototype.removeListeners_=function(t){var e=this.options;e.attributes&&t.removeEventListener(xL.ATTR_MODIFIED,this,!0),e.childList&&t.removeEventListener(xL.INSERTED,this,!0),(e.childList||e.subtree)&&t.removeEventListener(xL.REMOVED,this,!0)},t.prototype.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=kI.get(t),n=0;n<e.length;n++)if(e[n]===this){e.splice(n,1);break}}),this)},t.prototype.handleEvent=function(t){var e,n;switch(t.stopImmediatePropagation(),t.type){case xL.ATTR_MODIFIED:var r=t.attrName,i=t.relatedNode.namespaceURI;n=t.target,(e=II("attributes",n)).attributeName=r,e.attributeNamespace=i;var o=t.attrChange===ML.ADDITION?null:t.prevValue;RI(n,(function(t){var n;if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(r)||-1!==t.attributeFilter.indexOf(i)))return t.attributeOldValue?(n=o,CI||((CI=OI.copy(AI)).oldValue=n,CI)):e}));break;case xL.REMOVED:case xL.INSERTED:n=t.relatedNode;var a=t.target,s=void 0,u=void 0;t.type===xL.INSERTED?(s=[a],u=[]):(s=[],u=[a]);var l=a.previousSibling,c=a.nextSibling;(e=II("childList",n)).addedNodes=s,e.removedNodes=u,e.previousSibling=l,e.nextSibling=c,RI(n,(function(t){if(t.childList)return e}))}AI=CI=void 0},t}();function II(t,e){return AI=new OI(t,e)}function RI(t,e){for(var n=t;n;n=n.parentNode){var r=kI.get(n);if(r)for(var i=0;i<r.length;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}!function(){function t(t){this.callback=t,this.nodes=[],this.records=[],this.uid=PI++}t.prototype.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=kI.get(t);r||kI.set(t,r=[]);for(var i=0;i<r.length;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new LI(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},t.prototype.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=kI.get(e),r=0;r<n.length;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},t.prototype.takeRecords=function(){var t=this.records;return this.records=[],t}}();var DI=!1,NI=[];function FI(){DI=!1;var t=NI;NI=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=kI.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&FI()}var zI=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return(0,aM.__extends)(e,t),e}(pL),BI=0,jI=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(BI++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new zI(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},t.prototype.persist=function(){throw new Error(rO)},t.prototype.addEventListener=function(t,e,n){throw new Error(rO)},t.prototype.removeEventListener=function(t,e,n){throw new Error(rO)},t.prototype.dispatchEvent=function(t){throw new Error(rO)},t.prototype.commitStyles=function(){throw new Error(rO)},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new zI(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new zI(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),UI=.1,ZI="function"==typeof Float32Array,VI=function(t,e){return 1-3*e+3*t},GI=function(t,e){return 3*e-6*t},HI=function(t){return 3*t},WI=function(t,e,n){return((VI(e,n)*t+GI(e,n))*t+HI(e))*t},qI=function(t,e,n){return 3*VI(e,n)*t*t+2*GI(e,n)*t+HI(e)},YI=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=ZI?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=WI(o*UI,t,n);return function(o){return 0===o||1===o?o:WI(function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=UI;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*UI,s=qI(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=qI(e,n,r);if(0===o)return e;e-=(WI(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=WI(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+UI,t,n)}(o),e,r)}},XI=function(t){return Math.pow(t,2)},$I=function(t){return Math.pow(t,3)},KI=function(t){return Math.pow(t,4)},JI=function(t){return Math.pow(t,5)},QI=function(t){return Math.pow(t,6)},tR=function(t){return 1-Math.cos(t*Math.PI/2)},eR=function(t){return 1-Math.sqrt(1-t*t)},nR=function(t){return t*t*(3*t-2)},rR=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},iR=function(t,e){void 0===e&&(e=[]);var n=(0,aM.__read)(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=yA(Number(i),1,10),u=yA(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-u/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/u)},oR=function(t,e,n){void 0===e&&(e=[]);var r=(0,aM.__read)(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,u=r[2],l=void 0===u?10:u,c=r[3],h=void 0===c?0:c;o=yA(o,.1,1e3),s=yA(s,.1,1e3),l=yA(l,.1,1e3),h=yA(h,.1,1e3);var p=Math.sqrt(s/o),f=l/(2*Math.sqrt(s*o)),d=f<1?p*Math.sqrt(1-f*f):0,m=f<1?(f*p-h)/d:-h+p,g=n?n*t/1e3:t;return g=f<1?Math.exp(-g*f*p)*(1*Math.cos(d*g)+m*Math.sin(d*g)):(1+m*g)*Math.exp(-g*p),0===t||1===t?t:1-g},aR=function(t,e){void 0===e&&(e=[]);var n=(0,aM.__read)(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(yA(t,0,1)*i)/i},sR=function(t,e){void 0===e&&(e=[]);var n=(0,aM.__read)(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return YI(r,i,o,a)(t)},uR=YI(.42,0,1,1),lR=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},cR=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},hR=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},pR={steps:aR,"step-start":function(t){return aR(t,[1,"start"])},"step-end":function(t){return aR(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":sR,ease:function(t){return sR(t,[.25,.1,.25,1])},in:uR,out:lR(uR),"in-out":cR(uR),"out-in":hR(uR),"in-quad":XI,"out-quad":lR(XI),"in-out-quad":cR(XI),"out-in-quad":hR(XI),"in-cubic":$I,"out-cubic":lR($I),"in-out-cubic":cR($I),"out-in-cubic":hR($I),"in-quart":KI,"out-quart":lR(KI),"in-out-quart":cR(KI),"out-in-quart":hR(KI),"in-quint":JI,"out-quint":lR(JI),"in-out-quint":cR(JI),"out-in-quint":hR(JI),"in-expo":QI,"out-expo":lR(QI),"in-out-expo":cR(QI),"out-in-expo":hR(QI),"in-sine":tR,"out-sine":lR(tR),"in-out-sine":cR(tR),"out-in-sine":hR(tR),"in-circ":eR,"out-circ":lR(eR),"in-out-circ":cR(eR),"out-in-circ":hR(eR),"in-back":nR,"out-back":lR(nR),"in-out-back":cR(nR),"out-in-back":hR(nR),"in-bounce":rR,"out-bounce":lR(rR),"in-out-bounce":cR(rR),"out-in-bounce":hR(rR),"in-elastic":iR,"out-elastic":lR(iR),"in-out-elastic":cR(iR),"out-in-elastic":hR(iR),spring:oR,"spring-in":oR,"spring-out":lR(oR),"spring-in-out":cR(oR),"spring-out-in":hR(oR)},fR=function(t){return pR[function(t){return(e=t,"-"===(e=e.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?e.substring(1):e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim();var e}(t)]||pR.linear},dR=function(t){return t},mR=1,gR=.5,yR=0;function vR(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var _R="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",bR=new RegExp("cubic-bezier\\("+_R+","+_R+","+_R+","+_R+"\\)"),xR=/steps\(\s*(\d+)\s*\)/,wR=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function SR(t){var e=bR.exec(t);if(e)return YI.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e.slice(1).map(Number)),!1));var n=xR.exec(t);if(n)return vR(Number(n[1]),yR);var r=wR.exec(t);return r?vR(Number(r[1]),{start:mR,middle:gR,end:yR}[r[2]]):fR(t)}function ER(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var MR=function(t,e,n){return function(r){var i=AR(t,e,r);return!FL.enableCSSParsing&&fA(i)?i:n(i)}};function TR(t,e,n,r){var i=ak[t];if(i&&i.syntax&&i.int){var o=FL.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(FL.enableCSSParsing){var u=FL.styleValueRegistry.parseProperty(t,e,r),l=FL.styleValueRegistry.parseProperty(t,n,r);a=FL.styleValueRegistry.computeProperty(t,u,r),s=FL.styleValueRegistry.computeProperty(t,l,r)}else{var c=o.parserWithCSSDisabled;a=c?c(e,r):e,s=c?c(n,r):n}var h=o.mixer(a,s,r);if(h){var p=MR.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(h),!1));return function(t){return 0===t?e:1===t?n:p(t)}}}}return MR(!1,!0,(function(t){return t?n:e}))}function AR(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(AR(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var CR=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=dR,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=SR(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function OR(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(mA(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var s=n[a].computedOffset;if(!mA(s)&&!mA(o)){for(var u=1;u<a-i;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var PR="backwards|forwards|both|none".split("|"),kR="reverse|alternate|alternate-reverse".split("|");var LR=function(){function t(t,e,n){var r,i=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=function(t,e){return function(t,e){var n=new CR;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===PR.indexOf(t[e]))return;if("direction"===e&&-1===kR.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}(null!=t?t:{duration:"auto"}),e)}(n,!1),this.timing.effect=this,this.timing.activeDuration=(r=this.timing,Math.abs(function(t){var e;return 0===t.duration||0===t.iterations?0:("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(r)/(r.playbackRate||1))),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=OR(e,this.timing),this.interpolations=function(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(ER(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:SR(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,u=i[a].computedOffset,l=i[s].computedOffset,c=u,h=l;0===o&&(c=-1/0,0===l&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:c,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:TR(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:n.easingFunction(r/i);t.setAttribute(n.property,n.interpolation(o))}));else for(var n in r)ER(n)&&t.setAttribute(n,null)}}(this.normalizedKeyframes,this.timing,this.target);var o=FL.globalThis.Proxy;this.computedTiming=o?new o(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=function(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=l,n.easingFunction(l)}(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=OR(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function IR(t,e){return Number(t.id)-Number(e.id)}var RR=function(){function t(t){var e=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(IR),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new LR(t,e,n),i=new jI(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(IR),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,(0,aM.__spreadArray)([],(0,aM.__read)(a),!1)),(i=this.pendingEffects).push.apply(i,(0,aM.__spreadArray)([],(0,aM.__read)(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,l]},t}();FL.EasingFunction=SR,FL.AnimationTimeline=RR;const DR="main-layer",NR="label-layer",FR="element",zR="view",BR="plot",jR="component",UR="label",ZR="area";function VR(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function GR(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(0,0,i,0,2*Math.PI)}}function HR(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,u=e.defX,l=void 0===u?0:u,c=e.defY,h=void 0===c?0:c,p=e.markerStart,f=e.markerEnd,d=e.markerStartOffset,m=e.markerEndOffset,g=0,y=0,v=0,_=0,b=0;p&&HL(p)&&d&&(n=a-i,r=s-o,b=Math.atan2(r,n),g=Math.cos(b)*(d||0),y=Math.sin(b)*(d||0)),f&&HL(f)&&m&&(n=i-a,r=o-s,b=Math.atan2(r,n),v=Math.cos(b)*(m||0),_=Math.sin(b)*(m||0)),t.moveTo(i-l+g,o-h+y),t.lineTo(a-l+v,s-h+_)}function WR(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,u=e.markerStart,l=e.markerEnd,c=e.markerStartOffset,h=e.markerEndOffset,p=e.path,f=p.absolutePath,d=p.segments,m=0,g=0,y=0,v=0,_=0;if(u&&HL(u)&&c){var b=(0,aM.__read)(u.parentNode.getStartTangent(),2),x=b[0],w=b[1];n=x[0]-w[0],r=x[1]-w[1],_=Math.atan2(r,n),m=Math.cos(_)*(c||0),g=Math.sin(_)*(c||0)}if(l&&HL(l)&&h){var S=(0,aM.__read)(l.parentNode.getEndTangent(),2);x=S[0],w=S[1],n=x[0]-w[0],r=x[1]-w[1],_=Math.atan2(r,n),y=Math.cos(_)*(h||0),v=Math.sin(_)*(h||0)}for(var E=0;E<f.length;E++){var M=f[E],T=M[0],A=f[E+1],C=0===E&&(0!==m||0!==g),O=(E===f.length-1||A&&("M"===A[0]||"Z"===A[0]))&&0!==y&&0!==v;switch(T){case"M":C?(t.moveTo(M[1]-o+m,M[2]-s+g),t.lineTo(M[1]-o,M[2]-s)):t.moveTo(M[1]-o,M[2]-s);break;case"L":O?t.lineTo(M[1]-o+y,M[2]-s+v):t.lineTo(M[1]-o,M[2]-s);break;case"Q":t.quadraticCurveTo(M[1]-o,M[2]-s,M[3]-o,M[4]-s),O&&t.lineTo(M[3]-o+y,M[4]-s+v);break;case"C":t.bezierCurveTo(M[1]-o,M[2]-s,M[3]-o,M[4]-s,M[5]-o,M[6]-s),O&&t.lineTo(M[5]-o+y,M[6]-s+v);break;case"A":var P=d[E].arcParams,k=P.cx,L=P.cy,I=P.rx,R=P.ry,D=P.startAngle,N=P.endAngle,F=P.xRotation,z=P.sweepFlag;if(t.ellipse)t.ellipse(k-o,L-s,I,R,F,D,N,!!(1-z));else{var B=I>R?I:R,j=I>R?1:I/R,U=I>R?R/I:1;t.translate(k-o,L-s),t.rotate(F),t.scale(j,U),t.arc(0,0,B,D,N,!!(1-z)),t.scale(1/j,1/U),t.rotate(-F),t.translate(-(k-o),-(L-s))}O&&t.lineTo(M[6]-o+y,M[7]-s+v);break;case"Z":t.closePath()}}}function qR(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,u=e.markerStart,l=e.markerEnd,c=e.markerStartOffset,h=e.markerEndOffset,p=e.points.points,f=p.length,d=p[0][0]-o,m=p[0][1]-s,g=p[f-1][0]-o,y=p[f-1][1]-s,v=0,_=0,b=0,x=0,w=0;u&&HL(u)&&c&&(n=p[1][0]-p[0][0],r=p[1][1]-p[0][1],w=Math.atan2(r,n),v=Math.cos(w)*(c||0),_=Math.sin(w)*(c||0)),l&&HL(l)&&h&&(n=p[f-1][0]-p[0][0],r=p[f-1][1]-p[0][1],w=Math.atan2(r,n),b=Math.cos(w)*(h||0),x=Math.sin(w)*(h||0)),t.moveTo(d+(v||b),m+(_||x));for(var S=1;S<f-1;S++){var E=p[S];t.lineTo(E[0]-o,E[1]-s)}t.lineTo(g,y)}function YR(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,u=e.markerStart,l=e.markerEnd,c=e.markerStartOffset,h=e.markerEndOffset,p=e.points.points,f=p.length,d=p[0][0]-o,m=p[0][1]-s,g=p[f-1][0]-o,y=p[f-1][1]-s,v=0,_=0,b=0,x=0,w=0;u&&HL(u)&&c&&(n=p[1][0]-p[0][0],r=p[1][1]-p[0][1],w=Math.atan2(r,n),v=Math.cos(w)*(c||0),_=Math.sin(w)*(c||0)),l&&HL(l)&&h&&(n=p[f-2][0]-p[f-1][0],r=p[f-2][1]-p[f-1][1],w=Math.atan2(r,n),b=Math.cos(w)*(h||0),x=Math.sin(w)*(h||0)),t.moveTo(d+v,m+_);for(var S=1;S<f-1;S++){var E=p[S];t.lineTo(E[0]-o,E[1]-s)}t.lineTo(g+b,y+x)}function XR(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i;if(n&&n.some((function(t){return 0!==t}))){var s=r>0?1:-1,u=i>0?1:-1,l=s+u===0,c=(0,aM.__read)(n.map((function(t){return yA(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),h=c[0],p=c[1],f=c[2],d=c[3];t.moveTo(s*h,0),t.lineTo(o-s*p,0),0!==p&&t.arc(o-s*p,u*p,p,-u*Math.PI/2,s>0?0:Math.PI,l),t.lineTo(o,a-u*f),0!==f&&t.arc(o-s*f,a-u*f,f,s>0?0:Math.PI,u>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(s*d,a),0!==d&&t.arc(s*d,a-u*d,d,u>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,l),t.lineTo(0,u*h),0!==h&&t.arc(s*h,u*h,h,s>0?Math.PI:0,u>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,o,a)}var $R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-path-generator",e}return(0,aM.__extends)(e,t),e.prototype.init=function(){var t,e=((t={})[AC.CIRCLE]=VR,t[AC.ELLIPSE]=GR,t[AC.RECT]=XR,t[AC.LINE]=HR,t[AC.POLYLINE]=YR,t[AC.POLYGON]=qR,t[AC.PATH]=WR,t[AC.TEXT]=void 0,t[AC.GROUP]=void 0,t[AC.IMAGE]=void 0,t[AC.HTML]=void 0,t[AC.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(PC),KR=$T.create(),JR=$T.create(),QR=$T.create(),tD=KT.create(),eD=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=KT.invert(tD,r),s=$T.transformMat4(JR,$T.set(QR,n[0],n[1],0),a),u=e.getGeometryBounds().halfExtents,l=e.parsedStyle.anchor;if(s[0]+=(l&&l[0]||0)*u[0]*2,s[1]+=(l&&l[1]||0)*u[1]*2,o(e,new eO(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvas.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,(function(t){return(0,aM.__awaiter)(i,void 0,void 0,(function(){return(0,aM.__generator)(this,(function(e){return[2,this.pick(s,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))},t.prototype.pick=function(t,e){var n,r,i,o=e.topmost,a=(n=e.position).x,s=n.y,u=$T.set(KR,a,s,0),l=t.elementsFromBBox(u[0],u[1],u[0],u[1]),c=[];try{for(var h=(0,aM.__values)(l),p=h.next();!p.done;p=h.next()){var f=p.value,d=f.getWorldTransform();if(this.isHit(f,u,d,!1)){var m=Rk(f);if(m){var g=m.parsedStyle.clipPath;if(this.isHit(g,u,g.getWorldTransform(),!0)){if(o)return e.picked=[f],e;c.push(f)}}else{if(o)return e.picked=[f],e;c.push(f)}}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return e.picked=c,e},t.tag="CanvasPicker",t}();function nD(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.lineWidth,u=r.increasedLineWidthForHitTesting,l=r.pointerEvents,c=((s||0)+(u||0))/2,h=cC(i,i,e.x,e.y),p=(0,aM.__read)(Fk(l,o,a),2),f=p[0],d=p[1];return f&&d||n?h<=i+c:f?h<=i:!!d&&h>=i-c&&h<=i+c}function rD(t,e,n,r){return t/(n*n)+e/(r*r)}function iD(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.fill,s=r.stroke,u=r.lineWidth,l=r.increasedLineWidthForHitTesting,c=r.pointerEvents,h=e.x,p=e.y,f=(0,aM.__read)(Fk(c,a,s),2),d=f[0],m=f[1],g=((u||0)+(l||0))/2,y=(h-i)*(h-i),v=(p-o)*(p-o);return d&&m||n?rD(y,v,i+g,o+g)<=1:d?rD(y,v,i,o)<=1:!!m&&rD(y,v,i-g,o-g)>=1&&rD(y,v,i+g,o+g)<=1}function oD(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function aD(t,e,n,r,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(u),y:e+n*Math.sin(u)};return cC(l.x,l.y,a,s)<=o/2}function sD(t,e,n,r,i,o,a){var s=Math.min(t,n),u=Math.max(t,n),l=Math.min(e,r),c=Math.max(e,r),h=i/2;return o>=s-h&&o<=u+h&&a>=l-h&&a<=c+h&&function(t,e,n,r,i,o){var a=[n-t,r-e];if(cA.I6(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];cA.Fv(s,s);var u=[i-t,o-e];return Math.abs(cA.AK(u,s))}(t,e,n,r,o,a)<=i/2}function uD(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++)if(sD(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0;if(i){var s=t[0],u=t[o-1];if(sD(s[0],s[1],u[0],u[1],e,n,r))return!0}return!1}var lD=1e-6;function cD(t){return Math.abs(t)<lD?0:t<0?-1:1}function hD(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function pD(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(hD(a,s,[e,n]))return!0;cD(a[1]-n)>0!=cD(s[1]-n)>0&&cD(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function fD(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=pD(t[i],e,n));i++);return r}function dD(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,u=r.lineWidth,l=r.increasedLineWidthForHitTesting,c=r.defX,h=void 0===c?0:c,p=r.defY,f=void 0===p?0:p,d=r.pointerEvents,m=r.fill,g=r.stroke;return!(!(0,aM.__read)(Fk(d,m,g),2)[1]&&!n||!u)&&sD(i,o,a,s,(u||0)+(l||0),e.x+h,e.y+f)}function mD(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,u=a.increasedLineWidthForHitTesting,l=a.stroke,c=a.fill,h=a.defX,p=void 0===h?0:h,f=a.defY,d=void 0===f?0:f,m=a.path,g=a.pointerEvents,y=m.segments,v=m.hasArc,_=m.polylines,b=m.polygons,x=(0,aM.__read)(Fk(g,(null==b?void 0:b.length)&&c,l),2),w=x[0],S=x[1],E=SP(t),M=!1;return w||n?M=v?r(t,e):fD(b,e.x+p,e.y+d)||fD(_,e.x+p,e.y+d):((S||n)&&(M=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var u=t[s],l=u.currentPoint,c=u.params,h=u.prePoint,p=u.box;if(!p||oD(p.x-a,p.y-a,p.width+e,p.height+e,n,r))switch(u.command){case"L":case"Z":if(o=sD(h[0],h[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(y=h[0],v=h[1],_=c[1],b=c[2],x=c[3],w=c[4],M=void 0,M=function(t,e,n,r,i,o,a,s){return gC([t,n,i],[e,r,o],a,s,SC)}(y,v,_,b,x,w,S=n,E=r),o=cC(M.x,M.y,S,E)<=e/2)return!0;break;case"C":if(o=wC(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],n,r,i)<=e/2)return!0;break;case"A":u.cubicParams||(u.cubicParams=JA(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],c[7],void 0));for(var f=u.cubicParams,d=h,m=0;m<f.length;m+=6){var g=wC(d[0],d[1],f[m],f[m+1],f[m+2],f[m+3],f[m+4],f[m+5],n,r,i);if(d=[f[m+4],f[m+5]],o=g<=e/2)return!0}}}var y,v,_,b,x,w,S,E,M;return o}(y,(s||0)+(u||0),e.x+p,e.y+d,E)),M)}function gD(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,u=r.points,l=r.defX,c=void 0===l?0:l,h=r.defY,p=void 0===h?0:h,f=r.pointerEvents,d=(0,aM.__read)(Fk(f,o,i),2),m=d[0],g=!1;return(d[1]||n)&&(g=uD(u.points,(a||0)+(s||0),e.x+c,e.y+p,!0)),g||!m&&!n||(g=pD(u.points,e.x+c,e.y+p)),g}function yD(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,u=void 0===s?0:s,l=r.defY,c=void 0===l?0:l,h=r.pointerEvents,p=r.fill,f=r.stroke;return!(!(0,aM.__read)(Fk(h,p,f),2)[1]&&!n||!i)&&uD(a.points,(i||0)+(o||0),e.x+u,e.y+c,!1)}function vD(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,u=o.stroke,l=o.lineWidth,c=o.increasedLineWidthForHitTesting,h=o.width,p=o.height,f=o.pointerEvents,d=(0,aM.__read)(Fk(f,s,u),2),m=d[0],g=d[1],y=(l||0)+(c||0);if(a&&a.some((function(t){return 0!==t}))){var v=!1;return(g||n)&&(v=function(t,e,n,r,i,o,a,s){var u=(0,aM.__read)(i,4),l=u[0],c=u[1],h=u[2],p=u[3];return sD(0+l,0,0+n-c,0,o,a,s)||sD(0+n,0+c,0+n,0+r-h,o,a,s)||sD(0+n-h,0+r,0+p,0+r,o,a,s)||sD(0,0+r-p,0,0+l,o,a,s)||aD(0+n-c,0+c,c,Math.PI,Math.PI,o,a,s)||aD(0+n-h,0+r-h,h,0,Math.PI,o,a,s)||aD(0+p,0+r-p,p,Math.PI,Math.PI,o,a,s)||aD(0+l,0+l,l,Math.PI,Math.PI,o,a,s)}(0,0,h,p,a.map((function(t){return yA(t,0,Math.min(Math.abs(h)/2,Math.abs(p)/2))})),y,e.x,e.y)),v||!m&&!n||(v=r(t,e)),v}var _=y/2;return m&&g||n?oD(0-_,0-_,h+_,p+_,e.x,e.y):m?oD(0,0,h,p,e.x,e.y):!!g&&function(t,e,n,r,i,o,a){var s=i/2;return oD(0-s,0-s,n,i,o,a)||oD(0+n-s,0-s,i,r,o,a)||oD(0+s,0+r-s,n,i,o,a)||oD(0-s,0+s,i,r,o,a)}(0,0,h,p,y,e.x,e.y)}function _D(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,u=a.width,l=a.height;if("non-transparent-pixel"===s){var c=i.config.offscreenCanvas,h=o.offscreenCanvas.getOrCreateCanvas(c),p=o.offscreenCanvas.getOrCreateContext(c,{willReadFrequently:!0});return h.width=u,h.height=l,i.defaultStyleRendererFactory[AC.IMAGE].render(p,t.parsedStyle,t,void 0,void 0,void 0),p.getImageData(e.x,e.y,1,1).data.every((function(t){return 0!==t}))}return!0}var bD=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-picker",e}return(0,aM.__extends)(e,t),e.prototype.init=function(){var t,e=((t={})[AC.CIRCLE]=nD,t[AC.ELLIPSE]=iD,t[AC.RECT]=vD,t[AC.LINE]=dD,t[AC.POLYLINE]=yD,t[AC.POLYGON]=gD,t[AC.PATH]=mD,t[AC.TEXT]=function(){return!0},t[AC.GROUP]=null,t[AC.IMAGE]=_D,t[AC.HTML]=null,t[AC.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new eD)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(PC),xD=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=KT.create(),this.dprMatrix=KT.create(),this.tmpMat4=KT.create(),this.vec3a=$T.create(),this.vec3b=$T.create(),this.vec3c=$T.create(),this.vec3d=$T.create()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,u=e.rBushRoot,l=e.pathGeneratorFactory;this.rBush=u,this.pathGeneratorFactory=l;var c=e.contextService,h=s.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},f=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){h.addEventListener(xL.UNMOUNTED,p),h.addEventListener(xL.CULLED,f);var t=c.getDPR(),e=i.width,n=i.height,o=c.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){h.removeEventListener(xL.UNMOUNTED,p),h.removeEventListener(xL.CULLED,f)})),a.hooks.beginFrame.tap(t.tag,(function(){var t,e,n=c.getContext(),o=c.getDPR(),s=i.width,u=i.height,l=(t=r.canvasRendererPluginOptions).dirtyObjectNumThreshold,h=t.dirtyObjectRatioThreshold,p=(e=a.getStats()).total,f=e.rendered,d=f/p;r.clearFullScreen=a.disableDirtyRectangleRendering()||f>l&&d>h,n&&(n.resetTransform?n.resetTransform():n.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(n,0,0,s*o,u*o,i.background))}));var d=function(t,e){t.isVisible()&&!t.isCulled()&&(r.renderDisplayObject(t,e,r.context,r.restoreStack,n),r.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){d(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){var t=c.getContext(),e=c.getDPR();if(KT.fromScaling(r.dprMatrix,[e,e,1]),KT.multiply(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)d(s.root,t);else{var a=r.safeMergeAABB.apply(r,(0,aM.__spreadArray)([r.mergeDirtyAABBs(r.renderQueue)],(0,aM.__read)(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new XC;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],XC.isEmpty(a))return void(r.renderQueue=[]);var u=r.convertAABB2Rect(a),l=u.x,p=u.y,f=u.width,m=u.height,g=$T.transformMat4(r.vec3a,[l,p,0],r.vpMatrix),y=$T.transformMat4(r.vec3b,[l+f,p,0],r.vpMatrix),v=$T.transformMat4(r.vec3c,[l,p+m,0],r.vpMatrix),_=$T.transformMat4(r.vec3d,[l+f,p+m,0],r.vpMatrix),b=Math.min(g[0],y[0],_[0],v[0]),x=Math.min(g[1],y[1],_[1],v[1]),w=Math.max(g[0],y[0],_[0],v[0]),S=Math.max(g[1],y[1],_[1],v[1]),E=Math.floor(b),M=Math.floor(x),T=Math.ceil(w-b),A=Math.ceil(S-x);t.save(),r.clearRect(t,E,M,T,A,i.background),t.beginPath(),t.rect(E,M,T,A),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&h.dispatchEvent(new gL(WL.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:M,width:T,height:A}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var c=this.pathGeneratorFactory[l.nodeName];c&&(e.save(),r.push(t),e.beginPath(),c(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),u&&(e.beginPath(),u(e,t.parsedStyle),t.nodeName!==AC.LINE&&t.nodeName!==AC.PATH&&t.nodeName!==AC.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new XC;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e,n,r=(e=(0,aM.__read)(t.getMin(),2))[0],i=e[1],o=(n=(0,aM.__read)(t.getMax(),2))[0],a=n[1];return this.rBush.search({minX:r,minY:i,maxX:o,maxY:a}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new XC);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n,r=(n=e.parsedStyle).stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),mA(s)||(t.lineDashOffset=s),mA(o)||(t.globalAlpha*=o),mA(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),mA(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var u=e.geometry.contentBounds;r=-a*(u&&2*u.halfExtents[0]||0),i=-s*(u&&2*u.halfExtents[1]||0)}n?(KT.copy(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,KT.translate(this.tmpMat4,this.tmpMat4,this.vec3a),KT.multiply(this.tmpMat4,n,this.tmpMat4),KT.multiply(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(KT.copy(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,KT.translate(this.tmpMat4,this.tmpMat4,this.vec3a),KT.multiply(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new XC;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),wD=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,u=e.opacity,l=e.fillOpacity,c=e.stroke,h=e.strokeOpacity,p=e.lineWidth,f=e.lineCap,d=e.lineJoin,m=e.shadowType,g=e.shadowColor,y=e.shadowBlur,v=e.filter,_=e.miterLimit,b=!mA(a)&&!a.isNone,x=!mA(c)&&!c.isNone&&p>0,w=0===a.alpha,S=!(!v||!v.length),E=!mA(g)&&y>0,M=n.nodeName,T="inner"===m,A=x&&E&&(M===AC.PATH||M===AC.LINE||M===AC.POLYLINE||w||T);b&&(t.globalAlpha=u*l,A||SD(n,t,E),this.fill(t,n,a,s,r,i,o),A||this.clearShadowAndFilter(t,S,E)),x&&(t.globalAlpha=u*h,t.lineWidth=p,mA(_)||(t.miterLimit=_),mA(f)||(t.lineCap=f),mA(d)||(t.lineJoin=d),A&&(T&&(t.globalCompositeOperation="source-atop"),SD(n,t,!0),T&&(this.stroke(t,n,c,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,S,!0))),this.stroke(t,n,c,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!mA(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(rP(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(rP(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var u=t.image.parsedStyle,l=u.width,c=u.height;s=r.contextService.getDPR();var h=r.config.offscreenCanvas;(a=o.offscreenCanvas.getOrCreateCanvas(h)).width=l*s,a.height=c*s;var p=o.offscreenCanvas.getOrCreateContext(h),f=[];t.image.forEach((function(t){i.renderDisplayObject(t,p,r,f,o)})),f.forEach((function(){p.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===gO.LinearGradient||t.type===gO.RadialGradient){var i=e.getGeometryBounds(),o=i&&2*i.halfExtents[0]||1,a=i&&2*i.halfExtents[1]||1;r=this.imagePool.getOrCreateGradient((0,aM.__assign)((0,aM.__assign)({type:t.type},t.value),{width:o,height:a}),n)}return r},t}();function SD(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,u=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=u||0)}var ED,MD=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.width,o=e.height,a=e.img,s=e.shadowColor,u=e.shadowBlur,l=i,c=o;if(gA(a)?r=this.imagePool.getImageSync(a):(l||(l=a.width),c||(c=a.height),r=a),r){SD(n,t,!mA(s)&&u>0);try{t.drawImage(r,0,0,l,c)}catch(t){}}},t}(),TD=function(){function t(){}return t.prototype.render=function(t,e,n){var r=e,i=r.lineWidth,o=r.textAlign,a=r.textBaseline,s=r.lineJoin,u=r.miterLimit,l=r.letterSpacing,c=r.stroke,h=r.fill,p=r.fillOpacity,f=r.strokeOpacity,d=r.opacity,m=r.metrics,g=r.dx,y=r.dy,v=r.shadowColor,_=r.shadowBlur,b=m.font,x=m.lines,w=m.height,S=m.lineHeight,E=m.lineMetrics;t.font=b,t.lineWidth=i,t.textAlign="middle"===o?"center":o;var M=a;FL.enableCSSParsing||"alphabetic"!==M||(M="bottom"),t.lineJoin=s,mA(u)||(t.miterLimit=u);var T=0;"middle"===a?T=-w/2-S/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?T=-w:"top"!==a&&"hanging"!==a||(T=-S);var A=g||0;T+=y||0,1===x.length&&("bottom"===M?(M="middle",T-=.5*w):"top"===M&&(M="middle",T+=.5*w)),t.textBaseline=M,SD(n,t,!mA(v)&&_>0);for(var C=0;C<x.length;C++){var O=i/2+A;T+=S,mA(c)||c.isNone||!i||this.drawLetterSpacing(t,x[C],E[C],o,O,T,l,p,f,d,!0),mA(h)||this.drawLetterSpacing(t,x[C],E[C],o,O,T,l,p,f,d)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,u,l,c){if(void 0===c&&(c=!1),0!==a){var h=t.textAlign;t.textAlign="left";var p=i;"center"===r||"middle"===r?p=i-n.width/2:"right"!==r&&"end"!==r||(p=i-n.width);for(var f=Array.from(e),d=t.measureText(e).width,m=0,g=0;g<f.length;++g){var y=f[g];c?this.strokeText(t,y,p,o,u):this.fillText(t,y,p,o,s,l),p+=d-(m=t.measureText(e.substring(g+1)).width)+a,d=m}t.textAlign=h}else c?this.strokeText(t,e,i,o,u):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!mA(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!mA(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}(),AD=(ED=wD,(0,aM.__extends)((function(){return null!==ED&&ED.apply(this,arguments)||this}),ED),function(t){(0,aM.__extends)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(wD),function(t){(0,aM.__extends)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(wD),function(t){(0,aM.__extends)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(wD),function(t){(0,aM.__extends)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(wD),function(t){(0,aM.__extends)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(wD),function(t){(0,aM.__extends)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(wD),function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return(0,aM.__extends)(e,t),e.prototype.init=function(){var t,e=(0,aM.__assign)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new wD(n),i=((t={})[AC.CIRCLE]=r,t[AC.ELLIPSE]=r,t[AC.RECT]=r,t[AC.IMAGE]=new MD(n),t[AC.TEXT]=new TD,t[AC.LINE]=r,t[AC.POLYLINE]=r,t[AC.POLYGON]=r,t[AC.PATH]=r,t[AC.GROUP]=void 0,t[AC.HTML]=void 0,t[AC.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new xD(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(PC)),CD=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,u=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},c=function(t){i.hooks.pointerDown.call(t)},h=function(t){i.hooks.pointerOver.call(t)},p=function(t){i.hooks.pointerOut.call(t)},f=function(t){i.hooks.pointerCancel.call(t)},d=function(t){i.hooks.pointerWheel.call(t)},m=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",u,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("pointerleave",p,!0),t.addEventListener("pointerover",h,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",u,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("mouseout",p,!0),t.addEventListener("mouseover",h,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",c,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",u,!0),t.addEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",m,!0),t.addEventListener("wheel",d,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",u,!0),t.removeEventListener("pointerdown",c,!0),t.removeEventListener("pointerleave",p,!0),t.removeEventListener("pointerover",h,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",u,!0),t.removeEventListener("mousedown",c,!0),t.removeEventListener("mouseout",p,!0),t.removeEventListener("mouseover",h,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",c,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",u,!0),t.removeEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",m,!0),t.removeEventListener("wheel",d,!0)}))},t.tag="DOMInteraction",t}(),OD=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="dom-interaction",e}return(0,aM.__extends)(e,t),e.prototype.init=function(){this.addRenderingPlugin(new CD)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(PC),PD=function(){function t(){}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(e){var n=this,r=e.camera,i=e.renderingContext,o=e.renderingService;this.context=e;var a=i.root.ownerDocument.defaultView,s=function(t,e){e.style.transform=n.joinTransformMatrix(t.getWorldTransform())},u=function(t){var e=t.target;if(e.nodeName===AC.HTML){n.$camera||(n.$camera=n.createCamera(r));var i=n.getOrCreateEl(e);n.$camera.appendChild(i);var o=e.ownerDocument.documentElement.attributes;Object.keys(o).forEach((function(t){i.style[t]=o[t]})),Object.keys(e.attributes).forEach((function(t){n.updateAttribute(t,e)})),s(e,i),FL.nativeHTMLMap.set(i,e)}},l=function(t){var e=t.target;if(e.nodeName===AC.HTML&&n.$camera){var r=n.getOrCreateEl(e);r&&(r.remove(),FL.nativeHTMLMap.delete(r))}},c=function(t){var e=t.target;if(e.nodeName===AC.HTML){var r=t.attrName;n.updateAttribute(r,e)}},h=function(t){var e=t.target;if(e.nodeName===AC.HTML){var r=n.getOrCreateEl(e);s(e,r)}},p=function(){if(n.$camera){var t=n.context.config,e=t.width,r=t.height;n.$camera.style.width="".concat(e||0,"px"),n.$camera.style.height="".concat(r||0,"px")}};o.hooks.init.tap(t.tag,(function(){a.addEventListener(WL.RESIZE,p),a.addEventListener(xL.MOUNTED,u),a.addEventListener(xL.UNMOUNTED,l),a.addEventListener(xL.ATTR_MODIFIED,c),a.addEventListener(xL.BOUNDS_CHANGED,h)})),o.hooks.endFrame.tap(t.tag,(function(){n.$camera&&i.renderReasons.has(Xk.CAMERA_CHANGED)&&(n.$camera.style.transform=n.joinTransformMatrix(r.getOrthoMatrix()))})),o.hooks.destroy.tap(t.tag,(function(){n.$camera&&n.$camera.remove(),a.removeEventListener(WL.RESIZE,p),a.removeEventListener(xL.MOUNTED,u),a.removeEventListener(xL.UNMOUNTED,l),a.removeEventListener(xL.ATTR_MODIFIED,c),a.removeEventListener(xL.BOUNDS_CHANGED,h)}))},t.prototype.getId=function(t){return t.id||"g-html-"+t.entity},t.prototype.createCamera=function(t){var e,n=(e=this.context.config).document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",u=a.querySelector("#"+s);if(!u){var l=(n||document).createElement("div");u=l,l.id=s,l.style.position="absolute",l.style.left="".concat(o.offsetLeft||0,"px"),l.style.top="".concat(o.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),a.appendChild(l)}return u}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),t.parsedStyle.$el=r,r.id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},t.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;gA(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);break;case"width":if(FL.enableCSSParsing){var o=e.computedStyleMap().get("width");n.style.width=o.toString()}else o=e.parsedStyle.width,n.style.width=fA(o)?"".concat(o,"px"):o.toString();break;case"height":if(FL.enableCSSParsing){var a=e.computedStyleMap().get("height");n.style.height=a.toString()}else a=e.parsedStyle.height,n.style.height=fA(a)?"".concat(a,"px"):a.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var u=e.parsedStyle.visibility;n.style.visibility=u;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents;n.style.pointerEvents=l;break;case"opacity":var c=e.parsedStyle.opacity;n.style.opacity="".concat(c);break;case"fill":var h=e.parsedStyle.fill,p="";iP(h)?p=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)?p=e.getAttribute("fill"):rP(h),n.style.background=p;break;case"stroke":var f=e.parsedStyle.stroke,d="";iP(f)?d=f.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(f)?d=e.getAttribute("stroke"):rP(f),n.style["border-color"]=d,n.style["border-style"]="solid";break;case"lineWidth":var m=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(m||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var g=e.style.filter;n.style.filter=g}},t.tag="HTMLRendering",t}(),kD=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="html-renderer",e}return(0,aM.__extends)(e,t),e.prototype.init=function(){this.addRenderingPlugin(new PD)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(PC),LD=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):kk&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var a,s=t.image,u=t.repetition,l=t.transform,c=!1;gA(s)?a=this.getImageSync(s,i):n?(a=n,c=!0):a=s;var h=a&&e.createPattern(a,u);if(h){var p;p=l?vk(WP(l),new QL({})):KT.identity(KT.create()),c&&KT.scale(p,p,[1/r,1/r,1]),h.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12],f:p[13]})}return o&&h&&(this.patternCache[o]=h),h},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.width,a=t.height,s=t.angle,u=t.cx,l=t.cy,c=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===gO.LinearGradient){var p=function(t,e,n){var r=zC(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}}(o,a,s),f=p.x1,d=p.y1,m=p.x2,g=p.y2;h=e.createLinearGradient(f,d,m,g)}else if(r===gO.RadialGradient){var y=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===oO.kPercentage&&(o=n.value/100*t),r.unit===oO.kPercentage&&(a=r.value/100*e);var s=Math.max(dA([0,0],[o,a]),dA([0,e],[o,a]),dA([t,e],[o,a]),dA([t,0],[o,a]));return i&&(i instanceof OO?s=i.value:i instanceof wO&&("closest-side"===i.value?s=Math.min(o,t-o,a,e-a):"farthest-side"===i.value?s=Math.max(o,t-o,a,e-a):"closest-corner"===i.value&&(s=Math.min(dA([0,0],[o,a]),dA([0,e],[o,a]),dA([t,e],[o,a]),dA([t,0],[o,a]))))),{x:o,y:a,r:s}}(o,a,u,l,c),v=y.x,_=y.y,b=y.r;h=e.createRadialGradient(v,_,0,v,_,b)}return h&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===oO.kPercentage&&(null==h||h.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=h),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,o=t.angle,a=t.cx,s=t.cy,u=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==u?void 0:u.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return gA(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),ID=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===AC.IMAGE){var a=o.img;gA(a)&&i.getImageSync(a,(function(){e.renderable.dirty=!0,n.dirtify()}))}},s=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===AC.IMAGE&&"img"===r&&gA(o)&&i.getOrCreateImage(o).then((function(){e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(xL.MOUNTED,a),o.addEventListener(xL.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(xL.MOUNTED,a),o.removeEventListener(xL.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),RD=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="image-loader",e}return(0,aM.__extends)(e,t),e.prototype.init=function(){this.context.imagePool=new LD(this.context.config),this.addRenderingPlugin(new ID)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(PC),DD=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=gA(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,e){var n=this.canvasConfig.devicePixelRatio||kk&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){kk&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Xk.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),(0,aM.__awaiter)(this,void 0,void 0,(function(){var e,n;return(0,aM.__generator)(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),ND=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-context-register",e}return(0,aM.__extends)(e,t),e.prototype.init=function(){this.context.ContextService=DD},e.prototype.destroy=function(){delete this.context.ContextService},e}(PC),FD=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new ND),n.registerPlugin(new RD),n.registerPlugin(new $R),n.registerPlugin(new AD),n.registerPlugin(new OD),n.registerPlugin(new bD),n.registerPlugin(new kD),n}return(0,aM.__extends)(e,t),e}(kC),zD=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,u=t.timeStamp,l=[t.clientX,t.clientY],c=null,h=[t.clientX,t.clientY],p=function(t){return(0,aM.__awaiter)(n,void 0,void 0,(function(){var n,o,p,f,d,m;return(0,aM.__generator)(this,(function(g){switch(g.label){case 0:if(!s){if(n=t.timeStamp-u,o=dA([t.clientX,t.clientY],l),n<=this.dragndropPluginOptions.dragstartTimeThreshold||o<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];t.type="dragstart",a.dispatchEvent(t),s=!0}return t.type="drag",t.dx=t.clientX-h[0],t.dy=t.clientY-h[1],a.dispatchEvent(t),h=[t.clientX,t.clientY],r?[3,2]:(p="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(p[0],p[1])]);case 1:f=g.sent(),d=f[f.indexOf(e)+1],m=(null==d?void 0:d.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),c!==m&&(c&&(t.type="dragleave",t.target=c,c.dispatchEvent(t)),m&&(t.type="dragenter",t.target=m,m.dispatchEvent(t)),(c=m)&&(t.type="dragover",t.target=c,c.dispatchEvent(t))),g.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",p);var f=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();c&&(e.type="drop",e.target=c,c.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",p)};e.addEventListener("pointerup",f,{once:!0}),e.addEventListener("pointerupoutside",f,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))},t.tag="Dragndrop",t}(),BD=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return(0,aM.__extends)(e,t),e.prototype.init=function(){this.addRenderingPlugin(new zD((0,aM.__assign)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(PC);const jD=function(t){return"object"==typeof t&&null!==t},UD=function(t){if(!jD(t)||!pA(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function ZD(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&UD(o)?(UD(t[i])||(t[i]={}),n<r?ZD(t[i],o,n+1,r):t[i]=e[i]):GA(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}const VD=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)ZD(t,e[r]);return t};var GD=s(3275);const HD=()=>[["cartesian"]];HD.props={};const WD=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},qD=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=WD(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};qD.props={};const YD=({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]];YD.props={};const XD=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];XD.props={transform:!0};const $D=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[...XD(),...qD({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};$D.props={};const KD=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},JD=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=KD(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...qD({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};JD.props={};const QD=()=>[["parallel",0,1,0,1]];QD.props={};const tN=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];tN.props={transform:!0};const eN=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:r=0,outerRadius:i=1}=t;return[...QD(),...qD({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};eN.props={};const nN=({value:t})=>e=>e.map((()=>t));nN.props={};const rN=({value:t})=>e=>e.map(t);rN.props={};const iN=({value:t})=>e=>e.map((e=>e[t]));iN.props={};const oN=({value:t})=>()=>t;function aN(t){return null==t?null:sN(t)}function sN(t){if("function"!=typeof t)throw new Error;return t}function uN(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function lN(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=hN)):void 0===e&&(e=cN);for(var n,r,i,o,a,s=new dN(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new dN(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(fN)}function cN(t){return t.children}function hN(t){return Array.isArray(t)?t[1]:null}function pN(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function fN(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function dN(t){this.data=t,this.depth=this.height=0,this.parent=null}oN.props={},dN.prototype=lN.prototype={constructor:dN,count:function(){return this.eachAfter(uN)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++u,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},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(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return lN(this).eachBefore(pN)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};var mN={depth:-1},gN={},yN={};function vN(t){return t.id}function _N(t){return t.parentId}function bN(){var t,e=vN,n=_N;function r(r){var i,o,a,s,u,l,c,h,p=Array.from(r),f=e,d=n,m=new Map;if(null!=t){const e=p.map(((e,n)=>function(t){let e=(t=`${t}`).length;return wN(t,e-1)&&!wN(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(xN),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(xN(t)),p.push(yN));f=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=p.length;a<i;++a)o=p[a],l=p[a]=new dN(o),null!=(c=f(o,a,r))&&(c+="")&&(h=l.id=c,m.set(h,m.has(h)?gN:l)),null!=(c=d(o,a,r))&&(c+="")&&(l.parent=c);for(a=0;a<i;++a)if(c=(l=p[a]).parent){if(!(u=m.get(c)))throw new Error("missing: "+c);if(u===gN)throw new Error("ambiguous: "+c);u.children?u.children.push(l):u.children=[l],l.parent=u}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===yN&&1===s.children.length;)s=s.children[0],--i;for(let t=p.length-1;t>=0&&(l=p[t]).data===yN;--t)l.data=null}if(s.parent=mN,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(fN),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=aN(t),r):e},r.parentId=function(t){return arguments.length?(n=aN(t),r):n},r.path=function(e){return arguments.length?(t=aN(e),r):t},r}function xN(t){let e=t.length;if(e<2)return"";for(;--e>1&&!wN(t,e););return t.slice(0,e)}function wN(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0==(1&n))return!0}return!1}function SN(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function EN(t={}){return[...SN(t),{name:"title",scale:"identity"}]}function MN(t={}){return SN(t)}function TN(t,e){return t.getBandWidth(t.invert(e))}function AN(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:u}=t,{style:{bandOffset:l=(u?0:.5),bandOffsetX:c=l,bandOffsetY:h=l}={}}=n,p=!!(null==a?void 0:a.getBandWidth),f=!!(null==s?void 0:s.getBandWidth),d=!!(null==u?void 0:u.getBandWidth);return p||f?(t,e)=>{const n=p?TN(a,r[e]):0,l=f?TN(s,i[e]):0,m=d&&o?(TN(u,o[e])/2+ +o[e])*n:0,[g,y]=t;return[g+c*n+m,y+h*l]}:t=>t}function CN(t){return parseFloat(t)/100}function ON(t,e,n,r){const{x:i,y:o}=n,{width:a,height:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?CN(e)*a:+e,"string"==typeof n?CN(n)*s:+n]]}))]}function PN(t){return"function"==typeof t?t:e=>e[t]}function kN(t,e){return Array.from(t,PN(e))}function LN(t,e){const{source:n=(t=>t.source),target:r=(t=>t.target),value:i=(t=>t.value)}=e,{links:o,nodes:a}=t,s=kN(o,n),u=kN(o,r),l=kN(o,i);return{links:o.map(((t,e)=>({target:u[e],source:s[e],value:l[e]}))),nodes:a||Array.from(new Set([...s,...u]),(t=>({key:t})))}}function IN(t,e){return t.getBandWidth(t.invert(e))}const RN=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,series:s,size:u}=n,l=e.x,c=e.series,[h]=r.getSize(),p=u?u.map((t=>+t/h)):null,f=u?(t,e,n)=>{const r=t+e/2,i=p[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],d=Array.from(t,(t=>{const e=IN(l,i[t]),n=e*(c?IN(c,null==s?void 0:s[t]):1),u=(+(null==s?void 0:s[t])||0)*e,h=+i[t]+u,[p,d]=f(h,n,t),m=+o[t],g=+a[t];return[[p,m],[d,m],[d,g],[p,g]].map((t=>r.map(t)))}));return[t,d]};RN.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[{type:"maybeKey"},{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}],interaction:{shareTooltip:!0}};const DN=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,u=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,u]};function NN(t){return t}function FN(t,...e){return jN(t,NN,NN,e)}function zN(t,e,...n){return jN(t,NN,e,n)}function BN(t,e,...n){return jN(t,Array.from,e,n)}function jN(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new xp,s=r[o++];let u=-1;for(const t of i){const e=s(t,++u,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function UN(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function ZN(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function VN(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function GN(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function HN(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function WN(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function qN(t){return GN(t)||ZN(t)}function YN(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function XN(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}DN.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeKey"},{type:"maybeZeroY1"}],postInference:[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}],interaction:{shareTooltip:!0}};const $N=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:u}=n,{x:l,y:c}=e;if(void 0===s||void 0===u)throw new Error("Missing encode for x or y channel.");const h=a?Array.from(FN(t,(t=>a[t])).values()):[t],p=h.map((t=>t[0])).filter((t=>void 0!==t)),f=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,d=((null===(o=null==c?void 0:c.getBandWidth)||void 0===o?void 0:o.call(c))||0)/2,m=Array.from(h,(t=>t.map((t=>r.map([+s[t]+f,+u[t]+d])))));return[p,m,h]},KN=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o}))]},JN=()=>(t,e,n,r)=>(HN(r)?KN:$N)(t,e,n,r);JN.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[{type:"maybeKey"},{type:"maybeSeries"},{type:"maybeGradient"}],postInference:[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]},{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const QN=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:u,size:l,dx:c,dy:h}=r,[p,f]=i.getSize(),d=AN(n,r,t),m=t=>{const e=+((null==c?void 0:c[t])||0),n=+((null==h?void 0:h[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(u?(+a[t]+ +u[t])/2:+a[t])+n]},g=l?Array.from(e,(t=>{const[e,n]=m(t),r=+l[t],o=r/p,a=r/f,s=[e-o,n-a],u=[e+o,n+a];return[i.map(d(s,t)),i.map(d(u,t))]})):Array.from(e,(t=>[i.map(d(m(t),t))]));return[e,g]};QN.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["hollow","hollowDiamond","hollowHexagon","hollowSquare","hollowTriangleDown","hollowTriangle","hollowBowtie","point","plus","diamond","square","triangle","hexagon","cross","bowtie","hyphen","line","tick","triangleDown"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",scale:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[{type:"maybeKey"},{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const tF=t=>{const{cartesian:e=!1}=t;return e?ON:(e,n,r,i)=>{const{x:o,y:a}=r,s=AN(n,r,t),u=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,u]}};tF.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[{type:"maybeKey"},{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const eF=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,u=Array.from(t,(t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),u=+i[t],l=+o[t];return[[u,l],[u+e,l],[u+e,l+n],[u,l+n]].map((t=>r.map(t)))}));return[t,u]};eF.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[{type:"maybeKey"},{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const nF=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,series:s}=n,u=s?Array.from(FN(t,(t=>s[t])).values()):[t],l=u.map((t=>t[0])).filter((t=>void 0!==t));return[l,Array.from(u,(t=>{const e=t.length,n=new Array(2*e);for(let s=0;s<t.length;s++){const u=t[s];n[s]=r.map([+i[u],+o[u]]),n[e+s]=r.map([+i[u],+a[u]])}return n})),u]};nF.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[{type:"maybeKey"},{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const rF=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:u=a}=r,l=AN(n,r,t),c=e.map((t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+u[t]],t))]));return[e,c]};rF.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeKey"},{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const iF=t=>{const{cartesian:e}=t;return e?ON:(e,n,r,i)=>{const{x:o,y:a}=r,s=AN(n,r,t),u=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,u]}};iF.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[{type:"maybeKey"},{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const oF=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),a=t.map((t=>{const e=[];for(let n=0;n<i.length;n++){const a=i[n][t];if(void 0===a)break;const s=o[n][t];e.push(r.map([+a,+s]))}return e}));return[t,a]};oF.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeKey"}],postInference:[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const aF=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:u,y4:l,series:c}=n,h=e.x,p=e.series,f=Array.from(t,(t=>{const e=h.getBandWidth(h.invert(+i[t])),n=e*(p?p.getBandWidth(p.invert(+(null==c?void 0:c[t]))):1),f=(+(null==c?void 0:c[t])||0)*e,d=+i[t]+f+n/2,[m,g,y,v,_]=[+o[t],+a[t],+s[t],+u[t],+l[t]];return[[d-n/2,_],[d+n/2,_],[d,_],[d,v],[d-n/2,v],[d+n/2,v],[d+n/2,g],[d-n/2,g],[d-n/2,y],[d+n/2,y],[d,g],[d,m],[d-n/2,m],[d+n/2,m]].map((t=>r.map(t)))}));return[t,f]};aF.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[{type:"maybeKey"},{type:"maybeZeroX"}],postInference:[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}],interaction:{shareTooltip:!0}};const sF=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[u,l]=r.getSize(),c=t.map((t=>{const e=+s[t]/180*Math.PI,n=+a[t],c=n/l,h=n/u*Math.cos(e),p=-c*Math.sin(e);return[r.map([+i[t]-h/2,+o[t]-p/2]),r.map([+i[t]+h/2,+o[t]+p/2])]}));return[t,c]};sF.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[{type:"maybeKey"}],postInference:[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const uF=()=>(t,e,n,r)=>{const{y:i}=n,o=Array.from(t,(t=>[[0,i[t]],[1,i[t]]].map((t=>r.map(t)))));return[t,o]};uF.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...MN({shapes:["line"]}),{name:"y",required:!0}],preInference:[{type:"maybeKey"},{type:"maybeTupleY"}],postInference:[]};const lF=()=>(t,e,n,r)=>{const{x:i}=n,o=Array.from(t,(t=>[[i[t],1],[i[t],0]].map((t=>r.map(t)))));return[t,o]};lF.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...MN({shapes:["line"]}),{name:"x",required:!0}],preInference:[{type:"maybeKey"},{type:"maybeTupleX"}],postInference:[]};const cF=(...t)=>rF(...t);function hF(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function pF(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=hF("x",e,i,r.x),s=hF("y",n,i,r.y),u=Array.from(t,(t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>o.map(t)))}));return[t,u]}}cF.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...MN({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeKey"}],postInference:[]};const fF=()=>pF();fF.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...MN({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeKey"}],postInference:[]};const dF=()=>pF({extendY:!0});dF.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...MN({shapes:["range"]}),{name:"x",required:!0}],preInference:[{type:"maybeKey"}],postInference:[]};const mF=()=>pF({extendX:!0});function gF(t){return t.target.depth}function yF(t,e){return t.sourceLinks.length?t.depth:e-1}function vF(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function _F(t){return function(){return t}}function bF(t,e){return wF(t.source,e.source)||t.index-e.index}function xF(t,e){return wF(t.target,e.target)||t.index-e.index}function wF(t,e){return t.y0-e.y0}function SF(t){return t.value}function EF(t){return t.index}function MF(t){return t.nodes}function TF(t){return t.links}function AF(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function CF({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}mF.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...MN({shapes:["range"]}),{name:"y",required:!0}],preInference:[{type:"maybeKey"}],postInference:[]};const OF={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},PF={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?sp(t.sourceLinks,gF)-1:0},justify:yF},kF=t=>e=>{const{nodeId:n,nodeSort:r,nodeAlign:i,nodeWidth:o,nodePadding:a,nodeDepth:s,nodes:u,links:l,linkSort:c,iterations:h}=Object.assign({},OF,t),p=function(){let t,e,n,r,i=0,o=0,a=1,s=1,u=24,l=8,c=EF,h=yF,p=MF,f=TF,d=6;function m(m){const v={nodes:p(m),links:f(m)};return function({nodes:t,links:e}){t.forEach(((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]}));const n=new Map(t.map((t=>[c(t),t])));if(e.forEach(((t,e)=>{t.index=e;let{source:r,target:i}=t;"object"!=typeof r&&(r=t.source=AF(n,r)),"object"!=typeof i&&(i=t.target=AF(n,i)),r.sourceLinks.push(t),i.targetLinks.push(t)})),null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}(v),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(vF(e.sourceLinks,SF),vF(e.targetLinks,SF)):e.fixedValue}(v),function({nodes:t}){const n=t.length;let r=new Set(t),i=new Set,o=0;for(;r.size;){if(r.forEach((t=>{t.depth=o;for(const{target:e}of t.sourceLinks)i.add(e)})),++o>n)throw new Error("circular link");r=i,i=new Set}if(e){const n=Math.max(up(t,(t=>t.depth))+1,0);let r;for(let i=0;i<t.length;i++)r=t[i],r.depth=e.call(null,r,n)}}(v),function({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){if(n.forEach((t=>{t.height=i;for(const{source:e}of t.targetLinks)r.add(e)})),++i>e)throw new Error("circular link");n=r,r=new Set}}(v),function(e){const r=function({nodes:t}){const e=Math.max(up(t,(t=>t.depth))+1,0),r=(a-i-u)/(e-1),o=new Array(e).fill(0).map((()=>[]));for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+u,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(s-o)/(up(r,(t=>t.length))-1)),function(e){const n=sp(e,(e=>(s-o-(e.length-1)*t)/vF(e,SF)));for(const r of e){let e=o;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(s-e+t)/(r.length+1);for(let t=0;t<r.length;++t){const n=r[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}w(r)}}(r);for(let t=0;t<d;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/d);y(r,e,n),g(r,e,n)}}(v),CF(v),v}function g(t,e,r){for(let i=1,o=t.length;i<o;++i){const o=t[i];for(const t of o){let n=0,r=0;for(const{source:e,value:i}of t.targetLinks){const o=i*(t.layer-e.layer);n+=S(e,t)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,x(t)}void 0===n&&o.sort(wF),o.length&&v(o,r)}}function y(t,e,r){for(let i=t.length-2;i>=0;--i){const o=t[i];for(const t of o){let n=0,r=0;for(const{target:e,value:i}of t.sourceLinks){const o=i*(e.layer-t.layer);n+=E(t,e)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,x(t)}void 0===n&&o.sort(wF),o.length&&v(o,r)}}function v(e,n){const r=e.length>>1,i=e[r];b(e,i.y0-t,r-1,n),_(e,i.y1+t,r+1,n),b(e,s,e.length-1,n),_(e,o,0,n)}function _(e,n,r,i){for(;r<e.length;++r){const o=e[r],a=(n-o.y0)*i;a>1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+t}}function b(e,n,r,i){for(;r>=0;--r){const o=e[r],a=(o.y1-n)*i;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-t}}function x({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(xF);for(const{target:{targetLinks:e}}of t)e.sort(bF)}}function w(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(xF),n.sort(bF)}function S(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:o}of e.sourceLinks){if(i===n)break;r+=o+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function E(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:o}of n.targetLinks){if(i===e)break;r+=o+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return m.update=function(t){return CF(t),t},m.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:_F(t),m):c},m.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:_F(t),m):h},m.nodeDepth=function(t){return arguments.length?(e=t,m):e},m.nodeSort=function(t){return arguments.length?(n=t,m):n},m.nodeWidth=function(t){return arguments.length?(u=+t,m):u},m.nodePadding=function(e){return arguments.length?(l=t=+e,m):l},m.nodes=function(t){return arguments.length?(p="function"==typeof t?t:_F(t),m):p},m.links=function(t){return arguments.length?(f="function"==typeof t?t:_F(t),m):f},m.linkSort=function(t){return arguments.length?(r=t,m):r},m.size=function(t){return arguments.length?(i=o=0,a=+t[0],s=+t[1],m):[a-i,s-o]},m.extent=function(t){return arguments.length?(i=+t[0][0],a=+t[1][0],o=+t[0][1],s=+t[1][1],m):[[i,o],[a,s]]},m.iterations=function(t){return arguments.length?(d=+t,m):d},m}().nodeSort(r).linkSort(c).links(l).nodes(u).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?PF[t]||yF:"function"===e?t:yF}(i)).iterations(h).extent([[0,0],[1,1]]);"function"==typeof n&&p.nodeId(n);const f=p(e),{nodes:d,links:m}=f,g=d.map((t=>{const{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})})),y=m.map((t=>{const{source:e,target:n}=t,r=e.x1,i=n.x0,o=t.width/2;return Object.assign(Object.assign({},t),{x:[r,r,i,i],y:[t.y0+o,t.y0-o,t.y1+o,t.y1-o]})}));return{nodes:g,links:y}};kF.props={};const LF=function(t){return mA(t)?"":t.toString()},IF=function(t){var e=LF(t);return e.charAt(0).toLowerCase()+e.substring(1)};var RF=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function DF(t){return t}function NF(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function FF(t=""){throw new Error(t)}function zF(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||t.attr(e,i)}function BF(t){return null!=t&&!Number.isNaN(t)}function jF(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function UF(t,e){return ZF(t,e)||{}}function ZF(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[IF(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function VF(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function GF(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function HF(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function WF(t){return null===t||!1===t}function qF(t,e,n={},r=!1){if(WF(t))return t;if(Array.isArray(t)&&r)return t;const i=UF(t,e);return VD(n,i)}function YF(t,e={}){return WF(t)||Array.isArray(t)?t:XF(t)?VD(e,t):t}function XF(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}function $F(t,e){return"object"==typeof t?UF(t,e):t}const KF=t=>{const e={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},n={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},r={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},i={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10};return()=>{const{data:o,encode:a={},scale:s,style:u={},layout:l={},nodeLabels:c=[],linkLabels:h=[],animate:p={},tooltip:f={}}=t,{links:d,nodes:m}=LN(o,a),g=UF(a,"node"),y=UF(a,"link"),{key:v=(t=>t.key),color:_=v}=g,{links:b,nodes:x}=kF(Object.assign(Object.assign(Object.assign({},e),{nodeId:PN(v)}),l))({links:d,nodes:m}),w=UF(u,"label"),{text:S=v,spacing:E=5}=w,M=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(w,["text","spacing"]),T=PN(v),A=qF(f,"node",{title:T,items:[{field:"value"}]},!0),C=qF(f,"link",{title:"",items:[t=>({name:"source",value:T(t.source)}),t=>({name:"target",value:T(t.target)})]});return[VD({},n,{data:x,encode:Object.assign(Object.assign({},g),{color:_}),scale:s,style:UF(u,"node"),labels:[Object.assign(Object.assign(Object.assign({},i),{text:S,dx:t=>t.x[0]<.5?E:-E}),M),...c],tooltip:A,animate:$F(p,"node"),axis:!1}),VD({},r,{data:b,encode:y,labels:h,style:Object.assign({fill:y.color?void 0:"#aaa",strokeWidth:0},UF(u,"link")),tooltip:C,animate:$F(p,"link")})]}};KF.props={};const JF=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function QF(t,e,n,r,i){var o,a,s=t.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o<u;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,u){if(e>=n-1){var c=s[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}for(var h=l[e],p=r/2+h,f=e+1,d=n-1;f<d;){var m=f+d>>>1;l[m]<p?f=m+1:d=m}p-l[f-1]<l[f]-p&&e+1<f&&--f;var g=l[f]-h,y=r-g;if(a-i>u-o){var v=r?(i*y+a*g)/r:a;t(e,f,g,i,o,v,u),t(f,n,y,v,o,a,u)}else{var _=r?(o*y+u*g)/r:u;t(e,f,g,i,o,a,_),t(f,n,y,i,_,a,u)}}(0,u,t.value,e,n,r,i)}function tz(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(r-e)/t.value;++s<u;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}function ez(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(i-n)/t.value;++s<u;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}function nz(t,e,n,r,i){(1&t.depth?ez:tz)(t,e,n,r,i)}JF.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[{type:"maybeKey"}],postInference:[]};var rz=(1+Math.sqrt(5))/2;function iz(t,e,n,r,i,o){for(var a,s,u,l,c,h,p,f,d,m,g,y=[],v=e.children,_=0,b=0,x=v.length,w=e.value;_<x;){u=i-n,l=o-r;do{c=v[b++].value}while(!c&&b<x);for(h=p=c,g=c*c*(m=Math.max(l/u,u/l)/(w*t)),d=Math.max(p/g,g/h);b<x;++b){if(c+=s=v[b].value,s<h&&(h=s),s>p&&(p=s),g=c*c*m,(f=Math.max(p/g,g/h))>d){c-=s;break}d=f}y.push(a={value:c,dice:u<l,children:v.slice(_,b)}),a.dice?tz(a,n,r,i,w?r+=l*c/w:o):ez(a,n,r,w?n+=u*c/w:i,o),w-=c,_=b}return y}const oz=function t(e){function n(t,n,r,i,o){iz(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(rz),az=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,l,c,h=-1,p=a.length,f=t.value;++h<p;){for(u=(s=a[h]).children,l=s.value=0,c=u.length;l<c;++l)s.value+=u[l].value;s.dice?tz(s,n,r,i,f?r+=(o-r)*s.value/f:o):ez(s,n,r,f?n+=(i-n)*s.value/f:i,o),f-=s.value}else t._squarify=a=iz(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(rz);function sz(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 uz(){return 0}function lz(t){return function(){return t}}const cz=t=>t?parseInt(t):0;function hz(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:u=0,marginLeft:l=u,marginRight:c=u,marginTop:h=u,marginBottom:p=u,inset:f=0,insetLeft:d=f,insetRight:m=f,insetTop:g=f,insetBottom:y=f}=t,v=t=>"auto"===t?30:t;return{width:n-v(i)-v(o)-l-c-d-m,height:e-v(a)-v(s)-h-p-g-y}}const pz=t=>e=>{const{width:n,height:r}=hz(e),{data:i,encode:o={},scale:a,style:s={},layout:u={},labels:l=[],tooltip:c={}}=t,h=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["data","encode","scale","style","layout","labels","tooltip"]),p={tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[n,r],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0},f={type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,n],range:[0,1]},y:{domain:[0,r],range:[0,1]}},style:{stroke:"#fff"}},d=function(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:QF,treemapDice:tz,treemapSlice:ez,treemapSliceDice:nz,treemapSquarify:oz,treemapResquarify:az},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),o=function(t,e){return Array.isArray(t)?"function"==typeof e?bN().path(e)(t):bN()(t):lN(t)}(t,e.path);return r?o.sum((t=>e.ignoreParentValue&&t.children?0:PN(r)(t))).sort(e.sort):o.count(),function(){var t=oz,e=!1,n=1,r=1,i=[0],o=uz,a=uz,s=uz,u=uz,l=uz;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(sz),t}function h(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,h=e.x1-n,p=e.y1-n;h<r&&(r=h=(r+h)/2),p<c&&(c=p=(c+p)/2),e.x0=r,e.y0=c,e.x1=h,e.y1=p,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,c+=a(e)-n,(h-=s(e)-n)<r&&(r=h=(r+h)/2),(p-=u(e)-n)<c&&(c=p=(c+p)/2),t(e,r,c,h,p))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=sN(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:lz(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:lz(+t),c):a},c.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:lz(+t),c):s},c.paddingBottom=function(t){return arguments.length?(u="function"==typeof t?t:lz(+t),c):u},c.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:lz(+t),c):l},c}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(o),o.descendants().map((t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]}))).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}(i,VD({},p,u),o),m=UF(s,"label");return[VD({},f,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},{fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0}),m),...l]},h),{tooltip:YF(c,{title:t=>t.data.name,items:[{field:"value"}]}),axis:!1}))]};pz.props={};const fz=4294967296;function dz(t,e){var n,r;if(yz(e,t))return[e];for(n=0;n<t.length;++n)if(mz(e,t[n])&&yz(_z(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(mz(_z(t[n],t[r]),e)&&mz(_z(t[n],e),t[r])&&mz(_z(t[r],e),t[n])&&yz(bz(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function mz(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function gz(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function yz(t,e){for(var n=0;n<e.length;++n)if(!gz(t,e[n]))return!1;return!0}function vz(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return _z(t[0],t[1]);case 3:return bz(t[0],t[1],t[2])}}function _z(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,u=o-n,l=a-r,c=s-i,h=Math.sqrt(u*u+l*l);return{x:(n+o+u/h*c)/2,y:(r+a+l/h*c)/2,r:(h+i+s)/2}}function bz(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,u=e.r,l=n.x,c=n.y,h=n.r,p=r-a,f=r-l,d=i-s,m=i-c,g=u-o,y=h-o,v=r*r+i*i-o*o,_=v-a*a-s*s+u*u,b=v-l*l-c*c+h*h,x=f*d-p*m,w=(d*b-m*_)/(2*x)-r,S=(m*g-d*y)/x,E=(f*_-p*b)/(2*x)-i,M=(p*y-f*g)/x,T=S*S+M*M-1,A=2*(o+w*S+E*M),C=w*w+E*E-o*o,O=-(Math.abs(T)>1e-6?(A+Math.sqrt(A*A-4*T*C))/(2*T):C/A);return{x:r+w+S*O,y:i+E+M*O,r:O}}function xz(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,l=s*s+u*u;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function wz(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Sz(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function Ez(t){this._=t,this.next=null,this.previous=null}function Mz(t,e){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,u,l,c,h,p;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;xz(r,n,i=t[2]),n=new Ez(n),r=new Ez(r),i=new Ez(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<o;++u){xz(n._,r._,i=t[u]),i=new Ez(i),l=r.next,c=n.previous,h=r._.r,p=n._.r;do{if(h<=p){if(wz(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue t}h+=l._.r,l=l.next}else{if(wz(c._,i._)){(n=c).next=r,r.previous=n,--u;continue t}p+=c._.r,c=c.previous}}while(l!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Sz(n);(i=i.next)!==r;)(s=Sz(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=function(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i<o;)n=t[i],r&&gz(r,n)?++i:(r=vz(a=dz(a,n)),i=0);return r}(n,e),u=0;u<o;++u)(n=t[u]).x-=i.x,n.y-=i.y;return i.r}function Tz(t){return Math.sqrt(t.value)}function Az(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Cz(t,e,n){return function(r){if(i=r.children){var i,o,a,s=i.length,u=t(r)*e||0;if(u)for(o=0;o<s;++o)i[o].r+=u;if(a=Mz(i,n),u)for(o=0;o<s;++o)i[o].r-=u;r.r=a+u}}}function Oz(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}const Pz=t=>e=>{const{width:n,height:r}=hz(e),{data:i,encode:o={},scale:a={},style:s={},layout:u={},labels:l=[],tooltip:c={}}=t,h=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["data","encode","scale","style","layout","labels","tooltip"]),p={size:[n,r],padding:0,sort:(t,e)=>e.value-t.value},f={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,n]},y:{domain:[0,r]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:o.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:o.color?void 0:t=>0===t.height?"":"#000"}},d=((t,e,n)=>{const{value:r}=n,i=GA(t)?bN().path(e.path)(t):lN(t);return r?i.sum((t=>PN(r)(t))).sort(e.sort):i.count(),function(){var t=null,e=1,n=1,r=uz;function i(i){const o=function(){let t=1;return()=>(t=(1664525*t+1013904223)%fz)/fz}();return i.x=e/2,i.y=n/2,t?i.eachBefore(Az(t)).eachAfter(Cz(r,.5,o)).eachBefore(Oz(1)):i.eachBefore(Az(Tz)).eachAfter(Cz(uz,1,o)).eachAfter(Cz(r,i.r/Math.min(e,n),o)).eachBefore(Oz(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=aN(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:lz(+t),i):r},i}().size(e.size).padding(e.padding)(i),i.descendants()})(i,VD({},p,u),VD({},f.encode,o)),m=UF(s,"label");return[VD({},f,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),m),...l]},h),{tooltip:YF(c,{title:t=>t.data.name,items:[{field:"value"}]}),axis:!1}))]};function kz(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Lz(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Iz(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Rz(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const o=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),o.sort(((t,n)=>{for(const r of e){const e=Nz(r[t],r[n]);if(e)return e}}))):(n=t.map(n),o.sort(((t,e)=>Nz(n[t],n[e])))),r=t,i=o,Array.from(i,(t=>r[t]))}var r,i;return t.sort(Dz(n))}function Dz(t=Iz){if(t===Iz)return Nz;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Nz(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}function Fz(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Nz:Dz(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);Fz(t,e,Math.max(n,Math.floor(e-a*u/o+l)),Math.min(r,Math.floor(e+(o-a)*u/o+l)),i)}const o=t[e];let a=n,s=r;for(zz(t,n,e),i(t[r],o)>0&&zz(t,n,r);a<s;){for(zz(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?zz(t,n,s):(++s,zz(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function zz(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Bz(t){return null===t?NaN:+t}function jz(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return sp(t);if(e>=1)return up(t);var r,i=(r-1)*e,o=Math.floor(i),a=up(Fz(t,o).subarray(0,o+1));return a+(sp(t.subarray(o+1))-a)*(i-o)}}Pz.props={};var Uz=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function Zz(t,e){return sp(t,(t=>e[t]))}function Vz(t,e){return up(t,(t=>e[t]))}function Gz(t,e){const n=2.5*Hz(t,e)-1.5*qz(t,e);return sp(t,(t=>e[t]>=n?e[t]:NaN))}function Hz(t,e){return jz(t,.25,(t=>e[t]))}function Wz(t,e){return jz(t,.5,(t=>e[t]))}function qz(t,e){return jz(t,.75,(t=>e[t]))}function Yz(t,e){const n=2.5*qz(t,e)-1.5*Hz(t,e);return up(t,(t=>e[t]<=n?e[t]:NaN))}function Xz(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(FN(t,(t=>a[+t])).values()).flatMap((t=>{const e=Gz(t,o),n=Yz(t,o);return t.filter((t=>o[t]<e||o[t]>n))}));return[s,e]}}const $z=t=>()=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:o,animate:a}=t,s=Uz(t,["data","encode","style","tooltip","transform","animate"]),{point:u=!0}=r,l=Uz(r,["point"]),{y:c}=n,h={y:c,y1:c,y2:c,y3:c,y4:c},p={y1:Hz,y2:Wz,y3:qz},f=qF(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),d=qF(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});if(!u)return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:Zz},p),{y4:Vz})],encode:Object.assign(Object.assign({},n),h),style:l,tooltip:f},s)];const m=UF(l,"box"),g=UF(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:Gz},p),{y4:Yz})],encode:Object.assign(Object.assign({},n),h),style:m,tooltip:f,animate:$F(a,"box")},s),{type:"point",data:e,transform:[{type:Xz}],encode:n,style:Object.assign({},g),tooltip:d,animate:$F(a,"point")}]};$z.props={};const Kz=t=>{const{cartesian:e}=t;return e?ON:(e,n,r,i)=>{const{x:o,y:a}=r,s=AN(n,r,t),u=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,u]}};function Jz(t){return function(){return t}}function Qz(t){return 1e-6*(t()-.5)}Kz.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeKey"},{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};const tB=1664525,eB=1013904223,nB=4294967296;function rB(t){return t.x}function iB(t){return t.y}var oB=10,aB=Math.PI*(3-Math.sqrt(5));function sB(t){return t.index}function uB(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function lB(t,e,n){const{nodes:r,links:i}=t,{joint:o,nodeStrength:a,linkStrength:s}=e,{nodeKey:u=(t=>t.id),linkKey:l=(t=>t.id)}=n,c=function(){var t,e,n,r,i,o=Jz(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=Fh(t,rB,iB).visitAfter(h);for(r=n,i=0;i<o;++i)e=t[i],a.visit(p)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function h(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}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 p(t,o,l,c){if(!t.value)return!0;var h=t.x-e.x,p=t.y-e.y,f=c-o,d=h*h+p*p;if(f*f/u<d)return d<s&&(0===h&&(d+=(h=Qz(n))*h),0===p&&(d+=(p=Qz(n))*p),d<a&&(d=Math.sqrt(a*d)),e.vx+=h*t.value*r/d,e.vy+=p*t.value*r/d),!0;if(!(t.length||d>=s)){(t.data!==e||t.next)&&(0===h&&(d+=(h=Qz(n))*h),0===p&&(d+=(p=Qz(n))*p),d<a&&(d=Math.sqrt(a*d)));do{t.data!==e&&(f=i[t.data.index]*r/d,e.vx+=h*f,e.vy+=p*f)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:Jz(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l}(),h=function(t){var e,n,r,i,o,a,s=sB,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=Jz(30),c=1;function h(r){for(var i=0,s=t.length;i<c;++i)for(var u,l,h,p,f,d,m,g=0;g<s;++g)l=(u=t[g]).source,p=(h=u.target).x+h.vx-l.x-l.vx||Qz(a),f=h.y+h.vy-l.y-l.vy||Qz(a),p*=d=((d=Math.sqrt(p*p+f*f))-n[g])/d*r*e[g],f*=d,h.vx-=p*(m=o[g]),h.vy-=f*m,l.vx+=p*(m=1-m),l.vy+=f*m}function p(){if(r){var a,u,l=r.length,c=t.length,h=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<c;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=uB(h,u.source)),"object"!=typeof u.target&&(u.target=uB(h,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(c),f(),n=new Array(c),d()}}function f(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function d(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),h.initialize=function(t,e){r=t,a=e,p()},h.links=function(e){return arguments.length?(t=e,p(),h):t},h.id=function(t){return arguments.length?(s=t,h):s},h.iterations=function(t){return arguments.length?(c=+t,h):c},h.strength=function(t){return arguments.length?(u="function"==typeof t?t:Jz(+t),f(),h):u},h.distance=function(t){return arguments.length?(l="function"==typeof t?t:Jz(+t),d(),h):l},h}(i).id(PN(l));"function"==typeof a&&c.strength(a),"function"==typeof s&&h.strength(s);const p=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=ch(h),l=Xc("tick","end"),c=function(){let t=1;return()=>(t=(tB*t+eB)%nB)/nB}();function h(){p(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function p(r){var u,l,c=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<c;++u)null==(l=t[u]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function f(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=oB*Math.sqrt(.5+n),o=n*aB;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function d(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),f(),e={tick:p,restart:function(){return u.restart(h),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,f(),s.forEach(d),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(d),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}(r).force("link",h).force("charge",c);o?p.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i<a;++i)s+=(o=n[i]).x,u+=o.y;for(s=(s/a-t)*r,u=(u/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=u}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}()):p.force("x",function(t){var e,n,r,i=Jz(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Jz(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Jz(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:Jz(+e),a(),o):t},o}()).force("y",function(t){var e,n,r,i=Jz(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=Jz(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Jz(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:Jz(+e),a(),o):t},o}()),p.stop();const f=Math.ceil(Math.log(p.alphaMin())/Math.log(1-p.alphaDecay()));for(let t=0;t<f;t++)p.tick();return{nodesData:r,linksData:i}}const cB=t=>()=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:u={},tooltip:l={}}=t,{nodeKey:c=(t=>t.id),linkKey:h=(t=>t.id)}=n,p=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(n,["nodeKey","linkKey"]),f=Object.assign({nodeKey:c,linkKey:h},p),d=UF(f,"node"),m=UF(f,"link"),{links:g,nodes:y}=LN(e,f),{nodesData:v,linksData:_}=lB({links:g,nodes:y},VD({},{joint:!0},o),f),b=qF(l,"link",{items:[t=>({name:"source",value:PN(h)(t.source)}),t=>({name:"target",value:PN(h)(t.target)})]}),x=qF(l,"node",{items:[t=>({name:"key",value:PN(c)(t)})]},!0);return[VD({},{type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},{data:_,encode:m,labels:s,style:UF(i,"link"),tooltip:b,animate:$F(u,"link")}),VD({},{type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},{data:v,encode:Object.assign({},d),scale:r,style:UF(i,"node"),tooltip:x,labels:[Object.assign(Object.assign({},{text:""}),UF(i,"label")),...a],animate:$F(u,"link")})]};function hB(t,e){return t.parent===e.parent?1:2}function pB(t){var e=t.children;return e?e[0]:t.t}function fB(t){var e=t.children;return e?e[e.length-1]:t.t}function dB(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function mB(t,e,n){return t.a.parent===e.parent?t.a:n}function gB(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 yB(){var t=hB,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new gB(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new gB(r[i],i)),n.parent=e;return(a.parent=new gB(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,h=i;i.eachBefore((function(t){t.x<l.x&&(l=t),t.x>c.x&&(c=t),t.depth>h.depth&&(h=t)}));var p=l===c?1:t(l,c)/2,f=p-l.x,d=e/(c.x+p+f),m=n/(h.depth||1);i.eachBefore((function(t){t.x=(t.x+f)*d,t.y=t.depth*m}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],l=o.m,c=a.m,h=s.m,p=u.m;s=fB(s),o=pB(o),s&&o;)u=pB(u),(a=fB(a)).a=e,(i=s.z+h-o.z-l+t(s._,o._))>0&&(dB(mB(s,e,r),e,i),l+=i,c+=i),h+=s.m,l+=o.m,p+=u.m,c+=a.m;s&&!fB(a)&&(a.t=s,a.m+=h-c),o&&!pB(u)&&(u.t=o,u.m+=l-p,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function vB(t,e){return t.parent===e.parent?1:2}function _B(t,e){return t+e.x}function bB(t,e){return Math.max(t,e.y)}function xB(){var t=vB,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(_B,0)/t.length}(n),e.y=function(t){return 1+t.reduce(bB,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,u)/2,c=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}cB.props={},gB.prototype=Object.create(dN.prototype);const wB=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[u,l]=s,c=lN(n,(t=>t.children)).sum((t=>t[r])).sort(a),h=t();h.size([1,1]),i&&h.nodeSize(i),o&&h.separation(o),h(c);const p=[];c.each((t=>{t[u]=t.x,t[l]=t.y,t.name=t.data.name,p.push(t)}));const f=c.links();return f.forEach((t=>{t[u]=[t.source[u],t.target[u]],t[l]=[t.source[l],t.target[l]]})),{nodes:p,edges:f}},SB=t=>wB(xB)(t);SB.props={};const EB=t=>wB(yB)(t);EB.props={};const MB=t=>{const e={sortBy:(t,e)=>e.value-t.value},n={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},r={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},i={text:"",fontSize:10};return()=>{const{data:o,encode:a={},scale:s={},style:u={},layout:l={},nodeLabels:c=[],linkLabels:h=[],animate:p={},tooltip:f={}}=t,d=null==a?void 0:a.value,{nodes:m,edges:g}=EB(Object.assign(Object.assign(Object.assign({},e),l),{field:d}))(o),y=qF(f,"node",{title:"name",items:["value"]},!0),v=qF(f,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[VD({},r,{data:g,encode:UF(a,"link"),scale:UF(s,"link"),labels:h,style:Object.assign({stroke:"#999"},UF(u,"link")),tooltip:v,animate:$F(p,"link")}),VD({},n,{data:m,scale:UF(s,"node"),encode:UF(a,"node"),labels:[Object.assign(Object.assign({},i),UF(u,"label")),...c],style:Object.assign({},UF(u,"node")),tooltip:y,animate:$F(p,"node")})]}};MB.props={};var TB={},AB={};function CB(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function OB(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function PB(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function kB(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,u=o<=0,l=!1;function c(){if(u)return AB;if(l)return l=!1,TB;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?u=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return u=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=c())!==AB;){for(var h=[];r!==TB&&r!==AB;)h.push(r),r=c();e&&null==(h=e(h,s++))||i.push(h)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?(r=(n=t).getUTCHours(),i=n.getUTCMinutes(),o=n.getUTCSeconds(),a=n.getUTCMilliseconds(),isNaN(n)?"Invalid Date":function(t){return t<0?"-"+PB(-t,6):t>9999?"+"+PB(t,6):PB(t,4)}(n.getUTCFullYear())+"-"+PB(n.getUTCMonth()+1,2)+"-"+PB(n.getUTCDate(),2)+(a?"T"+PB(r,2)+":"+PB(i,2)+":"+PB(o,2)+"."+PB(a,3)+"Z":o?"T"+PB(r,2)+":"+PB(i,2)+":"+PB(o,2)+"Z":i||r?"T"+PB(r,2)+":"+PB(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var n,r,i,o,a}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=CB(t);return function(r,i){return e(n(r),i,t)}}(t,e):CB(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=OB(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=OB(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function LB(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;IB&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const IB=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();const RB=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>{return t=void 0,o=void 0,s=function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return kB(r).parse(e,i?LB:DF)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)},new((a=void 0)||(a=Promise))((function(e,n){function r(t){try{u(s.next(t))}catch(t){n(t)}}function i(t){try{u(s.throw(t))}catch(t){n(t)}}function u(t){t.done?e(t.value):function(t){return t instanceof a?t:new a((function(e){e(t)}))}(t.value).then(r,i)}u((s=s.apply(t,o||[])).next())}));var t,o,a,s}};RB.props={};const DB=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function NB(t){return null!=t&&!Number.isNaN(t)}DB.props={};const FB=t=>{const{callback:e=NB}=t;return t=>t.filter(e)};FB.props={};const zB=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};zB.props={};const BB=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};BB.props={};const jB=t=>e=>{return t&&(n=t,0!==Object.keys(n).length)?e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{}))):e;var n};jB.props={};const UB=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};UB.props={};const ZB=t=>{const{value:e}=t;return()=>e};ZB.props={};const VB=t=>{const{callback:e=DF}=t;return t=>e(t)};VB.props={};const GB=t=>{const{callback:e=DF}=t;return t=>Array.isArray(t)?t.map(e):t};function HB(t,e){return e.value-t.value}function WB(t,e){return e.frequency-t.frequency}function qB(t,e){return`${t.id}`.localeCompare(`${e.id}`)}function YB(t,e){return`${t.name}`.localeCompare(`${e.name}`)}GB.props={};const XB={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};const $B=e=>n=>function(e){const{y:n,thickness:r,weight:i,marginRatio:o,id:a,source:s,target:u,sourceWeight:l,targetWeight:c,sortBy:h}=Object.assign(Object.assign({},XB),e);return function(e){const p=e.nodes.map((t=>Object.assign({},t))),f=e.edges.map((t=>Object.assign({},t)));return function(t,e){e.forEach((t=>{t.source=s(t),t.target=u(t),t.sourceWeight=l(t),t.targetWeight=c(t)}));const n=FN(e,(t=>t.source)),r=FN(e,(t=>t.target));t.forEach((t=>{t.id=a(t);const e=n.has(t.id)?n.get(t.id):[],i=r.has(t.id)?r.get(t.id):[];t.frequency=e.length+i.length,t.value=vF(e,(t=>t.sourceWeight))+vF(i,(t=>t.targetWeight))}))}(p,f),function(e,n){const r="function"==typeof h?h:t[h];r&&e.sort(r)}(p),function(t,e){const a=t.length;if(!a)throw FF("Invalid nodes: it's empty!");if(!i){const r=1/a;return t.forEach(((t,e)=>{t.x=(e+.5)*r,t.y=n})),{nodes:t,edges:e}}const s=o/(2*a),u=t.reduce(((t,e)=>t+e.value),0);t.reduce(((t,e)=>{e.weight=e.value/u,e.width=e.weight*(1-o),e.height=r;const i=s+t,a=i+e.width,l=n-r/2,c=l+r;return e.x=[i,a,a,i],e.y=[l,l,c,c],t+e.width+2*s}),0)}(p,f),function(t,e){const r=new Map(t.map((t=>[t.id,t])));if(!i)return e.forEach((t=>{const e=s(t),n=u(t),i=r.get(e),o=r.get(n);i&&o&&(t.x=[i.x,o.x],t.y=[i.y,o.y])})),{nodes:t,edges:e};e.forEach((t=>{t.x=[0,0,0,0],t.y=[n,n,n,n]}));const o=FN(e,(t=>t.source)),a=FN(e,(t=>t.target));t.forEach((t=>{const{edges:e,width:n,x:r,y:i,value:s,id:u}=t,l=o.get(u)||[],c=a.get(u)||[];let h=0;l.map((e=>{const r=e.sourceWeight/s*n;e.x[0]=t.x[0]+h,e.x[1]=t.x[0]+h+r,h+=r})),c.forEach((e=>{const r=e.targetWeight/s*n;e.x[3]=t.x[0]+h,e.x[2]=t.x[0]+h+r,h+=r}))}))}(p,f),{nodes:p,edges:f}}}(e)(n);$B.props={};const KB=Math.PI/180,JB=64,QB=2048;function tj(t){return t.text}function ej(){return"serif"}function nj(){return"normal"}function rj(t){return t.value}function ij(){return 90*~~(2*Math.random())}function oj(){return 1}function aj(){}function sj(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,(JB<<5)/o,QB/o);let a=0,s=0,u=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font;let t=i.measureText(e.text+"m").width*o,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*KB),r=Math.cos(e.rotate*KB),i=t*r,o=t*n,a=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(o+a),Math.abs(o-a))}else t=t+31>>5<<5;if(l>u&&(u=l),a+t>=JB<<5&&(a=0,s+=u,u=0),s+l>=QB)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*KB),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=a,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const c=i.getImageData(0,0,(JB<<5)/o,QB/o).data,h=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let o=e.y1-e.y0;for(let t=0;t<o*i;t++)h[t]=0;if(a=e.xoff,null==a)return;s=e.yoff;let u=0,l=-1;for(let n=0;n<o;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=c[(s+n)*(JB<<5)+(a+e)<<2]?1<<31-e%32:0;h[t]|=r,u|=r}u?l=n:(e.y0++,o--,n--,s++)}e.y1=e.y0+l,e.sprite=h.slice(0,(e.y1-e.y0)*i)}}function uj(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,o=t.x-(i<<4),a=127&o,s=32-a,u=t.y1-t.y0;let l,c=(t.y+t.y0)*n+(o>>5);for(let t=0;t<u;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>a:0))&e[c+n])return!0;c+=n}return!1}function lj(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function cj(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function hj(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function pj(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function fj(){return document.createElement("canvas")}function dj(t){return"function"==typeof t?t:function(){return t}}const mj={archimedean:hj,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function gj(){let t=[256,256],e=tj,n=ej,r=rj,i=nj,o=ij,a=oj,s=hj,u=Math.random,l=aj,c=[],h=null,p=1/0;const f=nj,d=fj,m={};function g(e,n,r){const i=n.x,o=n.y,a=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),c=u()<.5?1:-1;let h,p,f,d=-c;for(;(h=l(d+=c))&&(p=~~h[0],f=~~h[1],!(Math.min(Math.abs(p),Math.abs(f))>=a));)if(n.x=i+p,n.y=o+f,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!uj(n,e,t[0]))&&(!r||cj(n,r))){const r=n.sprite,i=n.width>>5,o=t[0]>>5,a=n.x-(i<<4),s=127&a,u=32-s,l=n.y1-n.y0;let c,h=(n.y+n.y0)*o+(a>>5);for(let t=0;t<l;t++){c=0;for(let n=0;n<=i;n++)e[h+n]|=c<<u|(n<i?(c=r[t*i+n])>>>s:0);h+=o}return delete n.sprite,!0}return!1}return m.start=function(){const[s,y]=t,v=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(JB<<5)/e,t.height=QB/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(d()),_=m.board?m.board:pj((t[0]>>5)*t[1]),b=c.length,x=[],w=c.map((function(t,s,u){return t.text=e.call(this,t,s,u),t.font=n.call(this,t,s,u),t.style=f.call(this,t,s,u),t.weight=i.call(this,t,s,u),t.rotate=o.call(this,t,s,u),t.size=~~r.call(this,t,s,u),t.padding=a.call(this,t,s,u),t})).sort((function(t,e){return e.size-t.size}));let S=-1,E=m.board?[{x:0,y:0},{x:s,y}]:void 0;function M(){const e=Date.now();for(;Date.now()-e<p&&++S<b;){const e=w[S];e.x=s*(u()+.5)>>1,e.y=y*(u()+.5)>>1,sj(v,e,w,S),e.hasText&&g(_,e,E)&&(l.call(null,"word",{cloud:m,word:e}),x.push(e),E?m.hasImage||lj(E,e):E=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}m._tags=x,m._bounds=E,S>=b&&(m.stop(),l.call(null,"end",{cloud:m,words:x,bounds:E}))}return h&&clearInterval(h),h=setInterval(M,0),M(),m},m.stop=function(){return h&&(clearInterval(h),h=null),m},m.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const o=r>>5,a=pj((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const u=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=o*t+(e>>5),i=t*r+e<<2,s=u[i]>=250&&u[i+1]>=250&&u[i+2]>=250?1<<31-e%32:0;a[n]|=s}m.board=a,m.hasImage=!0},m.timeInterval=function(t){p=null==t?1/0:t},m.words=function(t){c=t},m.size=function(e=[]){t=[+e[0],+e[1]]},m.text=function(t){e=dj(t)},m.font=function(t){n=dj(t)},m.fontWeight=function(t){i=dj(t)},m.rotate=function(t){o=dj(t)},m.spiral=function(t){s=mj[t]||t},m.fontSize=function(t){r=dj(t)},m.padding=function(t){a=dj(t)},m.random=function(t){u=dj(t)},m.on=function(t){l=dj(t)},m}const yj={size:[500,500],fontSize:[14,28]};function vj(t){return new Promise(((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const _j=t=>e=>{return n=void 0,r=void 0,o=function*(){const n=Object.assign({},yj,t),r=gj();yield function(t,e){return{set(n,r,i){if(void 0===e[n])return this;const o=r?r.call(null,e[n]):e[n];return i?i.call(null,o):"function"==typeof t[n]?t[n](o):t[n]=o,this},setAsync(n,r,i){return o=this,a=void 0,u=function*(){if(void 0===e[n])return this;const o=r?yield r.call(null,e[n]):e[n];return i?i.call(null,o):"function"==typeof t[n]?t[n](o):t[n]=o,this},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{i(u.next(t))}catch(t){e(t)}}function r(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):function(t){return t instanceof s?t:new s((function(e){e(t)}))}(e.value).then(n,r)}i((u=u.apply(o,a||[])).next())}));var o,a,s,u}}}(r,n).set("fontSize",(t=>{const n=e.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[sp(n),up(n)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",vj,r.createMask),r.words([...e]);const i=r.start(),[o,a]=n.size,s=[{x:0,y:0},{x:o,y:a}],{_bounds:u=s,_tags:l,hasImage:c}=i,h=l.map((t=>{var{x:e,y:n}=t,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["x","y"]);return Object.assign(Object.assign({},r),{x:e+o/2,y:n+a/2})})),[{x:p,y:f},{x:d,y:m}]=u,g={text:"",value:0,opacity:0,fontSize:0};return h.push(Object.assign(Object.assign({},g),{x:c?0:p,y:c?0:f}),Object.assign(Object.assign({},g),{x:c?o:d,y:c?a:m})),h},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{u(o.next(t))}catch(t){e(t)}}function s(t){try{u(o.throw(t))}catch(t){e(t)}}function u(e){e.done?t(e.value):function(t){return t instanceof i?t:new i((function(e){e(t)}))}(e.value).then(a,s)}u((o=o.apply(n,r||[])).next())}));var n,r,i,o};function bj(t){return"string"==typeof t?e=>e[t]:t}_j.props={};const xj=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,u=bj(s),l=bj(a),c=zN(e,(([t])=>t),(t=>u(t)));return t=>t.map((t=>{const e=c.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:o,t)),{}))}))};xj.props={};const wj=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};wj.props={};var Sj=s(6311),Ej=s.n(Sj);const Mj=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[u,l]=r;return t=>{const r=Array.from(FN(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=Ej().create(t.map((t=>t[e])),{min:i,max:o,size:a,width:s}),r=n.map((t=>t.x)),c=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[u]:r,[l]:c})}))}};Mj.props={};const Tj=t=>e=>{return n=void 0,r=void 0,o=function*(){const{width:n,height:r}=hz(e),{data:i,encode:o={},scale:a,style:s={},layout:u={}}=t,l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["data","encode","scale","style","layout"]),c={size:[n,r]},h={axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,n],range:[0,1]},y:{domain:[0,r],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},p=function(t,e){const{text:n="text",value:r="value"}=e;return t.map((t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]})))}(i,o),f=yield _j(Object.assign(Object.assign({},c),u))(p);return[VD({},h,Object.assign(Object.assign({data:f,encode:o,scale:a,style:s},l),{axis:!1}))]},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{u(o.next(t))}catch(t){e(t)}}function s(t){try{u(o.throw(t))}catch(t){e(t)}}function u(e){e.done?t(e.value):function(t){return t instanceof i?t:new i((function(e){e(t)}))}(e.value).then(a,s)}u((o=o.apply(n,r||[])).next())}));var n,r,i,o};function Aj(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function Cj(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Oj(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}Tj.props={};const Pj=Math.sqrt(50),kj=Math.sqrt(10),Lj=Math.sqrt(2);function Ij(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=Pj?10:o>=kj?5:o>=Lj?2:1)*10**i:-(10**-i)/(o>=Pj?10:o>=kj?5:o>=Lj?2:1)}function Rj(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=Pj?i*=10:o>=kj?i*=5:o>=Lj&&(i*=2),e<t?-i:i}const Dj=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],u=r[a];return u<s&&([s,u]=[u,s],[o,a]=[a,o]),i=Ij(s,u,n),i>0?(s=Math.floor(s/i)*i,u=Math.ceil(u/i)*i,i=Ij(s,u,n)):i<0&&(s=Math.ceil(s*i)/i,u=Math.floor(u*i)/i,i=Ij(s,u,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(u/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(u*i)/i),r},Nj=1e3,Fj=6e4,zj=36e5,Bj=864e5,jj=6048e5,Uj=2592e6,Zj=31536e6;function Vj(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],u=Math.floor(r);for(let l=a?o(t,r):o(t);+l<+e;n(l,u),i(l))s.push(new Date(+l));return s},duration:t}}const Gj=Vj(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Hj=Vj(Nj,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Nj*e)}),(t=>t.getSeconds())),Wj=Vj(Fj,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Fj*e)}),(t=>t.getMinutes())),qj=Vj(zj,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+zj*e)}),(t=>t.getHours())),Yj=Vj(Bj,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Bj*e)}),(t=>t.getDate()-1)),Xj=Vj(Uj,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),$j=Vj(jj,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+jj*e)}),(t=>{const e=Xj.floor(t),n=new Date(+t);return Math.floor((+n-+e)/jj)})),Kj=Vj(Zj,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Jj={millisecond:Gj,second:Hj,minute:Wj,hour:qj,day:Yj,week:$j,month:Xj,year:Kj},Qj=Vj(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),tU=Vj(Nj,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Nj*e)}),(t=>t.getUTCSeconds())),eU=Vj(Fj,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Fj*e)}),(t=>t.getUTCMinutes())),nU=Vj(zj,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+zj*e)}),(t=>t.getUTCHours())),rU=Vj(Bj,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Bj*e)}),(t=>t.getUTCDate()-1)),iU=Vj(Uj,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),oU=Vj(jj,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+jj*e)}),(t=>{const e=iU.floor(t),n=new Date(+t);return Math.floor((+n-+e)/jj)})),aU=Vj(Zj,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),sU={millisecond:Qj,second:tU,minute:eU,hour:nU,day:rU,week:oU,month:iU,year:aU};function uU(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:u,millisecond:l}=function(t){const e=t?sU:Jj,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:u,millisecond:l}=e;return{tickIntervals:[[u,1],[u,5],[u,15],[u,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),c=([t,e])=>t.duration*e,h=r?(a-o)/r:n||5,p=r||(a-o)/h,f=s.length,d=Oj(s,p,0,f,c);let m;if(d===f)m=[u,Rj(o/u.duration,a/u.duration,h)];else if(d){const t=p/c(s[d-1])<c(s[d])/p,[e,n]=t?s[d-1]:s[d];m=[e,r?Math.ceil(r/e.duration):n]}else m=[l,Math.max(Rj(o,a,h),1)];return m}const lU=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[u,l]=uU(a,s,n,r,i),c=[u.floor(a,l),u.ceil(s,l)];return o?c.reverse():c};var cU=s(4859);function hU(t){return!(0,cU.isUndefined)(t)&&!(0,cU.isNull)(t)&&!Number.isNaN(t)}const pU=t=>e=>-t(-e),fU=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?pU(r):r},dU=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?pU(n):n};function mU(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return(0,cU.isNumber)(n)?Math.round(n):n})(i):i;this.output=Aj(s,a,n,t)},n.prototype.invert=void 0}}var gU=s(7945),yU=s.n(gU);function vU(t,e,n){let r=n;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}function _U(t){const e=yU().get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*vU(a,o,e+1/3),255*vU(a,o,e),255*vU(a,o,e-1/3),i]}(r):null}const bU=(t,e)=>n=>t*(1-n)+e*n,xU=(t,e)=>"number"==typeof t&&"number"==typeof e?bU(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=_U(t),r=_U(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,wU=(t,e)=>{const n=bU(t,e);return t=>Math.round(n(t))};function SU({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function EU(t){return"object"==typeof t?t.valueOf():t}class MU extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=EU,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(SU({map:this.map,initKey:this.initKey},t))}has(t){return super.has(SU({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class TU{constructor(t){this.options=(0,cU.deepMix)({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=(0,cU.deepMix)({},this.options,t),this.rescale(t)}rescale(t){}}const AU=Symbol("defaultUnknown");function CU(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function OU(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==AU)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function PU(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class kU extends TU{getDefaultOptions(){return{domain:[],range:[],unknown:AU}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&CU(this.domainIndexMap,this.getDomain(),this.domainKey),OU({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&CU(this.rangeIndexMap,this.getRange(),this.rangeKey),OU({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=PU(e),this.rangeKey=PU(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new kU(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function LU(t){return Math.round(1e12*t)/1e12}class IU extends kU{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:AU,flex:[]}}constructor(t){super(t)}clone(){return new IU(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return function(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,u=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,u),[c,h]=n,p=h-c,f=p/(2/u*r+1-1/u*i),d=f*i/u,m=f-u*d,g=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),y=g.reduce(((t,e)=>t+e)),v=m/y,_=new MU(e.map(((t,e)=>{const n=g[e]*v;return[t,a?Math.floor(n):n]}))),b=new MU(e.map(((t,e)=>{const n=g[e]*v+d;return[t,a?Math.floor(n):n]}))),x=Array.from(b.values()).reduce(((t,e)=>t+e)),w=c+(p-(x-x/u*i))*s;let S=a?Math.round(w):w;const E=new Array(u);for(let t=0;t<u;t+=1){E[t]=LU(S);const n=e[t];S+=b.get(n)}return{valueBandWidth:_,valueStep:b,adjustedRange:E}}(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:u}=t;let l,c,h=i[0];const p=i[1]-h,f=2*o,d=r-a;l=p/Math.max(1,f+d),s&&(l=Math.floor(l)),h+=(p-l*(r-a))*u,c=l*(1-a),s&&(h=Math.round(h),c=Math.round(c));const m=new Array(r).fill(0).map(((t,e)=>h+e*l));return{valueStep:l,valueBandWidth:c,adjustedRange:m}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const RU=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=Ij(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class DU extends TU{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:RU}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return(0,cU.isNumber)(r)&&(0,cU.isNumber)(i)?t(r,i,n):[]}clone(){return new DU(this.options)}}function NU(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const FU=[1,5,2,2.5,4,3],zU=100*Number.EPSILON;function BU(t,e,n,r,i,o){const a=(0,cU.size)(e),s=(0,cU.indexOf)(e,t);let u=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<zU||o-l<zU)&&r<=0&&i>=0&&(u=1),1-s/(a-1)-n+u}function jU(t,e,n){const r=(0,cU.size)(e);return 1-(0,cU.indexOf)(e,t)/(r-1)-n+1}function UU(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function ZU(t,e){return t>=e?2-(t-1)/(e-1):1}function VU(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function GU(t,e,n){const r=e-t;return n>r?1-((n-r)/2)**2/(.1*r)**2:1}const HU=(t,e,n=5,r=!0,i=FU,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let u=1;for(;u<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],c=jU(l,i,u);if(o[0]*c+o[1]+o[2]+o[3]<s.score){u=1/0;break}let h=2;for(;h<1/0;){const n=ZU(h,a);if(o[0]*c+o[1]+o[2]*n+o[3]<s.score)break;const p=(e-t)/(h+1)/u/l;let f=Math.ceil(Math.log10(p));for(;f<1/0;){const p=u*l*10**f,d=GU(t,e,p*(h-1));if(o[0]*c+o[1]*d+o[2]*n+o[3]<s.score)break;const m=Math.floor(e/p)*u-(h-1)*u,g=Math.ceil(t/p)*u;if(m<=g){const n=g-m;for(let c=0;c<=n;c+=1){const n=(m+c)*(p/u),f=n+p*(h-1),d=p,g=BU(l,i,u,n,f,d),y=VU(t,e,n,f),v=UU(h,a,t,e,n,f),_=1,b=o[0]*g+o[1]*y+o[2]*v+o[3]*_;b>s.score&&(!r||n<=t&&f>=e)&&(s.lmin=n,s.lmax=f,s.lstep=d,s.score=b)}}f+=1}h+=1}}u+=1}const l=NU(s.lmax),c=NU(s.lmin),h=NU(s.lstep),p=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-c)/h))+1,f=new Array(p);f[0]=NU(c);for(let t=1;t<p;t+=1)f[t]=NU(f[t-1]+h);return f};class WU extends TU{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:HU}}map(t){return hU(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new WU(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return(0,cU.isNumber)(r)&&(0,cU.isNumber)(i)?n(r,i,e):[]}}const qU=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,u;return r<i?(s=Cj(r,i),u=n(o,a)):(s=Cj(i,r),u=n(a,o)),Aj(u,s)},YU=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,u=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Cj(s[t],s[t+1]),o[t]=n(u[t],u[t+1]);return e=>{const n=Oj(t,e,1,r)-1,a=i[n];return Aj(o[n],a)(e)}},XU=(t,e,n,r)=>(Math.min(t.length,e.length)>2?YU:qU)(t,e,r?wU:n);class $U extends TU{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:bU,tickCount:5}}map(t){return hU(t)?this.output(t):this.options.unknown}invert(t){return hU(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Dj}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):cU.identity}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=XU(n.map(t),r,o,i);this.output=Aj(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=XU(i,r.map(t),bU);this.input=Aj(e,n,o)}}class KU extends $U{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:xU,tickMethod:RU,tickCount:5}}chooseTransforms(){return[cU.identity,cU.identity]}clone(){return new KU(this.options)}}class JU extends IU{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:AU,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new JU(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const QU=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class tZ extends $U{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:xU,tickMethod:RU,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[cU.identity,cU.identity];const e=.5===t?QU:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new tZ(this.options)}}class eZ extends tZ{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:xU,tickMethod:RU,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new eZ(this.options)}}class nZ extends TU{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!hU(t))return this.options.unknown;const e=Oj(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new nZ(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const rZ=(t,e,n,r=10)=>{const i=t<0,o=dU(r,i),a=fU(r,i),s=e<t,u=s?e:t,l=s?t:e;let c=a(u),h=a(l),p=[];if(!(r%1)&&h-c<n){if(c=Math.floor(c),h=Math.ceil(h),i)for(;c<=h;c+=1){const t=o(c);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=u&&p.push(n)}}else for(;c<=h;c+=1){const t=o(c);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=u&&p.push(n)}}2*p.length<n&&(p=RU(u,l,n))}else{const t=-1===n?h-c:Math.min(h-c,n);p=RU(c,h,t).map(o)}return s?p.reverse():p},iZ=(t,e,n,r)=>{const i=t<0,o=fU(r,i),a=dU(r,i),s=t>e,u=s?e:t,l=s?t:e,c=[a(Math.floor(o(u))),a(Math.ceil(o(l)))];return s?c.reverse():c};class oZ extends $U{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:xU,tickMethod:rZ,tickCount:5}}chooseNice(){return iZ}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[fU(t,n),dU(t,n)]}clone(){return new oZ(this.options)}}class aZ extends nZ{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:HU}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Dj(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new aZ(this.options)}}function sZ(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class uZ extends nZ{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:HU}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(sZ(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new uZ(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var lZ=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,cZ=/\[([^]*?)\]/gm;function hZ(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}var pZ=function(t){return function(e,n){var r=n[t].map((function(t){return t.toLowerCase()})),i=r.indexOf(e.toLowerCase());return i>-1?i:null}};function fZ(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var dZ=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],mZ=["January","February","March","April","May","June","July","August","September","October","November","December"],gZ=hZ(mZ,3),yZ=fZ({},{dayNamesShort:hZ(dZ,3),dayNames:dZ,monthNamesShort:gZ,monthNames:mZ,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),vZ=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},_Z={D:function(t){return String(t.getDate())},DD:function(t){return vZ(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return vZ(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return vZ(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return vZ(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return vZ(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return vZ(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return vZ(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return vZ(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return vZ(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return vZ(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return vZ(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+vZ(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+vZ(Math.floor(Math.abs(e)/60),2)+":"+vZ(Math.abs(e)%60,2)}},bZ=(pZ("monthNamesShort"),pZ("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});const xZ=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[u,l]=uU(a,s,n,r,i),c=u.range(a,new Date(+s+1),l,!0);return o?c.reverse():c};function wZ(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class SZ extends $U{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:xZ,interpolate:bU,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return lU}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?sU:Jj,r=e?wZ:cU.identity;return e=>function(t,e,n){if(void 0===e&&(e=bZ.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=bZ[e]||e).replace(cZ,(function(t,e){return r.push(e),"@@@"}));var i=fZ(fZ({},yZ),n);return(e=e.replace(lZ,(function(e){return _Z[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:u}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":u.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new SZ(this.options)}}var EZ;let MZ=EZ=class extends KU{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:cU.identity,tickMethod:RU,tickCount:5}}constructor(t){super(t)}clone(){return new EZ(this.options)}};MZ=EZ=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([mU((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return Aj(bU(0,1),Cj(e,n))}))],MZ);var TZ;let AZ=TZ=class extends KU{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:cU.identity,tickMethod:RU,tickCount:5}}constructor(t){super(t)}clone(){return new TZ(this.options)}};function CZ(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}function OZ(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function PZ(t){return t.map(((t,e)=>e))}function kZ(t){return t[t.length-1]}function LZ(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function IZ(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++)IZ(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}));return n}function RZ([t,e],[n,r]){return[t-n,e-r]}function DZ([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function NZ([t,e]){return Math.atan2(e,t)}function FZ([t,e]){return NZ([t,e])+Math.PI/2}function zZ(t,e){const n=NZ(t),r=NZ(e);return n<r?r-n:2*Math.PI-(n-r)}function BZ(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function jZ([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function UZ(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function ZZ(t,e,n,r,i){const o=NZ(RZ(r,e))+Math.PI,a=NZ(RZ(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function VZ(t,e,n,r="y",i="between"){const o="y"===r||!0===r?n:e,a="y"===r||!0===r?90:0,s=PZ(o),[u,l]=CZ(s,(t=>o[t])),c=new KU({domain:[u,l],range:[0,100]}),h=t=>c.map(o[t]),p={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`},f=s.sort(((t,e)=>h(t)-h(e))).map(p[i]||p.between).join(",");return`linear-gradient(${a}deg, ${f})`}function GZ(t){const[e,n,r,i]=t;return[i,e,n,r]}function HZ(t,e,n){const[r,i,,o]=UN(t)?GZ(e):e,[a,s]=n,u=t.getCenter(),l=FZ(RZ(r,u)),c=FZ(RZ(i,u)),h=c===l&&a!==s?c+2*Math.PI:c;return{startAngle:l,endAngle:h-l>=0?h:2*Math.PI+h,innerRadius:DZ(o,u),outerRadius:DZ(r,u)}}function WZ(t,e,n,r){const{defaultColor:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({defaultColor:i},a)}function qZ(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function YZ(t,e){if(!ZN(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function XZ(t){if(1===t.length)return t[0];const[[e,n],[r,i]]=t;return[(e+r)/2,(n+i)/2]}function $Z(t){return new KZ([t],null,t,t.ownerDocument)}AZ=TZ=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([mU((function(t){return[t(0),t(.5),t(1)]}),(t=>{const[e,n,r]=t,i=Aj(bU(0,.5),Cj(e,n)),o=Aj(bU(.5,1),Cj(n,r));return t=>e>r?t<n?o(t):i(t):t<n?i(t):o(t)}))],AZ);class KZ{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new KZ(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new KZ(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new KZ([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,o]=Array.isArray(r)?r:[r,null],a=e(i,t);a.__data__=i,null!==o&&(a.__fromElements__=o),this._parent.appendChild(a),n.push(a)}return new KZ(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new KZ(n,null,n[0],this._document)}maybeAppend(t,e){const n=this._elements[0],r=n.getElementById(t);if(r)return new KZ([r],null,this._parent,this._document);const i="string"==typeof e?this.createElement(e):e();return i.id=t,n.appendChild(i),new KZ([i],null,this._parent,this._document)}data(t,e=(t=>t),n=(()=>null)){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,u=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),c=FN(this._elements,(t=>n(t.__data__)));for(let h=0;h<t.length;h++){const p=t[h],f=e(p,h),d=n(p,h);if(u.has(f)){const t=u.get(f);t.__data__=p,t.__facet__=!1,i.push(t),o.delete(t),u.delete(f)}else if(l.has(f)){const t=l.get(f);t.__data__=p,t.__facet__=!0,i.push(t),l.delete(f)}else if(c.has(f)){const t=c.get(f);a.push([p,t]);for(const e of t)o.delete(e);c.delete(f)}else if(u.has(d)){const t=u.get(d);t.__toData__?t.__toData__.push(p):t.__toData__=[p],s.add(t),o.delete(t)}else r.push(p)}const h=[new KZ([],r,this._parent,this._document),new KZ(i,null,this._parent,this._document),new KZ(o,null,this._parent,this._document),new KZ([],a,this._parent,this._document),new KZ(s,null,this._parent,this._document)];return new KZ(this._elements,null,this._parent,this._document,h)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new KZ(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=KZ.registry[t];return e?new e:FF(`Unknown node type: ${t}`)}join(t=(t=>t),e=(t=>t),n=(t=>t.remove()),r=(t=>t),i=(t=>t.remove())){const o=t(this._enter),a=e(this._update),s=n(this._exit),u=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(u).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(e){const n=Array.isArray(e)?e:[e];Promise.all(n.map((t=>t.finished))).then((()=>{this._elements[t].remove()}))}else this._elements[t].remove()}return new KZ([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i){void 0!==e&&(this.style[t]=n.call(this,r,i))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r){n[r]=e.call(this,t,r)}))}on(t,e){return this.each((function(){this.addEventListener(t,e)})),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}KZ.registry={g:rI,rect:cI,circle:tI,path:sI,text:hI,ellipse:nI,image:oI,line:aI,polygon:uI,polyline:lI,html:iI};var JZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function QZ(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const tV=t=>{const{shape:e,radius:n}=t,r=JZ(t,["shape","radius"]),i=UF(r,"pointer"),o=UF(r,"pin"),{shape:a}=i,s=JZ(i,["shape"]),{shape:u}=o,l=JZ(o,["shape"]);return(t,e,i,o)=>{const c=t.map((t=>i.invert(t))),[h,p,f]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find((t=>"polar"===t[0]));return r}(i),d=i.clone(),{color:m}=e,g=JD({startAngle:h,endAngle:p,innerRadius:f,outerRadius:n});g.push(["cartesian"]),d.update({transformations:g});const y=c.map((t=>d.map(t))),[v,_]=XZ(y),[b,x]=i.getCenter(),w=Object.assign(Object.assign({x1:v,y1:_,x2:b,y2:x,stroke:m},s),r),S=Object.assign(Object.assign({cx:b,cy:x,stroke:m},l),r),E=$Z(new rI);return WF(a)||("function"==typeof a?E.append((()=>a(y,e,d,o))):E.append("line").call(UZ,w).node()),WF(u)||("function"==typeof u?E.append((()=>u(y,e,d,o))):E.append("circle").call(UZ,S).node()),E.node()}},eV=t=>{const e={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},n={style:{shape:tV,lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},r={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};return()=>{const{data:i={},scale:o={},style:a={},animate:s={},transform:u=[]}=t,l=JZ(t,["data","scale","style","animate","transform"]),{targetData:c,totalData:h,target:p,total:f,scale:d}=function(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=t,s=o||r,u=o?1:i,l=Object.assign({y:{domain:[0,u]}},e);return a.length?{targetData:[{x:n,y:s,color:"target"}],totalData:a.map(((t,e)=>({x:n,y:e>=1?t-a[e-1]:t,color:e}))),target:s,total:u,scale:l}:{targetData:[{x:n,y:s,color:"target"}],totalData:[{x:n,y:s,color:"target"},{x:n,y:u-s,color:"total"}],target:s,total:u,scale:l}}(i,o),m=UF(a,"text"),g=function(t,e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.find((e=>t.startsWith(e))))))}(a,["pointer","pin"]);return[VD({},e,Object.assign({type:"interval",transform:[{type:"stackY"}],data:h,scale:d,style:UF(a,"arc"),animate:"object"==typeof s?UF(s,"arc"):s},l)),VD({},e,n,Object.assign({type:"point",data:c,scale:d,style:g,animate:"object"==typeof s?UF(s,"indicator"):s},l)),VD({},r,{style:Object.assign({text:QZ(m,{target:p,total:f})},m),animate:"object"==typeof s?UF(s,"text"):s})]}};eV.props={};const nV=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const u=e.x,l=e.series,c=Array.from(t,(e=>{const n=u.getBandWidth(u.invert(+i[e])),c=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),h=(+(null==o?void 0:o[e])||0)*n,p=+i[e]+h+c/2;return[...a.map(((n,r)=>[p+ +s[r][e]/t.length,+a[r][e]])),...a.map(((n,r)=>[p-+s[r][e]/t.length,+a[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,c]};nV.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["density"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[{type:"maybeKey"},{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}],interaction:{shareTooltip:!0}};const rV=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};rV.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...EN({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[{type:"maybeKey"},{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]};const iV=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];iV.props={};const oV=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];oV.props={};const aV=t=>new IU(t);aV.props={};const sV=t=>new KU(t);sV.props={};const uV=t=>new kU(t);uV.props={};const lV=t=>new WU(t);lV.props={};const cV=t=>new JU(t);cV.props={};const hV=t=>new SZ(t);hV.props={};const pV=t=>new oZ(t);pV.props={};const fV=t=>new tZ(t);fV.props={};const dV=t=>new nZ(t);dV.props={};const mV=t=>new uZ(t);mV.props={};const gV=t=>new aZ(t);gV.props={};const yV=t=>new eZ(t);yV.props={};const vV=t=>new MZ(t);vV.props={};const _V=t=>new DU(t);function bV(t){return function(){return t}}_V.props={};const xV=Math.abs,wV=Math.atan2,SV=Math.cos,EV=Math.max,MV=Math.min,TV=Math.sin,AV=Math.sqrt,CV=1e-12,OV=Math.PI,PV=OV/2,kV=2*OV;function LV(t){return t>=1?PV:t<=-1?-PV:Math.asin(t)}const IV=Math.PI,RV=2*IV,DV=1e-6,NV=RV-DV;function FV(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class zV{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?FV:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return FV;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,h=l*l+c*c;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>DV)if(Math.abs(c*s-u*l)>DV&&i){let p=n-o,f=r-a,d=s*s+u*u,m=p*p+f*f,g=Math.sqrt(d),y=Math.sqrt(h),v=i*Math.tan((IV-Math.acos((d+h-m)/(2*g*y)))/2),_=v/y,b=v/g;Math.abs(_-1)>DV&&this._append`L${t+_*l},${e+_*c}`,this._append`A${i},${i},0,0,${+(c*p>l*f)},${this._x1=t+b*s},${this._y1=e+b*u}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,h=o?r-i:i-r;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>DV||Math.abs(this._y1-l)>DV)&&this._append`L${u},${l}`,n&&(h<0&&(h=h%RV+RV),h>NV?this._append`A${n},${n},0,1,${c},${t-a},${e-s}A${n},${n},0,1,${c},${this._x1=u},${this._y1=l}`:h>DV&&this._append`A${n},${n},0,${+(h>=IV)},${c},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function BV(){return new zV}function jV(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new zV(e)}function UV(t){return t.innerRadius}function ZV(t){return t.outerRadius}function VV(t){return t.startAngle}function GV(t){return t.endAngle}function HV(t){return t&&t.padAngle}function WV(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/AV(s*s+u*u),c=l*u,h=-l*s,p=t+c,f=e+h,d=n+c,m=r+h,g=(p+d)/2,y=(f+m)/2,v=d-p,_=m-f,b=v*v+_*_,x=i-o,w=p*m-d*f,S=(_<0?-1:1)*AV(EV(0,x*x*b-w*w)),E=(w*_-v*S)/b,M=(-w*v-_*S)/b,T=(w*_+v*S)/b,A=(-w*v+_*S)/b,C=E-g,O=M-y,P=T-g,k=A-y;return C*C+O*O>P*P+k*k&&(E=T,M=A),{cx:E,cy:M,x01:-c,y01:-h,x11:E*(i/x-1),y11:M*(i/x-1)}}function qV(){var t=UV,e=ZV,n=bV(0),r=null,i=VV,o=GV,a=HV,s=null,u=jV(l);function l(){var l,c,h=+t.apply(this,arguments),p=+e.apply(this,arguments),f=i.apply(this,arguments)-PV,d=o.apply(this,arguments)-PV,m=xV(d-f),g=d>f;if(s||(s=l=u()),p<h&&(c=p,p=h,h=c),p>CV)if(m>kV-CV)s.moveTo(p*SV(f),p*TV(f)),s.arc(0,0,p,f,d,!g),h>CV&&(s.moveTo(h*SV(d),h*TV(d)),s.arc(0,0,h,d,f,g));else{var y,v,_=f,b=d,x=f,w=d,S=m,E=m,M=a.apply(this,arguments)/2,T=M>CV&&(r?+r.apply(this,arguments):AV(h*h+p*p)),A=MV(xV(p-h)/2,+n.apply(this,arguments)),C=A,O=A;if(T>CV){var P=LV(T/h*TV(M)),k=LV(T/p*TV(M));(S-=2*P)>CV?(x+=P*=g?1:-1,w-=P):(S=0,x=w=(f+d)/2),(E-=2*k)>CV?(_+=k*=g?1:-1,b-=k):(E=0,_=b=(f+d)/2)}var L=p*SV(_),I=p*TV(_),R=h*SV(w),D=h*TV(w);if(A>CV){var N,F=p*SV(b),z=p*TV(b),B=h*SV(x),j=h*TV(x);if(m<OV)if(N=function(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,h=s-o,p=h*u-c*l;if(!(p*p<CV))return[t+(p=(c*(e-o)-h*(t-i))/p)*u,e+p*l]}(L,I,B,j,F,z,R,D)){var U=L-N[0],Z=I-N[1],V=F-N[0],G=z-N[1],H=1/TV(function(t){return t>1?0:t<-1?OV:Math.acos(t)}((U*V+Z*G)/(AV(U*U+Z*Z)*AV(V*V+G*G)))/2),W=AV(N[0]*N[0]+N[1]*N[1]);C=MV(A,(h-W)/(H-1)),O=MV(A,(p-W)/(H+1))}else C=O=0}E>CV?O>CV?(y=WV(B,j,L,I,p,O,g),v=WV(F,z,R,D,p,O,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),O<A?s.arc(y.cx,y.cy,O,wV(y.y01,y.x01),wV(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,O,wV(y.y01,y.x01),wV(y.y11,y.x11),!g),s.arc(0,0,p,wV(y.cy+y.y11,y.cx+y.x11),wV(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,O,wV(v.y11,v.x11),wV(v.y01,v.x01),!g))):(s.moveTo(L,I),s.arc(0,0,p,_,b,!g)):s.moveTo(L,I),h>CV&&S>CV?C>CV?(y=WV(R,D,F,z,h,-C,g),v=WV(L,I,B,j,h,-C,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),C<A?s.arc(y.cx,y.cy,C,wV(y.y01,y.x01),wV(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,C,wV(y.y01,y.x01),wV(y.y11,y.x11),!g),s.arc(0,0,h,wV(y.cy+y.y11,y.cx+y.x11),wV(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,C,wV(v.y11,v.x11),wV(v.y01,v.x01),!g))):s.arc(0,0,h,w,x,g):s.lineTo(R,D)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-OV/2;return[SV(r)*n,TV(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:bV(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:bV(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:bV(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:bV(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:bV(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:bV(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:bV(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}BV.prototype=zV.prototype;var YV=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function XV(t,e,n,r={}){const{inset:i=0,radius:o=0,insetLeft:a=i,insetTop:s=i,insetRight:u=i,insetBottom:l=i,radiusBottomLeft:c=o,radiusBottomRight:h=o,radiusTopLeft:p=o,radiusTopRight:f=o}=r,d=YV(r,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight"]);if(!ZN(n)&&!GN(n)){const e=!!UN(n),[r,,i]=e?GZ(t):t,[o,m]=r,[g,y]=RZ(i,r),v=(g>0?o:o+g)+a,_=(y>0?m:m+y)+s,b=Math.abs(g)-(a+u),x=Math.abs(y)-(s+l);return $Z(new cI({})).style("x",v).style("y",_).style("width",b).style("height",x).style("radius",[p,f,h,c]).call(UZ,d).node()}const{y:m,y1:g}=e,y=n.getCenter(),v=HZ(n,t,[m,g]),_=qV().cornerRadius(o).padAngle(i*Math.PI/180);return $Z(new sI({})).style("path",_(v)).style("transform",`translate(${y[0]}, ${y[1]})`).style("radius",o).style("inset",i).call(UZ,d).node()}const $V=t=>{const{colorAttribute:e,opacityAttribute:n="fill",first:r=!0,last:i=!0}=t,o=YV(t,["colorAttribute","opacityAttribute","first","last"]);return(n,a,s,u)=>{const{mark:l,shape:c,defaultShape:h}=a,p=WZ(u,l,c,h),{defaultColor:f,radius:d=0}=p,m=YV(p,["defaultColor","radius"]),g=m.lineWidth||1,{stroke:y,radius:v=d,radiusTopLeft:_=v,radiusTopRight:b=v,radiusBottomRight:x=v,radiusBottomLeft:w=v,innerRadius:S=0,innerRadiusTopLeft:E=S,innerRadiusTopRight:M=S,innerRadiusBottomRight:T=S,innerRadiusBottomLeft:A=S,lineWidth:C=("stroke"===e||y?g:0),inset:O=0,insetLeft:P=O,insetRight:k=O,insetBottom:L=O,insetTop:I=O}=o,R=YV(o,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop"]),{color:D=f,opacity:N}=a,F=[r?_:E,r?b:M,i?x:T,i?w:A],z=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];UN(s)&&z.push(z.shift());const B=Object.assign(Object.assign({radius:v},Object.fromEntries(z.map(((t,e)=>[t,F[e]])))),{inset:O,insetLeft:P,insetRight:k,insetBottom:L,insetTop:I});return $Z(XV(n,a,s,B)).call(UZ,m).style("fill","transparent").style(e,D).style(qZ(t),N).style("lineWidth",C).style("stroke",void 0===y?D:y).call(UZ,R).node()}};$V.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const KV=t=>$V(Object.assign({colorAttribute:"fill"},t));KV.props=Object.assign(Object.assign({},$V.props),{defaultMarker:"square"});const JV=t=>$V(Object.assign({colorAttribute:"stroke"},t));function QV(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function tG(t){this._context=t}function eG(t){return new tG(t)}function nG(t){return t[0]}function rG(t){return t[1]}function iG(t,e){var n=bV(!0),r=null,i=eG,o=null,a=jV(s);function s(s){var u,l,c,h=(s=QV(s)).length,p=!1;for(null==r&&(o=i(c=a())),u=0;u<=h;++u)!(u<h&&n(l=s[u],u,s))===p&&((p=!p)?o.lineStart():o.lineEnd()),p&&o.point(+t(l,u,s),+e(l,u,s));if(c)return o=null,c+""||null}return t="function"==typeof t?t:void 0===t?nG:bV(t),e="function"==typeof e?e:void 0===e?rG:bV(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:bV(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:bV(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:bV(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function oG(){}function aG(t){this._context=t}function sG(t){return new aG(t)}JV.props=Object.assign(Object.assign({},$V.props),{defaultMarker:"hollowSquare"}),Array.prototype.slice,tG.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)}}},aG.prototype={areaStart:oG,areaEnd:oG,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))}};var uG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function lG(t,e,n){const[r,i,o,a]=t;return UN(n)?[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]:[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}const cG=t=>{const{adjustPoints:e=lG}=t,n=uG(t,["adjustPoints"]);return(t,r,i,o,a,...s)=>{const{index:u,mark:l,shape:c,defaultShape:h}=r,p=WZ(o,l,c,h),{defaultColor:f}=p,d=uG(p,["defaultColor"]),m=a[u+1],g=e(t,m,i),y=!!UN(i),[v,_,b,x]=y?GZ(g):g,{color:w=f,opacity:S}=r,E=iG().curve(sG)([v,_,b,x]);return $Z(new sI({})).call(UZ,d).style("path",E).style("fill",w).style("fillOpacity",S).call(UZ,n).node()}};function hG(t,e,n){const[r,i,o,a]=t;return UN(n)?[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]:[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}cG.props={defaultMarker:"square"};const pG=t=>cG(Object.assign({adjustPoints:hG},t));pG.props={defaultMarker:"square"};var fG=mG(eG);function dG(t){this._curve=t}function mG(t){function e(e){return new dG(t(e))}return e._curve=t,e}function gG(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(mG(t)):e()._curve},t}function yG(t){const e="function"==typeof t?t:t.render;return class extends eI{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}dG.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 vG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const _G=yG((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes;$Z(t).maybeAppend("line",(()=>new sI({}))).style("d",e).call(UZ,r),$Z(t).maybeAppend("line1",(()=>new sI({}))).style("d",n).call(UZ,i)})),bG=t=>{const{curve:e,gradient:n=!1,gradientColor:r="between",defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=vG(t,["curve","gradient","gradientColor","defined","connect"]);return(t,s,u,l)=>{const{mark:c,shape:h,defaultShape:p}=s,f=WZ(l,c,h,p),{defaultColor:d,lineWidth:m}=f,g=vG(f,["defaultColor","lineWidth"]),{color:y=d,size:v=m,seriesColor:_,seriesX:b,seriesY:x}=s,w=n&&_?VZ(_,b,x,n,r):y,S=YZ(u,s),E=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),w&&{stroke:w}),v&&{lineWidth:v}),S&&{transform:S}),a);let M;if(ZN(u)){const t=u.getCenter();M=n=>gG(iG().curve(fG)).angle(((e,r)=>FZ(RZ(n[r],t)))).radius(((e,r)=>DZ(n[r],t))).defined((([t,e])=>i(t)&&i(e))).curve(e)(n)}else M=iG().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>i(t)&&i(e))).curve(e);const[T,A]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,i),C=UF(E,"connect"),O=!!A.length;return!O||o&&!Object.keys(C).length?$Z(new sI({})).style("d",M(T)||[]).call(UZ,E).node():O&&!o?$Z(new sI({})).style("d",M(t)).call(UZ,E).node():$Z(new _G).style("style1",Object.assign(Object.assign({},E),C)).style("style2",E).style("d1",(P=A,P.map(M).join(","))).style("d2",M(t)).node();var P}};bG.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xG=t=>(e,n,r,i)=>{const o=ZN(r)?sG:eG;return bG(Object.assign({curve:o},t))(e,n,r,i)};function wG(t,e,n){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-n),t._x2,t._y2)}function SG(t,e){this._context=t,this._k=(1-e)/6}function EG(t,e){this._context=t,this._k=(1-e)/6}function MG(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>CV){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>CV){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function TG(t,e){this._context=t,this._alpha=e}xG.props=Object.assign(Object.assign({},bG.props),{defaultMarker:"line"}),SG.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:wG(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:wG(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}},function t(e){function n(t){return new SG(t,e)}return n.tension=function(e){return t(+e)},n}(0),EG.prototype={areaStart:oG,areaEnd:oG,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:wG(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}},function t(e){function n(t){return new EG(t,e)}return n.tension=function(e){return t(+e)},n}(0),TG.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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:MG(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}};const AG=function t(e){function n(t){return e?new TG(t,e):new SG(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function CG(t,e){this._context=t,this._alpha=e}CG.prototype={areaStart:oG,areaEnd:oG,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 n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:MG(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}};const OG=function t(e){function n(t){return e?new CG(t,e):new EG(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);const PG=t=>{const{alpha:e=.5}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["alpha"]);return(t,r,i,o)=>{const a=ZN(i)?OG:AG;return bG(Object.assign({curve:a.alpha(e)},n))(t,r,i,o)}};function kG(t,e){this._context=t,this._t=e}function LG(t){return new kG(t,.5)}function IG(t){return new kG(t,0)}function RG(t){return new kG(t,1)}PG.props=Object.assign(Object.assign({},bG.props),{defaultMarker:"smooth"}),kG.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 n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const DG=t=>bG(Object.assign({curve:RG},t));DG.props=Object.assign(Object.assign({},bG.props),{defaultMarker:"hv"});const NG=t=>bG(Object.assign({curve:IG},t));NG.props=Object.assign(Object.assign({},bG.props),{defaultMarker:"vh"});const FG=t=>bG(Object.assign({curve:LG},t));FG.props=Object.assign(Object.assign({},bG.props),{defaultMarker:"hvh"});var zG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const BG=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];BG.style=["fill"];const jG=BG.bind(void 0);jG.style=["stroke","lineWidth"];const UG=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];UG.style=["fill"];const ZG=UG.bind(void 0);ZG.style=["fill"];const VG=UG.bind(void 0);VG.style=["stroke","lineWidth"];const GG=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};GG.style=["fill"];const HG=GG.bind(void 0);HG.style=["stroke","lineWidth"];const WG=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};WG.style=["fill"];const qG=WG.bind(void 0);qG.style=["stroke","lineWidth"];const YG=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};YG.style=["fill"];const XG=YG.bind(void 0);XG.style=["stroke","lineWidth"];const $G=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};$G.style=["fill"];const KG=$G.bind(void 0);KG.style=["stroke","lineWidth"];const JG=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};JG.style=["fill"];const QG=JG.bind(void 0);QG.style=["stroke","lineWidth"];const tH=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];tH.style=["stroke","lineWidth"];const eH=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];eH.style=["stroke","lineWidth"];const nH=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];nH.style=["stroke","lineWidth"];const rH=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];rH.style=["stroke","lineWidth"];const iH=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];iH.style=["stroke","lineWidth"];const oH=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];oH.style=["stroke","lineWidth"];const aH=oH.bind(void 0);aH.style=["stroke","lineWidth"];const sH=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];sH.style=["stroke","lineWidth"];const uH=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];uH.style=["stroke","lineWidth"];const lH=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];lH.style=["stroke","lineWidth"];const cH=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];cH.style=["stroke","lineWidth"];const hH=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];hH.style=["stroke","lineWidth"];const pH=new Map([["bowtie",JG],["cross",eH],["dash",aH],["diamond",GG],["dot",oH],["hexagon",$G],["hollowBowtie",QG],["hollowDiamond",HG],["hollowHexagon",KG],["hollowPoint",jG],["hollowSquare",VG],["hollowTriangle",qG],["hollowTriangleDown",XG],["hv",uH],["hvh",cH],["hyphen",iH],["line",tH],["plus",rH],["point",BG],["rect",ZG],["smooth",sH],["square",UG],["tick",nH],["triangleDown",YG],["triangle",WG],["vh",lH],["vhv",hH]]);var fH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const dH=t=>{const{colorAttribute:e,symbol:n,mode:r="auto"}=t,i=fH(t,["colorAttribute","symbol","mode"]),o=pH.get(n)||pH.get("point");return(n,a,s,u)=>{const{mark:l,shape:c,defaultShape:h}=a,p=WZ(u,l,c,h),{defaultColor:f,lineWidth:d}=p,m=fH(p,["defaultColor","lineWidth"]),g=i.stroke?d||1:d,{color:y=f,transform:v,opacity:_}=a,[b,x]=XZ(n),w=function(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||WN(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}(r,n,a,s),S=w||i.r||m.r;return $Z(new sI).call(UZ,m).style("fill","transparent").style("d",o(b,x,S)).style("lineWidth",g).style("transform",v).style("stroke",y).style(qZ(t),_).style(e,y).call(UZ,i).node()}};dH.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mH=t=>dH(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t));mH.props=Object.assign({defaultMarker:"bowtie"},dH.props);const gH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"cross"},t));gH.props=Object.assign({defaultMarker:"cross"},dH.props);const yH=t=>dH(Object.assign({colorAttribute:"fill",symbol:"diamond"},t));yH.props=Object.assign({defaultMarker:"diamond"},dH.props);const vH=t=>dH(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t));vH.props=Object.assign({defaultMarker:"hexagon"},dH.props);const _H=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t));_H.props=Object.assign({defaultMarker:"hollowBowtie"},dH.props);const bH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t));bH.props=Object.assign({defaultMarker:"hollowDiamond"},dH.props);const xH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t));xH.props=Object.assign({defaultMarker:"hollowHexagon"},dH.props);const wH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"point"},t));wH.props=Object.assign({defaultMarker:"hollowPoint"},dH.props);const SH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"square"},t));SH.props=Object.assign({defaultMarker:"hollowSquare"},dH.props);const EH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t));EH.props=Object.assign({defaultMarker:"hollowTriangle"},dH.props);const MH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t));MH.props=Object.assign({defaultMarker:"hollowTriangleDown"},dH.props);const TH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t));TH.props=Object.assign({defaultMarker:"hyphen"},dH.props);const AH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"line"},t));AH.props=Object.assign({defaultMarker:"line"},dH.props);const CH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"plus"},t));CH.props=Object.assign({defaultMarker:"plus"},dH.props);const OH=t=>dH(Object.assign({colorAttribute:"fill",symbol:"point"},t));OH.props=Object.assign({defaultMarker:"point"},dH.props);const PH=t=>dH(Object.assign({colorAttribute:"fill",symbol:"square"},t));PH.props=Object.assign({defaultMarker:"square"},dH.props);const kH=t=>dH(Object.assign({colorAttribute:"stroke",symbol:"tick"},t));kH.props=Object.assign({defaultMarker:"tick"},dH.props);const LH=t=>dH(Object.assign({colorAttribute:"fill",symbol:"triangle"},t));LH.props=Object.assign({defaultMarker:"triangle"},dH.props);const IH=t=>dH(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t));IH.props=Object.assign({defaultMarker:"triangleDown"},dH.props);var RH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const DH=t=>{const{arrow:e=!0,arrowSize:n="40%"}=t,r=RH(t,["arrow","arrowSize"]);return(t,i,o,a)=>{const{mark:s,shape:u,defaultShape:l,transform:c}=i,h=WZ(a,s,u,l),{defaultColor:p}=h,f=RH(h,["defaultColor"]),{color:d=p}=i,[m,g]=t,y=BV();if(y.moveTo(...m),y.lineTo(...g),e){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*DZ(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,u=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(u),e[1]-i*Math.sin(u)]]}(m,g,{arrowSize:n});y.moveTo(...g),y.lineTo(...t),y.moveTo(...g),y.lineTo(...e)}return $Z(new sI).call(UZ,f).style("d",y.toString()).style("stroke",d||p).style("transform",c).call(UZ,r).node()}};DH.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const NH=function(t){return"function"==typeof t};function FH(t,e){e(t),t.children&&t.children.forEach((function(t){t&&FH(t,e)}))}function zH(t){jH(t,!0)}function BH(t){jH(t,!1)}function jH(t,e){var n=e?"visible":"hidden";FH(t,(function(t){t.attr("visibility",n)}))}var UH=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=(0,aM.__read)(i,2),a=o[0],s=o[1],u=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?UD(s)?(UD(t[a])||(u[a]={}),n<r?UH(t[a],s,n+1,r):u[a]=e[a]):GA(s)?(u[a]=[],u[a]=u[a].concat(s)):u[a]=s:u[a]=s)}))},ZH=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)UH(t,e[r]);return t},VH=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,(0,aM.__spreadArray)([],(0,aM.__read)(e),!1))||this;return r.addEventListener(xL.INSERTED,(function(){BH(r)})),r}return(0,aM.__extends)(e,t),e}(rI);function GH(t){var e=t.appendChild(new VH({class:"offscreen"}));return BH(e),e}function HH(){jH(this,"hidden"!==this.attributes.visibility)}var WH=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,ZH({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=GH(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&HH.call(this)},e.prototype.update=function(t,e){var n;return void 0===t&&(t={}),this.attr(ZH({},this.attributes,t)),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e}(eI);function qH(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}var YH=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,aM.__rest)(e,["style"]);return t.call(this,(0,aM.__assign)({style:(0,aM.__assign)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=GH(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(hI),XH=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n;return t.prototype.selectAll=function(e){return new t("string"==typeof e?this._parent.querySelectorAll(e):e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(e){var n="string"==typeof e?this._parent.querySelectorAll(e):e;return new t(this._elements,null,this._parent,this._document,void 0,void 0,n)},t.prototype.select=function(e){var n="string"==typeof e?this._parent.querySelectorAll(e)[0]||null:e;return new t([n],null,n,this._document)},t.prototype.append=function(e){var n=this,r="function"==typeof e?e:function(){return n.createElement(e)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=(0,aM.__read)(Array.isArray(a)?a:[a,null],2),u=s[0],l=s[1];(h=r(u,o)).__data__=u,null!==l&&(h.__fromElements__=l),this._parent.appendChild(h),i.push(h)}return new t(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var c=this._elements[o],h=r(u=c.__data__,o);c.appendChild(h),i.push(h)}return new t(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,r){var i=(0,aM.__classPrivateFieldGet)(this,e,"m",n).call(this,"#"===t[0]?t:"#".concat(t),r);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,r){var i=t.toString(),o=(0,aM.__classPrivateFieldGet)(this,e,"m",n).call(this,"."===i[0]?i:".".concat(i),r);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,r){var i=(0,aM.__classPrivateFieldGet)(this,e,"m",n).call(this,'[name="'.concat(t,'"]'),r);return i.attr("name",t),i},t.prototype.data=function(e,n,r){var i,o;void 0===n&&(n=function(t){return t}),void 0===r&&(r=function(){return null});for(var a=[],s=[],u=new Set(this._elements),l=[],c=new Set,h=new Map(this._elements.map((function(t,e){return[n(t.__data__,e),t]}))),p=new Map(this._facetElements.map((function(t,e){return[n(t.__data__,e),t]}))),f=FN(this._elements,(function(t){return r(t.__data__)})),d=0;d<e.length;d++){var m=e[d],g=n(m,d),y=r(m,d);if(h.has(g))(x=h.get(g)).__data__=m,x.__facet__=!1,s.push(x),u.delete(x),h.delete(g);else if(p.has(g))(x=p.get(g)).__data__=m,x.__facet__=!0,s.push(x),p.delete(g);else if(f.has(g)){var v=f.get(g);l.push([m,v]);try{for(var _=(i=void 0,(0,aM.__values)(v)),b=_.next();!b.done;b=_.next()){var x=b.value;u.delete(x)}}catch(t){i={error:t}}finally{try{b&&!b.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}f.delete(g)}else h.has(y)?((x=h.get(y)).__toData__?x.__toData__.push(m):x.__toData__=[m],c.add(x),u.delete(x)):a.push(m)}var w=[new t([],a,this._parent,this._document),new t(s,null,this._parent,this._document),new t(u,null,this._parent,this._document),new t([],l,this._parent,this._document),new t(c,null,this._parent,this._document)];return new t(this._elements,null,this._parent,this._document,w)},t.prototype.merge=function(e){var n=(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(this._elements),!1),(0,aM.__read)(e._elements),!1),r=(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(this._transitions),!1),(0,aM.__read)(e._transitions),!1);return new t(n,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(e){if(this._document)return this._document.createElement(e,{});var n=t.registry[e];return n?new n:function(t){throw new Error(t)}("Unknown node type: ".concat(e))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var o=t(this._enter),a=e(this._update),s=n(this._exit),u=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(u).merge(l)},t.prototype.remove=function(){for(var e=function(t){var e=n._elements[t],r=n._transitions[t];r?r.then((function(){return e.remove()})):e.remove()},n=this,r=0;r<this._elements.length;r++)e(r);return new t([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var o=(0,aM.__read)(t,2),a=o[0],s=o[1],u="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,u.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,(0,aM.__spreadArray)([this._parent,this],(0,aM.__read)(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},e=new WeakSet,n=function(e,n){var r=this._elements[0],i=r.querySelector(e);if(i)return new t([i],null,this._parent,this._document);var o="string"==typeof n?this.createElement(n):n();return r.appendChild(o),new t([o],null,this._parent,this._document)},t.registry={g:rI,rect:cI,circle:tI,path:sI,text:YH,ellipse:nI,image:oI,line:aI,polygon:uI,polyline:lI,html:iI},t}();function $H(t){return new XH([t],null,t,t.ownerDocument)}function KH(t,e,n){return t.querySelector(e)?$H(t).select(e):$H(t).append(n)}var JH=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},QH=JH,tW=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},eW=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},nW=eW,rW=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};var iW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,aM.__extends)(e,t),e.prototype.render=function(t,n){var r=t.symbol,i=t.size,o=void 0===i?16:i,a=(0,aM.__rest)(t,["symbol","size"]),s=function(t){var e=function(t){var e="default";if(sC(t)&&t instanceof Image)e="image";else if(NH(t))e="symbol";else if(gA(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}(r);qH(!!s,$H(n),(function(t){t.maybeAppendByClassName("marker",s).attr("className","marker ".concat(s,"-marker")).call((function(t){if("image"===s){var n=2*o;t.styles({img:r,width:n,height:n,x:-o,y:-o})}else{n=o/2;var i=NH(r)?r:e.getSymbol(r);t.styles((0,aM.__assign)({path:null==i?void 0:i(0,0,n)},a))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e}(WH);iW.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),iW.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),iW.registerSymbol("line",tW),iW.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),iW.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),iW.registerSymbol("circle",JH),iW.registerSymbol("point",QH),iW.registerSymbol("bowtie",(function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]})),iW.registerSymbol("hexagon",(function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]})),iW.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),iW.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),iW.registerSymbol("triangle",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]})),iW.registerSymbol("triangle-down",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]})),iW.registerSymbol("line",tW),iW.registerSymbol("dot",eW),iW.registerSymbol("dash",nW),iW.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),iW.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),iW.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),iW.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),iW.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));var oW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const aW=yG((t=>{const e=t.attributes,{class:n,transform:r,rotate:i,labelTransform:o,labelTransformOrigin:a,x:s,y:u,x0:l=s,y0:c=u,background:h,connector:p,startMarker:f,endMarker:d,coordCenter:m}=e,g=oW(e,["class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]),y=UF(g,"background"),{padding:v}=y,_=oW(y,["padding"]),b=UF(g,"connector"),{points:x=[]}=b,w=oW(b,["points"]),S=[[+l,+c],[+s,+u]],E=$Z(t).maybeAppend("text","text").style("zIndex",0).call(UZ,Object.assign({textBaseline:"middle",transform:o,transformOrigin:a},g)).node(),M=$Z(t).maybeAppend("background","rect").style("zIndex",-1).call(UZ,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:u,halfExtents:l}=t.getLocalBounds(),[c,h]=u,[p,f]=l;return a.setEulerAngles(s),{x:c-o,y:h-n,width:2*p+o+r,height:2*f+n+i}}(E,v)).call(UZ,h?_:{}).node(),T=function(t,e,n,r){const[[i,o],[a,s]]=e,[u,l]=function(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}(t);if(i===a&&o===s)return iG()([[0,0],[u,l]]);const c=[[i-a,o-s]].concat(n.length?n:[0,0]),h=[r[0]-a,r[1]-s],[p,f]=c;if(((t,e,n)=>{const r=DZ(t,e),i=DZ(e,n),o=DZ(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(h,p,f)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=p[0]+(p[1]-h[1])*(p[1]-0)/(p[0]-h[0]);return n[0]<h[0]?Math.min(n[0],r):Math.max(e[0],r)})();c.splice(1,1,[e,0])}return iG()(c)}(M,S,x,m),A=f&&new iW({id:"startMarker",style:Object.assign({x:0,y:0},UF(g,"startMarker"))}),C=d&&new iW({id:"endMarker",style:Object.assign({x:0,y:0},UF(g,"endMarker"))});$Z(t).maybeAppend("connector","path").style("zIndex",0).style("path",T).style("markerStart",A).style("markerEnd",C).call(UZ,p?w:{})}));var sW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const uW=t=>{const e=sW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s}=n,u=sW(WZ(i,o,a,s),[]),{color:l,text:c="",fontSize:h,rotate:p=0,transform:f=""}=n,d={text:String(c),stroke:l,fill:l,fontSize:h},[[m,g]]=t;return $Z(new aW).style("x",m).style("y",g).call(UZ,u).style("transform",`${f}rotate(${+p})`).style("coordCenter",r.getCenter()).call(UZ,d).call(UZ,e).node()}};uW.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var lW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const cW=yG((t=>{const e=t.attributes,{class:n,x:r,y:i}=e,o=lW(e,["class","x","y"]),a=UF(o,"marker"),{size:s=24}=a,u=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,u]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,u],["L",o,a],["Z"]]}(s/2),l=$Z(t).maybeAppend("marker",(()=>new iW({}))).call((t=>t.node().update(Object.assign({symbol:u},a)))).node(),[c,h]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(l);$Z(t).maybeAppend("text","text").style("x",c).style("y",h).call(UZ,o)})),hW=t=>{const e=lW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s}=n,u=WZ(i,o,a,s),{defaultColor:l}=u,c=lW(u,["defaultColor"]),{color:h,text:p=""}=n,f={text:String(p),stroke:h||l,fill:h||l},[[d,m]]=t;return $Z(new cW).call(UZ,c).style("x",d).style("y",m).call(UZ,f).call(UZ,e).node()}};function pW(t,e,n){var r=null,i=bV(!0),o=null,a=eG,s=null,u=jV(l);function l(l){var c,h,p,f,d,m=(l=QV(l)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(s=a(d=u())),c=0;c<=m;++c){if(!(c<m&&i(f=l[c],c,l))===g)if(g=!g)h=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=c-1;p>=h;--p)s.point(y[p],v[p]);s.lineEnd(),s.areaEnd()}g&&(y[c]=+t(f,c,l),v[c]=+e(f,c,l),s.point(r?+r(f,c,l):y[c],n?+n(f,c,l):v[c]))}if(d)return s=null,d+""||null}function c(){return iG().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?nG:bV(+t),e="function"==typeof e?e:bV(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?rG:bV(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:bV(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:bV(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:bV(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:bV(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:bV(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:bV(+t),l):n},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(n)},l.lineX1=function(){return c().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:bV(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}hW.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var fW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const dW=yG((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;$Z(t).maybeAppend("connect-path",(()=>new sI({}))).style("d",n).call(UZ,i),$Z(t).maybeAppend("area-path",(()=>new sI({}))).style("d",e).call(UZ,r)})),mW=t=>{const{curve:e,gradient:n=!1,defined:r=(t=>!Number.isNaN(t)&&null!=t),connect:i=!1}=t,o=fW(t,["curve","gradient","defined","connect"]);return(t,a,s,u)=>{const{mark:l,shape:c,defaultShape:h}=a,p=WZ(u,l,c,h),{defaultColor:f}=p,d=fW(p,["defaultColor"]),{color:m=f,seriesColor:g,seriesX:y,seriesY:v}=a,_=YZ(s,a),b=n&&g?VZ(g,y,v,n):m,x=Object.assign(Object.assign(Object.assign(Object.assign({},d),{stroke:b,fill:b}),_&&{transform:_}),o),[w,S]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let u=0;u<s;u++){const l=t[u],c=t[u+s];if([...l,...c].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(c),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,c])}a=[l,c]}}return[n.concat(r),i]}(t,r),E=UF(x,"connect"),M=!!S.length,T=t=>$Z(new sI({})).style("d",t).call(UZ,x).node();if(ZN(s)){const n=t=>{const n=s.getCenter(),i=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=pW().curve(fG),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=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 gG(n())},delete t.lineX0,t.lineEndAngle=function(){return gG(r())},delete t.lineX1,t.lineInnerRadius=function(){return gG(i())},delete t.lineY0,t.lineOuterRadius=function(){return gG(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(mG(t)):e()._curve},t}().angle(((t,e)=>FZ(RZ(i[e],n)))).outerRadius(((t,e)=>DZ(i[e],n))).innerRadius(((t,e)=>DZ(o[e],n))).defined(((t,e)=>[...i[e],...o[e]].every(r))).curve(e)(o)};return!M||i&&!Object.keys(E).length?T(n(w)):M&&!i?T(n(t)):$Z(new dW).style("areaStyle",x).style("connectStyle",Object.assign(Object.assign({},E),o)).style("areaPath",n(t)).style("connectPath",S.map(n).join("")).node()}{const n=t=>{const n=t.slice(0,t.length/2),i=t.slice(t.length/2);return UN(s)?pW().y(((t,e)=>n[e][1])).x1(((t,e)=>n[e][0])).x0(((t,e)=>i[e][0])).defined(((t,e)=>[...n[e],...i[e]].every(r))).curve(e)(n):pW().x(((t,e)=>n[e][0])).y1(((t,e)=>n[e][1])).y0(((t,e)=>i[e][1])).defined(((t,e)=>[...n[e],...i[e]].every(r))).curve(e)(n)};return!M||i&&!Object.keys(E).length?T(n(w)):M&&!i?T(n(t)):$Z(new dW).style("areaStyle",x).style("connectStyle",Object.assign(Object.assign({},E),o)).style("areaPath",n(t)).style("connectPath",S.map(n).join("")).node()}}};mW.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gW=t=>(e,n,r,i)=>{const o=ZN(r)?sG:eG;return mW(Object.assign({curve:o},t))(e,n,r,i)};gW.props=Object.assign(Object.assign({},mW.props),{defaultMarker:"square"});const yW=t=>{const{alpha:e=.5}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["alpha"]);return(t,r,i,o)=>{const a=ZN(i)?OG:AG;return mW(Object.assign({curve:a.alpha(e)},n))(t,r,i,o)}};yW.props=Object.assign(Object.assign({},mW.props),{defaultMarker:"smooth"});const vW=t=>(e,n,r,i)=>mW(Object.assign({curve:LG},t))(e,n,r,i);vW.props=Object.assign(Object.assign({},mW.props),{defaultMarker:"hvh"});const _W=t=>(e,n,r,i)=>mW(Object.assign({curve:IG},t))(e,n,r,i);_W.props=Object.assign(Object.assign({},mW.props),{defaultMarker:"vh"});const bW=t=>(e,n,r,i)=>mW(Object.assign({curve:RG},t))(e,n,r,i);bW.props=Object.assign(Object.assign({},mW.props),{defaultMarker:"hv"});const xW=t=>{const{arrow:e=!1}=t;return(n,r,i,o)=>DH(Object.assign(Object.assign({},t),{arrow:e}))(n,r,i,o)};xW.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var wW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const SW=t=>{const e=wW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s}=n,u=WZ(i,o,a,s),{defaultColor:l}=u,c=wW(u,["defaultColor"]),{color:h=l,transform:p}=n,[f,d]=t,m=BV();return m.moveTo(f[0],f[1]),m.bezierCurveTo(f[0]/2+d[0]/2,f[1],f[0]/2+d[0]/2,d[1],d[0],d[1]),$Z(new sI).call(UZ,c).style("d",m.toString()).style("stroke",h).style("transform",p).call(UZ,e).node()}};SW.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var EW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const MW=t=>{const{cornerRatio:e=1/3}=t,n=EW(t,["cornerRatio"]);return(t,r,i,o)=>{const{mark:a,shape:s,defaultShape:u}=r,l=WZ(o,a,s,u),{defaultColor:c}=l,h=EW(l,["defaultColor"]),{color:p=c,transform:f}=r,[d,m]=t,g=function(t,e,n,r){const i=BV();if(ZN(n)){const o=n.getCenter(),a=DZ(t,o),s=(DZ(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),ZZ(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return UN(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}(d,m,i,e);return $Z(new sI).call(UZ,h).style("d",g.toString()).style("stroke",p).style("transform",f).call(UZ,n).node()}};MW.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var TW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const AW=t=>{const e=TW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s}=n,u=WZ(i,o,a,s),{defaultColor:l}=u,c=TW(u,["defaultColor"]),{color:h=l,transform:p}=n,[f,d]=t,m=BV();if(m.moveTo(f[0],f[1]),ZN(r)){const t=r.getCenter();m.quadraticCurveTo(t[0],t[1],d[0],d[1])}else ZZ(m,f,d,jZ(f,d),DZ(f,d)/2);return $Z(new sI).call(UZ,c).style("d",m.toString()).style("stroke",h).style("transform",p).call(UZ,e).node()}};AW.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var CW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const OW=t=>{const e=CW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s}=n,u=WZ(i,o,a,s),{defaultColor:l}=u,c=CW(u,["defaultColor"]),{color:h=l,src:p="",size:f=32,transform:d=""}=n;let{width:m=f,height:g=f}=e;const[[y,v]]=t,[_,b]=r.getSize();m="string"==typeof m?CN(m)*_:m,g="string"==typeof g?CN(g)*b:g;const x=y-Number(m)/2,w=v-Number(g)/2;return $Z(new oI).call(UZ,c).style("x",x).style("y",w).style("img",p).style("stroke",h).style("transform",d).call(UZ,e).style("width",m).style("height",g).node()}};OW.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var PW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const kW=t=>{const e=PW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s,color:u,transform:l}=n,c=WZ(i,o,a,s),{defaultColor:h}=c,p=PW(c,["defaultColor"]),f=function(t,e){const n=BV();if(ZN(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>DZ(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],u=o[i-1];void 0!==u&&Math.abs(a-u)<1e-10?ZZ(n,s,e,r,a):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}(t,r);return $Z(new sI).call(UZ,p).style("d",f.toString()).style("stroke",u||h).style("fill",u||h).style("transform",l).call(UZ,e).node()}};kW.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var LW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const IW=t=>{const e=LW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s,color:u,transform:l}=n,c=WZ(i,o,a,s),{defaultColor:h}=c,p=LW(c,["defaultColor"]),f=function(t,e){const[n,r,i,o]=t,a=BV();if(ZN(e)){const t=e.getCenter(),s=DZ(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),ZZ(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),ZZ(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}(t,r);return $Z(new sI).call(UZ,p).style("d",f.toString()).style("fill",u||h).style("stroke",u||h).style("transform",l).call(UZ,e).node()}};IW.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var RW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const DW=t=>{const e=RW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s,color:u,transform:l}=n,c=WZ(i,o,a,s),{defaultColor:h,fill:p=h,stroke:f=h}=c,d=RW(c,["defaultColor","fill","stroke"]),m=function(t,e){const n=BV();if(ZN(e)){const r=e.getCenter(),[i,o]=r,a=NZ(RZ(t[0],r)),s=NZ(RZ(t[1],r)),u=DZ(r,t[2]),l=DZ(r,t[3]),c=DZ(r,t[8]),h=DZ(r,t[10]),p=DZ(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,h,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,p,a,s),n.arc(i,o,p,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}(t,r);return $Z(new sI).call(UZ,d).style("d",m.toString()).style("stroke",f).style("fill",u||p).style("transform",l).call(UZ,e).node()}};DW.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var NW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const FW=t=>{const e=NW(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s,color:u,transform:l}=n,c=WZ(i,o,a,s),{defaultColor:h,fill:p=h,stroke:f=h}=c,d=NW(c,["defaultColor","fill","stroke"]),m=function(t,e,n=4){const r=BV();if(!ZN(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=DZ(i,t[3]),u=DZ(i,t[8]),l=DZ(i,t[10]),c=NZ(RZ(t[2],i)),h=Math.asin(n/u),p=c-h,f=c+h;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(p)*s+o,Math.sin(p)*s+a),r.arc(o,a,s,p,f),r.lineTo(Math.cos(f)*l+o,Math.sin(f)*l+a),r.arc(o,a,l,f,p,!0),r.lineTo(Math.cos(p)*s+o,Math.sin(p)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const d=(p+f)/2;return r.moveTo(Math.cos(d)*(u+n/2)+o,Math.sin(d)*(u+n/2)+a),r.arc(Math.cos(d)*u+o,Math.sin(d)*u+a,n/2,d,2*Math.PI+d),r.closePath(),r}(t,r,4);return $Z(new sI).call(UZ,d).style("d",m.toString()).style("stroke",f).style("fill",u||p).style("transform",l).call(UZ,e).node()}};FW.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var zW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const BW=t=>{const{arrow:e,arrowSize:n=4}=t,r=zW(t,["arrow","arrowSize"]);return(t,i,o,a)=>{const{mark:s,shape:u,defaultShape:l}=i,c=WZ(a,s,u,l),{defaultColor:h,lineWidth:p}=c,f=zW(c,["defaultColor","lineWidth"]),{color:d=h,size:m=p}=i,g=e?function(t,e){return new sI({style:Object.assign({path:`M ${t},${t} L -${t},0 L ${t},-${t} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},e)})}(n,Object.assign({fill:r.stroke||d,stroke:r.stroke||d},UF(r,"arrow"))):null,y=function(t,e){if(!ZN(e))return iG().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return qV()({startAngle:0,endAngle:2*Math.PI,outerRadius:DZ(t[0],n),innerRadius:DZ(t[1],n)})}(t,o),v=function(t,e){if(!ZN(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,i.transform);return $Z(new sI({})).call(UZ,f).style("d",y).style("stroke",d).style("lineWidth",m).style("transform",v).style("markerEnd",g).call(UZ,r).node()}};BW.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var jW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function UW(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}const ZW=yG((t=>{const e=t.attributes,{points:n,class:r,endMarker:i=!0,direction:o}=e,a=jW(e,["points","class","endMarker","direction"]),s=UF(a,"endMarker"),u=function(t){return iG().x((t=>t[0])).y((t=>t[1]))(t)}(n);$Z(t).maybeAppend("connector","path").style("path",u).style("markerEnd",i?new iW({className:"marker",style:Object.assign(Object.assign({},s),{symbol:UW})}):null).call(UZ,a)})),VW=t=>{const{offset:e=0,connectLength1:n}=t,r=jW(t,["offset","connectLength1"]);return(t,i,o,a)=>{const{mark:s,shape:u,defaultShape:l}=i,c=WZ(a,s,u,l),{defaultColor:h,connectLength1:p=n}=c,f=jW(c,["defaultColor","connectLength1"]),{color:d,transform:m}=i,g=function(t,e,n,r=0){const[[i,o],[a,s]]=e;if(UN(t)){const t=i+n,e=t+r;return[[t,o],[e,o],[e,s],[a+n,s]]}const u=-n,l=o+u,c=l+-r;return[[i,l],[i,c],[a,c],[a,s+u]]}(o,t,e,p);return $Z(new ZW).call(UZ,f).style("points",g).style("stroke",d||h).style("transform",m).call(UZ,r).node()}};function GW(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function HW(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=kz(o,((t,e)=>Math.abs(t[1]-a[e][1])));s=Math.max(Math.min(s,i-2),1);const u=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=u(s),c=u(s-1),h=NZ(RZ(u(s+1),c))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${h})`,textAlign:"center",textBaseline:"middle"}}function WW(t,e,n,r){const{bounds:i}=n,[[o,a],[s,u]]=i,l=s-o,c=u-a;return(t=>{const{x:e,y:r}=t,i=GF(n.x,l),s=GF(n.y,c);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})})("left"===t?{x:0,y:c/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:l,y:c/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:c,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:c,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:c,textAnchor:"end",textBaseline:"bottom"}:{x:l/2,y:c/2,textAnchor:"center",textBaseline:"middle"})}function qW(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,u=r.getCenter(),l=HZ(r,e,[i,o]),{innerRadius:c,outerRadius:h,startAngle:p,endAngle:f}=l,d="inside"===t?(p+f)/2:f,m=XW(d,a,s),g=(()=>{const[n,r]=e,i=c+.5*(h-c),[o,a]="inside"===t?YW(u,d,i):jZ(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},g),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:m})}function YW(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function XW(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function $W(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:u=.5,offset:l=0}=n,c=HZ(r,e,[i,o]),{startAngle:h,endAngle:p}=c,f=r.getCenter(),d=(h+p)/2,m={textAlign:"center",textBaseline:"middle",rotate:XW(d,a,s)},{innerRadius:g,outerRadius:y}=c,v=g+(y-g)*u+l,[_,b]=YW(f,d,v);return Object.assign({x:_,y:b},m)}function KW(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:o[0],y:o[1]}}function JW(t,e,n,r){const{bounds:i}=n;return 1===i.length?KW(0,0,n):(VN(r)?qW:qN(r)?$W:WW)(t,e,n,r)}function QW(t,e,n){const r=HZ(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function tq(t,e,n){const r=HZ(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function eq(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:u=a,connectorLength2:l=0,connectorDistance:c=0}=n,h=r.getCenter(),p=tq(e,n,r),f=Math.sin(p)>0?1:-1,d=XW(p,i,o),m={textAlign:f>0||VN(r)?"start":"end",textBaseline:"middle",rotate:d},g=QW(e,n,r),y=g+(s?u:a),[[v,_],[b,x],[w,S]]=function(t,e,n,r,i){const[o,a]=YW(t,e,n),[s,u]=YW(t,e,r);return[[o,a],[s,u],[s+(Math.sin(e)>0?1:-1)*i,u]]}(h,p,g,y,s?l:0),E=s?+c*f:0,M=w+E,T={connector:s,connectorPoints:[[b-M,x-S],[w-M,S-S]]};return Object.assign(Object.assign({x0:v,y0:_,x:w+E,y:S},m),T)}function nq(t,e,n,r){const{bounds:i}=n;return 1===i.length?KW(0,0,n):(VN(r)?qW:qN(r)?eq:WW)(t,e,n,r)}VW.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var rq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function iq(t,e,n,r){if(!qN(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=rq(eq(0,e,n,r),[]),u=r.getCenter(),l=QW(e,n,r),c=tq(e,n,r),h=l+i+o,p=Math.sin(c)>0?1:-1,f=u[0]+(h+ +a)*p,{x:d}=s,m=f-d;return s.x+=m,s.connectorPoints[0][0]-=m,s}var oq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function aq(t,e,n,r){if(!qN(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=oq(eq(0,e,n,r),[]),{x0:u,y0:l}=s,c=r.getCenter(),h=function(t){if(qN(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),p=h+i,f=FZ([u-c[0],l-c[1]]),d=Math.sin(f)>0?1:-1,[m,g]=YW(c,f,p);return s.x=m+(o+a)*d,s.y=g,s}var sq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const uq=t=>(n,r,i,o)=>{const{text:a,x:s,y:u,transform:l="",transformOrigin:c}=r,h=sq(r,["text","x","y","transform","transformOrigin"]),p=function(t,n,r,i,o){const{position:a}=n,s=function(t,e){return void 0!==t?t:qN(e)?"inside":UN(e)?"right":"top"}(a,r),u=i["inside"===s?"innerLabel":"label"],l=Object.assign({},u,n),c=e[GW(s)];if(!c)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},u),c(s,t,l,r,o))}(n,r,i,o,t),{rotate:f=0,transform:d=""}=p,m=sq(p,["rotate","transform"]);return $Z(new aW).call(UZ,m).style("text",`${a}`).style("labelTransform",`${d} rotate(${+f}) ${l}`.trim()).style("labelTransformOrigin",c).style("coordCenter",i.getCenter()).call(UZ,h).node()};uq.props={defaultMarker:"point"};var lq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const cq=t=>{const{arrow:e,colorAttribute:n}=t,r=lq(t,["arrow","colorAttribute"]);return(t,e,i,o)=>{const{mark:a,shape:s,defaultShape:u}=e,l=WZ(o,a,s,u),{stroke:c}=l,h=lq(l,["stroke"]),{d:p,color:f}=e;return $Z(new sI).call(UZ,h).style("d",p).style(n,f).call(UZ,r).node()}};cq.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hq=t=>cq(Object.assign({colorAttribute:"fill"},t));hq.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pq=t=>cq(Object.assign({fill:"none",colorAttribute:"stroke"},t));pq.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var fq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const dq=t=>{const e=fq(t,[]);return(t,n,r,i)=>{const{mark:o,shape:a,defaultShape:s,transform:u}=n,l=WZ(i,o,a,s),{defaultColor:c}=l,h=fq(l,["defaultColor"]),{color:p=c}=n,[f,...d]=t,m=BV();return m.moveTo(...f),d.forEach((([t,e])=>{m.lineTo(t,e)})),m.closePath(),$Z(new sI).call(UZ,h).style("d",m.toString()).style("stroke",p||c).style("fill",p||c).style("fillOpacity",.4).style("transform",u).call(UZ,e).node()}};function mq(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function gq(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}dq.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},mq(3);const yq=function(t,e=((...t)=>`${t[0]}`),n=16){const r=mq(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=gq(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));var vq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const _q=t=>{const{gradient:e,opacity:n,maxOpacity:r,minOpacity:i,blur:o,useGradientOpacity:a}=t,s=vq(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]);return(t,u,l,c,h,p)=>{const{mark:f,shape:d,defaultShape:m,transform:g}=u,y=vq(WZ(c,f,d,m),[]),{createCanvas:v}=p,[_,b]=l.getSize(),x=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),w=sp(t,(t=>t[2])),S=up(t,(t=>t[2])),E=_&&b?function(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const u=gq(a,t,e).getContext("2d"),l=function(t,e){const n=gq(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);u.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:u,value:l,radius:c}=r[s],h=Math.min(l,n),p=i-c,f=u-c,d=yq(c,1-a,o),m=(h-e)/(n-e);t.globalAlpha=Math.max(m,.001),t.drawImage(d,p,f)}}(u,n,r,i,s,a);const c=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:u}=i,l=e,c=n,h=t.getImageData(0,0,l,c),p=h.data,f=p.length;for(let t=3;t<f;t+=4){const e=p[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));p[t-3]=r[n],p[t-2]=r[n+1],p[t-1]=r[n+2],p[t]=u?r[n+3]:i}return h}(u,t,e,l,s),h=gq(a,t,e).getContext("2d");return h.putImageData(c,0,0),h}(_,b,w,S,x,(M={gradient:e,opacity:n,minOpacity:i,maxOpacity:r,blur:o,useGradientOpacity:a},T=t=>void 0===t,Object.assign({},M),Object.keys(M).reduce(((t,e)=>{const n=M[e];return T(n)||(t[e]=n),t}),{})),v):{canvas:null};var M,T;return $Z(new oI).call(UZ,y).style("x",0).style("y",0).style("width",_).style("height",b).style("src",E.canvas).style("transform",g).call(UZ,s).node()}};_q.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bq=t=>{const{render:e}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["render"]);return(t,r,i,o)=>{const[[a,s]]=t;return e(Object.assign(Object.assign({},n),{x:a,y:s}))}};bq.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xq="#000",wq="#416180",Sq=t=>{const e="#5B8FF9",n={defaultColor:e,defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:xq,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:xq,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:wq,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:wq,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:wq,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:wq,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:wq,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:wq,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:wq,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:wq,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:wq,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:xq}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:xq,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:xq,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:xq,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:xq,tickStrokeOpacity:.25,titleFill:xq,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,labelAutoRotate:!0,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,labelAutoRotate:!1,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:xq,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:xq,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:xq,navButtonFillOpacity:.65,navPageNumFill:xq,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:xq,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:xq,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:xq,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:xq,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:xq,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal",labelSpacing:8,tick:!0},label:{fill:xq,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:xq,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:"#fff",fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:wq,trackFillOpacity:1,selectionFill:e,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:xq,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:xq,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{titleFill:xq,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:xq,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},n,t)};Sq.props={};const Eq="#fff",Mq="#416180",Tq=t=>{const e="#5B8FF9",n={defaultColor:e,defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:Eq,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:Eq,lineWidth:1}},text:{text:{fill:Eq,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:Mq,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:Mq,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:Mq,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:Mq,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:Mq,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:Mq,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:Mq,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:Mq,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:Mq,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:Eq}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:Eq,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:Eq,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:Eq,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:Eq,tickStrokeOpacity:.25,titleFill:Eq,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:Eq,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:Eq,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:Eq,navButtonFillOpacity:.45,navPageNumFill:Eq,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:Eq,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:Eq,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:Eq,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:Eq,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:Eq,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal"},label:{fill:Eq,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:Eq,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:"#000",fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:Mq,trackFillOpacity:1,selectionFill:e,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:Eq,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:Eq,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:Eq,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:Eq,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},n,t)};Tq.props={};const Aq="#000",Cq="#888",Oq=t=>{const e="#4e79a7",n={defaultColor:e,defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:Aq,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0,connectFill:Aq,connectFillOpacity:.1}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:Cq,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:Cq,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:Cq,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:Cq,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:Cq,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:Cq,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:Cq,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:Cq,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:Cq,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:Aq}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:Aq,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:Cq,tickStrokeOpacity:1,titleFill:Aq,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:4},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:4,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90) translate(0, -50%)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:Aq,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:Aq,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:Aq,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:Aq,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!1,titleFill:Aq,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:Aq,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:Aq,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:Aq,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:Aq,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!1},label:{fill:Aq,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:Aq,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:"#fff",fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:Cq,trackFillOpacity:.05,selectionFill:e,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:Aq,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:Aq,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:Aq,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:Aq,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},n,t)};function Pq(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=(0,aM.__read)(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,(0,aM.__assign)((0,aM.__assign)({},t[e]),n)]:[e,n]})))}function kq(t,e){t?t.finished.then(e):e()}function Lq(t,e){"update"in t?t.update(e):t.attr(e)}function Iq(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Lq(t,{style:e.slice(-1)[0]}),null)}function Rq(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=(0,aM.__read)(e,2),o=n[0],a=n[1];if(!mA(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?Iq(t,[r,i],(0,aM.__assign)({fill:"both"},n)):(Lq(t,i),null)}Oq.props={};var Dq=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=(0,aM.__read)(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]})));return Object.assign(r,{prefix:n}),r},Nq={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new sI({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",tickStrokeOpacity:.65,labelOverlap:[]},Fq=(VD({},Nq,{style:{type:"arc"}}),VD({},Nq,{style:{}}),Dq({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"));function zq(t,e){return[t[0]*e,t[1]*e]}function Bq(t,e){return[t[0]+e[0],t[1]+e[1]]}function jq(t,e){return[t[0]-e[0],t[1]-e[1]]}function Uq(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Zq(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Vq(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Gq(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function Hq(t){return t*Math.PI/180}function Wq(t){return Number((180*t/Math.PI).toPrecision(5))}function qq(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Yq(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}function Xq(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i,o=(0,aM.__read)(t,2),a=o[0],s=o[1];if("className"===a||"class"===a);else if(a.startsWith("show")&&Yq(a,"show").startsWith(e)!==n)a===(i=e,"".concat("show").concat(qq(i)))?r[a]=s:r[a.replace(new RegExp(qq(e)),"")]=s;else if(!a.startsWith("show")&&a.startsWith(e)!==n){var u=Yq(a,e);"filter"===u&&"function"==typeof s||(r[u]=s)}})),r}function $q(t,e){return Object.entries(t).reduce((function(t,n){var r=(0,aM.__read)(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(qq(i))]=o,t}),{})}function Kq(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var o=(0,aM.__read)(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function Jq(t,e){return NH(t)?t.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e),!1)):t}function Qq(t,e){return t.style.opacity||(t.style.opacity=1),Rq(t,{opacity:0},e)}var tY=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function eY(t){return tY.includes(t)}function nY(t){var e={};for(var n in t)eY(n)&&(e[n]=t[n]);return e}var rY=Dq({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function iY(t){return t.reduce((function(t,e,n){return t.push((0,aM.__spreadArray)([0===n?"M":"L"],(0,aM.__read)(e),!1)),t}),[])}function oY(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return iY(t);if(!o)return[];var a=Vq(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push((0,aM.__spreadArray)(["M"],(0,aM.__read)(e),!1)):t.push((0,aM.__spreadArray)(["A",a,a,0,0,s],(0,aM.__read)(e),!1)),t}),[])}(t,e,n):iY(t)}function aY(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=(0,aM.__read)([oY(t,n),oY(e.slice().reverse(),n,!0)],2),u=s[0],l=s[1],c=(0,aM.__read)([t[0],e.slice(-1)[0]],2),h=c[0],p=c[1],f=function(t,e){return[u,t,l,e,a].flat()};if("line"===i||"surround"===r)return f([(0,aM.__spreadArray)(["L"],(0,aM.__read)(p),!1)],[(0,aM.__spreadArray)(["L"],(0,aM.__read)(h),!1)]);if(!o)throw new Error("Arc grid need to specified center");var d=(0,aM.__read)([Vq(p,o),Vq(h,o)],2),m=d[0],g=d[1];return f([(0,aM.__spreadArray)(["A",m,m,0,0,1],(0,aM.__read)(p),!1),(0,aM.__spreadArray)(["L"],(0,aM.__read)(p),!1)],[(0,aM.__spreadArray)(["A",g,g,0,0,0],(0,aM.__read)(h),!1),(0,aM.__spreadArray)(["L"],(0,aM.__read)(h),!1)])}var sY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,aM.__extends)(e,t),e.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n=(0,aM.__rest)(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=(0,aM.__read)(e,1)[0];return(0,aM.__assign)((0,aM.__assign)({},t),{points:(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(e),!1),[n],!1)})})):n}(t),i=$H(e).maybeAppendByClassName(rY.lineGroup,"g"),o=$H(e).maybeAppendByClassName(rY.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),path:oY(t.points,n)}}));return t.selectAll(rY.line.class).data(o,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Jq(nY((0,aM.__assign)({path:t.path},r)),[t,e,o]);this.attr((0,aM.__assign)({class:rY.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},n))}))}),(function(t){return t.transition((function(t,e){return Rq(this,Jq(nY((0,aM.__assign)({path:t.path},r)),[t,e,o]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=Qq(this,i.exit);return kq(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},u=[],l=0;l<e.length-1;l++){var c=(0,aM.__read)([e[l].points,e[l+1].points],2),h=aY(c[0],c[1],n);u.push({path:h,fill:s(l)})}return t.selectAll(rY.region.class).data(u,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Jq(t,[t,e,u]);this.attr(n)})).attr("className",rY.region.name)}),(function(t){return t.transition((function(t,e){return Rq(this,Jq(t,[t,e,u]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Qq(this,r.exit);return kq(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(a),!1),(0,aM.__read)(s),!1)},e}(WH);const uY=function(t,e){if(!NH(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n},lY=function(t,e,n){for(var r=0,i=gA(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t};var cY=function(t,e){return function(n){return t*(1-n)+e*n}};function hY(t,e){return"number"==typeof t&&"number"==typeof e?cY(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=hY(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=(0,aM.__read)(e,2),o=i[0],a=i[1];o in t?n[o]=hY(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=(0,aM.__read)(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function pY(t){return"function"==typeof t?t():gA(t)||fA(t)?new YH({style:{text:String(t)}}):t}function fY(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&t.scale(a),a}function dY(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function mY(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=(0,aM.__read)(t,2);return[n[0],Jq(n[1],e)]})))}function gY(t,e){return e&&NH(e)?t.filter(e):t}var yY=uY((function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}),(function(t,e){return[t,e.startAngle,e.endAngle].join()})),vY=uY((function(t,e){if("linear"===e.type){var n=(0,aM.__read)(e.startPos,2),r=n[0],i=n[1],o=(0,aM.__read)(e.endPos,2),a=o[0],s=o[1],u=(0,aM.__read)([a-r,s-i],2);return Gq([u[0],u[1]])}var l=Hq(yY(t,e));return[-Math.sin(l),Math.cos(l)]}),(function(t,e){var n=function(t){if("linear"===t.type){var e=t.startPos,n=t.endPos;return(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(e),!1),(0,aM.__read)(n),!1)}var r=t.startAngle,i=t.endAngle,o=t.center,a=t.radius;return(0,aM.__spreadArray)((0,aM.__spreadArray)([r,i],(0,aM.__read)(o),!1),[a],!1)}(e);return"arc"===e.type&&n.push(t),n.join()}));function _Y(t,e,n){var r;return r=vY(t,n),"positive"!==e?[r[1],-r[0]]:[-r[1],r[0]]}function bY(t,e){return _Y(t,e.labelDirection,e)}var xY,wY=uY((function(t,e){var n=(0,aM.__read)(e.startPos,2),r=n[0],i=n[1],o=(0,aM.__read)(e.endPos,2),a=o[0],s=o[1],u=(0,aM.__read)([a-r,s-i],2);return[r+u[0]*t,i+u[1]*t]}),(function(t,e){return(0,aM.__spreadArray)((0,aM.__spreadArray)([t],(0,aM.__read)(e.startPos),!1),(0,aM.__read)(e.endPos),!1).join()})),SY=uY((function(t,e){var n=e.radius,r=(0,aM.__read)(e.center,2),i=r[0],o=r[1],a=Hq(yY(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}),(function(t,e){var n=e.startAngle,r=e.endAngle,i=e.radius,o=e.center;return(0,aM.__spreadArray)([t,n,r,i],(0,aM.__read)(o),!1).join()}));function EY(t,e){return"linear"===e.type?wY(t,e):SY(t,e)}function MY(t){return 0===vY(0,t)[1]}function TY(t){return 0===vY(0,t)[0]}function AY(t,e){return e-t==360}function CY(t,e,n,r,i){var o=e-t,a=(0,aM.__read)([i,i],2),s=a[0],u=a[1],l=(0,aM.__read)([Hq(t),Hq(e)],2),c=l[0],h=l[1],p=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},f=(0,aM.__read)(p(c),2),d=f[0],m=f[1],g=(0,aM.__read)(p(h),2),y=g[0],v=g[1];if(AY(t,e)){var _=(h+c)/2,b=(0,aM.__read)(p(_),2);return[["M",d,m],["A",s,u,0,1,0,b[0],b[1]],["A",s,u,0,1,0,y,v]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(d,",").concat(m,",A").concat(s,",").concat(u,",0,").concat(x,",").concat(w,",").concat(y,",").concat(v)}function OY(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Fq.line.class).data([{path:CY.apply(void 0,(0,aM.__spreadArray)((0,aM.__spreadArray)([i,o],(0,aM.__read)(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Fq.line.name).styles(e).styles({path:function(t){return t.path}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=hY(e,n),s=Math.ceil(+o/16),u=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}}));return t.animate(u,(0,aM.__assign)({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return(0,aM.__spreadArray)((0,aM.__spreadArray)([n,r],(0,aM.__read)(i),!1),[o],!1)}(this),(0,aM.__spreadArray)((0,aM.__spreadArray)([i,o],(0,aM.__read)(a),!1),[s],!1),r.update);if(e){var n=function(){var e=lY(t.attributes,"__keyframe_data__");t.style.path=CY.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function PY(t){var e=(0,aM.__read)(t,2),n=(0,aM.__read)(e[0],2),r=n[0],i=n[1],o=(0,aM.__read)(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function kY(t,e,n){var r,i=e.type,o=Xq(e,"line");return r="linear"===i?function(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,u=e.lineExtension,l=(0,aM.__read)([o,a],2),c=(0,aM.__read)(l[0],2),h=c[0],p=c[1],f=(0,aM.__read)(l[1],2),d=f[0],m=f[1],g=(0,aM.__read)(u?function(t,e,n){void 0===n&&(n=[0,0]);var r=(0,aM.__read)([t,e,n],3),i=(0,aM.__read)(r[0],2),o=i[0],a=i[1],s=(0,aM.__read)(r[1],2),u=s[0],l=s[1],c=(0,aM.__read)(r[2],2),h=c[0],p=c[1],f=(0,aM.__read)([u-o,l-a],2),d=f[0],m=f[1],g=Math.sqrt(Math.pow(d,2)+Math.pow(m,2)),y=(0,aM.__read)([-h/g,p/g],2),v=y[0],_=y[1];return[v*d,v*m,_*d,_*m]}(o,a,u):new Array(4).fill(0),4),y=g[0],v=g[1],_=g[2],b=g[3],x=function(e){return t.selectAll(Fq.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Fq.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Rq(this,PY(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Rq(this,PY(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return x([{line:[[h+y,p+v],[d+_,m+b]],className:Fq.line.name}]);var w=(0,aM.__read)(s,2),S=w[0],E=w[1],M=d-h,T=m-p,A=(0,aM.__read)([h+M*S,p+T*S],2),C=A[0],O=A[1],P=(0,aM.__read)([h+M*E,p+T*E],2),k=P[0],L=P[1],I=x([{line:[[h+y,p+v],[C,O]],className:Fq.lineFirst.name},{line:[[k,L],[d+_,m+b]],className:Fq.lineSecond.name}]);return function(t,e){e.truncRange,e.truncShape,e.lineExtension}(0,e),I}(t,e,dY(o,"arrow"),n):OY(t,e,dY(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,u=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(Fq.line.class):a?t.select(Fq.lineSecond.class):t.select(Fq.line.class),!o||!s||"arc"===n.type&&AY(n.startAngle,n.endAngle)){var c=i.node();c&&(c.style.markerEnd=void 0)}else{var h=pY(s);h.attr(r),fY(h,l,!0),i.style("markerEnd",h).style("markerEndOffset",-u)}}(t,i,e,o),r}function LY(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function IY(t,e,n,r){var i=Xq(n,"grid"),o=i.type,a=i.areaFill,s=LY(n),u=gY(e,n.gridFilter),l="segment"===o?function(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=(0,aM.__read)(EY(i,e),2),a=o[0],s=o[1],u=(0,aM.__read)(zq(function(t,e){return _Y(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+u[0],s+u[1]]]}}))}(u,n):function(t,e){var n=e.gridControlAngles,r=LY(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=(0,aM.__read)(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=t.value,s=(0,aM.__read)(EY(i,e),2),u=s[0],l=s[1],c=(0,aM.__read)([u-o,l-a],2),h=c[0],p=c[1],f=[];return n.forEach((function(t){var e=Hq(t),n=(0,aM.__read)([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=h*r-p*i+o,u=h*i+p*r+a;f.push([s,u])})),{points:f,id:r}}))}(u,n),c=(0,aM.__assign)((0,aM.__assign)({},i),{center:s,areaFill:NH(a)?u.map((function(t,e){return Jq(a,[t,e,u])})):a,animate:r,data:l});return t.selectAll(Fq.grid.class).data([1]).join((function(t){return t.append((function(){return new sY({style:c})})).attr("className",Fq.grid.name)}),(function(t){return t.transition((function(){return this.update(c)}))}),(function(t){return t.remove()})).transitions()}function RY(t,e,n,r,i){return void 0===r&&(r=!0),!!(r&&t===e||i&&t===n)||t>e&&t<n}var DY=uY((function(t,e){var n=gA(t)?t:t.style.text.toString(),r=e||NY(t),i=r.fontSize,o=r.fontFamily,a=r.fontWeight,s=r.fontStyle,u=r.fontVariant;return xY||(xY=document.createElement("canvas").getContext("2d")),xY.font=[s,u,a,"".concat(i,"px"),o].join(" "),xY.measureText(n).width}),(function(t,e){return[gA(t)?t:t.style.text.toString(),Object.values(e||NY(t)).join()].join("")})),NY=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function FY(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function zY(t,e){var n=FY(t);n&&n.attr(e)}function BY(t,e,n){void 0===n&&(n="..."),zY(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function jY(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=(0,aM.__read)([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}var UY=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)};function ZY(t){if(fA(t))return[t,t,t,t];if(GA(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}var VY=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,u=Math.cos(t),l=Math.sin(t),c=e-e*u+n*l,h=n-e*l-n*u;return[[u*i-l*s+c,l*i+u*s+h],[u*a-l*s+c,l*a+u*s+h],[u*i-l*o+c,l*i+u*o+h],[u*a-l*o+c,l*a+u*o+h]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function GY(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getLocalBounds(),i=(0,aM.__read)(r.min,2),o=i[0],a=i[1],s=(0,aM.__read)(r.max,2),u=s[0],l=s[1],c=HY(t),h=c.width,p=c.height,f=0,d=0,m=o,g=a,y=FY(t);if(y){p-=1.5;var v=y.style.textAlign,_=y.style.textBaseline;"center"===v?m=(o+u)/2:"right"!==v&&"end"!==v||(m=u),"middle"===_?g=(a+l)/2:"bottom"===_&&(g=l)}var b=(0,aM.__read)(ZY(e),4),x=b[0],w=void 0===x?0:x,S=b[1],E=void 0===S?0:S,M=b[2],T=void 0===M?w:M,A=b[3],C=new VY((f+=o)-(void 0===A?E:A),(d+=a)-w,f+h+E,d+p+T);return t.setEulerAngles(n),C.rotatedPoints(Hq(n),m,g)}function HY(t){return t.__bbox__?t.__bbox__:t.getBBox()}function WY(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function qY(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function YY(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return function(t,e){var n=(0,aM.__read)(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=(0,aM.__read)(e,4),u=s[0],l=s[1],c=o-r,h=a-i,p=s[2]-u,f=s[3]-l,d=c*f-p*h;if(0===d)return!1;var m=d>0,g=r-u,y=i-l,v=c*y-h*g;if(v<0===m)return!1;var _=p*y-f*g;return _<0!==m&&v>d!==m&&_>d!==m}(e,t)}))}function XY(t,e,n){var r,i,o,a,s=e.crossPadding,u=new Set,l=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=(0,aM.__read)(o,2),u=s[0],l=s[1],c="negative"===r?0:i,h=-a-c,p=a+c,f=(0,aM.__read)(ZY(e),4),d=f[0],m=f[1],g=f[2],y=f[3];return new VY(u+h-y,l+h-d,u+p+m,l+p+g)}var v=(0,aM.__read)(t.startPos,2),_=v[0],b=v[1],x=(0,aM.__read)(t.endPos,2),w=x[0],S=x[1],E=(0,aM.__read)(TY(t)?[-e,0,e,0]:[0,e,0,-e],4),M=E[0],T=E[1],A=E[2],C=E[3],O=zq(bY(0,t),i),P=new VY(_,b,w,S);return P.x1+=C,P.y1+=M,P.x2+=T+O[0],P.y2+=A+O[1],P}(e,s),h=function(t){return!c||(n=t,i=(e=c).x1,o=e.x2,a=e.y1,s=e.y2,r=[[i,a],[o,a],[o,s],[i,s]],GY(n,void 0).every((function(t){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,u,l=[e,[9999,e[1]]],c=0,h=0;do{var p=[t[h],t[(h+1)%n]];if(o=qY((r=p)[0],r[1],(i=l)[0]),a=qY(r[0],r[1],i[1]),s=qY(i[0],i[1],r[0]),u=qY(i[0],i[1],r[1]),o!==a&&s!==u||0===o&&WY(r,i[0])||0===a&&WY(r,i[1])||0===s&&WY(i,r[0])||0===u&&WY(i,r[1])){if(0===qY(p[0],e,p[1]))return WY(p,e);c++}h=(h+1)%n}while(0!==h);return!!(1&c)}(r,t)})));var e,n,r,i,o,a,s};try{for(var p=(0,aM.__values)(t),f=p.next();!f.done;f=p.next()){var d=f.value;h(d)?l&&(a=d,(o=l)&&function(t,e,n){var r,i,o=GY(t,n).flat(1),a=GY(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var u=(0,aM.__values)(s),l=u.next();!l.done;l=u.next())if(YY(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return!1}(o,a,ZY(n)))?(u.add(l),u.add(d)):l=d:u.add(d)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}return Array.from(u)}function $Y(t,e){return void 0===e&&(e={}),mA(t)?0:"number"==typeof t?t:Math.floor(DY(t,e))}function KY(t){var e=t.getLocalBounds(),n=e.min,r=e.max,i=(0,aM.__read)([n,r],2),o=(0,aM.__read)(i[0],2),a=o[0],s=o[1],u=(0,aM.__read)(i[1],2),l=u[0],c=u[1];return{x:a,y:s,width:l-a,height:c-s,left:a,bottom:c,top:s,right:l}}function JY(t,e){var n=(0,aM.__read)(t,2),r=n[0],i=n[1],o=(0,aM.__read)(e,2),a=o[0],s=o[1];return r!==a&&i===s}var QY=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r&&(BH(t),1))}))},tX=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,u,l,c=QY,h=function(t){return t.forEach(r.show),t},p=2,f=t.slice(),d=t.slice(),m=Math.min.apply(Math,(0,aM.__spreadArray)([1],(0,aM.__read)(t.map((function(t){return HY(t).width}))),!1));if("linear"===n.type&&(MY(n)||TY(n))){var g=KY(t[0]).left,y=KY(t[i-1]).right,v=Math.abs(y-g)||1;p=Math.max(Math.floor(i*m/v),p)}for(o&&(s=f.splice(0,1)[0]),a&&(u=f.splice(-1,1)[0],f.reverse()),h(f);p<t.length&&XY((l=u?(0,aM.__spreadArray)((0,aM.__spreadArray)([u],(0,aM.__read)(d),!1),[s],!1):(0,aM.__spreadArray)([s],(0,aM.__read)(d),!1),l.filter(UY)),n,null==e?void 0:e.margin).length;)(u&&!s&&p%2==0||u&&s)&&f.splice(0,1).forEach(r.hide),d=c(h(f),{seq:p}),p++}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,u=e.margin,l=e.recoverWhenFailed,c=void 0===l||l,h=t.map((function(t){return t.getLocalEulerAngles()})),p=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var f=(0,aM.__values)(s),d=f.next();!d.done;d=f.next())if(p(d.value),XY(t,n,u).length<1)return}catch(t){i={error:t}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}c&&p(h)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,u=void 0===s?1/0:s,l=e.step,c=void 0===l?" ":l,h=e.margin,p=void 0===h?[0,0,0,0]:h,f=NY(r.getTextShape(t[0])),d=$Y(c,f),m=a?$Y(a,f):d,g=$Y(u,f);(mA(g)||g===1/0)&&(g=Math.max.apply(null,t.map((function(t){return HY(t).width}))));for(var y=t.slice(),v=(0,aM.__read)(p,4),_=(v[0],v[1],v[2],v[3],function(e){if(y.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(y=XY(t,n,p)).length<1)return{value:void 0}}),b=g;b>m+d;b-=d){var x=_(b);if("object"==typeof x)return x.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,u=e.recoverWhenFailed,l=void 0===u||u,c=e.margin,h=void 0===c?[0,0,0,0]:c,p=t.map((function(t){return t.attr("maxLines")||1})),f=Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(p),!1)),d=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&MY(t)?"negative"===n?"bottom":"top":"middle"}(n),m=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,d)}))};if(!(f>s)){for(var g=f;g<=s;g++)if(m(g),XY(t,n,h).length<1)return;l&&m(p)}}]]);function eX(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*("positive"===e?-1:1)}),1)}var nX=function(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)},rX=uY((function(t,e){var n=(0,aM.__read)(t,2),r=n[0],i=n[1],o=(0,aM.__read)(e,2),a=o[0],s=o[1],u=(0,aM.__read)([r*a+i*s,r*s-i*a],2),l=u[0],c=u[1];return Math.atan2(c,l)}),(function(t,e){return(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(t),!1),(0,aM.__read)(e),!1).join()}));function iX(t,e,n){var r=n.type,i=n.labelAlign,o=bY(t,n),a=nX(e),s=nX(Wq(rX([1,0],o))),u="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===a?(u="center",l=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(RY(a,0,90,!1,!0)||RY(a,0,90)||RY(a,270,360))&&(u="start"):90===s?RY(a,0,90,!1,!0)?u="start":(RY(a,90,180)||RY(a,270,360))&&(u="end"):270===s?RY(a,0,90,!1,!0)?u="end":(RY(a,90,180)||RY(a,270,360))&&(u="start"):180===s&&(90===a?u="start":(RY(a,0,90)||RY(a,270,360))&&(u="end")):u="center":"parallel"===i?l=RY(s,0,180,!0)?"top":"bottom":"horizontal"===i?RY(s,90,270,!1)?u="end":(RY(s,270,360,!1)||RY(s,0,90))&&(u="start"):"perpendicular"===i&&(u=RY(s,90,270)?"end":"start"),{textAlign:u,textBaseline:l}}function oX(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,u=e.indexOf(t),l=Jq(s,[t,u,e]),c=(0,aM.__read)([bY(t.value,n),eX(a,o)],2),h=c[0],p=1===c[1]?Jq(r?i:0,[t,u,e]):0,f=(0,aM.__read)(Bq(zq(h,l+p),EY(t.value,n)),2);return{x:f[0],y:f[1]}}function aX(t,e){"text"===t.nodeName&&t.attr(e)}function sX(t){!function(t,e,n){var r=e.labelOverlap,i=void 0===r?[]:r;i.length&&i.forEach((function(r){var i=r.type,o=tX.get(i);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,i)&&(null==o||o(t,r,e,n))}))}(this.node().childNodes,t,{hide:BH,show:zH,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=iX(e.__data__.value,t,n),i=e.querySelector(Fq.labelItem.class);i&&aX(i,r)}(+n,e,t)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&BY(t,e,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),zY(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function uX(t,e,n,r,i){var o=n.indexOf(e),a=$H(t).append(function(t,e,n,r){var i=r.labelFormatter;return NH(i)?function(){return pY(Jq(i,[t,e,n,bY(t.value,r)]))}:function(){return pY(t.label||"")}}(e,o,n,i)).attr("className",Fq.labelItem.name).node(),s=(0,aM.__read)(Kq(mY(r,[e,o,n])),2),u=s[0],l=s[1],c=l.transform,h=(0,aM.__rest)(l,["transform"]);jY(t,c);var p=function(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o,a,s=bY(t.value,n),u=vY(t.value,n);return"horizontal"===i?0:(o=Wq("perpendicular"===i?rX([1,0],s):rX([u[0]<0?-1:1,0],u)),RY(a=(o+360)%180,-90,90)||(a+=180),a)}(e,t,i);return t.setLocalEulerAngles(+p),aX(a,(0,aM.__assign)((0,aM.__assign)({},iX(e.value,p,i)),u)),jY(t,c),t.attr(h),a}function lX(t,e){return _Y(t,e.tickDirection,e)}var cX=uY((function(t,e){var n=(0,aM.__read)(t,2);return[[0,0],[n[0]*e,n[1]*e]]}),(function(t,e){return(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(t),!1),[e],!1).join()}));function hX(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=lX(e.value,i),s="line";return NH(o)&&(s=function(){return Jq(o,[e,n,r,a])}),t.append(s).attr("className",Fq.tickItem.name)}($H(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=lX(t.value,o),u=function(t,e,n,r,i){var o=i.tickLength,a=(0,aM.__read)(cX(r,Jq(o,[t,e,n])),2),s=(0,aM.__read)(a[0],2),u=s[0],l=s[1],c=(0,aM.__read)(a[1],2);return{x1:u,x2:c[0],y1:l,y2:c[1]}}(t,e,n,s,o),l=u.x1,c=u.x2,h=u.y1,p=u.y2,f=(0,aM.__read)(Kq(mY(a,[t,e,n,s])),2),d=f[0],m=f[1];"line"===r.node().nodeName&&r.styles((0,aM.__assign)({x1:l,x2:c,y1:h,y2:p},d)),i.attr(m),r.styles(d)}(t,e,n,a,this,r,i);var s=(0,aM.__read)(EY(t.value,r),2);return Rq(this,{x:s[0],y:s[1]},o)}var pX=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t}(),fX=Dq({text:"text"},"title");function dX(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function mX(t,e){var n=Object.entries(e).reduce((function(e,n){var r=(0,aM.__read)(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var gX=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return(0,aM.__extends)(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(fX.text.class);if(!a)return new pX(0,0,+e,+n);var s=a.getBBox(),u=s.width,l=s.height,c=(0,aM.__read)(ZY(i),4),h=c[0],p=c[1],f=c[2],d=c[3],m=(0,aM.__read)([0,0,+e,+n],4),g=m[0],y=m[1],v=m[2],_=m[3],b=dX(r);if(b.includes("i"))return new pX(g,y,v,_);b.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=(0,aM.__read)(0===r?[l+f,+n-l-f]:[0,+n],2),y=i[0],_=i[1]),"r"===t&&(o=(0,aM.__read)([+e-u-d],1),v=o[0]),"b"===t&&(a=(0,aM.__read)([+n-l-h],1),_=a[0]),"l"===t&&(s=(0,aM.__read)(0===r?[u+p,+e-u-p]:[0,+e],2),g=s[0],v=s[1])}));var x=(0,aM.__read)(ZY(o),4),w=x[0],S=x[1],E=x[2],M=x[3],T=(0,aM.__read)([M+S,w+E],2),A=T[0],C=T[1];return new pX(g+M,y+w,v-A,_-C)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new pX(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=(t.width,t.height,t.position,t.spacing,(0,aM.__rest)(t,["width","height","position","spacing"])),i=(0,aM.__read)(Kq(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,u=o.position,l=(0,aM.__read)([+a/2,+s/2],2),c=l[0],h=l[1],p=(0,aM.__read)([+c,+h,"center","middle"],4),f=p[0],d=p[1],m=p[2],g=p[3],y=dX(u);return y.includes("l")&&(f=(e=(0,aM.__read)([0,"start"],2))[0],m=e[1]),y.includes("r")&&(f=(n=(0,aM.__read)([+a,"end"],2))[0],m=n[1]),y.includes("t")&&(d=(r=(0,aM.__read)([0,"top"],2))[0],g=r[1]),y.includes("b")&&(d=(i=(0,aM.__read)([+s,"bottom"],2))[0],g=i[1]),{x:f,y:d,textAlign:m,textBaseline:g}}(t),a=o.x,s=o.y,u=o.textAlign,l=o.textBaseline;qH(!!r.text,$H(e),(function(t){n.title=t.maybeAppendByClassName(fX.text,"text").styles(i).call(mX,{x:a,y:s,textAlign:u,textBaseline:l}).node()}))},e}(WH);function yX(t,e,n,r,i){var o=Xq(r,"title"),a=(0,aM.__read)(Kq(o),2),s=a[0],u=a[1],l=u.transform,c=(0,aM.__rest)(u,["transform"]);t.styles(s),e.styles(c);var h=l||function(t,e,n){var r=t.cloneNode(!0);r.style.transform="scale(1, 1)",r.style.transform="none";var i=r.getBBox().height;if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(i/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(i/2,")")}return""}(t.node(),s.direction,s.position);jY(t.node(),h);var p=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=dX(i),s=t.node().getLocalBounds(),u=(0,aM.__read)(s.min,2),l=u[0],c=u[1],h=(0,aM.__read)(s.halfExtents,2),p=h[0],f=h[1],d=(0,aM.__read)(e.node().getLocalBounds().halfExtents,2),m=d[0],g=d[1],y=(0,aM.__read)([l+p,c+f],2),v=y[0],_=y[1],b=(0,aM.__read)(ZY(o),4),x=b[0],w=b[1],S=b[2],E=b[3];if(["start","end"].includes(i)&&"linear"===n.type){var M=n.startPos,T=n.endPos,A=(0,aM.__read)("start"===i?[M,T]:[T,M],2),C=A[0],O=A[1],P=Gq([-O[0]+C[0],-O[1]+C[1]]),k=(0,aM.__read)(zq(P,x),2),L=k[0],I=k[1];return{x:C[0]+L,y:C[1]+I}}return a.includes("t")&&(_-=f+g+x),a.includes("r")&&(v+=p+m+w),a.includes("l")&&(v-=p+m+E),a.includes("b")&&(_+=f+g+S),{x:v,y:_}}($H(n._offscreen||n.querySelector(Fq.mainGroup.class)),e,r),f=p.x,d=p.y,m=Rq(e.node(),{x:f,y:d},i);return jY(t.node(),h),m}function vX(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=qH(i,e.maybeAppendByClassName(Fq.lineGroup,"g"),(function(e){return kY(e,t,r)}))||[],u=qH(o,e.maybeAppendByClassName(Fq.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=gY(e,n.tickFilter),o=Xq(n,"tick");return t.selectAll(Fq.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Fq.tick.name).transition((function(t,e){return hX.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),hX.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Qq(this.childNodes[0],r.exit);return kq(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=qH(a,e.maybeAppendByClassName(Fq.labelGroup,"g"),(function(e){return function(t,e,n,r){var i=gY(e,n.labelFilter),o=Xq(n,"label");return t.selectAll(Fq.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",Fq.label.name).transition((function(t){return uX(this,t,e,o,n),this.attr(oX(t,e,n)),this.__bbox__=t.bbox,null})).call((function(){return sX.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&BH(t),e.isVisible()&&zH(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,u=void 0===s?0:s,l=Math.ceil(+a/2),c=+a/4,h=function(t){if("circle"===t.nodeName){var e=(0,aM.__read)(t.getLocalPosition(),2),n=e[0],r=e[1],i=t.attr("r");return[n-i,r-i]}return t.getLocalPosition()},p=(0,aM.__read)(h(t),2),f=p[0],d=p[1],m=(0,aM.__read)(h(e),2),g=m[0],y=m[1],v=(0,aM.__read)([(f+g)/2-f,(d+y)/2-d],2),_=v[0],b=v[1],x=t.animate([{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(_,", ").concat(b,")")}],(0,aM.__assign)((0,aM.__assign)({fill:"both"},n),{duration:u+l+c})),w=e.animate([{opacity:0,transform:"translate(".concat(-_,", ").concat(-b,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],(0,aM.__assign)((0,aM.__assign)({fill:"both"},n),{duration:l+c,delay:u+l-c}));return kq(w,i),[x,w]}(this.querySelector(Fq.labelItem.class),uX(this,t,e,o,n),r.update),a=Rq(this,oX(t,e,n),r.update);return this.__bbox__=t.bbox,(0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(i),!1),[a],!1)})).call((function(e){var r,i;i=function(){return sX.call(t,n)},0===(r=lY(e,"_transitions").flat().filter(UY)).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=Qq(this.childNodes[0],r.exit);return kq(e,(function(){return $H(t).remove()})),e}))})).transitions()}(e,n,t,r)}))||[];return(0,aM.__spreadArray)((0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(s),!1),(0,aM.__read)(u),!1),(0,aM.__read)(l),!1).filter((function(t){return!!t}))}var _X=function(t){function e(e){return t.call(this,e,Nq)||this}return(0,aM.__extends)(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,u=t.showGrid,l=t.dataThreshold,c=t.truncRange,h=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(o,l).filter((function(t){var e=t.value;return!(c&&e>c[0]&&e<c[1])})),p=Pq(void 0===n?a:n),f=qH(u,$H(e).maybeAppendByClassName(Fq.gridGroup,"g"),(function(e){return IY(e,h,t,p)}))||[],d=$H(e).maybeAppendByClassName(Fq.mainGroup,"g");i&&(!this.initialized&&p.enter||this.initialized&&p.update)&&vX(t,$H(this.offscreenGroup),h,Pq(!1));var m=vX(t,$H(d.node()),h,p),g=qH(s,$H(e).maybeAppendByClassName(Fq.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Fq.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(o){return o.append((function(){return pY(i)})).attr("className",Fq.title.name).transition((function(){return yX($H(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return yX($H(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,p)}))||[];return(0,aM.__spreadArray)((0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(f),!1),(0,aM.__read)(m),!1),(0,aM.__read)(g),!1).flat().filter((function(t){return!!t}))},e}(WH);function bX(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var xX,wX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function SX(t){if(!(e=wX.exec(t)))throw new Error("invalid format: "+t);var e;return new EX({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 EX(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 MX(t,e){var n=bX(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}SX.prototype=EX.prototype,EX.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};const TX={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>MX(100*t,e),r:MX,s:function(t,e){var n=bX(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(xX=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+bX(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function AX(t){return t}var CX,OX,PX=Array.prototype.map,kX=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function LX(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,u=a.y,l=a.width,c=a.height,h=(0,aM.__read)([s+l,u+c],2),p=h[0],f=h[1];s<e&&(e=s),u<n&&(n=u),p>r&&(r=p),f>i&&(i=f)}return new pX(e,n,r-e,i-n)}CX=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?AX:(e=PX.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?AX:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(PX.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=SX(t)).fill,n=t.align,h=t.sign,p=t.symbol,f=t.zero,d=t.width,m=t.comma,g=t.precision,y=t.trim,v=t.type;"n"===v?(m=!0,v="g"):TX[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var _="$"===p?i:"#"===p&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===p?o:/[%p]/.test(v)?u:"",x=TX[v],w=/[defgprs%]/.test(v);function S(t){var i,o,u,p=_,S=b;if("c"===v)S=x(t)+S,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:x(Math.abs(t),g),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==h&&(E=!1),p=(E?"("===h?h:l:"-"===h||"("===h?"":h)+p,S=("s"===v?kX[8+xX/3]:"")+S+(E&&"("===h?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){S=(46===u?a+t.slice(i+1):t.slice(i))+S,t=t.slice(0,i);break}}m&&!f&&(t=r(t,1/0));var M=p.length+t.length+S.length,T=M<d?new Array(d-M+1).join(e):"";switch(m&&f&&(t=r(T+t,T.length?d-S.length:1/0),T=""),n){case"<":t=p+t+S+T;break;case"=":t=p+T+t+S;break;case"^":t=T.slice(0,M=T.length>>1)+p+t+S+T.slice(M);break;default:t=T+p+t+S}return s(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=h(((t=SX(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=bX(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=kX[8+r/3];return function(t){return n(i*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),OX=CX.format,CX.formatPrefix;var IX=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=(n.flexWrap,n.justifyContent),u=void 0===s?"flex-start":s,l=(n.alignContent,n.alignItems),c=void 0===l?"flex-start":l,h="row"===a,p="row"===a||"column"===a,f=h?p?[1,0]:[-1,0]:p?[0,1]:[0,-1],d=(0,aM.__read)([0,0],2),m=d[0],g=d[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=(0,aM.__read)([m,g],2),o=i[0],a=i[1];return e=(0,aM.__read)([m+n*f[0],g+r*f[1]],2),m=e[0],g=e[1],new pX(o,a,n,r)})),v=LX(y),_={"flex-start":0,"flex-end":h?r-v.width:i-v.height,center:h?(r-v.width)/2:(i-v.height)/2},b=y.map((function(t){var e=t.x,n=t.y,r=pX.fromRect(t);return r.x=h?e+_[u]:e,r.y=h?n:n+_[u],r})),x=(LX(b),function(t){var e=(0,aM.__read)(h?["height",i]:["width",r],2),n=e[0],o=e[1];switch(c){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}}),w=b.map((function(t){var e=t.x,n=t.y,r=pX.fromRect(t);return r.x=h?e:e+x(r),r.y=h?n+x(r):n,r})),S=w.map((function(e){var n,r,i=pX.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return S},RX=function(t,e,n){return[]},DX=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[xL.BOUNDS_CHANGED,xL.INSERTED,xL.REMOVED],n.$margin=ZY(0),n.$padding=ZY(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=ZY(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=ZY(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=(0,aM.__read)(this.$margin,4),u=s[0],l=s[1],c=s[2],h=s[3];return new pX(n-h,i-u,o+h+l,a+u+c)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=(0,aM.__read)(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],u=(0,aM.__read)(this.$margin,4),l=u[0],c=u[3];return new pX(s+c,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=function(t,e,n){if(0===e.length)return[];var r={flex:IX,grid:RX},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(e,n){var r=t[n],i=r.x,o=r.y;e.attr({x:i,y:o})}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target.isMutationObserved=!0,t.layout()}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(rI);const NX=function(t){var e=LF(t);return e.charAt(0).toUpperCase()+e.substring(1)};function FX(t,e,n){return t.querySelector(e)?$Z(t).select(e):$Z(t).append(n)}function zX(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function BX(t,e){const n={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};if(e)return Object.assign(Object.assign({},n),e);let{flexDirection:r,justifyContent:i,alignItems:o}=n;const a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["colunm","center","center"],right:["colunm","center","center"],center:["column","center","center"]};return t in a&&([r,i,o]=a[t]),{display:"flex",flexDirection:r,justifyContent:i,alignItems:o}}class jX extends DX{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class UX extends jX{update(t){var e;const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}function ZX(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function VX(t){return"vertical"===t||t===-Math.PI/2}function GX(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[u,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:c,defaultLength:h}=n.props,p=o||c||u,f=a||h||l,d=s?"horizontal":"vertical",[m,g]=s?[f,p]:[p,f];return{orientation:d,width:m,height:g,size:p,length:f}}function HX(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${NX(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}var WX=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function qX(t){const{innerWidth:e,innerHeight:n}=t.getOptions();return[e,n]}function YX(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function XX(t,e,n,r,i,o,a,s){var u;void 0===n&&void 0===o||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),o&&{tickMethod:o}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=CZ(e,(t=>+t)),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),c=i?l.filter(i):l,h=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),p=r||(null===(u=t.getFormatter)||void 0===u?void 0:u.call(t))||h,f=function(t,e){const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:u}=n,[l,c,h]="left"===t||"right"===t?[o,a,i]:[s,u,r],p=new KU({domain:[0,1],range:[l/h,1-c/h]});return t=>p.map(t)}(a,s),d=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!WN(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new KU({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new KU({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s);return ZN(s)||UN(s)?c.map(((e,n,r)=>{var i,o;const u=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=f(t.map(e)+u),c=VN(s)&&"center"===a||UN(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a);return{value:c?1-l:l,label:h(p(YX(e),n,r)),id:String(n)}})):c.map(((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0;return{value:d(f(t.map(e)+o)),label:h(p(YX(e),n,r)),id:String(n)}}))}function $X(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(t)};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function KX(t,e,n){return!function(t){return ZN(t)&&UN(t)}(e)&&!HN(e)&&(void 0===t?!!n.getTicks:t)}const JX=t=>e=>{const{labelFormatter:n,labelFilter:r=(()=>!0)}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,u="string"==typeof n?OX(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:u,labelFilter:(t,e,n)=>r(s[e],e,s)});return t(l)(i)}},QX=JX((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:o,position:a,size:s,style:u={},title:l,tickCount:c,tickFilter:h,tickMethod:p,transform:f,indexBBox:d}=t,m=WX(t,["direction","important","labelFormatter","order","orientation","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[t],value:i,coordinate:g,theme:y})=>{const{bbox:v}=i,{domain:_}=t.getOptions(),b=function(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis;let s=n.axisLinear;return["top","right","bottom","left"].includes(i)&&(s=n[`axis${NF(i)}`]),Object.assign({},a,s)}(0,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:VX(o)?10:0,tick:"center"!==r&&void 0}):a}(0,0,y,e,a,o),x=Object.assign(Object.assign(Object.assign({},b),u),m),w=function(t,e){const[n,r]=qX(e);return t.includes("bottom")||t.includes("top")?r:n}(a,g),S=function(t,e,n,r){const{x:i,y:o,width:a,height:s}=n;if("bottom"===t)return{startPos:[i,o],endPos:[i+a,o]};if("left"===t)return{startPos:[i+a,o],endPos:[i+a,o+s]};if("right"===t)return{endPos:[i,o+s],startPos:[i,o]};if("top"===t)return{startPos:[i,o+s],endPos:[i+a,o+s]};if("center"===t){if("vertical"===e)return{startPos:[i+a,o],endPos:[i+a,o+s]};if("horizontal"===e)return{startPos:[i,o+s],endPos:[i+a,o+s]};if("number"==typeof e){const[t,n]=r.getCenter(),[u,l]=YN(r),[c,h]=XN(r),p=Math.min(a,s)/2,f=u*p,d=l*p,[m,g]=[t+i,n+o],[y,v]=[Math.cos(e),Math.sin(e)];return{startPos:[m+d*y,g+d*v],endPos:[m+f*y,g+f*v],gridClosed:h-c==360,gridCenter:[t+i,o+n],gridControlAngles:new Array(3).fill(0).map(((t,e,n)=>(h-c)/(n.length-1)*e))}}}return{}}(a,o,v,g),E=XX(t,_,c,r,h,p,a,g),M=d?E.map(((t,e)=>{const n=d.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):E,T=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},x),{type:"linear",data:M,crossSize:s,titleText:zX(l),labelOverlap:$X(f,x),grid:KX(x.grid,g,t),gridLength:w,line:!0,indexBBox:d}),x.line?null:{lineOpacity:0}),S),n),A=T.labelOverlap.find((t=>"hide"===t.type));return A&&(T.crossSize=!1),new _X({className:"axis",style:HX(T)})}})),t$=JX((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:o,tickFilter:a,tickCount:s,tickMethod:u,important:l={},style:c={}}=t,h=WX(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style"]),{title:p,grid:f=!1}=c;return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:c}=e,{domain:d}=t.getOptions(),m=XX(t,d,s,o,a,u,r,n),[g,y]=YN(n),v=function(t,e,n,r,i){const{x:o,y:a,width:s,height:u}=e,l=[o+s/2,a+u/2],c=Math.min(s,u)/2,[h,p]=XN(i),[f,d]=qX(i),m={center:l,radius:c,startAngle:h,endAngle:p,titleFillOpacity:0,titlePosition:"inner",line:!1,tick:!0,gridLength:(r-n)*(Math.min(f,d)/2)};if("inner"===t){const[t,e]=qX(i);return Math.min(t,e),Object.assign(Object.assign({},m),{labelAlign:"perpendicular",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},m),{labelAlign:"parallel",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",gridDirection:"positive"})}(r,c,g,y,n),{axis:_}=i;return new _X({style:HX(VD({},_,v,Object.assign(Object.assign({type:"arc",data:m,titleText:zX(p),grid:f},h),l)))})}}));QX.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},t$.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0};const e$=t=>(...e)=>QX(Object.assign({},{crossPadding:50},t))(...e);e$.props=Object.assign(Object.assign({},QX.props),{defaultPosition:"bottom"});const n$=t=>(...e)=>QX(Object.assign({},{crossPadding:10},t))(...e);n$.props=Object.assign(Object.assign({},QX.props),{defaultPosition:"left"});function r$(t,e,n,r){const{radar:i}=t,{scales:[{name:o}]}=r,[a,s]=XN(n),{axisRadar:u={}}=e;return Object.assign(Object.assign({},u),{grid:"position"===o,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map(((t,e)=>(s-a)/i.count*e))})}const i$=t=>{const{important:e={}}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["important"]);return r=>{const{theme:i,coordinate:o,value:a}=r;return QX(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},r$(t,i,o,a)),e)}))(r)}};i$.props=Object.assign(Object.assign({},QX.props),{defaultPosition:"center"});const o$=function(){},a$=function(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}};var s$=Dq({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),u$=function(t){function e(e){var n=t.call(this,e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:rW(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new rI({class:s$.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new rI({class:s$.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return yA(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=this.pageViews,e=(0,aM.__read)(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(t.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1))})),2),n=e[0],r=e[1],i=this.attributes,o=i.pageWidth,a=void 0===o?n:o,s=i.pageHeight;return{pageWidth:a,pageHeight:void 0===s?r:s}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new pX(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var u=(0,aM.__read)(this.getFollowingPageDiff(t),2),l=u[0],c=u[1];this.playState="running";var h=Iq(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-c,")")}],n);return kq(h,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),h},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:yA(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:yA(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(s$.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?zH(e):BH(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox(),u=s.width,l=(s.height,(0,aM.__read)("horizontal"===o?[-180,0]:[-90,90],2)),c=l[0],h=l[1];e.setLocalEulerAngles(c),n.setLocalEulerAngles(h);var p=e.getBBox(),f=p.width,d=p.height,m=n.getBBox(),g=m.width,y=m.height,v=Math.max(f,u,g),_="horizontal"===o?{offset:[[0,0],[f/2+a,0],[f+u+2*a,0]],textAlign:"start"}:{offset:[[v/2,-d-a],[v/2,0],[v/2,y+a]],textAlign:"center"},b=(0,aM.__read)(_.offset,3),x=(0,aM.__read)(b[0],2),w=x[0],S=x[1],E=(0,aM.__read)(b[1],2),M=E[0],T=E[1],A=(0,aM.__read)(b[2],2),C=A[0],O=A[1],P=_.textAlign,k=r.querySelector("text");k&&(k.style.textAlign=P),e.setLocalPosition(w,S),r.setLocalPosition(M,T),n.setLocalPosition(C,O)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(s$.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=(0,aM.__read)(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=this.pageViews.length>=2,s=t.maybeAppendByClassName(s$.controller,"g");if(jH(s.node(),a),a){var u=Xq(this.attributes,"button"),l=Xq(this.attributes,"pageNum"),c=(0,aM.__read)(Kq(u),2),h=c[0],p=c[1],f=h.size,d=(0,aM.__rest)(h,["size"]),m=!s.select(s$.prevBtnGroup.class).node(),g=s.maybeAppendByClassName(s$.prevBtnGroup,"g").styles(p);this.prevBtnGroup=g.node();var y=g.maybeAppendByClassName(s$.prevBtn,"path"),v=s.maybeAppendByClassName(s$.nextBtnGroup,"g").styles(p);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(s$.nextBtn,"path")].forEach((function(t){t.styles((0,aM.__assign)((0,aM.__assign)({},d),{transformOrigin:"center"})),fY(t.node(),f,!0)}));var _=s.maybeAppendByClassName(s$.pageInfoGroup,"g");this.pageInfoGroup=_.node(),_.maybeAppendByClassName(s$.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),m&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=$H(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=a$((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(xL.INSERTED,e),this.playWindow.addEventListener(xL.REMOVED,e)},e}(WH);function l$(t,e){var n=Math.pow(10,e);return~~(t*n)/n}function c$(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}iW.registerSymbol("hiddenHandle",(function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]})),iW.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]})),iW.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]}));var h$=Dq({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),p$=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new tI({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,o=r.height,a=e.node().getBBox(),s=a.width,u=a.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,o,u)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=(0,aM.__read)(ZY(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.height,s=this.actualSpace,u=s.labelWidth,l=s.valueWidth,c=(0,aM.__read)(this.spacing,2),h=c[0],p=c[1];if(r){var f=r-n-h-p,d=(0,aM.__read)(this.span,2),m=d[0],g=d[1];u=(t=(0,aM.__read)([m*f,g*f],2))[0],l=t[1]}return{width:o+u+l+h+p,height:a,markerWidth:o,labelWidth:u,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=(0,aM.__read)(ZY(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,o=t.height,a=(0,aM.__read)(this.spacing,2),s=a[0];return{height:o,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(h$.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,u=void 0===s?t.stroke:s,l=+(i||a||(u?1:0))*Math.sqrt(2),c=this.markerGroup.node().getBBox(),h=c.width,p=c.height;return(1-l/Math.max(h,p))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=Xq(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(h$.markerGroup,"g").style("zIndex",0),qH(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(h$.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(function(t,e){var n,r,i=e.attributes;try{for(var o=(0,aM.__values)(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=(0,aM.__read)(a.value,2),u=s[0],l=s[1];"id"!==u&&"className"!==u&&t.attr(u,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(i,o),$H(i).styles(r)):(i.remove(),$H(o).attr("className",h$.marker.name).styles(r),t.appendChild(o)):($H(o).attr("className",h$.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),fY(e.markerGroup.node(),e.scaleSize,!0)}))},e.prototype.renderLabel=function(t){var e=Xq(this.attributes,"label"),n=e.text,r=(0,aM.__rest)(e,["text"]);this.labelGroup=t.maybeAppendByClassName(h$.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(h$.label,(function(){return pY(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=Xq(this.attributes,"value"),r=n.text,i=(0,aM.__rest)(n,["text"]);this.valueGroup=t.maybeAppendByClassName(h$.valueGroup,"g").style("zIndex",0),qH(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(h$.value,(function(){return pY(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=Xq(this.attributes,"background");this.background=t.maybeAppendByClassName(h$.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(h$.background,"rect").styles((0,aM.__assign)({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=(0,aM.__read)(t.position,3),o=i[0],a=i[1],s=i[2],u=r/2;this.markerGroup.styles({x:o,y:u}),this.labelGroup.styles({x:a,y:u}),BY(this.labelGroup.select(h$.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:s,y:u}),BY(this.valueGroup.select(h$.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=$H(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(WH),f$=Dq({page:"item-page",navigator:"navigator",item:"item"},"items"),d$=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},m$=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:o$,mouseenter:o$,mouseleave:o$})||this;return n.navigatorShape=[0,0],n}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=Xq(this.attributes,"item"),i=e.map((function(t,i){var o=t.id,a=void 0===o?i:o,s=t.label,u=t.value;return{id:"".concat(a),index:i,style:(0,aM.__assign)({layout:n,labelText:s,valueText:u},Object.fromEntries(Object.entries(r).map((function(n){var r=(0,aM.__read)(n,2);return[r[0],Jq(r[1],[t,i,e])]}))))}}));return i},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=(0,aM.__read)(this.navigatorShape,1)[0],s=(0,aM.__read)(this.grid,2),u=s[0],l=s[1],c=l*u,h=0;return this.pageViews.children.map((function(e,s){var p,f,d=Math.floor(s/c),m=s%c,g=t.ifHorizontal(l,u),y=[Math.floor(m/g),m%g];"vertical"===n&&y.reverse();var v=(0,aM.__read)(y,2),_=v[0],b=v[1],x=(r-a-(l-1)*o)/l,w=e.getBBox().height,S=(0,aM.__read)([0,0],2),E=S[0],M=S[1];return"horizontal"===n?(E=(p=(0,aM.__read)([h,_*(w+i)],2))[0],M=p[1],h=b===l-1?0:h+x+o):(E=(f=(0,aM.__read)([b*(x+o),h],2))[0],M=f[1],h=_===u-1?0:h+w+i),{page:d,index:s,row:_,col:b,pageIndex:m,width:x,height:w,x:E,y:M}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=(0,aM.__read)(this.navigatorShape,1)[0],a=(0,aM.__read)(this.grid,2),s=a[0],u=a[1],l=(0,aM.__read)([e-o,n],2),c=l[0],h=l[1],p=(0,aM.__read)([0,0,0,0,0,0,0,0],8),f=p[0],d=p[1],m=p[2],g=p[3],y=p[4],v=p[5],_=p[6],b=p[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,p=t.getBBox(),x=p.width,w=p.height,S=0===_?0:i,E=_+S+x;return E<=c&&d$(y,(function(t){return t<u}))?(n=(0,aM.__read)([_+S,b,E],3),f=n[0],d=n[1],_=n[2],{width:x,height:w,x:f,y:d,page:m,index:e,pageIndex:g++,row:v,col:y++}):(o=(0,aM.__read)([v+1,0,0,b+w+r],4),v=o[0],y=o[1],_=o[2],(b=o[3])+r+w<=h&&d$(v,(function(t){return t<s}))?(a=(0,aM.__read)([_,b,x],3),f=a[0],d=a[1],_=a[2],{width:x,height:w,x:f,y:d,page:m,index:e,pageIndex:g++,row:v,col:y++}):(l=(0,aM.__read)([0,0,x,0,m+1,0,0,0],8),f=l[0],d=l[1],_=l[2],b=l[3],m=l[4],g=l[5],v=l[6],y=l[7],{width:x,height:w,x:f,y:d,page:m,index:e,pageIndex:g++,row:v,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return c$(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(f$.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(f$.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);$H(t).selectAll(f$.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new p$({style:e})})).attr("className",f$.item.name).on("click",(function(){null==n||n(this),o("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),o("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),o("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=(0,aM.__read)(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=(0,aM.__read)(t,2);return{page:e[0],layouts:e[1]}})),i=(0,aM.__spreadArray)([],(0,aM.__read)(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new rI({className:f$.page.name}));e.forEach((function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,u=i[o];r.appendChild(u),function(t,e,n){var r=t,i=gA(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(sC(r[t])||(r[t]=fA(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(u,"__layout__",t),u.update({x:e,y:n,width:a,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=Xq(this.attributes,"nav"),r=ZH({orientation:e},n),i=this;return t.selectAll(f$.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new u$({style:r})})).attr("className",f$.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator($H(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new gL(t,{detail:e});this.dispatchEvent(n)},e}(WH),g$=Dq({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),y$={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},v$=function(t){function e(e){return t.call(this,e,y$)||this}return(0,aM.__extends)(e,t),e.prototype.render=function(t,e){var n=$H(e).maybeAppendByClassName(g$.markerGroup,"g");this.renderMarker(n);var r=$H(e).maybeAppendByClassName(g$.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?c$(r,"horizontalHandle","verticalHandle"):i;qH(!!o,t,(function(t){var n=Xq(e.attributes,"marker"),r=(0,aM.__assign)({symbol:o},n);e.marker=t.maybeAppendByClassName(g$.marker,(function(){return new iW({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;qH(r,t,(function(t){var n,r=Xq(e.attributes,"label"),o=r.text,u=(0,aM.__rest)(r,["text"]),l=(null===(n=t.select(g$.marker.class))||void 0===n?void 0:n.node().getBBox())||{},c=l.width,h=void 0===c?0:c,p=l.height,f=void 0===p?0:p,d=(0,aM.__read)(c$(i,[0,f+a,"center","top"],[h+a,0,"start","middle"]),4),m=d[0],g=d[1],y=d[2],v=d[3];t.maybeAppendByClassName(g$.label,"text").styles((0,aM.__assign)((0,aM.__assign)({},u),{x:m,y:g,text:s(o).toString(),textAlign:y,textBaseline:v}))}))},e}(WH),_$={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},b$=ZH({},_$,{}),x$=ZH({},_$,$q(y$,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),w$=Dq({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),S$=function(t){function e(e){return t.call(this,e,b$)||this}return(0,aM.__extends)(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=Xq(this.attributes,"title"),s=(0,aM.__read)(Kq(a),2),u=s[0],l=s[1];this.titleGroup=t.maybeAppendByClassName(w$.titleGroup,"g").styles(l);var c=(0,aM.__assign)((0,aM.__assign)({width:e,height:n},u),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(w$.title,(function(){return new gX({style:c})})).update(c)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=Xq(this.attributes,"title",!0),s=(0,aM.__read)(Kq(a),2),u=s[0],l=s[1],c=(0,aM.__assign)((0,aM.__assign)({},u),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(w$.itemsGroup,"g").styles((0,aM.__assign)({x:n,y:r},l));var h=this;this.itemsGroup.selectAll(w$.items.class).data(["items"]).join((function(t){return t.append((function(){return new m$({style:c})})).attr("className",w$.items.name).each((function(){h.items=$H(this)}))}),(function(t){return t.update(c)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().setLocalPosition(e,n)}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new pX(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),u=e.getBBox(),l=dX(r),c=(0,aM.__read)(ZY(a?i:0),4),h=c[0],p=c[1],f=c[2],d=c[3],m=(0,aM.__read)(ZY(o),4),g=m[0],y=m[1],v=m[2],_=m[3],b=(0,aM.__read)([d+p,h+f],2),x=b[0],w=b[1],S=(0,aM.__read)([_+y,g+v],2),E=S[0],M=S[1];if("l"===l[0])return new pX(s.x,s.y,u.width+s.width+x+E,Math.max(u.height+M,s.height));if("t"===l[0])return new pX(s.x,s.y,Math.max(u.width+E,s.width),u.height+s.height+w+M);var T=(0,aM.__read)([e.attributes.width||u.width,e.attributes.height||u.height],2),A=T[0],C=T[1];return new pX(u.x,u.y,A+s.width+x+E,C+s.height+w+M)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=t.width,r=t.height,i=$H(e);this.renderTitle(i,n,r),this.renderItems(i,this.availableSpace),this.adjustLayout()},e}(WH);const E$=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)};function M$(t,e,n,r,i={}){var o,a;const s=(null===(a=null===(o=e[`shape.${t}`])||void 0===o?void 0:o.props)||void 0===a?void 0:a.defaultMarker)||function(t){if(E$(t))return t[t.length-1]}(t.split("."));return()=>function(t,e){var{d:n,fill:r,strokeWidth:i,path:o,stroke:a,lineWidth:s,color:u}=e,l=zG(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const c=pH.get(t)||pH.get("point");return(...t)=>new sI({style:Object.assign(Object.assign({},l),{path:c(...t),stroke:c.style.includes("stroke")?u||a:"",fill:c.style.includes("fill")?u||r:"",lineWidth:c.style.includes("lineWidth")?s||s||2:0})})}(s,i)(0,0,6)}function T$(t,{scales:e,library:n,coordinate:r,theme:i,markState:o}){const a=ZX(e,"shape"),[s,u]=function(t,e){const n=ZX(t,"shape"),r=ZX(t,"color"),i=[];for(const[t,o]of e){const e=t.type,a=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:o.data).map(((e,r)=>{var i;return n?n.map(e||"point"):(null===(i=null==t?void 0:t.style)||void 0===i?void 0:i.shape)||o.defaultShape||"point"}));"string"==typeof e&&i.push([e,a])}if(0===i.length)return["point",["point"]];if(1===i.length)return i[0];if(!n)return i[0];const{range:o}=n.getOptions();return i.map((([t,e])=>{let n=0;for(let t=0;t<i.length;t++){const r=o[t%o.length];e[t]===r&&n++}return[n/e.length,[t,e]]})).sort(((t,e)=>e[0]-t[0]))[0][1]}(e,o),{itemMarker:l}=t;return a&&!l?(t,e)=>M$(`${s}.${u[e]}`,n,0,0,{color:t.color}):"function"==typeof l?l:(t,e)=>M$(l||`${s}.${u[e]}`,n,0,0,{color:t.color})}function A$(t){const e=ZX(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function C$(t){const e=ZX(t,"size");return e?2*e.map(NaN):8}const O$=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s}=t,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["labelFormatter","layout","order","orientation","position","size","title"]),{gridCol:l,gridRow:c}=u;return e=>{var n,r,i;const{value:a,theme:h}=e,{bbox:p}=a,{width:f,height:d}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=GX(t,e,n);return{width:i,height:o}}(a,t,O$),m=BX(o,null===(i=null===(r=null===(n=a.scales)||void 0===n?void 0:n[0])||void 0===r?void 0:r.guide)||void 0===i?void 0:i.layout),[g,y]=function(t,e,n){const[r,i]=[e||100,n||100];switch(t){case"top":case"bottom":case"top-left":case"top-right":case"bottom-left":case"bottom-right":return[1,i];case"left":case"right":return[r,1];default:return[e,n]}}(o,c,l),v=Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:f,height:d,gridCol:null!=l?l:y,gridRow:null!=c?c:g,rowPadding:0,colPadding:8,titleText:zX(s)},function(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r}=e,i={itemMarker:T$(t,e),itemMarkerSize:C$(r),itemMarkerOpacity:A$(r)},o="string"==typeof n?OX(n):n,a=ZX(r,"color"),s=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r);return Object.assign(Object.assign({},i),{data:s.map((t=>({id:t,label:o(t),color:a.map(t)})))})}(t,e)),{legend:_={}}=h,b=HX(Object.assign({},_,v,u)),x=new UX({style:Object.assign(Object.assign({x:p.x,y:p.y,width:p.width,height:p.height},m),{subOptions:b})});return x.appendChild(new S$({className:"legend-category",style:b})),x}};function P$(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}O$.props={defaultPosition:"top",defaultOrder:1,defaultSize:40};var k$={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",zIndex:999},L$=Dq({background:"background",labelGroup:"label-group",label:"label"},"indicator"),I$=function(t){function e(e){var n=t.call(this,e,k$)||this;return n.point=[0,0],n.group=n.appendChild(new rI({})),n.isMutationObserved=!0,n}return(0,aM.__extends)(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=t.padding,r=(0,aM.__read)(ZY(n),4),i=r[0],o=r[1],a=r[2],s=r[3],u=this.label.node().getLocalBounds(),l=u.min,c=u.max,h=[[l[0]-s,l[1]-i],[c[0]+o,c[1]+a]],p=this.getPath(e,h),f=Xq(this.attributes,"background");this.background=$H(this.group).maybeAppendByClassName(L$.background,"path").styles((0,aM.__assign)((0,aM.__assign)({},f),{path:p})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=Xq(this.attributes,"label"),i=(0,aM.__read)(Kq(r),2),o=i[0],a=i[1],s=(o.text,(0,aM.__rest)(o,["text"]));this.label=$H(this.group).maybeAppendByClassName(L$.labelGroup,"g").styles(a),n&&this.label.maybeAppendByClassName(L$.label,(function(){return pY(e(n))})).style("text",e(n).toString()).selectAll("text").styles(s)},e.prototype.adjustLayout=function(){var t=(0,aM.__read)(this.point,2),e=t[0],n=t[1];this.group.attr("x",-e).attr("y",-n)},e.prototype.getPath=function(t,e){var n=this,r=(0,aM.__read)(e,2),i=(0,aM.__read)(r[0],2),o=i[0],a=i[1],s=(0,aM.__read)(r[1],2),u=s[0],l=s[1],c={top:[[o,a],[u,a]],right:[[u,a],[u,l]],bottom:[[u,l],[o,l]],left:[[o,l],[o,a]]},h={top:"bottom",right:"left",bottom:"top",left:"right"},p=Object.entries(c).map((function(e){var r=(0,aM.__read)(e,2),i=r[0],o=r[1];return i===h[t]?n.createCorner(o):[(0,aM.__spreadArray)(["M"],(0,aM.__read)(o[0]),!1),(0,aM.__spreadArray)(["L"],(0,aM.__read)(o[1]),!1)]}));return p.push([["Z"]]),p.flat().filter((function(t,e,n){return 0===e||"M"!==t[0]}))},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=JY.apply(void 0,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1)),r=(0,aM.__read)(t,2),i=(0,aM.__read)(r[0],2),o=i[0],a=i[1],s=(0,aM.__read)(r[1],2),u=s[0],l=s[1],c=(0,aM.__read)(n?[u-o,[o,u]]:[l-a,[a,l]],2),h=c[0],p=(0,aM.__read)(c[1],2),f=p[0],d=p[1],m=h/2,g=e*(h/Math.abs(h)),y=g/2,v=g*Math.sqrt(3)/2*.8,_=(0,aM.__read)([f,f+m-y,f+m,f+m+y,d],5),b=_[0],x=_[1],w=_[2],S=_[3],E=_[4];return n?(this.point=[w,a-v],[["M",b,a],["L",x,a],["L",w,a-v],["L",S,a],["L",E,a]]):(this.point=[o+v,w],[["M",o,b],["L",o,x],["L",o+v,w],["L",o,S],["L",o,E]])},e.prototype.bindEvents=function(){this.label.on(xL.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},e}(WH);function R$(t,e){var n=(0,aM.__read)(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var D$=Dq({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function N$(t){var e=t.orientation,n=t.size,r=t.length;return c$(e,[r,n],[n,r])}function F$(t){var e=t.type,n=(0,aM.__read)(N$(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function z$(t){return F$(t)}function B$(t){var e=t.orientation,n=t.range;if(!n)return[];var r=(0,aM.__read)(N$(t),2),i=r[0],o=r[1],a=(0,aM.__read)(n,2),s=a[0],u=a[1],l=c$(e,s*i,0),c=c$(e,0,s*o),h=c$(e,u*i,i),p=c$(e,o,u*o);return[["M",l,c],["L",l,p],["L",h,p],["L",h,c],["Z"]]}var j$=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return(0,aM.__extends)(e,t),e.prototype.render=function(t,e){!function(t,e){var n=Xq(e,"track");t.maybeAppendByClassName(D$.track,"path").styles((0,aM.__assign)({path:F$(e)},n))}($H(e).maybeAppendByClassName(D$.trackGroup,"g"),t),function(t,e){var n=Xq(e,"selection"),r=function(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;e=NH(r)?new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))})):r;var a=e.length,s=e.map((function(t){return oP(t).toString()}));return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)}),"l(".concat(c$(n,"0","270"),")")):""}(e),i=t.maybeAppendByClassName(D$.selection,"path").styles((0,aM.__assign)({path:z$(e),fill:r},n)),o=i.maybeAppendByClassName(D$.clipPath,"path").styles({path:B$(e)}).node();i.style("clip-path",o)}($H(e).maybeAppendByClassName(D$.selectionGroup,"g"),t)},e}(WH),U$={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Z$={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},V$={orientation:"horizontal",showLabel:!0,type:"start"},G$=Dq({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),H$=Dq({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),W$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,aM.__extends)(e,t),e.prototype.render=function(t,e){var n=t.size,r=void 0===n?10:n,i=t.radius,o=void 0===i?r/4:i,a=t.orientation,s=(0,aM.__rest)(t,["size","radius","orientation"]),u=r,l=2.4*u,c=$H(e).maybeAppendByClassName(H$.iconRect,"rect").styles((0,aM.__assign)((0,aM.__assign)({},s),{width:u,height:l,radius:o,x:-u/2,y:-l/2})),h=1/3*u,p=2/3*u,f=1/4*l,d=3/4*l;c.maybeAppendByClassName("".concat(H$.iconLine,"-1"),"line").styles((0,aM.__assign)({x1:h,x2:h,y1:f,y2:d},s)),c.maybeAppendByClassName("".concat(H$.iconLine,"-2"),"line").styles((0,aM.__assign)({x1:p,x2:p,y1:f,y2:d},s)),c.node().setOrigin(u/2,l/2),"vertical"===a?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},e}(WH),q$=function(t){function e(e){return t.call(this,e,V$)||this}return(0,aM.__extends)(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=Xq(this.attributes,"label"),i=r.transform,o=(0,aM.__rest)(r,["transform"]),a=(0,aM.__read)(Kq(o,[]),2),s=a[0],u=a[1],l=$H(t).maybeAppendByClassName(H$.labelGroup,"g").styles(u),c=(0,aM.__assign)((0,aM.__assign)({},Z$),s),h=c.text,p=(0,aM.__rest)(c,["text"]);qH(!!n,l,(function(t){e.label=t.maybeAppendByClassName(H$.label,"text").styles((0,aM.__assign)((0,aM.__assign)({},p),{transform:i,text:"".concat(h)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=(0,aM.__assign)((0,aM.__assign)({orientation:e},U$),Xq(this.attributes,"icon")),r=this.attributes.iconShape,i=void 0===r?function(){return new W$({style:n})}:r;$H(t).maybeAppendByClassName(H$.iconGroup,"g").selectAll(H$.icon.class).data([i]).join((function(t){return t.append(i).attr("className",H$.icon.name)}),(function(t){return t.update(n)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(WH),Y$=uY((function(t){return{min:Math.min.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,(0,aM.__spreadArray)([],(0,aM.__read)(t.map((function(t){return t.value}))),!1))}}),(function(t){return t.map((function(t){return t.id}))})),X$=function(t){function e(e){var n=t.call(this,e,x$)||this;return n.eventToOffsetScale=new KU({}),n.innerRibbonScale=new KU({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=R$(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=(0,aM.__read)(n.selection,2),i=r[0],o=r[1],a=n.getTickValue(n.getValueByCanvasPoint(t)),s=a-n.prevValue;"start"===e?i!==a&&n.updateSelection(a,o):"end"===e?o!==a&&n.updateSelection(i,a):"ribbon"===e&&0!==s&&(n.prevValue=a,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="default",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new pX(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle($H(e));var i=this.availableSpace,o=i.x,a=i.y,s=$H(e).maybeAppendByClassName(w$.contentGroup,"g").styles({x:o,y:a});qH(!!r,s.maybeAppendByClassName(w$.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var u=s.maybeAppendByClassName(w$.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(w$.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(u),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes.data;return Y$(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=(0,aM.__read)(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=void 0===r?[e,n]:r,o=(0,aM.__read)(i,2);return[o[0],o[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return c$(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=Xq(this.attributes,"title"),s=(0,aM.__assign)((0,aM.__assign)({},a),{width:i,height:o,text:r}),u=this;t.selectAll(w$.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new gX({style:s})})).attr("className",w$.title.name).each((function(){u.title=this}))}),(function(t){return t.update(s)}),(function(t){return t.each((function(){u.title=void 0})).remove()}))},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new pX(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new pX(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Fq.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new pX(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t,e=this.attributes,n=e.showHandle,r=e.ribbonSize,i=this.availableSpace,o=i.width,a=i.height,s=this.labelShape,u=s.size,l=s.length,c=(0,aM.__read)(this.ifHorizontal([a,o],[o,a]),2),h=c[0],p=c[1],f=n?this.handleShape:{size:0,length:0},d=f.size,m=f.length,g=this.handleOffsetRatio,y=this.labelPosition;t=r||(["bottom","right"].includes(y)?Math.min(h-u,(h-d)/g):h*(1-g)>d?Math.max(h-u,0):Math.max((h-u-d)/g,0));var v=Math.max(m,l),_=p-v,b=(0,aM.__read)(this.ifHorizontal([_,t],[t,_]),2),x=b[0],w=b[1],S=["top","left"].includes(y)?u:0,E=(0,aM.__read)(this.ifHorizontal([v/2,S],[S,v/2]),2),M=E[0],T=E[1];return new pX(M,T,x,w)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=Xq(this.attributes,"ribbon"),u=this.range,l=u.min,c=u.max,h=this.ribbonBBox,p=h.x,f=h.y,d=this.ribbonShape,m=d.length,g=d.size,y=ZH({x:p,y:f,length:m,size:g,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(c-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(w$.ribbon,(function(){return new j$({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(w$.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=Xq(this.attributes,"handle"),i=(0,aM.__read)(this.selection,2),o=i[0],a=i[1],s=(0,aM.__assign)((0,aM.__assign)({},r),{orientation:n}),u=r.shape,l="basic"===(void 0===u?"slider":u)?v$:q$,c=this;this.handlesGroup.selectAll(w$.handle.class).data(e?[{value:o,type:"start"},{value:a,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new l({style:s})})).attr("className",(function(t){var e=t.type;return"".concat(w$.handle," ").concat(c.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");c[r]=this,this.addEventListener("pointerdown",c.onDragStart(e))}))}),(function(t){return t.update(s).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");c[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=(0,aM.__read)(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},e.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,n=t.orientation,r=(0,aM.__read)(this.getElementsByClassName(w$.title.name),1)[0],i=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(r&&i&&"top-left"===e&&"horizontal"===n){var o=(0,aM.__read)(i.getLocalBounds().min,1)[0]-(0,aM.__read)(r.getLocalBounds().min,1)[0];r.style.x=+(this.style.x||0)+o}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new pX(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=(0,aM.__read)([Math.max(e,i),Math.max(n,o)],2),s=a[0],u=a[1];return this.cacheHandleBBox=new pX(0,0,s,u),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=(0,aM.__read)(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),u=(0,aM.__read)(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=u[0],c=u[1],h=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==h||h.update({x:l,y:c,formatter:n})},e.prototype.renderIndicator=function(t){var e=Xq(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(w$.indicator,(function(){return new I$({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,i){var o,a,s=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:r.toString();if(e.push((0,aM.__assign)((0,aM.__assign)({},n),{id:s,index:r,type:"value",label:null!==(a=null==n?void 0:n.label)&&void 0!==a?a:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var u=i[r+1],l=(0,aM.__read)([n.value,u.value],2),c=l[0],h=l[1],p=(c+h)/2;e.push((0,aM.__assign)((0,aM.__assign)({},n),{id:s,index:r,type:"range",range:[c,h],label:[c,h].join("~"),value:t.ribbonScale.map(p)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=(0,aM.__read)(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,o=e.labelFormatter,a=Xq(this.attributes,"tick"),s=Xq(this.attributes,"label"),u=s.align,l=ZH((0,aM.__assign)({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),$q(a,"tick"),$q(s,"label"),{data:this.labelData}),c={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter((function(t){return"value"!==t.type}))))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===u&&(!i||i(t,t.index,n.filter((function(t){return t.type===u}))))},labelFormatter:o},h=(0,aM.__assign)((0,aM.__assign)((0,aM.__assign)({},l),c),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(w$.label,(function(){return new _X({style:h})})).node(),this.label.update(h,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,o=this.ribbonShape.size,a=this.labelPosition,s=this.labelFixedSpacing,u=(0,aM.__read)([0,0,0],3),l=u[0],c=(u[1],u[2]),h=null!=i?i:o;return e?(c=h,"positive"===n?"right"===a?(l=h,c=h):"bottom"===a&&(l=c):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:c}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,u=o.tickLength,l=(0,aM.__read)(this.ifHorizontal([[e,n+a],[e+r,n+a]],[[e+a,n+i],[e+a,n]]),2),c=l[0],h=l[1];this.label.update({startPos:c,endPos:h,tickLength:u,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,o=this.ribbonBBox,a=o.x,s=o.y,u=yA(t,r,i),l=this.getOffset(u),c=this.ifHorizontal([l+a,s],[a,l+s]);this.indicator.update({x:c[0],y:c[1],position:this.ifHorizontal("top","left"),labelText:e}),zH(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){BH(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=(0,aM.__read)(this.selection,2),o=i[0],a=i[1],s=(0,aM.__read)([t,e],2),u=s[0],l=s[1];n&&(u+=o,l+=a);var c=this.range,h=c.min,p=c.max;r=(0,aM.__read)(function(t,e,n,r){var i;void 0===r&&(r=4);var o=(0,aM.__read)(t,2),a=o[0],s=o[1],u=(0,aM.__read)(e,2),l=u[0],c=u[1],h=(0,aM.__read)(n,2),p=h[0],f=h[1],d=(0,aM.__read)([l,c],2),m=d[0],g=d[1],y=g-m;return m>g&&(m=(i=(0,aM.__read)([g,m],2))[0],g=i[1]),y>s-a?[a,s]:m<a?p===a&&f===g?[a,g]:[a,y+a]:g>s?f===s&&p===m?[m,s]:[s-y,s]:[l$(m,r),l$(g,r)]}([h,p],[u,l],this.selection),2),u=r[0],l=r[1],this.update({defaultValue:[u,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return uC(e)?l$(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?R$(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=(0,aM.__read)(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],u=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,(0,aM.__spreadArray)([],(0,aM.__read)(P$(t)),!1))-u;return yA(this.getOffset(l,!0),r,i)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.dispatchSelection=function(){var t=new gL("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new gL("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(WH);function $$(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],kZ(e)];return[n,r]}function K$(t,e,n,r,i){const o=ZX(t,"color"),a=function(t,e,n){const{size:r}=e,i=GX(t,e,n),o=function(t,e){return Math.min(t,e)}(r,J$.props.defaultLegendSize);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,o,i.orientation)}(e,n,r);if(o instanceof nZ){const{range:t}=o.getOptions(),[e,n]=$$(o);return o instanceof aZ||o instanceof uZ?function(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}(a,o,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(a,o,t)}return function(t,e,n,r,i){const{length:o}=t,a=e||function(t,e){const{defaultColor:n}=e,r=t.getOptions(),i=t.clone();return i.update(Object.assign(Object.assign({},r),{range:[oP(n).toString()]})),i}(n||r,i),[s,u]=$$(a);return Object.assign(Object.assign({},t),{data:a.getTicks().map((t=>({value:t}))),color:new Array(o).fill(0).map(((t,e)=>{const n=(u-s)/(o-1)*e+s,i=a.map(n),l=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${l})`))}))})}(a,o,ZX(t,"size"),ZX(t,"opacity"),i)}const J$=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:u}=t,l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["labelFormatter","layout","order","orientation","position","size","title","style"]);return({scales:r,value:i,theme:a})=>{const{bbox:c}=i,{x:h,y:p,width:f,height:d}=c,m=BX(o,n),{continuousLegend:g={}}=a,y=HX(Object.assign({},g,Object.assign(Object.assign({titleText:zX(s),titleFontSize:12,handle:!1,indicator:!1,labelAlign:"value",labelFormatter:"string"==typeof e?t=>OX(e)(t.label):e},K$(r,i,t,J$,a)),u),l)),v=new jX({style:Object.assign(Object.assign({x:h,y:p,width:f,height:d},m),{subOptions:y})});return v.appendChild(new X$({style:y})),v}};J$.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:300,defaultLegendSize:60};const Q$=t=>(...e)=>J$(Object.assign({},{block:!0},t))(...e);Q$.props=Object.assign(Object.assign({},J$.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const tK=t=>e=>{const{scales:n}=e,r=ZX(n,"size");return J$(Object.assign({},{type:"size",tick:!1,data:r.getOptions().domain.map(((t,e)=>({value:t,label:String(t)}))),labelFilter:(t,e,n)=>0===e||e===n.length-1},t))(e)};tK.props=Object.assign(Object.assign({},J$.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const eK=t=>tK(Object.assign({},{block:!0},t));eK.props=Object.assign(Object.assign({},J$.props),{defaultPosition:"top",defaultOrientation:"horizontal"});function nK(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}const rK=(iK={render(t,e){const{x:n,y:r,width:i,title:o,subtitle:a}=t,s=t.style,{spacing:u=2,align:l="left"}=s,c=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(s,["spacing","align"]),h=UF(c,"title"),p=UF(c,"subtitle"),f=FX(e,".title","text").attr("className","title").call(UZ,Object.assign(Object.assign(Object.assign({},nK(0,r,i,l)),{fontSize:14,textBaseline:"top",text:o}),h)).node().getLocalBounds();FX(e,".sub-title","text").attr("className","sub-title").call((t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},nK(0,f.max[1]+u,i,l)),{fontSize:12,textBaseline:"top",text:a}),p))}))}},class extends eI{constructor(t){super(t),this.descriptor=iK}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(VD({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var iK;const oK=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new rK({style:VD({},{style:n.title},Object.assign({x:r,y:i,width:o,height:a},t))})};oK.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};var aK=function(t){if("object"!=typeof t||null===t)return t;var e;if(GA(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=aK(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=aK(t[i]):e[i]=t[i];return e};const sK=aK;var uK=function(t){function e(e){var n=this,r=e.style,i=(0,aM.__rest)(e,["style"]);return(n=t.call(this,VD({},{type:"column"},(0,aM.__assign)({style:r},i)))||this).columnsGroup=new rI({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return(0,aM.__extends)(e,t),e.prototype.render=function(){var t=this.attributes.columns;$H(this.columnsGroup).selectAll(".column").data(t.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(ZH({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(QL),lK=function(t){function e(e){var n=this,r=e.style,i=(0,aM.__rest)(e,["style"]);return(n=t.call(this,VD({},{type:"lines"},(0,aM.__assign)({style:r},i)))||this).linesGroup=n.appendChild(new rI),n.areasGroup=n.appendChild(new rI),n.render(),n}return(0,aM.__extends)(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas;e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(ZH({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){$H(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){$H(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(QL),cK=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(gA(t)||gA(e))return!1;if(E$(t)||E$(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=cK(t[r],e[r]));r++);return n}if(jD(t)||jD(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=cK(t[i[r]],e[i[r]]));r++);return n}return!1};const hK=cK;function pK(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return(0,aM.__spreadArray)([e===n?"M":"L"],(0,aM.__read)(t),!1)}));return e?r.reverse():r}function fK(t,e){if(void 0===e&&(e=!1),t.length<=2)return pK(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];hK(o,n.slice(-2))||n.push.apply(n,(0,aM.__spreadArray)([],(0,aM.__read)(o),!1))}var a=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,u,l,c=function(t,e,n,r){var i,o,a,s,u,l,c=[],h=!!r,p=[1/0,1/0],f=[-1/0,-1/0];if(h){p=(i=(0,aM.__read)(r,2))[0],f=i[1];for(var d=0,m=t.length;d<m;d+=1)p=Uq(p,y=t[d]),f=Zq(f,y)}d=0;for(var g=t.length;d<g;d+=1){var y=t[d];if(0!==d||n)if(d!==g-1||n){o=t[[d?d-1:g-1,d-1][n?0:1]];var v=[0,0];v=zq(v=jq(a=t[n?(d+1)%g:d+1],o),.4);var _=Vq(y,o),b=Vq(y,a),x=_+b;0!==x&&(_/=x,b/=x);var w=zq(v,-_),S=zq(v,b);u=Bq(y,w),s=Uq(s=Bq(y,S),Zq(a,y)),s=Zq(s,Uq(a,y)),u=Uq(u=Bq(y,w=zq(w=jq(s,y),-_/b)),Zq(o,y)),s=Bq(y,S=zq(S=jq(y,u=Zq(u,Uq(o,y))),b/_)),h&&(u=Uq(u=Zq(u,p),f),s=Uq(s=Zq(s,p),f)),c.push(l),c.push(u),l=s}else u=y,c.push(l),c.push(u);else l=y}return n&&c.push(c.shift()),c}(i,0,r,n),h=i.length,p=[];for(o=0;o<h-1;o+=1)s=c[2*o],u=c[2*o+1],l=i[o+1],p.push(["C",s[0],s[1],u[0],u[1],l[0],l[1]]);return r&&(s=c[h],u=c[h+1],l=(0,aM.__read)(i,1)[0],p.push(["C",s[0],s[1],u[0],u[1],l[0],l[1]])),p}(n,!1);return e?a.unshift((0,aM.__spreadArray)(["M"],(0,aM.__read)(t[r-1]),!1)):a.unshift((0,aM.__spreadArray)(["M"],(0,aM.__read)(t[0]),!1)),a}function dK(t,e,n){var r=sK(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}const mK=function(t,e){if(GA(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=NH(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},gK=function(t,e){if(GA(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=NH(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}};function yK(t){return 0===t.length?[0,0]:[HA(mK(t,(function(t){return HA(t)||0}))),WA(gK(t,(function(t){return WA(t)||0})))]}function vK(t){for(var e=sK(t),n=e[0].length,r=(0,aM.__read)([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],u=0;u<n;u+=1)s[u]>=0?(s[u]+=i[u],i[u]=s[u]):(s[u]+=o[u],o[u]=s[u]);return e}var _K=function(t){function e(e){return t.call(this,e,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff"})||this}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=sK(t);return fA(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?vK(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=(0,aM.__read)(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=Xq(this.attributes,"area"),a=Xq(this.attributes,"line"),s=this.containerShape.width,u=this.data;if(0===u[0].length)return{lines:[],areas:[]};var l=this.scales,c=function(t,e){var n,r=e.x,i=e.y,o=(0,aM.__read)(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=(0,aM.__read)([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),yA(i.map(t),s,a)]}))}))}(u,{type:"line",x:l.x,y:l.y}),h=[];if(o){var p=this.baseline;h=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=fK(o),s=void 0;if(0===i)s=dK(a,e,n);else{var u=fK(t[i-1],!0),l=o[0];u[0][0]="L",s=(0,aM.__spreadArray)((0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(a),!1),(0,aM.__read)(u),!1),[(0,aM.__spreadArray)(["M"],(0,aM.__read)(l),!1),["Z"]],!1)}r.push(s)}return r}(c,s,p):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=pK(t[i]),a=void 0;if(0===i)a=dK(o,e,n);else{var s=pK(t[i-1],!0);s[0][0]="L",a=(0,aM.__spreadArray)((0,aM.__spreadArray)((0,aM.__spreadArray)([],(0,aM.__read)(o),!1),(0,aM.__read)(s),!1),[["Z"]],!1)}r.push(a)}return r}(c,s,p):function(t,e,n,r){return t.map((function(t){return dK(e?fK(t):pK(t),n,r)}))}(c,i,s,p)}return{lines:c.map((function(e,n){return(0,aM.__assign)({stroke:t.getColor(n),path:i?fK(e):pK(e)},a)})),areas:h.map((function(e,n){return(0,aM.__assign)({path:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=Xq(this.attributes,"column"),n=this.attributes,r=n.isStack;if("column"!==n.type)throw new Error("columnsStyle can only be used in column type");var i=this.containerShape.height,o=this.rawData;if(!o)return{columns:[]};r&&(o=vK(o));var a=this.createScales(o),s=a.x,u=a.y,l=(0,aM.__read)(yK(o),2),c=l[0],h=l[1],p=new KU({domain:[0,h-(c>0?0:c)],range:[0,i]}),f=s.getBandWidth(),d=this.rawData;return{columns:o.map((function(n,i){return n.map((function(n,a){var l=f/o.length;return(0,aM.__assign)((0,aM.__assign)({fill:t.getColor(i)},e),r?{x:s.map(a),y:u.map(n),width:f,height:p.map(d[i][a])}:{x:s.map(a)+l*i,y:n>=0?u.map(n):u.map(0),width:l,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.container=KH(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=KH(e,".".concat(r),(function(){return"line"===n?new lK({className:r,style:i}):new uK({className:r,style:i})})).styles(i).node()},e.prototype.getColor=function(t){var e=this.attributes.color;return GA(e)?e[t%e.length]:NH(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.range,a=void 0===o?[]:o,s=r.isGroup,u=r.spacing,l=this.containerShape,c=l.width,h=l.height,p=(0,aM.__read)(yK(t),2),f=p[0],d=p[1],m=new KU({domain:[null!==(e=a[0])&&void 0!==e?e:f,null!==(n=a[1])&&void 0!==n?n:d],range:[h,0]});return"line"===i?{type:i,x:new KU({domain:[0,t[0].length-1],range:[0,c]}),y:m}:{type:i,x:new IU({domain:t[0].map((function(t,e){return e})),range:[0,c],paddingInner:s?u:0}),y:m}},e.tag="sparkline",e}(WH),bK=function(t){function e(e){var n=t.call(this,e,(0,aM.__assign)((0,aM.__assign)((0,aM.__assign)({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionCursor:"move",selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1]},$q(V$,"handle")),$q(U$,"handleIcon")),$q(Z$,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(P$(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.attributes,s=a.x,u=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+u])),n.selectionWidth=0,document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable;t.stopPropagation();var o=n.getOrientVal(P$(t)),a=o-n.prevPos;if(a){var s=n.getRatio(a);switch(n.target){case"start":r&&n.setValuesOffset(s);break;case"end":r&&n.setValuesOffset(0,s);break;case"selection":r&&n.setValuesOffset(s,s);break;case"track":if(!i)return;n.selectionWidth+=s,n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0)}n.prevPos=o}},n.onDragEnd=function(){document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n.onValueChange=function(t){var e=new gL("valuechange",{detail:{oldValue:t,value:n.getValues()}});n.dispatchEvent(e)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=Xq(this.attributes,"sparkline");return(0,aM.__assign)((0,aM.__assign)({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=(0,aM.__read)(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.padding,e=(0,aM.__read)(ZY(t),4),n=e[0],r=e[1],i=e[2],o=e[3],a=this.shape;return{x:o,y:n,width:a.width-(o+r),height:a.height-(n+i)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;Rq(this.selectionShape.node(),this.selectionStyle,n),this.updateHandlesPosition(n)},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(Rq(this.startHandle,this.getHandleStyle("start"),t),Rq(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attr("values",r),this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=Xq(this.attributes,"track");this.trackShape=$H(t).maybeAppendByClassName(G$.track,"rect").styles((0,aM.__assign)((0,aM.__assign)({cursor:e?"crosshair":"default"},this.shape),n))},e.prototype.renderSparkline=function(t){var e=this;qH("horizontal"===this.attributes.orientation,$H(t).maybeAppendByClassName(G$.sparklineGroup,"g"),(function(t){var n=e.sparklineStyle;t.maybeAppendByClassName(G$.sparkline,(function(){return new _K({style:n})})).update(n)}))},Object.defineProperty(e.prototype,"selectionStyle",{get:function(){var t=Xq(this.attributes,"selection");return(0,aM.__assign)((0,aM.__assign)({},t),this.calcMask())},enumerable:!1,configurable:!0}),e.prototype.renderHandles=function(){var t,e=this,n=(this.attributes.showHandle?["start","end"]:[]).map((function(t){return{type:t}})),r=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(G$.handle.class).data(n,(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new q$({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(G$.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");r[n]=this,this.addEventListener("pointerdown",(function(t){r.onDragStart(e)(t)}))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(r.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");r[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){this.foregroundGroup=$H(t).maybeAppendByClassName(G$.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(G$.selection,"rect").styles(this.selectionStyle),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=(0,aM.__read)(this.range,2),i=r[0],o=r[1],a=(0,aM.__read)(this.getValues().map((function(t){return l$(t,e)})),2),s=a[0],u=a[1],l=(0,aM.__read)((t||[s,u]).map((function(t){return l$(t,e)})),2),c=l[0],h=l[1];c>h&&(c=(n=(0,aM.__read)([h,c],2))[0],h=n[1]);var p=h-c;return p>o-i?[i,o]:c<i?s===i&&u===h?[i,h]:[i,p+i]:h>o?u===o&&s===c?[c,o]:[o-p,o]:[c,h]},e.prototype.calcMask=function(t){var e=(0,aM.__read)(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,u=i.height;return this.getOrientVal([{y:a,height:u,x:n*s+o,width:(r-n)*s},{x:o,width:s,y:n*u+a,height:(r-n)*u}])},e.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,o=e.height,a=(0,aM.__read)(this.clampValues(),2),s=a[0],u=a[1],l=("start"===t?s:u)*this.getOrientVal([i,o]);return{x:n+this.getOrientVal([l,i/2]),y:r+this.getOrientVal([o/2,l])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.orientation,i=n.formatter,o=n.autoFitLabel,a=Xq(this.attributes,"handle"),s=Xq(a,"label"),u=a.spacing,l=this.getHandleSize(),c=this.clampValues(),h=i("start"===t?c[0]:c[1]),p=new YH({style:(0,aM.__assign)((0,aM.__assign)((0,aM.__assign)({},s),this.inferTextStyle(t)),{text:h})}),f=p.getBBox(),d=f.width,m=f.height;if(p.destroy(),!o){var g=u+l+("horizontal"===r?d/2:0);return(e={text:h})["horizontal"===r?"x":"y"]="start"===t?-g:g,e}var y=0,v=0,_=this.availableSpace,b=_.width,x=_.height,w=this.calcMask(),S=w.x,E=w.y,M=w.width,T=w.height,A=u+l;if("horizontal"===r){var C=A+d/2;y="start"===t?S-A-d>0?-C:C:b-S-M-A>d?C:-C}else{var O=m+A;v="start"===t?E-l>m?-O:A:x-(E+T)-l>m?O:-A}return{x:y,y:v,text:h}},e.prototype.getHandleLabelStyle=function(t){if(!this.attributes.showLabel)return{};var e=Xq(this.attributes,"handleLabel");return(0,aM.__assign)((0,aM.__assign)((0,aM.__assign)({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=Xq(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return(0,aM.__assign)({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,r=e.orientation,i=this.calcHandlePosition(t),o=this.calcHandleText(t);return(0,aM.__assign)((0,aM.__assign)((0,aM.__assign)((0,aM.__assign)({},$q(this.getHandleIconStyle(),"icon")),$q((0,aM.__assign)((0,aM.__assign)({},this.getHandleLabelStyle(t)),o),"label")),i),{orientation:r,showLabel:n,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=(0,aM.__read)(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=(0,aM.__read)(this.getValues(),2),i=[r[0]+t,r[1]+e].sort();n?this.setValues(i):this.innerSetValues(i,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new gL(n,{detail:t}))}))},e.prototype.bindEvents=function(){var t=this.selectionShape;this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick");var e=this.trackShape;this.dispatchCustomEvent(e,"click","trackClick"),this.dispatchCustomEvent(e,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(e,"mouseleave","trackMouseleave"),e.on("mousedown",this.onDragStart("track")),e.on("touchstart",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(WH);function xK(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function wK(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=Iz,n=(e,n)=>Iz(t(e),n),r=(e,n)=>t(e)-n):(e=t===Iz||t===xK?t:SK,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function SK(){return 0}const EK=wK(Iz),MK=EK.right,TK=EK.left,AK=wK(Bz).center,CK=MK;function OK(t){return t.getBandWidth}function PK(t,e,n){if(!OK(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map((t=>t+a)),u=function(t,e,n){return Math.min(n,Math.max(0,t))}(TK(s,e)+o,0,i.length-1);return i[u]}function kK(t,e){if(!OK(t))return Rz(e);const{domain:n}=t.getOptions(),[r,i]=e,o=n.indexOf(r),a=n.indexOf(i);return n.slice(o,a+1)}function LK(t,e,n,r,i,o){const{x:a,y:s}=i,u=(t,e)=>{const[n,r]=o.invert(t);return[PK(a,n,e),PK(s,r,e)]},l=u([t,e],!0),c=u([n,r],!1);return[kK(a,[l[0],c[0]]),kK(s,[l[1],c[1]])]}const IK=t=>{const{orientation:e,labelFormatter:n,size:r,style:i,position:o}=t,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["orientation","labelFormatter","size","style","position"]);return({scales:[t],value:r,theme:o,coordinate:s})=>{var u;const{bbox:l}=r,{x:c,y:h,width:p,height:f}=l,{slider:d={}}=o,m=(null===(u=t.getFormatter)||void 0===u?void 0:u.call(t))||(t=>t.toString()),g="string"==typeof n?OX(n):n,y="horizontal"===e,v=UN(s)&&y;return new bK({className:"slider",style:Object.assign({},d,Object.assign(Object.assign({x:c,y:h,trackLength:y?p:f,orientation:e,formatter:e=>(g||m)(PK(t,v?1-e:e,!0))},i),a))})}};IK.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1};const RK=t=>IK(Object.assign(Object.assign({},t),{orientation:"horizontal"}));RK.props=Object.assign(Object.assign({},IK.props),{defaultPosition:"bottom"});const DK=t=>IK(Object.assign(Object.assign({},t),{orientation:"vertical"}));DK.props=Object.assign(Object.assign({},IK.props),{defaultPosition:"left"});var NK=function(t){function e(e){var n=t.call(this,e,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new gL("scroll",r)),n.dispatchEvent(new gL("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=(0,aM.__read)(n.getLocalPosition(),2),r=e[0],i=e[1],o=(0,aM.__read)(n.padding,4),a=o[0],s=o[3],u=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(P$(t))-u)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new gL("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new gL("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new gL("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new gL("trackMouseleave",{detail:t.detail}))},n}return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return ZY(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=(0,aM.__read)(this.range,2),n=e[0],r=e[1];return yA(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=(0,aM.__read)(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=(0,aM.__read)(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=(0,aM.__read)(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,o=e.slidable,a=Xq(this.attributes,"track"),s=Xq(this.attributes,"thumb"),u=(0,aM.__assign)((0,aM.__assign)({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:o,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},$q(a,"track")),$q(s,"selection"));this.slider=$H(t).maybeAppendByClassName("scrollbar",(function(){return new bK({style:u})})).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=(0,aM.__read)(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(yA(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(WH);const FK=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["orientation","labelFormatter","style"]);return({value:t,theme:n})=>{const{bbox:o}=t,{x:a,y:s,width:u,height:l}=o,{scrollbar:c={}}=n;return new NK({className:"scrollbar",style:Object.assign({},c,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:a,y:s,trackLength:"horizontal"===e?u:l}),i),{orientation:e,value:0,contentLength:1500,viewportLength:"horizontal"===e?u:l}))})}};FK.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1};const zK=t=>FK(Object.assign(Object.assign({},t),{orientation:"horizontal"}));zK.props=Object.assign(Object.assign({},FK.props),{defaultPosition:"bottom"});const BK=t=>FK(Object.assign(Object.assign({},t),{orientation:"vertical"}));BK.props=Object.assign(Object.assign({},FK.props),{defaultPosition:"left"});class jK{constructor(t){this.$value=t}static of(t){return new jK(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}function UK(t,e,n){return jK.of({}).call(ZK,t).call(ZK,e).call(ZK,n).value()}function ZK(t,e){for(const[n,r]of Object.entries(e))void 0!==r&&(t[n]=e[n]);return t}function VK(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}const GK=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"],HK=t=>(e,n,r,i,o)=>{const[a]=e,{height:s}=a.getBoundingClientRect(),{transform:u="",fillOpacity:l=1,strokeOpacity:c=1,opacity:h=1}=a.style,[p,f]=UN(i)?[[0,s],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],d=[{transform:`${u} ${f}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${u} ${f}`.trimStart(),fillOpacity:l,strokeOpacity:c,opacity:h,offset:.01},{transform:`${u} scale(1, 1)`.trimStart(),fillOpacity:l,strokeOpacity:c,opacity:h}];a.setOrigin(p);const m=a.animate(d,UK(o,r,t));return m.finished.then((()=>a.setOrigin(0,0))),m},WK=t=>(e,n,r,i,o)=>{const[a]=e,{height:s}=a.getBoundingClientRect(),{transform:u="",fillOpacity:l=1,strokeOpacity:c=1,opacity:h=1}=a.style,[p,f]=UN(i)?[[0,s],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],d=[{transform:`${u} scale(1, 1)`.trimStart()},{transform:`${u} ${f}`.trimStart(),fillOpacity:l,strokeOpacity:c,opacity:h,offset:.99},{transform:`${u} ${f}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];a.setOrigin(p);const m=a.animate(d,UK(o,r,t));return m.finished.then((()=>a.setOrigin(0,0))),m},qK=t=>(e,n,r,i,o)=>{const[a]=e,{height:s}=a.getBoundingClientRect(),{transform:u="",fillOpacity:l=1,strokeOpacity:c=1,opacity:h=1}=a.style,[p,f]=UN(i)?[[0,0],"scale(0.0001, 1)"]:[[0,s],"scale(1, 0.0001)"],d=[{transform:`${u} ${f}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${u} ${f}`.trimStart(),fillOpacity:l,strokeOpacity:c,opacity:h,offset:.01},{transform:`${u} scale(1, 1)`.trimStart(),fillOpacity:l,strokeOpacity:c,opacity:h}];a.setOrigin(p);const m=a.animate(d,UK(o,r,t));return m.finished.then((()=>a.setOrigin(0,0))),m},YK=t=>(e,n,r,i,o)=>{const[a]=e,{height:s}=a.getBoundingClientRect(),{transform:u="",fillOpacity:l=1,strokeOpacity:c=1,opacity:h=1}=a.style,[p,f]=UN(i)?[[0,0],"scale(0.0001, 1)"]:[[0,s],"scale(1, 0.0001)"],d=[{transform:`${u} scale(1, 1)`.trimStart()},{transform:`${u} ${f}`.trimStart(),fillOpacity:l,strokeOpacity:c,opacity:h,offset:.99},{transform:`${u} ${f}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];a.setOrigin(p);const m=a.animate(d,UK(o,r,t));return m.finished.then((()=>a.setOrigin(0,0))),m},XK=t=>(e,n,r,i,o)=>{const[a]=e,{fillOpacity:s=1,strokeOpacity:u=1,opacity:l=1}=a.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:s,strokeOpacity:u,opacity:l}];return a.animate(c,UK(o,r,t))};XK.props={};const $K=t=>(e,n,r,i,o)=>{const[a]=e,{fillOpacity:s=1,strokeOpacity:u=1,opacity:l=1}=a.style,c=[{fillOpacity:s,strokeOpacity:u,opacity:l},{fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(c,UK(o,r,t))};function KK(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function JK(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function QK(t,e){const[n,r,i,o]=KK(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),u=[],l=o/Math.ceil(e/s);let c=0,h=e;for(;h>0;){const t=Math.min(h,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,o=r+c*l;u.push(JK([t,o,e,l]))}h-=t,c+=1}return u}function tJ(t,e){t.__data__=e.__data__,t.className=e.className,e.parentNode.replaceChild(t,e)}function eJ(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function nJ(t){const e=DP(t);if(e&&!function(t){return!eJ(t,"m")||!eJ(t,"M")}(e))return e}function rJ(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=nJ(e),s=nJ(n);if(i===o&&"path"!==i||void 0===a||void 0===s)return function(t,e,n){const[r,i,o,a]=KK(t),{transform:s}=t.style,{transform:u}=e.style;tJ(e,t);const[l,c,h,p]=KK(e),f=r-l,d=i-c,m=o/h,g=a/p,y=[Object.assign({transform:`${s?s+" ":""}translate(${f}, ${d}) scale(${m}, ${g})`},VK(t,GK)),Object.assign({transform:(u?u+" ":"")+"translate(0, 0) scale(1, 1)"},VK(e,GK))];return e.animate(y,n)}(e,n,r);const u=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new sI({style:Object.assign(Object.assign({},VK(t,GK)),{d:e})});return tJ(r,t),r}(t,a),l=[Object.assign({path:a},VK(e,GK)),Object.assign({path:s},VK(n,GK))],c=u.animate(l,r);return c.onfinish=()=>{zF(u,n)},u.style.transform="scale(1, 1)",u.style.transform="none",c}$K.props={};const iJ=t=>(e,n,r,i,o)=>{const a=function(t="pack"){return"function"==typeof t?t:QK}(t.split),s=UK(o,r,t),{length:u}=e,{length:l}=n;if(1===u&&1===l||u>1&&l>1){const[t]=e,[r]=n;return rJ(t,t,r,s)}if(1===u&&l>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>rJ(e,new sI({style:Object.assign({path:i[r]},VK(t,GK))}),e,n)))}(t,n,s,a)}if(u>1&&1===l){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,u=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(u,n);return[...t.map(((t,r)=>rJ(t,t,new sI({style:{path:i[r],fill:e.style.fill}}),n))),l]}(e,t,s,a)}return null};iJ.props={};const oJ=t=>{const e=1e-4;return n={name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:HO.NUMBER},r=n.name,i=n.inherits,o=n.interpolable,a=n.initialValue,s=n.syntax,FL.styleValueRegistry.registerMetadata({n:r,inh:i,int:o,d:a,syntax:s}),(n,r,i,o,a)=>{const[s]=n;if(!ZN(o))return HK(t)(n,r,i,o,a);const u=o.getCenter(),{__data__:l,style:c}=s,{radius:h=0,inset:p=0,fillOpacity:f=1,strokeOpacity:d=1,opacity:m=1}=c,{points:g,y,y1:v}=l,_=qV().cornerRadius(h).padAngle(p*Math.PI/180),b=HZ(o,g,[y,v]),{startAngle:x,endAngle:w}=b,S=new sI({}),E=t=>{S.attr({d:_(t),transform:`translate(${u[0]}, ${u[1]})`});const e=DP(S);return S.style.transform="",e},M=[{waveInArcAngle:x+e,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+e,fillOpacity:f,strokeOpacity:d,opacity:m,offset:.01},{waveInArcAngle:w,fillOpacity:f,strokeOpacity:d,opacity:m}],T=s.animate(M,UK(a,i,t));return T.onframe=function(){s.style.path=E(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},T.onfinish=function(){s.style.path=E(Object.assign(Object.assign({},b),{endAngle:w}))},T};var n,r,i,o,a,s};oJ.props={};const aJ=t=>(e,n,r,i,o)=>{const[a]=e,{transform:s="",fillOpacity:u=1,strokeOpacity:l=1,opacity:c=1}=a.style,h=[{transform:`${s} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${s} scale(0.0001)`.trimStart(),fillOpacity:u,strokeOpacity:l,opacity:c,offset:.01},{transform:`${s} scale(1)`.trimStart(),fillOpacity:u,strokeOpacity:l,opacity:c}],{width:p,height:f}=a.getBoundingClientRect();a.setOrigin([p/2,f/2]);const d=a.animate(h,UK(o,r,t));return d.finished.then((()=>a.setOrigin(0,0))),d},sJ=t=>(e,n,r,i,o)=>{const[a]=e,{transform:s="",fillOpacity:u=1,strokeOpacity:l=1,opacity:c=1}=a.style,h=[{transform:`${s} scale(1)`.trimStart()},{transform:`${s} scale(0.0001)`.trimStart(),fillOpacity:u,strokeOpacity:l,opacity:c,offset:.99},{transform:`${s} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:p,height:f}=a.getBoundingClientRect();a.setOrigin([p/2,f/2]);const d=a.animate(h,UK(o,r,t));return d.finished.then((()=>a.setOrigin(0,0))),d},uJ=t=>(e,n,r,i,o)=>{var a,s;const[u]=e,l=(null===(s=(a=u).getTotalLength)||void 0===s?void 0:s.call(a))||0,c=[{lineDash:[0,l]},{lineDash:[l,0]}];return u.animate(c,UK(o,r,t))};uJ.props={};const lJ=t=>(e,n,r,i,o)=>{const[a]=e,{height:s,width:u}=a.getBoundingClientRect(),l=new sI({style:{path:`M0,0L${u},0L${u},${s}L0,${s}Z`}});a.appendChild(l),a.style.clipPath=l;const c=HK(t)([l],n,r,i,o);return c.finished.then((()=>{l.remove(),a.style.clipPath=null})),c};lJ.props={};const cJ=t=>(e,n,r,i,o)=>{const[a]=e,{height:s,width:u}=a.getBoundingClientRect(),l=new sI({style:{path:`M0,0L${u},0L${u},${s}L0,${s}Z`}});a.appendChild(l),a.style.clipPath=l;const c=qK(t)([l],n,r,i,o);return c.finished.then((()=>{l.remove(),a.style.clipPath=null})),c};cJ.props={};const hJ={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function pJ(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:hJ[e]}function fJ(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>fJ(t,e,n,r)))}function dJ(t){fJ(t,"visibility","hidden",!0)}function mJ(t){fJ(t,"visibility","visible",!0)}var gJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function yJ(t){return $Z(t).selectAll(`.${FR}`).nodes().filter((t=>!t.__removed__))}function vJ(t,e){return _J(t,e).flatMap((({container:t})=>yJ(t)))}function _J(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function bJ(t){return $Z(t).select(`.${BR}`).node()}function xJ(t,e){const{offsetX:n,offsetY:r}=e,i=t.getRenderBounds(),{min:[o,a],max:[s,u]}=i;return n<o||n>s||r<a||r>u?null:[n-o,r-a]}function wJ(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function SJ(t){return t=>t.__data__.color}function EJ(t){const{x:e}=t.scale;return t=>{const{x:n}=t.__data__;return e.invert(n)}}function MJ(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[AJ(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(AJ(i,r))[e]}}function TJ(t,e=((t,e)=>t),n=((t,e,n)=>t.setAttribute(e,n))){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,u=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(u).length){for(const[t,r]of Object.entries(u)){const i=pJ(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function AJ(t,e){return`${t},${e}`}function CJ(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[AJ(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=AJ(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t}),{})}return r}function OJ(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function PJ(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=gJ(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const o=t=>t.__data__.points,a=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=Rz(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=BV(),u=r[t-1],l=r[t],[c,h,p,f]=a(o(u),o(l));s.moveTo(...c),s.lineTo(...h),s.lineTo(...p),s.lineTo(...f),s.closePath();const d=OZ(i,(t=>n(t,u))),{fill:m=u.getAttribute("fill")}=d,g=gJ(d,["fill"]),y=new sI({className:"element-link",style:Object.assign({d:s.toString(),fill:m,zIndex:-2},g)});null===(e=u.link)||void 0===e||e.remove(),u.parentNode.appendChild(y),u.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function kJ(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(ZN(n)){const{points:i}=t.__data__,[o,a]=UN(n)?GZ(i):i,s=n.getCenter(),u=RZ(o,s),l=RZ(a,s),c=NZ(u)+zZ(u,l)/2;return r(`translate(${e*Math.cos(c)}, ${e*Math.sin(c)})`)}return UN(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function LJ(t){var{background:e,scale:n,coordinate:r,valueof:i}=t,o=gJ(t,["background","scale","coordinate","valueof"]);const a="element-background";if(!e)return[()=>{},()=>{}];const s=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},u=(t,e)=>{const{padding:i}=e,[o,a]=((t,e)=>{const{x:r}=n;if(!OK(r))return[0,1];const{__data__:i}=t,{x:o}=i,[a,u]=s(r,o,e);return[a,u]})(t,i),[u,l]=((t,e)=>{const{y:r}=n;if(!OK(r))return[0,1];const{__data__:i}=t,{y:o}=i,[a,u]=s(r,o,e);return[a,u]})(t,i),c=[[o,u],[a,u],[a,l],[o,l]].map((t=>r.map(t))),{__data__:h}=t,{y:p,y1:f}=h;return XV(c,{y:p,y1:f},r,e)},l=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=gJ(e,["transform","transformOrigin","stroke"]),a=Object.assign({transform:n,transformOrigin:r,stroke:i},o),s=t.cloneNode(!0);for(const[t,e]of Object.entries(a))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=OZ(o,(e=>i(e,t))),{fill:r="#CCD6EC",fillOpacity:s=.3,zIndex:c=-2,padding:h=.001,strokeWidth:p=0}=e,f=gJ(e,["fill","fillOpacity","zIndex","padding","strokeWidth"]),d=Object.assign(Object.assign({},f),{fill:r,fillOpacity:s,zIndex:c,padding:h,strokeWidth:p}),m=(()=>{const{x:t,y:e}=n;return[t,e].some(OK)})()?u:l,g=m(t,d);g.className=a,t.parentNode.appendChild(g),t.background=g},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===a]}function IJ(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(n.style.cursor=e)}function RJ(t){IJ(t,"default")}var DJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function NJ(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=DJ(t,["delay","createGroup","background","link"]);return t=>{const{container:a,view:s,options:u}=t,{scale:l,coordinate:c}=s;return function(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:u,state:l={}}){var c;const h=e(t),p=new Set(h),f=FN(h,r),d=OJ(h,n),[m,g]=PJ(Object.assign({elements:h,valueof:d,link:i,coordinate:u},UF(l.active,"link"))),[y,v,_]=LJ(Object.assign({scale:s,coordinate:u,background:o,valueof:d},UF(l.active,"background"))),b=VD(l,{active:Object.assign({},(null===(c=l.active)||void 0===c?void 0:c.offset)&&{transform:(...t)=>{const e=l.active.offset(...t),[,n]=t;return kJ(h[n],e,u)}})}),{setState:x,removeState:w,hasState:S}=TJ(b,d);let E;const M=t=>{const{target:e}=t;if(!p.has(e))return;E&&clearTimeout(E);const n=r(e),i=f.get(n),o=new Set(i);for(const t of h)o.has(t)?S(t,"active")||x(t,"active"):(x(t,"inactive"),g(t)),t!==e&&v(t);y(e),m(i)},T=()=>{for(const t of h)w(t,"active","inactive"),v(t),g(t)},A=t=>{const{target:e}=t;o&&!_(e)||(o||p.has(e))&&(a>0?(E&&clearTimeout(E),E=setTimeout((()=>{T(),E=null}),a)):T())},C=()=>{T()};return t.addEventListener("pointerover",M),t.addEventListener("pointerout",A),t.addEventListener("pointerleave",C),()=>{t.removeEventListener("pointerover",M),t.removeEventListener("pointerout",A),t.removeEventListener("pointerleave",C);for(const t of h)v(t),g(t)}}(bJ(a),Object.assign({elements:yJ,datum:MJ(s),groupKey:n?n(s):void 0,coordinate:c,scale:l,state:CJ(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e},o))}}function FJ(t){return NJ(Object.assign(Object.assign({},t),{createGroup:EJ}))}function zJ(t){return NJ(Object.assign(Object.assign({},t),{createGroup:SJ}))}var BJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function jJ(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=BJ(t,["createGroup","background","link"]);return t=>{const{container:o,view:a,options:s}=t,{coordinate:u,scale:l}=a;return function(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:u,state:l={}}){var c;const h=e(t),p=new Set(h),f=FN(h,r),d=OJ(h,n),[m,g]=PJ(Object.assign({link:i,elements:h,valueof:d,coordinate:a},UF(l.selected,"link"))),[y,v]=LJ(Object.assign({background:s,coordinate:a,scale:u,valueof:d},UF(l.selected,"background"))),_=VD(l,{selected:Object.assign({},(null===(c=l.selected)||void 0===c?void 0:c.offset)&&{transform:(...t)=>{const e=l.selected.offset(...t),[,n]=t;return kJ(h[n],e,a)}})}),{setState:b,removeState:x,hasState:w}=TJ(_,d),S=()=>{for(const t of h)x(t,"selected","unselected"),g(t),v(t)},E=t=>{const{target:e}=t;return p.has(e)?o?(t=>{if(w(t,"selected"))S();else{const e=r(t),n=f.get(e),i=new Set(n);for(const e of h)i.has(e)?b(e,"selected"):(b(e,"unselected"),g(e)),e!==t&&v(e);m(n),y(t)}})(e):(t=>{const e=r(t),n=f.get(e),o=new Set(n);if(w(t,"selected")){if(!h.some((t=>!o.has(t)&&w(t,"selected"))))return S();for(const t of n)b(t,"unselected"),g(t),v(t)}else{const e=n.some((t=>w(t,"selected")));for(const t of h)o.has(t)?b(t,"selected"):w(t,"selected")||b(t,"unselected");!e&&i&&m(n),y(t)}})(e):S()};return t.addEventListener("click",E),()=>{t.removeEventListener("click",E);for(const t of h)g(t)}}(bJ(o),Object.assign({elements:yJ,datum:MJ(a),groupKey:e?e(a):void 0,coordinate:u,scale:l,state:CJ(s,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r},i))}}function UJ(t){return jJ(Object.assign(Object.assign({},t),{createGroup:EJ}))}function ZJ(t){return jJ(Object.assign(Object.assign({},t),{createGroup:SJ}))}const VJ=function(t,e,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var c=e-(l-s);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l};var GJ=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))},HJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function WJ(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=HJ(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:a,view:s,container:u,update:l}=t,{markState:c,scale:h,coordinate:p}=s,f=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>"line"===t.type)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(c,0,["x","y","series"]);if(!f)return;const{y:d,x:m,series:g=[]}=f,y=d.map(((t,e)=>e)),v=Rz(y.map((t=>m[t]))),_=VD({},a),b=_.marks.find((t=>"line"===t.type)),x=up(zN(y,(t=>up(t,(t=>+d[t]))/sp(t,(t=>+d[t]))),(t=>g[t])).values());VD(b,{scale:{y:{domain:[1/x,x]}}});const w=bJ(u),S=u.getElementsByClassName(FR),E=FN(u.getElementsByClassName(UR),(t=>t.__data__.key.split("-")[0])),M=new aI({style:Object.assign({x1:0,y1:0,x2:0,y2:w.getAttribute("height"),stroke:"black",lineWidth:1},UF(o,"rule"))}),T=new hI({style:Object.assign({x:0,y:w.getAttribute("height"),text:"",fontSize:10},UF(o,"label"))});M.append(T),w.appendChild(M);const A=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[AK(v,i)]},C=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),T.setAttribute("text",i(e))};let O;const P=VJ((t=>{const e=xJ(w,t);e&&(t=>{const{scale:e,coordinate:n}=O,{x:r,y:i}=e,o=A(n,r,t);C(t,o);for(const t of S){const{seriesIndex:e,key:r}=t.__data__,a=e[wK((t=>m[+t])).center(e,o)],s=[0,i.map(1)],u=[0,i.map(d[a]/d[e[0]])],[,l]=n.map(s),[,c]=n.map(u),h=l-c;t.setAttribute("transform",`translate(0, ${h})`);const p=E.get(r)||[];for(const t of p)t.setAttribute("dy",h)}})(e)}),e,{leading:n,trailing:r});return(t=>{GJ(this,void 0,void 0,(function*(){const{x:e}=h,n=A(p,e,t);C(t,n);const r=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(b);r.groupBy="color",r.basis=(t,e)=>e[t[wK((t=>m[+t])).center(t,n)]];for(const t of _.marks)t.animate=!1;const i=yield l(_);O=i.view}))})([0,0]),w.addEventListener("pointerenter",P),w.addEventListener("pointermove",P),w.addEventListener("pointerleave",P),()=>{M.remove(),w.removeEventListener("pointerenter",P),w.removeEventListener("pointermove",P),w.removeEventListener("pointerleave",P)}}}function qJ({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,container:a}=r,s=bJ(a),u=VD({},i);for(const t of u.marks)t.animate=!1;const l=VJ((t=>{const e=xJ(s,t);if(!e)return void o(i);const[n,r]=e,a=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(u);a.focusX=n,a.focusY=r,a.visual=!0,o(u)}),t,{leading:e,trailing:n});return s.addEventListener("pointerenter",l),s.addEventListener("pointermove",l),s.addEventListener("pointerleave",l),()=>{s.removeEventListener("pointerenter",l),s.removeEventListener("pointermove",l),s.removeEventListener("pointerleave",l)}}}function YJ(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}var XJ=s(5483);function $J(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var KJ={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function JJ(t){var e;void 0===t&&(t="");var n=$J(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=(0,aM.__assign)({flex:1},KJ),e[".".concat(n.VALUE)]=(0,aM.__assign)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},KJ),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var QJ=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=$J(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:JJ(o)})||this).prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}var n,r;return(0,aM.__extends)(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"position",{set:function(t){var e=(0,aM.__read)(t,2),n=e[0],r=e[1];this.attributes.x=n,this.attributes.y=r,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r,i,o=t.name,a=void 0===o?"":o,s=t.color,u=void 0===s?"black":s,l=t.index,c=(0,aM.__rest)(t,["name","color","index"]),h=(0,aM.__assign)({name:a,color:u,index:null!=l?l:e},c);return(0,XJ.Z)((r=n.item,i=h,r&&i?r.replace(/\\?\{([^{}]+)\}/g,(function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===i[e]?"":i[e]})):r))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=this.element.style.transition;this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout((function(){n.element.style.transition=r}),10)}this.element.style.visibility="visible"},e.prototype.hide=function(){this.element.style.visibility="hidden"},e.prototype.initShape=function(){var t=this.attributes.template;this.element=(0,XJ.Z)(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,u=$J(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(u.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(u.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var c=this.HTMLTooltipItemsElements,h=document.createElement("ul");h.className=u.LIST,h.replaceChildren.apply(h,(0,aM.__spreadArray)([],(0,aM.__read)(c),!1));var p=this.element.querySelector(".".concat(u.LIST));p?p.replaceWith(h):l.appendChild(h)}!function(t,e){Object.entries(e).forEach((function(e){var n=(0,aM.__read)(e,2),r=n[0],i=n[1];(0,aM.__spreadArray)([t],(0,aM.__read)(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,u=a.height,l=[-s/2,-u/2];return i.forEach((function(t){var e=(0,aM.__read)(l,2),n=e[0],i=e[1],a=(0,aM.__read)(o[t],2),c=a[0],h=a[1];l=[n+(s/2+r[0])*c,i+(u/2+r[1])*h]})),l},e.prototype.setOffsetPosition=function(t){var e=(0,aM.__read)(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,u=void 0===s?0:s,l=i.container,c=l.x,h=l.y;this.element.style.left="".concat(+a+c+n,"px"),this.element.style.top="".concat(+u+h+r,"px")},e.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},e.prototype.autoPosition=function(t){var e=(0,aM.__read)(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,u=i.position;if(!s)return[n,r];var l=this.element,c=l.offsetWidth,h=l.offsetHeight,p=(0,aM.__read)([+o+n,+a+r],2),f=p[0],d=p[1],m={left:"right",right:"left",top:"bottom",bottom:"top"},g=s.x,y=s.y,v={left:f<g,right:f+c>g+s.width,top:d<y,bottom:d+h>y+s.height},_=[];u.split("-").forEach((function(t){v[t]?_.push(m[t]):_.push(t)}));var b=_.join("-");return this.getRelativeOffsetFromCursor(b)},e.tag="tooltip",(0,aM.__decorate)([(n=100,r=!0,void 0===n&&(n=0),void 0===r&&(r=!1),function(t,e,i){var o,a=i.value;"function"==typeof a&&(i.value=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!o){var i=this;r&&a.apply(i,t),o=window.setTimeout((function(){a.apply(i,t),o=null}),n)}})})],e.prototype,"updatePosition",null),e}(WH);const tQ=new Proxy({BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},{get(t,e){if(e in t)return t[e]},set:()=>!0});function eQ(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function nQ(t,e,n,r=(t=>!0)){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a,markType:s}=o;if("plot"!==a)if("element"===a){const r=Object.assign(Object.assign({},i),{nativeEvent:!0,data:{data:eQ(o,e)}});n.emit(`element:${t}`,r),n.emit(`${s}:${t}`,r)}else n.emit(`${a}:${t}`,i)}}function rQ(){return(t,e,n)=>{const{container:r,view:i}=t,o=nQ(tQ.CLICK,i,n,(t=>1===t.detail)),a=nQ(tQ.DBLCLICK,i,n,(t=>2===t.detail)),s=nQ(tQ.POINTER_TAP,i,n),u=nQ(tQ.POINTER_DOWN,i,n),l=nQ(tQ.POINTER_UP,i,n),c=nQ(tQ.POINTER_OVER,i,n),h=nQ(tQ.POINTER_OUT,i,n),p=nQ(tQ.POINTER_MOVE,i,n),f=nQ(tQ.POINTER_ENTER,i,n),d=nQ(tQ.POINTER_LEAVE,i,n),m=nQ(tQ.POINTER_UPOUTSIDE,i,n),g=nQ(tQ.DRAG_START,i,n),y=nQ(tQ.DRAG,i,n),v=nQ(tQ.DRAG_END,i,n),_=nQ(tQ.DRAG_ENTER,i,n),b=nQ(tQ.DRAG_LEAVE,i,n),x=nQ(tQ.DRAG_OVER,i,n),w=nQ(tQ.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",u),r.addEventListener("pointerup",l),r.addEventListener("pointerover",c),r.addEventListener("pointerout",h),r.addEventListener("pointermove",p),r.addEventListener("pointerenter",f),r.addEventListener("pointerleave",d),r.addEventListener("pointerupoutside",m),r.addEventListener("dragstart",g),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",_),r.addEventListener("dragleave",b),r.addEventListener("dragover",x),r.addEventListener("drop",w),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",u),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",c),r.removeEventListener("pointerout",h),r.removeEventListener("pointermove",p),r.removeEventListener("pointerenter",f),r.removeEventListener("pointerleave",d),r.removeEventListener("pointerupoutside",m),r.removeEventListener("dragstart",g),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",_),r.removeEventListener("dragleave",b),r.removeEventListener("dragover",x),r.removeEventListener("drop",w)}}}var iQ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function oQ(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}function aQ(t,e,n,r,i,o,a){const s=new QJ({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:{".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}});return t.appendChild(s.HTMLTooltipElement),s}function sQ({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:u=!1,mount:l,bounding:c}){const h=t.getRootNode().defaultView.getConfig().container,p=a?oQ(t,l):t,f=c||function(t){const e=t.getBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),d=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(h,p),{tooltipElement:m=aQ(p,n,r,s,u,f,d)}=p,{items:g,title:y=""}=e;m.update(Object.assign({x:n,y:r,data:g,title:y,position:s,enterable:u},void 0!==i&&{content:i(o,{items:g,title:y})})),p.tooltipElement=m}function uQ({root:t,single:e,emitter:n,nativeEvent:r=!0,mount:i}){const o=e?oQ(t,i):t,{tooltipElement:a}=o;a&&(a.hide(),r&&n.emit("tooltip:hide",{nativeEvent:r}))}function lQ(t){const{tooltipElement:e}=t;e&&(e.destroy(),t.tooltipElement=void 0)}function cQ(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function hQ(t,e){const{color:n,series:r}=t,{color:i,series:o}=e,a=t=>t&&t.invert&&!(t instanceof WU)&&!(t instanceof DU);if(a(r))return r.invert(o);if(o&&o!==i)return o;if(a(n)){const t=n.invert(i);return Array.isArray(t)?null:t}return null}function pQ(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function fQ(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function dQ(t,e,n,r=t.map((t=>t.__data__))){const i=t=>t instanceof Date?+t:t,o=fQ(r.map((t=>t.title)),i).filter(BF),a=r.flatMap(((r,i)=>{const o=t[i],{items:a=[],title:s}=r,u=a.filter(BF),l=void 0!==n?n:a.length<=1;return u.map((t=>{var{color:n=pQ(o),name:i}=t,a=iQ(t,["color","name"]);const u=l?hQ(e,r)||i:i||hQ(e,r);return Object.assign(Object.assign({},a),{color:n,name:u||s})}))})).map(cQ);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:fQ(a,(t=>`(${i(t.name)}, ${i(t.value)}, ${i(t.color)})`))})}function mQ(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function gQ(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function yQ(t,e){return void 0===t?e:t}function vQ(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function _Q(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:u,groupName:l,emitter:c,wait:h=50,leading:p=!0,trailing:f=!1,startX:d=0,startY:m=0,body:g=!0,single:y=!0,position:v,enterable:_,mount:b,bounding:x,style:w={}}=e,S=iQ(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","style"]);const E=n(t),M=UN(a),T=ZN(a),A=VD(w,S),{innerWidth:C,innerHeight:O}=a.getOptions(),P=[],k=[];for(const t of E){const{__data__:e}=t,{seriesX:n}=e;n?P.push(t):k.push(t)}P.sort(((t,e)=>{const n=M?0:1,r=t=>t.getBounds().min[n];return M?r(e)-r(t):r(t)-r(e)}));const L=new Map(P.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Rz(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),I=UF(A,"crosshairs"),{x:R}=o,D=(null==R?void 0:R.getBandWidth)?R.getBandWidth()/2:0,N=t=>{const[e]=a.invert(t);return e-D},F=(t,e,n)=>{const r=N(t),[i,o]=Rz([n[0],n[n.length-1]]);if(r<i||r>o)return null;return e[(0,wK((t=>n[+t])).center)(e,r)]},z=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[IF(t.replace("series","")),r]})))},B=VJ((e=>{const n=xJ(t,e);if(!n)return;const h=t.getRenderBounds(),p=h.min[0],f=h.min[1],w=[n[0]-d,n[1]-m];if(!w)return;const S=((t,e)=>{const n=M?1:0,r=t[n];return e.filter((t=>{const[e,i]=(t=>{const{min:e,max:r}=t.getLocalBounds();return Rz([e[n],r[n]])})(t);return r>=e&&r<=i}))})(w,k),E=[],A=[];for(const t of P){const[e,n]=L.get(t),r=F(w,e,n);if(null!==r){E.push(t);const e=z(t,r),{x:n,y:i}=e,o=a.map([(n||0)+D,i||0]);A.push([e,o])}}const R=Array.from(new Set(A.map((t=>t[0].x)))),B=R[Lz(R,(t=>Math.abs(t-N(w))))],U=A.filter((t=>t[0].x===B)),Z=[...U.map((t=>t[0])),...S.map((t=>t.__data__))],V=[...E,...S],G=dQ(V,o,l,Z);if(r&&G.items.sort(((t,e)=>r(t)-r(e))),i&&(G.items=G.items.filter(i)),0===V.length||vQ(G))j();else{if(g&&sQ({root:t,data:G,x:n[0]+p,y:n[1]+f,render:u,event:e,single:y,position:v,enterable:_,mount:b,bounding:x}),s){const e=U.map((t=>t[1]));!function(t,e,n){var{height:r,width:i,startX:o,startY:a,transposed:s,polar:u}=n,l=iQ(n,["height","width","startX","startY","transposed","polar"]);const c=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},l),h=e.map((t=>t[1])),p=e.map((t=>t[0])),f=YJ(h),d=YJ(p),[m,g,y,v]=(()=>{if(u){const t=o+i/2,e=a+r/2,n=Math.min(i,r)/2,s=NZ(RZ([d,f],[t,e]));return[t,t+n*Math.cos(s),e,e+n*Math.sin(s)]}return s?[o,o+i,f+a,f+a]:[d+o,d+o,a,a+r]})(),_=t.ruleY||(()=>{const e=new aI({style:Object.assign({x1:m,x2:g,y1:y,y2:v},c)});return t.appendChild(e),e})();_.style.x1=m,_.style.x2=g,_.style.y1=y,_.style.y2=v,t.ruleY=_}(t,e,Object.assign(Object.assign({},I),{width:C,height:O,startX:d,startY:m,transposed:M,polar:T}))}c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:PK(o.x,N(w),!0)}}}))}}),h,{leading:p,trailing:f}),j=()=>{uQ({root:t,single:y,emitter:c,mount:b}),s&&mQ(t)},U=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=o,s=i.map(r),[u,l]=a.map([s,.5]),{min:[c,h]}=t.getRenderBounds();B({offsetX:u+c,offsetY:l+h})},Z=()=>{uQ({root:t,single:y,emitter:c,nativeEvent:!1,mount:b})};return c.on("tooltip:show",U),c.on("tooltip:hide",Z),t.addEventListener("pointerenter",B),t.addEventListener("pointermove",B),t.addEventListener("pointerleave",j),()=>{t.removeEventListener("pointerenter",B),t.removeEventListener("pointermove",B),t.removeEventListener("pointerleave",j),c.off("tooltip:show",U),c.off("tooltip:hide",Z),lQ(t),s&&mQ(t)}}function bQ(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=iQ(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,u)=>{const{container:l,view:c}=t,{scale:h,markState:p,coordinate:f}=c,d=gQ(p,"seriesTooltip"),m=gQ(p,"crosshairs"),g=bJ(l),y=yQ(r,d);if(y&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!a)return _Q(g,Object.assign(Object.assign({},s),{elements:yJ,scale:h,coordinate:f,crosshairs:yQ(n,m),item:o,emitter:u}));if(y&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=vJ(t,i),a=e[0].view.scale,l=g.getBounds(),c=l.min[0],h=l.min[1];return _Q(g.parentNode.parentNode,Object.assign(Object.assign({},s),{elements:()=>r,scale:a,coordinate:f,crosshairs:yQ(n,m),item:o,startX:c,startY:h,emitter:u}))}return function(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:u=50,leading:l=!0,trailing:c=!1,groupKey:h=(t=>t),single:p=!0,position:f,enterable:d,datum:m,view:g,mount:y,bounding:v}){const _=e(t),b=new Set(_),x=FN(_,h),w=VJ((e=>{const{target:u}=e;if(!b.has(u))return void uQ({root:t,single:p,emitter:s,mount:y});const l=h(u),c=x.get(l),m=1===c.length?function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(BF).map((e=>{var{color:n=pQ(t)}=e,r=iQ(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(cQ);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(c[0]):dQ(c,n,i);if(o&&m.items.sort(((t,e)=>o(t)-o(e))),a&&(m.items=m.items.filter(a)),vQ(m))return void uQ({root:t,single:p,emitter:s,mount:y});const{offsetX:_,offsetY:w}=e;sQ({root:t,data:m,x:_,y:w,render:r,event:e,single:p,position:f,enterable:d,mount:y,bounding:v}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:eQ(u,g)}}))}),u,{leading:l,trailing:c}),S=e=>{const{target:n}=e;b.has(n)&&uQ({root:t,single:p,emitter:s,mount:y})},E=({nativeEvent:t,data:e})=>{if(t)return;const n=_.find((t=>Object.entries(e.data).every((([e,n])=>m(t)[e]===n))));if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;w({target:n,offsetX:i+a/2,offsetY:o+s/2})},M=({nativeEvent:e}={})=>{e||uQ({root:t,single:p,emitter:s,nativeEvent:!1,mount:y})};return s.on("tooltip:show",E),s.on("tooltip:hide",M),t.addEventListener("pointerover",w),t.addEventListener("pointermove",w),t.addEventListener("pointerout",S),()=>{t.removeEventListener("pointerover",w),t.removeEventListener("pointermove",w),t.removeEventListener("pointerout",S),s.off("tooltip:show",E),s.off("tooltip:hide",M),lQ(t)}}(g,Object.assign(Object.assign({},s),{datum:MJ(c),elements:yJ,scale:h,coordinate:f,groupKey:e?EJ(c):void 0,item:o,emitter:u,view:c}))}}var xQ=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const wQ="legend-category",SQ="items-item",EQ="legend-category-item-marker",MQ="legend-category-item-label";function TQ(t){return t.getElementsByClassName(EQ)[0]}function AQ(t){return t.getElementsByClassName(MQ)[0]}function CQ(t){return t.getElementsByClassName(SQ)}function OQ(t){return t.getElementsByClassName(wQ)}function PQ(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function kQ(){return(t,e,n)=>{const{container:r,view:i,options:o,update:a}=t,s=OQ(r),u=(t,e)=>xQ(this,void 0,void 0,(function*(){const{scale:n}=i,{[t]:r}=n,{marks:s}=o,u=s.map((n=>{const{transform:i=[]}=n,o=[{type:"filter",[t]:e},...i];return VD({},n,{transform:o,scale:{[t]:{domain:r.getOptions().domain}}})})),l=Object.assign(Object.assign({},o),{marks:u});return a(l)}));if(!s.length){const t=t=>{const{values:e,channel:n}=t;u(n,e)};return n.on("legend:filter",t),()=>{n.off("legend:filter",t)}}const l=s.map((t=>{const{name:e,domain:n}=PQ(t).scales[0];return function(t,{legends:e,marker:n,label:r,datum:i,filter:o,state:a={}}){const s=new Map,u=new Map,l=new Map,{unselected:c={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=a,h={unselected:UF(c,"marker")},p={unselected:UF(c,"label")},{setState:f,removeState:d}=TJ(h,void 0),{setState:m,removeState:g}=TJ(p,void 0),y=Array.from(e(t)),v=y.map(i),_=()=>{for(const t of y){const e=i(t),o=n(t),a=r(t);v.includes(e)?(d(o,"unselected"),g(a,"unselected")):(f(o,"unselected"),m(a,"unselected"))}};for(const e of y){const n=()=>{IJ(t,"pointer")},r=()=>{RJ(t)},a=()=>xQ(this,void 0,void 0,(function*(){const t=i(e),n=v.indexOf(t);-1===n?v.push(t):v.splice(n,1),0===v.length&&v.push(...y.map(i)),yield o(v),_()}));e.addEventListener("click",a),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),s.set(e,a),u.set(e,n),l.set(e,r)}return()=>{for(const t of y)t.removeEventListener("click",s.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",l.get(t))}}(r,{legends:CQ,marker:TQ,label:AQ,datum:t=>{const{__data__:e}=t,{index:r}=e;return n[r]},filter:t=>u(e,t),state:t.attributes.state})}));return()=>{l.forEach((t=>t()))}}}function LQ(){return t=>{const{container:e,view:n,options:r}=t,i=OQ(e),o=yJ(e),a=t=>PQ(t).scales[0].name,s=t=>{const{scale:{[t]:e}}=n;return e},u=CJ(r,["active","inactive"]),l=OJ(o,MJ(n));for(const t of i){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},n=a(t),r=CQ(t),i=s(n),c=FN(o,(t=>i.invert(t.__data__[n]))),{state:h={}}=t.attributes,{inactive:p={}}=h,{setState:f,removeState:d}=TJ(u,l),m={inactive:UF(p,"marker")},g={inactive:UF(p,"label")},{setState:y,removeState:v}=TJ(m),{setState:_,removeState:b}=TJ(g),x=t=>{for(const e of r){const n=TQ(e),r=AQ(e);e===t||null===t?(v(n,"inactive"),b(r,"inactive")):(y(n,"inactive"),_(r,"inactive"))}},w=new Map;for(const t of r){const n=()=>{const n=e(t),r=new Set(c.get(n));for(const t of o)r.has(t)?f(t,"active"):f(t,"inactive");x(t)};t.addEventListener("pointerover",n),w.set(t,n)}const S=()=>{for(const t of o)d(t,"inactive","active");x(null)};return t.addEventListener("pointerleave",S),()=>{t.removeEventListener(S);for(const[t,e]of w)t.removeEventListener(e)}}}}var IQ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function RQ(t,e){const[n,r,i,o]=t,[a,s,u,l]=e;return!(a>i||u<n||s>o||l<r)}function DQ(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function NQ(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const FQ=yG((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:u=10,document:l}=e,c=IQ(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const h=u/2,p=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},f=UF(VF(c,"handleNW","handleNE"),"handleN"),{render:d=p}=f,m=IQ(f,["render"]),g=UF(c,"handleE"),{render:y=p}=g,v=IQ(g,["render"]),_=UF(VF(c,"handleSE","handleSW"),"handleS"),{render:b=p}=_,x=IQ(_,["render"]),w=UF(c,"handleW"),{render:S=p}=w,E=IQ(w,["render"]),M=UF(c,"handleNW"),{render:T=p}=M,A=IQ(M,["render"]),C=UF(c,"handleNE"),{render:O=p}=C,P=IQ(C,["render"]),k=UF(c,"handleSE"),{render:L=p}=k,I=IQ(k,["render"]),R=UF(c,"handleSW"),{render:D=p}=R,N=IQ(R,["render"]),F=t=>()=>{const e=yG((e=>((t,e)=>{const{id:n}=t,r=t.attributes,{x:i,y:o}=r,a=IQ(r,["x","y"]),s=e(t,Object.assign({x:0,y:0},a),l);s.id=n,s.style.draggable=!0})(e,t)));return new e({})},z=$Z(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);z.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(NQ,Object.assign({width:i,height:o},VF(c,"handle"))),z.maybeAppend("handle-n",F(d)).style("x",h).style("y",-h).style("width",i-u).style("height",u).style("fill","transparent").call(NQ,m),z.maybeAppend("handle-e",F(y)).style("x",i-h).style("y",h).style("width",u).style("height",o-u).style("fill","transparent").call(NQ,v),z.maybeAppend("handle-s",F(b)).style("x",h).style("y",o-h).style("width",i-u).style("height",u).style("fill","transparent").call(NQ,x),z.maybeAppend("handle-w",F(S)).style("x",-h).style("y",h).style("width",u).style("height",o-u).style("fill","transparent").call(NQ,E),z.maybeAppend("handle-nw",F(T)).style("x",-h).style("y",-h).style("width",u).style("height",u).style("fill","transparent").call(NQ,A),z.maybeAppend("handle-ne",F(O)).style("x",i-h).style("y",-h).style("width",u).style("height",u).style("fill","transparent").call(NQ,P),z.maybeAppend("handle-se",F(L)).style("x",i-h).style("y",o-h).style("width",u).style("height",u).style("fill","transparent").call(NQ,I),z.maybeAppend("handle-sw",F(D)).style("x",-h).style("y",o-h).style("width",u).style("height",u).style("fill","transparent").call(NQ,N)}));function zQ(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),extent:o=DQ(t),brushRegion:a=((t,e,n,r,i)=>[t,e,n,r]),reverse:s=!1,fill:u="#777",fillOpacity:l="0.3",stroke:c="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=IQ(e,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let f=null,d=null,m=null,g=null,y=null,v=!1;const[_,b,x,w]=o;IJ(t,"crosshair"),t.style.draggable=!0;const S=(t,e)=>{if(g&&g.remove(),y&&y.remove(),f=[t,e],s)return E();M()},E=()=>{y=new sI({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:l,stroke:c,pointerEvents:"none"})}),g=new FQ({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(y),t.appendChild(g)},M=()=>{g=new FQ({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:l,stroke:c,draggable:!0}),className:"mask"}),t.appendChild(g)},T=(t=!0)=>{g&&g.remove(),y&&y.remove(),f=null,d=null,m=null,v=!1,g=null,y=null,t&&r()},A=(t,e,r=!0)=>{const[i,u,l,c]=function(t,e,n,r,i){const[o,a,s,u]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(u,Math.max(e,r))]}(t[0],t[1],e[0],e[1],o),[h,p,f,d]=a(i,u,l,c,o);return s?O(h,p,f,d):C(h,p,f,d),n(h,p,f,d,r),[h,p,f,d]},C=(t,e,n,r)=>{g.style.x=t,g.style.y=e,g.style.width=n-t,g.style.height=r-e},O=(t,e,n,r)=>{y.style.d=`\n M${_},${b}L${x},${b}L${x},${w}L${_},${w}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,g.style.x=t,g.style.y=e,g.style.width=n-t,g.style.height=r-e},P={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},k=t=>I(t)||L(t),L=t=>{const{id:e}=t;return-1!==h.indexOf(e)&&new Set(Object.keys(P)).has(e)},I=t=>t===g.getElementById("selection"),R=e=>{const{target:n}=e,[r,i]=wJ(t,e);if(!g||!k(n))return S(r,i),void(v=!0);k(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=wJ(t,e);if(!f)return;if(!m)return A(f,r);if(I(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,f[0],d[0],_,x),o=e(r,f[1],d[1],b,w),a=[f[0]+i,f[1]+o],s=[d[0]+i,d[1]+o];A(a,s)})(r);const[i,o]=[r[0]-m[0],r[1]-m[1]],{id:a}=n;if(P[a]){const[t,e,n,r]=P[a].vector;return A([f[0]+i*t,f[1]+o*e],[d[0]+i*n,d[1]+o*r])}},N=e=>{if(m){m=null;const{x:t,y:e,width:n,height:r}=g.style;return f=[t,e],void(d=[t+n,e+r])}d=wJ(t,e);const[n,r,o,a]=A(f,d);v=!1,i(n,r,o,a,e)},F=t=>{const{target:e}=t;g&&!k(e)&&T()},z=e=>{const{target:n}=e;g&&k(n)&&!v?I(n)?IJ(t,"move"):L(n)&&IJ(t,P[n.id].cursor):IJ(t,"crosshair")},B=()=>{IJ(t,"default")};return t.addEventListener("dragstart",R),t.addEventListener("drag",D),t.addEventListener("dragend",N),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",B),{mask:g,move(t,e,n,r,i=!0){g||S(t,e),f=[t,e],d=[n,r],A([t,e],[n,r],i)},remove(){g&&T()},destroy(){g&&T(!1),IJ(t,"default"),t.removeEventListener("dragstart",R),t.removeEventListener("drag",D),t.removeEventListener("dragend",N),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",B)}}}function BQ(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function jQ(t,e,n){return BQ(t,e,n).map((t=>t.options))}function UQ(t,e){var{elements:n,selectedHandles:r,siblings:i=(t=>[]),datum:o,brushRegion:a,extent:s,reverse:u,scale:l,coordinate:c,series:h=!1,key:p=(t=>t),bboxOf:f=(t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}}),state:d={},emitter:m}=e,g=IQ(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),v=i(t),_=v.flatMap(n),b=OJ(y,o),x=UF(g,"mask"),{setState:w,removeState:S}=TJ(d,b),E=new Map,{width:M,height:T,x:A=0,y:C=0}=f(t),O=s||[0,0,M,T],P=()=>{for(const t of[...y,..._])S(t,"active","inactive")},k=(t,e,n,r)=>{var i;for(const t of v)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[u,l]=a,[c,h]=s;RQ([u,l,c,h],[t,e,n,r])?(w(i,"active"),o.add(p(i))):w(i,"inactive")}for(const t of _)o.has(p(t))?w(t,"active"):w(t,"inactive")},L=()=>{for(const t of y)S(t,"inactive");for(const t of E.values())t.remove();E.clear()},I=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e};for(const o of y){const a=E.get(o)||i(o);a.style.clipPath=new cI({style:{x:t+A,y:e+C,width:n-t,height:r-e}}),w(o,"inactive"),w(a,"active")}},R=zQ(t,Object.assign(Object.assign({},x),{extent:O,brushRegion:a,reverse:u,selectedHandles:r,brushended:()=>{const t=h?L:P;m.emit("brush:end",{nativeEvent:!0}),t()},brushed:(t,e,n,r,i)=>{const o=LK(t,e,n,r,l,c);i&&m.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}}),(h?I:k)(t,e,n,r)}})),D=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const[[r,i],[o,a]]=t,{x:s,y:u}=e,l=[s.map(r),u.map(o)],c=t=>t.getStep?t.getStep():0,h=[s.map(i)+c(s),u.map(a)+c(u)],[p,f]=n.map(l),[d,m]=n.map(h);return[p,f,d,m]}(n,l,c);R.move(r,i,o,a,!1)};m.on("brush:highlight",D);const N=()=>R.remove();m.on("brush:remove",N);const F=R.destroy.bind(R);return R.destroy=()=>{m.off("brush:highlight",D),m.off("brush:remove",N),F()},R}function ZQ(t){var{facet:e,brushKey:n}=t,r=IQ(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:u}=t,l=bJ(a),c={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},h=["active",["inactive",{opacity:.5}]],{scale:p,coordinate:f}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],u=e.max[1];return UQ(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>vJ(t,i),datum:MJ(_J(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,u],state:CJ(_J(t,i).map((t=>t.options)),h),emitter:o,scale:p,coordinate:f,selectedHandles:void 0},c),r))}const d=UQ(l,Object.assign(Object.assign({elements:yJ,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return BQ(t,e,n).map((t=>bJ(t.container)))}(t,i,n),datum:MJ([s,...BQ(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:CJ([u,...jQ(t,i,n)],h),emitter:o,scale:p,coordinate:f,selectedHandles:void 0},c),r));return l.brush=d,()=>d.destroy()}}function VQ(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function GQ(t){return ZQ(Object.assign(Object.assign({},t),{brushRegion:VQ,selectedHandles:["handle-e","handle-w"]}))}function HQ(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function WQ(t){return ZQ(Object.assign(Object.assign({},t),{brushRegion:HQ,selectedHandles:["handle-n","handle-s"]}))}var qQ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const YQ="axis",XQ="axis-line",$Q="axis-main-group",KQ="axis-hot-area";function JQ(t){return t.getElementsByClassName(YQ)}function QQ(t){return t.getElementsByClassName(XQ)[0]}function t0(t){return function(t){return t.getElementsByClassName($Q)[0]}(t).getLocalBounds()}function e0(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=qQ(e,["cross","offsetX","offsetY"]);const a=t0(t),s=QQ(t),[u]=s.getLocalBounds().min,[l,c]=a.min,[h,p]=a.max,f=2*(h-l);return{brushRegion:HQ,hotZone:new cI({className:KQ,style:Object.assign({x:n?l:u-f/2,width:n?f/2:f,y:c,height:p-c},o)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(h-r),i]}}function n0(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=qQ(e,["offsetY","offsetX","cross"]);const a=t0(t),s=QQ(t),[,u]=s.getLocalBounds().min,[l,c]=a.min,[h,p]=a.max,f=p-c;return{brushRegion:VQ,hotZone:new cI({className:KQ,style:Object.assign({x:l,width:h-l,y:i?c:u-f,height:i?f:2*f},o)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(c-n),r,Math.ceil(p-n)]}}function r0(t){return e=>{const{container:n,view:r,options:i}=e,o=bJ(n),{x:a,y:s}=o.getBBox();return function(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:u,reverse:l=!1,state:c={}}=e,h=qQ(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state"]);const p=r(t),f=n(t),d=OJ(p,a),{setState:m}=TJ(c,d),g=new Map,y=UF(h,"mask"),v=t=>Array.from(g.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),_=()=>{for(const t of p){const e=i(t);v(e)?m(t,"active"):m(t,"inactive")}},b=f.some(o)&&f.some((t=>!o(t)));for(const t of f){const e=o(t)?n0:e0,{hotZone:n,brushRegion:r,extent:i}=e(t,{offsetY:s,offsetX:u,cross:b,zIndex:999,fill:"transparent"});t.parentNode.appendChild(n),zQ(n,Object.assign(Object.assign({},y),{reverse:l,brushRegion:r,brushended(){g.delete(t),_()},brushed(e,n,r,o){g.set(t,i(e,n,r,o)),_()}}))}}(n,Object.assign({elements:yJ,axes:JQ,offsetY:s,offsetX:a,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:MJ(r),state:CJ(i,["active",["inactive",{opacity:.5}]])},t))}}var i0=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function a0(t){var{hideX:e=!0,hideY:n=!0}=t,r=o0(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:u,update:l}=t,c=bJ(a);let h=!1,p=!1,f=s;const{scale:d,coordinate:m}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:u,coordinate:l,selection:c,series:h=!1}=e;const p=UF(o0(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:f,height:d}=t.getBBox(),m=o||[0,0,f,d],g=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=zQ(t,Object.assign(Object.assign({},p),{extent:m,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(c(t,e,r,i),o),y.remove()}}));function v(t){g(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",v);const _=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",_),()=>{y.destroy(),s.off("brush:filter",_),t.removeEventListener("click",v)}}(c,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=f;return LK(t,e,n,r,i,o)},filter:(t,r)=>i0(this,void 0,void 0,(function*(){if(p)return;p=!0;const[i,a]=t,{marks:s}=u,c=s.map((t=>VD({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i},y:{domain:a}}})));o.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,a]}}));const d=Object.assign(Object.assign({},u),{marks:c,clip:!0}),m=yield l(d);f=m.view,p=!1,h=!0})),reset:t=>{if(p||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,a=r.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,a]}})),h=!1,f=s,l(u)},extent:void 0,emitter:o,scale:d,coordinate:m},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function s0(t){return a0(Object.assign(Object.assign({hideX:!0},t),{brushRegion:VQ}))}function u0(t){return a0(Object.assign(Object.assign({hideY:!0},t),{brushRegion:HQ}))}var l0=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const c0="slider";function h0(t,e){const{marks:n}=t,r=n.map((t=>VD({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,slider:Object.assign(Object.assign({},t.slider.x&&{x:{preserve:!0}}),t.slider.y&&{y:{preserve:!0}}),animate:!1})));return Object.assign(Object.assign({},t),{marks:r,clip:!0,animate:!1})}function p0(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return kK(e,[PK(e,o(r),!0),PK(e,o(i),!1)])}function f0({wait:t=50,leading:e=!0,trailing:n=!1}){return r=>{const{container:i,view:o,options:a,update:s}=r,u=i.getElementsByClassName(c0);if(!u.length)return()=>{};let l=!1;const{scale:c,coordinate:h}=o,{x:p,y:f}=c,d=UN(h),m=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return d?[n,e]:[e,n]},g=new Map,y={x:p.getOptions().domain,y:f.getOptions().domain};for(const r of u){const{orientation:i}=r.attributes,o=VJ((t=>l0(this,void 0,void 0,(function*(){const{value:e}=t.detail;if(l)return;l=!0;const[n,r]=m(i),o=p0(e,c[n],d&&"horizontal"===i);y[n]=o;const u=y[r],h=h0(a,{[n]:{domain:o},[r]:{domain:u}});yield s(h),l=!1}))),t,{leading:e,trailing:n});r.addEventListener("valuechange",o),g.set(r,o)}return()=>{for(const[t,e]of g)t.removeEventListener("valuechange",e)}}}var d0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function m0(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const g0={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function y0(t){return"text"===t.nodeName&&!!t.isOverflowing()}function v0(t){var{offsetX:e=8,offsetY:n=8}=t,r=d0(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=UF(r,"tip"),u=new Set,l=t=>{const{target:r}=t;if(!y0(r))return void t.stopPropagation();const{offsetX:l,offsetY:c}=t,h=l+e-o,p=c+n-a;if(r.tip)return r.tip.style.x=h,void(r.tip.style.y=p);const{text:f}=r.style,d=new iI({className:"poptip",style:{innerHTML:m0("div",f,Object.assign(Object.assign({},g0),s)),x:h,y:p}});i.appendChild(d),r.tip=d,u.add(d)},c=t=>{const{target:e}=t;y0(e)?e.tip&&(e.tip.remove(),e.tip=null,u.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",c),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",c),u.forEach((t=>t.remove()))}}}function _0(t){return(e,...n)=>VD({},t(e,...n),e)}function b0(t){return(e,...n)=>VD({},e,t(e,...n))}function x0(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const w0=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map((t=>{var{data:e,x:s,y:u,width:l,height:c}=t,h=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},h),{data:x0(e,a),x:null!=s?s:n,y:null!=u?u:r,width:null!=l?l:i,height:null!=c?c:o})}))};w0.props={};var S0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const E0=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:o}=t,[a,s,u,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],c=r.reduce(((t,e)=>t+e)),h=t[s]-i*(e.length-1),p=r.map((t=>h*(t/c))),f=[];let d=t[a]||0;for(let n=0;n<p.length;n+=1){const r=e[n],{data:c}=r,h=S0(r,["data"]),m=x0(c,o);f.push(Object.assign({[a]:d,[s]:p[n],[l]:t[l]||0,[u]:t[u],data:m},h)),d+=p[n]+i}return f};E0.props={};var M0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const T0=()=>t=>{const{children:e}=t,n=M0(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:u=[]}=n,l=M0(n,["data","scale","axis","legend","encode","transform"]),c=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:c={},encode:h={},transform:p=[]}=t,f=M0(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:x0(e,r),scale:VD({},i,n),encode:VD({},s,h),transform:[...u,...p],axis:!(!l||!o)&&VD({},o,l),legend:!(!c||!a)&&VD({},a,c)},f)}));return[Object.assign(Object.assign({},l),{marks:c,type:"standardView"})]};T0.props={};const A0=()=>t=>{const{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:o,paddingBottom:a,padding:s,inset:u,insetLeft:l,insetTop:c,insetRight:h,insetBottom:p,margin:f,marginLeft:d,marginBottom:m,marginTop:g,marginRight:y,data:v,coordinate:_,theme:b,component:x,interaction:w,x:S,y:E,key:M,frame:T,title:A,labelTransform:C,parentKey:O,clip:P,viewStyle:k}=t,L=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","key","frame","title","labelTransform","parentKey","clip","viewStyle"]);return[{type:"standardView",x:S,y:E,key:M,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:o,inset:u,insetLeft:l,insetTop:c,insetRight:h,insetBottom:p,paddingBottom:a,theme:b,coordinate:_,component:x,interaction:w,frame:T,title:A,labelTransform:C,margin:f,marginLeft:d,marginBottom:m,marginTop:g,marginRight:y,parentKey:O,clip:P,style:k,marks:[Object.assign(Object.assign({},L),{key:`${M}-0`,data:v})]}]};A0.props={};const C0=_0((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=FN(n,(e=>e[t])),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),u=s.map((t=>a.has(t)?a.get(t).length:1));return{domain:s,flex:u}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}})),O0=_0((t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const t=r.shift(),{children:e,encode:n={},scale:s={},legend:u={}}=t,{color:l}=n,{color:c}=s,{color:h}=u;void 0!==l&&(i=l),void 0!==c&&(o=c),void 0!==h&&(a=h),Array.isArray(e)&&r.push(...e)}return{encode:{color:i},scale:{color:VD({},o,{domain:(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;return void 0!==r?r:void 0!==i?Array.from(new Set(e.map((t=>t[i])))):void 0})(),type:"ordinal"})},legend:{color:VD({title:i},a)}}})),P0=_0((()=>({animate:{enterType:"fadeIn"}}))),k0=b0((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),L0=b0((()=>({type:"cell"}))),I0=b0((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map((t=>t[r])))):[],a=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map((t=>({[r]:t}))):a.length?a.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),R0=b0(((t,e=D0,n=F0,r=z0,i={})=>{const{data:o,encode:a,children:s,scale:u,x:l=0,y:c=0,shareData:h=!1,key:p}=t,{value:f}=o,{x:d,y:m}=a,{color:g}=u,{domain:y}=g;return{children:(t,o,a)=>{const{x:u,y:g}=o,{paddingLeft:v,paddingTop:_}=a,{domain:b}=u.getOptions(),{domain:x}=g.getOptions(),w=PZ(t),S=t.map(e),E=t.map((({x:t,y:e})=>[u.invert(t),g.invert(e)])),M=E.map((([t,e])=>n=>{const{[d]:r,[m]:i}=n;return!(void 0!==d&&r!==t||void 0!==m&&i!==e)})),T=M.map((t=>f.filter(t))),A=h?up(T,(t=>t.length)):void 0,C=E.map((([t,e])=>({columnField:d,columnIndex:b.indexOf(t),columnValue:t,columnValuesLength:b.length,rowField:m,rowIndex:x.indexOf(e),rowValue:e,rowValuesLength:x.length}))),O=C.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return w.flatMap((t=>{const[e,o,a,s]=S[t],u=C[t],h=T[t];return O[t].map((g=>{var b,x,{scale:w,key:S,facet:E=!0,axis:M={},legend:T={}}=g,C=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(g,["scale","key","facet","axis","legend"]);const O=(null===(b=null==w?void 0:w.y)||void 0===b?void 0:b.guide)||M.y,P=(null===(x=null==w?void 0:w.x)||void 0===x?void 0:x.guide)||M.x,k={x:{tickCount:d?5:void 0},y:{tickCount:m?5:void 0}},L=E?h:0===h.length?[]:f,I={color:{domain:y}},R={x:B0(P,n)(u,L),y:B0(O,r)(u,L)};return Object.assign(Object.assign({key:`${S}-${t}`,data:L,x:e+v+l,y:o+_+c,parentKey:p,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!L.length,dataDomain:A,scale:VD(k,w,I),axis:VD({},M,R),legend:!1},C),i)}))}))}}}));function D0(t){const{points:e}=t;return BZ(e)}function N0(t,e){return e.length?VD({title:!1,tick:null,label:null},t):VD({title:!1,tick:null,label:null,grid:null},t)}function F0(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return N0(t,n);const s=o===a-1&&void 0,u=n.length?void 0:null;return VD({title:s,grid:u},t)}}function z0(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return N0(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return VD({title:o,grid:a},t)}}function B0(t,e){return"function"==typeof t?t:null===t?()=>null:e(t)}const j0=()=>t=>[jK.of(t).call(L0).call(O0).call(P0).call(C0).call(k0).call(I0).call(R0).value()];j0.props={};var U0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Z0=_0((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),V0=b0((t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(t,a,s)=>{const{x:u,y:l}=a,{paddingLeft:c,paddingTop:h}=s,{domain:p}=u.getOptions(),{domain:f}=l.getOptions(),d=PZ(t),m=t.map((({points:t})=>BZ(t))),g=t.map((({x:t,y:e})=>[u.invert(t),l.invert(e)])),y=g.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:f.indexOf(e),rowValue:e,rowValuesLength:f.length}))),v=y.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return d.flatMap((t=>{const[n,a,s,u]=m[t],[l,p]=g[t],f=y[t];return v[t].map((d=>{var m,g;const{scale:y,key:v,encode:_,axis:b}=d,x=U0(d,["scale","key","encode","axis"]),w=null===(m=null==y?void 0:y.y)||void 0===m?void 0:m.guide,S={x:(E=null===(g=null==y?void 0:y.x)||void 0===g?void 0:g.guide,"function"==typeof E?E:null===E?()=>null:(t,e)=>{const{rowIndex:n,rowValuesLength:r}=t;if(n!==r-1)return N0(E,e)})(f,e),y:H0(w)(f,e)};var E;return Object.assign({data:e,parentKey:o,key:`${v}-${t}`,x:n+c+r,y:a+h+i,width:s,height:u,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:VD({x:{facet:!1},y:{facet:!1}},y),axis:VD({x:{tickCount:5},y:{tickCount:5}},b,S),legend:!1,encode:VD({},_,{x:l,y:p})},x)}))}))}}})),G0=b0((t=>{const{encode:e}=t,n=U0(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=U0(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[o].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[o].flat(1).length&&{y:{paddingInner:0}})})}));function H0(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return N0(t,n)}}const W0=()=>t=>[jK.of(t).call(L0).call(O0).call(V0).call(G0).call(P0).call(k0).call(Z0).value()];const q0=_0((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),Y0=_0((t=>({coordinate:{type:"polar"}}))),X0=t=>{const{encode:e}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function $0(t){return t=>null}function K0(t){const{points:e}=t,[n,r,i,o]=e,a=DZ(n,o),s=RZ(n,o),u=zZ(s,RZ(r,i)),l=1/Math.sin(u/2),c=a/(1+l),h=c*Math.sqrt(2),[p,f]=i,d=FZ(s)+u/2,m=c*l;return[p+m*Math.sin(d)-h/2,f+m*Math.cos(d)-h/2,h,h]}const J0=()=>t=>[jK.of(t).call(L0).call(X0).call(O0).call(Y0).call(I0).call(R0,K0,$0,$0,{frame:!1}).call(P0).call(k0).call(q0).value()];function Q0(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const t1=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],u=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=VD({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=Q0(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield u[n]),t=n}e++}}};function e1(t,e){if(null!==t)return{type:"column",value:t,field:e}}function n1(t,e){const n=e1(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function r1(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function i1(t,e){const n=e1(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function o1(t,e){const n=[];for(const r of t)n[r]=e;return n}function a1(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function s1(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=a1(t,n);if(null!==e)return[e,r]}}return[null,null]}function u1(t){return!(t instanceof Date)&&"object"==typeof t}t1.props={};const l1=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,VD({},e,{encode:{y1:n1(o1(t,0))}})]};function c1(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=a1(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>BF(t)));return Array.from(FN(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function h1(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:Iz(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>v1((n=>t(e[n])))}(t):"series"===t?d1:"value"===t?m1:"sum"===t?g1:"maxIndex"===t?y1:()=>null}function p1(t,e){for(const n of t)n.sort(e)}function f1(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function d1(t,e,n){return v1((t=>n[t]))}function m1(t,e,n){return v1((t=>e[t]))}function g1(t,e,n){const r=PZ(t),i=Array.from(FN(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return v1((t=>o.get(n[t])))}function y1(t,e,n){const r=PZ(t),i=Array.from(FN(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,kz(n,(t=>e[t]))])));return v1((t=>o.get(n[t])))}function v1(t){return(e,n)=>Iz(t(e),t(n))}l1.props={};const _1=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:u,encode:l,style:c={}}=s,[h,p]=a1(l,"y"),[f,d]=a1(l,"y1"),[m]=a?s1(l,"series","color"):a1(l,"color"),g=c1(e,t,s),y=h1(n)(u,h,m);y&&p1(g,y);const v=new Array(t.length),_=new Array(t.length),b=new Array(t.length),x=[],w=[];for(const t of g){r&&t.reverse();const e=f?+f[t[0]]:0,n=[],i=[];for(const r of t){const t=b[r]=+h[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,u=0;for(;s>0&&0===h[o[s]];)s--;for(;u<a.length-1&&0===h[a[u]];)u++;x.push(o[s]),w.push(a[u]);let l=e;for(const t of i.reverse()){const e=b[t];l=v[t]=(_[t]=l)+e}let c=e;for(const t of n){const e=b[t];e>0?c=v[t]=(_[t]=c)+e:v[t]=_[t]=c}}const S=new Set(x),E=new Set(w),M="y"===i?v:_,T="y"===o?v:_;return[t,VD({},s,{encode:{y0:n1(h,p),y:e1(M,p),y1:e1(T,d)},style:Object.assign({first:(t,e)=>S.has(e),last:(t,e)=>E.has(e)},c)})]}};function b1(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}_1.props={};const x1=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(b1))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:u}=t;return _1({groupBy:u?["x","series"]:"x"})(e,n,r)};x1.props={};const w1=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(WF(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>a1(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e])).join(", ")};return[t,VD({},n,{tooltip:{title:s}})]}};w1.props={};const S1=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,VD({},e,{encode:{x:n1(o1(t,0))},scale:{x:{guide:null}}})]};S1.props={};const E1=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,VD({},e,{encode:{y:n1(o1(t,0))},scale:{y:{guide:null}}})]};E1.props={};const M1=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,VD({},e,{encode:{size:r1(o1(t,3))}})]};M1.props={};const T1=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map((({value:t})=>t)),a=t.map((t=>o.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,VD({},e,{encode:{key:e1(a)}})]};T1.props={};const A1=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=a1(n,"color");return[t,VD({},e,{encode:{series:e1(o,a)}})]};A1.props={};const C1=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(u1)?[t,e]:[t,VD({},e,{encode:{y:e1(n)}})]};C1.props={};const O1=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(u1)?[t,e]:[t,VD({},e,{encode:{x:e1(n)}})]};O1.props={};const P1=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=a1(n,"y");return[t,VD({},e,{encode:{y1:e1([...i])}})]};P1.props={};const k1=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=a1(n,"x");return[t,VD({},e,{encode:{x1:e1([...i])}})]};k1.props={};const L1=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(WF(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,VD({},n,{tooltip:{items:a}})]}};L1.props={};const I1=()=>(t,e)=>[t,VD({scale:{x:{padding:0},y:{padding:0}}},e)];I1.props={};var R1=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const D1=()=>(t,e)=>{const{data:n,style:r={}}=e,i=R1(e,["data","style"]),{x:o,y:a}=r,s=R1(r,["x","y"]);if(null==o||null==a)return[t,e];const u=a||0;return[[0],VD({},i,{data:[0],cartesian:!0,encode:{x:e1([o||0]),y:e1([u])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};D1.props={};const N1=()=>(t,e)=>{const{style:n={}}=e;return[t,VD({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};N1.props={};const F1=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(u1))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,VD({},e,{encode:{x:e1(i),y:e1(o)}})]};F1.props={};const z1=()=>(t,e)=>{const{style:n={}}=e,{gradient:r}=n;return r?[t,VD({},e,{encode:{series:r1(o1(t,void 0))}})]:[t,e]};z1.props={};const B1=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}}(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:u}=o,{series:l}=u,[c]=a1(s,"y"),[h]=s1(s,"series","color"),p=f1(h,l),f=c1(e,t,o),d=h1(r)(a,c,h);d&&p1(f,d);const m=new Array(t.length);for(const t of f){n&&t.reverse();for(let e=0;e<t.length;e++)m[t[e]]=p[e]}return[t,VD({},o,{scale:{series:{domain:p,paddingInner:i}},encode:{series:e1(m)}})]}};B1.props={};const j1=t=>{const{groupBy:e=["x"],reducer:n=((t,e)=>e[t[0]]),orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,u=(Array.isArray(e)?e:[e]).map((t=>[t,a1(s,t)[0]]));if(0===u.length)return[t,a];let l=[t];for(const[,t]of u){const e=[];for(const n of l){const r=Array.from(FN(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=a1(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const c=(o||3e3)/l.length,[h]=o?[o1(t,c)]:s1(s,"enterDuration",o1(t,c)),[p]=s1(s,"enterDelay",o1(t,0)),f=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=up(n,(t=>+h[t]));for(const t of n)f[t]=+p[t]+e;e+=r}return[t,VD({},a,{encode:{enterDuration:r1(h),enterDelay:r1(f)}})]}};function U1(t,e){return jz(t,.5,e)}function Z1(t,e){return function(t,e,n=Bz){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>Bz(n(t[r],r,t)))),e<=0)return Lz(r);if(e>=1)return kz(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return Fz(i,a,0,o,((t,e)=>Nz(r[t],r[e]))),a=function(t,e=Iz){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?Iz(t,i)>0:0===Iz(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}(t,.5,e)}function V1(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}j1.props={};const G1=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,{x:a}=i,s=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["x"]),u=Object.entries(s).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,a1(i,t)[0]])),[,l]=u.find((([t])=>"y"===t)),c=u.map((([e])=>[e,new Array(t.length)])),h=c1(e,t,r),p=function(t){return"function"==typeof t?t:{min:(t,e)=>sp(t,(t=>e[+t])),max:(t,e)=>up(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>YJ(t,(t=>e[+t])),median:(t,e)=>U1(t,(t=>e[+t])),sum:(t,e)=>vF(t,(t=>e[+t])),deviation:(t,e)=>V1(t,(t=>e[+t]))}[t]||up}(n);for(const t of h){const e=p(t,l);for(const n of t)for(let t=0;t<u.length;t++){const[,r]=u[t],[,i]=c[t];i[n]=+r[n]/e}}const f=WF(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,VD({},r,Object.assign({encode:Object.fromEntries(c.map((([t,e])=>[t,e1(e,a1(i,t)[1])])))},!f&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function H1(t,e,n){if(null===t)return[-.5,.5];const r=f1(t,e),i=new IU({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function W1(t,e,n){return e*(1-t)+n*t}G1.props={};const q1=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:u}=a,[l]=a1(o,"x"),[c]=a1(o,"y"),h=H1(l,s,n),p=H1(c,u,r),f=t.map((()=>W1(i(),...p))),d=t.map((()=>W1(i(),...h)));return[t,VD({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:e1(f),dx:e1(d)}})]}};q1.props={};const Y1=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=a1(i,"x"),u=H1(s,a,e),l=t.map((()=>W1(n(),...u)));return[t,VD({scale:{x:{padding:.5}}},r,{encode:{dx:e1(l)}})]}};Y1.props={};const X1=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,{x:i}=r,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(r,["x"]),a=Object.entries(o).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,a1(r,t)[0]])),s=a.map((([e])=>[e,new Array(t.length)])),u=c1(e,t,n),l=new Array(u.length);for(let t=0;t<u.length;t++){const e=u[t].flatMap((t=>a.map((([,e])=>+e[t])))),[n,r]=CZ(e);l[t]=(n+r)/2}const c=Math.max(...l);for(let t=0;t<u.length;t++){const e=c-l[t],n=u[t];for(const t of n)for(let n=0;n<a.length;n++){const[,r]=a[n],[,i]=s[n];i[t]=+r[t]+e}}return[t,VD({},n,{encode:Object.fromEntries(s.map((([t,e])=>[t,e1(e,a1(r,t)[1])])))})]}};X1.props={};const $1=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=a1(i,"y"),[a,s]=a1(i,"y1"),[u]=n?s1(i,"series","color"):a1(i,"color"),l=c1(e,t,r),c=new Array(t.length);for(const t of l){const e=t.map((t=>+o[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));c[r]=o[r]>i?i:o[r]}}return[t,VD({},r,{encode:{y1:e1(c,s)}})]}};function K1(t,e){return[t[0]]}function J1(t,e){return[t[t.length-1]]}function Q1(t,e){return[t[kz(t,(t=>e[t]))]]}function t2(t,e){return[t[Lz(t,(t=>e[t]))]]}$1.props={};const e2=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=c1(e,t,i),[s]=a1(o,n),u=function(t){return"function"==typeof t?t:{first:K1,last:J1,max:Q1,min:t2}[t]||K1}(r);return[a.flatMap((t=>u(t,s))),i]}};e2.props={};const n2=(t={})=>{const{selector:e}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["selector"]);return e2(Object.assign({channel:"x",selector:e},n))};n2.props={};const r2=(t={})=>{const{selector:e}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["selector"]);return e2(Object.assign({channel:"y",selector:e},n))};r2.props={};function i2(t){return e=>null===e?t:`${t} of ${e}`}function o2(){return[(t,e)=>YJ(t,(t=>+e[t])),i2("mean")]}function a2(){return[(t,e)=>U1(t,(t=>+e[t])),i2("median")]}function s2(){return[(t,e)=>up(t,(t=>+e[t])),i2("max")]}function u2(){return[(t,e)=>sp(t,(t=>+e[t])),i2("min")]}function l2(){return[(t,e)=>t.length,i2("count")]}function c2(){return[(t,e)=>vF(t,(t=>+e[t])),i2("sum")]}function h2(){return[(t,e)=>e[t[0]],i2("first")]}function p2(){return[(t,e)=>e[t[t.length-1]],i2("last")]}const f2=(t={})=>{const{groupBy:e}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:o2,max:s2,count:l2,first:h2,last:p2,sum:c2,min:u2,median:a2}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,u]=a1(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=a1(o,n);return r})(u,e),c=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},i1(c,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),u=Object.keys(o).map((t=>{const[e,n]=a1(o,t),r=a.map((t=>e[t[0]]));return[t,e1(r,n)]})),l=a.map((t=>i[t[0]]));return[PZ(a),VD({},r,{data:l,encode:Object.fromEntries([...u,...s])})]}};f2.props={};const d2=(t={})=>{const{channels:e=["x","y"]}=t,n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["channels"]);return f2(Object.assign(Object.assign({},n),{groupBy:(t,n)=>c1(e,t,n)}))};d2.props={};const m2=(t={})=>d2(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));m2.props={};const g2=(t={})=>d2(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));g2.props={};const y2=(t={})=>d2(Object.assign(Object.assign({},t),{channels:["color"]}));y2.props={};var v2=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const _2=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=v2(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?function(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=v2(n,["reverse","slice","channel"]),{encode:u,scale:l={}}=e,c=null===(r=l[a])||void 0===r?void 0:r.domain,[h]=a1(u,a),p=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=a1(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>up(t,(t=>+o[t]));if("min"===i)return t=>sp(t,(t=>+o[t]));if("sum"===i)return t=>vF(t,(t=>+o[t]));if("median"===i)return t=>U1(t,(t=>+o[t]));if("mean"===i)return t=>YJ(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(a,s,u),f=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,h,c),d=(m=f,y=t=>h[t],(2!==(g=p).length?Rz(zN(m,g,y),(([t,e],[n,r])=>Iz(e,r)||Iz(t,n))):Rz(FN(m,y),(([t,e],[n,r])=>g(e,r)||Iz(t,n)))).map((([t])=>t)));var m,g,y;i&&d.reverse();const v="number"==typeof o?[0,o]:o,_=o?d.slice(...v):d;return[t,VD(e,{scale:{[a]:{domain:_}}})]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=a1(o,i),s=Rz(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};_2.props={};const b2=(t={})=>_2(Object.assign(Object.assign({},t),{channel:"x"}));b2.props={};const x2=(t={})=>_2(Object.assign(Object.assign({},t),{channel:"color"}));x2.props={};const w2=(t={})=>_2(Object.assign(Object.assign({},t),{channel:"y"}));w2.props={};const S2=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=a1(a,"x"),u=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):a1(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>vF(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,u),c=BN(t,l,(t=>s[t])).map((t=>t[1]));return[t,VD({},i,{scale:{x:{flex:c}}})]}};function E2(t,e,n){const r=t.length;if(0===r)return[];const{innerWidth:i,innerHeight:o}=n,a=o/i;let s=Math.ceil(Math.sqrt(e/a)),u=i/s,l=Math.ceil(e/s),c=l*u;for(;c>o;)s+=1,u=i/s,l=Math.ceil(e/s),c=l*u;const h=o-l*u,p=l<=1?0:h/(l-1),[f,d]=l<=1?[(i-r*u)/(r-1),(o-u)/2]:[0,0];return t.map(((t,e)=>{const[n,r,i,o]=BZ(t),a=e%s,c=Math.floor(e/s);return`translate(${a*u-n+f*a}, ${(l-c-1)*u+h-r-p*c-d}) scale(${u/i}, ${u/o})`}))}S2.props={};const M2=()=>(t,e)=>[t,VD({},e,{modifier:E2,axis:!1})];function T2(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}M2.props={};var A2=Array.prototype,C2=A2.slice;function O2(t){return()=>t}A2.map;const P2=Math.sqrt(50),k2=Math.sqrt(10),L2=Math.sqrt(2);function I2(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=P2?10:o>=k2?5:o>=L2?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?I2(t,e,2*n):[s,u,l]}function R2(t,e,n){return I2(t=+t,e=+e,n=+n)[2]}function D2(t){return Math.max(1,Math.ceil(Math.log(T2(t))/Math.LN2)+1)}const N2="thresholds";const F2=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["groupChannels","binChannels"]),i={};return f2(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(N2))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=a1(a,t);return e})),u=UF(r,N2),l=t.filter((t=>s.every((e=>BF(e[t]))))),c=[...e.map((t=>{const[e]=a1(a,t);return e})).filter(BF).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=u[t]||function(t){const[e,n]=CZ(t);return Math.min(200,function(t,e,n){const r=T2(t),i=V1(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}(n),o=function(){var t=NN,e=CZ,n=D2;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,u=new Array(s);for(i=0;i<s;++i)u[i]=t(r[i],i,r);var l=e(u),c=l[0],h=l[1],p=n(u,c,h);if(!Array.isArray(p)){const t=h,n=+p;if(e===CZ&&([c,h]=function(t,e,n){let r;for(;;){const i=R2(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(c,h,n)),p=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?I2(e,t,n):I2(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)u[t]=(o-t)/-a;else for(let t=0;t<s;++t)u[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)u[t]=(i+t)/-a;else for(let t=0;t<s;++t)u[t]=(i+t)*a;return u}(c,h,n),p[0]<=c&&(a=R2(c,h,n)),p[p.length-1]>=h)if(t>=h&&e===CZ){const t=R2(c,h,n);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else p.pop()}for(var f=p.length,d=0,m=f;p[d]<=c;)++d;for(;p[m-1]>h;)--m;(d||m<f)&&(p=p.slice(d,m),f=m-d);var g,y=new Array(f+1);for(i=0;i<=f;++i)(g=y[i]=[]).x0=i>0?p[i-1]:c,g.x1=i<f?p[i]:h;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=u[i])&&c<=o&&o<=h&&y[Math.min(f,Math.floor((o-c)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=u[i])&&c<=o&&o<=h){const t=Math.floor((c-o)*a);y[Math.min(f,t+(p[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=u[i])&&c<=o&&o<=h&&y[CK(p,o,0,f)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:O2(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:O2([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:O2(Array.isArray(t)?C2.call(t):t),r):n},r}().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(FN(l,(t=>c.map((e=>e(t))).join("-"))).values())}}))};F2.props={};const z2=(t={})=>{const{thresholds:e}=t;return F2(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function B2(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],u=(i-2)/(r-2);let l,c,h,p=0;s.push(p);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*u)+1,f=Math.floor((t+2)*u)+1;f=Math.min(f,i);const d=f-r;for(;r<f;r++)e+=o(r),n+=a(r);e/=d,n/=d;let m=Math.floor((t+0)*u)+1;const g=Math.floor((t+1)*u)+1,y=[o(p),a(p)];for(l=c=-1;m<g;m++)c=.5*Math.abs((y[0]-e)*(o(m)-y[1])-(y[0]-a(m))*(n-y[0])),c>l&&(l=c,h=m);s.push(h),p=h}return s.push(i-1),s.map((e=>t[e]))}z2.props={};const j2=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return B2;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Lz(t,(t=>n[t]))]],max:(t,e,n)=>[t[kz(t,(t=>n[t]))]],median:(t,e,n)=>[t[Z1(t,(t=>n[t]))]]},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=c1(r,t,e),[s]=a1(o,"x"),[u]=a1(o,"y");return[a.flatMap((t=>i(t,s,u,n))),e]}};j2.props={};const U2=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=a1(r,t);if(!n)return null;if("function"==typeof e)return t=>e(n[t]);const i=Array.isArray(e)?e:[e];return 0===i.length?null:t=>i.includes(n[t])})).filter(BF);if(0===o.length)return[e,n];const a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e)),u=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]]))})]));return[s,VD({},n,{encode:Object.fromEntries(u),data:a.map((t=>i[t]))})]};function Z2(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function V2(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}U2.props={};const G2=t=>{const{priority:e}=t;return(t,n)=>{const r=[];return e&&t.sort(e),t.forEach((t=>{mJ(t);const e=t.getLocalBounds(),n=r.some((t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}(Z2(e),Z2(t.getLocalBounds()))));n?dJ(t):r.push(t)})),t}};function H2([t,e],[n,r]){return r>t&&e>n}function W2(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function q2(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const Y2=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=W2(),[s,u]=W2(),[l,c]=W2(),[h,p]=W2();for(const e of t){const{min:t,max:n}=q2(e),[r,i]=t,[o,s]=n;a(e,i),u(e,i),c(e,s-i),p(e,[r,o])}for(let o=0;o<e;o++){t.sort(((t,e)=>Iz(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let o,a=n+1;for(;(o=t[a])&&!H2(h(i),h(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),c=a-(t+n);if(c<r){const n=(r-c)/2;e=Math.max(e,n),u(i,t-n),u(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function X2(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function $2(t,e,n){return.2126*X2(t)+.7152*X2(e)+.0722*X2(n)}function K2(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,u=$2(n,r,i),l=$2(o,a,s);return(Math.max(u,l)+.05)/(Math.min(u,l)+.05)}const J2=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return(t,r)=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;K2(t.parsedStyle.fill,r)<e&&t.attr("fill",function(t,e){const n=kz(e,(e=>K2(t,function(t){return"object"==typeof t?t:oP(t)}(e))));return e[n]}(r,n))})),t)},Q2=t=>(t,e)=>(t.forEach((t=>{mJ(t);const e=t.attr("bounds");(function(t,e){const[n,r]=t;return!(V2(n,e)&&V2(r,e))})(Z2(t.getLocalBounds()),e)&&dJ(t)})),t),t3=t=>t;function e3(t,e){t&&r3.hasOwnProperty(t.type)&&r3[t.type](t,e)}var n3={Feature:function(t,e){e3(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)e3(n[r].geometry,e)}},r3={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 n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){i3(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)i3(n[r],e,0)},Polygon:function(t,e){o3(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)o3(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)e3(n[r],e)}};function i3(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function o3(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)i3(t[n],e,1);e.polygonEnd()}function a3(t,e){t&&n3.hasOwnProperty(t.type)?n3[t.type](t,e):e3(t,e)}class s3{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var u3=1e-6,l3=1e-12,c3=Math.PI,h3=c3/2,p3=c3/4,f3=2*c3,d3=180/c3,m3=c3/180,g3=Math.abs,y3=Math.atan,v3=Math.atan2,_3=Math.cos,b3=Math.ceil,x3=Math.exp,w3=(Math.floor,Math.hypot,Math.log),S3=Math.pow,E3=Math.sin,M3=Math.sign||function(t){return t>0?1:t<0?-1:0},T3=Math.sqrt,A3=Math.tan;function C3(t){return t>1?0:t<-1?c3:Math.acos(t)}function O3(t){return t>1?h3:t<-1?-h3:Math.asin(t)}function P3(){}var k3,L3,I3,R3,D3=new s3,N3=new s3,F3={point:P3,lineStart:P3,lineEnd:P3,polygonStart:function(){F3.lineStart=z3,F3.lineEnd=U3},polygonEnd:function(){F3.lineStart=F3.lineEnd=F3.point=P3,D3.add(g3(N3)),N3=new s3},result:function(){var t=D3/2;return D3=new s3,t}};function z3(){F3.point=B3}function B3(t,e){F3.point=j3,k3=I3=t,L3=R3=e}function j3(t,e){N3.add(R3*t-I3*e),I3=t,R3=e}function U3(){j3(k3,L3)}const Z3=F3;var V3=1/0,G3=V3,H3=-V3,W3=H3,q3={point:function(t,e){t<V3&&(V3=t),t>H3&&(H3=t),e<G3&&(G3=e),e>W3&&(W3=e)},lineStart:P3,lineEnd:P3,polygonStart:P3,polygonEnd:P3,result:function(){var t=[[V3,G3],[H3,W3]];return H3=W3=-(G3=V3=1/0),t}};const Y3=q3;var X3,$3,K3,J3,Q3=0,t5=0,e5=0,n5=0,r5=0,i5=0,o5=0,a5=0,s5=0,u5={point:l5,lineStart:c5,lineEnd:f5,polygonStart:function(){u5.lineStart=d5,u5.lineEnd=m5},polygonEnd:function(){u5.point=l5,u5.lineStart=c5,u5.lineEnd=f5},result:function(){var t=s5?[o5/s5,a5/s5]:i5?[n5/i5,r5/i5]:e5?[Q3/e5,t5/e5]:[NaN,NaN];return Q3=t5=e5=n5=r5=i5=o5=a5=s5=0,t}};function l5(t,e){Q3+=t,t5+=e,++e5}function c5(){u5.point=h5}function h5(t,e){u5.point=p5,l5(K3=t,J3=e)}function p5(t,e){var n=t-K3,r=e-J3,i=T3(n*n+r*r);n5+=i*(K3+t)/2,r5+=i*(J3+e)/2,i5+=i,l5(K3=t,J3=e)}function f5(){u5.point=l5}function d5(){u5.point=g5}function m5(){y5(X3,$3)}function g5(t,e){u5.point=y5,l5(X3=K3=t,$3=J3=e)}function y5(t,e){var n=t-K3,r=e-J3,i=T3(n*n+r*r);n5+=i*(K3+t)/2,r5+=i*(J3+e)/2,i5+=i,o5+=(i=J3*t-K3*e)*(K3+t),a5+=i*(J3+e),s5+=3*i,l5(K3=t,J3=e)}const v5=u5;function _5(t){this._context=t}_5.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,f3)}},result:P3};var b5,x5,w5,S5,E5,M5=new s3,T5={point:P3,lineStart:function(){T5.point=A5},lineEnd:function(){b5&&C5(x5,w5),T5.point=P3},polygonStart:function(){b5=!0},polygonEnd:function(){b5=null},result:function(){var t=+M5;return M5=new s3,t}};function A5(t,e){T5.point=C5,x5=S5=t,w5=E5=e}function C5(t,e){S5-=t,E5-=e,M5.add(T3(S5*S5+E5*E5)),S5=t,E5=e}const O5=T5;let P5,k5,L5,I5;class R5{constructor(t){this._append=null==t?D5:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return D5;if(e!==P5){const t=10**e;P5=e,k5=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return k5}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==L5||this._append!==k5){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,L5=t,k5=this._append,I5=this._,this._=e}this._+=I5}}result(){const t=this._;return this._="",t.length?t:null}}function D5(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function N5(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),a3(t,n(r))),r.result()}return a.area=function(t){return a3(t,n(Z3)),Z3.result()},a.measure=function(t){return a3(t,n(O5)),O5.result()},a.bounds=function(t){return a3(t,n(Y3)),Y3.result()},a.centroid=function(t){return a3(t,n(v5)),v5.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,t3):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new R5(i)):new _5(e=t),"function"!=typeof o&&r.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new R5(i)),a},a.projection(t).digits(i).context(e)}function F5(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function z5(t,e,n){var r=F5(t,e-u3,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function B5(t,e,n){var r=F5(t,e-u3,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function j5(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:P3,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function U5(t,e){return g3(t[0]-e[0])<u3&&g3(t[1]-e[1])<u3}function Z5(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function V5(t,e,n,r,i){var o,a,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(U5(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2*u3}s.push(n=new Z5(r,t,null,!0)),u.push(n.o=new Z5(r,null,n,!1)),s.push(n=new Z5(a,t,null,!1)),u.push(n.o=new Z5(a,null,n,!0))}})),s.length){for(u.sort(e),G5(s),G5(u),o=0,a=u.length;o<a;++o)u[o].e=n=!n;for(var l,c,h=s[0];;){for(var p=h,f=!0;p.v;)if((p=p.n)===h)return;l=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,a=l.length;o<a;++o)i.point((c=l[o])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(f)for(l=p.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}l=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}}function G5(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function H5(t){return[v3(t[1],t[0]),O3(t[2])]}function W5(t){var e=t[0],n=t[1],r=_3(n);return[r*_3(e),r*E3(e),E3(n)]}function q5(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Y5(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 X5(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function $5(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function K5(t){var e=T3(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function J5(t){return g3(t[0])<=c3?t[0]:M3(t[0])*((g3(t[0])+c3)%f3-c3)}function Q5(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function t4(t,e,n,r){return function(i){var o,a,s,u=e(i),l=j5(),c=e(l),h=!1,p={point:f,lineStart:m,lineEnd:g,polygonStart:function(){p.point=y,p.lineStart=v,p.lineEnd=_,a=[],o=[]},polygonEnd:function(){p.point=f,p.lineStart=m,p.lineEnd=g,a=Q5(a);var t=function(t,e){var n=J5(e),r=e[1],i=E3(r),o=[E3(n),-_3(n),0],a=0,s=0,u=new s3;1===i?r=h3+u3:-1===i&&(r=-h3-u3);for(var l=0,c=t.length;l<c;++l)if(p=(h=t[l]).length)for(var h,p,f=h[p-1],d=J5(f),m=f[1]/2+p3,g=E3(m),y=_3(m),v=0;v<p;++v,d=b,g=w,y=S,f=_){var _=h[v],b=J5(_),x=_[1]/2+p3,w=E3(x),S=_3(x),E=b-d,M=E>=0?1:-1,T=M*E,A=T>c3,C=g*w;if(u.add(v3(C*M*E3(T),y*S+C*_3(T))),a+=A?E+M*f3:E,A^d>=n^b>=n){var O=Y5(W5(f),W5(_));K5(O);var P=Y5(o,O);K5(P);var k=(A^E>=0?-1:1)*O3(P[2]);(r>k||r===k&&(O[0]||O[1]))&&(s+=A^E>=0?1:-1)}}return(a<-u3||a<u3&&u<-l3)^1&s}(o,r);a.length?(h||(i.polygonStart(),h=!0),V5(a,n4,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(e,n){t(e,n)&&i.point(e,n)}function d(t,e){u.point(t,e)}function m(){p.point=d,u.lineStart()}function g(){p.point=f,u.lineEnd()}function y(t,e){s.push([t,e]),c.point(t,e)}function v(){c.lineStart(),s=[]}function _(){y(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,u=c.clean(),p=l.result(),f=p.length;if(s.pop(),o.push(s),s=null,f)if(1&u){if((e=(n=p[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else f>1&&2&u&&p.push(p.pop().concat(p.shift())),a.push(p.filter(e4))}return p}}function e4(t){return t.length>1}function n4(t,e){return((t=t.x)[0]<0?t[1]-h3-u3:h3-t[1])-((e=e.x)[0]<0?e[1]-h3-u3:h3-e[1])}const r4=t4((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?c3:-c3,u=g3(o-n);g3(u-c3)<u3?(t.point(n,r=(r+a)/2>0?h3:-h3),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=c3&&(g3(n-i)<u3&&(n-=i*u3),g3(o-s)<u3&&(o-=s*u3),r=function(t,e,n,r){var i,o,a=E3(t-n);return g3(a)>u3?y3((E3(e)*(o=_3(r))*E3(n)-E3(r)*(i=_3(e))*E3(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*h3,r.point(-c3,i),r.point(0,i),r.point(c3,i),r.point(c3,0),r.point(c3,-i),r.point(0,-i),r.point(-c3,-i),r.point(-c3,0),r.point(-c3,i);else if(g3(t[0]-e[0])>u3){var o=t[0]<e[0]?c3:-c3;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-c3,-h3]);function i4(t,e){(e=W5(e))[0]-=t,K5(e);var n=C3(-e[1]);return((-e[2]<0?-n:n)+f3-u3)%f3}var o4=1e9,a4=-o4;function s4(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var c=0,h=0;if(null==i||(c=a(i,s))!==(h=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==h);else l.point(o[0],o[1])}function a(r,i){return g3(r[0]-t)<u3?i>0?0:3:g3(r[0]-n)<u3?i>0?2:1:g3(r[1]-e)<u3?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,h,p,f,d,m,g,y,v,_=a,b=j5(),x={point:w,lineStart:function(){x.point=S,l&&l.push(c=[]),y=!0,g=!1,d=m=NaN},lineEnd:function(){u&&(S(h,p),f&&g&&b.rejoin(),u.push(b.result())),x.point=w,g&&_.lineEnd()},polygonStart:function(){_=b,u=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,s=l[n],u=1,c=s.length,h=s[0],p=h[0],f=h[1];u<c;++u)o=p,a=f,p=(h=s[u])[0],f=h[1],a<=r?f>r&&(p-o)*(r-a)>(f-a)*(t-o)&&++e:f<=r&&(p-o)*(r-a)<(f-a)*(t-o)&&--e;return e}(),n=v&&e,i=(u=Q5(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&V5(u,s,e,o,a),a.polygonEnd()),_=a,u=l=c=null}};function w(t,e){i(t,e)&&_.point(t,e)}function S(o,a){var s=i(o,a);if(l&&c.push([o,a]),y)h=o,p=a,f=s,y=!1,s&&(_.lineStart(),_.point(o,a));else if(s&&g)_.point(o,a);else{var u=[d=Math.max(a4,Math.min(o4,d)),m=Math.max(a4,Math.min(o4,m))],b=[o=Math.max(a4,Math.min(o4,o)),a=Math.max(a4,Math.min(o4,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],l=0,c=1,h=e[0]-s,p=e[1]-u;if(a=n-s,h||!(a>0)){if(a/=h,h<0){if(a<l)return;a<c&&(c=a)}else if(h>0){if(a>c)return;a>l&&(l=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a<l)return;a<c&&(c=a)}if(a=r-u,p||!(a>0)){if(a/=p,p<0){if(a<l)return;a<c&&(c=a)}else if(p>0){if(a>c)return;a>l&&(l=a)}if(a=o-u,p||!(a<0)){if(a/=p,p<0){if(a>c)return;a>l&&(l=a)}else if(p>0){if(a<l)return;a<c&&(c=a)}return l>0&&(t[0]=s+l*h,t[1]=u+l*p),c<1&&(e[0]=s+c*h,e[1]=u+c*p),!0}}}}}(u,b,t,e,n,r)?s&&(_.lineStart(),_.point(o,a),v=!1):(g||(_.lineStart(),_.point(u[0],u[1])),_.point(b[0],b[1]),s||_.lineEnd(),v=!1)}d=o,m=a,g=s}return x}}function u4(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function l4(t,e){return g3(t)>c3&&(t-=Math.round(t/f3)*f3),[t,e]}function c4(t,e,n){return(t%=f3)?e||n?u4(p4(t),f4(e,n)):p4(t):e||n?f4(e,n):l4}function h4(t){return function(e,n){return g3(e+=t)>c3&&(e-=Math.round(e/f3)*f3),[e,n]}}function p4(t){var e=h4(t);return e.invert=h4(-t),e}function f4(t,e){var n=_3(t),r=E3(t),i=_3(e),o=E3(e);function a(t,e){var a=_3(e),s=_3(t)*a,u=E3(t)*a,l=E3(e),c=l*n+s*r;return[v3(u*i-c*o,s*n-l*r),O3(c*i+u*o)]}return a.invert=function(t,e){var a=_3(e),s=_3(t)*a,u=E3(t)*a,l=E3(e),c=l*i-u*o;return[v3(u*i+l*o,s*n+c*r),O3(c*n-s*r)]},a}function d4(t){return function(e){var n=new m4;for(var r in t)n[r]=t[r];return n.stream=e,n}}function m4(){}function g4(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),a3(n,t.stream(Y3)),e(Y3.result()),null!=r&&t.clipExtent(r),t}function y4(t,e,n){return g4(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function v4(t,e,n){return y4(t,[[0,0],e],n)}function _4(t,e,n){return g4(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function b4(t,e,n){return g4(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}l4.invert=l4,m4.prototype={constructor:m4,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 x4=16,w4=_3(30*m3);function S4(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,l,c,h,p,f,d,m,g){var y=l-r,v=c-i,_=y*y+v*v;if(_>4*e&&m--){var b=a+p,x=s+f,w=u+d,S=T3(b*b+x*x+w*w),E=O3(w/=S),M=g3(g3(w)-1)<u3||g3(o-h)<u3?(o+h)/2:v3(x,b),T=t(M,E),A=T[0],C=T[1],O=A-r,P=C-i,k=v*O-y*P;(k*k/_>e||g3((y*O+v*P)/_-.5)>.3||a*p+s*f+u*d<w4)&&(n(r,i,o,a,s,u,A,C,M,b/=S,x/=S,w,m,g),g.point(A,C),n(A,C,M,b,x,w,l,c,h,p,f,d,m,g))}}return function(e){var r,i,o,a,s,u,l,c,h,p,f,d,m={point:g,lineStart:y,lineEnd:_,polygonStart:function(){e.polygonStart(),m.lineStart=b},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function g(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,m.point=v,e.lineStart()}function v(r,i){var o=W5([r,i]),a=t(r,i);n(c,h,l,p,f,d,c=a[0],h=a[1],l=r,p=o[0],f=o[1],d=o[2],x4,e),e.point(c,h)}function _(){m.point=g,e.lineEnd()}function b(){y(),m.point=x,m.lineEnd=w}function x(t,e){v(r=t,e),i=c,o=h,a=p,s=f,u=d,m.point=v}function w(){n(c,h,l,p,f,d,i,o,r,a,s,u,x4,e),m.lineEnd=_,_()}return m}}(t,e):function(t){return d4({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var E4=d4({point:function(t,e){this.stream.point(t*m3,e*m3)}});function M4(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=_3(o),s=E3(o),u=a*t,l=s*t,c=a/t,h=s/t,p=(s*n-a*e)/t,f=(s*e+a*n)/t;function d(t,o){return[u*(t*=r)-l*(o*=i)+e,n-l*t-u*o]}return d.invert=function(t,e){return[r*(c*t-h*e+p),i*(f-h*t-c*e)]},d}function T4(t){return A4((function(){return t}))()}function A4(t){var e,n,r,i,o,a,s,u,l,c,h=150,p=480,f=250,d=0,m=0,g=0,y=0,v=0,_=0,b=1,x=1,w=null,S=r4,E=null,M=t3,T=.5;function A(t){return u(t[0]*m3,t[1]*m3)}function C(t){return(t=u.invert(t[0],t[1]))&&[t[0]*d3,t[1]*d3]}function O(){var t=M4(h,0,0,b,x,_).apply(null,e(d,m)),r=M4(h,p-t[0],f-t[1],b,x,_);return n=c4(g,y,v),s=u4(e,r),u=u4(n,s),a=S4(s,T),P()}function P(){return l=c=null,A}return A.stream=function(t){return l&&c===t?l:l=E4(function(t){return d4({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(S(a(M(c=t)))))},A.preclip=function(t){return arguments.length?(S=t,w=void 0,P()):S},A.postclip=function(t){return arguments.length?(M=t,E=r=i=o=null,P()):M},A.clipAngle=function(t){return arguments.length?(S=+t?function(t){var e=_3(t),n=6*m3,r=e>0,i=g3(e)>u3;function o(t,n){return _3(t)*_3(n)>e}function a(t,n,r){var i=[1,0,0],o=Y5(W5(t),W5(n)),a=q5(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var l=e*a/u,c=-e*s/u,h=Y5(i,o),p=$5(i,l);X5(p,$5(o,c));var f=h,d=q5(p,f),m=q5(f,f),g=d*d-m*(q5(p,p)-1);if(!(g<0)){var y=T3(g),v=$5(f,(-d-y)/m);if(X5(v,p),v=H5(v),!r)return v;var _,b=t[0],x=n[0],w=t[1],S=n[1];x<b&&(_=b,b=x,x=_);var E=x-b,M=g3(E-c3)<u3;if(!M&&S<w&&(_=w,w=S,S=_),M||E<u3?M?w+S>0^v[1]<(g3(v[0]-b)<u3?w:S):w<=v[1]&&v[1]<=S:E>c3^(b<=v[0]&&v[0]<=x)){var T=$5(f,(-d+y)/m);return X5(T,p),[v,H5(T)]}}}function s(e,n){var i=r?t:c3-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return t4(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,d=[h,p],m=o(h,p),g=r?m?0:s(h,p):m?s(h+(h<0?c3:-c3),p):0;if(!e&&(l=u=m)&&t.lineStart(),m!==u&&(!(f=a(e,d))||U5(e,f)||U5(d,f))&&(d[2]=1),m!==u)c=0,m?(t.lineStart(),f=a(d,e),t.point(f[0],f[1])):(f=a(e,d),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(i&&e&&r^m){var y;g&n||!(y=a(d,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!m||e&&U5(e,d)||t.point(d[0],d[1]),e=d,u=m,n=g},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var a=_3(e),s=E3(e),u=r*n;null==i?(i=e+r*f3,o=e-u/2):(i=i4(a,i),o=i4(a,o),(r>0?i<o:i>o)&&(i+=r*f3));for(var l,c=i;r>0?c>o:c<o;c-=u)l=H5([a,-s*_3(c),-s*E3(c)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)}),r?[0,-t]:[-c3,t-c3])}(w=t*m3):(w=null,r4),P()):w*d3},A.clipExtent=function(t){return arguments.length?(M=null==t?(E=r=i=o=null,t3):s4(E=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==E?null:[[E,r],[i,o]]},A.scale=function(t){return arguments.length?(h=+t,O()):h},A.translate=function(t){return arguments.length?(p=+t[0],f=+t[1],O()):[p,f]},A.center=function(t){return arguments.length?(d=t[0]%360*m3,m=t[1]%360*m3,O()):[d*d3,m*d3]},A.rotate=function(t){return arguments.length?(g=t[0]%360*m3,y=t[1]%360*m3,v=t.length>2?t[2]%360*m3:0,O()):[g*d3,y*d3,v*d3]},A.angle=function(t){return arguments.length?(_=t%360*m3,O()):_*d3},A.reflectX=function(t){return arguments.length?(b=t?-1:1,O()):b<0},A.reflectY=function(t){return arguments.length?(x=t?-1:1,O()):x<0},A.precision=function(t){return arguments.length?(a=S4(s,T=t*t),P()):T3(T)},A.fitExtent=function(t,e){return y4(A,t,e)},A.fitSize=function(t,e){return v4(A,t,e)},A.fitWidth=function(t,e){return _4(A,t,e)},A.fitHeight=function(t,e){return b4(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&C,O()}}function C4(t){var e=0,n=c3/3,r=A4(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*m3,n=t[1]*m3):[e*d3,n*d3]},i}function O4(t,e){var n=E3(t),r=(n+E3(e))/2;if(g3(r)<u3)return function(t){var e=_3(t);function n(t,n){return[t*e,E3(n)/e]}return n.invert=function(t,n){return[t/e,O3(n*e)]},n}(t);var i=1+n*(2*r-n),o=T3(i)/r;function a(t,e){var n=T3(i-2*r*E3(e))/r;return[n*E3(t*=r),o-n*_3(t)]}return a.invert=function(t,e){var n=o-e,a=v3(t,g3(n))*M3(n);return n*r<0&&(a-=c3*M3(t)*M3(n)),[a/r,O3((i-(t*t+n*n)*r*r)/(2*r))]},a}function P4(){return C4(O4).scale(155.424).center([0,33.6442])}function k4(){return P4().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function L4(){var t,e,n,r,i,o,a=k4(),s=P4().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=P4().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function c(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function h(){return t=e=null,c}return c.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},c.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},c.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),u.precision(t),h()):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),u.scale(t),c.translate(a.translate())):a.scale()},c.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],c=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,c-.238*e],[o+.455*e,c+.238*e]]).stream(l),r=s.translate([o-.307*e,c+.201*e]).clipExtent([[o-.425*e+u3,c+.12*e+u3],[o-.214*e-u3,c+.234*e-u3]]).stream(l),i=u.translate([o-.205*e,c+.212*e]).clipExtent([[o-.214*e+u3,c+.166*e+u3],[o-.115*e-u3,c+.234*e-u3]]).stream(l),h()},c.fitExtent=function(t,e){return y4(c,t,e)},c.fitSize=function(t,e){return v4(c,t,e)},c.fitWidth=function(t,e){return _4(c,t,e)},c.fitHeight=function(t,e){return b4(c,t,e)},c.scale(1070)}function I4(t){return function(e,n){var r=_3(e),i=_3(n),o=t(r*i);return o===1/0?[2,0]:[o*i*E3(e),o*E3(n)]}}function R4(t){return function(e,n){var r=T3(e*e+n*n),i=t(r),o=E3(i),a=_3(i);return[v3(e*o,r*a),O3(r&&n*o/r)]}}var D4=I4((function(t){return T3(2/(1+t))}));function N4(){return T4(D4).scale(124.75).clipAngle(179.999)}D4.invert=R4((function(t){return 2*O3(t/2)}));var F4=I4((function(t){return(t=C3(t))&&t/E3(t)}));function z4(){return T4(F4).scale(79.4188).clipAngle(179.999)}function B4(t,e){return[t,w3(A3((h3+e)/2))]}function j4(){return U4(B4).scale(961/f3)}function U4(t){var e,n,r,i=T4(t),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,l=null;function c(){var o=c3*a(),s=i(function(t){function e(e){return(e=t(e[0]*m3,e[1]*m3))[0]*=d3,e[1]*=d3,e}return t=c4(t[0]*m3,t[1]*m3,t.length>2?t[2]*m3:0),e.invert=function(e){return(e=t.invert(e[0]*m3,e[1]*m3))[0]*=d3,e[1]*=d3,e},e}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===B4?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),c()):a()},i.translate=function(t){return arguments.length?(s(t),c()):s()},i.center=function(t){return arguments.length?(o(t),c()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==l?null:[[l,e],[n,r]]},c()}function Z4(t){return A3((h3+t)/2)}function V4(t,e){var n=_3(t),r=t===e?E3(t):w3(n/_3(e))/w3(Z4(e)/Z4(t)),i=n*S3(Z4(t),r)/r;if(!r)return B4;function o(t,e){i>0?e<-h3+u3&&(e=-h3+u3):e>h3-u3&&(e=h3-u3);var n=i/S3(Z4(e),r);return[n*E3(r*t),i-n*_3(r*t)]}return o.invert=function(t,e){var n=i-e,o=M3(r)*T3(t*t+n*n),a=v3(t,g3(n))*M3(n);return n*r<0&&(a-=c3*M3(t)*M3(n)),[a/r,2*y3(S3(i/o,1/r))-h3]},o}function G4(){return C4(V4).scale(109.5).parallels([30,30])}function H4(t,e){return[t,e]}function W4(){return T4(H4).scale(152.63)}function q4(t,e){var n=_3(t),r=t===e?E3(t):(n-_3(e))/(e-t),i=n/r+t;if(g3(r)<u3)return H4;function o(t,e){var n=i-e,o=r*t;return[n*E3(o),i-n*_3(o)]}return o.invert=function(t,e){var n=i-e,o=v3(t,g3(n))*M3(n);return n*r<0&&(o-=c3*M3(t)*M3(n)),[o/r,i-M3(r)*T3(t*t+n*n)]},o}function Y4(){return C4(q4).scale(131.154).center([0,13.9389])}F4.invert=R4((function(t){return t})),B4.invert=function(t,e){return[t,2*y3(x3(e))-h3]},H4.invert=H4;var X4=1.340264,$4=-.081106,K4=893e-6,J4=.003796,Q4=T3(3)/2;function t6(t,e){var n=O3(Q4*E3(e)),r=n*n,i=r*r*r;return[t*_3(n)/(Q4*(X4+3*$4*r+i*(7*K4+9*J4*r))),n*(X4+$4*r+i*(K4+J4*r))]}function e6(){return T4(t6).scale(177.158)}function n6(t,e){var n=_3(e),r=_3(t)*n;return[n*E3(t)/r,E3(e)/r]}function r6(){return T4(n6).scale(144.049).clipAngle(60)}function i6(){var t,e,n,r,i,o,a,s=1,u=0,l=0,c=1,h=1,p=0,f=null,d=1,m=1,g=d4({point:function(t,e){var n=_([t,e]);this.stream.point(n[0],n[1])}}),y=t3;function v(){return d=s*c,m=s*h,o=a=null,_}function _(n){var r=n[0]*d,i=n[1]*m;if(p){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+u,i+l]}return _.invert=function(n){var r=n[0]-u,i=n[1]-l;if(p){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/d,i/m]},_.stream=function(t){return o&&a===t?o:o=g(y(a=t))},_.postclip=function(t){return arguments.length?(y=t,f=n=r=i=null,v()):y},_.clipExtent=function(t){return arguments.length?(y=null==t?(f=n=r=i=null,t3):s4(f=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),v()):null==f?null:[[f,n],[r,i]]},_.scale=function(t){return arguments.length?(s=+t,v()):s},_.translate=function(t){return arguments.length?(u=+t[0],l=+t[1],v()):[u,l]},_.angle=function(n){return arguments.length?(e=E3(p=n%360*m3),t=_3(p),v()):p*d3},_.reflectX=function(t){return arguments.length?(c=t?-1:1,v()):c<0},_.reflectY=function(t){return arguments.length?(h=t?-1:1,v()):h<0},_.fitExtent=function(t,e){return y4(_,t,e)},_.fitSize=function(t,e){return v4(_,t,e)},_.fitWidth=function(t,e){return _4(_,t,e)},_.fitHeight=function(t,e){return b4(_,t,e)},_}function o6(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function a6(){return T4(o6).scale(175.295)}function s6(t,e){return[_3(e)*E3(t),E3(e)]}function u6(){return T4(s6).scale(249.5).clipAngle(90+u3)}function l6(t,e){var n=_3(e),r=1+_3(t)*n;return[n*E3(t)/r,E3(e)/r]}function c6(){return T4(l6).scale(250).clipAngle(142)}function h6(t,e){return[w3(A3((h3+e)/2)),-t]}function p6(){var t=U4(h6),e=t.center,n=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?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}t6.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(X4+$4*i+o*(K4+J4*i))-e)/(X4+3*$4*i+o*(7*K4+9*J4*i)))*r)*i*i,!(g3(n)<l3));++a);return[Q4*t*(X4+3*$4*i+o*(7*K4+9*J4*i))/_3(r),O3(E3(r)/Q4)]},n6.invert=R4(y3),o6.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(g3(n)>u3&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},s6.invert=R4(O3),l6.invert=R4((function(t){return 2*y3(t)})),h6.invert=function(t,e){return[-e,2*y3(x3(t))-h3]};function f6(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return"graticule10"===n?Object.assign(Object.assign({},t),{data:{value:[function(){var t,e,n,r,i,o,a,s,u,l,c,h,p=10,f=p,d=90,m=360,g=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return F5(b3(r/d)*d,n,d).map(c).concat(F5(b3(s/m)*m,a,m).map(h)).concat(F5(b3(e/p)*p,t,p).filter((function(t){return g3(t%d)>u3})).map(u)).concat(F5(b3(o/f)*f,i,f).filter((function(t){return g3(t%m)>u3})).map(l))}return y.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(h(a).slice(1),c(n).reverse().slice(1),h(s).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),y.precision(g)):[[e,o],[t,i]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(d=+t[0],m=+t[1],y):[d,m]},y.stepMinor=function(t){return arguments.length?(p=+t[0],f=+t[1],y):[p,f]},y.precision=function(p){return arguments.length?(g=+p,u=z5(o,i,90),l=B5(e,t,g),c=z5(s,a,90),h=B5(r,n,g),y):g},y.extentMajor([[-180,-90+u3],[180,90-u3]]).extentMinor([[-180,-80-u3],[180,80+u3]])}()()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function d6(t){return"geoPath"===t.type}const m6=()=>t=>{const{children:e,coordinate:r={}}=t;if(!Array.isArray(e))return[];const{type:i="equalEarth"}=r,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(r,["type"]),a=function(t){if("function"==typeof t)return t;const e=`geo${NX(t)}`,r=n[e];if(!r)throw new Error(`Unknown coordinate: ${t}`);return r}(i),s=e.map(f6);let u;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=a();(function(t,e,n,r){const i=()=>{const t=e.filter(d6),n=t.find((t=>t.sphere));return n?{type:"Sphere"}:(r=t.filter((t=>!t.sphere)).flatMap((t=>t.data.value)),{type:"FeatureCollection",features:r.flatMap((t=>function(t){if(!t||!t.type)return null;const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0:null}(t).features))});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;"fitExtent"===a?function(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}(t,o,n):"fitWidth"===a&&function(t,e,n){const{width:r,height:i}=n,[[o,a],[s,u]]=N5(t.fitWidth(r,e)).bounds(e),l=Math.ceil(u-a),c=Math.min(Math.ceil(s-o),l),h=t.scale()*(c-1)/c,[p,f]=t.translate(),d=f+(i-l)/2;t.scale(h).translate([p,d]).precision(.2)}(t,o,n)})(i,s,{x:t,y:e,width:n,height:r},o),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(i,o),u=N5(i);const l=new KU({domain:[t,t+n]}),c=new KU({domain:[e,e+r]});return{transform:t=>(t=>{const e=i(t);if(!e)return null;const[n,r]=e;return[l.map(n),c.map(r)]})(t),untransform:t=>(t=>{if(!t)return null;const[e,n]=t,r=[l.invert(e),c.invert(n)];return i.invert(r)})(t)}}]]}},children:s.flatMap((t=>d6(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:YF(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>u(t)||[]})})}(t):t))})]};m6.props={};const g6=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:u}=t,l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},l),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:o,animate:a,state:u}]})]};g6.props={};const y6={"composition.geoView":m6,"composition.geoPath":g6};function v6(){return Object.assign({"data.fetch":RB,"data.inline":ZB,"data.sortBy":UB,"data.sort":zB,"data.filter":FB,"data.pick":BB,"data.rename":jB,"data.fold":DB,"data.slice":wj,"data.custom":VB,"data.map":GB,"data.cluster":SB,"data.tree":EB,"data.sankey":kF,"data.arc":$B,"data.wordCloud":_j,"data.join":xj,"data.kde":Mj,"transform.maybeZeroY1":l1,"transform.maybeZeroX":S1,"transform.maybeStackY":x1,"transform.maybeTitle":w1,"transform.maybeSeries":A1,"transform.maybeZeroPadding":I1,"transform.stackY":_1,"transform.binX":z2,"transform.bin":F2,"transform.dodgeX":B1,"transform.jitter":q1,"transform.jitterX":Y1,"transform.symmetryY":X1,"transform.diffY":$1,"transform.stackEnter":j1,"transform.normalizeY":G1,"transform.select":e2,"transform.selectX":n2,"transform.selectY":r2,"transform.groupX":m2,"transform.groupY":g2,"transform.groupColor":y2,"transform.group":d2,"transform.maybeSize":M1,"transform.maybeZeroY":E1,"transform.maybeKey":T1,"transform.sortX":b2,"transform.sortY":w2,"transform.sortColor":x2,"transform.flexX":S2,"transform.maybeTupleY":C1,"transform.maybeTupleX":O1,"transform.maybeIdentityY":P1,"transform.maybeIdentityX":k1,"transform.maybeTuple":F1,"transform.maybeVisualPosition":D1,"transform.maybeFunctionAttribute":N1,"transform.maybeGradient":z1,"transform.maybeTooltip":L1,"transform.pack":M2,"transform.sample":j2,"transform.filter":U2,"coordinate.cartesian":HD,"coordinate.polar":qD,"coordinate.helix":YD,"coordinate.transpose":XD,"coordinate.theta":$D,"coordinate.parallel":QD,"coordinate.fisheye":tN,"coordinate.radial":JD,"coordinate.radar":eN,"encode.constant":nN,"encode.field":iN,"encode.transform":rN,"encode.column":oN,"mark.interval":RN,"mark.rect":DN,"mark.line":JN,"mark.point":QN,"mark.text":tF,"mark.cell":eF,"mark.area":nF,"mark.link":rF,"mark.image":iF,"mark.polygon":oF,"mark.box":aF,"mark.vector":sF,"mark.lineX":lF,"mark.lineY":uF,"mark.connector":cF,"mark.range":fF,"mark.rangeX":dF,"mark.rangeY":mF,"mark.sankey":KF,"mark.path":JF,"mark.treemap":pz,"mark.pack":Pz,"mark.boxplot":$z,"mark.shape":Kz,"mark.forceGraph":cB,"mark.gauge":eV,"mark.tree":MB,"mark.wordCloud":Tj,"mark.density":nV,"mark.heatmap":rV,"palette.category10":iV,"palette.category20":oV,"scale.linear":sV,"scale.ordinal":uV,"scale.band":aV,"scale.identity":lV,"scale.point":cV,"scale.time":hV,"scale.log":pV,"scale.pow":fV,"scale.sqrt":yV,"scale.threshold":dV,"scale.quantile":mV,"scale.quantize":gV,"scale.sequential":vV,"scale.constant":_V,"shape.interval.rect":KV,"shape.interval.hollow":JV,"shape.interval.funnel":cG,"shape.interval.pyramid":pG,"shape.rect.rect":KV,"shape.rect.hollow":JV,"shape.cell.cell":KV,"shape.cell.hollow":JV,"shape.line.line":xG,"shape.line.hv":DG,"shape.line.vh":NG,"shape.line.hvh":FG,"shape.line.smooth":PG,"shape.point.bowtie":mH,"shape.point.cross":gH,"shape.point.diamond":yH,"shape.point.hexagon":vH,"shape.point.hollowBowtie":_H,"shape.point.hollowDiamond":bH,"shape.point.hollowHexagon":xH,"shape.point.hollow":wH,"shape.point.hollowSquare":SH,"shape.point.hollowTriangle":EH,"shape.point.hollowTriangleDown":MH,"shape.point.hyphen":TH,"shape.point.line":AH,"shape.point.plus":CH,"shape.point.point":OH,"shape.point.square":PH,"shape.point.tick":kH,"shape.point.triangle":LH,"shape.point.triangleDown":IH,"shape.text.text":uW,"shape.area.area":gW,"shape.area.smooth":yW,"shape.area.hvh":vW,"shape.area.vh":_W,"shape.area.hv":bW,"shape.link.smooth":SW,"shape.link.vhv":MW,"shape.link.arc":AW,"shape.link.link":xW,"shape.image.image":OW,"shape.polygon.polygon":kW,"shape.polygon.ribbon":IW,"shape.box.box":DW,"shape.box.violin":FW,"shape.vector.vector":DH,"shape.label.label":uq,"shape.text.badge":hW,"shape.lineX.line":BW,"shape.lineY.line":BW,"shape.shape.shape":bq,"shape.connector.connector":VW,"shape.range.range":KV,"shape.rangeX.range":KV,"shape.rangeY.range":KV,"shape.path.path":hq,"shape.path.hollow":pq,"shape.density.density":dq,"shape.heatmap.heatmap":_q,"theme.classic":Sq,"theme.classicDark":Tq,"theme.academy":Oq,"component.axisX":e$,"component.axisY":n$,"component.axisRadar":i$,"component.axisLinear":QX,"component.axisArc":t$,"component.legendCategory":O$,"component.legendContinuous":J$,"component.legendContinuousBlock":Q$,"component.legendContinuousBlockSize":eK,"component.legendContinuousSize":tK,"component.title":oK,"component.sliderX":RK,"component.sliderY":DK,"component.scrollbarX":zK,"component.scrollbarY":BK,"animation.scaleInX":HK,"animation.scaleOutX":WK,"animation.scaleInY":qK,"animation.scaleOutY":YK,"animation.waveIn":oJ,"animation.fadeIn":XK,"animation.fadeOut":$K,"animation.zoomIn":aJ,"animation.zoomOut":sJ,"animation.pathIn":uJ,"animation.morphing":iJ,"animation.growInX":lJ,"animation.growInY":cJ,"interaction.elementHighlight":NJ,"interaction.elementHighlightByX":FJ,"interaction.elementHighlightByColor":zJ,"interaction.elementSelect":jJ,"interaction.elementSelectByX":UJ,"interaction.elementSelectByColor":ZJ,"interaction.fisheye":qJ,"interaction.chartIndex":WJ,"interaction.tooltip":bQ,"interaction.legendFilter":kQ,"interaction.legendHighlight":LQ,"interaction.brushHighlight":ZQ,"interaction.brushXHighlight":GQ,"interaction.brushYHighlight":WQ,"interaction.brushAxisHighlight":r0,"interaction.brushFilter":a0,"interaction.brushXFilter":s0,"interaction.brushYFilter":u0,"interaction.sliderFilter":f0,"interaction.poptip":v0,"interaction.event":rQ,"composition.spaceLayer":w0,"composition.spaceFlex":E0,"composition.mark":A0,"composition.view":T0,"composition.facetRect":j0,"composition.repeatMatrix":W0,"composition.facetCircle":J0,"composition.timingKeyframe":t1,"labelTransform.overlapHide":G2,"labelTransform.overlapDodgeY":Y2,"labelTransform.overflowHide":Q2,"labelTransform.contrastReverse":J2},y6)}const _6=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var b6=s(2095),x6=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function w6(t,e){const n=n=>{if("string"!=typeof n)return n;const r=`${t}.${n}`;return e[r]||FF(`Unknown Component: ${r}`)};return[t=>{const{type:e}=t,r=x6(t,["type"]);return n(e)(Object.assign({},r))},n]}var S6=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function E6(t,e){const{coordinate:n={}}=t,r=S6(t,["coordinate"]),{type:i,transform:o=[]}=n,a=S6(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=w6("coordinate",e),{transform:u=!1}=s(i).props||{};if(u)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function M6(t,e){return t.filter((t=>t.type===e))}function T6(t){return M6(t,"polar").length>0}function A6(t){return M6(t,"transpose").length%2==1}function C6(t){return M6(t,"theta").length>0}function O6(t){return M6(t,"radial").length>0}const P6=Tp("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),k6=Tp("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),L6=Tp("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),I6=Tp("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),R6=Tp("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),D6=Tp("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),N6=Tp("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),F6=Tp("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),z6=Tp("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function B6(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function j6(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function U6(){}var Z6=.7,V6=1/Z6,G6="\\s*([+-]?\\d+)\\s*",H6="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W6="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",q6=/^#([0-9a-f]{3,8})$/,Y6=new RegExp(`^rgb\\(${G6},${G6},${G6}\\)$`),X6=new RegExp(`^rgb\\(${W6},${W6},${W6}\\)$`),$6=new RegExp(`^rgba\\(${G6},${G6},${G6},${H6}\\)$`),K6=new RegExp(`^rgba\\(${W6},${W6},${W6},${H6}\\)$`),J6=new RegExp(`^hsl\\(${H6},${W6},${W6}\\)$`),Q6=new RegExp(`^hsla\\(${H6},${W6},${W6},${H6}\\)$`),t8={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 e8(){return this.rgb().formatHex()}function n8(){return this.rgb().formatRgb()}function r8(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=q6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?i8(e):3===n?new u8(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?o8(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?o8(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=Y6.exec(t))?new u8(e[1],e[2],e[3],1):(e=X6.exec(t))?new u8(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=$6.exec(t))?o8(e[1],e[2],e[3],e[4]):(e=K6.exec(t))?o8(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=J6.exec(t))?d8(e[1],e[2]/100,e[3]/100,1):(e=Q6.exec(t))?d8(e[1],e[2]/100,e[3]/100,e[4]):t8.hasOwnProperty(t)?i8(t8[t]):"transparent"===t?new u8(NaN,NaN,NaN,0):null}function i8(t){return new u8(t>>16&255,t>>8&255,255&t,1)}function o8(t,e,n,r){return r<=0&&(t=e=n=NaN),new u8(t,e,n,r)}function a8(t){return t instanceof U6||(t=r8(t)),t?new u8((t=t.rgb()).r,t.g,t.b,t.opacity):new u8}function s8(t,e,n,r){return 1===arguments.length?a8(t):new u8(t,e,n,null==r?1:r)}function u8(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function l8(){return`#${f8(this.r)}${f8(this.g)}${f8(this.b)}`}function c8(){const t=h8(this.opacity);return`${1===t?"rgb(":"rgba("}${p8(this.r)}, ${p8(this.g)}, ${p8(this.b)}${1===t?")":`, ${t})`}`}function h8(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function p8(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function f8(t){return((t=p8(t))<16?"0":"")+t.toString(16)}function d8(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new g8(t,e,n,r)}function m8(t){if(t instanceof g8)return new g8(t.h,t.s,t.l,t.opacity);if(t instanceof U6||(t=r8(t)),!t)return new g8;if(t instanceof g8)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new g8(a,s,u,t.opacity)}function g8(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function y8(t){return(t=(t||0)%360)<0?t+360:t}function v8(t){return Math.max(0,Math.min(1,t||0))}function _8(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function b8(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}B6(U6,r8,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:e8,formatHex:e8,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return m8(this).formatHsl()},formatRgb:n8,toString:n8}),B6(u8,s8,j6(U6,{brighter(t){return t=null==t?V6:Math.pow(V6,t),new u8(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Z6:Math.pow(Z6,t),new u8(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new u8(p8(this.r),p8(this.g),p8(this.b),h8(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:l8,formatHex:l8,formatHex8:function(){return`#${f8(this.r)}${f8(this.g)}${f8(this.b)}${f8(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:c8,toString:c8})),B6(g8,(function(t,e,n,r){return 1===arguments.length?m8(t):new g8(t,e,n,null==r?1:r)}),j6(U6,{brighter(t){return t=null==t?V6:Math.pow(V6,t),new g8(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Z6:Math.pow(Z6,t),new g8(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new u8(_8(t>=240?t-240:t+120,i,r),_8(t,i,r),_8(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new g8(y8(this.h),v8(this.s),v8(this.l),h8(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(){const t=h8(this.opacity);return`${1===t?"hsl(":"hsla("}${y8(this.h)}, ${100*v8(this.s)}%, ${100*v8(this.l)}%${1===t?")":`, ${t})`}`}}));const x8=t=>()=>t;function w8(t,e){return function(n){return t+n*e}}function S8(t,e){var n=e-t;return n?w8(t,n):x8(isNaN(t)?e:t)}function E8(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=s8(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}!function t(e){var n=function(t){return 1==(t=+t)?S8:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):x8(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=s8(t)).r,(e=s8(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=S8(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var M8=E8((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return b8((n-r/e)*e,a,i,o,s)}}));E8((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return b8((n-r/e)*e,i,o,a,s)}}));const T8=t=>M8(t[t.length-1]);var A8=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Tp);const C8=T8(A8);var O8=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Tp);const P8=T8(O8);var k8=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Tp);const L8=T8(k8);var I8=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Tp);const R8=T8(I8);var D8=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Tp);const N8=T8(D8);var F8=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Tp);const z8=T8(F8);var B8=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Tp);const j8=T8(B8);var U8=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Tp);const Z8=T8(U8);var V8=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Tp);const G8=T8(V8);var H8=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Tp);const W8=T8(H8);var q8=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Tp);const Y8=T8(q8);var X8=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Tp);const $8=T8(X8);var K8=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Tp);const J8=T8(K8);var Q8=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Tp);const t7=T8(Q8);var e7=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Tp);const n7=T8(e7);var r7=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Tp);const i7=T8(r7);var o7=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Tp);const a7=T8(o7);var s7=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Tp);const u7=T8(s7);var l7=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Tp);const c7=T8(l7);var h7=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Tp);const p7=T8(h7);var f7=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Tp);const d7=T8(f7);var m7=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Tp);const g7=T8(m7);var y7=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Tp);const v7=T8(y7);var _7=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Tp);const b7=T8(_7);var x7=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Tp);const w7=T8(x7);var S7=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Tp);const E7=T8(S7);var M7=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Tp);const T7=T8(M7);function A7(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}const C7=Math.PI/180,O7=180/Math.PI;var P7=-.14861,k7=1.78277,L7=-.29227,I7=-.90649,R7=1.97294,D7=R7*I7,N7=R7*k7,F7=k7*L7-I7*P7;function z7(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof B7)return new B7(t.h,t.s,t.l,t.opacity);t instanceof u8||(t=a8(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(F7*r+D7*e-N7*n)/(F7+D7-N7),o=r-i,a=(R7*(n-i)-L7*o)/I7,s=Math.sqrt(a*a+o*o)/(R7*i*(1-i)),u=s?Math.atan2(a,o)*O7-120:NaN;return new B7(u<0?u+360:u,s,i,t.opacity)}(t):new B7(t,e,n,null==r?1:r)}function B7(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function j7(t){return function e(n){function r(e,r){var i=t((e=z7(e)).h,(r=z7(r)).h),o=S8(e.s,r.s),a=S8(e.l,r.l),s=S8(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}B6(B7,z7,j6(U6,{brighter(t){return t=null==t?V6:Math.pow(V6,t),new B7(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Z6:Math.pow(Z6,t),new B7(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*C7,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new u8(255*(e+n*(P7*r+k7*i)),255*(e+n*(L7*r+I7*i)),255*(e+n*(R7*r)),this.opacity)}})),j7((function(t,e){var n=e-t;return n?w8(t,n>180||n<-180?n-360*Math.round(n/360):n):x8(isNaN(t)?e:t)}));var U7=j7(S8);const Z7=U7(z7(300,.5,0),z7(-240,.5,1));var V7=U7(z7(-100,.75,.35),z7(80,1.5,.8)),G7=U7(z7(260,.75,.35),z7(80,1.5,.8)),H7=z7();function W7(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return H7.h=360*t-100,H7.s=1.5-1.5*e,H7.l=.8-.9*e,H7+""}var q7=s8(),Y7=Math.PI/3,X7=2*Math.PI/3;function $7(t){var e;return t=(.5-t)*Math.PI,q7.r=255*(e=Math.sin(t))*e,q7.g=255*(e=Math.sin(t+Y7))*e,q7.b=255*(e=Math.sin(t+X7))*e,q7+""}function K7(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function J7(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Q7=J7(Tp("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var t9=J7(Tp("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),e9=J7(Tp("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),n9=J7(Tp("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function r9(t,e,n,i,o,a){const{guide:s={}}=n,u=function(t,e,n){const{type:r,domain:i,range:o}=n;return void 0!==r?r:function(t){return v9(t,HF)}(e)?"identity":"string"==typeof o?"linear":(i||o||[]).length>2?p9(t):void 0!==i?g9([i])?p9(t):y9(e)?"time":f9(t,o):g9(e)?p9(t):y9(e)?"time":f9(t,o)}(t,e,n);if("string"!=typeof u)return n;const l=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return d9(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)BF(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return m9(n);case"quantile":return function(t){return m9(t).sort()}(n);case"sequential":return d9(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)BF(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(u,0,e,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,i,o){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=xU,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,i);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e?0:"band"===t?C6(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,o,i);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,i=NX(e),o=r[`interpolate${i}`];if(!o)throw new Error(`Unknown palette: ${i}`);return{interpolator:n?t=>o(n(t)):o}}(i);default:return i}}(u,t,0,n,i)),{domain:l,range:c9(u,t,e,n,l,o,a),guide:s,name:t,type:u})}function i9(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>o.map(t)))}}return n}function o9(t,e){const[n]=w6("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[DF,DF];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter((([t])=>"function"==typeof t)),a=t.filter((([t])=>"function"!=typeof t)),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const u=new Map(a.map((([t,e])=>[e,t]))),l=new Map(o.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:u.has(t)?u.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function a9(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));s9(e,"x"),s9(e,"y")}function s9(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(u9)?CZ(r):n.every(l9)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function u9(t){const{type:e}=t;return"string"==typeof e&&["linear","log","pow","time"].includes(e)}function l9(t){const{type:e}=t;return"string"==typeof e&&["band","point","ordinal"].includes(e)}function c9(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:u,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=h9(n,r,i,o,a),[s,c]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[(n=e,n[0]),kZ(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1];var n}(e,t);return[u||s,l||c]}case"band":case"point":return[u||0,l||1];case"ordinal":return h9(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function h9(t,e,n,i,o){const[a]=w6("palette",o),{defaultCategory10:s,defaultCategory20:u}=i,l=(p=t.flat(),Array.from(new Set(p))).length<=s.length?s:u,{palette:c=l,offset:h}=e;var p;try{return a({type:c})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const i=NX(t),o=r[`scheme${i}`],a=r[`interpolate${i}`];if(!o&&!a)return null;if(o){if(!o.some(Array.isArray))return o;const t=o[e.length];if(t)return t}return e.map(((t,r)=>a(n(r/e.length))))}(c,n,h);if(e)return e;throw new Error(`Unknown Component: ${c} `)}}function p9(t){return function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal"}function f9(t,e){return"color"!==t||e?"linear":"sequential"}function d9(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function m9(t){return Array.from(new Set(t.flat()))}function g9(t){return v9(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function y9(t){return v9(t,(t=>t instanceof Date))}function v9(t,e){for(const n of t)if(n.some(e))return!0;return!1}const _9={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},b9={threshold:"threshold",quantize:"quantize",quantile:"quantile"},x9={ordinal:"ordinal",band:"band",point:"point"},w9={constant:"constant"};var S9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function E9(t,e,n,r,i){const[o]=w6("component",r),{scales:a=[],bbox:s}=t,u=S9(t,["scales","bbox"]),l=a.map((t=>o9(t,r))),c={bbox:s,scales:a,library:r};return o(u)({coordinate:e,library:r,markState:i,scales:l,theme:n,value:c})}function M9(t,e){const n=t.filter((t=>"string"!=typeof t.type||["shape","size","color","opacity"].includes(t.name))).filter((t=>!("constant"===t.type&&"size"===t.name))),r=n.filter((t=>!t.field)),i=n.filter((t=>!!t.field)),o=new Map(Array.from(FN(i,(t=>t.field))).map((([t,e])=>[t,[...e,...r.filter((t=>"constant"===t.type))]])).concat([[void 0,r]]).filter((([t,e])=>e.some((t=>"constant"!==t.type)))));if(0===o.size)return[];function a(t){const{type:e}=t;return"string"!=typeof e?null:e in _9?"continuous":e in x9?"discrete":e in b9?"distribution":e in w9?"constant":null}const s=Array.from(o).map((([t,e])=>{const n=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...IZ(t,n));return e}(e).sort(((t,e)=>e.length-t.length)),r=n.map((t=>({combination:t,option:t.map((t=>[t.name,a(t)]))}))),i=t=>t.sort(((t,e)=>t[0].localeCompare(e[0])));for(const[t,e]of _6)for(const{option:n,combination:o}of r)if(e.some((t=>hK(i(t),i(n)))))return[t,o];return null})).filter(BF);return s}function T9(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return M6(t,"helix").length>0}(e)||C6(e))return null;if(A6(e)&&(T6(e)||O6(e)))return null;if(n.startsWith("x"))return T6(e)?["axisArc",[t]]:O6(e)?["axisLinear",[t]]:[A6(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return T6(e)?["axisLinear",[t]]:O6(e)?["axisArc",[t]]:[A6(e)?"axisX":"axisY",[t]];if(n.startsWith("position")){if(function(t){return M6(t,"radar").length>0}(e))return["axisRadar",[t]];if(!T6(e))return["axisY",[t]]}return null})).filter(BF)}function A9(t){const e=M6(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:n,endAngle:r}=WD(t);return[n,r]}const n=M6(t,"radial");if(n.length){const t=n[n.length-1],{startAngle:e,endAngle:r}=KD(t);return[e,r]}return[-Math.PI/2,Math.PI/2*3]}function C9(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}function O9(t,e,n,r,i,o,a){const[s]=A9(a),u=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?function(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=C9(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=A9(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return M6(t,"parallel").length>0}(i)){const t=C9(o);return null===t?e:A6(i)?0===t?["top",null]:["center","horizontal"]:0===t?e:["center","vertical"]}if("axisLinear"===t){const[t]=A9(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:T6(i)||O6(i)?["center",null]:"axisX"===t&&function(t){return M6(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return M6(t,"reflectY").length>0}(i)?["top",null]:e}(t,u,i,o,a):"string"==typeof t&&t.startsWith("legend")&&T6(a)&&"center"===r.position?["center","vertical"]:u}function P9(t,e,n,r,i,o){const[a]=w6("scale",o),{type:s}=t;if("string"!=typeof s||!s.startsWith("axis"))return;if(!["left","right","bottom","top"].includes(r))return;t.transform=t.transform||[{type:"hide"}];const{labelFormatter:u,scales:l,title:c,tickCount:h,tickMethod:p,tickFilter:f}=t,d="left"===r||"right"===r,m=function(t,e,n){const{axis:r,[`axis${NF(e)}`]:i}=n;return VD({},r,i,t.style)}(t,r,i),{tickLength:g=0,labelSpacing:y=0,titleSpacing:v=0}=m,_=S9(m,["tickLength","labelSpacing","titleSpacing"]),[b]=l;void 0!==h&&(b.tickCount=h),void 0!==p&&(b.tickMethod=p);const x=a(b),w=function(t,e,n){const r=k9(t,n).map((t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e})),i=e?"string"==typeof e?OX(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return r.map(i)}(x,u,f),S=UF(_,"label"),E=w.map(((t,e)=>{const n=Object.fromEntries(Object.entries(S).map((([n,r])=>[n,"function"==typeof r?r(t,e):r])));return d||(n.transform="none"),L9(t,n)})),M=up(E,(t=>t.width)),T=g+y;if(d)t.size=M+T;else if(function(t,e,n,r,i){const o=vF(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=k9(t,i),u=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;return t.getBandWidth(e)/2}(a,t))),l=s.map(((t,e)=>e)),c=-r[0],h=n+r[1],p=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=u[t],[r,i]=p(n,e[t]);if(r<c||i>h)return!0;const o=u[t+1];if(o){const[n]=p(o,e[t+1]);if(i>n)return!0}}return!1}(x,E,e,n,f))t.size=M+T,t.style=Object.assign(Object.assign({},t.style),{labelTransform:"rotate(90)"});else{const e=up(E,(t=>t.height));t.size=e+T}const A=w.map(((t,e)=>e));if(t.indexBBox=new Map(A.map((t=>[t,[w[t],E[t]]]))),!1===c||null==c)return;const C=UF(_,"title"),O=L9(Array.isArray(c)?c.join(","):c,C);t.size+=d?v+O.width:v+O.height}function k9(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function L9(t,e){const n=function(t){return t instanceof QL?t:new hI({style:{text:`${t}`}})}(t);return n.attr(Object.assign(Object.assign({},e),{visibility:"none"})),n.getBBox()}function I9(t,e,n,r,i,o,a){const s=FN(t,(t=>t.position)),{padding:u,paddingLeft:l=u,paddingRight:c=u,paddingBottom:h=u,paddingTop:p=u}=i,f={paddingBottom:h,paddingLeft:l,paddingTop:p,paddingRight:c};for(const t of r){const r=`padding${NF(GW(t))}`,i=f[r];if(void 0===i||"auto"===i)if(s.has(t)){const u=s.get(t);"auto"===i&&u.forEach((r=>P9(r,e,n,t,o,a)));const l=u.reduce(((t,{size:e})=>t+e),0);f[r]=l}else f[r]=30}return f}function R9(t,e,n,r){const[i,o]=LZ(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return HN(t)&&ZN(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):ZN(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):HN(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length+1).fill(0),s=e.map(a).filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=s[e],a=s[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length+1).fill(0),s=e.map(a).filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=s[e],a=s[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[u]=YN(e),l=u*(o/2),c=a-l,h=s-l;for(let e=0;e<t.length;e++)t[e].bbox={x:r+c,y:i+h,width:2*l,height:2*l}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=YN(e),u=a/2*s/Math.sqrt(2),l=r+o/2,c=i+a/2;for(let e=0;e<t.length;e++)t[e].bbox={x:l-u,y:c-u,width:2*u,height:2*u}}(o,e,n)}function D9(t,e,n){const[r,i,o,a,s,u,l]=n,[c,h,p,f,d,m,g,y]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));for(let e=0,n=u?h+m:h;e<t.length;e++){const r=t[e],{size:i}=r;r.bbox={[c]:u?n-i:n,[p]:f,[d]:i,[g]:y},n+=i*(u?-1:1)}}var N9=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))},F9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function z9(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=F9(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function B9(t,e,n){return N9(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=w6("data",t),o=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=F9(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[F9(o,["transform"]),...a].map(i),u=yield function(t){return t.reduce(((t,e)=>n=>RF(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),DF)}(s)(r);return[Array.isArray(u)?PZ(u):[],Object.assign(Object.assign({},e),{data:u})]}))}function j9(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++)i[`${t}${0===n?"":n}`]=e[n];else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function U9(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=OZ(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return BF(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:o})]}function Z9(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=OZ(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function V9(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=w6("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:J9(n)})}(o),s=OZ(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function G9(t,e,n){const{tooltip:r={}}=e;return WF(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:HF(r)&&XF(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function H9(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(WF(o))return[t,e];const a=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(HF(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:u=(t=>t)}=e,l="string"==typeof u?OX(u):u,c=o&&i[o],h=c&&i[o].field,p=s||h||o,f=[];for(const e of t){const t=n?r[e][n]:c?i[o].value[e]:null;f[e]={name:p,color:a,value:l(t)}}return f}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);HF(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:u=[]}=o,l=F9(o,["title","items"]),c=Object.assign({title:a(s),items:Array.isArray(u)?u.map(a):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:c})]}function W9(t,e,n){const{encode:r}=e,i=F9(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,o=F9(n,["value"]);for(let n=0;n<i.length;n++){const o=i[n];if(Array.isArray(o))for(let i=0;i<o.length;i++){const a=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];a[1][n]=o[i],r[i]=a}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},o)]))})),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function q9(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},u="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return VD(e,{scale:Object.assign(Object.assign({},Object.fromEntries(u.map((t=>[t,{guide:s(r,t),slider:s(o,t),scrollbar:s(a,t)}])))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function Y9(t,e,n){const{animate:r}=e;return r||void 0===r||VD(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}var X9=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))},$9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function K9(t,e,n){return X9(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return X9(this,void 0,void 0,(function*(){const{library:r}=n,[i]=w6("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,u=[z9,B9,j9,U9,Z9,V9,W9,Y9,q9,G9,...o.map(i),...s.map(i),...a.map(i),H9];let l=[],c=t;for(const t of u)[l,c]=yield t(l,c,n);return[l,c]}))}(t,e,r),{encode:a,scale:s,data:u,tooltip:l}=o;if(!1===Array.isArray(u))return null;const{channels:c}=e,h=BN(Object.entries(a).filter((([,t])=>BF(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=c.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),p=c.filter((t=>{const{name:e,required:n}=t;if(h.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i}=t;return h.filter((([t])=>t.startsWith(e))).map((([t,e],o)=>{const a=e.some((t=>t.visual)),u=e.some((t=>t.constant)),l=s[t]||{},{independent:c=!1,key:h=r||t,type:p=(u?"constant":a?"identity":n)}=l,f=$9(l,["independent","key","type"]),d="constant"===p,m=d?void 0:i;return{name:t,values:e,scaleKey:c||d?Symbol("independent"):h,scale:Object.assign({type:p,range:m},f)}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:p,tooltip:l})]}))}function J9(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}var Q9=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))},ttt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function ett(t,e,n,r){var i,o;return Q9(this,void 0,void 0,(function*(){const[a]=w6("composition",n),[s]=w6("interaction",n),u=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(BF)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"==typeof e&&u.has(e)?"mark":e},c=t=>"mark"===l(t),h=t=>"standardView"===l(t),p=t=>{if(h(t))return[t];const e=l(t);return a({type:e})(t)},f=[],d=new Map,m=new Map,g=[t],y=[];for(;g.length;){const t=g.shift();if(h(t)){const e=m.get(t),[r,i]=e?att(e,t,n):yield itt(t,n);d.set(r,t),f.push(r);const o=i.flatMap(p).map((t=>E6(t,n)));if(g.push(...o),o.every(h)){const t=yield Promise.all(o.map((t=>ott(t,n))));a9(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];m.set(n,r)}}}else{const e=p(c(t)?t:yield xtt(t,n));Array.isArray(e)?g.push(...e):"function"==typeof e&&y.push(e())}}r.emitter.emit(tQ.BEFORE_PAINT);const v=new Map,_=new Map,b=[];e.selectAll(Mtt(zR)).data(f,(t=>t.key)).join((t=>t.append("g").attr("className",zR).attr("id",(t=>t.key)).call(ntt).each((function(t){stt(t,$Z(this),b,n,r),v.set(t,this)}))),(t=>t.call(ntt).each((function(t){stt(t,$Z(this),b,n,r),_.set(t,this)}))),(t=>t.each((function(){const t=this.nameInteraction.values();for(const e of t)e.destroy()})).remove()));const x=t=>Array.from(t.entries()).map((([t,e])=>({view:t,container:e,options:d.get(t),update:rtt($Z(e),n,r)}))),w=x(v);for(const t of w){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of btt(e)){const[e,o]=i;if(o){const i=s(Object.assign({type:e},o))(t,w,r.emitter);n.set(e,{destroy:i})}}}const S=x(_);for(const t of S){const{options:e,container:n}=t,o=n.nameInteraction;for(const n of btt(e)){const[e,a]=n,u=o.get(e);if(u&&(null===(i=u.destroy)||void 0===i||i.call(u)),a){const n=s(Object.assign({type:e},a))(t,S,r.emitter);o.set(e,{destroy:n})}}}const{width:E,height:M}=t,T=[];for(const t of y){const i=new Promise((i=>Q9(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:E,height:M},i);yield ett(t,e,n,r)}i()}))));T.push(i)}r.views=f,null===(o=r.animations)||void 0===o||o.forEach((t=>null==t?void 0:t.cancel())),r.animations=b,r.emitter.emit(tQ.AFTER_PAINT);const A=b.filter(BF).map(gtt).map((t=>t.finished));return Promise.all([...A,...T])}))}function ntt(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function rtt(t,e,n){return r=>Q9(this,void 0,void 0,(function*(){const[i,o]=yield itt(r,e);stt(i,t,[],e,n),function(t,e,n,r,i){var o;const[a]=w6("interaction",r),s=t.node().nameInteraction,u=btt(e).find((([t])=>"tooltip"===t)),l=s.get("tooltip");if(!l)return;if(null===(o=l.destroy)||void 0===o||o.call(l),!u[1])return;const c=a(Object.assign({type:"tooltip"},u[1])),h={options:e,view:n,container:t.node(),update:t=>Promise.resolve(t)};c(h,[],i.emitter)}(t,r,i,e,n);for(const r of o)ett(r,t,e,n);return{options:r,view:i}}))}function itt(t,e){return Q9(this,void 0,void 0,(function*(){const n=yield function(t,e){return Q9(this,void 0,void 0,(function*(){const[n,r]=w6("mark",e),{marks:i}=t,o=[],a=[...i];for(;a.length;){const[i]=a.splice(0,1),s=yield xtt(i,e),{type:u=FF("G2Mark type is required."),key:l}=s,{props:c={}}=r(u),{composite:h=!0}=c;if(h){const e=yield n(s)(t),r=Array.isArray(e)?e:[e];a.unshift(...r.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${l}-${e}`}))))}else o.push(s)}return Object.assign(Object.assign({},t),{marks:o})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=ttt(t,["coordinate","interaction","style","marks"]),a=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),u=i.map((t=>t.viewStyle||{})),l=[...a,e].reduceRight(((t,e)=>VD(t,e)),{}),c=[n,...s].reduce(((t,e)=>VD(t,e)),{}),h=[...u,r].reduce(((t,e)=>VD(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:c,style:h})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate;const i=E6(r,e);return att(yield ott(i,e),i,e)}))}function ott(t,e){return Q9(this,void 0,void 0,(function*(){const[n]=w6("theme",e),[,r]=w6("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(_tt(i)),u=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield K9(t,i,e);if(o){const[t,e]=o;u.set(t,e)}}const l=FN(Array.from(u.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>VD(t,e)),{}),{values:r}=t[0],i=Array.from(new Set(r.map((t=>t.field)).filter(BF))),o=VD({guide:{title:0===i.length?void 0:i},field:i[0]},n),{name:u}=t[0],l=t.flatMap((({values:t})=>t.map((t=>t.value)))),c=r9(u,l,o,a,s,e);t.forEach((t=>t.scale=c))}return u}))}function att(t,e,n){const[r]=w6("mark",n),[i]=w6("theme",n),[o]=w6("labelTransform",n),{key:a,frame:s=!1,theme:u,clip:l,style:c={},labelTransform:h=[]}=e,p=i(_tt(u)),f=Array.from(t.values()),d=Array.from(new Set(f.flatMap((t=>t.channels.map((t=>t.scale)))))),m=function(t,e,n){const{component:r=[],coordinates:i=[],title:o,theme:a}=e,[,s]=w6("component",n),u=t.filter((({guide:t,name:e})=>null!==t)),l=function(t,e,n){const[,r]=w6("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?A6(n)?`${e}Y`:`${e}X`:"y"===t?A6(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:u,defaultSize:l,defaultOrder:c}=s;return Object.assign(Object.assign({position:u,size:l,order:c,type:a},o),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n),c=[...r,...l];if(o){const{props:t}=s("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:i}=t,a="string"==typeof o?{title:o}:o;c.push(Object.assign({type:"title",position:e,orientation:n,order:r,size:i},a))}const h=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t)));return[...M9(n),...T9(n,e)]}(u,i);return h.forEach((([t,e])=>{const{props:n}=s(t),{defaultPosition:r,defaultOrientation:o,defaultSize:a,defaultOrder:l}=n,h=Object.assign({},...e),{guide:p,field:f}=h,d=Array.isArray(p)?p:[p];for(const n of d){const[s,h]=O9(t,r,o,n,e,u,i);if(!s&&!h)continue;const{size:p=a,order:d=l}=n;c.push(Object.assign(Object.assign({title:f},n),{position:s,orientation:h,order:d,size:p,type:t,scales:e}))}})),c}(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={field:(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[i]]};return[...t,o]}(Array.from(d),f,t),e,n),g=function(t,e,n,r){const{width:i,height:o,x:a=0,y:s=0,inset:u=0,insetLeft:l=u,insetTop:c=u,insetBottom:h=u,insetRight:p=u,margin:f=0,marginLeft:d=f,marginBottom:m=f,marginTop:g=f,marginRight:y=f,padding:v,paddingBottom:_=v,paddingLeft:b=v,paddingRight:x=v,paddingTop:w=v}=e,S=1/3,E=(t,e,n)=>"auto"===t?Math.min(n,e):e,M=I9(t,o,[0,0],["left","right"],e,n,r),{paddingLeft:T,paddingRight:A}=M,C=i-d-y,O=E(b,T,C*S),P=E(x,A,C*S),k=C-O-P,L=I9(t,k,[O,P],["bottom","top"],e,n,r),{paddingTop:I,paddingBottom:R}=L,D=o-m-g,N=E(_,R,D*S),F=E(w,I,D*S);return{width:i,height:o,insetLeft:l,insetTop:c,insetBottom:h,insetRight:p,innerWidth:k,innerHeight:D-N-F,paddingLeft:O,paddingRight:P,paddingTop:F,paddingBottom:N,marginLeft:d,marginBottom:m,marginTop:g,marginRight:y,x:a,y:s}}(m,e,p,n),y=function(t,e,n){const[r]=w6("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:u,insetBottom:l,marginLeft:c,marginTop:h}=t,{coordinates:p=[]}=e,f=(d=p).find((t=>"cartesian"===t.type))?d:[...d,{type:"cartesian"}];var d;return new b6.Coordinate(Object.assign(Object.assign({},t),{x:a+c,y:s+h,width:o-a-u,height:i-l-s,transformations:f.map(r).flat()}))}(g,e,n),v=s?VD({mainLineWidth:1,mainStroke:"#000"},c):c;!function(t,e,n){const r=FN(t,(t=>t.position)),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:u,marginTop:l,marginBottom:c,marginRight:h,innerHeight:p,innerWidth:f,height:d,width:m}=n,g=i+u,y=a+l,v=o+h,_=s+c,b={top:[g,0,f,y,"vertical",!0,Iz],right:[m-v,y,v,p,"horizontal",!1,Iz],bottom:[g,d-_,f,_,"vertical",!1,Iz],left:[0,y,g,p,"horizontal",!0,Iz],"top-left":[g,0,f,y,"vertical",!0,Iz],"top-right":[g,0,f,y,"vertical",!0,Iz],"bottom-left":[g,d-_,f,_,"vertical",!1,Iz],"bottom-right":[g,d-_,f,_,"vertical",!1,Iz],center:[g,y,f,p,"center",null,null],inner:[g,y,f,p,"center",null,null],outer:[g,y,f,p,"center",null,null]};for(const[t,n]of r.entries()){const r=b[t],[i,o]=LZ(n,(e=>"string"==typeof e.type&&("center"===t||!(!e.type.startsWith("axis")||!["inner","outer"].includes(t)))));i.length&&R9(i,e,r,t),o.length&&D9(n,0,r)}}(m,y,g);const _={},b=[];for(const[e,i]of t.entries()){const{children:t,dataDomain:o,modifier:s,key:u}=e,{index:l,channels:c,tooltip:h}=i,p=OZ(Object.fromEntries(c.map((({name:t,scale:e})=>[t,e]))),(t=>o9(t,n)));Object.assign(_,p);const f=i9(c,p),d=r(e),[m,v,x]=ltt(d(l,p,f,y)),w=o||m.length,S=s?s(v,w,g):[],E=t=>{var e,n;return null===(n=null===(e=h.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},M=t=>h.items.map((e=>e[t])),T=m.map(((t,e)=>{const n=Object.assign({points:v[e],transform:S[e],index:t,markKey:u,viewKey:a},h&&{title:E(t),items:M(t)});for(const[r,i]of Object.entries(f))n[r]=i[t],x&&(n[`series${NX(r)}`]=x[e].map((t=>i[t])));return x&&(n.seriesIndex=x[e]),x&&h&&(n.seriesItems=x[e].map((t=>M(t))),n.seriesTitle=x[e].map((t=>E(t)))),n}));i.data=T,i.index=m;const A=null==t?void 0:t(T,p,g);b.push(...A||[])}return[{layout:g,theme:p,coordinate:y,components:m,markState:t,key:a,clip:l,scale:_,style:v,labelTransform:utt(h.map(o))},b]}function stt(t,e,n,r,i){return Q9(this,void 0,void 0,(function*(){const{components:o,theme:a,layout:s,markState:u,coordinate:l,key:c,style:h,clip:p}=t,{x:f,y:d,width:m,height:g}=s,y=ttt(s,["x","y","width","height"]),v=["view","plot","main","content"],_=v.map(((t,e)=>e)),b=v.map((t=>ZF(Object.assign({},a,h),t))),x=["a","margin","padding","inset"].map((t=>UF(y,t))),w=t=>t.style("x",(t=>A[t].x)).style("y",(t=>A[t].y)).style("width",(t=>A[t].width)).style("height",(t=>A[t].height)).each((function(t){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}($Z(this),b[t])}));let S=0,E=0,M=m,T=g;const A=_.map((t=>{const e=x[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return S+=n,E+=r,M-=n+o,T-=r+i,{x:S,y:E,width:M,height:T}}));e.selectAll(Mtt(ZR)).data(_.filter((t=>BF(b[t]))),(t=>v[t])).join((t=>t.append("rect").attr("className",ZR).style("zIndex",-2).call(w)),(t=>t.call(w)),(t=>t.remove()));const C=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:u={}}=t,{type:l,duration:c=300,delay:h=0}=s,{type:p,duration:f=300,delay:d=0}=a,{type:m,duration:g=300,delay:y=0}=u;for(const t of o){const{updateType:r=l,updateDuration:i=c,updateDelay:o=h,enterType:a=p,enterDuration:s=f,enterDelay:u=d,exitDuration:v=g,exitDelay:_=y,exitType:b=m}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===b||b)&&(e=Math.max(e,v+_),n=Math.min(n,_)),(void 0===a||a)&&(e=Math.max(e,s+u),n=Math.min(n,u))}}return e===-1/0?null:[n,e-n]}(u),O=!!C&&{duration:C[1]},P=e.selectAll(Mtt(jR)).data(o,((t,e)=>`${t.type}-${e}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",jR).append((t=>E9(VD({animate:O},t),l,a,r,u)))),(t=>t.transition((function(t){const{preserve:e=!1}=t;if(e)return;const n=E9(VD({animate:O},t),l,a,r,u),{attributes:i}=n,[o]=this.childNodes;return o.update(i)})))).transitions();n.push(...P.flat().filter(BF));const k=e.selectAll(Mtt(BR)).data([s],(()=>c)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",BR).call(wtt).call(Ett,Array.from(u.keys())).call(Ttt,p)),(t=>t.call(Ett,Array.from(u.keys())).call((t=>C?function(t,e){const[n,r]=e;t.transition((function(t){const{x:e,y:i,width:o,height:a}=this.style,{paddingLeft:s,paddingTop:u,innerWidth:l,innerHeight:c}=t,h=[{x:e,y:i,width:o,height:a},{x:s,y:u,width:l,height:c}];return this.animate(h,{delay:n,duration:r,fill:"both"})}))}(t,C):wtt(t))).call(Ttt,p))).transitions();n.push(...k.flat());for(const[o,a]of u.entries()){const{data:s}=a,{key:u,class:l,type:c}=o,h=e.select(`#${u}`),p=ftt(o,a,t,r,i),f=mtt(o,a,t,r),d=ytt(o,a,t,r),m=vtt(o,a,t,r),g=htt(e,h,l,"element"),y=h.selectAll(Mtt(FR)).selectFacetAll(g).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(p).attr("className",FR).attr("markType",c).transition((function(t){return f(t,[this])}))),(t=>t.call((e=>{const n=e.parent(),r=jF((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,e){ptt(this,n,r);const i=p(t,e),o=d(t,[this],[i]);return null===o&&(this.nodeName===i.nodeName?zF(this,i):this.parentNode.replaceChild(i,this)),o}))}))),(t=>t.each((function(){this.__removed__=!0})).transition((function(t){return m(t,[this])})).remove()),(t=>t.append(p).attr("className",FR).attr("markType",c).transition((function(t){const{__fromElements__:e}=this,n=d(t,e,[this]);return new KZ(e,null,this.parentNode).transition(n).remove(),n}))),(t=>t.transition((function(t){const e=new KZ([],this.__toData__,this.parentNode).append(p).attr("className",FR).attr("markType",c).nodes();return d(t,[this],e)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r){const[i]=w6("labelTransform",r),{markState:o,labelTransform:a}=t,s=e.select(Mtt(NR)).node(),u=new Map,l=new Map,c=Array.from(o.entries()).flatMap((([n,i])=>{const{labels:o=[],key:a}=n,s=function(t,e,n,r){const[i]=w6("shape",r),{data:o}=t,{data:a,defaultLabelShape:s}=e,u=a.map((t=>t.points)),{theme:l,coordinate:c}=n;return t=>{const{index:e,points:n}=t,r=o[e],{formatter:a=(t=>`${t}`),transform:h,style:p}=t,f=ttt(t,["formatter","transform","style"]),d=OZ(Object.assign(Object.assign({},f),p),(t=>ctt(t,r,e,o))),{shape:m=s,text:g}=d,y=ttt(d,["shape","text"]),v="string"==typeof a?OX(a):a,_=Object.assign(Object.assign({},y),{text:v(g,r,e,o)});return i(Object.assign({type:`label.${m}`},y))(n,_,c,l,u)}}(n,i,t,r),c=e.select(`#${a}`).selectAll(Mtt(FR)).nodes().filter((t=>!t.__removed__));return o.flatMap(((t,e)=>{const{transform:n=[]}=t,r=ttt(t,["transform"]);return c.flatMap((n=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,u=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:u,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),c=r.filter(((t,e)=>o[e].every(BF))).map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(c):c}(r,e,n);return i.forEach((e=>{u.set(e,s),l.set(e,t)})),i}))}))})),h=$Z(s).selectAll(Mtt(UR)).data(c,(t=>t.key)).join((t=>t.append((t=>u.get(t)(t))).attr("className",UR)),(t=>t.each((function(t){zF(this,u.get(t)(t))}))),(t=>t.remove())).nodes(),p=FN(h,(t=>l.get(t.__data__))),{coordinate:f}=t;for(const[t,e]of p){const{transform:n=[]}=t;utt(n.map(i))(e,f)}a&&a(h,f)}(t,e,0,r)}))}function utt(t){return(e,n)=>{for(const r of t)e=r(e,n);return e}}function ltt([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const o=t[n],a=e[n];a.every((([t,e])=>BF(t)&&BF(e)))&&(r.push(o),i.push(a))}return[r,i]}function ctt(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function htt(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function ptt(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,u]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-u})`),e.append(t)}function ftt(t,e,n,r,i){const[o]=w6("shape",r),{data:a}=t,{defaultShape:s,data:u}=e,l=u.map((t=>t.points)),{theme:c,coordinate:h}=n,{type:p,style:f={}}=t;return e=>{const{shape:n=s}=f,{shape:r=n,points:u,seriesIndex:d,index:m}=e,g=ttt(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},g),{shape:r,mark:p,defaultShape:s,index:m}),v=d?d.map((t=>a[t])):a[m],_=d||m,b=OZ(f,(t=>ctt(t,v,_,a)));return o(Object.assign(Object.assign({},b),{type:Stt(t,r)}))(u,y,h,c,l,i)}}function dtt(t,e,n,r,i){var o;const[,a]=w6("shape",i),[s]=w6("animation",i),{defaultShape:u}=n,{theme:l,coordinate:c}=r,h=`default${NX(t)}Animation`,{[h]:p}=a(Stt(e,u)).props,{[t]:f={}}=l,d=(null===(o=e.animate)||void 0===o?void 0:o[t])||{};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:u}=e,l=Object.assign({type:i||p},d);if(!l.type)return null;const h=s(l)(n,r,{delay:o,duration:a,easing:u},c,f);return Array.isArray(h)?h:[h]}}function mtt(t,e,n,r){return dtt("enter",t,e,n,r)}function gtt(t){return t.finished.then((()=>{t.cancel()})),t}function ytt(t,e,n,r){return dtt("update",t,e,n,r)}function vtt(t,e,n,r){return dtt("exit",t,e,n,r)}function _tt(t={}){if("string"==typeof t)return{type:t};const{type:e="classic"}=t,n=ttt(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function btt(t){const{interaction:e={}}=t;return Object.entries(VD({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0},e))}function xtt(t,e){return Q9(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=ttt(t,["data"]);if(null==r)return t;const[,{data:o}]=yield B9(0,{data:r},n);return Object.assign({data:o},i)}))}function wtt(t){t.style("x",(t=>t.paddingLeft)).style("y",(t=>t.paddingTop)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function Stt(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function Ett(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";0!==t.nodes().length&&(t.selectAll(Mtt(DR)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",DR).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove())),t.select(Mtt(NR)).node()||t.append("g").attr("className",NR).style("zIndex",0))}function Mtt(...t){return t.map((t=>`.${t}`)).join("")}function Ttt(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,innerWidth:i,innerHeight:o}=t;return new cI({style:{x:r,y:n,width:i,height:o}})}))}function Att(t,e){const n=new FD;return n.registerPlugin(new BD),new MI({width:t,height:e,container:document.createElement("div"),renderer:n})}function Ctt(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,theme:a}=t;a||FF('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.');const s=function(t){const e=VD({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o<e.length;o++){const a=VD({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}(t),{canvas:u=Att(i,o),library:l=v6(),emitter:c=new GD.default}=e;e.canvas=u,e.library=l,e.emitter=c,u.resize(i,o),c.emit(tQ.BEFORE_RENDER);const h=$Z(u.document.documentElement);return u.ready.then((()=>ett(Object.assign(Object.assign({},s),{width:i,height:o}),h,l,e))).then((()=>{u.requestAnimationFrame((()=>{c.emit(tQ.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=u.getConfig().container)?document.getElementById(p):p;var p}function Ott(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(function(t){const e=t.getRoot().querySelectorAll(`.${zR}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}function Ptt(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function ktt(t,{name:e,key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function Ltt(t,{name:e,key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function Itt(t,{name:e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(HF(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function Rtt(t,{name:e,ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function Dtt(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function Ntt(t){return e=>{for(const n of t){const{type:t}=n;"value"===t?Ptt(e,n):"array"===t?ktt(e,n):"object"===t?Ltt(e,n):"node"===t?Rtt(e,n):"container"===t?Dtt(e,n):"mix"===t&&Itt(e,n)}return e}}function Ftt(t){return Object.entries(t).map((([t,e])=>({type:"node",name:t,ctor:e})))}function ztt(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class Btt{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=(t=>t)){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return ztt(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return ztt(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return ztt(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}class jtt extends Btt{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}}var Utt=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};const Ztt=[{name:"encode",type:"object"},{name:"scale",type:"object"},{name:"data",type:"value"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"animate",type:"object"},{name:"coordinate",type:"object"},{name:"interaction",type:"object"},{name:"label",type:"array",key:"labels"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"slider",type:"object"},{name:"scrollbar",type:"object"},{name:"state",type:"object"},{name:"tooltip",type:"mix"}];let Vtt=class extends jtt{constructor(){super({})}};Vtt=Utt([Ntt(Ztt)],Vtt);let Gtt=class extends jtt{constructor(){super({},"interval")}};Gtt=Utt([Ntt(Ztt)],Gtt);let Htt=class extends jtt{constructor(){super({},"rect")}};Htt=Utt([Ntt(Ztt)],Htt);let Wtt=class extends jtt{constructor(){super({},"point")}};Wtt=Utt([Ntt(Ztt)],Wtt);let qtt=class extends jtt{constructor(){super({},"area")}};qtt=Utt([Ntt(Ztt)],qtt);let Ytt=class extends jtt{constructor(){super({},"line")}};Ytt=Utt([Ntt(Ztt)],Ytt);let Xtt=class extends jtt{constructor(){super({},"cell")}};Xtt=Utt([Ntt(Ztt)],Xtt);let $tt=class extends jtt{constructor(){super({},"vector")}};$tt=Utt([Ntt(Ztt)],$tt);let Ktt=class extends jtt{constructor(){super({},"link")}};Ktt=Utt([Ntt(Ztt)],Ktt);let Jtt=class extends jtt{constructor(){super({},"polygon")}};Jtt=Utt([Ntt(Ztt)],Jtt);let Qtt=class extends jtt{constructor(){super({},"image")}};Qtt=Utt([Ntt(Ztt)],Qtt);let tet=class extends jtt{constructor(){super({},"text")}};tet=Utt([Ntt(Ztt)],tet);let eet=class extends jtt{constructor(){super({},"box")}};eet=Utt([Ntt(Ztt)],eet);let net=class extends jtt{constructor(){super({},"lineX")}};net=Utt([Ntt(Ztt)],net);let ret=class extends jtt{constructor(){super({},"lineY")}};ret=Utt([Ntt(Ztt)],ret);let iet=class extends jtt{constructor(){super({},"range")}};iet=Utt([Ntt(Ztt)],iet);let oet=class extends jtt{constructor(){super({},"rangeX")}};oet=Utt([Ntt(Ztt)],oet);let aet=class extends jtt{constructor(){super({},"rangeY")}};aet=Utt([Ntt(Ztt)],aet);let set=class extends jtt{constructor(){super({},"connector")}};set=Utt([Ntt(Ztt)],set);let uet=class extends jtt{constructor(){super({},"shape")}};uet=Utt([Ntt(Ztt)],uet);let cet=class extends jtt{constructor(){super({},"sankey")}};cet=Utt([Ntt([...Ztt,{name:"layout",type:"value"}])],cet);let het=class extends jtt{constructor(){super({},"treemap")}};het=Utt([Ntt([...Ztt,{name:"layout",type:"value"}])],het);let pet=class extends jtt{constructor(){super({},"boxplot")}};pet=Utt([Ntt(Ztt)],pet);let fet=class extends jtt{constructor(){super({},"density")}};fet=Utt([Ntt(Ztt)],fet);let det=class extends jtt{constructor(){super({},"heatmap")}};det=Utt([Ntt(Ztt)],det);let met=class extends jtt{constructor(){super({},"pack")}};met=Utt([Ntt([...Ztt,{name:"layout",type:"value"}])],met);let get=class extends jtt{constructor(){super({},"forceGraph")}};get=Utt([Ntt([...Ztt,{name:"layout",type:"value"}])],get);let yet=class extends jtt{constructor(){super({},"tree")}};yet=Utt([Ntt([...Ztt,{name:"layout",type:"value"}])],yet);let vet=class extends jtt{constructor(){super({},"wordCloud")}};vet=Utt([Ntt([...Ztt,{name:"layout",type:"object"}])],vet);let _et=class extends jtt{constructor(){super({},"gauge")}};_et=Utt([Ntt(Ztt)],_et);const bet={mark:Vtt,interval:Gtt,rect:Htt,point:Wtt,area:qtt,line:Ytt,cell:Xtt,vector:$tt,link:Ktt,polygon:Jtt,image:Qtt,text:tet,box:eet,lineX:net,lineY:ret,range:iet,rangeX:oet,rangeY:aet,connector:set,sankey:cet,treemap:het,boxplot:pet,density:fet,heatmap:det,shape:uet,pack:met,forceGraph:get,tree:yet,wordCloud:vet,gauge:_et};class xet extends Btt{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&mJ(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&dJ(t)}}let wet=class extends xet{constructor(t={},e="view"){super(t,e)}};wet=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"axis"},{type:"object",name:"legend"},...Ftt(bet)])],wet);let Eet=class extends xet{constructor(){super({},"spaceLayer")}};Eet=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},...Ftt(bet)])],Eet);let Met=class extends xet{constructor(){super({},"spaceFlex")}};Met=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},...Ftt(bet)])],Met);let Tet=class extends xet{constructor(){super({},"facetRect")}};Tet=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...Ftt(bet)])],Tet);let Aet=class extends xet{constructor(){super({},"facetCircle")}};Aet=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...Ftt(bet)])],Aet);let Cet=class extends xet{constructor(){super({},"repeatMatrix")}};Cet=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...Ftt(bet)])],Cet);let Oet=class extends xet{constructor(){super({},"timingKeyframe")}};Oet=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([...Ftt(bet)])],Oet);let Pet=class extends xet{constructor(){super({},"geoView")}};Pet=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"legend"},...Ftt(bet)])],Pet);let ket=class extends xet{constructor(){super({},"geoPath")}};ket=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"state"},...Ftt(bet)])],ket);const Let={view:wet,spaceLayer:Eet,spaceFlex:Met,facetRect:Tet,facetCircle:Aet,repeatMatrix:Cet,timingKeyframe:Oet,geoView:Pet,geoPath:ket};for(const t of Object.values(Let))Ntt(Ftt(Let))(t);const Iet=v6();var Ret=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Det=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme"];function Net(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function Fet(t,e){const{autoFit:n}=t;if(n)return function(t){const e=getComputedStyle(t),n=t.clientWidth||cz(e.width),r=t.clientHeight||cz(e.height);return{width:n-(cz(e.paddingLeft)+cz(e.paddingRight)),height:r-(cz(e.paddingTop)+cz(e.paddingBottom))}}(e);const{width:r=640,height:i=480}=t;return{width:r,height:i}}function zet(t){return new Set(Object.keys(bet)).has(t)}function Bet(t){const{type:e,children:n}=t,r=Ret(t,["type","children"]);if("string"!=typeof e)return;const i=function(t){const e=Object.assign(Object.assign({},bet),Let)[t];if(!e)throw new Error(`Unknown mark: ${t}.`);return e}(e),o=new i;return o.value=r,o}function jet(t,e){const{type:n,children:r}=e,i=Ret(e,["type","children"]);t.type===n||void 0===n?t.value=VD(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function Uet(t,e){if(!t)return;const n=[[t,e]];for(;n.length;){const[t,e]=n.shift(),r=Bet(e);Array.isArray(t.children)&&t.push(r);const{children:i}=e;if(Array.isArray(i))for(const t of i)n.push([r,t])}}const Zet="G2_CHART_KEY",Vet=[{name:"data",type:"value"},{name:"width",type:"value"},{name:"height",type:"value"},{name:"coordinate",type:"value"},{name:"interaction",type:"object"},{name:"theme",type:"object"},{name:"title",type:"value"},{name:"transform",type:"array"},{name:"scale",type:"object"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"style",type:"object"},{name:"labelTransform",type:"array"},...Ftt(bet),...(Get=Let,Object.entries(Get).map((([t,e])=>({type:"container",name:t,ctor:e}))))];var Get;let Het=class extends wet{constructor(t){const e=t||{},{container:n,canvas:r,renderer:i,plugins:o}=e;super(function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(e,["container","canvas","renderer","plugins"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=a$((()=>{this.forceFit()}),300),this._renderer=i||new FD,this._plugins=o||[],this._container=function(t){return void 0===t?document.createElement("div"):"string"==typeof t?document.getElementById(t):t}(n),this._emitter=new GD.default,this._context={library:Iet,emitter:this._emitter,canvas:r}}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>Ctt(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return function(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of Det)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,Net(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i){const i=Net(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n){const r=function(t,e,n){const{type:r}=t,{type:i=n||r}=e;if("view"===i)return e;if("string"!=typeof i)return e;if(!zet(i))return e;const o={type:"view"},a=Object.assign({},e);for(const t of Det)void 0!==a[t]&&(o[t]=a[t],delete a[t]);return Object.assign(Object.assign({},o),{children:[a]})}(t,e,n),i=[[null,t,r]];for(;i.length;){const[t,e,n]=i.shift();if(e)if(n){jet(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let o=0;o<n;o++){const n=t[o],a=r[o];i.push([e,a,n])}}}else e.remove();else Uet(t,n)}}(this,t,this._previousDefinedType),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options(),this.emit(tQ.BEFORE_CLEAR),this._reset(),Ott(0,this._context,!1),this.emit(tQ.AFTER_CLEAR)}destroy(){this.options(),this.emit(tQ.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),Ott(0,this._context,!0),function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(tQ.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=Fet(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(tQ.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(tQ.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(tQ.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);const n=this.render();return n.then((()=>{this.emit(tQ.AFTER_CHANGE_SIZE)})),n}_reset(){this.type="view",this.value={},this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=Zet}=t,{width:n,height:r}=Fet(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r})}_createCanvas(){const{width:t,height:e}=Fet(this.options(),this._container);this._plugins.push(new BD),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new MI({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;return null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0,new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}};Het=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([Ntt(Vet)],Het),FL.enableCSSParsing=!1;var Wet=s(7837),qet=s.n(Wet);var Yet=s(1997),Xet=s.n(Yet);const $et=(t,e)=>(Xet()(t,e).isValid(),Xet()(t).format(e)),Ket=t=>{const e=Math.ceil(.2*t.length);return[t[0],t[e]]},Jet=t=>{switch(t){case"year":return"YYYY";case"quarter":case"month":return"YYYY-MM";case"week":case"day":return"YYYY-MM-DD";case"hour":return"YYYY-MM-DD HH";case"minute":return"YYYY-MM-DD HH:mm";default:return"YYYY-MM-DD HH:mm:ss"}};const Qet=t=>(e,n,r)=>{if(!e.handle){const t=r.createElement("path");e.handle=t,e.appendChild(e.handle)}const{handle:i}=e,{width:o,height:a}=n,s=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(n,["width","height"]);return void 0===o||void 0===a||i.attr(Object.assign(Object.assign({},t(o,a)),s)),i},tnt=(t,e,n)=>`M${t-n/2},${e+.5*n}c${.25*-n},0,${.45*-n},${.2*n},${.45*-n},${.45*n}v${3*n}c0,${.25*n},${.2*n},${.45*n},${.45*n},${.45*n}V${e+.5*n}z`,ent=(t,e,n)=>`M${t+n/2},${e+.5*n}c${.25*n},0,${.45*n},${.2*n},${.45*n},${.45*n}v${3*n}c0,${.25*n},${.2*-n},${.45*n},${.45*-n},${.45*n}V${e+.5*n}z`;let nnt;const rnt=t=>{const{className:e,data:n=[],xField:r,yField:i,selection:s,onSelection:u,onReset:l,aggregation:c,granularity:h}=t,p=(0,o.useRef)(),f=(0,o.useRef)(null),d=(0,o.useRef)(!0),m=t=>{switch(t){case"max":case"mean":case"min":case"median":case"sum":return{transform:[{type:"groupX",y:t}],encode:{x:r,y:i}};case"count":return{transform:[{type:"groupX",y:"count"}],encode:{x:r}};default:return{encode:{x:r,y:i}}}};(0,o.useEffect)((()=>{const t={type:"interval",data:n,axis:{x:{labelAutoHide:!0,title:!1,labelAutoRotate:!1},y:!1},state:{inactive:{fill:"rgb(105,116,131)"}},animate:!1,interaction:{brushXHighlight:{maskOpacity:.3,maskFill:"#777",maskHandleWRender:Qet(((t,e)=>({d:tnt(t,e/2-20,10)}))),maskHandleERender:Qet(((t,e)=>({d:ent(0,e/2-20,10)}))),maskHandleEFill:"#D3D8E0",maskHandleWFill:"#D3D8E0"}}};if(p.current){const e=()=>{var e,n;null===(e=p.current)||void 0===e||e.options({children:[Object.assign(Object.assign({},t),m(c))]}),null===(n=p.current)||void 0===n||n.render().then((()=>d.current=!1))};d.current?p.current.once("afterrender",(()=>{d.current=!0,e()})):(d.current=!0,e())}else{d.current=!0;const e=5*Jet(h).length,n=new Het({container:f.current,theme:"classic",autoFit:!0,paddingLeft:e,paddingRight:e});n.options({type:"view",style:{viewFill:"transparent"},children:[Object.assign(Object.assign({},t),m(c))]}),p.current=n,p.current.render().then((()=>d.current=!1))}console.log(p.current.options())}),[n,r,i,c,h]),(0,o.useEffect)((()=>{if(!(p.current&&s&&s[0]&&s[1]))return;const t=()=>{var t,e;s[0]===s[1]||s[0]===-1/0&&s[1]===1/0?null===(t=p.current)||void 0===t||t.emit("brush:remove"):null===(e=p.current)||void 0===e||e.emit("brush:highlight",{data:{selection:[[...s],[-1/0,1/0]]}})};nnt&&(window.clearTimeout(nnt),nnt=void 0),d.current?p.current.once("afterrender",(()=>{nnt=window.setTimeout(t,1e3)})):t()}),[s]),(0,o.useEffect)((()=>{if(!p.current)return()=>null;const t=t=>{const{nativeEvent:e,data:n}=t;if(!e)return;const[r]=n.selection,i=r[0],o=r[r.length-1];i===(null==s?void 0:s[0])&&o===(null==s?void 0:s[1])||u(i,o)},e=()=>l();return p.current.on("brush:highlight",t),p.current.on("brush:end",e),()=>{p.current&&(p.current.off("brush:highlight",t),p.current.off("brush:end",e))}}),[u,l]),(0,o.useEffect)((()=>()=>{p.current&&(p.current.destroy(),p.current=void 0)}),[]);const{run:g}=function(t,e){var n,r=lM(t),i=null!==(n=null==e?void 0:e.wait)&&void 0!==n?n:1e3,a=(0,o.useMemo)((function(){return qet()((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.current.apply(r,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1))}),i,e)}),[]);return cM((function(){a.cancel()})),{run:a,cancel:a.cancel,flush:a.flush}}((()=>{var t;null===(t=p.current)||void 0===t||t.forceFit()}),{wait:200});return(0,o.useEffect)((()=>{const t=new ResizeObserver(g);return t.observe(f.current),()=>{t.disconnect()}}),[]),a().createElement("div",{className:e,ref:f})},int=t=>{const{aggregation:e,data:n,defaultSelection:r,timeField:i,onChangeTimeRange:s,onClear:u,speed:l,timeGranularity:c,yField:h,defaultTimeRange:p}=t,f=(0,o.useMemo)((()=>{const t=((t,e,n)=>{const r=t.filter((t=>!!t[e])).map((t=>Object.assign(Object.assign({},t),{[e]:$et(t[e],n)}))).sort((function(t,n){return new Date(t[e]).getTime()-new Date(n[e]).getTime()}));return r})(n,i,Jet(c)),e=t.map((t=>t[i]));return{data:t,times:[...new Set(e)]}}),[n,i]),[d,m]=(0,o.useState)(p?p.map((t=>$et(t,Jet(c)))):Ket(f.times)),[g,y]=(0,o.useState)(d),[v,_]=(0,o.useState)(d);(0,o.useEffect)((()=>{if(!p)return;const t=p.map((t=>$et(t,Jet(c))));m(t),y(t),_(t)}),[p]),AT((()=>{if(p)return;const t=Ket(f.times);m(t),y(void 0)}),[f.times]);const b=(0,o.useMemo)((()=>g?i_({id:"scene.control.panel.CurrentselectedrangeToCurrentselectedrange",dm:"{currentSelectedRangeStart} 至 {currentSelectedRangeEnd}"},{currentSelectedRangeStart:g[0],currentSelectedRangeEnd:g[1]}):i_({id:"scene.control.panel.DatatimestimesToDatatimestimes",dm:"{dataTimesTimesStart} 至 {dataTimesTimesEnd}"},{dataTimesTimesStart:f.times[0],dataTimesTimesEnd:f.times[1]})),[g,f.times]),x=()=>{u(),y(void 0)};return a().createElement("div",{className:"content"},a().createElement("div",{className:"content-header"},a().createElement("div",{className:"content-header-field"},a().createElement(TT,null),i),a().createElement("div",{className:"content-header-time"},a().createElement("span",null,b))),a().createElement(rnt,{className:"chart",data:f.data,xField:i,yField:h,selection:v,aggregation:e,granularity:c,onSelection:(t,e)=>{t&&e&&(y([t,e]),m([t,e]),s([t,e]))},onReset:x}),a().createElement(YT,{className:"content-btn",timebar:f.times,selection:g,initialSelection:d,setSelection:t=>{y(t),_(t),s(t)},defaultSpeed:l,onReset:()=>{x(),_([-1/0,1/0])}}))};function ont(t,e){return"number"==typeof t?10===t.toString().length?1e3*t:t:Xet()(t,Jet(e)).valueOf()}function ant(t,e,n){const r=t.map((t=>t[n])).filter(Boolean).map((t=>ont(t,e)));return[Math.min(...r),Math.max(...r)]}function snt(t,e){return t[e].map((t=>t.data))}let unt=!1;const lnt=t=>{const{aggregation:e,speed:n,timeField:r,timeGranularity:s,yField:u,graphData:l,type:c,playMode:h,defaultTimeLength:p}=t,{updateContext:f,transform:d,graph:m}=(0,i.useContext)(),[g,y]=(0,o.useState)(),[v,_]=(0,o.useState)([]),[b,x]=(0,o.useState)(),w=(0,o.useRef)(),S=(0,o.useMemo)((()=>l[c].map((t=>t.data))),[l,c]);(0,o.useEffect)((()=>{y(b)}),[b]),(0,o.useEffect)((()=>{(null==S?void 0:S.length)&&(unt?unt=!0:setTimeout((()=>{const t=ant(S,s,r);switch(p){case"all":return E(t),void x(t);case"day":return void E([t[0],t[0]+864e5]);case"month":return void E([t[0],t[0]+26784e5]);case"year":return void E([t[0],t[0]+31536e6]);default:return}})))}),[p,S]),(0,o.useEffect)((()=>{(function(t){return t.nodes.some((t=>t.__GI_PLAYING__))||t.edges.some((t=>t.__GI_PLAYING__))})(l)||(t=>!t.edges.length&&!t.nodes.length)(l)||(w.current=l,_(snt(l,c)))}),[l]),(0,o.useEffect)((()=>{w.current&&s&&_(snt(w.current,c))}),[s]),(0,o.useEffect)((()=>{if(!g||!w.current)return;const t=function(t,e,n,r,i){const o=t=>ont(t,n),a=t[i].filter((t=>{if(!t.data[r])return!0;const n=o(t.data[r]);return n>=o(e[0])&&n<=o(e[1])})),s=t["nodes"===i?"edges":"nodes"],u=t=>{const e=(new Date).getTime();return t.map((t=>Object.assign(Object.assign({},t),{__GI_PLAYING__:e})))};return{[i]:u(a),["nodes"===i?"edges":"nodes"]:u(s)}}(w.current,g,s,r,c);if("filter"===h){const e=d(t);f((t=>{t.data=e}))}else if("highlight"===h)l.nodes.forEach((e=>{const{id:n}=e;t.nodes.some((t=>t.id===n))?m.setItemState(e.id,"highlight",!0):m.setItemState(e.id,"inactive",!0)})),l.edges.forEach((e=>{const{id:n}=e;t.edges.some((t=>t.id===n))?m.setItemState(e.id,"highlight",!0):m.setItemState(e.id,"inactive",!0)}));else if("show-hide"===h){const e={};l.nodes.forEach((n=>{const{id:r}=n;t.nodes.some((t=>t.id===r))?(m.showItem(r),e[r]=!0):m.hideItem(r)})),l.edges.forEach((n=>{const{id:r,source:i,target:o}=n;t.edges.some((t=>t.id===r))&&e[i]&&e[o]?m.showItem(r):m.hideItem(r)}))}m.emit("timechange",{timeRange:g})}),[g,w.current]);const{run:E}=function(t,e){var n,r=lM(t),i=null!==(n=null==e?void 0:e.wait)&&void 0!==n?n:1e3,a=(0,o.useMemo)((function(){return uM()((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.current.apply(r,(0,aM.__spreadArray)([],(0,aM.__read)(t),!1))}),i,e)}),[]);return cM((function(){a.cancel()})),{run:a,cancel:a.cancel,flush:a.flush}}((t=>{y(t.map((t=>ont(t,s))))}),{wait:500});return(0,hM.Z)(v)?a().createElement(FE.Empty,{description:i_({id:"scene.Timebar.control.PleaseQueryTheGraphFirst",dm:"请先进行图查询"})}):a().createElement(int,{aggregation:e,data:v,defaultSelection:g,onChangeTimeRange:E,onClear:()=>{y(ant(S,s,r))},speed:n,timeField:r,timeGranularity:s,yField:u,defaultTimeRange:b})},cnt={MapMode:JE,LargeGraph:m_,Timebar:{info:nM,component:({aggregation:t,timeField:e,yField:n,timeRange:r,defaultTimeLength:o,timeGranularity:s,speed:u,playMode:l})=>{const{data:c}=(0,i.useContext)();if(!e||!n)return a().createElement(FE.Empty,{description:i_({id:"scene.src.Timebar.Component.PleaseConfigureTheTimeField",dm:"请配置时间字段"}),style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}});const[h,p]=e.split(":"),[f,d]=n.split(":");return h!==f?(FE.message.warning(i_({id:"scene.src.Timebar.Component.MakeSureThatTheTime",dm:"请确保时间字段和指标字段同属于节点或边!"})),null):a().createElement(lnt,{aggregation:t,graphData:c,speed:u,timeField:p,timeGranularity:s,type:h,yField:d,playMode:l,defaultTimeLength:o})},registerMeta:({schemaData:t})=>{const e=(e,n)=>Object.entries(t[e].reduce(((t,e)=>Object.assign(Object.assign({},t),e.properties)),{})).filter((([,t])=>!n||[n].includes(t))).map((([t])=>({label:t,value:`${e}:${t}`})));return Object.assign({timeField:{title:i_({id:"scene.src.Timebar.registerMeta.TimeField",dm:"时间字段"}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:[{label:i_({id:"scene.src.Timebar.registerMeta.Node",dm:"节点"}),options:e("nodes")},{label:i_({id:"scene.src.Timebar.registerMeta.Edge",dm:"边"}),options:e("edges")}]},yField:{title:i_({id:"scene.src.Timebar.registerMeta.IndicatorField",dm:"指标字段"}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:[{label:i_({id:"scene.src.Timebar.registerMeta.Node",dm:"节点"}),options:e("nodes")},{label:i_({id:"scene.src.Timebar.registerMeta.Edge",dm:"边"}),options:e("edges")}],"x-decorator-props":{tooltip:i_({id:"scene.src.Timebar.registerMeta.OnlyAggregateCountsAreSupported",dm:"非数值类型仅支持聚合计数\n确保和时间字段同属于节点或边"})}},aggregation:{title:i_({id:"scene.src.Timebar.registerMeta.Aggregation",dm:"聚合"}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:[{label:i_({id:"scene.src.Timebar.registerMeta.Count",dm:"计数"}),value:"count"},{label:i_({id:"scene.src.Timebar.registerMeta.Maximum",dm:"最大值"}),value:"max"},{label:i_({id:"scene.src.Timebar.registerMeta.Mean",dm:"均值"}),value:"mean"},{label:i_({id:"scene.src.Timebar.registerMeta.MinimumValue",dm:"最小值"}),value:"min"},{label:i_({id:"scene.src.Timebar.registerMeta.Median",dm:"中位数"}),value:"median"},{label:i_({id:"scene.src.Timebar.registerMeta.Summation",dm:"求和"}),value:"sum"}],default:"count"},defaultTimeLength:{title:i_({id:"scene.src.Timebar.registerMeta.DefaultTimeLength",dm:"默认时间长度"}),type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{options:[{value:"all",label:i_({id:"scene.src.Timebar.registerMeta.All",dm:"全部"})},{value:"month",label:i_({id:"scene.src.Timebar.registerMeta.OneMonth",dm:"一个月"})},{value:"year",label:i_({id:"scene.src.Timebar.registerMeta.OneYear",dm:"一年"})}]},default:"all"},timeGranularity:{title:i_({id:"scene.src.Timebar.registerMeta.TimeGranularity",dm:"时间粒度"}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:QE,"x-linkages":[{type:"value:schema",target:"timeRange",condition:"{{ $self === 'year' }}",schema:{"x-component-props":{picker:"year"}}},{type:"value:schema",target:"timeRange",condition:"{{ $self === 'quarter' }}",schema:{"x-component-props":{picker:"quarter"}}},{type:"value:schema",target:"timeRange",condition:"{{ $self === 'month' }}",schema:{"x-component-props":{picker:"month"}}},{type:"value:schema",target:"timeRange",condition:"{{ $self === 'week' }}",schema:{"x-component-props":{picker:"week"}}}],default:"day"},speed:{title:i_({id:"scene.src.Timebar.registerMeta.PlaybackSpeed",dm:"播放速度"}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:eM,default:1},playMode:{title:i_({id:"scene.src.Timebar.registerMeta.PlaybackMode",dm:"播放模式"}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:[{label:i_({id:"scene.src.Timebar.registerMeta.Filtering",dm:"过滤"}),value:"filter"},{label:i_({id:"scene.src.Timebar.registerMeta.Highlight",dm:"高亮"}),value:"highlight"},{label:i_({id:"scene.src.Timebar.registerMeta.ShowHide",dm:"显示/隐藏"}),value:"show-hide"}],default:"filter"}},oM)}}}})(),u})()));
|