{ "pandav:/dist/maptalks.vt.es.js": { "cubeCode": "Cube(\"pandav:/npm/@maptalks/vt/0.107.2/dist/maptalks.vt.es\", [\"pandav:/npm/maptalks/1.2.1\", \"pandav:/npm/@maptalks/gl/0.108.1\", \"pandav:/npm/color/3.0.0\", \"pandav:/npm/fast-deep-equal/2.0.1\", \"pandav:/npm/@maptalks/function-type/1.4.1\", \"pandav:/npm/animation-easings/0.1.0\", \"pandav:/npm/@maptalks/feature-filter/1.3.0\", \"pandav:/npm/@maptalks/vt-plugin/0.99.1\", \"pandav:/npm/gl-matrix/3.4.0\", \"pandav:/npm/earcut/3.0.1\", \"pandav:/npm/@maptalks/tbn-packer/1.4.5\", \"pandav:/npm/rbush/3.0.1\"], function (module, exports, require, load, process, global) {Object.defineProperty(exports, \"__esModule\", { value: true });exports.WireframePlugin = exports.WireframePainter = exports.WaterPlugin = exports.VectorTileLayerRenderer = exports.VectorTileLayer = exports.Vector3DLayer = exports.TubePlugin = exports.TextPlugin = exports.TextPainter = exports.SYMBOLS_NEED_REBUILD_IN_VT = exports.SYMBOLS_NEED_REBUILD_IN_VECTOR = exports.PolygonLayer = exports.PointLayer = exports.PhongPlugin = exports.PhongPainter = exports.PackUtil = exports.NativePointPainter = exports.NativeLinePlugin = exports.NativeLinePainter = exports.MapboxVectorTileLayer = exports.LitPlugin = exports.LineStringLayer = exports.LinePlugin = exports.LinePainter = exports.LineGradientPlugin = exports.IconPlugin = exports.IconPainter = exports.HeatmapPlugin = exports.GeoJSONVectorTileLayer = exports.GLTFStandardPlugin = exports.GLTFPhongPlugin = exports.FilterUtil = exports.FillPlugin = exports.FillPainter = exports.ExtrudePolygonLayer = exports.BillBoardPlugin = exports.BillBoardPainter = void 0;var _maptalks = _interopRequireWildcard(require('pandav:/npm/maptalks/1.2.1'));var e = _maptalks;var _gl = _interopRequireWildcard(require('pandav:/npm/@maptalks/gl/0.108.1'));var r = _gl;var _color = _interopRequireDefault(require('pandav:/npm/color/3.0.0'));var _fastDeepEqual = _interopRequireDefault(require('pandav:/npm/fast-deep-equal/2.0.1'));var _functionType = require('pandav:/npm/@maptalks/function-type/1.4.1');var _animationEasings = _interopRequireDefault(require('pandav:/npm/animation-easings/0.1.0'));var _featureFilter = require('pandav:/npm/@maptalks/feature-filter/1.3.0');var _vtPlugin = _interopRequireDefault(require('pandav:/npm/@maptalks/vt-plugin/0.99.1'));var _glMatrix = require('pandav:/npm/gl-matrix/3.4.0');var _earcut = _interopRequireDefault(require('pandav:/npm/earcut/3.0.1'));var _tbnPacker = require('pandav:/npm/@maptalks/tbn-packer/1.4.5');var _rbush = _interopRequireDefault(require('pandav:/npm/rbush/3.0.1'));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}function _getRequireWildcardCache(e) {if (\"function\" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}function _superPropSet(t, e, o, r, p, f) {return _set(_getPrototypeOf(f ? t.prototype : t), e, o, r, p);}function set(e, r, t, o) {return set = \"undefined\" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) {var f,i = _superPropBase(e, r);if (i) {if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0;if (!f.writable) return !1;}if (f = Object.getOwnPropertyDescriptor(o, r)) {if (!f.writable) return !1;f.value = t, Object.defineProperty(o, r, f);} else _defineProperty(o, r, t);return !0;}, set(e, r, t, o);}function _set(e, r, t, o, f) {if (!set(e, r, t, o || e) && f) throw new TypeError(\"failed to set property\");return t;}function _defineProperty(e, r, t) {return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;}function _superPropGet(t, o, e, r) {var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);return 2 & r && \"function\" == typeof p ? function (t) {return p.apply(e, t);} : p;}function _get() {return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {var p = _superPropBase(e, t);if (p) {var n = Object.getOwnPropertyDescriptor(p, t);return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;}}, _get.apply(null, arguments);}function _superPropBase(t, o) {for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););return t;}function _toArray(r) {return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest();}function _toConsumableArray(r) {return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();}function _nonIterableSpread() {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 _iterableToArray(r) {if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);}function _arrayWithoutHoles(r) {if (Array.isArray(r)) return _arrayLikeToArray(r);}function _callSuper(t, o, e) {return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));}function _possibleConstructorReturn(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 _assertThisInitialized(t);}function _assertThisInitialized(e) {if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e;}function _inherits(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 && _setPrototypeOf(t, e);}function _wrapNativeSuper(t) {var r = \"function\" == typeof Map ? new Map() : void 0;return _wrapNativeSuper = function _wrapNativeSuper(t) {if (null === t || !_isNativeFunction(t)) return t;if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\");if (void 0 !== r) {if (r.has(t)) return r.get(t);r.set(t, Wrapper);}function Wrapper() {return _construct(t, arguments, _getPrototypeOf(this).constructor);}return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t);}, _wrapNativeSuper(t);}function _construct(t, e, r) {if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);var o = [null];o.push.apply(o, e);var p = new (t.bind.apply(t, o))();return r && _setPrototypeOf(p, r.prototype), p;}function _isNativeReflectConstruct() {try {var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));} catch (t) {}return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {return !!t;})();}function _isNativeFunction(t) {try {return -1 !== Function.toString.call(t).indexOf(\"[native code]\");} catch (n) {return \"function\" == typeof t;}}function _setPrototypeOf(t, e) {return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {return t.__proto__ = e, t;}, _setPrototypeOf(t, e);}function _getPrototypeOf(t) {return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {return t.__proto__ || Object.getPrototypeOf(t);}, _getPrototypeOf(t);}function _createForOfIteratorHelper(r, e) {var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];if (!t) {if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) {t && (r = t);var _n304 = 0,F = function F() {};return { s: F, n: function n() {return _n304 >= r.length ? { done: !0 } : { done: !1, value: r[_n304++] };}, e: function e(r) {throw r;}, f: F };}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,u = !1;return { s: function s() {t = t.call(r);}, n: function n() {var r = t.next();return a = r.done, r;}, e: function e(r) {u = !0, o = r;}, f: function f() {try {a || null == t.return || t.return();} finally {if (u) throw o;}} };}function _typeof(o) {\"@babel/helpers - typeof\";return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;}, _typeof(o);}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {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 _unsupportedIterableToArray(r, a) {if (r) {if (\"string\" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _classCallCheck(a, n) {if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");}function _defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);}}function _createClass(e, r, t) {return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e;}function _toPropertyKey(t) {var i = _toPrimitive(t, \"string\");return \"symbol\" == _typeof(i) ? i : i + \"\";}function _toPrimitive(t, r) {if (\"object\" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || \"default\");if (\"object\" != _typeof(i)) return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\");}return (\"string\" === r ? String : Number)(t);}var E = \"${\",D = \"function(t){let e;const n={width:100,height:10};let r=!1;try{const t=new OffscreenCanvas(1,1);t.getContext(\\\"2d\\\").fillText(\\\"hello\\\",0,0),r=!0}catch(t){r=!1}function i(){if(!e){const{width:t,height:i}=n;r?e=new OffscreenCanvas(t,i):(e=document.createElement(\\\"canvas\\\"),e.width=t,e.height=i)}return e}class o{constructor(t,e={}){if(!Array.isArray(t))return void console.error(\\\"colors is not array\\\");if(t.length<2)return void console.error(\\\"colors.length should >1\\\");this.colors=t;let r=1/0,i=-1/0;for(let e=0,n=t.length;e=t.stops.length||e<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:m(e,n,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}\\\"function\\\"==typeof Map&&(s=new Map);const d={width:100,height:1};function g(t,e){const n=t.stops;if(n&&n.length>1){let t;if(s){const e=JSON.stringify(n);if(!s.has(e)){const t=new o(n,d);s.set(e,t)}t=s.get(e)}else t=new o(n,d);const[r,i,a,l]=t.getColor(e);return[r/255,i/255,a/255,l/255]}return n&&1===n.length?n[0][1]:null}function y(t,e){return n=e,r=t.default,l(n)?n:l(r)?r:l(i)?i:null;var n,r,i}function x(t,e){const n=String(t.property),r=t.expression,i=e;function o(e){return a(e)||u(e)||isNaN(e)?t.default:e}if(!l(e)||u(e)||isNaN(e)||e<0)return o(t.default);{const e=function t(e,n,r){const i=Number(r),o=String(n);return Array.isArray(e)?e.map((e=>t(e,o,i))):e===o?i:e}(r,n,i);return o(function e(n){if(!Array.isArray(n)){if(\\\"number\\\"==typeof n)return n;throw new Error(\\\"Invalid expression format\\\")}{const r=n[0];if(![\\\"+\\\",\\\"-\\\",\\\"*\\\",\\\"/\\\"].includes(r))throw new Error(`Unknown operator: \".concat(E, \"r}`);const i=n.slice(1).map((t=>e(t)));switch(r){case\\\"+\\\":return i.reduce(((t,e)=>t+e),0);case\\\"-\\\":return i.reduce(((t,e)=>t-e));case\\\"*\\\":return i.reduce(((t,e)=>t*e),1);case\\\"/\\\":return i.some((t=>0===t))?t.default:i.reduce(((t,e)=>t/e));default:throw new Error(`Unsupported operator: \").concat(E, \"r}`)}}}(e))}}function m(t,e,n,r,i,o){return\\\"function\\\"==typeof i?function(){var s=i.apply(void 0,arguments),a=o.apply(void 0,arguments);return m(t,e,n,r,s,a)}:i.length?function(t,e,n,r,i,o){var s=[];for(let a=0;a{const i=this._parseResponse(r,e.returnJSON,e.responseType);i.message?(i.url=t,n(i)):i.then((t=>{\\\"arraybuffer\\\"===e.responseType?n(null,{data:t,cacheControl:r.headers.get(\\\"Cache-Control\\\"),expires:r.headers.get(\\\"Expires\\\"),contentType:r.headers.get(\\\"Content-Type\\\")}):n(null,t)})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(console.error(\\\"Fetch error:\\\",t,e),n(e))}))})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(console.error(\\\"Fetch error:\\\",t,e),n(e))})),r}{const i=C._getClient(n);if(i.open(e.method||\\\"GET\\\",t,!0),e){for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);i.withCredentials=\\\"include\\\"===e.credentials,e.responseType&&(i.responseType=e.responseType)}return i.send(r?e.body:null),i}},_parseResponse:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(\").concat(E, \"t.status}): \").concat(E, \"t.statusText}`}:\\\"arraybuffer\\\"===n?t.arrayBuffer():e?t.json():t.text(),_wrapCallback:function(t,e){return function(){if(4===t.readyState)if(200===t.status)if(\\\"arraybuffer\\\"===t.responseType){0===t.response.byteLength?e({status:200,statusText:t.statusText,message:\\\"http status 200 returned without content.\\\"}):e(null,{data:t.response,cacheControl:t.getResponseHeader(\\\"Cache-Control\\\"),expires:t.getResponseHeader(\\\"Expires\\\"),contentType:t.getResponseHeader(\\\"Content-Type\\\")})}else e(null,t.responseText);else e({status:t.status,statusText:t.statusText,message:`incorrect http request with status code(\").concat(E, \"t.status}): \").concat(E, \"t.statusText}`})}},_getClient:function(t){let e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject(\\\"Msxml2.XMLHTTP\\\")}catch(t){try{e=new ActiveXObject(\\\"Microsoft.XMLHTTP\\\")}catch(t){}}}return e.onreadystatechange=C._wrapCallback(e,t),e},getArrayBuffer(t,e,n){if(T(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType=\\\"arraybuffer\\\",C.get(t,e,n)}};function Y(t,e,n,r,i=3){let o=r;const s=n-e>>1;let a,l=n-e;const u=t[e],h=t[e+1],c=t[n],f=t[n+1];for(let r=e+i;ro)a=r,o=e;else if(e===o){const t=Math.abs(r-s);tr&&(a-e>i&&Y(t,e,a,r,i),t[a+2]=o,n-a>i&&Y(t,a,n,r,i))}function V(t,e,n,r,i,o){let s=i-n,a=o-r;if(0!==s||0!==a){const l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return s=t-n,a=e-r,s*s+a*a}function O(t,e,n,r,i,o){const s={id:null==t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};i&&(s.layer=i);return function(t,e){const n=t.geometry,r=t.type;if(\\\"Point\\\"===r||\\\"MultiPoint\\\"===r||\\\"LineString\\\"===r)X(t,n,e);else if(\\\"Polygon\\\"===r)X(t,n[0],e);else if(\\\"MultiLineString\\\"===r)for(const r of n)X(t,r,e);else if(\\\"MultiPolygon\\\"===r)for(const r of n)X(t,r[0],e)}(s,o?4:3),s}function X(t,e,n){for(let r=0;r2?e.push(t[2]):e.push(0))}function $(t,e,n,r,i){let o,s,a=0;for(let n=0;n2?e.push(t[n][2]):e.push(0)),n>0&&(a+=r?(o*u-l*s)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-s,2))),o=l,s=u}const l=i.hasAltitude?4:3,u=e.length-l;e[2]=1,Y(e,0,u,n,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function D(t,e,n,r,i){for(let o=0;o1?1:r}function Z(t,e,n,r,i,o,s,a){if(r/=e,o>=(n/=e)&&s=r)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const s=0===i?e.minX:e.minY,u=0===i?e.maxX:e.maxY;if(s>=n&&u=r)continue;let h=[];if(\\\"Point\\\"===o||\\\"MultiPoint\\\"===o)G(t,h,n,r,i,a.hasAltitude);else if(\\\"LineString\\\"===o)U(t,h,n,r,i,!1,a.lineMetrics,a.hasAltitude);else if(\\\"MultiLineString\\\"===o)J(t,h,n,r,i,!1,a.hasAltitude);else if(\\\"Polygon\\\"===o)J(t,h,n,r,i,!0,a.hasAltitude);else if(\\\"MultiPolygon\\\"===o)for(const e of t){const t=[];J(e,t,n,r,i,!0,a.hasAltitude),t.length&&h.push(t)}if(h.length){if(a.lineMetrics&&\\\"LineString\\\"===o){for(const t of h)l.push(O(e.id,o,t,e.tags,e.layer,a.hasAltitude));continue}\\\"LineString\\\"!==o&&\\\"MultiLineString\\\"!==o||(1===h.length?(o=\\\"LineString\\\",h=h[0]):o=\\\"MultiLineString\\\"),\\\"Point\\\"!==o&&\\\"MultiPoint\\\"!==o||(o=3===h.length?\\\"Point\\\":\\\"MultiPoint\\\"),l.push(O(e.id,o,h,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function G(t,e,n,r,i,o){const s=o?4:3;for(let a=0;a=n&&s<=r&&(H(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function U(t,e,n,r,i,o,s,a){let l=R(t);const u=0===i?W:K;let h,c,f=t.start;const p=a?4:3,d=o?t.length:t.length-p;for(let g=0;gn&&(c=u(l,y,x,v,w,n),a&&l.push(Q(M,b,c)),s&&(l.start=f+h*c)):P>r?_=n&&(c=u(l,y,x,v,w,n),a&&l.push(Q(M,b,c)),I=!0),_>r&&P<=r&&(c=u(l,y,x,v,w,r),a&&l.push(Q(M,b,c)),I=!0),!o&&I&&(s&&(l.end=f+h*c),e.push(l),l=R(t)),s&&(f+=h)}let g=t.length-p;if(!o){const e=t[g],o=t[g+1],s=t[g+2],u=0===i?e:o;if(u>=n&&u<=r&&H(l,e,o,s),u>=n&&u<=r&&a){const e=t[g+3];l.push(e)}}g=l.length-p,o&&g>=p&&(l[g]!==l[0]||l[g+1]!==l[1])&&(H(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function R(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,n,r,i,o,s){for(const a of t)U(a,e,n,r,i,o,!1,s)}function H(t,e,n,r){t.push(e,n,r)}function W(t,e,n,r,i,o){const s=(o-e)/(r-e);return H(t,o,n+(i-n)*s,1),s}function K(t,e,n,r,i,o){const s=(o-n)/(i-n);return H(t,e+(r-e)*s,o,1),s}function Q(t,e,n){return t+(e-t)*n}function tt(t,e,n){const r=[];for(let i=0;i0&&n}function at(t,e,n,r,i,o,s){const a=r*r,{hasAltitude:l,disableFilter:u}=s,h=l?4:3;if(!u&&r>0&&e.size<(i?a:r))return void(n.numPoints+=e.length/h);const c=[];for(let t=0;ta||st(e,t,l))&&(n.numSimplified++,c.push(e[t],e[t+1]),l&&c.push(e[t+3])),n.numPoints++;i&&function(t,e,n){const r=n?3:2;let i=0;for(let e=0,n=t.length,o=n-r;e0===e){const e=r,i=r-1,o=r-2;for(let s=0,a=t.length;s24)throw new Error(\\\"maxZoom should be in the 0-24 range\\\");if(e.promoteId&&e.generateId)throw new Error(\\\"promoteId and generateId cannot be used together.\\\");let r=function(t,e){const n=[];if(Array.isArray(t)){for(let r=0;r1&&console.time(\\\"creation\\\"),f=this.tiles[c]=it(t,e,n,r,l),this.tileCoords.push({z:e,x:n,y:r}),u)){u>1&&(console.log(\\\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\\\",e,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd(\\\"creation\\\"));const t=`z\").concat(E, \"e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(n!==o>>t||r!==s>>t)continue}}if(f.source=null,0===t.length)continue;u>1&&console.time(\\\"clipping\\\");const p=.5*l.buffer/l.extent,d=.5-p,g=.5+p,y=1+p;let x=null,m=null,v=null,w=null,M=Z(t,h,n-p,n+g,0,f.minX,f.maxX,l),b=Z(t,h,n+d,n+y,0,f.minX,f.maxX,l);t=null,M&&(x=Z(M,h,r-p,r+g,1,f.minY,f.maxY,l),m=Z(M,h,r+d,r+y,1,f.minY,f.maxY,l),M=null),b&&(v=Z(b,h,r-p,r+g,1,f.minY,f.maxY,l),w=Z(b,h,r+d,r+y,1,f.minY,f.maxY,l),b=null),u>1&&console.timeEnd(\\\"clipping\\\"),a.push(x||[],e+1,2*n,2*r),a.push(m||[],e+1,2*n,2*r+1),a.push(v||[],e+1,2*n+1,2*r),a.push(w||[],e+1,2*n+1,2*r+1)}}getTile(t,e,n){t=+t,e=+e,n=+n;const r=this.options,{extent:i,debug:o}=r,{hasAltitude:s,wrapX:a}=r;if(t<0||t>24)return null;if(a){const n=1<1&&console.log(\\\"drilling down to z%d-%d-%d\\\",t,e,n);let u,h=t,c=e,f=n;for(;!u&&h>0;)h--,c>>=1,f>>=1,u=this.tiles[ht(h,c,f)];return u&&u.source?(o>1&&(console.log(\\\"found parent tile z%d-%d-%d\\\",h,c,f),console.time(\\\"drilling down\\\")),this.splitTile(u.source,h,c,f,t,e,n),o>1&&console.timeEnd(\\\"drilling down\\\"),this.tiles[l]?nt(this.tiles[l],i,s):null):null}}function ht(t,e,n){return 32*((1<r)||o===a&&(o<0||o>r)}var pt=\\\"undefined\\\"!=typeof Float32Array?Float32Array:Array;function dt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function yt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function xt(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 mt(t,e,n){return t[0]=e,t[1]=n,t}function vt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function(){var t,e=(t=new pt(3),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}(),function(){var t,e=(t=new pt(4),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),function(){var t,e=(t=new pt(2),pt!=Float32Array&&(t[0]=0,t[1]=0),t)}();const wt=Math.PI/180,Mt=6378137*Math.PI/180,bt=85.0511287798;function Pt(t,e,n){if(\\\"EPSG:3857\\\"===n)return function(t,e){const n=bt,r=e[0],i=Math.max(Math.min(n,e[1]),-n);let o;o=0===i?0:Math.log(Math.tan((90+i)*wt/2))/wt;return t[0]=r*Mt,t[1]=o*Mt,t}(t,e);if(\\\"EPSG:4326\\\"===n||\\\"EPSG:4490\\\"===n||\\\"identity\\\"===n)return _t(t,e);if(\\\"baidu\\\"===n)return _t(t,e);throw new Error(\\\"unsupported projection:\\\"+n)}function _t(t,e){return t[0]=e[0],t[1]=e[1],t}function It(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){0===t?function(t,e,n,r,i,o,s,a,l,u){const h=1/(100*o[0]),c=1/(100*o[1]),f=u&&u[0]||0,p=u&&u[1]||0,d=[0,0];for(let i=t;i80*n){a=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;oe&&(e=n),i>r&&(r=i)}u=Math.max(e-a,r-l),u=0!==u?32767/u:0}return Bt(o,s,n,a,l,u,0),s}function Ft(t,e,n,r,i){let o;if(i===function(t,e,n,r){let i=0;for(let o=e,s=n-r;o0)for(let i=e;i=e;i-=r)o=Wt(i/r|0,t[i],t[i+1],o);return o&&Zt(o,o.next)&&(Kt(o),o=o.next),o}function kt(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Zt(r,r.next)&&0!==jt(r.prev,r,r.next))r=r.next;else{if(Kt(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function Bt(t,e,n,r,i,o,s){if(!t)return;!s&&o&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=Et(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=1;do{let r,i=t;t=null;let o=null;for(e=0;i;){e++;let s=i,a=0;for(let t=0;t0||l>0&&s;)0!==a&&(0===l||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);let a=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ct(t,r,i,o):Lt(t))e.push(l.i,t.i,u.i),Kt(t),t=u.next,a=u.next;else if((t=u)===a){s?1===s?Bt(t=Yt(kt(t),e),e,n,r,i,o,2):2===s&&Vt(t,e,n,r,i,o):Bt(kt(t),e,n,r,i,o,1);break}}}function Lt(t){const e=t.prev,n=t,r=t.next;if(jt(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,h=Math.min(i,o,s),c=Math.min(a,l,u),f=Math.max(i,o,s),p=Math.max(a,l,u);let d=r.next;for(;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&Dt(i,a,o,l,s,u,d.x,d.y)&&jt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ct(t,e,n,r){const i=t.prev,o=t,s=t.next;if(jt(i,o,s)>=0)return!1;const a=i.x,l=o.x,u=s.x,h=i.y,c=o.y,f=s.y,p=Math.min(a,l,u),d=Math.min(h,c,f),g=Math.max(a,l,u),y=Math.max(h,c,f),x=Et(p,d,e,n,r),m=Et(g,y,e,n,r);let v=t.prevZ,w=t.nextZ;for(;v&&v.z>=x&&w&&w.z<=m;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&Dt(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&Dt(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;v&&v.z>=x;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&Dt(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=m;){if(w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&Dt(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function Yt(t,e){let n=t;do{const r=n.prev,i=n.next.next;!Zt(r,i)&&Gt(r,n,n.next,i)&&Jt(r,i)&&Jt(i,r)&&(e.push(r.i,n.i,i.i),Kt(n),Kt(n.next),n=t=i),n=n.next}while(n!==t);return kt(n)}function Vt(t,e,n,r,i,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&qt(s,t)){let a=Ht(s,t);return s=kt(s,s.next),a=kt(a,a.next),Bt(s,e,n,r,i,o,0),void Bt(a,e,n,r,i,o,0)}t=t.next}s=s.next}while(s!==t)}function Ot(t,e){let n=t.x-e.x;if(0===n&&(n=t.y-e.y,0===n)){n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return n}function Xt(t,e){const n=function(t,e){let n=e;const r=t.x,i=t.y;let o,s=-1/0;if(Zt(t,n))return n;do{if(Zt(t,n.next))return n.next;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>s&&(s=t,o=n.x=n.x&&n.x>=l&&r!==n.x&&$t(io.x||n.x===o.x&&Nt(o,n)))&&(o=n,h=e)}n=n.next}while(n!==a);return o}(t,e);if(!n)return e;const r=Ht(n,t);return kt(r,r.next),kt(n,n.next)}function Nt(t,e){return jt(t.prev,t,e.prev)<0&&jt(e.next,t,t.next)<0}function Et(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 zt(t){let e=t,n=t;do{(e.x=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function Dt(t,e,n,r,i,o,s,a){return!(t===s&&e===a)&&$t(t,e,n,r,i,o,s,a)}function qt(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&&Gt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Jt(t,e)&&Jt(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)&&(jt(t.prev,t,e.prev)||jt(t,e.prev,e))||Zt(t,e)&&jt(t.prev,t,t.next)>0&&jt(e.prev,e,e.next)>0)}function jt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Zt(t,e){return t.x===e.x&&t.y===e.y}function Gt(t,e,n,r){const i=Rt(jt(t,e,n)),o=Rt(jt(t,e,r)),s=Rt(jt(n,r,t)),a=Rt(jt(n,r,e));return i!==o&&s!==a||(!(0!==i||!Ut(t,n,e))||(!(0!==o||!Ut(t,r,e))||(!(0!==s||!Ut(n,t,r))||!(0!==a||!Ut(n,e,r)))))}function Ut(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 Rt(t){return t>0?1:t<0?-1:0}function Jt(t,e){return jt(t.prev,t,t.next)<0?jt(t,e,t.next)>=0&&jt(t,t.prev,e)>=0:jt(t,e,t.prev)<0||jt(t,t.next,e)<0}function Ht(t,e){const n=Qt(t.i,t.x,t.y),r=Qt(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 Wt(t,e,n,r){const i=Qt(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 Kt(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 Qt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const te=\\\"__fea_idx\\\";new Float32Array([-1e12])[0];const ee=\\\"maptalks_ombb\\\";function ne(){return function(){if(\\\"undefined\\\"!=typeof undefinedThis)return globalThis;if(\\\"undefined\\\"!=typeof self)return self;if(\\\"undefined\\\"!=typeof window)return window;if(\\\"undefined\\\"!=typeof undefined)return global;throw new Error(\\\"unable to locate global object\\\")}().maptalks_vt_packers}const{PackUtil:re,ArrayPool:ie}=ne();function oe(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g,y){const x=e.getLength(),m=i/3;for(let n=2,r=x;n=s;c--){const s=o[c],m=3*s+1,v=3*s+2,w=i[3*s],M=i[m],b=i[v];p||d||(p=Math.max(i[v],i[3*o[c-3]+2]),d=Math.min(i[v],i[3*o[c-3]+2]),f=p-d);let P=g;const _=c%6;0===t?(5===_&&(y=St(i,o,c,w,M)),P=_===x[0]||_===x[1]||_===x[2]?g:g+y):1===t&&(_===x[0]||_===x[1]||_===x[2]?P=0:5===_?(y=St(i,o,c,w,M),P=y):P=y);const I=P/u*(1/(100*h))/a;let A;A=1===e?b===p?1:0:\\\"bottom\\\"===n?b===p?f/100/l:0:b===p?0:-f/100/l,r[2*s]=I,r[2*s+1]=A,0===_&&(g+=y)}}(a,l,u,h,n,o,g,c[0],c[1],f,p,d)}function ae(t){const e=[t[0]];let n=t[0];for(let r=1;r0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function ge(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=i*l-o*a,t[1]=o*s-r*l,t[2]=r*a-i*s,t}var xe=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t};function me(){var t=new le(4);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ve(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+s]-e[3*s+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}!function(){var t=ue()}(),function(){var t,e=(t=new le(4),le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var we,Me=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},be=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=o*s),t};ue(),he(1,0,0),he(0,1,0),me(),me(),we=new le(9),le!=Float32Array&&(we[1]=0,we[2]=0,we[3]=0,we[5]=0,we[6]=0,we[7]=0),we[0]=1,we[4]=1,we[8]=1;\\n/*!\\n * Contains code from google filament\\n * https://github.com/google/filament/\\n * License Apache-2.0\\n */\\nconst Pe=8,_e=[],Ie=[],Ae=[],Se=[];function Te(t,e,n){const r=ye(Ie,e,n),i=function(t,e,n,r,i,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(_e,n[0],n[1],n[2],...r,...e);t=ve(t,i),t=function(t){return t[3]<0?Me(t,t,-1):t}(t=be(t,t));const o=1/((1<<2*Pe-1)-1);if(t[3]0?ye(Ae,n,e):ye(Ae,e,n);return ge(ye(Se,n,e),s)<0&&Me(t,t,-1),t}const Fe=[];const ke=[],Be=[],Le=[],Ce=[],Ye=[],Ve=[],Oe=[];function Xe(t,e,n,r,i,o){fe(Ce,t[3*e],t[3*e+1],t[3*e+2]),fe(Ye,t[3*n],t[3*n+1],t[3*n+2]),fe(Ve,t[3*r],t[3*r+1],t[3*r+2]);const s=xe(ke,Ve,Ye),a=xe(Be,Ce,Ye),l=ye(Le,s,a);de(Oe,l),i[3*e]=i[3*e]||0,i[3*n]=i[3*n]||0,i[3*r]=i[3*r]||0,i[3*e+1]=i[3*e+1]||0,i[3*n+1]=i[3*n+1]||0,i[3*r+1]=i[3*r+1]||0,i[3*e+2]=i[3*e+2]||0,i[3*n+2]=i[3*n+2]||0,i[3*r+2]=i[3*r+2]||0,i[3*e]+=Oe[0],i[3*n]+=Oe[0],i[3*r]+=Oe[0],i[3*e+1]+=Oe[1],i[3*n+1]+=Oe[1],i[3*r+1]+=Oe[1],i[3*e+2]+=Oe[2],i[3*n+2]+=Oe[2],i[3*r+2]+=Oe[2],o[e]+=1,o[n]+=1,o[r]+=1}\\n/*!\\n * Contains code from THREE.JS\\n * https://github.com/mrdoob/three.js/\\n * License MIT\\n * \\n * Generate tangents per vertex.\\n */function Ne(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function Ee(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}const{StyleUtil:ze,PackUtil:$e,ArrayPool:De}=ne(),qe=De.getInstance();function je(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0),qe.reset();const{altitudeScale:y,altitudeProperty:x,defaultAltitude:m,heightProperty:v,minHeightProperty:P,defaultHeight:_,tangent:I,uv:A,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,top:L,side:C,textureYOrigin:Y,topThickness:V}=e,O=function(t,e,{altitudeScale:n,altitudeProperty:r,defaultAltitude:i,heightProperty:o,minHeightProperty:s,defaultHeight:a},{center:l,side:u,top:h,topThickness:c,uvOrigin:f,uv:p,uvSize:d,topUVMode:g,sideUVMode:y,sideVerticalUVMode:x,textureYOrigin:m,tileRatio:v,centimeterToPoint:w,verticalCentimeterToPoint:M,positionType:b,res:P,glScale:_,projectionCode:I},A,T){let F=e/t[0].extent;e===1/0&&(F=1);const k=e===1/0,B=T.get(),L=T.get(),C=T.get(),Y=T.getProxy(),V=T.get(),O=T.get(),X=T.get(),N=!!p,E=!!h,z=!!u,$=N?T.get():null;function D(t,n,r,i,o,s){let a=n;if(E){const u=Tt(Y,r,3);if(0===u.length)return n;let h=Y.getLength(),p=V.currentIndex;for(let t=0;t0&&!z&&(n=oe(V,Y,r,O,n,$,0,c,e,N,y||0,x||0,m,d,v,M,i<0?!s:s)),X.setLength(n/3),X.fill(1,a/3,n/3)}if(z){E&&(c=0),a=n,n=oe(V,Y,r,O,n,$,c,i,e,N,y||0,x||0,m,d,v,M,i<0?!s:s),X.setLength(n/3);const t=Y.getLength()/3;X.fill(1,a/3,a/3+t),X.fill(0,a/3+t,a/3+2*t),X.fill(1,a/3+2*t,a/3+3*t),X.fill(0,a/3+3*t,n/3)}return n}let q=-1/0,j=1/0,Z=0;const G=[-1,-1,e+1,e+1];let U=0,R=t.length;S(A)&&(U=A,R=A+1);let J=0,H=!1;const W=T.getProxy();let K=!1;for(;UJ&&(J=Math.abs(u)),u<0&&(H=!0));const h=l.geometry,c=l.properties[ee];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:p,height:d}=re.getFeaAltitudeAndHeight(l,n,r,i,o,a,s);d<0?(K=!0,j=Math.min(p,j),q=Math.max(p-d,q)):(q=Math.max(p,q),j=Math.min(p-d,j));const g=V.getLength();let y=0,x=Z;W.setLength(0),Y.setLength(0);const m=re.calculateSignedArea(h[0])<0;for(let t=0,n=h.length;t0&&(y++,f=c&&c[y],Z=D(x,Z,W,d*F,f,k),Y.setLength(0),W.setLength(0),x=Z),e!==1/0&&(r=re.clipPolygon(r,G)),!r.length){t===n-1&&(Z=D(x,Z,W,d*F,f,k));continue}const o=r.length;if(Array.isArray(r[0])?r[0][0]===r[o-1][0]&&r[0][1]===r[o-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[o-1].x&&r[0].y===r[o-1].y||r.push(r[0]),i){let t=W.currentIndex;W[t++]=Y.getLength()/3,W.currentIndex=t}ct(Y,Y.getLength(),r,F,p,!1,b),t===n-1&&(Z=D(x,Z,W,d*F,f,k))}const v=V.getLength()-g,w=(te+\\\"\\\").trim();for(let t=0;t1e-6?Z=!1:0!==e&&(j[t]=Math.round(j[t]))}if(O.normals=j,I){let t=qe.get();t.setLength(4*N),t=function(t,e,n,r,i){const o=t.length/3,s=i||new Array(4*o),a=[],l=[];for(let t=0;tMath.max(t,e)),0),A=new(Ue.getIndexArrayType(I))(x),T=Ue.getUnsignedArrayType(t.length),F=Math.max(Math.abs(M,Math.abs(b)));return{aPosition:new(Ue.getPosArrayType(Math.max(512,F)))(g),indices:A,aPickingId:new T(d),aColor:y,maxAltitude:M===-1/0?0:M/100,minAltitude:b===1/0?0:b/100}}function We(t,e,n){const r=t[3*e],i=t[3*e+1];return r<0||r>n||i<0||i>n}function Ke(t,e,n,r){const i=He(t,e,n.lineColor,n.lineOpacity,r),{minAltitude:o,maxAltitude:s}=i;delete i.minAltitude,delete i.maxAltitude;const a=[i.aPosition.buffer,i.indices.buffer,i.aPickingId.buffer],l=i.indices;return delete i.indices,{data:{data:i,properties:{minAltitude:o,maxAltitude:s},indices:l},buffers:a}}\\n/*!\\n Feature Filter by\\n\\n (c) mapbox 2016 and maptalks 2018\\n www.mapbox.com | www.maptalks.org\\n License: MIT, header required.\\n */const Qe=[\\\"Unknown\\\",\\\"Point\\\",\\\"LineString\\\",\\\"Polygon\\\",\\\"MultiPoint\\\",\\\"MultiLineString\\\",\\\"MultiPolygon\\\",\\\"GeometryCollection\\\"];function tn(t){if(!t)return\\\"true\\\";const e=t[0];if(t.length<=1)return\\\"any\\\"===e?\\\"false\\\":\\\"true\\\";return`(\").concat(E, \"\\\"==\\\"===e?nn(t[1],t[2],\\\"===\\\",!1):\\\"!=\\\"===e?nn(t[1],t[2],\\\"!==\\\",!1):\\\"<\\\"===e||\\\">\\\"===e||\\\"<=\\\"===e||\\\">=\\\"===e?nn(t[1],t[2],e,!0):\\\"any\\\"===e?on(t.slice(1),\\\"||\\\"):\\\"all\\\"===e?on(t.slice(1),\\\"&&\\\"):\\\"none\\\"===e?ln(on(t.slice(1),\\\"||\\\")):\\\"in\\\"===e?sn(t[1],t.slice(2)):\\\"!in\\\"===e?ln(sn(t[1],t.slice(2))):\\\"has\\\"===e?an(t[1]):\\\"!has\\\"===e?ln(an(t[1])):\\\"contains\\\"===e?function(t,e,n){const r=en(t);return void 0!==n?`(\").concat(E, \"r} + '').indexOf(\\\"\").concat(E, \"e}\\\") === \").concat(E, \"n}`:`(\").concat(E, \"r} + '').indexOf(\\\"\").concat(E, \"e}\\\") >= 0`}(t[1],t[2],t[3]):\\\"true\\\"})`}function en(t){return\\\"$\\\"===t[0]?\\\"f.\\\"+t.substring(1):\\\"p[\\\"+JSON.stringify(t)+\\\"]\\\"}function nn(t,e,n,r){if(\\\"object\\\"==typeof(i=t)&&i&&t.op)return function(t,e,n,r){const i=t.property,o=t.op;let s=en(i);return\\\"length\\\"!==o?(console.error(`not support \").concat(E, \"o} op`),\\\"false\\\"):(s=`((\").concat(E, \"s}+='').length)`,rn(s,i,e,n,r))}(t,e,n,r);var i;return rn(en(t),t,e,n,r)}function rn(t,e,n,r,i){const o=\\\"$type\\\"===e?Qe.indexOf(n):JSON.stringify(n);return(i?`typeof \").concat(E, \"t}=== typeof \").concat(E, \"o}&&`:\\\"\\\")+t+r+o}function on(t,e){return t.map(tn).join(e)}function sn(t,e){\\\"$type\\\"===t&&(e=e.map((t=>Qe.indexOf(t))));const n=JSON.stringify(e.sort(un)),r=en(t);return e.length<=200?`\").concat(E, \"n}.indexOf(\").concat(E, \"r}) !== -1`:`function(v, a, i, j) {\\\\n while (i <= j) { var m = (i + j) >> 1;\\\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\\\n }\\\\n return false; }(\").concat(E, \"r}, \").concat(E, \"n},0,\").concat(E, \"e.length-1})`}function an(t){return\\\"$id\\\"===t?'\\\"id\\\" in f':`\").concat(E, \"JSON.stringify(t)} in p`}function ln(t){return`!(\").concat(E, \"t})`}function un(t,e){return te?1:0}let hn=!1;try{const t=new OffscreenCanvas(1,1);t.getContext(\\\"2d\\\").fillText(\\\"hello\\\",0,0),hn=!0}catch(t){hn=!1}var cn=hn;const{VectorPack:fn,PolygonPack:pn,NativeLinePack:dn,LinePack:gn,PointPack:yn,NativePointPack:xn,LineExtrusionPack:mn,CirclePack:vn,RoundTubePack:wn,SquareTubePack:Mn,FilterUtil:bn,PackUtil:Pn,StyleUtil:_n,TextUtil:In,DEFAULT_TEX_WIDTH:An,GlyphRequestor:Sn}=ne(),Tn=\\\"__original_properties\\\",Fn=\\\"__fn-type_properties\\\";class kn{constructor(t,e,n,r,i){this.id=t,this.options=e,this.upload=n,this._compileStyle(e.style),this.requests={},this._cache=r,this._styleCounter=1,this.loadings=i}updateStyle(t,e){this.options.style=t,this._styleCounter=t.styleCounter,this._compileStyle(t),e()}updateOptions(t,e){this.options=I(this.options,t),e()}loadTile(t,e){const n=this.loadings,r=t.tileInfo.url,i=this.options.debugTile;if(i){const{x:n,y:r,z:o}=t.tileInfo;let s=!1;for(let t=0;t{const l=n[r];if(delete n[r],this.checkIfCanceled(r))return delete this.requests[r],void this._callWaitings(l,null,{canceled:!0});if(delete this.requests[r],(this.options.debug||o)&&i)for(let e=0;e{n.canceled?e(null,{canceled:!0}):(n.data.styleCounter=t.styleCounter,o&&I(n.data,o),e(null,n.data,n.buffers))})).catch((t=>{e(t)}))}abortTile(t,e){delete this.requests[t],this._cancelLoadings(t),e()}_cancelLoadings(t){const e=this.loadings[t];if(e)for(let t=0;t{this.upload(\\\"fetchIconGlyphs\\\",{icons:t},null,((t,n)=>{e({err:t,iconData:n})}))}));r.push(e)}if(e&&Object.keys(e).length){const t=new Promise((t=>{this._glyphRequestor||(this._glyphRequestor=new Sn),this._glyphRequestor.getGlyphs(e,((e,n)=>{t({err:e,glyphData:n})}))}));r.push(t)}Promise.all(r).then((t=>{const e={icons:null,glyphs:null};for(let r=0;r{n(null,t)}))}else this.upload(\\\"fetchIconGlyphs\\\",{icons:t,glyphs:e},null,n)}_createTileData(t,e,n){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:r,tileInfo:i}=n,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this._updateLayerPluginConfig(t)),this.featurePlugins&&function(t){for(let e=1;et&&(t=i)}for(let e=0;e0;const{tileFeatures:l,tileFeaIndexes:u}=this._filterFeatures(c,r.type,r.filter,e,m,t);if(!l.length){a[M]=null;continue}const y=u[u.length-1],_=Pn.getIndexArrayType(y);a[M]={styledFeatures:new _(u)},g.push({idx:t,typeIdx:M}),x.push(a[M].styledFeatures.buffer);const A=I({},n,{extent:h,zoom:c,tilePoint:f});if(this.options.debugTile){const t=this.options.debugTile;for(let e=0;e{if(!t)return null;if(t.data)t.data.layer=l[0].layer;else if(Array.isArray(t))for(let e=0;e{if(n!==this._styleCounter)return{canceled:!0};function i(t,e){if(void 0!==t.data.ref)return;const n=s[g[e].idx],r=n.renderPlugin.dataConfig;if(t.data.type=r.type,t.data.filter=n.filter.def,r.altitudeOffset&&(t.data.properties.minAltitude+=r.altitudeOffset,t.data.properties.maxAltitude+=r.altitudeOffset),t.buffers&&t.buffers.length)for(let e=0;e{const i=e?e.properties:t.properties;i[Fn]||(i[Fn]=new Set),i[Fn].add(r),n=!0}))}}o[r]=i}if(n)for(const t in o){const e=o[t],n=e.properties[Fn];if(n){delete e.properties[Fn],\\\"transient\\\"===y.features&&(e.fnTypeProps=I({},e.properties));for(const t in e.properties)n.has(t)||(\\\"transient\\\"===y.features?delete e.fnTypeProps[t]:delete e.properties[t])}}}return{data:{styleCounter:n,schema:a,data:p,featureData:d,extent:h,features:o},buffers:x}})).catch((t=>{console.error(t)}))}_createTileGeometry(t,e,n){let r=t;const i=e.renderPlugin.dataConfig,o=e.symbol,s=this.options.tileSize,{extent:a,glScale:l,zScale:u,zoom:h,tilePoint:c,centimeterToPoint:f,verticalCentimeterToPoint:p}=n,d=a/s,g=i.type,y=n.debugIndex;let x=I({},i,{EXTENT:a,zoom:h,debugIndex:y,features:this.options.features});if(\\\"3d-extrusion\\\"===g){Yn(o)&&(i.uv=1);const t=this.options.projectionCode,e=o.material&&o.material.textureWidth||An;return Promise.all([Promise.resolve(je(r,i,a,c,e,n.tileInfo.res,l,a/this.options.tileSize,f,p,o,h,t,y))])}if(\\\"3d-wireframe\\\"===g)return Promise.all([Promise.resolve(Ke(r,a,o,i))]);if(\\\"point\\\"===g){x=I(x,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:u*a/this.options.tileSize/l,pluginType:e.renderPlugin.type});let t=o;return Array.isArray(o)||(t=[o]),t=t.map(((t,e)=>(t&&(t.index={index:e},t.isIconText=function(t){return t.markerType||t.markerFile}(t)),t))).filter((t=>!!t)),Promise.all(t.map((t=>{const e=fn.genFnTypes(t);let n=r;return yn.needMerge(t,e,h)&&(n=yn.mergeLineFeatures(r,t,e,h)),new yn(n,t,x).load(d)})))}if(\\\"native-point\\\"===g){const t=u*a/this.options.tileSize/l;return x.altitudeToTileScale=t,Vn(r,o,x,xn,d)}if(\\\"line\\\"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:d}),Vn(r,o,x,gn,1,!0);if(\\\"native-line\\\"===g)return Vn(r,o,x,dn,1,!0);if(\\\"fill\\\"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this)}),Vn(r,o,x,pn);if(\\\"line-extrusion\\\"===g){delete o.lineGradientProperty,o.lineJoin=\\\"miter\\\",o.lineCap=\\\"butt\\\";const t=Yn(o);if(t&&(i.uv=1),x=I(x,{tileSize:s,zScale:u,glScale:l}),o.mergeOnProperty){const t=fn.genFnTypes(o);r=gn.mergeLineFeatures(r,o,t,x.zoom)}if(t){const t=[];if(!1!==i.top){const e=I({},x);e.side=!1,t.push(new mn(r,o,e))}return!1!==i.side&&(x.side=!0,x.top=!1,t.push(new mn(r,o,x))),Promise.all(t.map((t=>t.load())))}return Promise.all([new mn(r,o,x).load()])}if(\\\"circle\\\"===g)return Vn(r,o,x,vn);if(\\\"round-tube\\\"===g||\\\"square-tube\\\"===g){const t=\\\"round-tube\\\"===g?wn:Mn;return x=I(x,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:\\\"round-tube\\\"===g?i.radialSegments||8:4,centimeterToPoint:f,verticalCentimeterToPoint:p,tileRatio:d,isTube:!0}),Vn(r,o,x,t)}return Promise.resolve([])}_filterFeatures(t,e,n,r,i,o){const s=(te+\\\"\\\").trim(),a=[],l=[],u=r.length;for(let h=0;h{Array.isArray(t.id)?(t.id.forEach((t=>{r[t]=1})),t.filter=[\\\"in\\\",\\\"$id\\\",...t.id]):(r[t.id]=1,t.filter=[\\\"==\\\",\\\"$id\\\",t.id])}));const i=bn.compileStyle(e);for(let t=0;t0&&t[n])e=1;else if(F(t[n])){const r=Yn(t[n]);if(2===r)return r;1===r&&(e=1)}}return e}function Vn(t,e,n,r,i,o){const s={},a=Array.isArray(e)?e:[e];let l=-1;for(let t=0;te in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},En={get:function(t,e){return e in t?t[e]:t[Tn][e]},has:(t,e)=>e in t||e in t[Tn]},zn={};function $n(t){const e={};e.originalFeature=t;const n=new Proxy(e,Nn);return n.properties=new Proxy({},En),n.properties[Tn]=t.properties||zn,n}function Dn(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const qn=[];function jn(t,e,n){if(!t)return qn;for(const r in t){if(!t[r]||!_n.checkIfZoomFnTypeSymbol(r))continue;if(B(t[r]))Dn(e,n,t[r].property);else{if(\\\"lineGradientProperty\\\"===r){Dn(e,n,t[r]);continue}if(\\\"textName\\\"===r)if(A(t[r])){const i=In.resolveVarNames(t[r]);if(i)for(let t=0;tn;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Wn(t,e,Math.max(n,Math.floor(e-s*l/o+u)),Math.min(r,Math.floor(e+(o-s)*l/o+u)),i)}var h=t[e],c=n,f=r;for(Kn(t,n,e),i(t[r],h)>0&&Kn(t,n,r);c0;)f--}0===i(t[n],h)?Kn(t,n,f):Kn(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Kn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Qn(t,e){return te?1:0}class tr{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!cr(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),s=fr(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,nr(n,this.toBBox),nr(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=fr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,nr(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let s=e;s<=n-e;s++){const e=rr(t,0,s,this.toBBox),a=rr(t,s,n,this.toBBox),l=ur(e,a),u=ar(e)+ar(a);l=e;r--){const e=t.children[r];ir(s,t.leaf?i(e):e),a+=lr(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)ir(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():nr(t[n],this.toBBox)}}function er(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function fr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function pr(t,e,n,r,i){const o=[e,n];for(;o.length;){if((n=o.pop())-(e=o.pop())<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Hn(t,s,e,n,i),o.push(e,s,s,n)}}class dr{constructor(t=[],e=gr){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=0)break;e[t]=o,t=r}e[t]=i}}function gr(t,e){return te?1:0}function yr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,\\\"default\\\")?t.default:t}var xr={exports:{}},mr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,l=0,u=a-1;lo!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s},vr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,l=0,u=a-1;lo!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s};xr.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?vr(t,e,n,r):mr(t,e,n,r)};var wr=xr.exports.nested=vr;xr.exports.flat=mr;const Mr=11102230246251565e-32,br=134217729,Pr=(3+8*Mr)*Mr;function _r(t,e,n,r,i){let o,s,a,l,u=e[0],h=r[0],c=0,f=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=r[++f]);let p=0;if(cu==h>-u?(s=u+o,a=o-(s-u),u=e[++c]):(s=h+o,a=o-(s-h),h=r[++f]),o=s,0!==a&&(i[p++]=a);cu==h>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c]):(s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f]),o=s,0!==a&&(i[p++]=a);for(;c0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=Ar*u?l:-function(t,e,n,r,i,o,s){let a,l,u,h,c,f,p,d,g,y,x,m,v,w,M,b,P,_;const I=t-i,A=n-i,S=e-o,T=r-o;w=I*T,f=br*I,p=f-(f-I),d=I-p,f=br*T,g=f-(f-T),y=T-g,M=d*y-(w-p*g-d*g-p*y),b=S*A,f=br*S,p=f-(f-S),d=S-p,f=br*A,g=f-(f-A),y=A-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Fr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Fr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Fr[2]=m-(_-c)+(x-c),Fr[3]=_;let F=function(t,e){let n=e[0];for(let r=1;r=k||-F>=k)return F;if(c=t-I,a=t-(I+c)+(c-i),c=n-A,u=n-(A+c)+(c-i),c=e-S,l=e-(S+c)+(c-o),c=r-T,h=r-(T+c)+(c-o),0===a&&0===l&&0===u&&0===h)return F;if(k=Tr*s+Pr*Math.abs(F),F+=I*h+T*a-(S*u+A*l),F>=k||-F>=k)return F;w=a*T,f=br*a,p=f-(f-a),d=a-p,f=br*T,g=f-(f-T),y=T-g,M=d*y-(w-p*g-d*g-p*y),b=l*A,f=br*l,p=f-(f-l),d=l-p,f=br*A,g=f-(f-A),y=A-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const B=_r(4,Fr,4,Cr,kr);w=I*h,f=br*I,p=f-(f-I),d=I-p,f=br*h,g=f-(f-h),y=h-g,M=d*y-(w-p*g-d*g-p*y),b=S*u,f=br*S,p=f-(f-S),d=S-p,f=br*u,g=f-(f-u),y=u-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const L=_r(B,kr,4,Cr,Br);w=a*h,f=br*a,p=f-(f-a),d=a-p,f=br*h,g=f-(f-h),y=h-g,M=d*y-(w-p*g-d*g-p*y),b=l*u,f=br*l,p=f-(f-l),d=l-p,f=br*u,g=f-(f-u),y=u-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const C=_r(L,Br,4,Cr,Lr);return Lr[C-1]}(t,e,n,r,i,o,u)}function Vr(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;or[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],l=a.slice();for(o=0;o=2&&$r(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&&$r(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),i=new tr(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,e){return t[0]-e[0]},i.compareMinY=function(t,e){return t[1]-e[1]},i.load(t);for(var o,s=[],a=0;ao||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),p=f.node,d=Zr(p,e,n),g=Zr(p,r,i);if(f.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function zr(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),l=Math.min(t[1],e[1]),u=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),c=n.search({minX:a,minY:l,maxX:u,maxY:h}),f=0;f0!=$r(r,i,s)>0&&$r(o,s,r)>0!=$r(o,s,i)>0)return!1;return!0}function $r(t,e,n){return Yr(t[0],t[1],e[0],e[1],n[0],n[1])}function Dr(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 qr(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 jr(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Zr(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Gr(t,e,n,r,i,o,s,a){var l,u,h,c,f=n-t,p=r-e,d=s-i,g=a-o,y=t-i,x=e-o,m=f*f+p*p,v=f*d+p*g,w=d*d+g*g,M=f*y+p*x,b=d*y+g*x,P=m*w-v*v,_=P,I=P;0===P?(u=0,_=1,c=b,I=w):(c=m*b-v*M,(u=v*b-w*M)<0?(u=0,c=b,I=w):u>_&&(u=_,c=b+v,I=w)),c<0?(c=0,-M<0?u=0:-M>m?u=_:(u=-M,_=m)):c>I&&(c=I,-M+v<0?u=0:-M+v>m?u=_:(u=-M+v,_=m));var A=(1-(h=0===c?0:c/I))*i+h*s-((1-(l=0===u?0:u/_))*t+l*n),S=(1-h)*o+h*a-((1-l)*e+l*r);return A*A+S*S}function Ur(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}const{PackUtil:Rr}=ne();class Jr{constructor(t,e){this.x=t,this.y=e}clone(){return new Jr(this.x,this.y)}normalize(){const t=this.length();this.x/=t,this.y/=t}negate(){this.x=-this.x,this.y=-this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}diff(t){return new Jr(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}orthogonal(){return new Jr(this.y,-this.x)}}function Hr(t,e,n,r){const i=e.x*r.y-e.y*r.x,o=n.x-t.x,s=n.y-t.y,a=(o*r.y-s*r.x)/i;return new Jr(t.x+a*e.x,t.y+a*e.y)}const Wr=[],Kr=[];function Qr(t){if(S(t[0]&&t[0].x)){const e=[];let n=0;for(let r=0;rr[0]&&(r[0]=e[t][0]),e[t][1]r[1]&&(r[1]=e[t][1]);const i=[];let o=[],s=0;for(let t=0;th.x&&(h.x=c.x,s=e),c.yh.y&&(h.y=c.y,a=e)}var f=new Jr(0,-1),p=new Jr(0,1),d=new Jr(-1,0),g=new Jr(1,0);for(let e=0;e[t.x,t.y]));return h.push(+(u>l)),h}catch(t){return null}}const ti=[];function ei(t,e){const n=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r{if(t&&(console.error(\\\"Failed to fetch geojson:\\\"+r),e(t)),!i)return void e(null,{extent:null,idMap:{}});let o=i;if(this.options.convertFn){o=new Function(\\\"data\\\",this.options.convertFn+\\\"\\\\nreturn convert(data)\\\")(o)}const s=Array.isArray(o)?o:o.features;this._genOMBB(s);const{sample1000:a,idMap:l}=this._generateId(s);this._generate(a,l,o,n,e)}))}else{\\\"string\\\"==typeof t&&(t=JSON.parse(t));const r=Array.isArray(t)?t:t.features,i=r&&r.length;this._genOMBB(r);let o=r;if(r&&i>1e3){o=[];for(let t=0;t{!function(t,o,s){if(t&&(\\\"Feature\\\"!==t.type||t.geometry)){if(S(t.id)||(t.id=r++),i){let e=i;F(i)&&(e=i[t.layer||\\\"0\\\"]),t.id=t.properties[e]}n[t.id]=I({},t),t.geometry?(n[t.id].geometry=I({},t.geometry),n[t.id].geometry.coordinates=null):t.coordinates&&(n[t.id].coordinates=null),ii(t,e,o,s)}}(t,s,o)}))}return{sample1000:e,idMap:n}}getTileFeatures(t,e){const n=t.tileInfo,r=[];if(!this.index)return this.empty?(setTimeout((function(){e(null,r,[])}),1),1):(setTimeout((function(){e({loading:!0})}),1),1);const i=this.index.getTile(n.z,n.x,n.y);if(!i||0===i.features.length)return setTimeout((function(){e(null,r,[])}),1),1;const o=[];for(let t=0,e=i.features.length;t+t));return setTimeout((function(){e(null,r,o)}),1),1}onRemove(){super.onRemove(),delete this.index}}function ii(t,e,n,r){const i=Math.floor(r/998);(0===n||n===r-1||(0===i||n%i==0)&&e.length<999)&&e.push(t)}var oi={\\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\\nread:function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<>1,h=-7,c=n?i-1:0,f=n?-1:1,p=t[e+c];for(c+=f,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+c],c+=f,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,n,r,i,o){var s,a,l,u=8*o-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[n+p]=255&s,p+=d,s/=256,u-=8);t[n+p-d]|=128*g}},si=li,ai=oi;function li(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}li.Varint=0,li.Fixed64=1,li.Bytes=2,li.Fixed32=5;var ui=4294967296,hi=1/ui,ci=\\\"undefined\\\"==typeof TextDecoder?null:new TextDecoder(\\\"utf8\\\");function fi(t){return t.type===li.Bytes?t.readVarint()+t.pos:t.pos+1}function pi(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function di(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 gi(t,e){for(var n=0;n>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Ai(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}li.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos>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=_i(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ai(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_i(this.buf,this.pos)+_i(this.buf,this.pos+4)*ui;return this.pos+=8,t},readSFixed64:function(){var t=_i(this.buf,this.pos)+Ai(this.buf,this.pos+4)*ui;return this.pos+=8,t},readFloat:function(){var t=ai.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ai.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(i=o[n.pos++],r=(112&i)>>4,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return pi(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&&ci?function(t,e,n){return ci.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r=\\\"\\\",i=e;for(;i239?4:l>223?3:l>191?2:1;if(i+h>n)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),i+=h}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!==li.Bytes)return t.push(this.readVarint(e));var n=fi(this);for(t=t||[];this.pos127;);else if(e===li.Bytes)this.pos=this.readVarint()+this.pos;else if(e===li.Fixed32)this.pos+=4;else{if(e!==li.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;e268435455||t<0?function(t,e){var n,r;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));if(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;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;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;o55295&&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&&di(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),ai.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ai.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=128&&di(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,li.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,gi,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,yi,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vi,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,xi,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,mi,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,wi,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Mi,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,bi,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pi,e)},writeBytesField:function(t,e){this.writeTag(t,li.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,li.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,li.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,li.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Si=yr(si),Ti=Fi;function Fi(t,e){this.x=t,this.y=e}Fi.prototype={clone:function(){return new Fi(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}},Fi.convert=function(t){return t instanceof Fi?t:Array.isArray(t)?new Fi(t[0],t[1]):t};var ki=Ti,Bi=Li;function Li(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(Ci,this,e)}function Ci(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos>3}if(i--,1===r||2===r)o+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&a.push(e),e=[]),e.push(new ki(o,s));else{if(7!==r)throw new Error(\\\"unknown command \\\"+r);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Li.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,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos>3}if(r--,1===n||2===n)(i+=t.readSVarint())a&&(a=i),(o+=t.readSVarint())u&&(u=o);else if(7!==n)throw new Error(\\\"unknown command \\\"+n)}return[s,l,a,u]},Li.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=Li.types[this.type];function h(t){for(var e=0;e>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))}Xi.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 Vi(this._pbf,e,this.extent,this._keys,this._values)};var Ei=Oi,zi=function(t,e){this.layers=t.readFields($i,{},e)};function $i(t,e,n){if(3===t){var r=new Ei(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}var Di=zi;const qi=2,ji=new TextDecoder(\\\"utf-8\\\");class Zi extends kn{constructor(t,e,n,r,i,o){super(t,e,n,r,i),e=e||{},o()}getTileFeatures(t,e){const n=t.tileInfo.url,r=t.fetchOptions||{},{altitudePropertyName:i,disableAltitudeWarning:o}=t,s=this._cache.get(n);if(s&&s.cacheIndex===t.workerCacheIndex){const{err:t,data:r}=s;return setTimeout((()=>{this._readTile(n,i,o,t,r,e)}),1)}const{tileArrayBuffer:a}=t;return a?setTimeout((()=>{this._readTile(n,i,o,null,a,e)}),1):(r.referrer=t.referrer,C.getArrayBuffer(n,r,((r,s)=>{this._cache&&(r?r.loading||this._cache.add(n,{err:r,data:s&&s.data,cacheIndex:t.workerCacheIndex}):s&&s.data&&this._cache.add(n,{err:null,data:s.data,cacheIndex:t.workerCacheIndex}),this._readTile(n,i,o,r,s&&s.data,e))})))}_readTile(t,e,n,r,i,o){if(r)return void o(r);let s;try{s=new Di(new Si(i))}catch(r){const e=ji.decode(i);return r.message+=\\\"\\\\n\\\"+t+\\\"\\\\n\\\"+e,void o(r.message,[],[])}const a=[];if(!s.layers)return void o(null,a,[]);const l={};let u;for(const t in s.layers)if(h=s.layers,c=t,Object.prototype.hasOwnProperty.call(h,c)){l[t]={types:{}};const i=l[t].types;for(let o=0,l=s.layers[t].length;o+t));o(null,a,l,{byteLength:i.byteLength})}abortTile(t,e){const n=this.requests[t];delete this.requests[t],n&&n.abort&&n.abort(),this._cancelLoadings(t),e()}onRemove(){super.onRemove();for(const t in this.requests){const e=this.requests[t];e&&e.abort&&e.abort()}this.requests={}}}function Gi(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t\\\",workerId:this.workerId,actorId:t,command:e,params:n,callback:String(o)},r||[])}_genKey(t,e){return`\").concat(E, \"t}-\").concat(E, \"e}`}_getLayerById(t,e){const n=this._genKey(t,e);return this._layers[n]}_resetCache(){Hi.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new Wi(t.workerId)),\\\"\\\"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=n.command;this.dispatcher[r]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},((t,n,i)=>{t&&404!==t.status&&204!==t.status&&!t.loading&&console.error(r,t),e(t,n,i)}))}}}\");function L(e) {var t = function t() {return \"undefined\" != typeof globalThis ? globalThis : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : \"undefined\" != typeof global ? global : void 0;};if (t().maptalks_vt_packers) return;function n(e) {return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;}var i = r;function r(e, t) {this.x = e, this.y = t;}r.prototype = { clone: function clone() {return new r(this.x, this.y);}, add: function add(e) {return this.clone()._add(e);}, sub: function sub(e) {return this.clone()._sub(e);}, multByPoint: function multByPoint(e) {return this.clone()._multByPoint(e);}, divByPoint: function divByPoint(e) {return this.clone()._divByPoint(e);}, mult: function mult(e) {return this.clone()._mult(e);}, div: function div(e) {return this.clone()._div(e);}, rotate: function rotate(e) {return this.clone()._rotate(e);}, rotateAround: function rotateAround(e, t) {return this.clone()._rotateAround(e, t);}, matMult: function matMult(e) {return this.clone()._matMult(e);}, unit: function unit() {return this.clone()._unit();}, perp: function perp() {return this.clone()._perp();}, round: function round() {return this.clone()._round();}, mag: function mag() {return Math.sqrt(this.x * this.x + this.y * this.y);}, equals: function equals(e) {return this.x === e.x && this.y === e.y;}, dist: function dist(e) {return Math.sqrt(this.distSqr(e));}, distSqr: function distSqr(e) {var t = e.x - this.x,n = e.y - this.y;return t * t + n * n;}, angle: function angle() {return Math.atan2(this.y, this.x);}, angleTo: function angleTo(e) {return Math.atan2(this.y - e.y, this.x - e.x);}, angleWith: function angleWith(e) {return this.angleWithSep(e.x, e.y);}, angleWithSep: function angleWithSep(e, t) {return Math.atan2(this.x * t - this.y * e, this.x * e + this.y * t);}, _matMult: function _matMult(e) {var t = e[0] * this.x + e[1] * this.y,n = e[2] * this.x + e[3] * this.y;return this.x = t, this.y = n, this;}, _add: function _add(e) {return this.x += e.x, this.y += e.y, this;}, _sub: function _sub(e) {return this.x -= e.x, this.y -= e.y, this;}, _mult: function _mult(e) {return this.x *= e, this.y *= e, this;}, _div: function _div(e) {return this.x /= e, this.y /= e, this;}, _multByPoint: function _multByPoint(e) {return this.x *= e.x, this.y *= e.y, this;}, _divByPoint: function _divByPoint(e) {return this.x /= e.x, this.y /= e.y, this;}, _unit: function _unit() {return this._div(this.mag()), this;}, _perp: function _perp() {var e = this.y;return this.y = this.x, this.x = -e, this;}, _rotate: function _rotate(e) {var t = Math.cos(e),n = Math.sin(e),i = t * this.x - n * this.y,r = n * this.x + t * this.y;return this.x = i, this.y = r, this;}, _rotateAround: function _rotateAround(e, t) {var n = Math.cos(e),i = Math.sin(e),r = t.x + n * (this.x - t.x) - i * (this.y - t.y),s = t.y + i * (this.x - t.x) + n * (this.y - t.y);return this.x = r, this.y = s, this;}, _round: function _round() {return this.x = Math.round(this.x), this.y = Math.round(this.y), this;} }, r.convert = function (e) {return e instanceof r ? e : Array.isArray(e) ? new r(e[0], e[1]) : e;};var s = n(i);var o = { Point: 1, LineString: 2, Polygon: 3, MultiPoint: 4, MultiLineString: 5, MultiPolygon: 6 };function a(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var n = [];if (\"FeatureCollection\" === e.type) for (var i = 0; i < e.features.length; i++) l(n, e.features[i], t, i);else \"Feature\" === e.type ? l(n, e, t) : l(n, { geometry: e }, t);return n;}function l(e, t, n, i) {if (t.geometry && t.geometry.geometry) {var r = t.geometry.coordinates,s = t.geometry.type,o = [],a = t.id;if (n.promoteId ? a = t.properties[n.promoteId] : n.generateId && (a = i || 0), \"Point\" === s) h(r, o);else if (\"MultiPoint\" === s) for (var d = 0; d < r.length; d++) h(r[d], o);else if (\"LineString\" === s) u([r], o);else if (\"MultiLineString\" === s) {if (n.lineMetrics) {for (d = 0; d < r.length; d++) o = [], c(r[d], o), e.push(f(a, \"LineString\", o, t.properties));return;}u(r, o);} else if (\"Polygon\" === s) u(r, o);else {if (\"MultiPolygon\" !== s) {if (\"GeometryCollection\" === s) {for (d = 0; d < t.geometry.geometries.length; d++) l(e, { id: a, geometry: t.geometry.geometries[d], properties: t.properties }, n, i);return;}return void console.warn(\"Input data type(\".concat(s, \") is not a valid GeoJSON geometry type.\"));}for (d = 0; d < r.length; d++) {var p = [];u(r[d], p), o.push(p);}}e.push(f(a, s, o, t.properties));}}function h(e, t) {var n = new s(e[0], e[1]);n.z = 100 * (e[2] || 0), t.push([n]);}function c(e, t) {for (var _n2 = 0; _n2 < e.length; _n2++) {var _i2 = e[_n2][0],_r2 = e[_n2][1],_o2 = new s(_i2, _r2);_o2.z = 100 * (e[_n2][2] || 0), t.push(_o2);}}function u(e, t, n, i) {for (var r = 0; r < e.length; r++) {var s = [];c(e[r], s), t.push(s);}}function f(e, t, n, i) {return { id: void 0 === e ? null : e, type: o[t], geometry: n, properties: i };}function d(e, t, n) {n = n || {}, this.w = e || 64, this.h = t || 64, this.autoResize = !!n.autoResize, this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;}function p(e, t, n) {this.x = 0, this.y = e, this.w = this.free = t, this.h = n;}function g(e, t, n, i, r, s, o) {this.id = e, this.x = t, this.y = n, this.w = i, this.h = r, this.maxw = s || i, this.maxh = o || r, this.refcount = 0;}function m(e, _ref, i, r) {var t = _ref.width,n = _ref.height;if (r) {if (r.length !== t * n * i) throw new RangeError(\"mismatched image size\");} else r = new Uint8Array(t * n * i);return e.width = t, e.height = n, e.data = r, e;}function y(e, _ref2, i) {var t = _ref2.width,n = _ref2.height;if (t === e.width && n === e.height) return;var r = m({}, { width: t, height: n }, i);x(e, r, { x: 0, y: 0 }, { x: 0, y: 0 }, { width: Math.min(e.width, t), height: Math.min(e.height, n) }, i), e.width = t, e.height = n, e.data = r.data;}function x(e, t, n, i, r, s) {if (0 === r.width || 0 === r.height) return t;if (r.width > e.width || r.height > e.height || n.x > e.width - r.width || n.y > e.height - r.height) throw new RangeError(\"out of range source coordinates for image copy\");if (r.width > t.width || r.height > t.height || i.x > t.width - r.width || i.y > t.height - r.height) throw new RangeError(\"out of range destination coordinates for image copy\");var o = e.data,a = t.data;if (o === a) return t;for (var _l2 = 0; _l2 < r.height; _l2++) {var _h = ((n.y + _l2) * e.width + n.x) * s,_c = ((i.y + _l2) * t.width + i.x) * s;for (var _e2 = 0; _e2 < r.width * s; _e2++) a[_c + _e2] = o[_h + _e2];}return t;}d.prototype.pack = function (e, t) {e = [].concat(e), t = t || {};for (var n, i, r, s, o = [], a = 0; a < e.length; a++) if (n = e[a].w || e[a].width, i = e[a].h || e[a].height, r = e[a].id, n && i) {if (!(s = this.packOne(n, i, r))) continue;t.inPlace && (e[a].x = s.x, e[a].y = s.y, e[a].id = s.id), o.push(s);}return this.shrink(), o;}, d.prototype.packOne = function (e, t, n) {var i,r,s,o,a,l,h,c,u = { freebin: -1, shelf: -1, waste: 1 / 0 },f = 0;if (\"string\" == typeof n || \"number\" == typeof n) {if (i = this.getBin(n)) return this.ref(i), i;\"number\" == typeof n && (this.maxId = Math.max(n, this.maxId));} else n = ++this.maxId;for (o = 0; o < this.freebins.length; o++) {if (t === (i = this.freebins[o]).maxh && e === i.maxw) return this.allocFreebin(o, e, t, n);t > i.maxh || e > i.maxw || t <= i.maxh && e <= i.maxw && (s = i.maxw * i.maxh - e * t) < u.waste && (u.waste = s, u.freebin = o);}for (o = 0; o < this.shelves.length; o++) if (f += (r = this.shelves[o]).h, !(e > r.free)) {if (t === r.h) return this.allocShelf(o, e, t, n);t > r.h || t < r.h && (s = (r.h - t) * e) < u.waste && (u.freebin = -1, u.waste = s, u.shelf = o);}return -1 !== u.freebin ? this.allocFreebin(u.freebin, e, t, n) : -1 !== u.shelf ? this.allocShelf(u.shelf, e, t, n) : t <= this.h - f && e <= this.w ? (r = new p(f, this.w, t), this.allocShelf(this.shelves.push(r) - 1, e, t, n)) : this.autoResize ? (a = l = this.h, ((h = c = this.w) <= a || e > h) && (c = 2 * Math.max(e, h)), (a < h || t > a) && (l = 2 * Math.max(t, a)), this.resize(c, l), this.packOne(e, t, n)) : null;}, d.prototype.allocFreebin = function (e, t, n, i) {var r = this.freebins.splice(e, 1)[0];return r.id = i, r.w = t, r.h = n, r.refcount = 0, this.bins[i] = r, this.ref(r), r;}, d.prototype.allocShelf = function (e, t, n, i) {var r = this.shelves[e].alloc(t, n, i);return this.bins[i] = r, this.ref(r), r;}, d.prototype.shrink = function () {if (this.shelves.length > 0) {for (var e = 0, t = 0, n = 0; n < this.shelves.length; n++) {var i = this.shelves[n];t += i.h, e = Math.max(i.w - i.free, e);}this.resize(e, t);}}, d.prototype.getBin = function (e) {return this.bins[e];}, d.prototype.ref = function (e) {if (1 == ++e.refcount) {var t = e.h;this.stats[t] = 1 + (0 | this.stats[t]);}return e.refcount;}, d.prototype.unref = function (e) {return 0 === e.refcount ? 0 : (0 == --e.refcount && (this.stats[e.h]--, delete this.bins[e.id], this.freebins.push(e)), e.refcount);}, d.prototype.clear = function () {this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;}, d.prototype.resize = function (e, t) {this.w = e, this.h = t;for (var n = 0; n < this.shelves.length; n++) this.shelves[n].resize(e);return !0;}, p.prototype.alloc = function (e, t, n) {if (e > this.free || t > this.h) return null;var i = this.x;return this.x += e, this.free -= e, new g(n, i, this.y, e, t, e, this.h);}, p.prototype.resize = function (e) {return this.free += e - this.w, this.w = e, !0;};var _ = function () {function _(e, t) {_classCallCheck(this, _);m(this, e, 1, t);}return _createClass(_, [{ key: \"resize\", value: function resize(e) {y(this, e, 1);} }, { key: \"clone\", value: function clone() {return new _({ width: this.width, height: this.height }, new Uint8Array(this.data));} }], [{ key: \"copy\", value: function copy(e, t, n, i, r) {x(e, t, n, i, r, 1);} }]);}();var v = function () {function v(e, t) {_classCallCheck(this, v);m(this, e, 4, t);}return _createClass(v, [{ key: \"resize\", value: function resize(e) {y(this, e, 4);} }, { key: \"clone\", value: function clone() {return new v({ width: this.width, height: this.height }, new Uint8Array(this.data));} }], [{ key: \"copy\", value: function copy(e, t, n, i, r) {x(e, t, n, i, r, 4);} }]);}();function b(e) {var t = 0;for (var _n3, _i3, _r3 = 0, _s2 = e.length, _o3 = _s2 - 1; _r3 < _s2; _o3 = _r3++) if (_n3 = e[_r3], _i3 = e[_o3], void 0 !== _n3.x) t += (_i3.x - _n3.x) * (_n3.y + _i3.y);else {if (_n3[2] || _i3[2]) return 1;t += (_i3[0] - _n3[0]) * (_n3[1] + _i3[1]);}return t;}function A(e, t, n, i, r) {var s = e[t * i],o = e[t * i + 1],a = e[n * i],l = e[n * i + 1];return s === a && (s < 0 || s > r) && o !== l || o === l && (o < 0 || o > r) && s !== a;}function T(e, t, n) {var i = n;return t && e && (i = +e[t]), isNaN(i) && (i = n || 0), 100 * i;}function w(e, t, n, i, r, s, o) {t || 0 === t || (t = 1);var a = T(e.properties, n, i),l = a * t;var h = (s ? 100 * s : 0) || a;return r ? h = T(e.properties, r, s) : o && (h = a - T(e.properties, o, s)), h *= t, { altitude: l, height: h };}function S(e, t) {return t < 1 / 0 && (e.x < 0 || e.x > t || e.y < 0 || e.y > t);}function M(e) {return null == e;}function P(e, t, n) {if (e === n || e === t) return e;var i = n - t;return ((e - t) % i + i) % i + t;}function I(e, t) {if (!t) return null;var n = new Map();for (var _i4 = 0; _i4 < t.length; _i4++) {var _r4 = t[_i4],_s3 = e[_r4];var _o4 = n.get(_s3);_o4 || (_o4 = [], n.set(_s3, _o4)), _o4.push(_r4);}return n;}function C(e) {return !(e & e - 1) && 0 !== e;}var k = function () {function k(e, t, _ref3) {var n = _ref3.pixelRatio;_classCallCheck(this, k);this.paddedRect = e, this.pixelRatio = n || 1, this.padding = t;}return _createClass(k, [{ key: \"tl\", get: function get() {return [this.paddedRect.x + this.padding, this.paddedRect.y + this.padding];} }, { key: \"br\", get: function get() {return [this.paddedRect.x + this.paddedRect.w - this.padding, this.paddedRect.y + this.paddedRect.h - this.padding];} }, { key: \"displaySize\", get: function get() {return [(this.paddedRect.w - 2 * this.padding) / this.pixelRatio, (this.paddedRect.h - 2 * this.padding) / this.pixelRatio];} }]);}();var F = function () {function F(e) {_classCallCheck(this, F);this.glyphMap = e, this.build();}return _createClass(F, [{ key: \"build\", value: function build() {var e = this.glyphMap,t = Object.keys(e).length,n = {},i = new d(0, 0, { autoResize: !0 }),r = [],s = t > 1 ? 1 : 0;for (var _t2 in e) {var _i5 = e[_t2],_o5 = { x: 0, y: 0, w: _i5.data.width + 2 * s, h: _i5.data.height + 2 * s };r.push(_o5), n[_t2] = new k(_o5, s, _i5);}if (i.pack(r, { inPlace: !0 }), !C(i.w) || !C(i.h)) {var _e3 = O(i.w),_t3 = O(i.h);i.resize(_e3, _t3);}var o = new v({ width: i.w, height: i.h });for (var _t4 in e) {var _i6 = e[_t4],_r5 = n[_t4].paddedRect;v.copy(_i6.data, o, { x: 0, y: 0 }, { x: _r5.x + s, y: _r5.y + s }, _i6.data);}this.image = o, this.positions = n;} }]);}();function O(e) {return Math.pow(2, Math.ceil(Math.log(e) / Math.LN2));}var R = function () {function R(e) {_classCallCheck(this, R);this.glyphMap = e, this.build();}return _createClass(R, [{ key: \"build\", value: function build() {var e = this.glyphMap,t = {},n = new d(0, 0, { autoResize: !0 }),i = [];for (var _n4 in e) {var _r6 = e[_n4],_s4 = t[_n4] = {};for (var _e4 in _r6) {var _t5 = _r6[+_e4];if (!_t5 || 0 === _t5.bitmap.width || 0 === _t5.bitmap.height) continue;var _n5 = { x: 0, y: 0, w: _t5.bitmap.width + 2, h: _t5.bitmap.height + 2 };i.push(_n5), _s4[_e4] = { rect: _n5, metrics: _t5.metrics };}}n.pack(i, { inPlace: !0 });var r = new _({ width: n.w, height: n.h });for (var _n6 in e) {var _i7 = e[_n6];for (var _e5 in _i7) {var _s5 = _i7[+_e5];if (!_s5 || 0 === _s5.bitmap.width || 0 === _s5.bitmap.height) continue;var _o6 = t[_n6][_e5].rect;_.copy(_s5.bitmap, r, { x: 0, y: 0 }, { x: _o6.x + 1, y: _o6.y + 1 }, _s5.bitmap);}}this.image = r, this.positions = t;} }]);}();function E(e) {return e < 65536 ? Uint16Array : Uint32Array;}function D(e) {return (e = Math.abs(e)) < 128 ? Int8Array : e < 32768 ? Int16Array : Float32Array;}function L(e) {return e < 256 ? Uint8Array : e < 65536 ? Uint16Array : Float32Array;}function H(e, t) {var n = e.getLength ? e.getLength() : e.length;if (e instanceof t) return e.slice(0, n);var i = new t(n);e = e._origin || e;for (var _t6 = 0; _t6 < n; _t6++) i[_t6] = e[_t6] || 0;return i;}function N(e) {var t = e.type,n = [];if (1 === t || 4 === t) for (var _t7 = 0; _t7 < e.geometry.length; _t7++) h(e.geometry[_t7], n);else if (2 === t) u(e.geometry, n);else if (3 === t) u(e.geometry, n);else if (5 === t) u(e.geometry, n);else if (6 === t) for (var _t8 = 0; _t8 < e.geometry.length; _t8++) {var _i8 = [];u(e.geometry[_t8], _i8), n.push(_i8);}return e.geometry = n, e;}var z;var V = { width: 100, height: 10 };var U = !1;try {new OffscreenCanvas(1, 1).getContext(\"2d\").fillText(\"hello\", 0, 0), U = !0;} catch (e) {U = !1;}var B = function () {function B(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};_classCallCheck(this, B);if (!Array.isArray(e)) return void console.error(\"colors is not array\");if (e.length < 2) return void console.error(\"colors.length should >1\");this.colors = e;var n = 1 / 0,i = -1 / 0;for (var _t9 = 0, _r7 = e.length; _t9 < _r7; _t9++) {var _r8 = e[_t9][0];n = Math.min(_r8, n), i = Math.max(_r8, i);}this.min = n, this.max = i, this.valueOffset = this.max - this.min, this.options = Object.assign({}, V, t), this._initImgData();}return _createClass(B, [{ key: \"getImageData\", value: function getImageData() {return this.imgData;} }, { key: \"_initImgData\", value: function _initImgData() {var e = function () {if (!z) {var _e6 = V.width,_t10 = V.height;U ? z = new OffscreenCanvas(_e6, _t10) : (z = document.createElement(\"canvas\"), z.width = _e6, z.height = _t10);}return z;}(),_this$options = this.options,t = _this$options.width,n = _this$options.height;e.width = t, e.height = n;var i = e.getContext(\"2d\");i.clearRect(0, 0, e.width, e.height);var r = i.createLinearGradient(0, 0, e.width, 0),s = this.colors,o = this.valueOffset;for (var _e7 = 0, _t11 = s.length; _e7 < _t11; _e7++) {var _s$_e = _slicedToArray(s[_e7], 2),_t12 = _s$_e[0],_n7 = _s$_e[1],_i9 = (_t12 - this.min) / o;r.addColorStop(_i9, _n7);}i.fillStyle = r, i.fillRect(0, 0, e.width, e.height), this.imgData = i.getImageData(0, 0, e.width, e.height);} }, { key: \"getColor\", value: function getColor(e) {e = Math.max(this.min, e);var t = ((e = Math.min(e, this.max)) - this.min) / this.valueOffset;var n = Math.round(t * this.imgData.width);n = Math.min(n, this.imgData.width - 1);var i = 4 * n;return [this.imgData.data[i], this.imgData.data[i + 1], this.imgData.data[i + 2], this.imgData.data[i + 3]];} }]);}();var G;function j(e) {return null == e;}function W(e) {return !j(e);}function X(e) {return \"\" === e;}function Y(e, t) {var n, i, r;if (ie(e)) {var s,o = e.stops && \"object\" == _typeof(e.stops[0][0]),a = o || W(e.property),l = o || !a,h = e.type || t || \"exponential\";if (\"exponential\" === h) s = $;else if (\"interval\" === h) s = q;else if (\"categorical\" === h) s = Z;else if (\"identity\" === h) s = Q;else if (\"color-interpolate\" === h) s = K;else {if (\"calculate-expression\" !== h) throw new Error('Unknown function type \"' + h + '\"');s = ee;}if (o) {var c = {},u = [];for (var _t13 = 0; _t13 < e.stops.length; _t13++) {var f = e.stops[_t13];void 0 === c[f[0].zoom] && (c[f[0].zoom] = { zoom: f[0].zoom, type: e.type, property: e.property, default: e.default, stops: [] }), c[f[0].zoom].stops.push([f[0].value, f[1]]);}for (var _e8 in c) u.push([c[_e8].zoom, Y(c[_e8])]);n = function n(t, _n8) {var i = $({ stops: u, base: e.base }, t)(t, _n8);return \"function\" == typeof i ? i(t, _n8) : i;}, i = !1, r = !1;} else l ? (n = function n(t) {var n = s(e, t);return \"function\" == typeof n ? n(t) : n;}, i = !0, r = !1) : (n = function n(t, _n9) {var i = s(e, _n9 ? _n9[e.property] : null);return \"function\" == typeof i ? i(t, _n9) : i;}, i = !1, r = !0);} else n = function n() {return e;}, i = !0, r = !0;return n.isZoomConstant = r, n.isFeatureConstant = i, n;}function Z(e, t) {for (var _n10 = 0; _n10 < e.stops.length; _n10++) if (t === e.stops[_n10][0]) return e.stops[_n10][1];return e.default;}function q(e, t) {for (var n = 0; n < e.stops.length && !(t < e.stops[n][0]); n++);return e.stops[Math.max(n - 1, 0)][1];}function $(e, t) {for (var n = W(e.base) && !X(e.base) ? e.base : 1, i = 0; !(i >= e.stops.length || t <= e.stops[i][0]);) i++;return 0 === i ? e.stops[i][1] : i === e.stops.length ? e.stops[i - 1][1] : te(t, n, e.stops[i - 1][0], e.stops[i][0], e.stops[i - 1][1], e.stops[i][1]);}\"function\" == typeof Map && (G = new Map());var J = { width: 100, height: 1 };function K(e, t) {var n = e.stops;if (n && n.length > 1) {var _e9;if (G) {var _t14 = JSON.stringify(n);if (!G.has(_t14)) {var _e10 = new B(n, J);G.set(_t14, _e10);}_e9 = G.get(_t14);} else _e9 = new B(n, J);var _e9$getColor = _e9.getColor(t),_e9$getColor2 = _slicedToArray(_e9$getColor, 4),_i10 = _e9$getColor2[0],_r9 = _e9$getColor2[1],_s6 = _e9$getColor2[2],_o7 = _e9$getColor2[3];return [_i10 / 255, _r9 / 255, _s6 / 255, _o7 / 255];}return n && 1 === n.length ? n[0][1] : null;}function Q(e, t) {return n = t, i = e.default, W(n) ? n : W(i) ? i : W(r) ? r : null;var n, i, r;}function ee(e, t) {var n = String(e.property),i = e.expression,r = t;function s(t) {return j(t) || X(t) || isNaN(t) ? e.default : t;}if (!W(t) || X(t) || isNaN(t) || t < 0) return s(e.default);{var _t15 = function e(t, n, i) {var r = Number(i),s = String(n);return Array.isArray(t) ? t.map(function (t) {return e(t, s, r);}) : t === s ? r : t;}(i, n, r);return s(function t(n) {if (!Array.isArray(n)) {if (\"number\" == typeof n) return n;throw new Error(\"Invalid expression format\");}{var _i11 = n[0];if (![\"+\", \"-\", \"*\", \"/\"].includes(_i11)) throw new Error(\"Unknown operator: \".concat(_i11));var _r10 = n.slice(1).map(function (e) {return t(e);});switch (_i11) {case \"+\":return _r10.reduce(function (e, t) {return e + t;}, 0);case \"-\":return _r10.reduce(function (e, t) {return e - t;});case \"*\":return _r10.reduce(function (e, t) {return e * t;}, 1);case \"/\":return _r10.some(function (e) {return 0 === e;}) ? e.default : _r10.reduce(function (e, t) {return e / t;});default:throw new Error(\"Unsupported operator: \".concat(_i11));}}}(_t15));}}function te(e, t, n, i, r, s) {return \"function\" == typeof r ? function () {var o = r.apply(void 0, arguments),a = s.apply(void 0, arguments);return te(e, t, n, i, o, a);} : r.length ? function (e, t, n, i, r, s) {var o = [];for (var _a2 = 0; _a2 < r.length; _a2++) o[_a2] = ne(e, t, n, i, r[_a2], s[_a2]);return o;}(e, t, n, i, r, s) : ne(e, t, n, i, r, s);}function ne(e, t, n, i, r, s) {var o,a = i - n,l = e - n;return r * (1 - (o = 1 === t ? l / a : (Math.pow(t, l) - 1) / (Math.pow(t, a) - 1))) + s * o;}function ie(e) {return e && \"object\" == _typeof(e) && (e.stops || e.property && \"identity\" === e.type || e.expression && \"calculate-expression\" === e.type);}function re(e) {return ae(e, \"exponential\");}function se(e) {return ae(e, \"interval\");}function oe(e, t) {if (!e) return null;var n = !1;if (Array.isArray(e)) {var i,r = [];for (var _s7 = 0; _s7 < e.length; _s7++) (i = oe(e[_s7], t)) ? (r.push(i), n = !0) : r.push(e[_s7]);return n ? r : e;}var s,o = { __fn_types_loaded: !0 },a = [];for (s in e) e.hasOwnProperty(s) && a.push(s);var l = function l(e) {Object.defineProperty(o, e, { get: function get() {return this[\"__fn_\" + e] || (this[\"__fn_\" + e] = re(this[\"_\" + e])), this[\"__fn_\" + e].apply(this, t());}, set: function set(t) {this[\"_\" + e] = t;}, configurable: !0, enumerable: !0 });};for (var _t16 = 0, _i12 = a.length; _t16 < _i12; _t16++) ie(e[s = a[_t16]]) ? (n = !0, o[\"_\" + s] = e[s], l(s)) : o[s] = e[s];return n ? o : e;}function ae(e, t) {if (!ie(e)) return function () {return e;};var n = !0,i = !0;var r = (e = JSON.parse(JSON.stringify(e))).stops;if (r) for (var _e11 = 0; _e11 < r.length; _e11++) if (ie(r[_e11][1])) {var _s8 = ae(r[_e11][1], t);n = n && _s8.isZoomConstant, i = i && _s8.isFeatureConstant, r[_e11] = [r[_e11][0], _s8];}var s = Y(e, t);return s.isZoomConstant = n && s.isZoomConstant, s.isFeatureConstant = i && s.isFeatureConstant, s;}var le = { exports: {} },he = { exports: {} },ce = function ce(e) {return !(!e || \"string\" == typeof e) && (e instanceof Array || Array.isArray(e) || e.length >= 0 && (e.splice instanceof Function || Object.getOwnPropertyDescriptor(e, e.length - 1) && \"String\" !== e.constructor.name));},ue = Array.prototype.concat,fe = Array.prototype.slice,de = he.exports = function (e) {for (var t = [], n = 0, i = e.length; n < i; n++) {var r = e[n];ce(r) ? t = ue.call(t, fe.call(r)) : t.push(r);}return t;};de.wrap = function (e) {return function () {return e(de(arguments));};};var pe = he.exports,ge = { 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] },me = pe,ye = Object.hasOwnProperty,xe = Object.create(null);for (var _e in ge) ye.call(ge, _e) && (xe[ge[_e]] = _e);var ve = le.exports = { to: {}, get: {} };function be(e, t, n) {return Math.min(Math.max(t, e), n);}function Ae(e) {var t = Math.round(e).toString(16).toUpperCase();return t.length < 2 ? \"0\" + t : t;}ve.get = function (e) {var t, n;switch (e.substring(0, 3).toLowerCase()) {case \"hsl\":t = ve.get.hsl(e), n = \"hsl\";break;case \"hwb\":t = ve.get.hwb(e), n = \"hwb\";break;default:t = ve.get.rgb(e), n = \"rgb\";}return t ? { model: n, value: t } : null;}, ve.get.rgb = function (e) {if (!e) return null;var t,n,i,r = [0, 0, 0, 1];if (t = e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)) {for (i = t[2], t = t[1], n = 0; n < 3; n++) {var s = 2 * n;r[n] = parseInt(t.slice(s, s + 2), 16);}i && (r[3] = parseInt(i, 16) / 255);} else if (t = e.match(/^#([a-f0-9]{3,4})$/i)) {for (i = (t = t[1])[3], n = 0; n < 3; n++) r[n] = parseInt(t[n] + t[n], 16);i && (r[3] = parseInt(i + i, 16) / 255);} else if (t = e.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)) {for (n = 0; n < 3; n++) r[n] = parseInt(t[n + 1], 0);t[4] && (t[5] ? r[3] = .01 * parseFloat(t[4]) : r[3] = parseFloat(t[4]));} else {if (!(t = e.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/))) return (t = e.match(/^(\\w+)$/)) ? \"transparent\" === t[1] ? [0, 0, 0, 0] : ye.call(ge, t[1]) ? ((r = ge[t[1]])[3] = 1, r) : null : null;for (n = 0; n < 3; n++) r[n] = Math.round(2.55 * parseFloat(t[n + 1]));t[4] && (t[5] ? r[3] = .01 * parseFloat(t[4]) : r[3] = parseFloat(t[4]));}for (n = 0; n < 3; n++) r[n] = be(r[n], 0, 255);return r[3] = be(r[3], 0, 1), r;}, ve.get.hsl = function (e) {if (!e) return null;var t = e.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 (t) {var n = parseFloat(t[4]);return [(parseFloat(t[1]) % 360 + 360) % 360, be(parseFloat(t[2]), 0, 100), be(parseFloat(t[3]), 0, 100), be(isNaN(n) ? 1 : n, 0, 1)];}return null;}, ve.get.hwb = function (e) {if (!e) return null;var t = e.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 (t) {var n = parseFloat(t[4]);return [(parseFloat(t[1]) % 360 + 360) % 360, be(parseFloat(t[2]), 0, 100), be(parseFloat(t[3]), 0, 100), be(isNaN(n) ? 1 : n, 0, 1)];}return null;}, ve.to.hex = function () {var e = me(arguments);return \"#\" + Ae(e[0]) + Ae(e[1]) + Ae(e[2]) + (e[3] < 1 ? Ae(Math.round(255 * e[3])) : \"\");}, ve.to.rgb = function () {var e = me(arguments);return e.length < 4 || 1 === e[3] ? \"rgb(\" + Math.round(e[0]) + \", \" + Math.round(e[1]) + \", \" + Math.round(e[2]) + \")\" : \"rgba(\" + Math.round(e[0]) + \", \" + Math.round(e[1]) + \", \" + Math.round(e[2]) + \", \" + e[3] + \")\";}, ve.to.rgb.percent = function () {var e = me(arguments),t = Math.round(e[0] / 255 * 100),n = Math.round(e[1] / 255 * 100),i = Math.round(e[2] / 255 * 100);return e.length < 4 || 1 === e[3] ? \"rgb(\" + t + \"%, \" + n + \"%, \" + i + \"%)\" : \"rgba(\" + t + \"%, \" + n + \"%, \" + i + \"%, \" + e[3] + \")\";}, ve.to.hsl = function () {var e = me(arguments);return e.length < 4 || 1 === e[3] ? \"hsl(\" + e[0] + \", \" + e[1] + \"%, \" + e[2] + \"%)\" : \"hsla(\" + e[0] + \", \" + e[1] + \"%, \" + e[2] + \"%, \" + e[3] + \")\";}, ve.to.hwb = function () {var e = me(arguments),t = \"\";return e.length >= 4 && 1 !== e[3] && (t = \", \" + e[3]), \"hwb(\" + e[0] + \", \" + e[1] + \"%, \" + e[2] + \"%\" + t + \")\";}, ve.to.keyword = function (e) {return xe[e.slice(0, 3)];};var Te = le.exports,we = { exports: {} },Se = { 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] },Me = {};for (var Pe in Se) Se.hasOwnProperty(Pe) && (Me[Se[Pe]] = Pe);var Ie = we.exports = { rgb: { channels: 3, labels: \"rgb\" }, hsl: { channels: 3, labels: \"hsl\" }, hsv: { channels: 3, labels: \"hsv\" }, hwb: { channels: 3, labels: \"hwb\" }, cmyk: { channels: 4, labels: \"cmyk\" }, xyz: { channels: 3, labels: \"xyz\" }, lab: { channels: 3, labels: \"lab\" }, lch: { channels: 3, labels: \"lch\" }, hex: { channels: 1, labels: [\"hex\"] }, keyword: { channels: 1, labels: [\"keyword\"] }, ansi16: { channels: 1, labels: [\"ansi16\"] }, ansi256: { channels: 1, labels: [\"ansi256\"] }, hcg: { channels: 3, labels: [\"h\", \"c\", \"g\"] }, apple: { channels: 3, labels: [\"r16\", \"g16\", \"b16\"] }, gray: { channels: 1, labels: [\"gray\"] } };for (var Ce in Ie) if (Ie.hasOwnProperty(Ce)) {if (!(\"channels\" in Ie[Ce])) throw new Error(\"missing channels property: \" + Ce);if (!(\"labels\" in Ie[Ce])) throw new Error(\"missing channel labels property: \" + Ce);if (Ie[Ce].labels.length !== Ie[Ce].channels) throw new Error(\"channel and label counts mismatch: \" + Ce);var ke = Ie[Ce].channels,Fe = Ie[Ce].labels;delete Ie[Ce].channels, delete Ie[Ce].labels, Object.defineProperty(Ie[Ce], \"channels\", { value: ke }), Object.defineProperty(Ie[Ce], \"labels\", { value: Fe });}Ie.rgb.hsl = function (e) {var t,n,i = e[0] / 255,r = e[1] / 255,s = e[2] / 255,o = Math.min(i, r, s),a = Math.max(i, r, s),l = a - o;return a === o ? t = 0 : i === a ? t = (r - s) / l : r === a ? t = 2 + (s - i) / l : s === a && (t = 4 + (i - r) / l), (t = Math.min(60 * t, 360)) < 0 && (t += 360), n = (o + a) / 2, [t, 100 * (a === o ? 0 : n <= .5 ? l / (a + o) : l / (2 - a - o)), 100 * n];}, Ie.rgb.hsv = function (e) {var t,n,i,r,s,o = e[0] / 255,a = e[1] / 255,l = e[2] / 255,h = Math.max(o, a, l),c = h - Math.min(o, a, l),u = function u(e) {return (h - e) / 6 / c + .5;};return 0 === c ? r = s = 0 : (s = c / h, t = u(o), n = u(a), i = u(l), o === h ? r = i - n : a === h ? r = 1 / 3 + t - i : l === h && (r = 2 / 3 + n - t), r < 0 ? r += 1 : r > 1 && (r -= 1)), [360 * r, 100 * s, 100 * h];}, Ie.rgb.hwb = function (e) {var t = e[0],n = e[1],i = e[2];return [Ie.rgb.hsl(e)[0], 1 / 255 * Math.min(t, Math.min(n, i)) * 100, 100 * (i = 1 - 1 / 255 * Math.max(t, Math.max(n, i)))];}, Ie.rgb.cmyk = function (e) {var t,n = e[0] / 255,i = e[1] / 255,r = e[2] / 255;return [100 * ((1 - n - (t = Math.min(1 - n, 1 - i, 1 - r))) / (1 - t) || 0), 100 * ((1 - i - t) / (1 - t) || 0), 100 * ((1 - r - t) / (1 - t) || 0), 100 * t];}, Ie.rgb.keyword = function (e) {var t = Me[e];if (t) return t;var n,i,r,s = 1 / 0;for (var o in Se) if (Se.hasOwnProperty(o)) {var a = (i = e, r = Se[o], Math.pow(i[0] - r[0], 2) + Math.pow(i[1] - r[1], 2) + Math.pow(i[2] - r[2], 2));a < s && (s = a, n = o);}return n;}, Ie.keyword.rgb = function (e) {return Se[e];}, Ie.rgb.xyz = function (e) {var t = e[0] / 255,n = e[1] / 255,i = e[2] / 255;return [100 * (.4124 * (t = t > .04045 ? Math.pow((t + .055) / 1.055, 2.4) : t / 12.92) + .3576 * (n = n > .04045 ? Math.pow((n + .055) / 1.055, 2.4) : n / 12.92) + .1805 * (i = i > .04045 ? Math.pow((i + .055) / 1.055, 2.4) : i / 12.92)), 100 * (.2126 * t + .7152 * n + .0722 * i), 100 * (.0193 * t + .1192 * n + .9505 * i)];}, Ie.rgb.lab = function (e) {var t = Ie.rgb.xyz(e),n = t[0],i = t[1],r = t[2];return i /= 100, r /= 108.883, n = (n /= 95.047) > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116, [116 * (i = i > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116) - 16, 500 * (n - i), 200 * (i - (r = r > .008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116))];}, Ie.hsl.rgb = function (e) {var t,n,i,r,s,o = e[0] / 360,a = e[1] / 100,l = e[2] / 100;if (0 === a) return [s = 255 * l, s, s];t = 2 * l - (n = l < .5 ? l * (1 + a) : l + a - l * a), r = [0, 0, 0];for (var h = 0; h < 3; h++) (i = o + 1 / 3 * -(h - 1)) < 0 && i++, i > 1 && i--, s = 6 * i < 1 ? t + 6 * (n - t) * i : 2 * i < 1 ? n : 3 * i < 2 ? t + (n - t) * (2 / 3 - i) * 6 : t, r[h] = 255 * s;return r;}, Ie.hsl.hsv = function (e) {var t = e[0],n = e[1] / 100,i = e[2] / 100,r = n,s = Math.max(i, .01);return n *= (i *= 2) <= 1 ? i : 2 - i, r *= s <= 1 ? s : 2 - s, [t, 100 * (0 === i ? 2 * r / (s + r) : 2 * n / (i + n)), (i + n) / 2 * 100];}, Ie.hsv.rgb = function (e) {var t = e[0] / 60,n = e[1] / 100,i = e[2] / 100,r = Math.floor(t) % 6,s = t - Math.floor(t),o = 255 * i * (1 - n),a = 255 * i * (1 - n * s),l = 255 * i * (1 - n * (1 - s));switch (i *= 255, r) {case 0:return [i, l, o];case 1:return [a, i, o];case 2:return [o, i, l];case 3:return [o, a, i];case 4:return [l, o, i];case 5:return [i, o, a];}}, Ie.hsv.hsl = function (e) {var t,n,i,r = e[0],s = e[1] / 100,o = e[2] / 100,a = Math.max(o, .01);return i = (2 - s) * o, n = s * a, [r, 100 * (n = (n /= (t = (2 - s) * a) <= 1 ? t : 2 - t) || 0), 100 * (i /= 2)];}, Ie.hwb.rgb = function (e) {var t,n,i,r,s,o,a,l = e[0] / 360,h = e[1] / 100,c = e[2] / 100,u = h + c;switch (u > 1 && (h /= u, c /= u), i = 6 * l - (t = Math.floor(6 * l)), 1 & t && (i = 1 - i), r = h + i * ((n = 1 - c) - h), t) {default:case 6:case 0:s = n, o = r, a = h;break;case 1:s = r, o = n, a = h;break;case 2:s = h, o = n, a = r;break;case 3:s = h, o = r, a = n;break;case 4:s = r, o = h, a = n;break;case 5:s = n, o = h, a = r;}return [255 * s, 255 * o, 255 * a];}, Ie.cmyk.rgb = function (e) {var t = e[0] / 100,n = e[1] / 100,i = e[2] / 100,r = e[3] / 100;return [255 * (1 - Math.min(1, t * (1 - r) + r)), 255 * (1 - Math.min(1, n * (1 - r) + r)), 255 * (1 - Math.min(1, i * (1 - r) + r))];}, Ie.xyz.rgb = function (e) {var t,n,i,r = e[0] / 100,s = e[1] / 100,o = e[2] / 100;return n = -.9689 * r + 1.8758 * s + .0415 * o, i = .0557 * r + -.204 * s + 1.057 * o, t = (t = 3.2406 * r + -1.5372 * s + -.4986 * o) > .0031308 ? 1.055 * Math.pow(t, 1 / 2.4) - .055 : 12.92 * t, n = n > .0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - .055 : 12.92 * n, i = i > .0031308 ? 1.055 * Math.pow(i, 1 / 2.4) - .055 : 12.92 * i, [255 * (t = Math.min(Math.max(0, t), 1)), 255 * (n = Math.min(Math.max(0, n), 1)), 255 * (i = Math.min(Math.max(0, i), 1))];}, Ie.xyz.lab = function (e) {var t = e[0],n = e[1],i = e[2];return n /= 100, i /= 108.883, t = (t /= 95.047) > .008856 ? Math.pow(t, 1 / 3) : 7.787 * t + 16 / 116, [116 * (n = n > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116) - 16, 500 * (t - n), 200 * (n - (i = i > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116))];}, Ie.lab.xyz = function (e) {var t,n,i,r = e[0];t = e[1] / 500 + (n = (r + 16) / 116), i = n - e[2] / 200;var s = Math.pow(n, 3),o = Math.pow(t, 3),a = Math.pow(i, 3);return n = s > .008856 ? s : (n - 16 / 116) / 7.787, t = o > .008856 ? o : (t - 16 / 116) / 7.787, i = a > .008856 ? a : (i - 16 / 116) / 7.787, [t *= 95.047, n *= 100, i *= 108.883];}, Ie.lab.lch = function (e) {var t,n = e[0],i = e[1],r = e[2];return (t = 360 * Math.atan2(r, i) / 2 / Math.PI) < 0 && (t += 360), [n, Math.sqrt(i * i + r * r), t];}, Ie.lch.lab = function (e) {var t,n = e[0],i = e[1];return t = e[2] / 360 * 2 * Math.PI, [n, i * Math.cos(t), i * Math.sin(t)];}, Ie.rgb.ansi16 = function (e) {var t = e[0],n = e[1],i = e[2],r = 1 in arguments ? arguments[1] : Ie.rgb.hsv(e)[2];if (0 === (r = Math.round(r / 50))) return 30;var s = 30 + (Math.round(i / 255) << 2 | Math.round(n / 255) << 1 | Math.round(t / 255));return 2 === r && (s += 60), s;}, Ie.hsv.ansi16 = function (e) {return Ie.rgb.ansi16(Ie.hsv.rgb(e), e[2]);}, Ie.rgb.ansi256 = function (e) {var t = e[0],n = e[1],i = e[2];return t === n && n === i ? t < 8 ? 16 : t > 248 ? 231 : Math.round((t - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(t / 255 * 5) + 6 * Math.round(n / 255 * 5) + Math.round(i / 255 * 5);}, Ie.ansi16.rgb = function (e) {var t = e % 10;if (0 === t || 7 === t) return e > 50 && (t += 3.5), [t = t / 10.5 * 255, t, t];var n = .5 * (1 + ~~(e > 50));return [(1 & t) * n * 255, (t >> 1 & 1) * n * 255, (t >> 2 & 1) * n * 255];}, Ie.ansi256.rgb = function (e) {if (e >= 232) {var t = 10 * (e - 232) + 8;return [t, t, t];}var n;return e -= 16, [Math.floor(e / 36) / 5 * 255, Math.floor((n = e % 36) / 6) / 5 * 255, n % 6 / 5 * 255];}, Ie.rgb.hex = function (e) {var t = (((255 & Math.round(e[0])) << 16) + ((255 & Math.round(e[1])) << 8) + (255 & Math.round(e[2]))).toString(16).toUpperCase();return \"000000\".substring(t.length) + t;}, Ie.hex.rgb = function (e) {var t = e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if (!t) return [0, 0, 0];var n = t[0];3 === t[0].length && (n = n.split(\"\").map(function (e) {return e + e;}).join(\"\"));var i = parseInt(n, 16);return [i >> 16 & 255, i >> 8 & 255, 255 & i];}, Ie.rgb.hcg = function (e) {var t,n = e[0] / 255,i = e[1] / 255,r = e[2] / 255,s = Math.max(Math.max(n, i), r),o = Math.min(Math.min(n, i), r),a = s - o;return t = a <= 0 ? 0 : s === n ? (i - r) / a % 6 : s === i ? 2 + (r - n) / a : 4 + (n - i) / a + 4, t /= 6, [360 * (t %= 1), 100 * a, 100 * (a < 1 ? o / (1 - a) : 0)];}, Ie.hsl.hcg = function (e) {var t,n = e[1] / 100,i = e[2] / 100,r = 0;return (t = i < .5 ? 2 * n * i : 2 * n * (1 - i)) < 1 && (r = (i - .5 * t) / (1 - t)), [e[0], 100 * t, 100 * r];}, Ie.hsv.hcg = function (e) {var t = e[1] / 100,n = e[2] / 100,i = t * n,r = 0;return i < 1 && (r = (n - i) / (1 - i)), [e[0], 100 * i, 100 * r];}, Ie.hcg.rgb = function (e) {var t = e[0] / 360,n = e[1] / 100,i = e[2] / 100;if (0 === n) return [255 * i, 255 * i, 255 * i];var r,s = [0, 0, 0],o = t % 1 * 6,a = o % 1,l = 1 - a;switch (Math.floor(o)) {case 0:s[0] = 1, s[1] = a, s[2] = 0;break;case 1:s[0] = l, s[1] = 1, s[2] = 0;break;case 2:s[0] = 0, s[1] = 1, s[2] = a;break;case 3:s[0] = 0, s[1] = l, s[2] = 1;break;case 4:s[0] = a, s[1] = 0, s[2] = 1;break;default:s[0] = 1, s[1] = 0, s[2] = l;}return r = (1 - n) * i, [255 * (n * s[0] + r), 255 * (n * s[1] + r), 255 * (n * s[2] + r)];}, Ie.hcg.hsv = function (e) {var t = e[1] / 100,n = t + e[2] / 100 * (1 - t),i = 0;return n > 0 && (i = t / n), [e[0], 100 * i, 100 * n];}, Ie.hcg.hsl = function (e) {var t = e[1] / 100,n = e[2] / 100 * (1 - t) + .5 * t,i = 0;return n > 0 && n < .5 ? i = t / (2 * n) : n >= .5 && n < 1 && (i = t / (2 * (1 - n))), [e[0], 100 * i, 100 * n];}, Ie.hcg.hwb = function (e) {var t = e[1] / 100,n = t + e[2] / 100 * (1 - t);return [e[0], 100 * (n - t), 100 * (1 - n)];}, Ie.hwb.hcg = function (e) {var t = e[1] / 100,n = 1 - e[2] / 100,i = n - t,r = 0;return i < 1 && (r = (n - i) / (1 - i)), [e[0], 100 * i, 100 * r];}, Ie.apple.rgb = function (e) {return [e[0] / 65535 * 255, e[1] / 65535 * 255, e[2] / 65535 * 255];}, Ie.rgb.apple = function (e) {return [e[0] / 255 * 65535, e[1] / 255 * 65535, e[2] / 255 * 65535];}, Ie.gray.rgb = function (e) {return [e[0] / 100 * 255, e[0] / 100 * 255, e[0] / 100 * 255];}, Ie.gray.hsl = Ie.gray.hsv = function (e) {return [0, 0, e[0]];}, Ie.gray.hwb = function (e) {return [0, 100, e[0]];}, Ie.gray.cmyk = function (e) {return [0, 0, 0, e[0]];}, Ie.gray.lab = function (e) {return [e[0], 0, 0];}, Ie.gray.hex = function (e) {var t = 255 & Math.round(e[0] / 100 * 255),n = ((t << 16) + (t << 8) + t).toString(16).toUpperCase();return \"000000\".substring(n.length) + n;}, Ie.rgb.gray = function (e) {return [(e[0] + e[1] + e[2]) / 3 / 255 * 100];};var Oe = we.exports,Re = Oe;function Ee(e, t) {return function (n) {return t(e(n));};}function De(e, t) {for (var n = [t[e].parent, e], i = Re[t[e].parent][e], r = t[e].parent; t[r].parent;) n.unshift(t[r].parent), i = Ee(Re[t[r].parent][r], i), r = t[r].parent;return i.conversion = n, i;}var Le = Oe,He = function He(e) {for (var t = function (e) {var t = function () {for (var e = {}, t = Object.keys(Re), n = t.length, i = 0; i < n; i++) e[t[i]] = { distance: -1, parent: null };return e;}(),n = [e];for (t[e].distance = 0; n.length;) for (var i = n.pop(), r = Object.keys(Re[i]), s = r.length, o = 0; o < s; o++) {var a = r[o],l = t[a];-1 === l.distance && (l.distance = t[i].distance + 1, l.parent = i, n.unshift(a));}return t;}(e), n = {}, i = Object.keys(t), r = i.length, s = 0; s < r; s++) {var o = i[s];null !== t[o].parent && (n[o] = De(o, t));}return n;},Ne = {};Object.keys(Le).forEach(function (e) {Ne[e] = {}, Object.defineProperty(Ne[e], \"channels\", { value: Le[e].channels }), Object.defineProperty(Ne[e], \"labels\", { value: Le[e].labels });var t = He(e);Object.keys(t).forEach(function (n) {var i = t[n];Ne[e][n] = function (e) {var t = function t(_t17) {if (null == _t17) return _t17;arguments.length > 1 && (_t17 = Array.prototype.slice.call(arguments));var n = e(_t17);if (\"object\" == _typeof(n)) for (var i = n.length, r = 0; r < i; r++) n[r] = Math.round(n[r]);return n;};return \"conversion\" in e && (t.conversion = e.conversion), t;}(i), Ne[e][n].raw = function (e) {var t = function t(_t18) {return null == _t18 ? _t18 : (arguments.length > 1 && (_t18 = Array.prototype.slice.call(arguments)), e(_t18));};return \"conversion\" in e && (t.conversion = e.conversion), t;}(i);});});var ze = Te,Ve = Ne,Ue = [].slice,Be = [\"keyword\", \"gray\", \"hex\"],Ge = {};Object.keys(Ve).forEach(function (e) {Ge[Ue.call(Ve[e].labels).sort().join(\"\")] = e;});var je = {};function We(e, t) {if (!(this instanceof We)) return new We(e, t);if (t && t in Be && (t = null), t && !(t in Ve)) throw new Error(\"Unknown model: \" + t);var n, i;if (null == e) this.model = \"rgb\", this.color = [0, 0, 0], this.valpha = 1;else if (e instanceof We) this.model = e.model, this.color = e.color.slice(), this.valpha = e.valpha;else if (\"string\" == typeof e) {var r = ze.get(e);if (null === r) throw new Error(\"Unable to parse color from string: \" + e);this.model = r.model, i = Ve[this.model].channels, this.color = r.value.slice(0, i), this.valpha = \"number\" == typeof r.value[i] ? r.value[i] : 1;} else if (e.length) {this.model = t || \"rgb\", i = Ve[this.model].channels;var s = Ue.call(e, 0, i);this.color = Ze(s, i), this.valpha = \"number\" == typeof e[i] ? e[i] : 1;} else if (\"number\" == typeof e) e &= 16777215, this.model = \"rgb\", this.color = [e >> 16 & 255, e >> 8 & 255, 255 & e], this.valpha = 1;else {this.valpha = 1;var o = Object.keys(e);\"alpha\" in e && (o.splice(o.indexOf(\"alpha\"), 1), this.valpha = \"number\" == typeof e.alpha ? e.alpha : 0);var a = o.sort().join(\"\");if (!(a in Ge)) throw new Error(\"Unable to parse color from object: \" + JSON.stringify(e));this.model = Ge[a];var l = Ve[this.model].labels,h = [];for (n = 0; n < l.length; n++) h.push(e[l[n]]);this.color = Ze(h);}if (je[this.model]) for (i = Ve[this.model].channels, n = 0; n < i; n++) {var c = je[this.model][n];c && (this.color[n] = c(this.color[n]));}this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);}function Xe(e, t, n) {return (e = Array.isArray(e) ? e : [e]).forEach(function (e) {(je[e] || (je[e] = []))[t] = n;}), e = e[0], function (i) {var r;return arguments.length ? (n && (i = n(i)), (r = this[e]()).color[t] = i, r) : (r = this[e]().color[t], n && (r = n(r)), r);};}function Ye(e) {return function (t) {return Math.max(0, Math.min(e, t));};}function Ze(e, t) {for (var n = 0; n < t; n++) \"number\" != typeof e[n] && (e[n] = 0);return e;}We.prototype = { toString: function toString() {return this.string();}, toJSON: function toJSON() {return this[this.model]();}, string: function string(e) {var t = this.model in ze.to ? this : this.rgb(),n = 1 === (t = t.round(\"number\" == typeof e ? e : 1)).valpha ? t.color : t.color.concat(this.valpha);return ze.to[t.model](n);}, percentString: function percentString(e) {var t = this.rgb().round(\"number\" == typeof e ? e : 1),n = 1 === t.valpha ? t.color : t.color.concat(this.valpha);return ze.to.rgb.percent(n);}, array: function array() {return 1 === this.valpha ? this.color.slice() : this.color.concat(this.valpha);}, object: function object() {for (var e = {}, t = Ve[this.model].channels, n = Ve[this.model].labels, i = 0; i < t; i++) e[n[i]] = this.color[i];return 1 !== this.valpha && (e.alpha = this.valpha), e;}, unitArray: function unitArray() {var e = this.rgb().color;return e[0] /= 255, e[1] /= 255, e[2] /= 255, 1 !== this.valpha && e.push(this.valpha), e;}, unitObject: function unitObject() {var e = this.rgb().object();return e.r /= 255, e.g /= 255, e.b /= 255, 1 !== this.valpha && (e.alpha = this.valpha), e;}, round: function round(e) {return e = Math.max(e || 0, 0), new We(this.color.map(function (e) {return function (t) {return function (e, t) {return Number(e.toFixed(t));}(t, e);};}(e)).concat(this.valpha), this.model);}, alpha: function alpha(e) {return arguments.length ? new We(this.color.concat(Math.max(0, Math.min(1, e))), this.model) : this.valpha;}, red: Xe(\"rgb\", 0, Ye(255)), green: Xe(\"rgb\", 1, Ye(255)), blue: Xe(\"rgb\", 2, Ye(255)), hue: Xe([\"hsl\", \"hsv\", \"hsl\", \"hwb\", \"hcg\"], 0, function (e) {return (e % 360 + 360) % 360;}), saturationl: Xe(\"hsl\", 1, Ye(100)), lightness: Xe(\"hsl\", 2, Ye(100)), saturationv: Xe(\"hsv\", 1, Ye(100)), value: Xe(\"hsv\", 2, Ye(100)), chroma: Xe(\"hcg\", 1, Ye(100)), gray: Xe(\"hcg\", 2, Ye(100)), white: Xe(\"hwb\", 1, Ye(100)), wblack: Xe(\"hwb\", 2, Ye(100)), cyan: Xe(\"cmyk\", 0, Ye(100)), magenta: Xe(\"cmyk\", 1, Ye(100)), yellow: Xe(\"cmyk\", 2, Ye(100)), black: Xe(\"cmyk\", 3, Ye(100)), x: Xe(\"xyz\", 0, Ye(100)), y: Xe(\"xyz\", 1, Ye(100)), z: Xe(\"xyz\", 2, Ye(100)), l: Xe(\"lab\", 0, Ye(100)), a: Xe(\"lab\", 1), b: Xe(\"lab\", 2), keyword: function keyword(e) {return arguments.length ? new We(e) : Ve[this.model].keyword(this.color);}, hex: function hex(e) {return arguments.length ? new We(e) : ze.to.hex(this.rgb().round().color);}, rgbNumber: function rgbNumber() {var e = this.rgb().color;return (255 & e[0]) << 16 | (255 & e[1]) << 8 | 255 & e[2];}, luminosity: function luminosity() {for (var e = this.rgb().color, t = [], n = 0; n < e.length; n++) {var i = e[n] / 255;t[n] = i <= .03928 ? i / 12.92 : Math.pow((i + .055) / 1.055, 2.4);}return .2126 * t[0] + .7152 * t[1] + .0722 * t[2];}, contrast: function contrast(e) {var t = this.luminosity(),n = e.luminosity();return t > n ? (t + .05) / (n + .05) : (n + .05) / (t + .05);}, level: function level(e) {var t = this.contrast(e);return t >= 7.1 ? \"AAA\" : t >= 4.5 ? \"AA\" : \"\";}, isDark: function isDark() {var e = this.rgb().color;return (299 * e[0] + 587 * e[1] + 114 * e[2]) / 1e3 < 128;}, isLight: function isLight() {return !this.isDark();}, negate: function negate() {for (var e = this.rgb(), t = 0; t < 3; t++) e.color[t] = 255 - e.color[t];return e;}, lighten: function lighten(e) {var t = this.hsl();return t.color[2] += t.color[2] * e, t;}, darken: function darken(e) {var t = this.hsl();return t.color[2] -= t.color[2] * e, t;}, saturate: function saturate(e) {var t = this.hsl();return t.color[1] += t.color[1] * e, t;}, desaturate: function desaturate(e) {var t = this.hsl();return t.color[1] -= t.color[1] * e, t;}, whiten: function whiten(e) {var t = this.hwb();return t.color[1] += t.color[1] * e, t;}, blacken: function blacken(e) {var t = this.hwb();return t.color[2] += t.color[2] * e, t;}, grayscale: function grayscale() {var e = this.rgb().color,t = .3 * e[0] + .59 * e[1] + .11 * e[2];return We.rgb(t, t, t);}, fade: function fade(e) {return this.alpha(this.valpha - this.valpha * e);}, opaquer: function opaquer(e) {return this.alpha(this.valpha + this.valpha * e);}, rotate: function rotate(e) {var t = this.hsl(),n = t.color[0];return n = (n = (n + e) % 360) < 0 ? 360 + n : n, t.color[0] = n, t;}, mix: function mix(e, t) {if (!e || !e.rgb) throw new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + _typeof(e));var n = e.rgb(),i = this.rgb(),r = void 0 === t ? .5 : t,s = 2 * r - 1,o = n.alpha() - i.alpha(),a = ((s * o == -1 ? s : (s + o) / (1 + s * o)) + 1) / 2,l = 1 - a;return We.rgb(a * n.red() + l * i.red(), a * n.green() + l * i.green(), a * n.blue() + l * i.blue(), n.alpha() * r + i.alpha() * (1 - r));} }, Object.keys(Ve).forEach(function (e) {if (-1 === Be.indexOf(e)) {var t = Ve[e].channels;We.prototype[e] = function () {if (this.model === e) return new We(this);if (arguments.length) return new We(arguments, e);var n,i = \"number\" == typeof arguments[t] ? t : this.valpha;return new We((n = Ve[this.model][e].raw(this.color), Array.isArray(n) ? n : [n]).concat(i), e);}, We[e] = function (n) {return \"number\" == typeof n && (n = Ze(Ue.call(arguments), t)), new We(n, e);};}});var qe = n(We);function $e(e) {for (var _t19 = 1; _t19 < arguments.length; _t19++) {var _n11 = arguments[_t19];for (var _t20 in _n11) e[_t20] = _n11[_t20];}return e;}function Je(e) {return null == e;}function Ke(e) {return \"number\" == typeof e && !isNaN(e);}function Qe(e) {return \"object\" == _typeof(e) && !!e;}function et(e) {return !Je(e) && (\"string\" == typeof e || null !== e.constructor && e.constructor === String);}function tt(e) {return !Je(e) && (\"function\" == typeof e || null !== e.constructor && e.constructor === Function);}var nt = Object.prototype.hasOwnProperty;function it(e, t) {return nt.call(e, t);}var rt = Math.PI / 180;function st(e) {return e && ie(e) && e.property;}function ot(e) {var t = e.verticalCentimeterToPoint,n = e.tileRatio;return t * n;}function at(e) {return \"centimeter\" === e || \"cm\" === e ? 1 : \"millimeter\" === e || \"mm\" === e ? .1 : 100;}var lt = {};function ht(e, t) {if (!Array.isArray(t)) {if (t && void 0 !== t.r && void 0 !== t.g && void 0 !== t.b) return e[0] = 255 * t.r, e[1] = 255 * t.g, e[2] = 255 * t.b, void 0 !== t.a ? e[3] = 255 * t.a : e[3] = 255, e;var _n12 = t;t = lt[_n12] = lt[_n12] || qe(t).unitArray();}for (var _n13 = 0; _n13 < t.length; _n13++) e[_n13] = 255 * t[_n13];return 3 === t.length && (e[3] = 255), e;}var ct = { textFill: 1, textSize: 1, textOpacity: 1, textDx: 1, textDy: 1, markerWidth: 1, markerHeight: 1, markerOpacity: 1, markerDx: 1, markerDy: 1, lineWidth: 1, lineColor: 1, lineOpacity: 1, polygonFill: 1, polygonOpacity: 1, polygonPatternFileWidth: 1, polygonPatternFileOrigin: 1, rotationX: 1, rotationY: 1, rotationZ: 1, scaleX: 1, scaleY: 1, scaleZ: 1, translationX: 1, translationY: 1, translationZ: 1 },ut = { textName: 1, markerTextFitPadding: 1, markerTextFit: 1, lineGradientProperty: 1 };var ft = Object.freeze({ __proto__: null, checkIfIdentityZoomDependent: function checkIfIdentityZoomDependent(e, t, n) {if (Array.isArray(n) || (n = Object.values(n)), !n || !n.length) return !1;if (!ct[e]) return !1;for (var _e12 = 0; _e12 < n.length; _e12++) {var _i13 = n[_e12] && (n[_e12].feature || n[_e12]);if (!_i13) continue;var _r11 = _i13.properties && _i13.properties[t];if (_r11 && ie(_r11) && !re(_r11).isZoomConstant) return !0;}return !1;}, checkIfZoomFnTypeSymbol: function checkIfZoomFnTypeSymbol(e) {return !!ct[e] || !!ut[e];}, evaluate: function evaluate(e, t, n) {return tt(e) ? e(void 0 !== n ? n : null, t) : e;}, extend: $e, getAltitudeToLocal: ot, getTubeSizeScale: at, hasOwn: it, isFnTypeSymbol: st, isFunction: tt, isInteger: function isInteger(e) {return (0 | e) === e;}, isNil: Je, isNumber: Ke, isObject: Qe, isString: et, join: function join(e, t) {return e.join ? e.join(t || \",\") : Array.prototype.join.call(e, t || \",\");}, normalizeColor: ht, now: function now() {return Date.now();}, toDegree: function toDegree(e) {return e / rt;}, toRadian: function toRadian(e) {return e * rt;} });var dt = function () {function dt(e, t, n, i) {_classCallCheck(this, dt);this.feature = e, this.symbol = t, this.fnTypes = n, this.options = i;}return _createClass(dt, [{ key: \"getPolygonResource\", value: function getPolygonResource() {var e = this.symbol.polygonPatternFile;var t = this.fnTypes.polygonPatternFileFn,n = t;return this._getResource(e, n);} }, { key: \"getLineResource\", value: function getLineResource() {var e = this.symbol.linePatternFile;var t = this.fnTypes.linePatternFileFn,n = t;return this._getResource(e, n);} }, { key: \"_getResource\", value: function _getResource(e, t) {if (t) {var _n14 = this.feature.properties;e = t(this.options.zoom, _n14);}return e;} }]);}();function pt(e, t, n, i) {var r = Math.abs(i) >> 15,s = r >> 1,o = r % 2;var a = i % Math.pow(2, 15);var l = t + (s << 14) * Math.sign(t),h = n + (o << 14) * Math.sign(n);return e[0] = l, e[1] = h, a = Math.round(a), e[2] = 0 === a ? i < 0 ? -1 : 0 : a, e;}var gt = Math.pow(2, 14),mt = Math.pow(2, 15),yt = [\"Unknown\", \"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\", \"GeometryCollection\"];function xt(e) {if (!0 === e || !1 === e) return !0;if (!Array.isArray(e) || 0 === e.length) return !1;switch (e[0]) {case \"has\":case \"!has\":return 2 === e.length && (\"string\" == typeof e[1] || e[1].property && e[1].op);case \"in\":case \"!in\":return e.length >= 2 && (\"string\" == typeof e[1] || e[1].property && e[1].op);case \"==\":case \"!=\":case \">\":case \">=\":case \"<\":case \"<=\":return 3 === e.length && (\"string\" == typeof e[1] || e[1].property && e[1].op);case \"none\":case \"any\":case \"all\":var _iterator = _createForOfIteratorHelper(e.slice(1)),_step;try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var _t21 = _step.value;if (!xt(_t21) && \"boolean\" != typeof _t21) return !1;}} catch (err) {_iterator.e(err);} finally {_iterator.f();}return !0;case \"contains\":return !0;default:return !1;}}function _t(e) {if (!e) return \"true\";var t = e[0];if (e.length <= 1) return \"any\" === t ? \"false\" : \"true\";var n = \"==\" === t ? bt(e[1], e[2], \"===\", !1) : \"!=\" === t ? bt(e[1], e[2], \"!==\", !1) : \"<\" === t || \">\" === t || \"<=\" === t || \">=\" === t ? bt(e[1], e[2], t, !0) : \"any\" === t ? Tt(e.slice(1), \"||\") : \"all\" === t ? Tt(e.slice(1), \"&&\") : \"none\" === t ? Mt(Tt(e.slice(1), \"||\")) : \"in\" === t ? wt(e[1], e.slice(2)) : \"!in\" === t ? Mt(wt(e[1], e.slice(2))) : \"has\" === t ? St(e[1]) : \"!has\" === t ? Mt(St(e[1])) : \"contains\" === t ? function (e, t, n) {var i = vt(e);return void 0 !== n ? \"(\".concat(i, \" + '').indexOf(\\\"\").concat(t, \"\\\") === \").concat(n) : \"(\".concat(i, \" + '').indexOf(\\\"\").concat(t, \"\\\") >= 0\");}(e[1], e[2], e[3]) : \"true\";return \"(\".concat(n, \")\");}function vt(e) {return \"$\" === e[0] ? \"f.\" + e.substring(1) : \"p[\" + JSON.stringify(e) + \"]\";}function bt(e, t, n, i) {return \"object\" == _typeof(r = e) && r && e.op ? function (e, t, n, i) {var r = e.property,s = e.op;var o = vt(r);return \"length\" !== s ? (console.error(\"not support \".concat(s, \" op\")), \"false\") : (o = \"((\".concat(o, \"+='').length)\"), At(o, r, t, n, i));}(e, t, n, i) : At(vt(e), e, t, n, i);var r;}function At(e, t, n, i, r) {var s = \"$type\" === t ? yt.indexOf(n) : JSON.stringify(n);return (r ? \"typeof \".concat(e, \"=== typeof \").concat(s, \"&&\") : \"\") + e + i + s;}function Tt(e, t) {return e.map(_t).join(t);}function wt(e, t) {\"$type\" === e && (t = t.map(function (e) {return yt.indexOf(e);}));var n = JSON.stringify(t.sort(Pt)),i = vt(e);return t.length <= 200 ? \"\".concat(n, \".indexOf(\").concat(i, \") !== -1\") : \"function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(\".concat(i, \", \").concat(n, \",0,\").concat(t.length - 1, \")\");}function St(e) {return \"$id\" === e ? '\"id\" in f' : \"\".concat(JSON.stringify(e), \" in p\");}function Mt(e) {return \"!(\".concat(e, \")\");}function Pt(e, t) {return e < t ? -1 : e > t ? 1 : 0;}var It = \"undefined\" != typeof globalThis ? globalThis : \"undefined\" != typeof window ? window : \"undefined\" != typeof global ? global : \"undefined\" != typeof self ? self : {},Ct = { exports: {} };function kt(e) {for (var _len = arguments.length, t = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {t[_key - 1] = arguments[_key];}for (var _i14 = 0, _t22 = t; _i14 < _t22.length; _i14++) {var _n15 = _t22[_i14];for (var _t23 in _n15) e[_t23] = _n15[_t23];}return e;}!function (e, t) {!function (n) {var i = t && !t.nodeType && t,r = e && !e.nodeType && e,s = \"object\" == _typeof(It) && It;s.global !== s && s.window !== s && s.self !== s || (n = s);var o,a,l = 2147483647,h = 36,c = 26,u = 38,f = 700,d = /^xn--/,p = /[^\\x20-\\x7E]/,g = /[\\x2E\\u3002\\uFF0E\\uFF61]/g,m = { overflow: \"Overflow: input needs wider integers to process\", \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\", \"invalid-input\": \"Invalid input\" },y = h - 1,x = Math.floor,_ = String.fromCharCode;function v(e) {throw RangeError(m[e]);}function b(e, t) {for (var n = e.length, i = []; n--;) i[n] = t(e[n]);return i;}function A(e, t) {var n = e.split(\"@\"),i = \"\";return n.length > 1 && (i = n[0] + \"@\", e = n[1]), i + b((e = e.replace(g, \".\")).split(\".\"), t).join(\".\");}function T(e) {for (var t, n, i = [], r = 0, s = e.length; r < s;) (t = e.charCodeAt(r++)) >= 55296 && t <= 56319 && r < s ? 56320 == (64512 & (n = e.charCodeAt(r++))) ? i.push(((1023 & t) << 10) + (1023 & n) + 65536) : (i.push(t), r--) : i.push(t);return i;}function w(e) {return b(e, function (e) {var t = \"\";return e > 65535 && (t += _((e -= 65536) >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t + _(e);}).join(\"\");}function S(e, t) {return e + 22 + 75 * (e < 26) - ((0 != t) << 5);}function M(e, t, n) {var i = 0;for (e = n ? x(e / f) : e >> 1, e += x(e / t); e > y * c >> 1; i += h) e = x(e / y);return x(i + (y + 1) * e / (e + u));}function P(e) {var t,n,i,r,s,o,a,u,f,d,p,g = [],m = e.length,y = 0,_ = 128,b = 72;for ((n = e.lastIndexOf(\"-\")) < 0 && (n = 0), i = 0; i < n; ++i) e.charCodeAt(i) >= 128 && v(\"not-basic\"), g.push(e.charCodeAt(i));for (r = n > 0 ? n + 1 : 0; r < m;) {for (s = y, o = 1, a = h; r >= m && v(\"invalid-input\"), ((u = (p = e.charCodeAt(r++)) - 48 < 10 ? p - 22 : p - 65 < 26 ? p - 65 : p - 97 < 26 ? p - 97 : h) >= h || u > x((l - y) / o)) && v(\"overflow\"), y += u * o, !(u < (f = a <= b ? 1 : a >= b + c ? c : a - b)); a += h) o > x(l / (d = h - f)) && v(\"overflow\"), o *= d;b = M(y - s, t = g.length + 1, 0 == s), x(y / t) > l - _ && v(\"overflow\"), _ += x(y / t), y %= t, g.splice(y++, 0, _);}return w(g);}function I(e) {var t,n,i,r,s,o,a,u,f,d,p,g,m,y,b,A = [];for (g = (e = T(e)).length, t = 128, n = 0, s = 72, o = 0; o < g; ++o) (p = e[o]) < 128 && A.push(_(p));for (i = r = A.length, r && A.push(\"-\"); i < g;) {for (a = l, o = 0; o < g; ++o) (p = e[o]) >= t && p < a && (a = p);for (a - t > x((l - n) / (m = i + 1)) && v(\"overflow\"), n += (a - t) * m, t = a, o = 0; o < g; ++o) if ((p = e[o]) < t && ++n > l && v(\"overflow\"), p == t) {for (u = n, f = h; !(u < (d = f <= s ? 1 : f >= s + c ? c : f - s)); f += h) b = u - d, y = h - d, A.push(_(S(d + b % y, 0))), u = x(b / y);A.push(_(S(u, 0))), s = M(n, m, i == r), n = 0, ++i;}++n, ++t;}return A.join(\"\");}if (o = { version: \"1.3.2\", ucs2: { decode: T, encode: w }, decode: P, encode: I, toASCII: function toASCII(e) {return A(e, function (e) {return p.test(e) ? \"xn--\" + I(e) : e;});}, toUnicode: function toUnicode(e) {return A(e, function (e) {return d.test(e) ? P(e.slice(4).toLowerCase()) : e;});} }, i && r) {if (e.exports == i) r.exports = o;else for (a in o) o.hasOwnProperty(a) && (i[a] = o[a]);} else n.punycode = o;}(It);}(Ct, Ct.exports);var Ft = function (_Error) {function Ft(e, t) {var _this;_classCallCheck(this, Ft);_this = _callSuper(this, Ft, [t]), _this.message = t, _this.key = e;return _this;}_inherits(Ft, _Error);return _createClass(Ft);}(_wrapNativeSuper(Error));var Ot = Ft;var Rt = function () {function Rt(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];_classCallCheck(this, Rt);this.parent = e, this.bindings = {};var _iterator2 = _createForOfIteratorHelper(t),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var _step2$value = _slicedToArray(_step2.value, 2),_e13 = _step2$value[0],_n16 = _step2$value[1];this.bindings[_e13] = _n16;}} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}}return _createClass(Rt, [{ key: \"concat\", value: function concat(e) {return new Rt(this, e);} }, { key: \"get\", value: function get(e) {if (this.bindings[e]) return this.bindings[e];if (this.parent) return this.parent.get(e);throw new Error(\"\".concat(e, \" not found in scope.\"));} }, { key: \"has\", value: function has(e) {return !!this.bindings[e] || !!this.parent && this.parent.has(e);} }]);}();var Et = Rt;var Dt = { kind: \"null\" },Lt = { kind: \"number\" },Ht = { kind: \"string\" },Nt = { kind: \"boolean\" },zt = { kind: \"color\" },Vt = { kind: \"object\" },Ut = { kind: \"value\" },Bt = { kind: \"collator\" },Gt = { kind: \"formatted\" },jt = { kind: \"resolvedImage\" };function Wt(e, t) {return { kind: \"array\", itemType: e, N: t };}function Xt(e) {if (\"array\" === e.kind) {var _t24 = Xt(e.itemType);return \"number\" == typeof e.N ? \"array<\".concat(_t24, \", \").concat(e.N, \">\") : \"value\" === e.itemType.kind ? \"array\" : \"array<\".concat(_t24, \">\");}return e.kind;}var Yt = [Dt, Lt, Ht, Nt, zt, Gt, Vt, Wt(Ut), jt];function Zt(e, t) {if (\"error\" === t.kind) return null;if (\"array\" === e.kind) {if (\"array\" === t.kind && (0 === t.N && \"value\" === t.itemType.kind || !Zt(e.itemType, t.itemType)) && (\"number\" != typeof e.N || e.N === t.N)) return null;} else {if (e.kind === t.kind) return null;if (\"value\" === e.kind) for (var _i15 = 0, _Yt = Yt; _i15 < _Yt.length; _i15++) {var _e14 = _Yt[_i15];if (!Zt(_e14, t)) return null;}}return \"Expected \".concat(Xt(e), \" but found \").concat(Xt(t), \" instead.\");}function qt(e, t) {return t.some(function (t) {return t.kind === e.kind;});}function $t(e, t) {return t.some(function (t) {return \"null\" === t ? null === e : \"array\" === t ? Array.isArray(e) : \"object\" === t ? e && !Array.isArray(e) && \"object\" == _typeof(e) : t === _typeof(e);});}var Jt,Kt = { 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 Qt(e) {return (e = Math.round(e)) < 0 ? 0 : e > 255 ? 255 : e;}function en(e) {return e < 0 ? 0 : e > 1 ? 1 : e;}function tn(e) {return \"%\" === e[e.length - 1] ? Qt(parseFloat(e) / 100 * 255) : Qt(parseInt(e));}function nn(e) {return \"%\" === e[e.length - 1] ? en(parseFloat(e) / 100) : en(parseFloat(e));}function rn(e, t, n) {return n < 0 ? n += 1 : n > 1 && (n -= 1), 6 * n < 1 ? e + (t - e) * n * 6 : 2 * n < 1 ? t : 3 * n < 2 ? e + (t - e) * (2 / 3 - n) * 6 : e;}try {Jt = {}.parseCSSColor = function (e) {var t,n = e.replace(/ /g, \"\").toLowerCase();if (n in Kt) return Kt[n].slice();if (\"#\" === n[0]) return 4 === n.length ? (t = parseInt(n.substr(1), 16)) >= 0 && t <= 4095 ? [(3840 & t) >> 4 | (3840 & t) >> 8, 240 & t | (240 & t) >> 4, 15 & t | (15 & t) << 4, 1] : null : 7 === n.length && (t = parseInt(n.substr(1), 16)) >= 0 && t <= 16777215 ? [(16711680 & t) >> 16, (65280 & t) >> 8, 255 & t, 1] : null;var i = n.indexOf(\"(\"),r = n.indexOf(\")\");if (-1 !== i && r + 1 === n.length) {var s = n.substr(0, i),o = n.substr(i + 1, r - (i + 1)).split(\",\"),a = 1;switch (s) {case \"rgba\":if (4 !== o.length) return null;a = nn(o.pop());case \"rgb\":return 3 !== o.length ? null : [tn(o[0]), tn(o[1]), tn(o[2]), a];case \"hsla\":if (4 !== o.length) return null;a = nn(o.pop());case \"hsl\":if (3 !== o.length) return null;var l = (parseFloat(o[0]) % 360 + 360) % 360 / 360,h = nn(o[1]),c = nn(o[2]),u = c <= .5 ? c * (h + 1) : c + h - c * h,f = 2 * c - u;return [Qt(255 * rn(f, u, l + 1 / 3)), Qt(255 * rn(f, u, l)), Qt(255 * rn(f, u, l - 1 / 3)), a];default:return null;}}return null;};} catch (e) {}var sn = function () {function sn(e, t, n) {var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;_classCallCheck(this, sn);this.r = e, this.g = t, this.b = n, this.a = i;}return _createClass(sn, [{ key: \"toString\", value: function toString() {var _this$toArray = this.toArray(),_this$toArray2 = _slicedToArray(_this$toArray, 4),e = _this$toArray2[0],t = _this$toArray2[1],n = _this$toArray2[2],i = _this$toArray2[3];return \"rgba(\".concat(Math.round(e), \",\").concat(Math.round(t), \",\").concat(Math.round(n), \",\").concat(i, \")\");} }, { key: \"toArray\", value: function toArray() {var e = this.r,t = this.g,n = this.b,i = this.a;return 0 === i ? [0, 0, 0, 0] : [255 * e / i, 255 * t / i, 255 * n / i, i];} }, { key: \"toArray01\", value: function toArray01() {var e = this.r,t = this.g,n = this.b,i = this.a;return 0 === i ? [0, 0, 0, 0] : [e / i, t / i, n / i, i];} }, { key: \"toArray01PremultipliedAlpha\", value: function toArray01PremultipliedAlpha() {var e = this.r,t = this.g,n = this.b,i = this.a;return [e, t, n, i];} }], [{ key: \"parse\", value: function parse(e) {if (!e) return;if (e instanceof sn) return e;if (\"string\" != typeof e) return;var t = Jt(e);return t ? new sn(t[0] / 255 * t[3], t[1] / 255 * t[3], t[2] / 255 * t[3], t[3]) : void 0;} }]);}();sn.black = new sn(0, 0, 0, 1), sn.white = new sn(1, 1, 1, 1), sn.transparent = new sn(0, 0, 0, 0), sn.red = new sn(1, 0, 0, 1), sn.blue = new sn(0, 0, 1, 1);var on = sn;var an = function () {function an(e, t, n) {_classCallCheck(this, an);this.sensitivity = e ? t ? \"variant\" : \"case\" : t ? \"accent\" : \"base\", this.locale = n, this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: \"search\" });}return _createClass(an, [{ key: \"compare\", value: function compare(e, t) {return this.collator.compare(e, t);} }, { key: \"resolvedLocale\", value: function resolvedLocale() {return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale;} }]);}();var ln = _createClass(function ln(e, t, n, i, r) {_classCallCheck(this, ln);this.text = e.normalize ? e.normalize() : e, this.image = t, this.scale = n, this.fontStack = i, this.textColor = r;});var hn = function () {function hn(e) {_classCallCheck(this, hn);this.sections = e;}return _createClass(hn, [{ key: \"isEmpty\", value: function isEmpty() {return 0 === this.sections.length || !this.sections.some(function (e) {return 0 !== e.text.length || e.image && 0 !== e.image.name.length;});} }, { key: \"toString\", value: function toString() {return 0 === this.sections.length ? \"\" : this.sections.map(function (e) {return e.text;}).join(\"\");} }, { key: \"serialize\", value: function serialize() {var e = [\"format\"];var _iterator3 = _createForOfIteratorHelper(this.sections),_step3;try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {var _t25 = _step3.value;if (_t25.image) {e.push([\"image\", _t25.image.name]);continue;}e.push(_t25.text);var _n17 = {};_t25.fontStack && (_n17[\"text-font\"] = [\"literal\", _t25.fontStack.split(\",\")]), _t25.scale && (_n17[\"font-scale\"] = _t25.scale), _t25.textColor && (_n17[\"text-color\"] = [\"rgba\"].concat(_t25.textColor.toArray())), e.push(_n17);}} catch (err) {_iterator3.e(err);} finally {_iterator3.f();}return e;} }], [{ key: \"fromString\", value: function fromString(e) {return new hn([new ln(e, null, null, null, null)]);} }, { key: \"factory\", value: function factory(e) {return e instanceof hn ? e : hn.fromString(e);} }]);}();var cn = function () {function cn(e) {_classCallCheck(this, cn);this.name = e.name, this.available = e.available;}return _createClass(cn, [{ key: \"toString\", value: function toString() {return this.name;} }, { key: \"serialize\", value: function serialize() {return [\"image\", this.name];} }], [{ key: \"fromString\", value: function fromString(e) {return e ? new cn({ name: e, available: !1 }) : null;} }]);}();function un(e, t, n, i) {return \"number\" == typeof e && e >= 0 && e <= 255 && \"number\" == typeof t && t >= 0 && t <= 255 && \"number\" == typeof n && n >= 0 && n <= 255 ? void 0 === i || \"number\" == typeof i && i >= 0 && i <= 1 ? null : \"Invalid rgba value [\".concat([e, t, n, i].join(\", \"), \"]: 'a' must be between 0 and 1.\") : \"Invalid rgba value [\".concat((\"number\" == typeof i ? [e, t, n, i] : [e, t, n]).join(\", \"), \"]: 'r', 'g', and 'b' must be between 0 and 255.\");}function fn(e) {if (null === e) return !0;if (\"string\" == typeof e) return !0;if (\"boolean\" == typeof e) return !0;if (\"number\" == typeof e) return !0;if (e instanceof on) return !0;if (e instanceof an) return !0;if (e instanceof hn) return !0;if (e instanceof cn) return !0;if (Array.isArray(e)) {var _iterator4 = _createForOfIteratorHelper(e),_step4;try {for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {var _t26 = _step4.value;if (!fn(_t26)) return !1;}} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}return !0;}if (\"object\" == _typeof(e)) {for (var _t27 in e) if (!fn(e[_t27])) return !1;return !0;}return !1;}function dn(e) {if (null === e) return Dt;if (\"string\" == typeof e) return Ht;if (\"boolean\" == typeof e) return Nt;if (\"number\" == typeof e) return Lt;if (e instanceof on) return zt;if (e instanceof an) return Bt;if (e instanceof hn) return Gt;if (e instanceof cn) return jt;if (Array.isArray(e)) {var _t28 = e.length;var _n18;var _iterator5 = _createForOfIteratorHelper(e),_step5;try {for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {var _t29 = _step5.value;var _e15 = dn(_t29);if (_n18) {if (_n18 === _e15) continue;_n18 = Ut;break;}_n18 = _e15;}} catch (err) {_iterator5.e(err);} finally {_iterator5.f();}return Wt(_n18 || Ut, _t28);}return Vt;}function pn(e) {var t = _typeof(e);return null === e ? \"\" : \"string\" === t || \"number\" === t || \"boolean\" === t ? String(e) : e instanceof on || e instanceof hn || e instanceof cn ? e.toString() : JSON.stringify(e);}var gn = function () {function gn(e, t) {_classCallCheck(this, gn);this.type = e, this.value = t;}return _createClass(gn, [{ key: \"evaluate\", value: function evaluate() {return this.value;} }, { key: \"eachChild\", value: function eachChild() {} }, { key: \"outputDefined\", value: function outputDefined() {return !0;} }, { key: \"serialize\", value: function serialize() {return \"array\" === this.type.kind || \"object\" === this.type.kind ? [\"literal\", this.value] : this.value instanceof on ? [\"rgba\"].concat(this.value.toArray()) : this.value instanceof hn ? this.value.serialize() : this.value;} }], [{ key: \"parse\", value: function parse(e, t) {if (2 !== e.length) return t.error(\"'literal' expression requires exactly one argument, but found \".concat(e.length - 1, \" instead.\"));if (!fn(e[1])) return t.error(\"invalid value\");var n = e[1];var i = dn(n);var r = t.expectedType;return \"array\" !== i.kind || 0 !== i.N || !r || \"array\" !== r.kind || \"number\" == typeof r.N && 0 !== r.N || (i = r), new gn(i, n);} }]);}();var mn = gn,yn = function () {function yn(e) {_classCallCheck(this, yn);this.name = \"ExpressionEvaluationError\", this.message = e;}return _createClass(yn, [{ key: \"toJSON\", value: function toJSON() {return this.message;} }]);}();var xn = { string: Ht, number: Lt, boolean: Nt, object: Vt };var _n = function () {function _n(e, t) {_classCallCheck(this, _n);this.type = e, this.args = t;}return _createClass(_n, [{ key: \"evaluate\", value: function evaluate(e) {for (var _t30 = 0; _t30 < this.args.length; _t30++) {var _n19 = this.args[_t30].evaluate(e);if (!Zt(this.type, dn(_n19))) return _n19;if (_t30 === this.args.length - 1) throw new yn(\"Expected value to be of type \".concat(Xt(this.type), \", but found \").concat(Xt(dn(_n19)), \" instead.\"));}return null;} }, { key: \"eachChild\", value: function eachChild(e) {this.args.forEach(e);} }, { key: \"outputDefined\", value: function outputDefined() {return this.args.every(function (e) {return e.outputDefined();});} }, { key: \"serialize\", value: function serialize() {var e = this.type,t = [e.kind];if (\"array\" === e.kind) {var _n20 = e.itemType;if (\"string\" === _n20.kind || \"number\" === _n20.kind || \"boolean\" === _n20.kind) {t.push(_n20.kind);var _i16 = e.N;(\"number\" == typeof _i16 || this.args.length > 1) && t.push(_i16);}}return t.concat(this.args.map(function (e) {return e.serialize();}));} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length < 2) return t.error(\"Expected at least one argument.\");var n,i = 1;var r = e[0];if (\"array\" === r) {var _r12, _s9;if (e.length > 2) {var _n21 = e[1];if (\"string\" != typeof _n21 || !(_n21 in xn) || \"object\" === _n21) return t.error('The item type argument of \"array\" must be one of string, number, boolean', 1);_r12 = xn[_n21], i++;} else _r12 = Ut;if (e.length > 3) {if (null !== e[2] && (\"number\" != typeof e[2] || e[2] < 0 || e[2] !== Math.floor(e[2]))) return t.error('The length argument to \"array\" must be a positive integer literal', 2);_s9 = e[2], i++;}n = Wt(_r12, _s9);} else n = xn[r];var s = [];for (; i < e.length; i++) {var _n22 = t.parse(e[i], i, Ut);if (!_n22) return null;s.push(_n22);}return new _n(n, s);} }]);}();var vn = _n;var bn = function () {function bn(e) {_classCallCheck(this, bn);this.type = Gt, this.sections = e;}return _createClass(bn, [{ key: \"evaluate\", value: function evaluate(e) {return new hn(this.sections.map(function (t) {var n = t.content.evaluate(e);return dn(n) === jt ? new ln(\"\", n, null, null, null) : new ln(pn(n), null, t.scale ? t.scale.evaluate(e) : null, t.font ? t.font.evaluate(e).join(\",\") : null, t.textColor ? t.textColor.evaluate(e) : null);}));} }, { key: \"eachChild\", value: function eachChild(e) {var _iterator6 = _createForOfIteratorHelper(this.sections),_step6;try {for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {var _t31 = _step6.value;e(_t31.content), _t31.scale && e(_t31.scale), _t31.font && e(_t31.font), _t31.textColor && e(_t31.textColor);}} catch (err) {_iterator6.e(err);} finally {_iterator6.f();}} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {var e = [\"format\"];var _iterator7 = _createForOfIteratorHelper(this.sections),_step7;try {for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {var _t32 = _step7.value;e.push(_t32.content.serialize());var _n23 = {};_t32.scale && (_n23[\"font-scale\"] = _t32.scale.serialize()), _t32.font && (_n23[\"text-font\"] = _t32.font.serialize()), _t32.textColor && (_n23[\"text-color\"] = _t32.textColor.serialize()), e.push(_n23);}} catch (err) {_iterator7.e(err);} finally {_iterator7.f();}return e;} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length < 2) return t.error(\"Expected at least one argument.\");var n = e[1];if (!Array.isArray(n) && \"object\" == _typeof(n)) return t.error(\"First argument must be an image or text section.\");var i = [];var r = !1;for (var _n24 = 1; _n24 <= e.length - 1; ++_n24) {var _s10 = e[_n24];if (r && \"object\" == _typeof(_s10) && !Array.isArray(_s10)) {r = !1;var _e16 = null;if (_s10[\"font-scale\"] && (_e16 = t.parse(_s10[\"font-scale\"], 1, Lt), !_e16)) return null;var _n25 = null;if (_s10[\"text-font\"] && (_n25 = t.parse(_s10[\"text-font\"], 1, Wt(Ht)), !_n25)) return null;var _o8 = null;if (_s10[\"text-color\"] && (_o8 = t.parse(_s10[\"text-color\"], 1, zt), !_o8)) return null;var _a3 = i[i.length - 1];_a3.scale = _e16, _a3.font = _n25, _a3.textColor = _o8;} else {var _s11 = t.parse(e[_n24], 1, Ut);if (!_s11) return null;var _o9 = _s11.type.kind;if (\"string\" !== _o9 && \"value\" !== _o9 && \"null\" !== _o9 && \"resolvedImage\" !== _o9) return t.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");r = !0, i.push({ content: _s11, scale: null, font: null, textColor: null });}}return new bn(i);} }]);}();var An = function () {function An(e) {_classCallCheck(this, An);this.type = jt, this.input = e;}return _createClass(An, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.input.evaluate(e),n = cn.fromString(t);return n && e.availableImages && (n.available = e.availableImages.indexOf(t) > -1), n;} }, { key: \"eachChild\", value: function eachChild(e) {e(this.input);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {return [\"image\", this.input.serialize()];} }], [{ key: \"parse\", value: function parse(e, t) {if (2 !== e.length) return t.error(\"Expected two arguments.\");var n = t.parse(e[1], 1, Ht);return n ? new An(n) : t.error(\"No image name provided.\");} }]);}();var Tn = { \"to-boolean\": Nt, \"to-color\": zt, \"to-number\": Lt, \"to-string\": Ht };var wn = function () {function wn(e, t) {_classCallCheck(this, wn);this.type = e, this.args = t;}return _createClass(wn, [{ key: \"evaluate\", value: function evaluate(e) {if (\"boolean\" === this.type.kind) return Boolean(this.args[0].evaluate(e));if (\"color\" === this.type.kind) {var _t33, _n26;var _iterator8 = _createForOfIteratorHelper(this.args),_step8;try {for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {var _i17 = _step8.value;if (_t33 = _i17.evaluate(e), _n26 = null, _t33 instanceof on) return _t33;if (\"string\" == typeof _t33) {var _n27 = e.parseColor(_t33);if (_n27) return _n27;} else if (Array.isArray(_t33) && (_n26 = _t33.length < 3 || _t33.length > 4 ? \"Invalid rbga value \".concat(JSON.stringify(_t33), \": expected an array containing either three or four numeric values.\") : un(_t33[0], _t33[1], _t33[2], _t33[3]), !_n26)) return new on(_t33[0] / 255, _t33[1] / 255, _t33[2] / 255, _t33[3]);}} catch (err) {_iterator8.e(err);} finally {_iterator8.f();}throw new yn(_n26 || \"Could not parse color from value '\".concat(\"string\" == typeof _t33 ? _t33 : String(JSON.stringify(_t33)), \"'\"));}if (\"number\" === this.type.kind) {var _t34 = null;var _iterator9 = _createForOfIteratorHelper(this.args),_step9;try {for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {var _n28 = _step9.value;if (_t34 = _n28.evaluate(e), null === _t34) return 0;var _i18 = Number(_t34);if (!isNaN(_i18)) return _i18;}} catch (err) {_iterator9.e(err);} finally {_iterator9.f();}throw new yn(\"Could not convert \".concat(JSON.stringify(_t34), \" to number.\"));}return \"formatted\" === this.type.kind ? hn.fromString(pn(this.args[0].evaluate(e))) : \"resolvedImage\" === this.type.kind ? cn.fromString(pn(this.args[0].evaluate(e))) : pn(this.args[0].evaluate(e));} }, { key: \"eachChild\", value: function eachChild(e) {this.args.forEach(e);} }, { key: \"outputDefined\", value: function outputDefined() {return this.args.every(function (e) {return e.outputDefined();});} }, { key: \"serialize\", value: function serialize() {if (\"formatted\" === this.type.kind) return new bn([{ content: this.args[0], scale: null, font: null, textColor: null }]).serialize();if (\"resolvedImage\" === this.type.kind) return new An(this.args[0]).serialize();var e = [\"to-\".concat(this.type.kind)];return this.eachChild(function (t) {e.push(t.serialize());}), e;} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length < 2) return t.error(\"Expected at least one argument.\");var n = e[0];if ((\"to-boolean\" === n || \"to-string\" === n) && 2 !== e.length) return t.error(\"Expected one argument.\");var i = Tn[n],r = [];for (var _n29 = 1; _n29 < e.length; _n29++) {var _i19 = t.parse(e[_n29], _n29, Ut);if (!_i19) return null;r.push(_i19);}return new wn(i, r);} }]);}();var Sn = wn;var Mn = [\"Unknown\", \"Point\", \"LineString\", \"Polygon\"];var Pn = function () {function Pn() {_classCallCheck(this, Pn);this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null, this.featureTileCoord = null, this.featureDistanceData = null;}return _createClass(Pn, [{ key: \"id\", value: function id() {return this.feature && void 0 !== this.feature.id ? this.feature.id : null;} }, { key: \"geometryType\", value: function geometryType() {return this.feature ? \"number\" == typeof this.feature.type ? Mn[this.feature.type] : this.feature.type : null;} }, { key: \"geometry\", value: function geometry() {return this.feature && \"geometry\" in this.feature ? this.feature.geometry : null;} }, { key: \"canonicalID\", value: function canonicalID() {return this.canonical;} }, { key: \"properties\", value: function properties() {return this.feature && this.feature.properties || {};} }, { key: \"distanceFromCenter\", value: function distanceFromCenter() {if (this.featureTileCoord && this.featureDistanceData) {var _e17 = this.featureDistanceData.center,_t35 = this.featureDistanceData.scale,_this$featureTileCoor = this.featureTileCoord,_n30 = _this$featureTileCoor.x,_i20 = _this$featureTileCoor.y,_r13 = _n30 * _t35 - _e17[0],_s12 = _i20 * _t35 - _e17[1];return this.featureDistanceData.bearing[0] * _r13 + this.featureDistanceData.bearing[1] * _s12;}return 0;} }, { key: \"parseColor\", value: function parseColor(e) {var t = this._parseColorCache[e];return t || (t = this._parseColorCache[e] = on.parse(e)), t;} }]);}();var In = function () {function In(e, t, n, i) {_classCallCheck(this, In);this.name = e, this.type = t, this._evaluate = n, this.args = i;}return _createClass(In, [{ key: \"evaluate\", value: function evaluate(e) {return this._evaluate(e, this.args);} }, { key: \"eachChild\", value: function eachChild(e) {this.args.forEach(e);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {return [this.name].concat(this.args.map(function (e) {return e.serialize();}));} }], [{ key: \"parse\", value: function parse(e, t) {var _t$errors;var n = e[0],i = In.definitions[n];if (!i) return t.error(\"Unknown expression \\\"\".concat(n, \"\\\". If you wanted a literal array, use [\\\"literal\\\", [...]].\"), 0);var r = Array.isArray(i) ? i[0] : i.type,s = Array.isArray(i) ? [[i[1], i[2]]] : i.overloads,o = s.filter(function (_ref4) {var _ref5 = _slicedToArray(_ref4, 1),t = _ref5[0];return !Array.isArray(t) || t.length === e.length - 1;});var a = null;var _iterator10 = _createForOfIteratorHelper(o),_step10;try {for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {var _step10$value = _slicedToArray(_step10.value, 2),_i22 = _step10$value[0],_s13 = _step10$value[1];a = new ni(t.registry, t.path, null, t.scope);var _o10 = [];var _l3 = !1;for (var _t36 = 1; _t36 < e.length; _t36++) {var _n33 = e[_t36],_r15 = Array.isArray(_i22) ? _i22[_t36 - 1] : _i22.type,_s14 = a.parse(_n33, 1 + _o10.length, _r15);if (!_s14) {_l3 = !0;break;}_o10.push(_s14);}if (!_l3) if (Array.isArray(_i22) && _i22.length !== _o10.length) a.error(\"Expected \".concat(_i22.length, \" arguments, but found \").concat(_o10.length, \" instead.\"));else {for (var _e18 = 0; _e18 < _o10.length; _e18++) {var _t37 = Array.isArray(_i22) ? _i22[_e18] : _i22.type,_n34 = _o10[_e18];a.concat(_e18 + 1).checkSubtype(_t37, _n34.type);}if (0 === a.errors.length) return new In(n, r, _s13, _o10);}}} catch (err) {_iterator10.e(err);} finally {_iterator10.f();}if (1 === o.length) (_t$errors = t.errors).push.apply(_t$errors, _toConsumableArray(a.errors));else {var _n31 = (o.length ? o : s).map(function (_ref6) {var _ref7 = _slicedToArray(_ref6, 1),e = _ref7[0];return t = e, Array.isArray(t) ? \"(\".concat(t.map(Xt).join(\", \"), \")\") : \"(\".concat(Xt(t.type), \"...)\");var t;}).join(\" | \"),_i21 = [];for (var _n32 = 1; _n32 < e.length; _n32++) {var _r14 = t.parse(e[_n32], 1 + _i21.length);if (!_r14) return null;_i21.push(Xt(_r14.type));}t.error(\"Expected arguments of type \".concat(_n31, \", but found (\").concat(_i21.join(\", \"), \") instead.\"));}return null;} }, { key: \"register\", value: function register(e, t) {In.definitions = t;for (var _n35 in t) e[_n35] = In;} }]);}();var Cn = In;var kn = function () {function kn(e, t, n) {_classCallCheck(this, kn);this.type = Bt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;}return _createClass(kn, [{ key: \"evaluate\", value: function evaluate(e) {return new an(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);} }, { key: \"eachChild\", value: function eachChild(e) {e(this.caseSensitive), e(this.diacriticSensitive), this.locale && e(this.locale);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {var e = {};return e[\"case-sensitive\"] = this.caseSensitive.serialize(), e[\"diacritic-sensitive\"] = this.diacriticSensitive.serialize(), this.locale && (e.locale = this.locale.serialize()), [\"collator\", e];} }], [{ key: \"parse\", value: function parse(e, t) {if (2 !== e.length) return t.error(\"Expected one argument.\");var n = e[1];if (\"object\" != _typeof(n) || Array.isArray(n)) return t.error(\"Collator options argument must be an object.\");var i = t.parse(void 0 !== n[\"case-sensitive\"] && n[\"case-sensitive\"], 1, Nt);if (!i) return null;var r = t.parse(void 0 !== n[\"diacritic-sensitive\"] && n[\"diacritic-sensitive\"], 1, Nt);if (!r) return null;var s = null;return n.locale && (s = t.parse(n.locale, 1, Ht), !s) ? null : new kn(i, r, s);} }]);}();var Fn = 8192;function On(e, t) {e[0] = Math.min(e[0], t[0]), e[1] = Math.min(e[1], t[1]), e[2] = Math.max(e[2], t[0]), e[3] = Math.max(e[3], t[1]);}function Rn(e, t) {return !(e[0] <= t[0] || e[2] >= t[2] || e[1] <= t[1] || e[3] >= t[3]);}function En(e, t) {var n = (180 + e[0]) / 360,i = (r = e[1], (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360);var r;var s = Math.pow(2, t.z);return [Math.round(n * s * Fn), Math.round(i * s * Fn)];}function Dn(e, t, n) {var i = e[0] - t[0],r = e[1] - t[1],s = e[0] - n[0],o = e[1] - n[1];return i * o - s * r == 0 && i * s <= 0 && r * o <= 0;}function Ln(e, t) {var n = !1;for (var _o11 = 0, _a4 = t.length; _o11 < _a4; _o11++) {var _a5 = t[_o11];for (var _t38 = 0, _o12 = _a5.length; _t38 < _o12 - 1; _t38++) {if (Dn(e, _a5[_t38], _a5[_t38 + 1])) return !1;i = e, r = _a5[_t38], s = _a5[_t38 + 1], r[1] > i[1] != s[1] > i[1] && i[0] < (s[0] - r[0]) * (i[1] - r[1]) / (s[1] - r[1]) + r[0] && (n = !n);}}var i, r, s;return n;}function Hn(e, t) {for (var _n36 = 0; _n36 < t.length; _n36++) if (Ln(e, t[_n36])) return !0;return !1;}function Nn(e, t, n, i) {var r = e[0] - n[0],s = e[1] - n[1],o = t[0] - n[0],a = t[1] - n[1],l = i[0] - n[0],h = i[1] - n[1],c = r * h - l * s,u = o * h - l * a;return c > 0 && u < 0 || c < 0 && u > 0;}function zn(e, t, n, i) {var r = [t[0] - e[0], t[1] - e[1]];return 0 != (s = [i[0] - n[0], i[1] - n[1]])[0] * (o = r)[1] - s[1] * o[0] && !(!Nn(e, t, n, i) || !Nn(n, i, e, t));var s, o;}function Vn(e, t, n) {var _iterator11 = _createForOfIteratorHelper(n),_step11;try {for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {var _i23 = _step11.value;for (var _n37 = 0; _n37 < _i23.length - 1; ++_n37) if (zn(e, t, _i23[_n37], _i23[_n37 + 1])) return !0;}} catch (err) {_iterator11.e(err);} finally {_iterator11.f();}return !1;}function Un(e, t) {for (var _n38 = 0; _n38 < e.length; ++_n38) if (!Ln(e[_n38], t)) return !1;for (var _n39 = 0; _n39 < e.length - 1; ++_n39) if (Vn(e[_n39], e[_n39 + 1], t)) return !1;return !0;}function Bn(e, t) {for (var _n40 = 0; _n40 < t.length; _n40++) if (Un(e, t[_n40])) return !0;return !1;}function Gn(e, t, n) {var i = [];for (var _r16 = 0; _r16 < e.length; _r16++) {var _s15 = [];for (var _i24 = 0; _i24 < e[_r16].length; _i24++) {var _o13 = En(e[_r16][_i24], n);On(t, _o13), _s15.push(_o13);}i.push(_s15);}return i;}function jn(e, t, n) {var i = [];for (var _r17 = 0; _r17 < e.length; _r17++) {var _s16 = Gn(e[_r17], t, n);i.push(_s16);}return i;}function Wn(e, t, n, i) {if (e[0] < n[0] || e[0] > n[2]) {var _t39 = .5 * i;var _r18 = e[0] - n[0] > _t39 ? -i : n[0] - e[0] > _t39 ? i : 0;0 === _r18 && (_r18 = e[0] - n[2] > _t39 ? -i : n[2] - e[0] > _t39 ? i : 0), e[0] += _r18;}On(t, e);}function Xn(e, t, n, i) {var r = Math.pow(2, i.z) * Fn,s = [i.x * Fn, i.y * Fn],o = [];if (!e) return o;var _iterator12 = _createForOfIteratorHelper(e),_step12;try {for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {var _i25 = _step12.value;var _iterator13 = _createForOfIteratorHelper(_i25),_step13;try {for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {var _e19 = _step13.value;var _i26 = [_e19.x + s[0], _e19.y + s[1]];Wn(_i26, t, n, r), o.push(_i26);}} catch (err) {_iterator13.e(err);} finally {_iterator13.f();}}} catch (err) {_iterator12.e(err);} finally {_iterator12.f();}return o;}function Yn(e, t, n, i) {var r = Math.pow(2, i.z) * Fn,s = [i.x * Fn, i.y * Fn],o = [];if (!e) return o;var _iterator14 = _createForOfIteratorHelper(e),_step14;try {for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {var _n41 = _step14.value;var _e21 = [];var _iterator17 = _createForOfIteratorHelper(_n41),_step17;try {for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {var _i28 = _step17.value;var _n42 = [_i28.x + s[0], _i28.y + s[1]];On(t, _n42), _e21.push(_n42);}} catch (err) {_iterator17.e(err);} finally {_iterator17.f();}o.push(_e21);}} catch (err) {_iterator14.e(err);} finally {_iterator14.f();}if (t[2] - t[0] <= r / 2) {(a = t)[0] = a[1] = 1 / 0, a[2] = a[3] = -1 / 0;var _iterator15 = _createForOfIteratorHelper(o),_step15;try {for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {var _e20 = _step15.value;var _iterator16 = _createForOfIteratorHelper(_e20),_step16;try {for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {var _i27 = _step16.value;Wn(_i27, t, n, r);}} catch (err) {_iterator16.e(err);} finally {_iterator16.f();}}} catch (err) {_iterator15.e(err);} finally {_iterator15.f();}}var a;return o;}var Zn = function () {function Zn(e, t) {_classCallCheck(this, Zn);this.type = Nt, this.geojson = e, this.geometries = t;}return _createClass(Zn, [{ key: \"evaluate\", value: function evaluate(e) {if (null != e.geometry() && null != e.canonicalID()) {if (\"Point\" === e.geometryType()) return function (e, t) {var n = [1 / 0, 1 / 0, -1 / 0, -1 / 0],i = [1 / 0, 1 / 0, -1 / 0, -1 / 0],r = e.canonicalID();if (!r) return !1;if (\"Polygon\" === t.type) {var _s17 = Gn(t.coordinates, i, r),_o14 = Xn(e.geometry(), n, i, r);if (!Rn(n, i)) return !1;var _iterator18 = _createForOfIteratorHelper(_o14),_step18;try {for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {var _e22 = _step18.value;if (!Ln(_e22, _s17)) return !1;}} catch (err) {_iterator18.e(err);} finally {_iterator18.f();}}if (\"MultiPolygon\" === t.type) {var _s18 = jn(t.coordinates, i, r),_o15 = Xn(e.geometry(), n, i, r);if (!Rn(n, i)) return !1;var _iterator19 = _createForOfIteratorHelper(_o15),_step19;try {for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {var _e23 = _step19.value;if (!Hn(_e23, _s18)) return !1;}} catch (err) {_iterator19.e(err);} finally {_iterator19.f();}}return !0;}(e, this.geometries);if (\"LineString\" === e.geometryType()) return function (e, t) {var n = [1 / 0, 1 / 0, -1 / 0, -1 / 0],i = [1 / 0, 1 / 0, -1 / 0, -1 / 0],r = e.canonicalID();if (!r) return !1;if (\"Polygon\" === t.type) {var _s19 = Gn(t.coordinates, i, r),_o16 = Yn(e.geometry(), n, i, r);if (!Rn(n, i)) return !1;var _iterator20 = _createForOfIteratorHelper(_o16),_step20;try {for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {var _e24 = _step20.value;if (!Un(_e24, _s19)) return !1;}} catch (err) {_iterator20.e(err);} finally {_iterator20.f();}}if (\"MultiPolygon\" === t.type) {var _s20 = jn(t.coordinates, i, r),_o17 = Yn(e.geometry(), n, i, r);if (!Rn(n, i)) return !1;var _iterator21 = _createForOfIteratorHelper(_o17),_step21;try {for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {var _e25 = _step21.value;if (!Bn(_e25, _s20)) return !1;}} catch (err) {_iterator21.e(err);} finally {_iterator21.f();}}return !0;}(e, this.geometries);}return !1;} }, { key: \"eachChild\", value: function eachChild() {} }, { key: \"outputDefined\", value: function outputDefined() {return !0;} }, { key: \"serialize\", value: function serialize() {return [\"within\", this.geojson];} }], [{ key: \"parse\", value: function parse(e, t) {if (2 !== e.length) return t.error(\"'within' expression requires exactly one argument, but found \".concat(e.length - 1, \" instead.\"));if (fn(e[1])) {var _t40 = e[1];if (\"FeatureCollection\" === _t40.type) for (var _e26 = 0; _e26 < _t40.features.length; ++_e26) {var _n43 = _t40.features[_e26].geometry.type;if (\"Polygon\" === _n43 || \"MultiPolygon\" === _n43) return new Zn(_t40, _t40.features[_e26].geometry);} else if (\"Feature\" === _t40.type) {var _e27 = _t40.geometry.type;if (\"Polygon\" === _e27 || \"MultiPolygon\" === _e27) return new Zn(_t40, _t40.geometry);} else if (\"Polygon\" === _t40.type || \"MultiPolygon\" === _t40.type) return new Zn(_t40, _t40);}return t.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\");} }]);}();var qn = Zn;function $n(e) {if (e instanceof Cn) {if (\"get\" === e.name && 1 === e.args.length) return !1;if (\"feature-state\" === e.name) return !1;if (\"has\" === e.name && 1 === e.args.length) return !1;if (\"properties\" === e.name || \"geometry-type\" === e.name || \"id\" === e.name) return !1;if (/^filter-/.test(e.name)) return !1;}if (e instanceof qn) return !1;var t = !0;return e.eachChild(function (e) {t && !$n(e) && (t = !1);}), t;}function Jn(e) {if (e instanceof Cn && \"feature-state\" === e.name) return !1;var t = !0;return e.eachChild(function (e) {t && !Jn(e) && (t = !1);}), t;}function Kn(e, t) {if (e instanceof Cn && t.indexOf(e.name) >= 0) return !1;var n = !0;return e.eachChild(function (e) {n && !Kn(e, t) && (n = !1);}), n;}var Qn = function () {function Qn(e, t) {_classCallCheck(this, Qn);this.type = t.type, this.name = e, this.boundExpression = t;}return _createClass(Qn, [{ key: \"evaluate\", value: function evaluate(e) {return this.boundExpression.evaluate(e);} }, { key: \"eachChild\", value: function eachChild() {} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {return [\"var\", this.name];} }], [{ key: \"parse\", value: function parse(e, t) {if (2 !== e.length || \"string\" != typeof e[1]) return t.error(\"'var' expression requires exactly one string literal argument.\");var n = e[1];return t.scope.has(n) ? new Qn(n, t.scope.get(n)) : t.error(\"Unknown variable \\\"\".concat(n, \"\\\". Make sure \\\"\").concat(n, \"\\\" has been bound in an enclosing \\\"let\\\" expression before using it.\"), 1);} }]);}();var ei = Qn;var ti = function () {function ti(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];var n = arguments.length > 2 ? arguments[2] : undefined;var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new Et();var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];_classCallCheck(this, ti);this.registry = e, this.path = t, this.key = t.map(function (e) {return \"[\".concat(e, \"]\");}).join(\"\"), this.scope = i, this.errors = r, this.expectedType = n;}return _createClass(ti, [{ key: \"parse\", value: function parse(e, t, n, i) {var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};return t ? this.concat(t, n, i)._parse(e, r) : this._parse(e, r);} }, { key: \"_parse\", value: function _parse(e, t) {function n(e, t, n) {return \"assert\" === n ? new vn(t, [e]) : \"coerce\" === n ? new Sn(t, [e]) : e;}if (null !== e && \"string\" != typeof e && \"boolean\" != typeof e && \"number\" != typeof e || (e = [\"literal\", e]), Array.isArray(e)) {if (0 === e.length) return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');var _i29 = e[0];if (\"string\" != typeof _i29) return this.error(\"Expression name must be a string, but found \".concat(_typeof(_i29), \" instead. If you wanted a literal array, use [\\\"literal\\\", [...]].\"), 0), null;var _r19 = this.registry[_i29];if (_r19) {var _i30 = _r19.parse(e, this);if (!_i30) return null;if (this.expectedType) {var _e28 = this.expectedType,_r20 = _i30.type;if (\"string\" !== _e28.kind && \"number\" !== _e28.kind && \"boolean\" !== _e28.kind && \"object\" !== _e28.kind && \"array\" !== _e28.kind || \"value\" !== _r20.kind) {if (\"color\" !== _e28.kind && \"formatted\" !== _e28.kind && \"resolvedImage\" !== _e28.kind || \"value\" !== _r20.kind && \"string\" !== _r20.kind) {if (this.checkSubtype(_e28, _r20)) return null;} else _i30 = n(_i30, _e28, t.typeAnnotation || \"coerce\");} else _i30 = n(_i30, _e28, t.typeAnnotation || \"assert\");}if (!(_i30 instanceof mn) && \"resolvedImage\" !== _i30.type.kind && ii(_i30)) {var _t41 = new Pn();try {_i30 = new mn(_i30.type, _i30.evaluate(_t41));} catch (e) {return this.error(e.message), null;}}return _i30;}return this.error(\"Unknown expression \\\"\".concat(_i29, \"\\\". If you wanted a literal array, use [\\\"literal\\\", [...]].\"), 0);}return void 0 === e ? this.error(\"'undefined' value invalid. Use null instead.\") : \"object\" == _typeof(e) ? this.error('Bare objects invalid. Use [\"literal\", {...}] instead.') : this.error(\"Expected an array, but found \".concat(_typeof(e), \" instead.\"));} }, { key: \"concat\", value: function concat(e, t, n) {var i = \"number\" == typeof e ? this.path.concat(e) : this.path,r = n ? this.scope.concat(n) : this.scope;return new ti(this.registry, i, t || null, r, this.errors);} }, { key: \"error\", value: function error(e) {for (var _len2 = arguments.length, t = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {t[_key2 - 1] = arguments[_key2];}var n = \"\".concat(this.key).concat(t.map(function (e) {return \"[\".concat(e, \"]\");}).join(\"\"));this.errors.push(new Ot(n, e));} }, { key: \"checkSubtype\", value: function checkSubtype(e, t) {var n = Zt(e, t);return n && this.error(n), n;} }]);}();var ni = ti;function ii(e) {if (e instanceof ei) return ii(e.boundExpression);if (e instanceof Cn && \"error\" === e.name) return !1;if (e instanceof kn) return !1;if (e instanceof qn) return !1;var t = e instanceof Sn || e instanceof vn;var n = !0;return e.eachChild(function (e) {n = t ? n && ii(e) : n && e instanceof mn;}), !!n && $n(e) && Kn(e, [\"zoom\", \"heatmap-density\", \"line-progress\", \"sky-radial-progress\", \"accumulated\", \"is-supported-script\", \"pitch\", \"distance-from-center\"]);}function ri(e, t) {var n = e.length - 1;var i,r,s = 0,o = n,a = 0;for (; s <= o;) if (a = Math.floor((s + o) / 2), i = e[a], r = e[a + 1], i <= t) {if (a === n || t < r) return a;s = a + 1;} else {if (!(i > t)) throw new yn(\"Input is not a number.\");o = a - 1;}return 0;}var si = function () {function si(e, t, n) {_classCallCheck(this, si);this.type = e, this.input = t, this.labels = [], this.outputs = [];var _iterator22 = _createForOfIteratorHelper(n),_step22;try {for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {var _step22$value = _slicedToArray(_step22.value, 2),_e29 = _step22$value[0],_t42 = _step22$value[1];this.labels.push(_e29), this.outputs.push(_t42);}} catch (err) {_iterator22.e(err);} finally {_iterator22.f();}}return _createClass(si, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.labels,n = this.outputs;if (1 === t.length) return n[0].evaluate(e);var i = this.input.evaluate(e);if (i <= t[0]) return n[0].evaluate(e);var r = t.length;return i >= t[r - 1] ? n[r - 1].evaluate(e) : n[ri(t, i)].evaluate(e);} }, { key: \"eachChild\", value: function eachChild(e) {e(this.input);var _iterator23 = _createForOfIteratorHelper(this.outputs),_step23;try {for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {var _t43 = _step23.value;e(_t43);}} catch (err) {_iterator23.e(err);} finally {_iterator23.f();}} }, { key: \"outputDefined\", value: function outputDefined() {return this.outputs.every(function (e) {return e.outputDefined();});} }, { key: \"serialize\", value: function serialize() {var e = [\"step\", this.input.serialize()];for (var _t44 = 0; _t44 < this.labels.length; _t44++) _t44 > 0 && e.push(this.labels[_t44]), e.push(this.outputs[_t44].serialize());return e;} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length - 1 < 4) return t.error(\"Expected at least 4 arguments, but found only \".concat(e.length - 1, \".\"));if ((e.length - 1) % 2 != 0) return t.error(\"Expected an even number of arguments.\");var n = t.parse(e[1], 1, Lt);if (!n) return null;var i = [];var r = null;t.expectedType && \"value\" !== t.expectedType.kind && (r = t.expectedType);for (var _n44 = 1; _n44 < e.length; _n44 += 2) {var _s21 = 1 === _n44 ? -1 / 0 : e[_n44],_o18 = e[_n44 + 1],_a6 = _n44,_l4 = _n44 + 1;if (\"number\" != typeof _s21) return t.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', _a6);if (i.length && i[i.length - 1][0] >= _s21) return t.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.', _a6);var _h2 = t.parse(_o18, _l4, r);if (!_h2) return null;r = r || _h2.type, i.push([_s21, _h2]);}return new si(r, n, i);} }]);}();var oi = si,ai = li;function li(e, t, n, i) {this.cx = 3 * e, this.bx = 3 * (n - e) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * t, this.by = 3 * (i - t) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = e, this.p1y = t, this.p2x = n, this.p2y = i;}function hi(e, t, n) {return e * (1 - n) + t * n;}li.prototype = { sampleCurveX: function sampleCurveX(e) {return ((this.ax * e + this.bx) * e + this.cx) * e;}, sampleCurveY: function sampleCurveY(e) {return ((this.ay * e + this.by) * e + this.cy) * e;}, sampleCurveDerivativeX: function sampleCurveDerivativeX(e) {return (3 * this.ax * e + 2 * this.bx) * e + this.cx;}, solveCurveX: function solveCurveX(e, t) {if (void 0 === t && (t = 1e-6), e < 0) return 0;if (e > 1) return 1;for (var n = e, i = 0; i < 8; i++) {var r = this.sampleCurveX(n) - e;if (Math.abs(r) < t) return n;var s = this.sampleCurveDerivativeX(n);if (Math.abs(s) < 1e-6) break;n -= r / s;}var o = 0,a = 1;for (n = e, i = 0; i < 20 && (r = this.sampleCurveX(n), !(Math.abs(r - e) < t)); i++) e > r ? o = n : a = n, n = .5 * (a - o) + o;return n;}, solve: function solve(e, t) {return this.sampleCurveY(this.solveCurveX(e, t));} };var ci = Object.freeze({ __proto__: null, number: hi, color: function color(e, t, n) {return new on(hi(e.r, t.r, n), hi(e.g, t.g, n), hi(e.b, t.b, n), hi(e.a, t.a, n));}, array: function array(e, t, n) {return e.map(function (e, i) {return hi(e, t[i], n);});} });var ui = .95047,fi = 1.08883,di = 4 / 29,pi = 6 / 29,gi = 3 * pi * pi,mi = pi * pi * pi,yi = Math.PI / 180,xi = 180 / Math.PI;function _i(e) {return e > mi ? Math.pow(e, 1 / 3) : e / gi + di;}function vi(e) {return e > pi ? e * e * e : gi * (e - di);}function bi(e) {return 255 * (e <= .0031308 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - .055);}function Ai(e) {return (e /= 255) <= .04045 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4);}function Ti(e) {var t = Ai(e.r),n = Ai(e.g),i = Ai(e.b),r = _i((.4124564 * t + .3575761 * n + .1804375 * i) / ui),s = _i((.2126729 * t + .7151522 * n + .072175 * i) / 1);return { l: 116 * s - 16, a: 500 * (r - s), b: 200 * (s - _i((.0193339 * t + .119192 * n + .9503041 * i) / fi)), alpha: e.a };}function wi(e) {var t = (e.l + 16) / 116,n = isNaN(e.a) ? t : t + e.a / 500,i = isNaN(e.b) ? t : t - e.b / 200;return t = 1 * vi(t), n = ui * vi(n), i = fi * vi(i), new on(bi(3.2404542 * n - 1.5371385 * t - .4985314 * i), bi(-.969266 * n + 1.8760108 * t + .041556 * i), bi(.0556434 * n - .2040259 * t + 1.0572252 * i), e.alpha);}function Si(e, t, n) {var i = t - e;return e + n * (i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i);}var Mi = { forward: Ti, reverse: wi, interpolate: function interpolate(e, t, n) {return { l: hi(e.l, t.l, n), a: hi(e.a, t.a, n), b: hi(e.b, t.b, n), alpha: hi(e.alpha, t.alpha, n) };} },Pi = { forward: function forward(e) {var _Ti = Ti(e),t = _Ti.l,n = _Ti.a,i = _Ti.b,r = Math.atan2(i, n) * xi;return { h: r < 0 ? r + 360 : r, c: Math.sqrt(n * n + i * i), l: t, alpha: e.a };}, reverse: function reverse(e) {var t = e.h * yi,n = e.c;return wi({ l: e.l, a: Math.cos(t) * n, b: Math.sin(t) * n, alpha: e.alpha });}, interpolate: function interpolate(e, t, n) {return { h: Si(e.h, t.h, n), c: hi(e.c, t.c, n), l: hi(e.l, t.l, n), alpha: hi(e.alpha, t.alpha, n) };} };var Ii = Object.freeze({ __proto__: null, lab: Mi, hcl: Pi });var Ci = function () {function Ci(e, t, n, i, r) {_classCallCheck(this, Ci);this.type = e, this.operator = t, this.interpolation = n, this.input = i, this.labels = [], this.outputs = [];var _iterator24 = _createForOfIteratorHelper(r),_step24;try {for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {var _step24$value = _slicedToArray(_step24.value, 2),_e30 = _step24$value[0],_t45 = _step24$value[1];this.labels.push(_e30), this.outputs.push(_t45);}} catch (err) {_iterator24.e(err);} finally {_iterator24.f();}}return _createClass(Ci, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.labels,n = this.outputs;if (1 === t.length) return n[0].evaluate(e);var i = this.input.evaluate(e);if (i <= t[0]) return n[0].evaluate(e);var r = t.length;if (i >= t[r - 1]) return n[r - 1].evaluate(e);var s = ri(t, i),o = t[s],a = t[s + 1],l = Ci.interpolationFactor(this.interpolation, i, o, a),h = n[s].evaluate(e),c = n[s + 1].evaluate(e);return \"interpolate\" === this.operator ? ci[this.type.kind.toLowerCase()](h, c, l) : \"interpolate-hcl\" === this.operator ? Pi.reverse(Pi.interpolate(Pi.forward(h), Pi.forward(c), l)) : Mi.reverse(Mi.interpolate(Mi.forward(h), Mi.forward(c), l));} }, { key: \"eachChild\", value: function eachChild(e) {e(this.input);var _iterator25 = _createForOfIteratorHelper(this.outputs),_step25;try {for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {var _t46 = _step25.value;e(_t46);}} catch (err) {_iterator25.e(err);} finally {_iterator25.f();}} }, { key: \"outputDefined\", value: function outputDefined() {return this.outputs.every(function (e) {return e.outputDefined();});} }, { key: \"serialize\", value: function serialize() {var e;e = \"linear\" === this.interpolation.name ? [\"linear\"] : \"exponential\" === this.interpolation.name ? 1 === this.interpolation.base ? [\"linear\"] : [\"exponential\", this.interpolation.base] : [\"cubic-bezier\"].concat(this.interpolation.controlPoints);var t = [this.operator, e, this.input.serialize()];for (var _e31 = 0; _e31 < this.labels.length; _e31++) t.push(this.labels[_e31], this.outputs[_e31].serialize());return t;} }], [{ key: \"interpolationFactor\", value: function interpolationFactor(e, t, n, i) {var r = 0;if (\"exponential\" === e.name) r = ki(t, e.base, n, i);else if (\"linear\" === e.name) r = ki(t, 1, n, i);else if (\"cubic-bezier\" === e.name) {var _s22 = e.controlPoints;r = new ai(_s22[0], _s22[1], _s22[2], _s22[3]).solve(ki(t, 1, n, i));}return r;} }, { key: \"parse\", value: function parse(e, t) {var _e32 = _toArray(e),n = _e32[0],i = _e32[1],r = _e32[2],s = _e32.slice(3);if (!Array.isArray(i) || 0 === i.length) return t.error(\"Expected an interpolation type expression.\", 1);if (\"linear\" === i[0]) i = { name: \"linear\" };else if (\"exponential\" === i[0]) {var _e33 = i[1];if (\"number\" != typeof _e33) return t.error(\"Exponential interpolation requires a numeric base.\", 1, 1);i = { name: \"exponential\", base: _e33 };} else {if (\"cubic-bezier\" !== i[0]) return t.error(\"Unknown interpolation type \".concat(String(i[0])), 1, 0);{var _e34 = i.slice(1);if (4 !== _e34.length || _e34.some(function (e) {return \"number\" != typeof e || e < 0 || e > 1;})) return t.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\", 1);i = { name: \"cubic-bezier\", controlPoints: _e34 };}}if (e.length - 1 < 4) return t.error(\"Expected at least 4 arguments, but found only \".concat(e.length - 1, \".\"));if ((e.length - 1) % 2 != 0) return t.error(\"Expected an even number of arguments.\");if (r = t.parse(r, 2, Lt), !r) return null;var o = [];var a = null;\"interpolate-hcl\" === n || \"interpolate-lab\" === n ? a = zt : t.expectedType && \"value\" !== t.expectedType.kind && (a = t.expectedType);for (var _e35 = 0; _e35 < s.length; _e35 += 2) {var _n45 = s[_e35],_i31 = s[_e35 + 1],_r21 = _e35 + 3,_l5 = _e35 + 4;if (\"number\" != typeof _n45) return t.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', _r21);if (o.length && o[o.length - 1][0] >= _n45) return t.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.', _r21);var _h3 = t.parse(_i31, _l5, a);if (!_h3) return null;a = a || _h3.type, o.push([_n45, _h3]);}return \"number\" === a.kind || \"color\" === a.kind || \"array\" === a.kind && \"number\" === a.itemType.kind && \"number\" == typeof a.N ? new Ci(a, n, i, r, o) : t.error(\"Type \".concat(Xt(a), \" is not interpolatable.\"));} }]);}();function ki(e, t, n, i) {var r = i - n,s = e - n;return 0 === r ? 0 : 1 === t ? s / r : (Math.pow(t, s) - 1) / (Math.pow(t, r) - 1);}var Fi = Ci;var Oi = function () {function Oi(e, t) {_classCallCheck(this, Oi);this.type = e, this.args = t;}return _createClass(Oi, [{ key: \"evaluate\", value: function evaluate(e) {var t,n = null,i = 0;var _iterator26 = _createForOfIteratorHelper(this.args),_step26;try {for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {var _r22 = _step26.value;if (i++, n = _r22.evaluate(e), n && n instanceof cn && !n.available && (t || (t = n), n = null, i === this.args.length)) return t;if (null !== n) break;}} catch (err) {_iterator26.e(err);} finally {_iterator26.f();}return n;} }, { key: \"eachChild\", value: function eachChild(e) {this.args.forEach(e);} }, { key: \"outputDefined\", value: function outputDefined() {return this.args.every(function (e) {return e.outputDefined();});} }, { key: \"serialize\", value: function serialize() {var e = [\"coalesce\"];return this.eachChild(function (t) {e.push(t.serialize());}), e;} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length < 2) return t.error(\"Expectected at least one argument.\");var n = null;var i = t.expectedType;i && \"value\" !== i.kind && (n = i);var r = [];var _iterator27 = _createForOfIteratorHelper(e.slice(1)),_step27;try {for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {var _i32 = _step27.value;var _e36 = t.parse(_i32, 1 + r.length, n, void 0, { typeAnnotation: \"omit\" });if (!_e36) return null;n = n || _e36.type, r.push(_e36);}} catch (err) {_iterator27.e(err);} finally {_iterator27.f();}var s = i && r.some(function (e) {return Zt(i, e.type);});return new Oi(s ? Ut : n, r);} }]);}();var Ri = Oi;var Ei = function () {function Ei(e, t) {_classCallCheck(this, Ei);this.type = t.type, this.bindings = [].concat(e), this.result = t;}return _createClass(Ei, [{ key: \"evaluate\", value: function evaluate(e) {return this.result.evaluate(e);} }, { key: \"eachChild\", value: function eachChild(e) {var _iterator28 = _createForOfIteratorHelper(this.bindings),_step28;try {for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {var _t47 = _step28.value;e(_t47[1]);}} catch (err) {_iterator28.e(err);} finally {_iterator28.f();}e(this.result);} }, { key: \"outputDefined\", value: function outputDefined() {return this.result.outputDefined();} }, { key: \"serialize\", value: function serialize() {var e = [\"let\"];var _iterator29 = _createForOfIteratorHelper(this.bindings),_step29;try {for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {var _step29$value = _slicedToArray(_step29.value, 2),_t48 = _step29$value[0],_n46 = _step29$value[1];e.push(_t48, _n46.serialize());}} catch (err) {_iterator29.e(err);} finally {_iterator29.f();}return e.push(this.result.serialize()), e;} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length < 4) return t.error(\"Expected at least 3 arguments, but found \".concat(e.length - 1, \" instead.\"));var n = [];for (var _i33 = 1; _i33 < e.length - 1; _i33 += 2) {var _r23 = e[_i33];if (\"string\" != typeof _r23) return t.error(\"Expected string, but found \".concat(_typeof(_r23), \" instead.\"), _i33);if (/[^a-zA-Z0-9_]/.test(_r23)) return t.error(\"Variable names must contain only alphanumeric characters or '_'.\", _i33);var _s23 = t.parse(e[_i33 + 1], _i33 + 1);if (!_s23) return null;n.push([_r23, _s23]);}var i = t.parse(e[e.length - 1], e.length - 1, t.expectedType, n);return i ? new Ei(n, i) : null;} }]);}();var Di = Ei;var Li = function () {function Li(e, t, n) {_classCallCheck(this, Li);this.type = e, this.index = t, this.input = n;}return _createClass(Li, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.index.evaluate(e),n = this.input.evaluate(e);if (t < 0) throw new yn(\"Array index out of bounds: \".concat(t, \" < 0.\"));if (t >= n.length) throw new yn(\"Array index out of bounds: \".concat(t, \" > \").concat(n.length - 1, \".\"));if (t !== Math.floor(t)) throw new yn(\"Array index must be an integer, but found \".concat(t, \" instead.\"));return n[t];} }, { key: \"eachChild\", value: function eachChild(e) {e(this.index), e(this.input);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {return [\"at\", this.index.serialize(), this.input.serialize()];} }], [{ key: \"parse\", value: function parse(e, t) {if (3 !== e.length) return t.error(\"Expected 2 arguments, but found \".concat(e.length - 1, \" instead.\"));var n = t.parse(e[1], 1, Lt),i = t.parse(e[2], 2, Wt(t.expectedType || Ut));if (!n || !i) return null;var r = i.type;return new Li(r.itemType, n, i);} }]);}();var Hi = Li;var Ni = function () {function Ni(e, t) {_classCallCheck(this, Ni);this.type = Nt, this.needle = e, this.haystack = t;}return _createClass(Ni, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.needle.evaluate(e),n = this.haystack.evaluate(e);if (null == n) return !1;if (!$t(t, [\"boolean\", \"string\", \"number\", \"null\"])) throw new yn(\"Expected first argument to be of type boolean, string, number or null, but found \".concat(Xt(dn(t)), \" instead.\"));if (!$t(n, [\"string\", \"array\"])) throw new yn(\"Expected second argument to be of type array or string, but found \".concat(Xt(dn(n)), \" instead.\"));return n.indexOf(t) >= 0;} }, { key: \"eachChild\", value: function eachChild(e) {e(this.needle), e(this.haystack);} }, { key: \"outputDefined\", value: function outputDefined() {return !0;} }, { key: \"serialize\", value: function serialize() {return [\"in\", this.needle.serialize(), this.haystack.serialize()];} }], [{ key: \"parse\", value: function parse(e, t) {if (3 !== e.length) return t.error(\"Expected 2 arguments, but found \".concat(e.length - 1, \" instead.\"));var n = t.parse(e[1], 1, Ut),i = t.parse(e[2], 2, Ut);return n && i ? qt(n.type, [Nt, Ht, Lt, Dt, Ut]) ? new Ni(n, i) : t.error(\"Expected first argument to be of type boolean, string, number or null, but found \".concat(Xt(n.type), \" instead\")) : null;} }]);}();var zi = Ni;var Vi = function () {function Vi(e, t, n) {_classCallCheck(this, Vi);this.type = Lt, this.needle = e, this.haystack = t, this.fromIndex = n;}return _createClass(Vi, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.needle.evaluate(e),n = this.haystack.evaluate(e);if (!$t(t, [\"boolean\", \"string\", \"number\", \"null\"])) throw new yn(\"Expected first argument to be of type boolean, string, number or null, but found \".concat(Xt(dn(t)), \" instead.\"));if (!$t(n, [\"string\", \"array\"])) throw new yn(\"Expected second argument to be of type array or string, but found \".concat(Xt(dn(n)), \" instead.\"));if (this.fromIndex) {var _i34 = this.fromIndex.evaluate(e);return n.indexOf(t, _i34);}return n.indexOf(t);} }, { key: \"eachChild\", value: function eachChild(e) {e(this.needle), e(this.haystack), this.fromIndex && e(this.fromIndex);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {if (null != this.fromIndex && void 0 !== this.fromIndex) {var _e37 = this.fromIndex.serialize();return [\"index-of\", this.needle.serialize(), this.haystack.serialize(), _e37];}return [\"index-of\", this.needle.serialize(), this.haystack.serialize()];} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length <= 2 || e.length >= 5) return t.error(\"Expected 3 or 4 arguments, but found \".concat(e.length - 1, \" instead.\"));var n = t.parse(e[1], 1, Ut),i = t.parse(e[2], 2, Ut);if (!n || !i) return null;if (!qt(n.type, [Nt, Ht, Lt, Dt, Ut])) return t.error(\"Expected first argument to be of type boolean, string, number or null, but found \".concat(Xt(n.type), \" instead\"));if (4 === e.length) {var _r24 = t.parse(e[3], 3, Lt);return _r24 ? new Vi(n, i, _r24) : null;}return new Vi(n, i);} }]);}();var Ui = Vi;var Bi = function () {function Bi(e, t, n, i, r, s) {_classCallCheck(this, Bi);this.inputType = e, this.type = t, this.input = n, this.cases = i, this.outputs = r, this.otherwise = s;}return _createClass(Bi, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.input.evaluate(e);return (dn(t) === this.inputType && this.outputs[this.cases[t]] || this.otherwise).evaluate(e);} }, { key: \"eachChild\", value: function eachChild(e) {e(this.input), this.outputs.forEach(e), e(this.otherwise);} }, { key: \"outputDefined\", value: function outputDefined() {return this.outputs.every(function (e) {return e.outputDefined();}) && this.otherwise.outputDefined();} }, { key: \"serialize\", value: function serialize() {var _this2 = this;var e = [\"match\", this.input.serialize()],t = Object.keys(this.cases).sort(),n = [],i = {};var _iterator30 = _createForOfIteratorHelper(t),_step30;try {for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {var _e38 = _step30.value;var _t50 = i[this.cases[_e38]];void 0 === _t50 ? (i[this.cases[_e38]] = n.length, n.push([this.cases[_e38], [_e38]])) : n[_t50][1].push(_e38);}} catch (err) {_iterator30.e(err);} finally {_iterator30.f();}var r = function r(e) {return \"number\" === _this2.inputType.kind ? Number(e) : e;};for (var _i35 = 0, _n47 = n; _i35 < _n47.length; _i35++) {var _n47$_i = _slicedToArray(_n47[_i35], 2),_t49 = _n47$_i[0],_i36 = _n47$_i[1];1 === _i36.length ? e.push(r(_i36[0])) : e.push(_i36.map(r)), e.push(this.outputs[_t49].serialize());}return e.push(this.otherwise.serialize()), e;} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length < 5) return t.error(\"Expected at least 4 arguments, but found only \".concat(e.length - 1, \".\"));if (e.length % 2 != 1) return t.error(\"Expected an even number of arguments.\");var n, i;t.expectedType && \"value\" !== t.expectedType.kind && (i = t.expectedType);var r = {},s = [];for (var _o19 = 2; _o19 < e.length - 1; _o19 += 2) {var _a7 = e[_o19];var _l6 = e[_o19 + 1];Array.isArray(_a7) || (_a7 = [_a7]);var _h4 = t.concat(_o19);if (0 === _a7.length) return _h4.error(\"Expected at least one branch label.\");var _iterator31 = _createForOfIteratorHelper(_a7),_step31;try {for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {var _e39 = _step31.value;if (\"number\" != typeof _e39 && \"string\" != typeof _e39) return _h4.error(\"Branch labels must be numbers or strings.\");if (\"number\" == typeof _e39 && Math.abs(_e39) > Number.MAX_SAFE_INTEGER) return _h4.error(\"Branch labels must be integers no larger than \".concat(Number.MAX_SAFE_INTEGER, \".\"));if (\"number\" == typeof _e39 && Math.floor(_e39) !== _e39) return _h4.error(\"Numeric branch labels must be integer values.\");if (n) {if (_h4.checkSubtype(n, dn(_e39))) return null;} else n = dn(_e39);if (void 0 !== r[String(_e39)]) return _h4.error(\"Branch labels must be unique.\");r[String(_e39)] = s.length;}} catch (err) {_iterator31.e(err);} finally {_iterator31.f();}var _c2 = t.parse(_l6, _o19, i);if (!_c2) return null;i = i || _c2.type, s.push(_c2);}var o = t.parse(e[1], 1, Ut);if (!o) return null;var a = t.parse(e[e.length - 1], e.length - 1, i);return a ? \"value\" !== o.type.kind && t.concat(1).checkSubtype(n, o.type) ? null : new Bi(n, i, o, r, s, a) : null;} }]);}();var Gi = Bi;var ji = function () {function ji(e, t, n) {_classCallCheck(this, ji);this.type = e, this.branches = t, this.otherwise = n;}return _createClass(ji, [{ key: \"evaluate\", value: function evaluate(e) {var _iterator32 = _createForOfIteratorHelper(this.branches),_step32;try {for (_iterator32.s(); !(_step32 = _iterator32.n()).done;) {var _step32$value = _slicedToArray(_step32.value, 2),_t51 = _step32$value[0],_n48 = _step32$value[1];if (_t51.evaluate(e)) return _n48.evaluate(e);}} catch (err) {_iterator32.e(err);} finally {_iterator32.f();}return this.otherwise.evaluate(e);} }, { key: \"eachChild\", value: function eachChild(e) {var _iterator33 = _createForOfIteratorHelper(this.branches),_step33;try {for (_iterator33.s(); !(_step33 = _iterator33.n()).done;) {var _step33$value = _slicedToArray(_step33.value, 2),_t52 = _step33$value[0],_n49 = _step33$value[1];e(_t52), e(_n49);}} catch (err) {_iterator33.e(err);} finally {_iterator33.f();}e(this.otherwise);} }, { key: \"outputDefined\", value: function outputDefined() {return this.branches.every(function (_ref8) {var _ref9 = _slicedToArray(_ref8, 2),e = _ref9[0],t = _ref9[1];return t.outputDefined();}) && this.otherwise.outputDefined();} }, { key: \"serialize\", value: function serialize() {var e = [\"case\"];return this.eachChild(function (t) {e.push(t.serialize());}), e;} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length < 4) return t.error(\"Expected at least 3 arguments, but found only \".concat(e.length - 1, \".\"));if (e.length % 2 != 0) return t.error(\"Expected an odd number of arguments.\");var n;t.expectedType && \"value\" !== t.expectedType.kind && (n = t.expectedType);var i = [];for (var _r25 = 1; _r25 < e.length - 1; _r25 += 2) {var _s24 = t.parse(e[_r25], _r25, Nt);if (!_s24) return null;var _o20 = t.parse(e[_r25 + 1], _r25 + 1, n);if (!_o20) return null;i.push([_s24, _o20]), n = n || _o20.type;}var r = t.parse(e[e.length - 1], e.length - 1, n);return r ? new ji(n, i, r) : null;} }]);}();var Wi = ji;var Xi = function () {function Xi(e, t, n, i) {_classCallCheck(this, Xi);this.type = e, this.input = t, this.beginIndex = n, this.endIndex = i;}return _createClass(Xi, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.input.evaluate(e),n = this.beginIndex.evaluate(e);if (!$t(t, [\"string\", \"array\"])) throw new yn(\"Expected first argument to be of type array or string, but found \".concat(Xt(dn(t)), \" instead.\"));if (this.endIndex) {var _i37 = this.endIndex.evaluate(e);return t.slice(n, _i37);}return t.slice(n);} }, { key: \"eachChild\", value: function eachChild(e) {e(this.input), e(this.beginIndex), this.endIndex && e(this.endIndex);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {if (null != this.endIndex && void 0 !== this.endIndex) {var _e40 = this.endIndex.serialize();return [\"slice\", this.input.serialize(), this.beginIndex.serialize(), _e40];}return [\"slice\", this.input.serialize(), this.beginIndex.serialize()];} }], [{ key: \"parse\", value: function parse(e, t) {if (e.length <= 2 || e.length >= 5) return t.error(\"Expected 3 or 4 arguments, but found \".concat(e.length - 1, \" instead.\"));var n = t.parse(e[1], 1, Ut),i = t.parse(e[2], 2, Lt);if (!n || !i) return null;if (!qt(n.type, [Wt(Ut), Ht, Ut])) return t.error(\"Expected first argument to be of type array or string, but found \".concat(Xt(n.type), \" instead\"));if (4 === e.length) {var _r26 = t.parse(e[3], 3, Lt);return _r26 ? new Xi(n.type, n, i, _r26) : null;}return new Xi(n.type, n, i);} }]);}();var Yi = Xi;function Zi(e, t) {return \"==\" === e || \"!=\" === e ? \"boolean\" === t.kind || \"string\" === t.kind || \"number\" === t.kind || \"null\" === t.kind || \"value\" === t.kind : \"string\" === t.kind || \"number\" === t.kind || \"value\" === t.kind;}function qi(e, t, n, i) {return 0 === i.compare(t, n);}function $i(e, t, n) {var i = \"==\" !== e && \"!=\" !== e;return function () {function r(e, t, n) {_classCallCheck(this, r);this.type = Nt, this.lhs = e, this.rhs = t, this.collator = n, this.hasUntypedArgument = \"value\" === e.type.kind || \"value\" === t.type.kind;}return _createClass(r, [{ key: \"evaluate\", value: function evaluate(_r27) {var s = this.lhs.evaluate(_r27),o = this.rhs.evaluate(_r27);if (i && this.hasUntypedArgument) {var _t53 = dn(s),_n50 = dn(o);if (_t53.kind !== _n50.kind || \"string\" !== _t53.kind && \"number\" !== _t53.kind) throw new yn(\"Expected arguments for \\\"\".concat(e, \"\\\" to be (string, string) or (number, number), but found (\").concat(_t53.kind, \", \").concat(_n50.kind, \") instead.\"));}if (this.collator && !i && this.hasUntypedArgument) {var _e41 = dn(s),_n51 = dn(o);if (\"string\" !== _e41.kind || \"string\" !== _n51.kind) return t(_r27, s, o);}return this.collator ? n(_r27, s, o, this.collator.evaluate(_r27)) : t(_r27, s, o);} }, { key: \"eachChild\", value: function eachChild(e) {e(this.lhs), e(this.rhs), this.collator && e(this.collator);} }, { key: \"outputDefined\", value: function outputDefined() {return !0;} }, { key: \"serialize\", value: function serialize() {var t = [e];return this.eachChild(function (e) {t.push(e.serialize());}), t;} }], [{ key: \"parse\", value: function parse(e, t) {if (3 !== e.length && 4 !== e.length) return t.error(\"Expected two or three arguments.\");var n = e[0];var s = t.parse(e[1], 1, Ut);if (!s) return null;if (!Zi(n, s.type)) return t.concat(1).error(\"\\\"\".concat(n, \"\\\" comparisons are not supported for type '\").concat(Xt(s.type), \"'.\"));var o = t.parse(e[2], 2, Ut);if (!o) return null;if (!Zi(n, o.type)) return t.concat(2).error(\"\\\"\".concat(n, \"\\\" comparisons are not supported for type '\").concat(Xt(o.type), \"'.\"));if (s.type.kind !== o.type.kind && \"value\" !== s.type.kind && \"value\" !== o.type.kind) return t.error(\"Cannot compare types '\".concat(Xt(s.type), \"' and '\").concat(Xt(o.type), \"'.\"));i && (\"value\" === s.type.kind && \"value\" !== o.type.kind ? s = new vn(o.type, [s]) : \"value\" !== s.type.kind && \"value\" === o.type.kind && (o = new vn(s.type, [o])));var a = null;if (4 === e.length) {if (\"string\" !== s.type.kind && \"string\" !== o.type.kind && \"value\" !== s.type.kind && \"value\" !== o.type.kind) return t.error(\"Cannot use collator to compare non-string types.\");if (a = t.parse(e[3], 3, Bt), !a) return null;}return new r(s, o, a);} }]);}();}var Ji = $i(\"==\", function (e, t, n) {return t === n;}, qi),Ki = $i(\"!=\", function (e, t, n) {return t !== n;}, function (e, t, n, i) {return !qi(0, t, n, i);}),Qi = $i(\"<\", function (e, t, n) {return t < n;}, function (e, t, n, i) {return i.compare(t, n) < 0;}),er = $i(\">\", function (e, t, n) {return t > n;}, function (e, t, n, i) {return i.compare(t, n) > 0;}),tr = $i(\"<=\", function (e, t, n) {return t <= n;}, function (e, t, n, i) {return i.compare(t, n) <= 0;}),nr = $i(\">=\", function (e, t, n) {return t >= n;}, function (e, t, n, i) {return i.compare(t, n) >= 0;});var ir = function () {function ir(e, t, n, i, r, s) {_classCallCheck(this, ir);this.type = Ht, this.number = e, this.locale = t, this.currency = n, this.unit = i, this.minFractionDigits = r, this.maxFractionDigits = s;}return _createClass(ir, [{ key: \"evaluate\", value: function evaluate(e) {return new Intl.NumberFormat(this.locale ? this.locale.evaluate(e) : [], { style: (this.currency ? \"currency\" : this.unit && \"unit\") || \"decimal\", currency: this.currency ? this.currency.evaluate(e) : void 0, unit: this.unit ? this.unit.evaluate(e) : void 0, minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(e) : void 0, maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(e) : void 0 }).format(this.number.evaluate(e));} }, { key: \"eachChild\", value: function eachChild(e) {e(this.number), this.locale && e(this.locale), this.currency && e(this.currency), this.unit && e(this.unit), this.minFractionDigits && e(this.minFractionDigits), this.maxFractionDigits && e(this.maxFractionDigits);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {var e = {};return this.locale && (e.locale = this.locale.serialize()), this.currency && (e.currency = this.currency.serialize()), this.unit && (e.unit = this.unit.serialize()), this.minFractionDigits && (e[\"min-fraction-digits\"] = this.minFractionDigits.serialize()), this.maxFractionDigits && (e[\"max-fraction-digits\"] = this.maxFractionDigits.serialize()), [\"number-format\", this.number.serialize(), e];} }], [{ key: \"parse\", value: function parse(e, t) {if (3 !== e.length) return t.error(\"Expected two arguments.\");var n = t.parse(e[1], 1, Lt);if (!n) return null;var i = e[2];if (\"object\" != _typeof(i) || Array.isArray(i)) return t.error(\"NumberFormat options argument must be an object.\");var r = null;if (i.locale && (r = t.parse(i.locale, 1, Ht), !r)) return null;var s = null;if (i.currency && (s = t.parse(i.currency, 1, Ht), !s)) return null;var o = null;if (i.unit && (o = t.parse(i.unit, 1, Ht), !o)) return null;var a = null;if (i[\"min-fraction-digits\"] && (a = t.parse(i[\"min-fraction-digits\"], 1, Lt), !a)) return null;var l = null;return i[\"max-fraction-digits\"] && (l = t.parse(i[\"max-fraction-digits\"], 1, Lt), !l) ? null : new ir(n, r, s, o, a, l);} }]);}();var rr = function () {function rr(e) {_classCallCheck(this, rr);this.type = Lt, this.input = e;}return _createClass(rr, [{ key: \"evaluate\", value: function evaluate(e) {var t = this.input.evaluate(e);if (\"string\" == typeof t) return t.length;if (Array.isArray(t)) return t.length;throw new yn(\"Expected value to be of type string or array, but found \".concat(Xt(dn(t)), \" instead.\"));} }, { key: \"eachChild\", value: function eachChild(e) {e(this.input);} }, { key: \"outputDefined\", value: function outputDefined() {return !1;} }, { key: \"serialize\", value: function serialize() {var e = [\"length\"];return this.eachChild(function (t) {e.push(t.serialize());}), e;} }], [{ key: \"parse\", value: function parse(e, t) {if (2 !== e.length) return t.error(\"Expected 1 argument, but found \".concat(e.length - 1, \" instead.\"));var n = t.parse(e[1], 1);return n ? \"array\" !== n.type.kind && \"string\" !== n.type.kind && \"value\" !== n.type.kind ? t.error(\"Expected argument of type string or array, but found \".concat(Xt(n.type), \" instead.\")) : new rr(n) : null;} }]);}();var sr = { \"==\": Ji, \"!=\": Ki, \">\": er, \"<\": Qi, \">=\": nr, \"<=\": tr, array: vn, at: Hi, boolean: vn, case: Wi, coalesce: Ri, collator: kn, format: bn, image: An, in: zi, \"index-of\": Ui, interpolate: Fi, \"interpolate-hcl\": Fi, \"interpolate-lab\": Fi, length: rr, let: Di, literal: mn, match: Gi, number: vn, \"number-format\": ir, object: vn, slice: Yi, step: oi, string: vn, \"to-boolean\": Sn, \"to-color\": Sn, \"to-number\": Sn, \"to-string\": Sn, var: ei, within: qn };function or(e, _ref10) {var _ref11 = _slicedToArray(_ref10, 4),t = _ref11[0],n = _ref11[1],i = _ref11[2],r = _ref11[3];t = t.evaluate(e), n = n.evaluate(e), i = i.evaluate(e);var s = r ? r.evaluate(e) : 1,o = un(t, n, i, s);if (o) throw new yn(o);return new on(t / 255 * s, n / 255 * s, i / 255 * s, s);}function ar(e, t) {return e in t;}function lr(e, t) {var n = t[e];return void 0 === n ? null : n;}function hr(e) {return { type: e };}Cn.register(sr, { error: [{ kind: \"error\" }, [Ht], function (e, _ref12) {var _ref13 = _slicedToArray(_ref12, 1),t = _ref13[0];throw new yn(t.evaluate(e));}], typeof: [Ht, [Ut], function (e, _ref14) {var _ref15 = _slicedToArray(_ref14, 1),t = _ref15[0];return Xt(dn(t.evaluate(e)));}], \"to-rgba\": [Wt(Lt, 4), [zt], function (e, _ref16) {var _ref17 = _slicedToArray(_ref16, 1),t = _ref17[0];return t.evaluate(e).toArray();}], rgb: [zt, [Lt, Lt, Lt], or], rgba: [zt, [Lt, Lt, Lt, Lt], or], has: { type: Nt, overloads: [[[Ht], function (e, _ref18) {var _ref19 = _slicedToArray(_ref18, 1),t = _ref19[0];return ar(t.evaluate(e), e.properties());}], [[Ht, Vt], function (e, _ref20) {var _ref21 = _slicedToArray(_ref20, 2),t = _ref21[0],n = _ref21[1];return ar(t.evaluate(e), n.evaluate(e));}]] }, get: { type: Ut, overloads: [[[Ht], function (e, _ref22) {var _ref23 = _slicedToArray(_ref22, 1),t = _ref23[0];return lr(t.evaluate(e), e.properties());}], [[Ht, Vt], function (e, _ref24) {var _ref25 = _slicedToArray(_ref24, 2),t = _ref25[0],n = _ref25[1];return lr(t.evaluate(e), n.evaluate(e));}]] }, \"feature-state\": [Ut, [Ht], function (e, _ref26) {var _ref27 = _slicedToArray(_ref26, 1),t = _ref27[0];return lr(t.evaluate(e), e.featureState || {});}], properties: [Vt, [], function (e) {return e.properties();}], \"geometry-type\": [Ht, [], function (e) {return e.geometryType();}], id: [Ut, [], function (e) {return e.id();}], zoom: [Lt, [], function (e) {return e.globals.zoom;}], pitch: [Lt, [], function (e) {return e.globals.pitch || 0;}], \"distance-from-center\": [Lt, [], function (e) {return e.distanceFromCenter();}], \"heatmap-density\": [Lt, [], function (e) {return e.globals.heatmapDensity || 0;}], \"line-progress\": [Lt, [], function (e) {return e.globals.lineProgress || 0;}], \"sky-radial-progress\": [Lt, [], function (e) {return e.globals.skyRadialProgress || 0;}], accumulated: [Ut, [], function (e) {return void 0 === e.globals.accumulated ? null : e.globals.accumulated;}], \"+\": [Lt, hr(Lt), function (e, t) {var n = 0;var _iterator34 = _createForOfIteratorHelper(t),_step34;try {for (_iterator34.s(); !(_step34 = _iterator34.n()).done;) {var _i38 = _step34.value;n += _i38.evaluate(e);}} catch (err) {_iterator34.e(err);} finally {_iterator34.f();}return n;}], \"*\": [Lt, hr(Lt), function (e, t) {var n = 1;var _iterator35 = _createForOfIteratorHelper(t),_step35;try {for (_iterator35.s(); !(_step35 = _iterator35.n()).done;) {var _i39 = _step35.value;n *= _i39.evaluate(e);}} catch (err) {_iterator35.e(err);} finally {_iterator35.f();}return n;}], \"-\": { type: Lt, overloads: [[[Lt, Lt], function (e, _ref28) {var _ref29 = _slicedToArray(_ref28, 2),t = _ref29[0],n = _ref29[1];return t.evaluate(e) - n.evaluate(e);}], [[Lt], function (e, _ref30) {var _ref31 = _slicedToArray(_ref30, 1),t = _ref31[0];return -t.evaluate(e);}]] }, \"/\": [Lt, [Lt, Lt], function (e, _ref32) {var _ref33 = _slicedToArray(_ref32, 2),t = _ref33[0],n = _ref33[1];return t.evaluate(e) / n.evaluate(e);}], \"%\": [Lt, [Lt, Lt], function (e, _ref34) {var _ref35 = _slicedToArray(_ref34, 2),t = _ref35[0],n = _ref35[1];return t.evaluate(e) % n.evaluate(e);}], ln2: [Lt, [], function () {return Math.LN2;}], pi: [Lt, [], function () {return Math.PI;}], e: [Lt, [], function () {return Math.E;}], \"^\": [Lt, [Lt, Lt], function (e, _ref36) {var _ref37 = _slicedToArray(_ref36, 2),t = _ref37[0],n = _ref37[1];return Math.pow(t.evaluate(e), n.evaluate(e));}], sqrt: [Lt, [Lt], function (e, _ref38) {var _ref39 = _slicedToArray(_ref38, 1),t = _ref39[0];return Math.sqrt(t.evaluate(e));}], log10: [Lt, [Lt], function (e, _ref40) {var _ref41 = _slicedToArray(_ref40, 1),t = _ref41[0];return Math.log(t.evaluate(e)) / Math.LN10;}], ln: [Lt, [Lt], function (e, _ref42) {var _ref43 = _slicedToArray(_ref42, 1),t = _ref43[0];return Math.log(t.evaluate(e));}], log2: [Lt, [Lt], function (e, _ref44) {var _ref45 = _slicedToArray(_ref44, 1),t = _ref45[0];return Math.log(t.evaluate(e)) / Math.LN2;}], sin: [Lt, [Lt], function (e, _ref46) {var _ref47 = _slicedToArray(_ref46, 1),t = _ref47[0];return Math.sin(t.evaluate(e));}], cos: [Lt, [Lt], function (e, _ref48) {var _ref49 = _slicedToArray(_ref48, 1),t = _ref49[0];return Math.cos(t.evaluate(e));}], tan: [Lt, [Lt], function (e, _ref50) {var _ref51 = _slicedToArray(_ref50, 1),t = _ref51[0];return Math.tan(t.evaluate(e));}], asin: [Lt, [Lt], function (e, _ref52) {var _ref53 = _slicedToArray(_ref52, 1),t = _ref53[0];return Math.asin(t.evaluate(e));}], acos: [Lt, [Lt], function (e, _ref54) {var _ref55 = _slicedToArray(_ref54, 1),t = _ref55[0];return Math.acos(t.evaluate(e));}], atan: [Lt, [Lt], function (e, _ref56) {var _ref57 = _slicedToArray(_ref56, 1),t = _ref57[0];return Math.atan(t.evaluate(e));}], min: [Lt, hr(Lt), function (e, t) {return Math.min.apply(Math, _toConsumableArray(t.map(function (t) {return t.evaluate(e);})));}], max: [Lt, hr(Lt), function (e, t) {return Math.max.apply(Math, _toConsumableArray(t.map(function (t) {return t.evaluate(e);})));}], abs: [Lt, [Lt], function (e, _ref58) {var _ref59 = _slicedToArray(_ref58, 1),t = _ref59[0];return Math.abs(t.evaluate(e));}], round: [Lt, [Lt], function (e, _ref60) {var _ref61 = _slicedToArray(_ref60, 1),t = _ref61[0];var n = t.evaluate(e);return n < 0 ? -Math.round(-n) : Math.round(n);}], floor: [Lt, [Lt], function (e, _ref62) {var _ref63 = _slicedToArray(_ref62, 1),t = _ref63[0];return Math.floor(t.evaluate(e));}], ceil: [Lt, [Lt], function (e, _ref64) {var _ref65 = _slicedToArray(_ref64, 1),t = _ref65[0];return Math.ceil(t.evaluate(e));}], \"filter-==\": [Nt, [Ht, Ut], function (e, _ref66) {var _ref67 = _slicedToArray(_ref66, 2),t = _ref67[0],n = _ref67[1];return e.properties()[t.value] === n.value;}], \"filter-id-==\": [Nt, [Ut], function (e, _ref68) {var _ref69 = _slicedToArray(_ref68, 1),t = _ref69[0];return e.id() === t.value;}], \"filter-type-==\": [Nt, [Ht], function (e, _ref70) {var _ref71 = _slicedToArray(_ref70, 1),t = _ref71[0];return e.geometryType() === t.value;}], \"filter-<\": [Nt, [Ht, Ut], function (e, _ref72) {var _ref73 = _slicedToArray(_ref72, 2),t = _ref73[0],n = _ref73[1];var i = e.properties()[t.value],r = n.value;return _typeof(i) == _typeof(r) && i < r;}], \"filter-id-<\": [Nt, [Ut], function (e, _ref74) {var _ref75 = _slicedToArray(_ref74, 1),t = _ref75[0];var n = e.id(),i = t.value;return _typeof(n) == _typeof(i) && n < i;}], \"filter->\": [Nt, [Ht, Ut], function (e, _ref76) {var _ref77 = _slicedToArray(_ref76, 2),t = _ref77[0],n = _ref77[1];var i = e.properties()[t.value],r = n.value;return _typeof(i) == _typeof(r) && i > r;}], \"filter-id->\": [Nt, [Ut], function (e, _ref78) {var _ref79 = _slicedToArray(_ref78, 1),t = _ref79[0];var n = e.id(),i = t.value;return _typeof(n) == _typeof(i) && n > i;}], \"filter-<=\": [Nt, [Ht, Ut], function (e, _ref80) {var _ref81 = _slicedToArray(_ref80, 2),t = _ref81[0],n = _ref81[1];var i = e.properties()[t.value],r = n.value;return _typeof(i) == _typeof(r) && i <= r;}], \"filter-id-<=\": [Nt, [Ut], function (e, _ref82) {var _ref83 = _slicedToArray(_ref82, 1),t = _ref83[0];var n = e.id(),i = t.value;return _typeof(n) == _typeof(i) && n <= i;}], \"filter->=\": [Nt, [Ht, Ut], function (e, _ref84) {var _ref85 = _slicedToArray(_ref84, 2),t = _ref85[0],n = _ref85[1];var i = e.properties()[t.value],r = n.value;return _typeof(i) == _typeof(r) && i >= r;}], \"filter-id->=\": [Nt, [Ut], function (e, _ref86) {var _ref87 = _slicedToArray(_ref86, 1),t = _ref87[0];var n = e.id(),i = t.value;return _typeof(n) == _typeof(i) && n >= i;}], \"filter-has\": [Nt, [Ut], function (e, _ref88) {var _ref89 = _slicedToArray(_ref88, 1),t = _ref89[0];return t.value in e.properties();}], \"filter-has-id\": [Nt, [], function (e) {return null !== e.id() && void 0 !== e.id();}], \"filter-type-in\": [Nt, [Wt(Ht)], function (e, _ref90) {var _ref91 = _slicedToArray(_ref90, 1),t = _ref91[0];return t.value.indexOf(e.geometryType()) >= 0;}], \"filter-id-in\": [Nt, [Wt(Ut)], function (e, _ref92) {var _ref93 = _slicedToArray(_ref92, 1),t = _ref93[0];return t.value.indexOf(e.id()) >= 0;}], \"filter-in-small\": [Nt, [Ht, Wt(Ut)], function (e, _ref94) {var _ref95 = _slicedToArray(_ref94, 2),t = _ref95[0],n = _ref95[1];return n.value.indexOf(e.properties()[t.value]) >= 0;}], \"filter-in-large\": [Nt, [Ht, Wt(Ut)], function (e, _ref96) {var _ref97 = _slicedToArray(_ref96, 2),t = _ref97[0],n = _ref97[1];return function (e, t, n, i) {for (; n <= i;) {var _r28 = n + i >> 1;if (t[_r28] === e) return !0;t[_r28] > e ? i = _r28 - 1 : n = _r28 + 1;}return !1;}(e.properties()[t.value], n.value, 0, n.value.length - 1);}], all: { type: Nt, overloads: [[[Nt, Nt], function (e, _ref98) {var _ref99 = _slicedToArray(_ref98, 2),t = _ref99[0],n = _ref99[1];return t.evaluate(e) && n.evaluate(e);}], [hr(Nt), function (e, t) {var _iterator36 = _createForOfIteratorHelper(t),_step36;try {for (_iterator36.s(); !(_step36 = _iterator36.n()).done;) {var _n52 = _step36.value;if (!_n52.evaluate(e)) return !1;}} catch (err) {_iterator36.e(err);} finally {_iterator36.f();}return !0;}]] }, any: { type: Nt, overloads: [[[Nt, Nt], function (e, _ref100) {var _ref101 = _slicedToArray(_ref100, 2),t = _ref101[0],n = _ref101[1];return t.evaluate(e) || n.evaluate(e);}], [hr(Nt), function (e, t) {var _iterator37 = _createForOfIteratorHelper(t),_step37;try {for (_iterator37.s(); !(_step37 = _iterator37.n()).done;) {var _n53 = _step37.value;if (_n53.evaluate(e)) return !0;}} catch (err) {_iterator37.e(err);} finally {_iterator37.f();}return !1;}]] }, \"!\": [Nt, [Nt], function (e, _ref102) {var _ref103 = _slicedToArray(_ref102, 1),t = _ref103[0];return !t.evaluate(e);}], \"is-supported-script\": [Nt, [Ht], function (e, _ref104) {var _ref105 = _slicedToArray(_ref104, 1),t = _ref105[0];var n = e.globals && e.globals.isSupportedScript;return !n || n(t.evaluate(e));}], upcase: [Ht, [Ht], function (e, _ref106) {var _ref107 = _slicedToArray(_ref106, 1),t = _ref107[0];return t.evaluate(e).toUpperCase();}], downcase: [Ht, [Ht], function (e, _ref108) {var _ref109 = _slicedToArray(_ref108, 1),t = _ref109[0];return t.evaluate(e).toLowerCase();}], concat: [Ht, hr(Ut), function (e, t) {return t.map(function (t) {return pn(t.evaluate(e));}).join(\"\");}], \"resolved-locale\": [Ht, [Bt], function (e, _ref110) {var _ref111 = _slicedToArray(_ref110, 1),t = _ref111[0];return t.evaluate(e).resolvedLocale();}] });var cr = sr;function ur(e) {return { result: \"success\", value: e };}function fr(e) {return { result: \"error\", value: e };}function dr(e) {return !!e.expression && e.expression.interpolated;}function pr(e) {return e instanceof Number ? \"number\" : e instanceof String ? \"string\" : e instanceof Boolean ? \"boolean\" : Array.isArray(e) ? \"array\" : null === e ? \"null\" : _typeof(e);}function gr(e) {return \"object\" == _typeof(e) && null !== e && !Array.isArray(e);}function mr(e) {return e;}function yr(e, t) {var n = \"color\" === t.type,i = e.stops && \"object\" == _typeof(e.stops[0][0]),r = i || void 0 !== e.property,s = i || !r,o = e.type || (dr(t) ? \"exponential\" : \"interval\");if (n && ((e = kt({}, e)).stops && (e.stops = e.stops.map(function (e) {return [e[0], on.parse(e[1])];})), e.default ? e.default = on.parse(e.default) : e.default = on.parse(t.default)), e.colorSpace && \"rgb\" !== e.colorSpace && !Ii[e.colorSpace]) throw new Error(\"Unknown color space: \".concat(e.colorSpace));var a, l, h;if (\"exponential\" === o) a = br;else if (\"interval\" === o) a = vr;else if (\"categorical\" === o) {a = _r, l = Object.create(null);var _iterator38 = _createForOfIteratorHelper(e.stops),_step38;try {for (_iterator38.s(); !(_step38 = _iterator38.n()).done;) {var _t54 = _step38.value;l[_t54[0]] = _t54[1];}} catch (err) {_iterator38.e(err);} finally {_iterator38.f();}h = _typeof(e.stops[0][0]);} else {if (\"identity\" !== o) throw new Error(\"Unknown function type \\\"\".concat(o, \"\\\"\"));a = Ar;}if (i) {var _n54 = {},_i40 = [];for (var _t55 = 0; _t55 < e.stops.length; _t55++) {var _r29 = e.stops[_t55],_s25 = _r29[0].zoom;void 0 === _n54[_s25] && (_n54[_s25] = { zoom: _s25, type: e.type, property: e.property, default: e.default, stops: [] }, _i40.push(_s25)), _n54[_s25].stops.push([_r29[0].value, _r29[1]]);}var _r30 = [];for (var _i42 = 0, _i41 = _i40; _i42 < _i41.length; _i42++) {var _e42 = _i41[_i42];_r30.push([_n54[_e42].zoom, yr(_n54[_e42], t)]);}var _s26 = { name: \"linear\" };return { kind: \"composite\", interpolationType: _s26, interpolationFactor: Fi.interpolationFactor.bind(void 0, _s26), zoomStops: _r30.map(function (e) {return e[0];}), evaluate: function evaluate(_ref112, i) {var n = _ref112.zoom;return br({ stops: _r30, base: e.base }, t, n).evaluate(n, i);} };}if (s) {var _n55 = \"exponential\" === o ? { name: \"exponential\", base: void 0 !== e.base ? e.base : 1 } : null;return { kind: \"camera\", interpolationType: _n55, interpolationFactor: Fi.interpolationFactor.bind(void 0, _n55), zoomStops: e.stops.map(function (e) {return e[0];}), evaluate: function evaluate(_ref113) {var n = _ref113.zoom;return a(e, t, n, l, h);} };}return { kind: \"source\", evaluate: function evaluate(n, i) {var r = i && i.properties ? i.properties[e.property] : void 0;return void 0 === r ? xr(e.default, t.default) : a(e, t, r, l, h);} };}function xr(e, t, n) {return void 0 !== e ? e : void 0 !== t ? t : void 0 !== n ? n : void 0;}function _r(e, t, n, i, r) {return xr(_typeof(n) === r ? i[n] : void 0, e.default, t.default);}function vr(e, t, n) {if (\"number\" !== pr(n)) return xr(e.default, t.default);var i = e.stops.length;if (1 === i) return e.stops[0][1];if (n <= e.stops[0][0]) return e.stops[0][1];if (n >= e.stops[i - 1][0]) return e.stops[i - 1][1];var r = ri(e.stops.map(function (e) {return e[0];}), n);return e.stops[r][1];}function br(e, t, n) {var i = void 0 !== e.base ? e.base : 1;if (\"number\" !== pr(n)) return xr(e.default, t.default);var r = e.stops.length;if (1 === r) return e.stops[0][1];if (n <= e.stops[0][0]) return e.stops[0][1];if (n >= e.stops[r - 1][0]) return e.stops[r - 1][1];var s = ri(e.stops.map(function (e) {return e[0];}), n),o = function (e, t, n, i) {var r = i - n,s = e - n;return 0 === r ? 0 : 1 === t ? s / r : (Math.pow(t, s) - 1) / (Math.pow(t, r) - 1);}(n, i, e.stops[s][0], e.stops[s + 1][0]),a = e.stops[s][1],l = e.stops[s + 1][1];var h = ci[t.type] || mr;if (e.colorSpace && \"rgb\" !== e.colorSpace) {var _t56 = Ii[e.colorSpace];h = function h(e, n) {return _t56.reverse(_t56.interpolate(_t56.forward(e), _t56.forward(n), o));};}return \"function\" == typeof a.evaluate ? { evaluate: function evaluate() {for (var _len3 = arguments.length, e = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {e[_key3] = arguments[_key3];}var t = a.evaluate.apply(void 0, e),n = l.evaluate.apply(void 0, e);if (void 0 !== t && void 0 !== n) return h(t, n, o);} } : h(a, l, o);}function Ar(e, t, n) {return \"color\" === t.type ? n = on.parse(n) : \"formatted\" === t.type ? n = hn.fromString(n.toString()) : \"resolvedImage\" === t.type ? n = cn.fromString(n.toString()) : pr(n) === t.type || \"enum\" === t.type && t.values[n] || (n = void 0), xr(n, e.default, t.default);}var Tr = function () {function Tr(e, t) {_classCallCheck(this, Tr);this.expression = e, this._warningHistory = {}, this._evaluator = new Pn(), this._defaultValue = t ? function (e) {return \"color\" === e.type && (gr(e.default) || Array.isArray(e.default)) ? new on(0, 0, 0, 0) : \"color\" === e.type ? on.parse(e.default) || null : void 0 === e.default ? null : e.default;}(t) : null, this._enumValues = t && \"enum\" === t.type ? t.values : null;}return _createClass(Tr, [{ key: \"evaluateWithoutErrorHandling\", value: function evaluateWithoutErrorHandling(e, t, n, i, r, s, o, a) {return this._evaluator.globals = e, this._evaluator.feature = t, this._evaluator.featureState = n, this._evaluator.canonical = i || null, this._evaluator.availableImages = r || null, this._evaluator.formattedSection = s, this._evaluator.featureTileCoord = o || null, this._evaluator.featureDistanceData = a || null, this.expression.evaluate(this._evaluator);} }, { key: \"evaluate\", value: function evaluate(e, t, n, i, r, s, o, a) {this._evaluator.globals = e, this._evaluator.feature = t || null, this._evaluator.featureState = n || null, this._evaluator.canonical = i || null, this._evaluator.availableImages = r || null, this._evaluator.formattedSection = s || null, this._evaluator.featureTileCoord = o || null, this._evaluator.featureDistanceData = a || null;try {var _e43 = this.expression.evaluate(this._evaluator);if (null == _e43 || \"number\" == typeof _e43 && _e43 != _e43) return this._defaultValue;if (this._enumValues && !(_e43 in this._enumValues)) throw new yn(\"Expected value to be one of \".concat(Object.keys(this._enumValues).map(function (e) {return JSON.stringify(e);}).join(\", \"), \", but found \").concat(JSON.stringify(_e43), \" instead.\"));return _e43;} catch (e) {return this._warningHistory[e.message] || (this._warningHistory[e.message] = !0, \"undefined\" != typeof console && console.warn(e.message)), this._defaultValue;}} }]);}();function wr(e) {return Array.isArray(e) && e.length > 0 && \"string\" == typeof e[0] && e[0] in cr;}function Sr(e, t) {var n = new ni(cr, [], t ? function (e) {var t = { color: zt, string: Ht, number: Lt, enum: Ht, boolean: Nt, formatted: Gt, resolvedImage: jt };return \"array\" === e.type ? Wt(t[e.value] || Ut, e.length) : t[e.type];}(t) : void 0),i = n.parse(e, void 0, void 0, void 0, t && \"string\" === t.type ? { typeAnnotation: \"coerce\" } : void 0);return i ? ur(new Tr(i, t)) : fr(n.errors);}var Mr = function () {function Mr(e, t) {_classCallCheck(this, Mr);this.kind = e, this._styleExpression = t, this.isStateDependent = \"constant\" !== e && !Jn(t.expression);}return _createClass(Mr, [{ key: \"evaluateWithoutErrorHandling\", value: function evaluateWithoutErrorHandling(e, t, n, i, r, s) {return this._styleExpression.evaluateWithoutErrorHandling(e, t, n, i, r, s);} }, { key: \"evaluate\", value: function evaluate(e, t, n, i, r, s) {return this._styleExpression.evaluate(e, t, n, i, r, s);} }]);}();var Pr = function () {function Pr(e, t, n, i) {_classCallCheck(this, Pr);this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = \"camera\" !== e && !Jn(t.expression), this.interpolationType = i;}return _createClass(Pr, [{ key: \"evaluateWithoutErrorHandling\", value: function evaluateWithoutErrorHandling(e, t, n, i, r, s) {return this._styleExpression.evaluateWithoutErrorHandling(e, t, n, i, r, s);} }, { key: \"evaluate\", value: function evaluate(e, t, n, i, r, s) {return this._styleExpression.evaluate(e, t, n, i, r, s);} }, { key: \"interpolationFactor\", value: function interpolationFactor(e, t, n) {return this.interpolationType ? Fi.interpolationFactor(this.interpolationType, e, t, n) : 0;} }]);}();function Ir(e, t) {if (\"error\" === (e = Sr(e, t)).result) return e;var n = e.value.expression,i = $n(n);if (!i && !function (e) {return \"data-driven\" === e[\"property-type\"];}(t)) return fr([new Ot(\"\", \"data expressions not supported\")]);var r = Kn(n, [\"zoom\", \"pitch\", \"distance-from-center\"]);if (!r && !function (e) {return !!e.expression && e.expression.parameters.indexOf(\"zoom\") > -1;}(t)) return fr([new Ot(\"\", \"zoom expressions not supported\")]);var s = kr(n);if (!s && !r) return fr([new Ot(\"\", '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);if (s instanceof Ot) return fr([s]);if (s instanceof Fi && !dr(t)) return fr([new Ot(\"\", '\"interpolate\" expressions cannot be used with this property')]);if (!s) return ur(new Mr(i ? \"constant\" : \"source\", e.value));var o = s instanceof Fi ? s.interpolation : void 0;return ur(new Pr(i ? \"camera\" : \"composite\", e.value, s.labels, o));}var Cr = function () {function Cr(e, t) {_classCallCheck(this, Cr);this._parameters = e, this._specification = t, kt(this, yr(this._parameters, this._specification));}return _createClass(Cr, null, [{ key: \"deserialize\", value: function deserialize(e) {return new Cr(e._parameters, e._specification);} }, { key: \"serialize\", value: function serialize(e) {return { _parameters: e._parameters, _specification: e._specification };} }]);}();function kr(e) {var t = null;if (e instanceof Di) t = kr(e.result);else if (e instanceof Ri) {var _iterator39 = _createForOfIteratorHelper(e.args),_step39;try {for (_iterator39.s(); !(_step39 = _iterator39.n()).done;) {var _n56 = _step39.value;if (t = kr(_n56), t) break;}} catch (err) {_iterator39.e(err);} finally {_iterator39.f();}} else (e instanceof oi || e instanceof Fi) && e.input instanceof Cn && \"zoom\" === e.input.name && (t = e);return t instanceof Ot || e.eachChild(function (e) {var n = kr(e);n instanceof Ot ? t = n : !t && n ? t = new Ot(\"\", '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.') : t && n && t !== n && (t = new Ot(\"\", 'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'));}), t;}function Fr(e) {if (Array.isArray(e)) return e.map(Fr);if (e instanceof Object && !(e instanceof Number || e instanceof String || e instanceof Boolean)) {var _t57 = {};for (var _n57 in e) _t57[_n57] = Fr(e[_n57]);return _t57;}return function (e) {return e instanceof Number || e instanceof String || e instanceof Boolean ? e.valueOf() : e;}(e);}function Or(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"fill\";if (null == e) return { filter: function filter() {return !0;}, needGeometry: !1, needFeature: !1 };var n = e;var i = !0;try {i = function (e) {if (!Dr(e)) return e;var t = Fr(e);return Er(t), t = Rr(t), t;}(n);} catch (e) {console.warn(\"Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\\nand paste the contents of this message in the report.\\nThank you!\\nFilter Expression:\\n\".concat(JSON.stringify(n, null, 2), \"\\n \"));}var r = Sr(i, null);var s = null;if (\"error\" === r.result) throw new Error(r.value.map(function (e) {return \"\".concat(e.key, \": \").concat(e.message);}).join(\", \"));s = function s(e, t, n) {return r.value.evaluate(e, t, {}, n);};var o = null,a = null;if (i !== n) {var _e44 = Sr(n, null);if (\"error\" === _e44.result) throw new Error(_e44.value.map(function (e) {return \"\".concat(e.key, \": \").concat(e.message);}).join(\", \"));o = function o(t, n, i, r, s) {return _e44.value.evaluate(t, n, {}, i, void 0, void 0, r, s);}, a = !$n(_e44.value.expression);}return { filter: s, dynamicFilter: o || void 0, needGeometry: Hr(i), needFeature: !!a };}function Rr(e) {if (!Array.isArray(e)) return e;var t = function (e) {if (Lr.has(e[0])) for (var _t58 = 1; _t58 < e.length; _t58++) if (Dr(e[_t58])) return !0;return e;}(e);return !0 === t ? t : t.map(function (e) {return Rr(e);});}function Er(e) {var t = !1;var n = [];if (\"case\" === e[0]) {for (var _i43 = 1; _i43 < e.length - 1; _i43 += 2) t = t || Dr(e[_i43]), n.push(e[_i43 + 1]);n.push(e[e.length - 1]);} else if (\"match\" === e[0]) {t = t || Dr(e[1]);for (var _t59 = 2; _t59 < e.length - 1; _t59 += 2) n.push(e[_t59 + 1]);n.push(e[e.length - 1]);} else if (\"step\" === e[0]) {t = t || Dr(e[1]);for (var _t60 = 1; _t60 < e.length - 1; _t60 += 2) n.push(e[_t60 + 1]);}t && (e.length = 0, e.push.apply(e, [\"any\"].concat(n)));for (var _t61 = 1; _t61 < e.length; _t61++) Er(e[_t61]);}function Dr(e) {if (!Array.isArray(e)) return !1;if (function (e) {return \"pitch\" === e || \"distance-from-center\" === e;}(e[0])) return !0;for (var _t62 = 1; _t62 < e.length; _t62++) if (Dr(e[_t62])) return !0;return !1;}var Lr = new Set([\"in\", \"==\", \"!=\", \">\", \">=\", \"<\", \"<=\", \"to-boolean\"]);function Hr(e) {if (!Array.isArray(e)) return !1;if (\"within\" === e[0]) return !0;for (var _t63 = 1; _t63 < e.length; _t63++) if (Hr(e[_t63])) return !0;return !1;}var Nr = { StyleExpression: Tr, isExpression: wr, isExpressionFilter: function e(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\":var _iterator40 = _createForOfIteratorHelper(t.slice(1)),_step40;try {for (_iterator40.s(); !(_step40 = _iterator40.n()).done;) {var _n58 = _step40.value;if (!e(_n58) && \"boolean\" != typeof _n58) return !1;}} catch (err) {_iterator40.e(err);} finally {_iterator40.f();}return !0;default:return !0;}}, createExpression: Sr, createPropertyExpression: Ir, normalizePropertyExpression: function normalizePropertyExpression(e, t) {if (gr(e)) return new Cr(e, t);if (wr(e)) {var _n59 = Ir(e, t);if (\"error\" === _n59.result) throw new Error(_n59.value.map(function (e) {return \"\".concat(e.key, \": \").concat(e.message);}).join(\", \"));return _n59.value;}{var _n60 = e;return \"string\" == typeof e && \"color\" === t.type && (_n60 = on.parse(e)), { kind: \"constant\", evaluate: function evaluate() {return _n60;} };}}, ZoomConstantExpression: Mr, ZoomDependentExpression: Pr, StylePropertyFunction: Cr },zr = Nr.isExpression,Vr = Nr.createExpression,Ur = {};function Br(e) {if (!Array.isArray(e)) return Br([e]);var t = [];for (var _n61 = 0; _n61 < e.length; _n61++) {var _i44 = void 0;_i44 = !0 === e[_n61].filter ? function () {return !0;} : Gr(e[_n61].filter), t.push($e({}, e[_n61], { filter: _i44 }));}return t;}function Gr(e) {if (!0 === e) return function () {return !0;};if (e && e.condition) {if (\"any\" === e.type) {var _t64 = e.condition,_n62 = [];for (var _e45 = 0; _e45 < _t64.length; _e45++) _n62.push(Gr(_t64[_e45]));return function (e, t) {for (var _i45 = 0; _i45 < _n62.length; _i45++) if (_n62[_i45](e, t)) return !0;return !1;};}var _t65 = Gr(e.condition);if (Je(e.layer)) return _t65;var _n63 = function _n63(t) {return t.layer === e.layer;};return function (e, i) {return _n63(e) && _t65(e, i);};}if (xt(e)) return new Function(\"f\", \"var p = (f && f.properties || {}); return \".concat(_t(e)));{var _t66 = Or(e);_t66 = _t66 && _t66.filter;var _n64 = function _n64(e, n) {return Ur.zoom = n, _t66 && _t66(Ur, e);};return _n64;}}var jr = { type: \"number\", \"property-type\": \"data-driven\", expression: { parameters: [\"zoom\", \"feature\"] } };function Wr(e, t) {jr.type = t || \"number\";var n = Vr(e, jr);if (\"success\" !== n.result) throw new Error(\"Invalid maplibre spec expression: \".concat(JSON.stringify(e), \" (\").concat(n.value, \")\"));return n.value;}function Xr(e) {return zr(e);}var Yr = { lineWidth: 1, lineStrokeWidth: 1, lineDx: 1, lineDy: 1, lineOpacity: 1, linePatternAnimSpeed: 1, markerWidth: 1, markerHeight: 1, markerDx: 1, markerDy: 1, markerSpacing: 1, markerOpacity: 1, markerRotation: 1, textWrapWidth: 1, textSpacing: 1, textSize: 1, textHaloRadius: 1, textHaloOpacity: 1, textDx: 1, textDy: 1, textOpacity: 1, textRotation: 1, polygonOpacity: 1 };function Zr(e) {return Yr[e];}var qr = { markerPlacement: 1, markerFile: 1, mergeOnProperty: 1, markerTextFit: 1, markerType: 1, markerHorizontalAlignment: 1, markerVerticalAlignment: 1, markerRotationAlignment: 1, markerPitchAlignment: 1, markerFillPatternFile: 1, markerLinePatternFile: 1, textName: 1, textPlacement: 1, textFaceName: 1, textStyle: 1, textHorizontalAlignment: 1, textVerticalAlignment: 1, textRotationAlignment: 1, textPitchAlignment: 1, lineJoin: 1, lineCap: 1, linePatternFile: 1, polygonPatternFile: 1 },$r = { lineDasharray: 1, markerLineDasharray: 1, uvScale: 1, uvOffset: 1 };function Jr(e) {return qr[e] ? \"string\" : Zr(e) ? \"number\" : $r[e] ? \"array\" : \"color\";}var Kr = Object.freeze({ __proto__: null, compileFilter: Gr, compileStyle: function compileStyle() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];return Br(e = e.map(function (e) {var t = $e({}, e);return t.filter && t.filter.value && (t.filter = t.filter.value), t;}));}, createExpression: Wr, getExpressionType: Jr, isExpression: Xr, isInterpolated: Zr });var Qr = \"undefined\" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope,es = function es(e) {return function (_e46) {function _class() {_classCallCheck(this, _class);return _callSuper(this, _class, arguments);}_inherits(_class, _e46);return _createClass(_class, [{ key: \"pushIn\", value: function pushIn() {var t = arguments.length;for (var _n65 = 0; _n65 < t; _n65++) this[this.currentIndex++] = _n65 < 0 || arguments.length <= _n65 ? undefined : arguments[_n65];} }, { key: \"fill\", value: function fill(e, t, n) {_superPropGet(_class, \"fill\", this, 3)([e, t, n]), n > this.currentIndex && (this.currentIndex = n);} }, { key: \"set\", value: function set(e, t) {e >= this.currentIndex && (this.currentIndex = e + 1), this[e] = t;} }, { key: \"getLength\", value: function getLength() {return this.currentIndex;} }, { key: \"setLength\", value: function setLength(e) {this.currentIndex = e, _superPropGet(_class, \"length\", this, 1) < e && _superPropSet(_class, \"length\", e, this, 1, 1);} }, { key: \"trySetLength\", value: function trySetLength(e) {e > this.currentIndex && this.setLength(e);} }, { key: \"reset\", value: function reset() {this.currentIndex = 0;} }, { key: \"slice\", value: function slice(e, t) {var n = _superPropGet(_class, \"slice\", this, 3)([e, t]);return n.currentIndex = t - e, n;} }]);}(e);},ts = es(Array),ns = { get: function get(e, t) {return \"length\" === t ? e.getLength() : e[t];} };var is = function (_Array) {function is() {_classCallCheck(this, is);return _callSuper(this, is, arguments);}_inherits(is, _Array);return _createClass(is, [{ key: \"setLength\", value: function setLength(e) {this.length = e, this.currentIndex = e;} }, { key: \"trySetLength\", value: function trySetLength(e) {this.length = e, this.currentIndex = e;} }, { key: \"getLength\", value: function getLength() {return this.length;} }]);}(_wrapNativeSuper(Array));var rs;var ss = function () {function ss() {_classCallCheck(this, ss);this._arrays = [], this._index = 0, this._proxiedArrays = [], this._proxiedIndex = 0, this._typedArrays = {};}return _createClass(ss, [{ key: \"getProxy\", value: function getProxy() {if (!Qr) {var _e47 = new is();return _e47.currentIndex = 0, _e47;}var e = this._proxiedArrays[this._proxiedIndex] = this._proxiedArrays[this._proxiedIndex] || ss.getProxyArray();return e.reset(), this._proxiedIndex++, e;} }, { key: \"get\", value: function get(e) {if (!Qr) {var _e48 = new is();return _e48.currentIndex = 0, _e48;}if (e) {var _t67 = e.name;var _n66 = this._typedArrays[_t67];_n66 || (_n66 = this._typedArrays[_t67] = { arrays: [], index: 0 });var _i46 = _n66.index,_r31 = _n66.arrays[_i46] = _n66.arrays[_i46] || ss.getArray(e);return _r31.reset(), _n66.index++, _r31;}var t = this._arrays[this._index] = this._arrays[this._index] || ss.getArray();return t.reset(), this._index++, t;} }, { key: \"reset\", value: function reset() {this._index = 0, this._proxiedIndex = 0;for (var _e49 in this._typedArrays) this._typedArrays[_e49].index = 0;} }], [{ key: \"createTypedArray\", value: function createTypedArray(e, t) {return H(e, t);} }, { key: \"getInstance\", value: function getInstance() {return rs;} }, { key: \"ensureCapacity\", value: function ensureCapacity(e, t) {if (!e.BYTES_PER_ELEMENT) return e;if (e.length >= t) return e;var n = new e.constructor(t + Math.ceil(.5 * t)),i = e.getLength();for (var _t68 = 0; _t68 < i; _t68++) n[_t68] = e[_t68];return n.currentIndex = e.currentIndex, n;} }, { key: \"getArray\", value: function getArray(e) {var t;if (e) {var _n67 = es(e),_i47 = 1048576 / _n67.BYTES_PER_ELEMENT;t = new _n67(_i47);} else t = new ts();return t.push = function () {var _t69;(_t69 = t).pushIn.apply(_t69, arguments);}, t;} }, { key: \"getProxyArray\", value: function getProxyArray() {var e = new ts(),t = new Proxy(e, ns);return t.push = function () {e.pushIn.apply(e, arguments);}, t._origin = e, t;} }]);}();rs = new ss();var os = \"__fea_idx\",as = [],ls = {},hs = {},cs = {},us = [],fs = ss.getInstance();var ds = !1;var ps = Math.pow(2, 17);var gs = function () {function gs(e, t, n) {_classCallCheck(this, gs);this.options = n;var i = [];this.symbolDef = t, this.symbol = oe(t, function () {return i[0] = n.zoom, i;}), this.styledVectors = [], this.properties = {}, this._fnTypes = n.fnTypes || gs.genFnTypes(this.symbolDef), st(this.symbolDef.visible) && (this._visibleFn = re(this.symbolDef.visible)), n.atlas && (this.iconAtlas = n.atlas.iconAtlas, this.glyphAtlas = n.atlas.glyphAtlas), this.maxAltitude = 0, this.features = this._check(e);}return _createClass(gs, [{ key: \"needAltitudeAttribute\", value: function needAltitudeAttribute() {var e = Math.max(Math.abs(this.maxPosZ), Math.abs(this.minPosZ));return this.options.forceAltitudeAttribute || e >= ps || this.options.positionType === Float32Array;} }, { key: \"getPositionFormat\", value: function getPositionFormat() {return this.needAltitudeAttribute() ? [{ type: Int16Array, width: 2, name: \"aPosition\" }, { type: Float32Array, width: 1, name: \"aAltitude\" }] : [{ type: Float32Array, width: 3, name: \"aPosition\" }];} }, { key: \"fillPosition\", value: function fillPosition(e, t, n, i) {if (t < this._minX && (this._minX = t), t > this._maxX && (this._maxX = t), n < this._minY && (this._minY = n), n > this._maxY && (this._maxY = n), this.needAltitudeAttribute()) {var _r32 = e.aPosition.currentIndex;e.aPosition[_r32++] = t, e.aPosition[_r32++] = n, e.aPosition.currentIndex = _r32, _r32 = e.aAltitude.currentIndex, e.aAltitude[_r32++] = i, e.aAltitude.currentIndex = _r32;} else {pt(as, t, n, i);var _r33 = e.aPosition.currentIndex;e.aPosition[_r33++] = as[0], e.aPosition[_r33++] = as[1], e.aPosition[_r33++] = as[2], e.aPosition.currentIndex = _r33;}} }, { key: \"_check\", value: function _check(e) {if (!e.length) return e;var t = (os + \"\").trim();var n,i = 0,r = e[i];for (; !r.geometry;) i++, r = e[i];if (Array.isArray(r.geometry) && r.properties) {var _t70 = r.geometry[0];for (; Array.isArray(_t70);) _t70 = _t70[0];_t70 && !Je(_t70.x) && (n = e);}if (!n) if (n = [], Array.isArray(r.geometry)) for (var _t71 = 0; _t71 < e.length; _t71++) {var _i48 = $e({}, e[_t71]);n.push(N(_i48));} else for (var _i49 = 0; _i49 < e.length; _i49++) {var _r34 = e[_i49],_s27 = a(_r34);for (var _e50 = 0; _e50 < _s27.length; _e50++) {var _i50 = _s27[_e50];_i50[t] = _r34[t], n.push(_i50);}}if (this.options.altitudeProperty) for (var _e51 = 0; _e51 < n.length; _e51++) {var _t72 = n[_e51];if (!_t72 || !_t72.geometry || 1 !== _t72.type && 4 !== _t72.type) continue;var _i51 = this.getAltitude(_t72.properties);if (_i51) for (var _e52 = 0; _e52 < _t72.geometry.length; _e52++) {var _n68 = _t72.geometry[_e52];if (_n68 && _n68.length) for (var _e53 = 0; _e53 < _n68.length; _e53++) _n68[_e53].z = (_n68[_e53].z || 0) + _i51;}}if (this.maxPosZ = 0, this.minPosZ = 0, !this.options.forceAltitudeAttribute) {var _e54 = \"line\" === this.symbolDef.textPlacement;var _t73 = -1 / 0,_i52 = 1 / 0,_r35 = !1;var _s28 = this._fnTypes.textPitchAlignmentFn;!_s28 && _e54 && \"map\" === this.symbolDef.textPitchAlignment && (_r35 = !0);var _o21 = [];for (var _a8 = 0; _a8 < n.length; _a8++) {var _ys = ys(_o21, n[_a8] && n[_a8].geometry),_ys2 = _slicedToArray(_ys, 2),_l7 = _ys2[0],_h5 = _ys2[1];if (_h5 > _t73 && (_t73 = _h5), _l7 < _i52 && (_i52 = _l7), _e54 && !_r35 && _s28 && n[_a8].properties) {var _e55 = _s28(null, n[_a8].properties);\"map\" === _e55 && (_r35 = _e55);}}this.hasMapPitchAlign = _r35, this.maxPosZ = _t73 === -1 / 0 ? 0 : _t73, this.minPosZ = _i52 === 1 / 0 ? 0 : _i52;}var s = this.options.order;if (s) {var _e56 = [];for (var _t74 = 0; _t74 < s.length; _t74++) s[_t74] && _e56.push(Gr(s[_t74]));n = n.sort(function (t, n) {var i = _e56.length;var r = -1,s = -1;for (var _o22 = 0; _o22 < i && (_e56[_o22](t) && (r = _o22), _e56[_o22](n) && (s = _o22), !(r >= 0 && r < i && s >= 0 && s < i)); _o22++);return r - s;});}return n;} }, { key: \"load\", value: function load() {var _this3 = this;var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;var t = (os + \"\").trim(),n = \"_debug_info\".trim(),i = this._fnTypes,r = this.styledVectors;this.count = 0;var s = this.features;if (!s || !s.length) return Promise.resolve(null);var o = {},a = {},l = { zoom: this.options.zoom, isVector3D: !!this.options.center },h = [],c = oe(this.symbolDef, function () {return h[0] = l.zoom, h;});var u = 0,f = s.length;var d = this.options.debugIndex;try {for (; u < f; u++) {var _e57 = s[u];if (!_e57 || !_e57.geometry) continue;if (Ke(d) && _e57[n].index !== d) continue;_e57.properties || (_e57.properties = {}), _e57.properties.$layer = _e57.layer, _e57.properties.$type = _e57.type;var _h6 = this.createStyledVector(_e57, c, i, l, o, a);_h6 && _h6.feature.geometry && (_h6.featureIdx = void 0 === _e57[t] ? u : _e57[t], this.count++, r.push(_h6));}} catch (e) {return Promise.reject(e);}return this.options.atlas ? Promise.resolve(this.pack(e)) : this.loadAtlas(o, a).then(function () {return _this3.pack(e);});} }, { key: \"loadAtlas\", value: function loadAtlas(e, t) {var _this4 = this;return new Promise(function (n, i) {_this4.fetchAtlas(e, t, function (e, t) {if (e) i(e);else {if (t) {var _e58 = t.icons,_n69 = t.glyphs;if (_e58 && Object.keys(_e58).length) {for (var _t75 in _e58) {var _n70 = _e58[_t75],_n$data = _n70.data,_i53 = _n$data.width,_r36 = _n$data.height,_s29 = _n$data.data;_n70.data = new v({ width: _i53, height: _r36 }, _s29);}_this4.iconAtlas = new F(_e58);}if (_n69 && Object.keys(_n69).length) {for (var _e59 in _n69) {var _t76 = _n69[_e59];for (var _e60 in _t76) {var _n71 = _t76[_e60],_n$bitmap = _n71.bitmap,_i54 = _n$bitmap.width,_r37 = _n$bitmap.height,_s30 = _n$bitmap.data;_n71.bitmap = new _({ width: _i54, height: _r37 }, _s30);}}_this4.glyphAtlas = new R(_n69);}}n({ glyphAtlas: _this4.glyphAtlas, iconAtlas: _this4.iconAtlas });}});});} }, { key: \"fetchAtlas\", value: function fetchAtlas(e, t, n) {Object.keys(e).length > 0 || Object.keys(t).length > 0 ? this.options.requestor(e, t, n) : n();} }, { key: \"pack\", value: function pack(e) {if (!this.count) return null;if (null == e) throw new Error(\"layout scale is undefined\");var t = this.createDataPack(this.styledVectors, e);if (!t) return null;this.properties.minAltitude = this.minPosZ / 100, this.properties.maxAltitude = this.maxPosZ / 100, t.properties = this.properties, this.empty && (t.empty = !0);var n = t.buffers;delete t.buffers;var i = { data: t, buffers: n };if (this.iconAtlas) {var _e61 = i.data.iconAtlas = ms(this.iconAtlas);if (_e61.glyphMap) for (var _t77 in _e61.glyphMap) {var _i55 = _e61.glyphMap[_t77];n.push(_i55.data.data.buffer);}n.push(i.data.iconAtlas.image.data.buffer);}return this.glyphAtlas && (i.data.glyphAtlas = ms(this.glyphAtlas), n.push(i.data.glyphAtlas.image.data.buffer)), i;} }, { key: \"createStyledVector\", value: function createStyledVector(e, t, n, i) {return new dt(e, t, n, i);} }, { key: \"createDataPack\", value: function createDataPack(e, t) {if (!e || !e.length) return null;this.maxIndex = 0, this.maxPos = 0, this._minX = this._minY = 1 / 0, this._maxX = this._maxY = -1 / 0, this.dynamicAttrs = {};var n = this.data = {};this._arrayPool = fs, fs.reset();var i = this.elements = fs.get();var r = this._dataFormat = this.getFormat(Array.isArray(e[0]) ? e[0][0].symbol : e[0].symbol),s = this.needAltitudeAttribute() ? 2 : 3;for (var _e62 = 0; _e62 < r.length; _e62++) n[r[_e62].name] = fs.get(r[_e62].type);var o = fs.get(),a = 0;var l = fs.get();var h = 0,c = !1,u = !0;var f = new Set();for (var _i56 = 0, _r38 = e.length; _i56 < _r38; _i56++) {if (!e[_i56].feature.geometry) continue;var _r39 = Array.isArray(e[_i56]) ? e[_i56][0].feature.id : e[_i56].feature.id;u && (void 0 !== hs.id ? f && (f.has(hs.id) ? u = !1 : f.add(hs.id)) : u = !1), Ke(_r39) && (Math.abs(_r39) > h && (h = Math.abs(_r39)), _r39 < 0 && (c = !0));var _d = this.data.aPosition.getLength();if (Array.isArray(e[_i56])) for (var _n72 = 0; _n72 < e[_i56].length; _n72++) this._placeVector(e[_i56][_n72], t);else this._placeVector(e[_i56], t);var _p = (n.aPosition.getLength() - _d) / s;for (var _t78 = 0; _t78 < _p; _t78++) o.push(e[_i56].featureIdx), Ke(_r39) && l.push(_r39);a = Math.max(a, e[_i56].featureIdx);}if (this.countOutOfAngle > 0 && !ds && (ds = !0, console.warn(\"text anchor along line is ignored as anchor's line angle is bigger than textMaxAngle.\")), this.hasElements() && !i.getLength()) return null;var d = this.options.center ? Float32Array : L(a);o = ss.createTypedArray(o, d), this.options.positionType ? r[0].type = this.options.positionType : r[0].type = D(this.maxPos);var p = this.options.center;if (p && (p[0] || p[1])) {var _e63 = n.aPosition,_t79 = _e63.getLength();for (var _n73 = 0; _n73 < _t79; _n73 += s) _e63[_n73] -= p[0], _e63[_n73 + 1] -= p[1];}var g = function (e, t) {var n = {};for (var _i57 = 0; _i57 < e.length; _i57++) {var _r40 = e[_i57],_s31 = _r40.type,_o23 = _r40.name;n[_o23] = _s31 === Array ? t[_o23] : H(t[_o23], _s31);}return n;}(r, n);g.aPickingId = o;var m = [];for (var _e64 in g) m.push(g[_e64].buffer);var y = E(this.maxIndex);i = ss.createTypedArray(i, y), m.push(i.buffer);var x = { data: g, isIdUnique: u, is2D: 0 === this.maxPosZ && 0 === this.minPosZ, indices: this.hasElements() ? i : null, positionSize: s, positionBounding: [this._minX, this._minY, this._maxX, this._maxY], buffers: m, symbolIndex: this.symbolDef.index || { index: 0 }, dynamicAttributes: this.dynamicAttrs };if (this._packMarkerPlacement && (x.markerPlacement = this._packMarkerPlacement), this._packTextPlacement && (x.textPlacement = this._packTextPlacement), l.getLength()) {var _e65 = c ? D(h) : L(h);x.featureIds = ss.createTypedArray(l, _e65), m.push(x.featureIds.buffer);} else x.featureIds = [];return x.pickingIdIndiceMap = I(o, x.indices), x;} }, { key: \"_placeVector\", value: function _placeVector(e, t) {var n = e.feature.properties;this._visibleFn && !this._visibleFn(this.options.zoom, n) || this.placeVector(e, t, this.formatWidth);} }, { key: \"addElements\", value: function addElements(e, t, n) {this.maxIndex = Math.max(this.maxIndex, e, t, n);var i = this.elements.currentIndex;this.elements[i++] = e, this.elements[i++] = t, this.elements[i++] = n, this.elements.currentIndex = i;} }, { key: \"hasElements\", value: function hasElements() {return !0;} }, { key: \"getAltitude\", value: function getAltitude(e) {var _this$options2 = this.options,t = _this$options2.altitudeProperty,n = _this$options2.defaultAltitude,i = _this$options2.altitudeScale;var r = T(e, t, n);return i && (r *= i), this.maxAltitude = Math.max(this.maxAltitude, Math.abs(r)), r;} }, { key: \"getIconAtlasMaxValue\", value: function getIconAtlasMaxValue() {var e = this.iconAtlas.positions;var t = 0;for (var _n74 in e) if (it(e, _n74)) {var _e$_n = e[_n74],_i58 = _e$_n.tl,_r41 = _e$_n.displaySize,_s32 = Math.max(_i58[0], _i58[1], _r41[0] - 1, _r41[1] - 1);_s32 > t && (t = _s32);}return t;} }, { key: \"ensureDataCapacity\", value: function ensureDataCapacity(e, t) {var n = this._dataFormat;for (var _i59 = 0; _i59 < n.length; _i59++) {var _r42 = this.data[n[_i59].name];if (!_r42) continue;var _s33 = n[_i59].width * e,_o24 = _r42.getLength();this.data[n[_i59].name] = ss.ensureCapacity(_r42, _o24 + _s33 * t);}} }], [{ key: \"isAtlasLoaded\", value: function isAtlasLoaded(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var n = t.iconAtlas;return !!(!e || n && n.positions[e]);} }, { key: \"genFnTypes\", value: function genFnTypes(e) {var t = {};var _loop = function _loop() {if (Xr(e[_n75])) {var _i60 = (_n75 + \"_Fn_0\").trim(),_r43 = (_n75 + \"Fn\").trim(),_s34 = Jr(_n75);t[_i60] = Wr(e[_n75], _s34), t[_r43] = function (e, n) {var r;ls.zoom = e, hs.properties = n;try {r = t[_i60].evaluateWithoutErrorHandling(ls, hs, cs, null, us);} catch (e) {return null;}return r;};} else if (st(e[_n75])) {var _i61 = (_n75 + \"_Fn_0\").trim(),_r44 = (_n75 + \"Fn\").trim();Zr(_n75) ? (t[_i61] = re(e[_n75]), t[_r44] = function (e, n) {var r = t[_i61](e, n);return st(r) ? re(r)(e, n) : r;}) : (t[_i61] = se(e[_n75]), t[_r44] = function (e, n) {var r = t[_i61](e, n);return st(r) ? se(r)(e, n) : r;});}};for (var _n75 in e) {_loop();}return t;} }]);}();function ms(e) {var t = e.positions,n = e.image && e.image.format || \"alpha\";if (e instanceof F) {t = {};for (var _n76 in e.positions) {var _i62 = e.positions[_n76];t[_n76] = { paddedRect: _i62.paddedRect, pixelRatio: _i62.pixelRatio, tl: _i62.tl, br: _i62.br, displaySize: _i62.displaySize };}n = \"rgba\";}var i = e.image;return { image: { width: i.width, height: i.height, data: i.data, format: n }, glyphMap: e.glyphMap, positions: t };}function ys(e, t) {if (!t) return 0;var n = -1 / 0,i = 1 / 0;var r = [];if (Array.isArray(t)) {for (var _e66 = 0; _e66 < t.length; _e66++) if (Array.isArray(t[_e66])) {var _ys3 = ys(r, t[_e66]),_ys4 = _slicedToArray(_ys3, 2),_s35 = _ys4[0],_o25 = _ys4[1];_o25 > n && (n = _o25), _s35 < i && (i = _s35);} else {var _r45 = Math.abs(t[_e66].z || 0);_r45 > n && (n = _r45), _r45 < i && (i = _r45);}} else {var _e67 = Math.abs(t.z || 0);_e67 > n && (n = _e67), _e67 < i && (i = _e67);}return e[0] = i, e[1] = n, e;}var xs = \"___fn_in_stops\";function _s(e, t, n, i) {var r = \"__fn_textSize\".trim();var s = e.textSize;if (Je(t.textSize)) return [16, 16];e[r] && (s = e[r]);var o = [];if (tt(s) ? o[0] = s(i, n) : o[0] = s, ie(o[0])) {var _t80 = o[0].__fn_key = o[0].__fn_key || JSON.stringify(o[0]);e[xs] || (e[xs] = {}), e[xs][_t80] || (e[xs][_t80] = re(o[0]));var _r46 = e[xs][_t80];o[0] = _r46(i, n);}return o[1] = o[0], o;}function vs(e) {var t = e.stops;var n = -1 / 0;for (var _e68 = 0; _e68 < t.length; _e68++) {var _i63 = t[_e68][1];Qe(t[_e68][1]) && (_i63 = vs(t[_e68][1])), _i63 > n && (n = _i63);}return n;}var bs = [\"{\", \"}\"],As = \"\";function Ts(e) {return e || \"Open Sans Regular\";}var ws = /\\{[\\w-]+(?:\\|[\\w-]+)*\\}/g;function Ss(e, t) {if (!et(e)) return e;function n(e) {if (!t) return As;var n = t[e];return Je(n) ? As : Array.isArray(n) ? n.join() : n;}var i = bs[0],r = bs[1],s = Ms(e);for (var _t81 = 0, _o26 = s.length; _t81 < _o26; _t81++) {var _o27 = s[_t81],_a9 = \"\".concat(i).concat(_o27).concat(r);if (_o27.indexOf(\"|\") > 0) {var _t82 = _o27.split(\"|\");var _i64 = !1;for (var _r47 = 0; _r47 < _t82.length; _r47++) {var _s36 = n(_t82[_r47]);if (_s36 !== As) {e = Ps(e, _a9, _s36), _i64 = !0;break;}}_i64 || (e = Ps(e, _a9, As));} else e = Ps(e, _a9, n(_o27));}return e;}function Ms(e) {e += As;var t = bs[0],n = bs[1],i = [];var r = !1,s = As;for (var _o28 = 0, _a10 = e.length; _o28 < _a10; _o28++) {var _a11 = e[_o28];r || _a11 !== t || (r = !0), _a11 === t && r && (s = As), r && _a11 !== t && _a11 !== n && (s += _a11), _a11 === n && s && (r = !1, i.push(s), s = As);}return i;}function Ps(e, t, n) {if (!e) return e;if (e.replaceAll) return e.replaceAll(t, n);for (; e.indexOf(t) > -1;) e = e.replace(t, n);return e;}var Is = Object.freeze({ __proto__: null, EMPTY_STRING: As, getSDFFont: Ts, replaceAll: Ps, resolveExpVarNames: function e(t, n) {if (2 !== n.length || \"get\" !== n[0]) for (var _i65 = 0; _i65 < n.length; _i65++) 2 === n[_i65].length && \"get\" === n[_i65][0] ? t.push(n[_i65][1]) : Array.isArray(n[_i65]) && e(t, n[_i65]);else t.push(n[1]);}, resolveText: Ss, resolveText_bak: function resolveText_bak(e, t) {return et(e) ? e.replace(ws, function (e) {if (!t) return \"\";if ((e = e.substring(1, e.length - 1)).indexOf(\"|\") > 0) {var _n77 = e.split(\"|\");for (var _e69 = 0; _e69 < _n77.length; _e69++) {var _i66 = t[_n77[_e69]];if (!Je(_i66)) return _i66;}return \"\";}var n = t[e];return Je(n) ? \"\" : Array.isArray(n) ? n.join() : n;}) : e;}, resolveVarNames: function resolveVarNames(e) {return e.match(ws);}, templateKeys: Ms });var Cs = { \"Latin-1 Supplement\": function Latin1_Supplement(e) {return e >= 128 && e <= 255;}, Arabic: function Arabic(e) {return e >= 1536 && e <= 1791;}, \"Arabic Supplement\": function Arabic_Supplement(e) {return e >= 1872 && e <= 1919;}, \"Arabic Extended-A\": function Arabic_ExtendedA(e) {return e >= 2208 && e <= 2303;}, \"Hangul Jamo\": function Hangul_Jamo(e) {return e >= 4352 && e <= 4607;}, \"Unified Canadian Aboriginal Syllabics\": function Unified_Canadian_Aboriginal_Syllabics(e) {return e >= 5120 && e <= 5759;}, Khmer: function Khmer(e) {return e >= 6016 && e <= 6143;}, \"Unified Canadian Aboriginal Syllabics Extended\": function Unified_Canadian_Aboriginal_Syllabics_Extended(e) {return e >= 6320 && e <= 6399;}, \"General Punctuation\": function General_Punctuation(e) {return e >= 8192 && e <= 8303;}, \"Letterlike Symbols\": function Letterlike_Symbols(e) {return e >= 8448 && e <= 8527;}, \"Number Forms\": function Number_Forms(e) {return e >= 8528 && e <= 8591;}, \"Miscellaneous Technical\": function Miscellaneous_Technical(e) {return e >= 8960 && e <= 9215;}, \"Control Pictures\": function Control_Pictures(e) {return e >= 9216 && e <= 9279;}, \"Optical Character Recognition\": function Optical_Character_Recognition(e) {return e >= 9280 && e <= 9311;}, \"Enclosed Alphanumerics\": function Enclosed_Alphanumerics(e) {return e >= 9312 && e <= 9471;}, \"Geometric Shapes\": function Geometric_Shapes(e) {return e >= 9632 && e <= 9727;}, \"Miscellaneous Symbols\": function Miscellaneous_Symbols(e) {return e >= 9728 && e <= 9983;}, \"Miscellaneous Symbols and Arrows\": function Miscellaneous_Symbols_and_Arrows(e) {return e >= 11008 && e <= 11263;}, \"CJK Radicals Supplement\": function CJK_Radicals_Supplement(e) {return e >= 11904 && e <= 12031;}, \"Kangxi Radicals\": function Kangxi_Radicals(e) {return e >= 12032 && e <= 12255;}, \"Ideographic Description Characters\": function Ideographic_Description_Characters(e) {return e >= 12272 && e <= 12287;}, \"CJK Symbols and Punctuation\": function CJK_Symbols_and_Punctuation(e) {return e >= 12288 && e <= 12351;}, Hiragana: function Hiragana(e) {return e >= 12352 && e <= 12447;}, Katakana: function Katakana(e) {return e >= 12448 && e <= 12543;}, Bopomofo: function Bopomofo(e) {return e >= 12544 && e <= 12591;}, \"Hangul Compatibility Jamo\": function Hangul_Compatibility_Jamo(e) {return e >= 12592 && e <= 12687;}, Kanbun: function Kanbun(e) {return e >= 12688 && e <= 12703;}, \"Bopomofo Extended\": function Bopomofo_Extended(e) {return e >= 12704 && e <= 12735;}, \"CJK Strokes\": function CJK_Strokes(e) {return e >= 12736 && e <= 12783;}, \"Katakana Phonetic Extensions\": function Katakana_Phonetic_Extensions(e) {return e >= 12784 && e <= 12799;}, \"Enclosed CJK Letters and Months\": function Enclosed_CJK_Letters_and_Months(e) {return e >= 12800 && e <= 13055;}, \"CJK Compatibility\": function CJK_Compatibility(e) {return e >= 13056 && e <= 13311;}, \"CJK Unified Ideographs Extension A\": function CJK_Unified_Ideographs_Extension_A(e) {return e >= 13312 && e <= 19903;}, \"Yijing Hexagram Symbols\": function Yijing_Hexagram_Symbols(e) {return e >= 19904 && e <= 19967;}, \"CJK Unified Ideographs\": function CJK_Unified_Ideographs(e) {return e >= 19968 && e <= 40959;}, \"Yi Syllables\": function Yi_Syllables(e) {return e >= 40960 && e <= 42127;}, \"Yi Radicals\": function Yi_Radicals(e) {return e >= 42128 && e <= 42191;}, \"Hangul Jamo Extended-A\": function Hangul_Jamo_ExtendedA(e) {return e >= 43360 && e <= 43391;}, \"Hangul Syllables\": function Hangul_Syllables(e) {return e >= 44032 && e <= 55215;}, \"Hangul Jamo Extended-B\": function Hangul_Jamo_ExtendedB(e) {return e >= 55216 && e <= 55295;}, \"Private Use Area\": function Private_Use_Area(e) {return e >= 57344 && e <= 63743;}, \"CJK Compatibility Ideographs\": function CJK_Compatibility_Ideographs(e) {return e >= 63744 && e <= 64255;}, \"Arabic Presentation Forms-A\": function Arabic_Presentation_FormsA(e) {return e >= 64336 && e <= 65023;}, \"Vertical Forms\": function Vertical_Forms(e) {return e >= 65040 && e <= 65055;}, \"CJK Compatibility Forms\": function CJK_Compatibility_Forms(e) {return e >= 65072 && e <= 65103;}, \"Small Form Variants\": function Small_Form_Variants(e) {return e >= 65104 && e <= 65135;}, \"Arabic Presentation Forms-B\": function Arabic_Presentation_FormsB(e) {return e >= 65136 && e <= 65279;}, \"Halfwidth and Fullwidth Forms\": function Halfwidth_and_Fullwidth_Forms(e) {return e >= 65280 && e <= 65519;} };function ks(e) {return !(Cs.Arabic(e) || Cs[\"Arabic Supplement\"](e) || Cs[\"Arabic Extended-A\"](e) || Cs[\"Arabic Presentation Forms-A\"](e) || Cs[\"Arabic Presentation Forms-B\"](e));}function Fs(e) {return !!(!(e < 11904) && (Cs[\"Bopomofo Extended\"](e) || Cs.Bopomofo(e) || Cs[\"CJK Compatibility Forms\"](e) || Cs[\"CJK Compatibility Ideographs\"](e) || Cs[\"CJK Compatibility\"](e) || Cs[\"CJK Radicals Supplement\"](e) || Cs[\"CJK Strokes\"](e) || Cs[\"CJK Symbols and Punctuation\"](e) || Cs[\"CJK Unified Ideographs Extension A\"](e) || Cs[\"CJK Unified Ideographs\"](e) || Cs[\"Enclosed CJK Letters and Months\"](e) || Cs[\"Halfwidth and Fullwidth Forms\"](e) || Cs.Hiragana(e) || Cs[\"Ideographic Description Characters\"](e) || Cs[\"Kangxi Radicals\"](e) || Cs[\"Katakana Phonetic Extensions\"](e) || Cs.Katakana(e) || Cs[\"Vertical Forms\"](e) || Cs[\"Yi Radicals\"](e) || Cs[\"Yi Syllables\"](e)));}function Os(e) {return !!(746 === e || 747 === e || !(e < 4352) && (Cs[\"Bopomofo Extended\"](e) || Cs.Bopomofo(e) || Cs[\"CJK Compatibility Forms\"](e) && !(e >= 65097 && e <= 65103) || Cs[\"CJK Compatibility Ideographs\"](e) || Cs[\"CJK Compatibility\"](e) || Cs[\"CJK Radicals Supplement\"](e) || Cs[\"CJK Strokes\"](e) || !(!Cs[\"CJK Symbols and Punctuation\"](e) || e >= 12296 && e <= 12305 || e >= 12308 && e <= 12319 || 12336 === e) || Cs[\"CJK Unified Ideographs Extension A\"](e) || Cs[\"CJK Unified Ideographs\"](e) || Cs[\"Enclosed CJK Letters and Months\"](e) || Cs[\"Hangul Compatibility Jamo\"](e) || Cs[\"Hangul Jamo Extended-A\"](e) || Cs[\"Hangul Jamo Extended-B\"](e) || Cs[\"Hangul Jamo\"](e) || Cs[\"Hangul Syllables\"](e) || Cs.Hiragana(e) || Cs[\"Ideographic Description Characters\"](e) || Cs.Kanbun(e) || Cs[\"Kangxi Radicals\"](e) || Cs[\"Katakana Phonetic Extensions\"](e) || Cs.Katakana(e) && 12540 !== e || !(!Cs[\"Halfwidth and Fullwidth Forms\"](e) || 65288 === e || 65289 === e || 65293 === e || e >= 65306 && e <= 65310 || 65339 === e || 65341 === e || 65343 === e || e >= 65371 && e <= 65503 || 65507 === e || e >= 65512 && e <= 65519) || !(!Cs[\"Small Form Variants\"](e) || e >= 65112 && e <= 65118 || e >= 65123 && e <= 65126) || Cs[\"Unified Canadian Aboriginal Syllabics\"](e) || Cs[\"Unified Canadian Aboriginal Syllabics Extended\"](e) || Cs[\"Vertical Forms\"](e) || Cs[\"Yijing Hexagram Symbols\"](e) || Cs[\"Yi Syllables\"](e) || Cs[\"Yi Radicals\"](e)));}function Rs(e) {return !(Os(e) || function (e) {return !!(Cs[\"Latin-1 Supplement\"](e) && (167 === e || 169 === e || 174 === e || 177 === e || 188 === e || 189 === e || 190 === e || 215 === e || 247 === e) || Cs[\"General Punctuation\"](e) && (8214 === e || 8224 === e || 8225 === e || 8240 === e || 8241 === e || 8251 === e || 8252 === e || 8258 === e || 8263 === e || 8264 === e || 8265 === e || 8273 === e) || Cs[\"Letterlike Symbols\"](e) || Cs[\"Number Forms\"](e) || Cs[\"Miscellaneous Technical\"](e) && (e >= 8960 && e <= 8967 || e >= 8972 && e <= 8991 || e >= 8996 && e <= 9e3 || 9003 === e || e >= 9085 && e <= 9114 || e >= 9150 && e <= 9165 || 9167 === e || e >= 9169 && e <= 9179 || e >= 9186 && e <= 9215) || Cs[\"Control Pictures\"](e) && 9251 !== e || Cs[\"Optical Character Recognition\"](e) || Cs[\"Enclosed Alphanumerics\"](e) || Cs[\"Geometric Shapes\"](e) || Cs[\"Miscellaneous Symbols\"](e) && !(e >= 9754 && e <= 9759) || Cs[\"Miscellaneous Symbols and Arrows\"](e) && (e >= 11026 && e <= 11055 || e >= 11088 && e <= 11097 || e >= 11192 && e <= 11243) || Cs[\"CJK Symbols and Punctuation\"](e) || Cs.Katakana(e) || Cs[\"Private Use Area\"](e) || Cs[\"CJK Compatibility Forms\"](e) || Cs[\"Small Form Variants\"](e) || Cs[\"Halfwidth and Fullwidth Forms\"](e) || 8734 === e || 8756 === e || 8757 === e || e >= 9984 && e <= 10087 || e >= 10102 && e <= 10131 || 65532 === e || 65533 === e);}(e));}function Es(e) {return e >= 1424 && e <= 2303 || Cs[\"Arabic Presentation Forms-A\"](e) || Cs[\"Arabic Presentation Forms-B\"](e);}var Ds = [[9, 9], [32, 32], [5760, 5760], [8192, 8198], [8200, 8202], [8287, 12288], [6158, 6158], [8203, 8205]];function Ls(e) {var _iterator41 = _createForOfIteratorHelper(Ds),_step41;try {for (_iterator41.s(); !(_step41 = _iterator41.n()).done;) {var _t83 = _step41.value;if (e >= _t83[0] && e <= _t83[1]) return !0;}} catch (err) {_iterator41.e(err);} finally {_iterator41.f();}return !1;}var Hs = { \"!\": \"︕\", \"#\": \"#\", $: \"$\", \"%\": \"%\", \"&\": \"&\", \"(\": \"︵\", \")\": \"︶\", \"*\": \"*\", \"+\": \"+\", \",\": \"︐\", \"-\": \"︲\", \".\": \"・\", \"/\": \"/\", \":\": \"︓\", \";\": \"︔\", \"<\": \"︿\", \"=\": \"=\", \">\": \"﹀\", \"?\": \"︖\", \"@\": \"@\", \"[\": \"﹇\", \"\\\\\": \"\\", \"]\": \"﹈\", \"^\": \"^\", _: \"︳\", \"`\": \"`\", \"{\": \"︷\", \"|\": \"―\", \"}\": \"︸\", \"~\": \"~\", \"¢\": \"¢\", \"£\": \"£\", \"¥\": \"¥\", \"¦\": \"¦\", \"¬\": \"¬\", \"¯\": \" ̄\", \"–\": \"︲\", \"—\": \"︱\", \"‘\": \"﹃\", \"’\": \"﹄\", \"“\": \"﹁\", \"”\": \"﹂\", \"…\": \"︙\", \"‧\": \"・\", \"₩\": \"₩\", \"、\": \"︑\", \"。\": \"︒\", \"〈\": \"︿\", \"〉\": \"﹀\", \"《\": \"︽\", \"》\": \"︾\", \"「\": \"﹁\", \"」\": \"﹂\", \"『\": \"﹃\", \"』\": \"﹄\", \"【\": \"︻\", \"】\": \"︼\", \"〔\": \"︹\", \"〕\": \"︺\", \"〖\": \"︗\", \"〗\": \"︘\", \"!\": \"︕\", \"(\": \"︵\", \")\": \"︶\", \",\": \"︐\", \"-\": \"︲\", \".\": \"・\", \":\": \"︓\", \";\": \"︔\", \"<\": \"︿\", \">\": \"﹀\", \"?\": \"︖\", \"[\": \"﹇\", \"]\": \"﹈\", \"_\": \"︳\", \"{\": \"︷\", \"|\": \"―\", \"}\": \"︸\", \"⦅\": \"︵\", \"⦆\": \"︶\", \"。\": \"︒\", \"「\": \"﹁\", \"」\": \"﹂\" },Ns = 1,zs = 2;function Vs(e, t, n, i, r, s, o, a, l, h) {var c = e.trim();h === zs && (c = function (e) {var t = \"\";var n = Array.from(e);for (var _e70 = 0; _e70 < n.length; _e70++) {var _i67 = n[_e70 + 1].codePointAt(0) || null,_r48 = n[_e70 - 1].codePointAt(0) || null;_i67 && Rs(_i67) && !Hs[n[_e70 + 1]] || _r48 && Rs(_r48) && !Hs[n[_e70 - 1]] || !Hs[n[_e70]] ? t += n[_e70] : t += Hs[n[_e70]];}return t;}(c));var u = [],f = { positionedGlyphs: u, text: c, top: a[1], bottom: a[1], left: a[0], right: a[0], writingMode: h };var d;return d = function (e, t) {var n = [];var i = 0;for (var _r49 = 0; _r49 < t.length; _r49++) {var _s37 = t[_r49];n.push(e.substring(i, _s37)), i = _s37;}return i < e.length && n.push(e.substring(i, e.length)), n;}(c, function (e, t, n, i) {if (!n) return [];if (!e) return [];var r = [],s = function (e, t, n, i) {var r = 0;for (var _n78 = 0; _n78 < e.length; _n78++) {var _s38 = i[e.codePointAt(_n78)];_s38 && (r += _s38.metrics.advance + t);}return r / Math.max(1, Math.ceil(r / n));}(e, t, n, i);var o = 0;for (var _n79 = 0; _n79 < e.length; _n79++) {var _a12 = e.codePointAt(_n79),_l8 = i[_a12];_l8 && (_l8 && !Us[_a12] && (o += _l8.metrics.advance + t), _n79 < e.length - 1 && (Bs[_a12] || Fs(_a12)) && r.push(Ws(_n79 + 1, o, s, r, js(_a12, e.codePointAt(_n79 + 1)), !1)));}return Xs(Ws(e.length, o, s, r, 0, !0));}(c, o, n, t)), function (e, t, n, i, r, s, o, a, l, h) {var c = 0,u = 0,f = 0;var d = e.positionedGlyphs;for (var _e71 = 0; _e71 < n.length; _e71++) {var _r50 = n[_e71];if (_r50 = _r50.trim(), !_r50.length) {u -= i;continue;}var _s39 = d.length;for (var _e72 = 0; _e72 < _r50.length; _e72++) {var _n80 = _r50.codePointAt(_e72),_i68 = t[_n80];_i68 && (Os(_n80) && o !== Ns ? (32 !== _n80 && d.push({ glyph: _n80, x: c, y: 0, vertical: !0 }), c += l + a) : (32 !== _n80 && d.push({ glyph: _n80, x: c, y: u, vertical: !1 }), c += _i68.metrics.advance + a));}if (d.length !== _s39) {var _e73 = c - a;f = Math.max(_e73, f), Zs(d, t, _s39, d.length - 1, .5);}c = 0, u -= i;}var _Ys = Ys(r, void 0),p = _Ys.horizontalAlign,g = _Ys.verticalAlign;!function (e, t, n, i, r, s, o) {var a = (.5 - n) * r,l = -(-i * o + .5) * s;if (a || l) for (var _t84 = 0; _t84 < e.length; _t84++) e[_t84].x += a, e[_t84].y += l;}(d, 0, p, g, f, i, n.length);var m = n.length * i;e.top += -g * m, e.bottom = e.top + m, e.left += -p * f, e.right = e.left + f;}(f, t, d, i, r, 0, h, o, l), !!u.length && f;}var Us = { 9: !0, 10: !0, 11: !0, 12: !0, 13: !0, 32: !0 },Bs = { 10: !0, 32: !0, 38: !0, 40: !0, 41: !0, 43: !0, 45: !0, 47: !0, 173: !0, 183: !0, 8203: !0, 8208: !0, 8211: !0, 8231: !0 };function Gs(e, t, n, i) {var r = Math.pow(e - t, 2);return i ? e < t ? r / 2 : 2 * r : r + Math.abs(n) * n;}function js(e, t) {var n = 0;return 10 === e && (n -= 1e4), 40 !== e && 65288 !== e || (n += 50), 41 !== t && 65289 !== t || (n += 50), n;}function Ws(e, t, n, i, r, s) {var o = null,a = Gs(t, n, r, s);for (var _e74 = 0; _e74 < i.length; _e74++) {var _l9 = i[_e74],_h7 = Gs(t - _l9.x, n, r, s) + _l9.badness;_h7 <= a && (o = _l9, a = _h7);}return { index: e, x: t, priorBreak: o, badness: a };}function Xs(e) {return e ? Xs(e.priorBreak).concat(e.index) : [];}function Ys(e, t) {var n = .5,i = .5;switch (e) {case \"right\":case \"top-right\":case \"bottom-right\":n = t ? 1 : 0;break;case \"left\":case \"top-left\":case \"bottom-left\":n = t ? 0 : 1;}switch (e) {case \"bottom\":case \"bottom-right\":case \"bottom-left\":i = t ? 1 : 0;break;case \"top\":case \"top-right\":case \"top-left\":i = t ? 0 : 1;}return { horizontalAlign: n, verticalAlign: i };}function Zs(e, t, n, i, r) {var s = t[e[i].glyph];if (s) {var _t85 = s.metrics.advance,_o29 = (e[i].x + _t85) * r;if (!_o29) return;for (var _t86 = n; _t86 <= i; _t86++) e[_t86].x -= _o29;}}function qs(e) {if (!function (e) {var _iterator42 = _createForOfIteratorHelper(e),_step42;try {for (_iterator42.s(); !(_step42 = _iterator42.n()).done;) {var _t87 = _step42.value;if (Es(_t87.charCodeAt(0))) return !0;}} catch (err) {_iterator42.e(err);} finally {_iterator42.f();}return !1;}(e)) return e;var t = [],n = [],i = [];var r = 0,s = 0,o = 1,a = 1;var _iterator43 = _createForOfIteratorHelper(e),_step43;try {for (_iterator43.s(); !(_step43 = _iterator43.n()).done;) {var _l10 = _step43.value;var _e75 = _l10.codePointAt(0);Ls(_e75) ? (i.push(_l10), r++) : (o = Es(_e75) ? -1 : 1, a !== o ? (s = r, n.length && (a > 0 && n.reverse(), t.push.apply(t, n)), i.length && (t.splice.apply(t, [s, 0].concat(i)), i.length = 0), a = o, n.length = 0) : i.length && (n.push.apply(n, i), i.length = 0), n.push(_l10), r++);}} catch (err) {_iterator43.e(err);} finally {_iterator43.f();}return i.length && n.push.apply(n, i), n.length && (a > 0 && n.reverse(), t.push.apply(t, n)), t.reverse().join(\"\");}var $s = /\\{ *([\\w_]+) *\\}/g;var Js = function () {function Js(e, t, n, i, r) {_classCallCheck(this, Js);this.feature = e, this.symbolDef = t, this.symbol = n, this.options = r, this._thisReplacer = this._replacer.bind(this), this._fnTypes = i;}return _createClass(Js, [{ key: \"_replacer\", value: function _replacer(e, t) {return this.feature.properties[t] || \"\";} }, { key: \"getShape\", value: function getShape(e, t) {if (this._shape) return this._shape;var _this$_fnTypes = this._fnTypes,n = _this$_fnTypes.textHorizontalAlignmentFn,i = _this$_fnTypes.textVerticalAlignmentFn,r = _this$_fnTypes.markerHorizontalAlignmentFn,s = _this$_fnTypes.markerVerticalAlignmentFn,o = _this$_fnTypes.textWrapWidthFn,a = {},l = this.symbol,h = this.getIconAndGlyph(),c = this.feature.properties;if (h && h.glyph) {var _h$glyph = h.glyph,_e76 = _h$glyph.font,_r51 = _h$glyph.text;if (\"\" === _r51) return null;var _s40 = 24,_u = this.textSize[0] / _s40,_f = 24,_d2 = l.textKeepUpright,_p2 = \"map\" === l.textRotationAlignment && \"line\" === l.textPlacement && !l.isIconText,_g = t.glyphMap[_e76],_m = Ks(n ? n(null, c) : l.textHorizontalAlignment, i ? i(null, c) : l.textVerticalAlignment),_y = 1.2 * _f,_x = function (e) {for (var _t88 = 0; _t88 < e.length; _t88++) if (!ks(e.charAt(_t88).charCodeAt(0))) return !1;return !0;}(_r51),_2 = _x && l.textLetterSpacing / _u || 0,_v = [l.textDx / _u || 0, l.textDy / _u || 0],_b = ((o ? o(null, c) : l.textWrapWidth) || 10 * _f) / _u,_A = {};_A.horizontal = Vs(_r51, _g, _b, _y, _m, 0, _2, _v, _f, Ns, this.options.isVector3D), _x && _p2 && _d2 && (_A.vertical = Vs(_r51, _g, _b, _y, _m, 0, _2, _v, _f, zs)), a.textShape = _A;}if (h && h.icon) {if (!e || !e.positions[h.icon.url]) return null;var _t89 = Ks(r ? r(null, c) : l.markerHorizontalAlignment, s ? s(null, c) : l.markerVerticalAlignment),_n81 = function (e, t, n) {var _Ys2 = Ys(t, n),i = _Ys2.horizontalAlign,r = _Ys2.verticalAlign;n ? i = 1 - i : r = 1 - r;var s = -2048 * i,o = -2048 * r;return { image: e, top: o, bottom: o + 2048, left: s, right: s + 2048 };}(e.positions[h.icon.url], _t89, this.options.isVector3D);this.iconSize || (this.iconSize = _n81.image.displaySize), a.iconShape = _n81;}return this._shape = a, a;} }, { key: \"getIconAndGlyph\", value: function getIconAndGlyph() {if (this.iconGlyph) return this.iconGlyph;var _this$_fnTypes2 = this._fnTypes,e = _this$_fnTypes2.markerFileFn,t = _this$_fnTypes2.markerTypeFn,n = _this$_fnTypes2.markerPathFn,i = _this$_fnTypes2.markerWidthFn,r = _this$_fnTypes2.markerHeightFn,s = _this$_fnTypes2.markerFillFn,o = _this$_fnTypes2.markerFillPatternFileFn,a = _this$_fnTypes2.markerFillOpacityFn,l = _this$_fnTypes2.markerTextFitFn,h = _this$_fnTypes2.markerTextFitPaddingFn,c = _this$_fnTypes2.markerLineColorFn,u = _this$_fnTypes2.markerLineWidthFn,f = _this$_fnTypes2.markerLineOpacityFn,d = _this$_fnTypes2.markerLineDasharrayFn,p = _this$_fnTypes2.markerLinePatternFileFn,g = _this$_fnTypes2.markerPathWidthFn,m = _this$_fnTypes2.markerPathHeightFn,y = _this$_fnTypes2.textNameFn,x = _this$_fnTypes2.textFaceNameFn,_ = this.options.zoom,v = {},b = this.symbol,A = this.symbolDef,T = this.feature.properties,w = e ? e(null, T) : b.markerFile,S = t ? t(null, T) : b.markerType,M = w || S || b.markerPath,P = !Je(this.symbolDef.textName);var I, C;if (M) {I = function (e, t, n, i, r, s) {if (Je(t.markerWidth) && Je(t.markerHeight)) return null;var o = \"__fn_markerWidth\".trim(),a = \"__fn_markerHeight\".trim();var l = t.markerWidth || 0,h = t.markerHeight || 0;return Qe(l) && (\"identity\" !== l.type ? l = vs(l) : (l = e.markerWidth, e[o] && (l = e[o](i, n)), Qe(l) && (l = \"identity\" === l.type ? r(i, n) : vs(l)))), Qe(h) && (\"identity\" !== h.type ? h = vs(h) : (h = e.markerHeight, e[a] && (h = e[a](i, n)), Qe(h) && (h = \"identity\" === h.type ? s(i, n) : vs(h)))), [l, h];}(b, this.symbolDef, T, _, i, r) || [0, 0];var _e77 = b.markerTextFit;if (l && (_e77 = l(_, T)), _e77 && A.textName && \"none\" !== _e77) {var _t90 = A.textSize;var _n82 = A.textName;ie(_n82) && (_n82 = re(_n82)(_, T));var _i69 = Ss(_n82, T);if (_i69) {var _n83 = \"__fn_textSize\".trim(),_r52 = \"__fn_textSize_0\".trim();ie(_t90) && !A[_n83] && (A[_r52] = re(_t90), A[_n83] = function (e, t) {var n = A[_r52](e, t);return ie(n) ? re(n)(e, t) : n;});var _s41 = _s(A, A, T, _);if (\"width\" !== _e77 && \"both\" !== _e77 || (I[0] = _s41[0] * _i69.length), \"height\" !== _e77 && \"both\" !== _e77 || (I[1] = _s41[1]), _s41[0] && _s41[1]) {var _e78 = b.markerTextFitPadding || [0, 0, 0, 0];h && (_e78 = h(_, T)), I[0] += _e78[1] + _e78[3], I[1] += _e78[0] + _e78[2];}} else I[0] = I[1] = -1;}}if (P && (C = _s(b, this.symbolDef, T, _)), !C && !I) return v;if (I && (I[0] = Math.ceil(I[0]), I[1] = Math.ceil(I[1])), C && (C[0] = Math.ceil(C[0]), C[1] = Math.ceil(C[1])), this.iconSize = I, this.textSize = C, M && I[0] >= 0 && I[1] >= 0) {var _e79;if (S) {var _t91 = {};if (_t91.markerType = S, \"path\" === S && (_t91.markerPath = n ? n(null, T) : b.markerPath, _t91.markerPathWidth = g ? g(null, T) : b.markerPathWidth, _t91.markerPathHeight = m ? m(null, T) : b.markerPathHeight), i) {var _e80 = i(null, T);Je(_e80) || (_t91.markerWidth = _e80);} else b.markerWidth >= 0 && (_t91.markerWidth = b.markerWidth);if (r) {var _e81 = r(null, T);Je(_e81) || (_t91.markerHeight = _e81);} else b.markerHeight >= 0 && (_t91.markerHeight = b.markerHeight);if (s) {var _e82 = s(null, T);Je(_e82) || (_t91.markerFill = _e82);} else b.markerFill && (_t91.markerFill = b.markerFill);if (o) {var _e83 = o(null, T);Je(_e83) || (_t91.markerFillPatternFile = _e83);} else b.markerFillPatternFile && (_t91.markerFillPatternFile = b.markerFillPatternFile);if (a) {var _e84 = a(null, T);Je(_e84) || (_t91.markerFillOpacity = _e84);} else b.markerFillOpacity >= 0 && (_t91.markerFillOpacity = b.markerFillOpacity);if (c) {var _e85 = c(null, T);Je(_e85) || (_t91.markerLineColor = _e85);} else b.markerLineColor && (_t91.markerLineColor = b.markerLineColor);if (u) {var _e86 = u(null, T);Je(_e86) || (_t91.markerLineWidth = _e86);} else b.markerLineWidth >= 0 && (_t91.markerLineWidth = b.markerLineWidth);if (f) {var _e87 = f(null, T);Je(_e87) || (_t91.markerLineOpacity = _e87);} else b.markerLineOpacity >= 0 && (_t91.markerLineOpacity = b.markerLineOpacity);if (d) {var _e88 = d(null, T);Je(_e88) || (_t91.markerLineDasharray = _e88);} else b.markerLineDasharray && (_t91.markerLineDasharray = b.markerLineDasharray);if (p) {var _e89 = p(null, T);Je(_e89) || (_t91.markerLinePatternFile = _e89);} else b.markerLinePatternFile && (_t91.markerLinePatternFile = b.markerLinePatternFile);_e79 = \"vector://\" + JSON.stringify(_t91);} else _e79 = w ? w.replace($s, this._thisReplacer) : b.markerPath ? function (e, t, n) {if (!e.markerPath) return null;var i = 1;var r = function (e) {var t = { stroke: { stroke: e.markerLineColor, \"stroke-width\": e.markerLineWidth, \"stroke-opacity\": e.markerLineOpacity, \"stroke-dasharray\": null, \"stroke-linecap\": \"butt\", \"stroke-linejoin\": \"round\" }, fill: { fill: e.markerFill, \"fill-opacity\": e.markerFillOpacity } };return 0 === t.stroke[\"stroke-width\"] && (t.stroke[\"stroke-opacity\"] = 0), t;}(e);Ke(e.markerOpacity) && (i = e.markerOpacity), Ke(e.opacity) && (i *= e.opacity);var s = {};if (r) {for (var _e90 in r.stroke) it(r.stroke, _e90) && (Je(r.stroke[_e90]) || (s[_e90] = r.stroke[_e90]));for (var _e91 in r.fill) it(r.fill, _e91) && (Je(r.fill[_e91]) || (s[_e91] = r.fill[_e91]));}var o = Array.isArray(e.markerPath) ? e.markerPath : [e.markerPath];var a;var l = [];for (var _e92 = 0; _e92 < o.length; _e92++) a = et(o[_e92]) ? { path: o[_e92] } : o[_e92], a = $e({}, a, s), a.d = a.path, delete a.path, l.push(a);var h = ['\");for (var _e93 = 0; _e93 < l.length; _e93++) {var _t92 = \"\", h.push(_t92);}return h.push(\"\"), \"data:image/svg+xml;base64,\" + btoa(h.join(\" \"));}(b, I[0], I[1]) : null;v.icon = { url: _e79, iconSize: I, textSize: C };}if (P) {var _e94 = y ? y(this.options.zoom, T) : b.textName;if (_e94 || 0 === _e94) {var _t93 = Ts(x ? x(null, T) : b.textFaceName);var _n85 = Ss(_e94, T);_n85 && _n85.length && (_n85 = qs(_n85), v.glyph = { font: _t93, text: _n85 });}}return this.iconGlyph = v, v;} }]);}();function Ks(e, t) {t && \"middle\" !== t || (t = \"center\"), e && \"middle\" !== e || (e = \"center\");var n = \"center\" !== t ? t : \"\";return n += \"center\" !== e ? (n.length ? \"-\" : \"\") + e : \"\", n;}function Qs(e, t, n, i, r) {var o = [];var a;for (var _l11 = 0; _l11 < e.length; _l11++) {var _h8 = e[_l11];var _c3 = void 0,_u2 = !1;for (var _e95 = 0; _e95 < _h8.length - 1; _e95++) {var _l12 = _h8[_e95],_f2 = _h8[_e95 + 1];_l12.x < t && _f2.x < t || (_l12.x < t ? (a = _l12, _l12 = new s(t, _l12.y + (_f2.y - _l12.y) * ((t - _l12.x) / (_f2.x - _l12.x)))._round(), _l12.z = a.z + (_f2.z - a.z) * ((t - a.x) / (_f2.x - a.x)), _u2 = !0) : _f2.x < t && (a = _f2, _f2 = new s(t, _l12.y + (_f2.y - _l12.y) * ((t - _l12.x) / (_f2.x - _l12.x)))._round(), _f2.z = _l12.z + (a.z - _l12.z) * ((t - _l12.x) / (a.x - _l12.x)), _u2 = !0), _l12.y < n && _f2.y < n || (_l12.y < n ? (a = _l12, _l12 = new s(_l12.x + (_f2.x - _l12.x) * ((n - _l12.y) / (_f2.y - _l12.y)), n)._round(), _l12.z = a.z + (_f2.z - a.z) * ((n - a.y) / (_f2.y - a.y)), _u2 = !0) : _f2.y < n && (a = _f2, _f2 = new s(_l12.x + (_f2.x - _l12.x) * ((n - _l12.y) / (_f2.y - _l12.y)), n)._round(), _f2.z = _l12.z + (a.z - _l12.z) * ((n - _l12.y) / (a.y - _l12.y)), _u2 = !0), _l12.x >= i && _f2.x >= i || (_l12.x >= i ? (a = _l12, _l12 = new s(i, _l12.y + (_f2.y - _l12.y) * ((i - _l12.x) / (_f2.x - _l12.x)))._round(), _l12.z = a.z + (_f2.z - a.z) * ((i - a.x) / (_f2.x - a.x)), _u2 = !0) : _f2.x >= i && (a = _f2, _f2 = new s(i, _l12.y + (_f2.y - _l12.y) * ((i - _l12.x) / (_f2.x - _l12.x)))._round(), _f2.z = _l12.z + (a.z - _l12.z) * ((i - _l12.x) / (a.x - _l12.x)), _u2 = !0), _l12.y >= r && _f2.y >= r || (_l12.y >= r ? (a = _l12, _l12 = new s(_l12.x + (_f2.x - _l12.x) * ((r - _l12.y) / (_f2.y - _l12.y)), r)._round(), _l12.z = a.z + (_f2.z - a.z) * ((r - a.y) / (_f2.y - a.y)), _u2 = !0) : _f2.y >= r && (a = _f2, _f2 = new s(_l12.x + (_f2.x - _l12.x) * ((r - _l12.y) / (_f2.y - _l12.y)), r)._round(), _f2.z = _l12.z + (a.z - _l12.z) * ((r - _l12.y) / (a.y - _l12.y)), _u2 = !0), _c3 && _l12.equals(_c3[_c3.length - 1]) || (_c3 = [_l12], o.push(_c3)), _u2 && (_c3.clipped = !0), _c3.push(_f2)))));}}return o;}var eo = function (_s42) {function eo(e, t, n, i) {var _this5;_classCallCheck(this, eo);_this5 = _callSuper(this, eo, [e, t]), _this5.angle = n, void 0 !== i && (_this5.segment = i);return _this5;}_inherits(eo, _s42);return _createClass(eo, [{ key: \"clone\", value: function clone() {return new eo(this.x, this.y, this.angle, this.segment);} }]);}(s);function to(e, t, n, i, r) {if (void 0 === t.segment) return !0;var s = t,o = t.segment + 1,a = 0;for (; a > -n / 2;) {if (o--, o < 0) return !1;a -= e[o].dist(s), s = e[o];}a += e[o].dist(e[o + 1]), o++;var l = [];var h = 0;for (; a < n / 2;) {var _t94 = e[o - 1],_n86 = e[o],_s43 = e[o + 1];if (!_s43) return !1;var _c4 = _t94.angleTo(_n86) - _n86.angleTo(_s43);for (_c4 = Math.abs((_c4 + 3 * Math.PI) % (2 * Math.PI) - Math.PI), l.push({ distance: a, angleDelta: _c4 }), h += _c4; a - l[0].distance > i;) h -= l.shift().angleDelta;if (h > r) return !1;o++, a += _n86.dist(_s43);}return !0;}function no(e, t, n, i, r, s, o, a, l, h, c) {var u = function (e, t, n) {return e ? .6 * t * n : 0;}(i, s, o),f = function (e, t) {return Math.max(e ? e.right - e.left : 0, 0);}(i),d = 0 === e[0].x || e[0].x === l || 0 === e[0].y || e[0].y === l;return t - f * o < t / 4 && (t = f * o + t / 4), io(e, d ? t / 2 * a % t : (f / 2 + 2 * s) * o * a % t, t, u, n, f * o, d, !1, l, h, c);}function io(e, t, n, i, r, s, o, a, l, h, c) {var u = 0;var f = s / 2,d = function (e) {var t = 0;for (var _n87 = 0; _n87 < e.length - 1; _n87++) t += e[_n87].dist(e[_n87 + 1]);return t;}(e);var p = 0,g = t - n,m = [];for (var _t95 = 0; _t95 < e.length - 1; _t95++) {var _o30 = e[_t95],_a13 = e[_t95 + 1],_y2 = _o30.dist(_a13),_x2 = _a13.angleTo(_o30);for (; g + n < p + _y2;) {g += n;var _3 = (g - p) / _y2,_v2 = ro(_o30.x, _a13.x, _3),_b2 = ro(_o30.y, _a13.y, _3),_A2 = ro(_o30.z || 0, _a13.z || 0, _3);if (_v2 >= 0 && _v2 < l && _b2 >= 0 && _b2 < l && g - f >= 0 && g + f <= d) {var _n88 = new eo(_v2, _b2, _x2, _t95);_n88.z = _A2, h && (_n88.axis = [_o30.y - _b2, _v2 - _o30.x], _n88.angleR = _A2 === (_o30.z || 0) ? 0 : Math.atan(.9 * (_A2 - (_o30.z || 0)) * c / _o30.dist(_n88))), _n88.line = e, _n88._round(), !i || to(e, _n88, s, i, r) ? m.push(_n88) : i && u++;}}p += _y2;}return a || m.length || o || (m = io(e, p / 2, n, i, r, s, o, !0, l, h, c)), m.countOutOfAngle = u, m;}function ro(e, t, n) {return e * (1 - n) + t * n;}var so = { exports: {} };so.exports = function () {function e(n, i, r, s, o) {for (; s > r;) {if (s - r > 600) {var a = s - r + 1,l = i - r + 1,h = Math.log(a),c = .5 * Math.exp(2 * h / 3),u = .5 * Math.sqrt(h * c * (a - c) / a) * (l - a / 2 < 0 ? -1 : 1);e(n, i, Math.max(r, Math.floor(i - l * c / a + u)), Math.min(s, Math.floor(i + (a - l) * c / a + u)), o);}var f = n[i],d = r,p = s;for (t(n, r, i), o(n[s], f) > 0 && t(n, r, s); d < p;) {for (t(n, d, p), d++, p--; o(n[d], f) < 0;) d++;for (; o(n[p], f) > 0;) p--;}0 === o(n[r], f) ? t(n, r, p) : t(n, ++p, s), p <= i && (r = p + 1), i <= p && (s = p - 1);}}function t(e, t, n) {var i = e[t];e[t] = e[n], e[n] = i;}function n(e, t) {return e < t ? -1 : e > t ? 1 : 0;}return function (t, i, r, s, o) {e(t, i, r || 0, s || t.length - 1, o || n);};}();var oo = n(so.exports);function ao(e, t) {var n = e.length;if (n <= 1) return [e];var i = [];var r, s;for (var _t96 = 0; _t96 < n; _t96++) {var _n89 = b(e[_t96]);0 !== _n89 && (e[_t96].area = Math.abs(_n89), void 0 === s && (s = _n89 < 0), s === _n89 < 0 ? (r && i.push(r), r = [e[_t96]]) : r.push(e[_t96]));}if (r && i.push(r), t > 1) for (var _e96 = 0; _e96 < i.length; _e96++) i[_e96].length <= t || (oo(i[_e96], t, 1, i[_e96].length - 1, lo), i[_e96] = i[_e96].slice(0, t));return i;}function lo(e, t) {return t.area - e.area;}var ho = function () {function ho() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : co;_classCallCheck(this, ho);if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0) for (var _e97 = (this.length >> 1) - 1; _e97 >= 0; _e97--) this._down(_e97);}return _createClass(ho, [{ key: \"push\", value: function push(e) {this.data.push(e), this.length++, this._up(this.length - 1);} }, { key: \"pop\", value: function pop() {if (0 === this.length) return;var e = this.data[0],t = this.data.pop();return this.length--, this.length > 0 && (this.data[0] = t, this._down(0)), e;} }, { key: \"peek\", value: function peek() {return this.data[0];} }, { key: \"_up\", value: function _up(e) {var t = this.data,n = this.compare,i = t[e];for (; e > 0;) {var _r53 = e - 1 >> 1,_s44 = t[_r53];if (n(i, _s44) >= 0) break;t[e] = _s44, e = _r53;}t[e] = i;} }, { key: \"_down\", value: function _down(e) {var t = this.data,n = this.compare,i = this.length >> 1,r = t[e];for (; e < i;) {var _i70 = 1 + (e << 1),_s45 = t[_i70];var _o31 = _i70 + 1;if (_o31 < this.length && n(t[_o31], _s45) < 0 && (_i70 = _o31, _s45 = t[_o31]), n(_s45, r) >= 0) break;t[e] = _s45, e = _i70;}t[e] = r;} }]);}();function co(e, t) {return e < t ? -1 : e > t ? 1 : 0;}function uo(e, t, n) {var i = t.distSqr(n);if (0 === i) return e.distSqr(t);var r = ((e.x - t.x) * (n.x - t.x) + (e.y - t.y) * (n.y - t.y)) / i;return r < 0 ? e.distSqr(t) : r > 1 ? e.distSqr(n) : e.distSqr(n.sub(t)._mult(r)._add(t));}function fo(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;var i = 1 / 0,r = 1 / 0,o = -1 / 0,a = -1 / 0;var l = e[0];for (var _e98 = 0; _e98 < l.length; _e98++) {var _t97 = l[_e98];(!_e98 || _t97.x < i) && (i = _t97.x), (!_e98 || _t97.y < r) && (r = _t97.y), (!_e98 || _t97.x > o) && (o = _t97.x), (!_e98 || _t97.y > a) && (a = _t97.y);}var h = o - i,c = a - r,u = Math.min(h, c);var f = u / 2;var d = new ho([], po);if (0 === u) return new s(i, r);for (var _t98 = i; _t98 < o; _t98 += u) for (var _n90 = r; _n90 < a; _n90 += u) d.push(new go(_t98 + f, _n90 + f, f, e));var p = function (e) {var t = 0,n = 0,i = 0;var r = e[0];for (var _e99 = 0, _s46 = r.length, _o32 = _s46 - 1; _e99 < _s46; _o32 = _e99++) {var _s47 = r[_e99],_a14 = r[_o32],_l13 = _s47.x * _a14.y - _a14.x * _s47.y;n += (_s47.x + _a14.x) * _l13, i += (_s47.y + _a14.y) * _l13, t += 3 * _l13;}return new go(n / t, i / t, 0, e);}(e),g = d.length;for (; d.length;) {var _i71 = d.pop();(_i71.d > p.d || !p.d) && (p = _i71, n && console.log(\"found best %d after %d probes\", Math.round(1e4 * _i71.d) / 1e4, g)), _i71.max - p.d <= t || (f = _i71.h / 2, d.push(new go(_i71.p.x - f, _i71.p.y - f, f, e)), d.push(new go(_i71.p.x + f, _i71.p.y - f, f, e)), d.push(new go(_i71.p.x - f, _i71.p.y + f, f, e)), d.push(new go(_i71.p.x + f, _i71.p.y + f, f, e)), g += 4);}return n && (console.log(\"num probes: \".concat(g)), console.log(\"best distance: \".concat(p.d))), p.p;}function po(e, t) {return t.max - e.max;}function go(e, t, n, i) {this.p = new s(e, t), this.h = n, this.d = function (e, t) {var n = !1,i = 1 / 0;for (var _r54 = 0; _r54 < t.length; _r54++) {var _s48 = t[_r54];for (var _t99 = 0, _r55 = _s48.length, _o33 = _r55 - 1; _t99 < _r55; _o33 = _t99++) {var _r56 = _s48[_t99],_a15 = _s48[_o33];_r56.y > e.y != _a15.y > e.y && e.x < (_a15.x - _r56.x) * (e.y - _r56.y) / (_a15.y - _r56.y) + _r56.x && (n = !n), i = Math.min(i, uo(e, _r56, _a15));}}return (n ? 1 : -1) * Math.sqrt(i);}(this.p, i), this.max = this.d + this.h * Math.SQRT2;}function mo(e, t, n, i, r, s, o, a, l, h) {var c = e.feature,u = e.iconSize,f = e.textSize,d = e.symbol,p = u || f ? 24 : 0,g = r * (f ? f[0] / p : 1);if (\"line\" === o) {var _e100 = [];_e100.countOutOfAngle = 0;var _r57 = c.geometry;s && (_r57 = Qs(c.geometry, 0, 0, s, s));for (var _o34 = 0; _o34 < _r57.length; _o34++) {var _c5 = no(_r57[_o34], a, n, d.isIconText ? null : i && i.vertical || i && i.horizontal || i, 0, p, d.isIconText ? 1 : g, 1, s || 1 / 0, l, h);if (d.textPlacement && !d.isIconText) for (var _e101 = 0; _e101 < _c5.length; _e101++) _c5[_e101].startIndex = t.length / 3;if (_e100.push.apply(_e100, _c5), d.textPlacement && !d.isIconText) for (var _e102 = 0; _e102 < _r57[_o34].length; _e102++) t.push(_r57[_o34][_e102].x, _r57[_o34][_e102].y, _r57[_o34][_e102].z || 0);_e100.countOutOfAngle += _c5.countOutOfAngle || 0;}return _e100;}return yo(c, o, s);}function yo(e, t, n, i, r) {var s = [];if (3 === e.type) {var _o35 = ao(e.geometry, 0);for (var _e103 = 0; _e103 < _o35.length; _e103++) {var _a16 = _o35[_e103];if (\"vertex\" === t) for (var _e104 = 0; _e104 < _a16.length; _e104++) {var _t100 = _a16[_e104];for (var _o36 = 0; _o36 < _t100.length; _o36++) S(_t100[_o36], n) || (s.push(_t100[_o36]), i && (0 === _o36 ? xo(_t100[_o36], _t100[_o36], _t100[_e104 + 1], r) : xo(_t100[_o36], _t100[_o36 - 1], _t100[_o36], r)));} else if (\"vertex-first\" === t) {var _e105 = _a16[0];_e105 && _e105[0] && !S(_e105[0], n) && (s.push(_e105[0]), i && xo(_e105[0], _e105[0], _e105[1], r));} else if (\"vertex-last\" === t || \"vertex-firstlast\" === t) {var _e106 = _a16[0];if (\"vertex-firstlast\" === t && _e106 && _e106[0] && !S(_e106[0], n) && (s.push(_e106[0]), i && xo(_e106[0], _e106[0], _e106[1], r)), _e106 && _e106[_e106.length - 1] && !S(_e106[_e106.length - 1], n)) {var _t101 = _e106.length - 1;s.push(_e106[_t101]), i && xo(_e106[_t101], _e106[_t101 - 1], _e106[_t101], r);}} else {var _e107 = fo(_a16, 16);S(_e107, n) || s.push(_e107);}}} else if (2 === e.type) for (var _o37 = 0; _o37 < e.geometry.length; _o37++) {var _a17 = e.geometry[_o37];if (\"vertex\" === t) for (var _e108 = 0; _e108 < _a17.length; _e108++) S(_a17[_e108], n) || (s.push(_a17[_e108]), i && (0 === _e108 ? xo(_a17[_e108], _a17[_e108], _a17[_e108 + 1], r) : xo(_a17[_e108], _a17[_e108 - 1], _a17[_e108], r)));else if (\"vertex-last\" === t || \"vertex-firstlast\" === t) {if (\"vertex-firstlast\" !== t || S(_a17[0], n) || (s.push(_a17[0]), i && xo(_a17[0], _a17[0], _a17[1], r)), _a17 && _a17[_a17.length - 1] && !S(_a17[_a17.length - 1], n)) {var _e109 = _a17.length - 1;s.push(_a17[_e109]), i && xo(_a17[_e109], _a17[_e109 - 1], _a17[_e109], r);}} else S(_a17[0], n) || (s.push(_a17[0]), i && xo(_a17[0], _a17[0], _a17[1], r));} else if (1 === e.type) for (var _t102 = 0; _t102 < e.geometry.length; _t102++) {var _r58 = e.geometry[_t102];for (var _e110 = 0; _e110 < _r58.length; _e110++) {var _t103 = _r58[_e110];S(_t103, n) || (i && (_t103.xRotation = 0, _t103.yRotation = 0, _t103.zRotation = 0), s.push(_t103));}}return s;}function xo(e, t, n, i) {if (e.xRotation || e.yRotation || e.zRotation) return e;var r = n.x - t.x,s = t.y - n.y,o = (n.z - t.z) * i,a = Math.atan2(s, r);e.zRotation = a;var l = Math.atan2(o, Math.sqrt(r * r + s * s));return e.xyRotation = l, e;}function _o(e, t) {var n = {},i = {},r = [];var s = 0;function o(t) {r.push(e[t]), s++;}function a(e, t, n) {var s = i[e];return delete i[e], i[t] = s, r[s].geometry[0].pop(), r[s].geometry[0] = r[s].geometry[0].concat(n[0]), s;}function l(e, t, i) {var s = n[t];return delete n[t], n[e] = s, r[s].geometry[0].shift(), r[s].geometry[0] = i[0].concat(r[s].geometry[0]), s;}function h(e, t, n) {var i = n ? t[0][t[0].length - 1] : t[0][0];return \"\".concat(e, \":\").concat(i.x, \":\").concat(i.y);}for (var _c6 = 0; _c6 < e.length; _c6++) {var _u3 = e[_c6],_f3 = _u3.geometry;if (!_f3) continue;var _d3 = _u3.properties[t] ? _u3.properties[t].toString() : null;if (!_d3) {o(_c6);continue;}var _p3 = h(_d3, _f3),_g2 = h(_d3, _f3, !0);if (_p3 in i && _g2 in n && i[_p3] !== n[_g2]) {var _e111 = l(_p3, _g2, _f3),_t104 = a(_p3, _g2, r[_e111].geometry);delete n[_p3], delete i[_g2], i[h(_d3, r[_t104].geometry, !0)] = _t104, r[_e111].geometry = null;} else _p3 in i ? a(_p3, _g2, _f3) : _g2 in n ? l(_p3, _g2, _f3) : (o(_c6), n[_p3] = s - 1, i[_g2] = s - 1);}return r.filter(function (e) {return e.geometry;});}var vo = \"__index\";function bo(e, t, n, i) {var r = (vo + \"\").trim(),s = function (e, t, n, i) {var r = (vo + \"\").trim(),s = n.mergeOnPropertyFn;if (!t.mergeOnProperty) return [];if (!M(o = t.mergeOnProperty) && (\"string\" == typeof o || null !== o.constructor && o.constructor === String)) return [{ features: e, property: t.mergeOnProperty }];var o;var a = [],l = {},h = [];for (var _n91 = 0; _n91 < e.length; _n91++) {e[_n91][r] = _n91;var _o38 = e[_n91].properties = e[_n91].properties || {};_o38.$layer = e[_n91].layer, _o38.$type = e[_n91].type;var _c7 = s ? s(i, _o38) : t.mergeOnProperty;M(_c7) ? h.push(e[_n91]) : (void 0 === l[_c7] && (l[_c7] = a.length, a.push({ features: [], property: _c7 })), a[l[_c7]].features.push(e[_n91]));}return h.length && a.push({ features: h }), a;}(e, t, n, i);if (s.length) {var _e112 = [];for (var _t105 = 0; _t105 < s.length; _t105++) s[_t105].property ? _e112.push(_o(s[_t105].features, s[_t105].property)) : _e112.push(s[_t105].features);if (1 === _e112.length) return _e112[0];{var _t106 = [];for (var _n92 = 0; _n92 < _e112.length; _n92++) _t106 = _t106.concat(_e112[_n92]);return _t106.sort(function (e, t) {return e[r] - t[r];}), _t106;}}return [];}var Ao = function (_gs) {function Ao(e, t, n) {var _this6;_classCallCheck(this, Ao);_this6 = _callSuper(this, Ao, [e, t, n]), _this6._textPlacement = t.textPlacement, _this6._fnTypes.textPlacementFn && (_this6._textPlacement = _this6._fnTypes.textPlacementFn(_this6.options.zoom));return _this6;}_inherits(Ao, _gs);return _createClass(Ao, [{ key: \"createStyledVector\", value: function createStyledVector(e, t, n, i, r, s) {var o = new Js(e, this.symbolDef, t, n, i),a = o.getIconAndGlyph();if (a.icon && !this.options.atlas) {var _a$icon = a.icon,_e113 = _a$icon.url,_t107 = _a$icon.iconSize;r[_e113] || (r[_e113] = a.icon.iconSize), r[_e113][0] < _t107[0] && (r[_e113][0] = _t107[0]), r[_e113][1] < _t107[1] && (r[_e113][1] = _t107[1]);}if (a.glyph && !this.options.atlas) {var _a$glyph = a.glyph,_e114 = _a$glyph.font,_t108 = _a$glyph.text,_n93 = s[_e114] = s[_e114] || {};var _iterator44 = _createForOfIteratorHelper(_t108),_step44;try {for (_iterator44.s(); !(_step44 = _iterator44.n()).done;) {var _e115 = _step44.value;_n93[_e115.codePointAt(0)] = 1;}} catch (err) {_iterator44.e(err);} finally {_iterator44.f();}\"line\" === this._textPlacement && (s.options = { isCharsCompact: !1 });}return this.options.allowEmptyPack || a.icon || a.glyph ? o : null;} }, { key: \"getFormat\", value: function getFormat(e) {var t = \"text\" === this.options.pluginType,n = \"line\" === this._textPlacement && !e.isIconText,i = this.getPackSDFFormat(e);i.push.apply(i, _toConsumableArray(this._getTextFnTypeFormats())), n || i.push.apply(i, _toConsumableArray(this._getMarkerFnTypeFormats()));var _this$_fnTypes3 = this._fnTypes,r = _this$_fnTypes3.markerOpacityFn,s = _this$_fnTypes3.textOpacityFn,o = _this$_fnTypes3.markerPitchAlignmentFn,a = _this$_fnTypes3.textPitchAlignmentFn,l = _this$_fnTypes3.markerRotationAlignmentFn,h = _this$_fnTypes3.textRotationAlignmentFn,c = _this$_fnTypes3.markerRotationFn,u = _this$_fnTypes3.textRotationFn,f = _this$_fnTypes3.markerAllowOverlapFn,d = _this$_fnTypes3.textAllowOverlapFn,p = _this$_fnTypes3.markerIgnorePlacementFn,g = _this$_fnTypes3.textIgnorePlacementFn;return r ? i.push({ type: Uint8Array, width: 2, name: \"aColorOpacity\" }) : s && i.push({ type: Uint8Array, width: 1, name: \"aColorOpacity\" }), (o || a) && i.push({ type: Uint8Array, width: t ? 1 : 2, name: \"aPitchAlign\" }), (l || h) && i.push({ type: Uint8Array, width: t ? 1 : 2, name: \"aRotationAlign\" }), (c || u) && i.push({ type: Uint16Array, width: t ? 1 : 2, name: \"aRotation\" }), (f || d || p || g) && i.push({ type: Uint8Array, width: 1, name: \"aOverlap\" }), i;} }, { key: \"_is3DPitchText\", value: function _is3DPitchText() {return this.hasMapPitchAlign;} }, { key: \"_getTextFnTypeFormats\", value: function _getTextFnTypeFormats() {var _this$_fnTypes4 = this._fnTypes,e = _this$_fnTypes4.textFillFn,t = _this$_fnTypes4.textSizeFn,n = _this$_fnTypes4.textHaloFillFn,i = _this$_fnTypes4.textHaloRadiusFn,r = _this$_fnTypes4.textHaloOpacityFn,s = _this$_fnTypes4.textDxFn,o = _this$_fnTypes4.textDyFn,a = [];return e && a.push({ type: Uint8Array, width: 4, name: \"aTextFill\" }), t && a.push({ type: Uint8Array, width: 1, name: \"aTextSize\" }), n && a.push({ type: Uint8Array, width: 4, name: \"aTextHaloFill\" }), (i || r) && a.push({ type: Uint8Array, width: 2, name: \"aTextHalo\" }), s && a.push({ type: Int8Array, width: 1, name: \"aTextDx\" }), o && a.push({ type: Int8Array, width: 1, name: \"aTextDy\" }), a;} }, { key: \"_getMarkerFnTypeFormats\", value: function _getMarkerFnTypeFormats() {var _this$_fnTypes5 = this._fnTypes,e = _this$_fnTypes5.markerWidthFn,t = _this$_fnTypes5.markerHeightFn,n = _this$_fnTypes5.markerDxFn,i = _this$_fnTypes5.markerDyFn,r = _this$_fnTypes5.textDxFn,s = _this$_fnTypes5.textDyFn,o = [];return e && o.push({ type: this.options.markerWidthType || Uint8Array, width: 1, name: \"aMarkerWidth\" }), t && o.push({ type: this.options.markerHeightType || Uint8Array, width: 1, name: \"aMarkerHeight\" }), (n || r) && o.push({ type: Int8Array, width: 1, name: \"aMarkerDx\" }), (i || s) && o.push({ type: Int8Array, width: 1, name: \"aMarkerDy\" }), o;} }, { key: \"_prepareFnTypes\", value: function _prepareFnTypes() {this.iconAtlas || (this._fnTypes.markerWidthFn = this._fnTypes.markerHeightFn = this._fnTypes.markerDxFn = this._fnTypes.markerDyFn = this._fnTypes.markerPitchAlignmentFn = this._fnTypes.markerRotationAlignmentFn = this._fnTypes.markerRotationFn = this._fnTypes.markerAllowOverlapFn = this._fnTypes.markerIgnorePlacementFn = this._fnTypes.markerOpacityFn = null), this.glyphAtlas || (this._fnTypes.textFillFn = this._fnTypes.textSizeFn = this._fnTypes.textHaloFillFn = this._fnTypes.textHaloRadiusFn = this._fnTypes.textHaloOpacityFn = this._fnTypes.textDxFn = this._fnTypes.textDyFn = this._fnTypes.textPitchAlignmentFn = this._fnTypes.textRotationAlignmentFn = this._fnTypes.textRotationFn = this._fnTypes.textAllowOverlapFn = this._fnTypes.textIgnorePlacementFn = this._fnTypes.textOpacityFn = null);} }, { key: \"createDataPack\", value: function createDataPack() {if (!this.iconAtlas && !this.glyphAtlas) {if (!this.options.allowEmptyPack) return null;this.empty = !0;}this._prepareFnTypes(), this.countOutOfAngle = 0, this.lineVertex = [];var e = _superPropGet(Ao, \"createDataPack\", this, 1).apply(this, arguments);return e ? (e.lineVertex = new Int16Array(this.lineVertex), e.buffers.push(e.lineVertex.buffer), e) : null;} }, { key: \"placeVector\", value: function placeVector(e, t) {var _this7 = this;var n = e.getShape(this.iconAtlas, this.glyphAtlas);if (!n) return;var i = n.iconShape,r = n.textShape,o = !i || !i.image,a = !r || !r.horizontal && !r.vertical;if (!this.options.allowEmptyPack && o && a) return;var l = this._getAnchors(e, r || i, t);if (this.countOutOfAngle += l.countOutOfAngle || 0, 0 === l.length) return;var h = this.data,c = this.needAltitudeAttribute() ? 2 : 3;var u = this.data.aPosition.getLength() / c;var f = e.symbol,d = e.feature.properties,p = \"line\" === this._textPlacement && !f.isIconText,g = !a,m = !o,y = g && p && function (e) {var t = 0;for (var _n94 = 0; _n94 < e.length; _n94++) if (Os(e.charAt(_n94).charCodeAt(0))) t = 0;else if (t++, t >= 1) return !1;return !0;}(e.getIconAndGlyph().glyph.text) ? 1 : 0,_this$_fnTypes6 = this._fnTypes,x = _this$_fnTypes6.textFillFn,_ = _this$_fnTypes6.textSizeFn,v = _this$_fnTypes6.textHaloFillFn,b = _this$_fnTypes6.textHaloRadiusFn,A = _this$_fnTypes6.textHaloOpacityFn,T = _this$_fnTypes6.textDxFn,I = _this$_fnTypes6.textDyFn,C = _this$_fnTypes6.textPitchAlignmentFn,k = _this$_fnTypes6.textRotationAlignmentFn,F = _this$_fnTypes6.textRotationFn,O = _this$_fnTypes6.textAllowOverlapFn,R = _this$_fnTypes6.textIgnorePlacementFn,E = _this$_fnTypes6.textOpacityFn,D = _this$_fnTypes6.markerWidthFn,L = _this$_fnTypes6.markerHeightFn,H = _this$_fnTypes6.markerDxFn,N = _this$_fnTypes6.markerDyFn,z = _this$_fnTypes6.markerPitchAlignmentFn,V = _this$_fnTypes6.markerRotationAlignmentFn,U = _this$_fnTypes6.markerRotationFn,B = _this$_fnTypes6.markerAllowOverlapFn,G = _this$_fnTypes6.markerIgnorePlacementFn,j = _this$_fnTypes6.markerOpacityFn;var W,X,Y,Z,q,$ = [0, 0, 0, 0],J = 14,K = [0, 0, 0, 0],Q = 0,ee = 0,te = 0,ne = 0,re = 0,se = 0,oe = 0,ae = 0,le = 0,he = 0,ce = 0,ue = 0,fe = 0,de = 0;if (g) {var _t109 = e.getIconAndGlyph().glyph.font;Y = function (e, t, n) {var i = e.positionedGlyphs,r = [];for (var _o39 = 0; _o39 < i.length; _o39++) {var _a18 = i[_o39],_l14 = n[_a18.glyph];if (!_l14) continue;var _h9 = _l14.rect;if (!_h9) continue;var _c8 = 4,_u4 = _l14.metrics.advance / 2,_f4 = _l14.metrics.height / 2,_d4 = t ? [_a18.x + _u4, 0] : [0, 0],_p4 = t ? [0, _a18.y - _f4] : [_a18.x + _u4, _a18.y - _f4],_g3 = _l14.metrics.left - _c8 - _u4 + _p4[0],_m2 = _l14.metrics.top - _c8 + _p4[1],_y3 = _g3 + _h9.w,_x3 = _m2 + _h9.h,_4 = new s(_g3, _m2),_v3 = new s(_y3, _m2),_b3 = new s(_g3, _x3),_A3 = new s(_y3, _x3);if (t && _a18.vertical) {var _e116 = new s(-_u4, _u4),_t110 = -Math.PI / 2,_n95 = new s(5, 0);_4._rotateAround(_t110, _e116)._add(_n95), _v3._rotateAround(_t110, _e116)._add(_n95), _b3._rotateAround(_t110, _e116)._add(_n95), _A3._rotateAround(_t110, _e116)._add(_n95);}r.push({ tl: _4, tr: _v3, bl: _b3, br: _A3, tex: _h9, writingMode: e.writingMode, glyphOffset: _d4 });}return r;}(r.horizontal, p, this.glyphAtlas.positions[_t109]), x && ($ = x(null, d), ie($) ? this.dynamicAttrs.aTextFill = 1 : $ = ht([], $)), _ && (J = _(this.options.zoom, d), M(J) && (J = 14)), v && (K = v(null, d), ie(K) ? this.dynamicAttrs.aTextHaloFill = 1 : K = ht([], K)), b && (Q = b(null, d)), A && (ee = 255 * A(null, d)), T && (te = T(null, d) || 0), I && (ne = I(null, d) || 0), C && (he = +(\"map\" === C(null, d))), k && (ue = +(\"map\" === k(null, d))), F && (de = P(F(null, d), 0, 360) * Math.PI / 180);}m && (Z = i ? function (e) {var t = e.image,n = e.top - 1 / t.pixelRatio,i = e.left - 1 / t.pixelRatio,r = e.bottom + 1 / t.pixelRatio,o = e.right + 1 / t.pixelRatio;var a, l, h, c;return a = new s(i, n), l = new s(o, n), h = new s(o, r), c = new s(i, r), [{ tl: a, tr: l, bl: c, br: h, tex: { x: t.tl[0], y: t.tl[1], w: t.displaySize[0], h: t.displaySize[1] }, writingMode: void 0, glyphOffset: [0, 0] }];}(i) : function () {var e = new s(0, 0),t = new s(0, 0),n = new s(0, 0);return [{ tl: e, tr: t, bl: new s(0, 0), br: n, tex: { x: 0, y: 0, w: 0, h: 0 }, writingMode: void 0, glyphOffset: [0, 0] }];}(), D && (re = D(null, d)), M(re) && (re = Z[0].tex.w), L && (se = L(null, d)), M(se) && (se = Z[0].tex.h), H && (oe = H(null, d)), N && (ae = N(null, d)), z && (le = +(\"map\" === z(null, d))), V && (ce = +(\"map\" === V(null, d))), U && (fe = P(U(null, d), 0, 360) * Math.PI / 180)), ie(J) && (this.dynamicAttrs.aTextSize = 1), (ie(Q) || ie(ee)) && (this.dynamicAttrs.aTextHalo = 1), ie(re) && (this.dynamicAttrs.aMarkerWidth = 1), ie(se) && (this.dynamicAttrs.aMarkerHeight = 1), (ie(oe) || ie(te)) && (this.dynamicAttrs.aDxDy = 1), (ie(ae) || ie(te)) && (this.dynamicAttrs.aDxDy = 1), (ie(le) || ie(he)) && (this.dynamicAttrs.aPitchAlign = 1), (ie(ce) || ie(ue)) && (this.dynamicAttrs.aRotationAlign = 1), (ie(fe) || ie(de)) && (this.dynamicAttrs.aRotation = 1), (B || O) && (B && (W = B(null, d) || 0), !W && O && (W = O(null, d) || 0)), (G || R) && (G && (X = G(null, d) || 0), !X && R && (X = R(null, d) || 0)), j && (q = 255 * (j(this.options.zoom, d) || 0));var pe = 0;E && (pe = 255 * (E(this.options.zoom, d) || 0));var ge = Y && Y.length || 0;this.ensureDataCapacity(4 * (ge + (Z && Z.length || 0)), l.length);var me = this.options.EXTENT,_this$options3 = this.options,ye = _this$options3.altitudeScale,xe = _this$options3.altitudeProperty,_e = _this$options3.defaultAltitude,_w = w(e.feature, ye, xe, _e),ve = _w.altitude,be = this.needAltitudeAttribute(),Ae = function Ae(e, t, n, i, r, s, o) {if (!t) return;var a = e ? ge : 1;for (var _l15 = 0; _l15 < t.length; _l15++) {var _c9 = t[_l15],_f5 = _c9.tl,_d5 = _c9.tr,_g4 = _c9.bl,_m3 = _c9.br,_x4 = _c9.tex;var _5 = void 0;_this7._fillPos(h, n, i, r, 10 * _f5.x, 10 * _f5.y, _x4.x, _x4.y + _x4.h, e, o), _this7._fillTextData(h, p, a, _c9.glyphOffset, s, y, s.axis, s.angleR), _this7._fillFnTypeData(h, $, J, K, Q, ee, te, ne, re, se, oe, ae, q, pe, le, he, ce, ue, fe, de, W, X), _this7._fillPos(h, n, i, r, 10 * _d5.x, 10 * _d5.y, _x4.x + _x4.w, _x4.y + _x4.h, e, o), _this7._fillTextData(h, p, a, _c9.glyphOffset, s, y, s.axis, s.angleR), _this7._fillFnTypeData(h, $, J, K, Q, ee, te, ne, re, se, oe, ae, q, pe, le, he, ce, ue, fe, de, W, X), _this7._fillPos(h, n, i, r, 10 * _g4.x, 10 * _g4.y, _x4.x, _x4.y, e, o), _this7._fillTextData(h, p, a, _c9.glyphOffset, s, y, s.axis, s.angleR), _this7._fillFnTypeData(h, $, J, K, Q, ee, te, ne, re, se, oe, ae, q, pe, le, he, ce, ue, fe, de, W, X), _this7._fillPos(h, n, i, r, 10 * _m3.x, 10 * _m3.y, _x4.x + _x4.w, _x4.y, e, o), _this7._fillTextData(h, p, a, _c9.glyphOffset, s, y, s.axis, s.angleR), _this7._fillFnTypeData(h, $, J, K, Q, ee, te, ne, re, se, oe, ae, q, pe, le, he, ce, ue, fe, de, W, X), _this7.addElements(u, u + 1, u + 2), _this7.addElements(u + 1, u + 2, u + 3), u += 4, _5 = be ? Math.max(Math.abs(n), Math.abs(i)) : Math.max(Math.abs(n), Math.abs(i), Math.abs(r)), _5 > _this7.maxPos && (_this7.maxPos = _5);}},Te = \"text\" === this.options.pluginType;for (var _e117 = 0; _e117 < l.length; _e117++) {var _t111 = l[_e117],_n96 = _t111.z || ve || 0;if (me !== 1 / 0 && S(_t111, me)) continue;var _i72 = _t111.x,_r59 = _t111.y;m && Ae(!1, Z, _i72, _r59, _n96, _t111), g && (Te || Ae(!0, Y, _i72, _r59, _n96, _t111, !0), Ae(!0, Y, _i72, _r59, _n96, _t111, !1));}} }, { key: \"_fillPos\", value: function _fillPos(e, t, n, i, r, s, o, a, l, h) {this.fillPosition(e, t, n, i);var c = e.aShape.currentIndex;e.aShape[c++] = r, e.aShape[c++] = s, e.aShape.currentIndex = c, e.aTexCoord ? (c = e.aTexCoord.currentIndex, e.aTexCoord[c++] = o, e.aTexCoord[c++] = a, e.aTexCoord.currentIndex = c) : (c = e.aShape.currentIndex, \"text\" !== this.options.pluginType ? (e.aShape[c++] = +!!l + (o << 1), e.aShape[c++] = +!!h + (a << 1)) : (e.aShape[c++] = o, e.aShape[c++] = a), e.aShape.currentIndex = c);} }, { key: \"_fillTextData\", value: function _fillTextData(e, t, n, i, r, s, o, a) {var l = e.aCount.currentIndex;if (e.aCount[l++] = n, e.aCount.currentIndex = l, t) {l = e.aGlyphOffset.currentIndex, e.aGlyphOffset[l++] = i[0], e.aGlyphOffset[l++] = i[1], e.aGlyphOffset.currentIndex = l, this._is3DPitchText() && (l = e.aPitchRotation.currentIndex, e.aPitchRotation[l++] = o[0], e.aPitchRotation[l++] = o[1], e.aPitchRotation[l++] = a, e.aPitchRotation.currentIndex = l);var _t112 = r.startIndex;l = e.aSegment.currentIndex, e.aSegment[l++] = r.segment + _t112, e.aSegment[l++] = _t112, e.aSegment[l++] = r.line.length, e.aSegment.currentIndex = l, l = e.aVertical.currentIndex, e.aVertical[l++] = s, e.aVertical.currentIndex = l;}} }, { key: \"_fillFnTypeData\", value: function _fillFnTypeData(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g, m, y, x, _, v, b) {var _this$_fnTypes7 = this._fnTypes,A = _this$_fnTypes7.textFillFn,T = _this$_fnTypes7.textSizeFn,w = _this$_fnTypes7.textHaloFillFn,S = _this$_fnTypes7.textHaloRadiusFn,P = _this$_fnTypes7.textDxFn,I = _this$_fnTypes7.textDyFn,C = _this$_fnTypes7.textPitchAlignmentFn,k = _this$_fnTypes7.textRotationAlignmentFn,F = _this$_fnTypes7.textRotationFn,O = _this$_fnTypes7.textAllowOverlapFn,R = _this$_fnTypes7.textIgnorePlacementFn,E = _this$_fnTypes7.textOpacityFn,D = _this$_fnTypes7.textHaloOpacityFn,L = _this$_fnTypes7.markerWidthFn,H = _this$_fnTypes7.markerHeightFn,N = _this$_fnTypes7.markerDxFn,z = _this$_fnTypes7.markerDyFn,V = _this$_fnTypes7.markerPitchAlignmentFn,U = _this$_fnTypes7.markerRotationAlignmentFn,B = _this$_fnTypes7.markerRotationFn,G = _this$_fnTypes7.markerAllowOverlapFn,j = _this$_fnTypes7.markerIgnorePlacementFn,W = _this$_fnTypes7.markerOpacityFn;if (A) {var _n97 = e.aTextFill.currentIndex;e.aTextFill[_n97++] = t[0], e.aTextFill[_n97++] = t[1], e.aTextFill[_n97++] = t[2], e.aTextFill[_n97++] = t[3], e.aTextFill.currentIndex = _n97;}if (T) {var _t113 = e.aTextSize.currentIndex;e.aTextSize[_t113++] = n, e.aTextSize.currentIndex = _t113;}if (w) {var _t114 = e.aTextHaloFill.currentIndex;e.aTextHaloFill[_t114++] = i[0], e.aTextHaloFill[_t114++] = i[1], e.aTextHaloFill[_t114++] = i[2], e.aTextHaloFill[_t114++] = i[3], e.aTextHaloFill.currentIndex = _t114;}if (S || D) {var _t115 = e.aTextHalo.currentIndex;e.aTextHalo[_t115++] = r || 0, e.aTextHalo.currentIndex = _t115, _t115 = e.aTextHalo.currentIndex, e.aTextHalo[_t115++] = 255 * (M(s) ? 1 : s), e.aTextHalo.currentIndex = _t115;}if (P) {var _t116 = e.aTextDx.currentIndex;e.aTextDx[_t116++] = o, e.aTextDx.currentIndex = _t116;}if (I) {var _t117 = e.aTextDy.currentIndex;e.aTextDy[_t117++] = a, e.aTextDy.currentIndex = _t117;}if (L) {var _t118 = e.aMarkerWidth.currentIndex;e.aMarkerWidth[_t118++] = l, e.aMarkerWidth.currentIndex = _t118;}if (H) {var _t119 = e.aMarkerHeight.currentIndex;e.aMarkerHeight[_t119++] = h, e.aMarkerHeight.currentIndex = _t119;}if (N) {var _t120 = e.aMarkerDx.currentIndex;e.aMarkerDx[_t120++] = c, e.aMarkerDx.currentIndex = _t120;}if (z) {var _t121 = e.aMarkerDy.currentIndex;e.aMarkerDy[_t121++] = u, e.aMarkerDy.currentIndex = _t121;}var X = \"text\" === this.options.pluginType;if (!X && (W || E)) {W || (f = 255);var _t122 = e.aColorOpacity.currentIndex;e.aColorOpacity[_t122++] = f, e.aColorOpacity.currentIndex = _t122, f = E ? d : 255, _t122 = e.aColorOpacity.currentIndex, e.aColorOpacity[_t122++] = f, e.aColorOpacity.currentIndex = _t122;}if (X && E) {var _t123 = e.aColorOpacity.currentIndex;e.aColorOpacity[_t123++] = d, e.aColorOpacity.currentIndex = _t123;}if (C || V) if (X) {var _t124 = e.aPitchAlign.currentIndex;e.aPitchAlign[_t124++] = g, e.aPitchAlign.currentIndex = _t124;} else {var _t125 = e.aPitchAlign.currentIndex;e.aPitchAlign[_t125++] = p, e.aPitchAlign.currentIndex = _t125, _t125 = e.aPitchAlign.currentIndex, e.aPitchAlign[_t125++] = g, e.aPitchAlign.currentIndex = _t125;}if (U || k) if (X) {var _t126 = e.aRotationAlign.currentIndex;e.aRotationAlign[_t126++] = y, e.aRotationAlign.currentIndex = _t126;} else {var _t127 = e.aRotationAlign.currentIndex;e.aRotationAlign[_t127++] = m, e.aRotationAlign.currentIndex = _t127, _t127 = e.aRotationAlign.currentIndex, e.aRotationAlign[_t127++] = y, e.aRotationAlign.currentIndex = _t127;}if (B || F) if (X) {var _t128 = e.aRotation.currentIndex;e.aRotation[_t128++] = 9362 * _, e.aRotation.currentIndex = _t128;} else {var _t129 = e.aRotation.currentIndex;e.aRotation[_t129++] = 9362 * x, e.aRotation.currentIndex = _t129, _t129 = e.aRotation.currentIndex, e.aRotation[_t129++] = 9362 * _, e.aRotation.currentIndex = _t129;}var Y = G || O,Z = j || R;if (Y || Z) {var _t130 = (Y ? 8 : 0) + 4 * v,_n98 = (Z ? 2 : 0) + b;var _i73 = e.aOverlap.currentIndex;e.aOverlap[_i73++] = _t130 + _n98, e.aOverlap.currentIndex = _i73;}r > 0 && (this.properties.hasHalo = 1);} }, { key: \"_getAnchors\", value: function _getAnchors(e, t, n) {var i = e.feature,r = e.symbol,s = this._getPlacement(e, r),o = i.properties,_this$_fnTypes8 = this._fnTypes,a = _this$_fnTypes8.markerSpacingFn,l = _this$_fnTypes8.textSpacingFn,h = _this$_fnTypes8.textMaxAngleFn,c = ((a ? a(null, o) : r.markerSpacing) || (l ? l(null, o) : r.textSpacing) || 250) * n;var u = h ? h(this.options.zoom, o) : r.textMaxAngle;M(u) && (u = 80), u *= Math.PI / 180;var f = this.options.EXTENT,d = this.options.altitudeToTileScale,p = this._is3DPitchText();return mo(e, this.lineVertex, u, t, n, f, s, c, p, d);} }, { key: \"_getPlacement\", value: function _getPlacement(e, t) {var n;return n = this._fnTypes.markerPlacementFn ? this._fnTypes.markerPlacementFn(this.options.zoom, e.feature.properties) : t.markerPlacement || this._textPlacement, this._packMarkerPlacement || !t.markerPlacement && !t.isIconText || (this._packMarkerPlacement = n), !this._textPlacement || t.isIconText || this._packTextPlacement || (this._packTextPlacement = n), n;} }, { key: \"getPackSDFFormat\", value: function getPackSDFFormat(e) {if (\"line\" !== this._textPlacement || e.isIconText) return [].concat(_toConsumableArray(this.getPositionFormat()), [{ type: Int16Array, width: 4, name: \"aShape\" }, { type: Uint8Array, width: 1, name: \"aCount\" }]);{var _e118 = [].concat(_toConsumableArray(this.getPositionFormat()), [{ type: Int16Array, width: 2, name: \"aShape\" }, { type: Uint16Array, width: 2, name: \"aTexCoord\" }, { type: Uint8Array, width: 1, name: \"aCount\" }, { type: Int16Array, width: 2, name: \"aGlyphOffset\" }, { type: Uint16Array, width: 3, name: \"aSegment\" }, { type: Uint8Array, width: 1, name: \"aVertical\" }]);return this._is3DPitchText() && _e118.push({ type: Float32Array, width: 3, name: \"aPitchRotation\" }), _e118;}} }], [{ key: \"needMerge\", value: function needMerge(e, t, n) {if (!e) return !1;var i = \"line\" === e.textPlacement || \"line\" === e.markerPlacement;return i || (t.textPlacementFn && (i = \"line\" === t.textPlacementFn(n)), t.markerPlacementFn && (i = \"line\" === t.markerPlacementFn(n))), e.mergeOnProperty && i;} }, { key: \"mergeLineFeatures\", value: function mergeLineFeatures(e, t, n, i) {var r = t.textPlacement,s = t.markerPlacement;return n.textPlacementFn && (r = n.textPlacementFn(i)), n.markerPlacementFn && (s = n.markerPlacementFn(i)), \"line\" !== r && \"line\" !== s ? e : bo(e, t, n, i);} }, { key: \"splitPointSymbol\", value: function splitPointSymbol(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var n = [];if (Array.isArray(e)) {var _t131 = e;for (var _e119 = 0; _e119 < _t131.length; _e119++) _t131[_e119] && n.push.apply(n, _toConsumableArray(Ao.splitPointSymbol(_t131[_e119], _e119)));return n;}var i = null,r = null;for (var _t132 in e) 0 === _t132.indexOf(\"marker\") ? (i = i || {}, i[_t132] = e[_t132]) : 0 === _t132.indexOf(\"text\") && (r = r || {}, r[_t132] = e[_t132]);return i && (i.isIconText = !0, e.mergeOnProperty && (i.mergeOnProperty = e.mergeOnProperty), n.push(i)), r && (i && (r.textPlacement = i.markerPlacement, r.textSpacing = i.markerSpacing, r.isIconText = !0), e.mergeOnProperty && (r.mergeOnProperty = e.mergeOnProperty), n.push(r)), void 0 !== e.visible && (i && (i.visible = e.visible), r && (r.visible = e.visible)), i && (i.markerTextFit && r && (i.text = {}, i.text.textName = r.textName, i.text.textSize = r.textSize), i.index = { index: t, type: 0 }), r && (r.index = { index: t, type: 1 }), n;} }, { key: \"isAtlasLoaded\", value: function isAtlasLoaded(e, t) {var n = e.icon,i = e.glyph,r = t.iconAtlas,s = t.glyphAtlas;if (n && (!r || !r.positions[n.url])) return !1;if (i) {if (!s || !s.positions[i.font]) return !1;var _e120 = s.positions[i.font],_t133 = i.text;var _iterator45 = _createForOfIteratorHelper(_t133),_step45;try {for (_iterator45.s(); !(_step45 = _iterator45.n()).done;) {var _n99 = _step45.value;if (!_e120[_n99.codePointAt(0)]) return !1;}} catch (err) {_iterator45.e(err);} finally {_iterator45.f();}}return !0;} }]);}(gs);var To = function () {function To(e) {_classCallCheck(this, To);this.x = e.x, this.y = e.y, this.z = e.z || 0;}return _createClass(To, [{ key: \"clone\", value: function clone() {return new To(this);} }, { key: \"_unit\", value: function _unit() {return this._div(this.mag()), this;} }, { key: \"_div\", value: function _div(e) {return this.x /= e, this.y /= e, this.z /= e, this;} }, { key: \"_perp\", value: function _perp() {var e = this.y;return this.y = this.x, this.x = -e, this;} }, { key: \"mag\", value: function mag() {return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);} }, { key: \"add\", value: function add(e) {return this.clone()._add(e);} }, { key: \"sub\", value: function sub(e) {return this.clone()._sub(e);} }, { key: \"_add\", value: function _add(e) {return this.x += e.x, this.y += e.y, this.z += e.z, this;} }, { key: \"_sub\", value: function _sub(e) {return this.x -= e.x, this.y -= e.y, this.z -= e.z, this;} }, { key: \"equals\", value: function equals(e) {return this.x === e.x && this.y === e.y && this.z === e.z;} }, { key: \"mult\", value: function mult(e) {return this.clone()._mult(e);} }, { key: \"_mult\", value: function _mult(e) {return this.x *= e, this.y *= e, this.z *= e, this;} }, { key: \"dist\", value: function dist(e) {return Math.sqrt(this.distSqr(e));} }, { key: \"distSqr\", value: function distSqr(e) {var t = e.x - this.x,n = e.y - this.y,i = e.z - this.z;return t * t + n * n + i * i;} }, { key: \"_round\", value: function _round() {return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;} }, { key: \"angleTo\", value: function angleTo(e) {return Math.atan2(this.y - e.y, this.x - e.x);} }]);}();var wo,So = \"undefined\" != typeof Float32Array ? Float32Array : Array;function Mo(e, t, n, i) {return e[0] = t, e[1] = n, e[2] = i, e;}function Po(e, t) {var n = t[0],i = t[1],r = t[2],s = n * n + i * i + r * r;return s > 0 && (s = 1 / Math.sqrt(s)), e[0] = t[0] * s, e[1] = t[1] * s, e[2] = t[2] * s, e;}function Io(e, t, n) {var i = t[0],r = t[1],s = t[2],o = n[0],a = n[1],l = n[2];return e[0] = r * l - s * a, e[1] = s * o - i * l, e[2] = i * a - r * o, e;}function Co(e, t, n, i, r) {return e[0] = t, e[1] = n, e[2] = i, e[3] = r, e;}function ko(e, t, n) {return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e;}function Fo(e, t, n) {return e[0] = t, e[1] = n, e;}Math.hypot || (Math.hypot = function () {for (var e = 0, t = arguments.length; t--;) e += arguments[t] * arguments[t];return Math.sqrt(e);}), wo = new So(3), So != Float32Array && (wo[0] = 0, wo[1] = 0, wo[2] = 0), function () {var e = new So(4);So != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 0);}();!function () {var e = new So(2);So != Float32Array && (e[0] = 0, e[1] = 0);}();var Oo = 63,Ro = Math.cos(Math.PI / 180 * 37.5),Eo = Math.pow(2, 16) / 1,Do = new s(),Lo = new s(),Ho = new s();var No = function (_gs2) {function No(e, t, n) {var _this8;_classCallCheck(this, No);_this8 = _callSuper(this, No, [e, t, n]);var i = !1;var _this8$_fnTypes = _this8._fnTypes,r = _this8$_fnTypes.lineDasharrayFn,s = _this8$_fnTypes.lineDashColorFn;_this8.hasGradient = _this8.symbol.lineGradientProperty, r && (i = function (e, t, n) {for (var _i74 = 0; _i74 < e.length; _i74++) if (n(t, e[_i74].properties)) return !0;return !1;}(e, _this8.options.zoom, r), i && (_this8.dasharrayFn = r)), _this8.hasDasharray = Uo(_this8.symbol.lineDasharray) || i, _this8.hasDasharray && s && (_this8.dashColorFn = s);return _this8;}_inherits(No, _gs2);return _createClass(No, [{ key: \"createStyledVector\", value: function createStyledVector(e, t, n, i, r) {var s = new dt(e, t, n, i),o = s.getLineResource();return !this.options.atlas && o && (r[o] = [0, 0]), s;} }, { key: \"getFormat\", value: function getFormat() {var _this$_fnTypes9 = this._fnTypes,e = _this$_fnTypes9.lineWidthFn,t = _this$_fnTypes9.lineStrokeWidthFn,n = _this$_fnTypes9.lineStrokeColorFn,i = _this$_fnTypes9.lineColorFn,r = _this$_fnTypes9.lineOpacityFn,s = _this$_fnTypes9.lineDxFn,o = _this$_fnTypes9.lineDyFn,a = _this$_fnTypes9.linePatternAnimSpeedFn,l = _this$_fnTypes9.linePatternGapFn,h = [].concat(_toConsumableArray(this.getPositionFormat()));if (this.iconAtlas || this.hasDasharray ? h.push({ type: Int8Array, width: 3, name: \"aExtrude\" }) : h.push({ type: Int8Array, width: 2, name: \"aExtrude\" }), h.push({ type: this.options.positionType || Uint16Array, width: 1, name: \"aLinesofar\" }), e && h.push({ type: Uint8Array, width: 1, name: \"aLineWidth\" }), t && h.push({ type: Uint8Array, width: 1, name: \"aLineStrokeWidth\" }), i && h.push({ type: Uint8Array, width: 4, name: \"aColor\" }), n && h.push({ type: Uint8Array, width: 4, name: \"aStrokeColor\" }), r && h.push({ type: Uint8Array, width: 1, name: \"aOpacity\" }), this.dasharrayFn && h.push({ type: Uint8Array, width: 4, name: \"aDasharray\" }), this.dashColorFn && h.push({ type: Uint8Array, width: 4, name: \"aDashColor\" }), this.iconAtlas) {var _e121 = this.getIconAtlasMaxValue();h.push({ type: _e121 > 255 ? Uint16Array : Uint8Array, width: 4, name: \"aTexInfo\" });}return (s || o) && h.push({ type: Int8Array, width: 2, name: \"aLineDxDy\" }), (a || l) && h.push({ type: Int8Array, width: 2, name: \"aLinePattern\" }), h;} }, { key: \"placeVector\", value: function placeVector(e) {var _this$_fnTypes10 = this._fnTypes,t = _this$_fnTypes10.lineJoinFn,n = _this$_fnTypes10.lineCapFn,i = _this$_fnTypes10.lineWidthFn,r = _this$_fnTypes10.lineHeightFn,s = _this$_fnTypes10.lineStrokeWidthFn,o = _this$_fnTypes10.lineStrokeColorFn,a = _this$_fnTypes10.lineColorFn,l = _this$_fnTypes10.lineOpacityFn,h = _this$_fnTypes10.lineDxFn,c = _this$_fnTypes10.lineDyFn,u = _this$_fnTypes10.linePatternAnimSpeedFn,f = _this$_fnTypes10.linePatternGapFn,d = this.symbol,p = e.feature,g = p.properties;this.elements;var m = d.lineJoin || \"miter\",y = d.lineCap || \"butt\";if (t && (m = t(this.options.zoom, g) || \"miter\"), n && (y = n(this.options.zoom, g) || \"butt\"), i) {var _e122 = i(this.options.zoom, g);ie(_e122) && (this.dynamicAttrs.aLineWidth = 1, _e122 = 4), Je(_e122) && (_e122 = 4), this.feaLineWidth = +_e122;} else this.feaLineWidth = +d.lineWidth;if (r) {var _e123 = r(this.options.zoom, g);ie(_e123) && (this.dynamicAttrs.aLineHeight = 1), Je(_e123) && (_e123 = this.feaLineWidth), this.feaLineHeight = +_e123;} else this.feaLineHeight = +d.lineHeight || this.feaLineWidth;if (s) {var _e124 = s(this.options.zoom, g);ie(_e124) && (this.dynamicAttrs.aLineStrokeWidth = 1, _e124 = 0), Je(_e124) && (_e124 = 0), this.feaLineStrokeWidth = _e124;} else this.feaLineStrokeWidth = d.lineStrokeWidth || 0;if (a && (this.feaColor = a(this.options.zoom, g) || [255, 255, 255, 255], ie(this.feaColor) ? (this.dynamicAttrs.aColor = 1, this.feaColor = [0, 0, 0, 0]) : this.feaColor = ht([], this.feaColor)), o && (this.feaStrokeColor = o(this.options.zoom, g) || [0, 0, 0, 255], ie(this.feaStrokeColor) ? (this.dynamicAttrs.aStrokeColor = 1, this.feaStrokeColor = [0, 0, 0, 0]) : this.feaStrokeColor = ht([], this.feaStrokeColor)), l) {var _e125 = l(this.options.zoom, g);ie(_e125) && (this.dynamicAttrs.aOpacity = 1, _e125 = 1), Je(_e125) && (_e125 = 1), this.feaOpacity = 255 * _e125;}if (this.dasharrayFn) {var _e126 = this.dasharrayFn(this.options.zoom, g) || [0, 0, 0, 0];if (ie(_e126) && (this.dynamicAttrs.aDasharray = 1, _e126 = [0, 0, 0, 0]), _e126.length < 4) {var _t134 = _e126;1 === _e126.length ? _e126 = [_t134[0], _t134[0], _t134[0], _t134[0]] : 2 === _e126.length ? _e126 = [_t134[0], _t134[1], _t134[0], _t134[1]] : 3 === _e126.length && (_e126 = [_t134[0], _t134[1], _t134[2], _t134[2]]);}this.feaDash = _e126;}if (this.dashColorFn) {var _e127 = (this.dashColorFn ? this.dashColorFn(this.options.zoom, g) : this.symbol.lineDashColor) || [0, 0, 0, 0];ie(_e127) && (this.dynamicAttrs.aDashColor = 1, _e127 = [0, 0, 0, 0]), _e127 = ht([], _e127), this.feaDashColor = _e127;}if (this.iconAtlas) {var _t135 = e.getLineResource(),_n100 = this.iconAtlas.glyphMap[_t135];if (this.feaTexInfo = this.feaTexInfo || [0, 0, 0, 0], _n100) {var _this$iconAtlas$posit = this.iconAtlas.positions[_t135],_e128 = _this$iconAtlas$posit.tl,_n101 = _this$iconAtlas$posit.displaySize;this.feaTexInfo[0] = _e128[0] + 1, this.feaTexInfo[1] = _e128[1] + 1, this.feaTexInfo[2] = _n101[0] - 3, this.feaTexInfo[3] = _n101[1] - 3;} else this.feaTexInfo[0] = this.feaTexInfo[1] = this.feaTexInfo[2] = this.feaTexInfo[3] = 0;}if (h) {var _e129 = h(this.options.zoom, g);ie(_e129) && (this.dynamicAttrs.aLineDxDy = 1, _e129 = 0), Je(_e129) && (_e129 = 0), this.feaLineDx = _e129;}if (c) {var _e130 = c(this.options.zoom, g);ie(_e130) && (this.dynamicAttrs.aLineDxDy = 1, _e130 = 0), Je(_e130) && (_e130 = 0), this.feaLineDy = _e130;}if (u) {var _e131 = u(this.options.zoom, g);ie(_e131) && (this.dynamicAttrs.aLinePatternAnimSpeed = 1, _e131 = 0), Je(_e131) && (_e131 = 0), 0 !== _e131 && (this.properties.hasPatternAnim = 1), this.feaPatternAnimSpeed = _e131;}if (f) {var _e132 = f(this.options.zoom, g);ie(_e132) && (this.dynamicAttrs.aLinePatternGap = 1, _e132 = 0), Je(_e132) && (_e132 = 0), this.feaLinePatternGap = _e132;}var x = this.options.EXTENT;var _ = p.geometry;if (x !== 1 / 0) {_ = [];var _e133 = [];for (var _t136 = 0; _t136 < p.geometry.length; _t136++) {var _ref114;_e133[0] = p.geometry[_t136];var _n102 = Qs(_e133, -1, -1, x + 1, x + 1);if (3 === p.type && _n102.length > 1) {var _e134 = _n102[0],_t137 = _n102[_n102.length - 1];Wo(_e134[0], _t137[_t137.length - 1]) && (_n102[0] = _t137.concat(_e134.slice(1)), _n102.length = _n102.length - 1);}(_ref114 = _).push.apply(_ref114, _toConsumableArray(_n102));}}var v = this.needAltitudeAttribute() ? 2 : 3;for (var _e135 = 0; _e135 < _.length; _e135++) {this.offset = this.data.aPosition.getLength() / v;var _t138 = _[_e135];this._addLine(_t138, p, m, y, 2, 1.05);}} }, { key: \"_hasPattern\", value: function _hasPattern() {return this.iconAtlas && this.feaTexInfo[2] && this.feaTexInfo[3];} }, { key: \"_addLine\", value: function _addLine(e, t, n, i, r, s) {var o = this._hasPattern() || Uo(this.feaDash) || Uo(this.symbol.lineDasharray),a = this.options.isTube;a && (e = e.map(function (e) {return new To(e);})), this.overscaling = 1;var l = this.options.EXTENT;if (this.distance = 0, this.scaledDistance = 0, this.totalDistance = 0, this.prevVertex = null, this.symbol.lineGradientProperty && t.properties && Ke(t.properties.mapbox_clip_start) && Ke(t.properties.mapbox_clip_end)) {this.clipStart = +t.properties.mapbox_clip_start, this.clipEnd = +t.properties.mapbox_clip_end;for (var _t139 = 0; _t139 < e.length - 1; _t139++) this.totalDistance += e[_t139].dist(e[_t139 + 1]);this.updateScaledDistance();}var h = 3 === t.type && !e.clipped;var c = e.length;for (; c >= 2 && Wo(e[c - 1], e[c - 2]);) c--;var u = 0;for (; u < c - 1 && Wo(e[u], e[u + 1]);) u++;if (c < (h ? 3 : 2)) return;\"bevel\" === n && (r = 1.05);var f = this.overscaling <= 16 ? 15 * l / (512 * this.overscaling) : 0,d = { vertexLength: 0, primitiveLength: 0, currentNormal: null };var p, g, m, y, x;this.e1 = this.e2 = -1, h && (p = e[c - 2], x = e[u].sub(p)._unit()._perp()), this.ensureDataCapacity(n, c, 360, 2);for (var _t140 = u; _t140 < c; _t140++) {if (m = _t140 === c - 1 ? h ? e[u + 1] : void 0 : e[_t140 + 1], m && Wo(e[_t140], m)) continue;x && (y = x), p && (g = p), p = e[_t140], m && p.x === m.x && p.y === m.y && (p.x += 1e-4), x = m ? m.sub(p)._unit()._perp() : y, d.dir = g ? p.sub(g)._unit() : m.sub(p)._unit(), y = y || x, d.currentNormal = y;var _l16 = y.add(x);0 === _l16.x && 0 === _l16.y || _l16._unit();var _6 = y.x * x.x + y.y * x.y,_v4 = _l16.x * x.x + _l16.y * x.y,_b4 = 0 !== _v4 ? 1 / _v4 : 1 / 0,_A4 = 2 * Math.sqrt(2 - 2 * _v4),_T = _v4 < Ro && g && m,_w2 = y.x * x.y - y.y * x.x > 0;if (!a && _T && _t140 > u) {var _e136 = p.dist(g);if (_e136 > 2 * f) {var _t141 = p.sub(p.sub(g)._mult(f / _e136)._round());_t141.z = p.z, this.updateDistance(g, _t141), this.addCurrentVertex(_t141, y, 0, 0, d), g = _t141;}}var _S = g && m;d.middleVertex = _S;var _M = _S ? n : h ? \"butt\" : i;if (_S && \"round\" === _M && (_b4 < s ? _M = \"miter\" : _b4 <= 2 && (_M = \"fakeround\")), \"miter\" === _M && _b4 > r && !a && (_M = \"bevel\"), \"bevel\" === _M && (_b4 > 2 && (_M = \"flipbevel\"), _b4 < r && (_M = \"miter\")), g && this.updateDistance(g, p), \"miter\" === _M) a ? (this.addCurrentVertex(p, y, 0, 0, d), d.dir = m.sub(p)._unit(), this.addCurrentVertex(p, x, 0, 0, d)) : (_l16._mult(_b4), this.addCurrentVertex(p, _l16, 0, 0, d), o && (d.currentNormal = x, d.dir = m.sub(p)._unit(), this.addCurrentVertex(p, _l16, 0, 0, d)));else if (\"flipbevel\" === _M) {if (_b4 > 100) _l16 = x.mult(-1);else {var _e137 = _b4 * y.add(x).mag() / y.sub(x).mag();_l16._perp()._mult(_e137 * (_w2 ? -1 : 1));}this.addCurrentVertex(p, _l16, 0, 0, d), this.addCurrentVertex(p, _l16.mult(-1), 0, 0, d);} else if (\"bevel\" === _M || \"fakeround\" === _M) {var _e138 = -Math.sqrt(_b4 * _b4 - 1),_t142 = _w2 ? _e138 : 0,_n103 = _w2 ? 0 : _e138;if (g && this.addCurrentVertex(p, y, _t142, _n103, d), \"fakeround\" === _M) {var _e139 = Math.round(180 * _A4 / Math.PI / 20);for (var _t143 = 1; _t143 < _e139; _t143++) {var _n104 = _t143 / _e139;if (.5 !== _n104) {var _e140 = _n104 - .5;_n104 += _n104 * _e140 * (_n104 - 1) * ((1.0904 + _6 * (_6 * (3.55645 - 1.43519 * _6) - 3.2452)) * _e140 * _e140 + (.848013 + _6 * (.215638 * _6 - 1.06021)));}var _i75 = x.sub(y)._mult(_n104)._add(y)._unit()._mult(_w2 ? -1 : 1);this.addHalfVertex(p, _i75.x, _i75.y, !1, _w2, 0, d);}}m && (d.currentNormal = x, d.dir = m.sub(p)._unit(), this.addCurrentVertex(p, x, -_t142, -_n103, d));} else if (\"butt\" === _M) this.addCurrentVertex(p, _l16, 0, 0, d);else if (\"square\" === _M) {var _e141 = g ? 1 : -1;this.addCurrentVertex(p, _l16, _e141, _e141, d);} else \"round\" === _M && (g && (this.addCurrentVertex(p, y, 0, 0, d), this.addCurrentVertex(p, y, 1, 1, d, !0)), m && (this.addCurrentVertex(p, x, -1, -1, d, !0), this.addCurrentVertex(p, x, 0, 0, d)));if (!a && _T && _t140 < c - 1) {var _e142 = p.dist(m);if (_e142 > 2 * f) {var _t144 = p.add(m.sub(p)._mult(f / _e142)._round());_t144.z = p.z, this.updateDistance(p, _t144), this.addCurrentVertex(_t144, x, 0, 0, d), p = _t144;}}}} }, { key: \"ensureDataCapacity\", value: function ensureDataCapacity(e, t, n, i) {var r = \"round\" === e ? Math.round(n / 20) - 1 : 0;_superPropGet(No, \"ensureDataCapacity\", this, 3)([(6 + r) * i, t]);} }, { key: \"addCurrentVertex\", value: function addCurrentVertex(e, t, n, i, r) {var s = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;var o = t.x + t.y * n,a = t.y - t.x * n,l = -t.x + t.y * i,h = -t.y - t.x * i;var c = 0,u = 0;if (r.middleVertex) {Do.x = o, Do.y = a;var _e143 = r.currentNormal;if (c = jo(_e143, Do, r.dir), 0 === n && 0 === i) u = -c;else {var _t145 = Lo;_t145.x = _e143.x, _t145.y = _e143.y, _t145._mult(-1), Ho.x = l, Ho.y = h, u = jo(_t145, Ho, r.dir);}}this.addHalfVertex(e, o, a, s, !1, n, r, c), this.addHalfVertex(e, l, h, s, !0, -i, r, u), this.prevVertex && Wo(e, this.prevVertex) || (this.prevVertex = e), this.distance > Eo / 2 && 0 === this.totalDistance && (this.distance = 0, this.updateScaledDistance(), this.addCurrentVertex(e, t, n, i, r, s));} }, { key: \"addHalfVertex\", value: function addHalfVertex(_ref115, i, r, s, o, a, l, h) {var e = _ref115.x,t = _ref115.y,n = _ref115.z;var c = 1 * this.scaledDistance;this.fillData(this.data, e, t, n || 0, i, r, s, o, c, h);var u = l.vertexLength++;this.e1 >= 0 && this.e2 >= 0 && (this.addElements(this.e1, this.e2, u), l.primitiveLength++), o ? this.e2 = u : this.e1 = u;} }, { key: \"fillData\", value: function fillData(e, t, n, i, r, s, o, a, l, h) {var _this$_fnTypes11 = this._fnTypes,c = _this$_fnTypes11.lineWidthFn,u = _this$_fnTypes11.lineStrokeWidthFn,f = _this$_fnTypes11.lineStrokeColorFn,d = _this$_fnTypes11.lineColorFn,p = _this$_fnTypes11.lineOpacityFn,g = _this$_fnTypes11.lineDxFn,m = _this$_fnTypes11.lineDyFn,y = _this$_fnTypes11.linePatternAnimSpeedFn,x = _this$_fnTypes11.linePatternGapFn;this.fillPosition(e, t, n, i);var _ = Oo * r;_ = (Math.sign(_) || 1) * ((Math.floor(Math.abs(_)) >> 1 << 1) + +o);var v = Oo * s;v = (Math.sign(v) || 1) * ((Math.floor(Math.abs(v)) >> 1 << 1) + +a);var b = e.aExtrude.currentIndex;e.aExtrude[b++] = _, e.aExtrude[b++] = v, (this.iconAtlas || this.hasDasharray) && (e.aExtrude[b++] = Oo * h), e.aExtrude.currentIndex = b, b = e.aLinesofar.currentIndex, e.aLinesofar[b++] = l, e.aLinesofar.currentIndex = b, c && (b = e.aLineWidth.currentIndex, e.aLineWidth[b++] = Math.round(2 * this.feaLineWidth), e.aLineWidth.currentIndex = b), u && (b = e.aLineStrokeWidth.currentIndex, e.aLineStrokeWidth[b++] = Math.round(2 * this.feaLineStrokeWidth), e.aLineStrokeWidth.currentIndex = b), d && (b = e.aColor.currentIndex, e.aColor[b++] = this.feaColor[0], e.aColor[b++] = this.feaColor[1], e.aColor[b++] = this.feaColor[2], e.aColor[b++] = this.feaColor[3], e.aColor.currentIndex = b), f && (b = e.aStrokeColor.currentIndex, e.aStrokeColor[b++] = this.feaStrokeColor[0], e.aStrokeColor[b++] = this.feaStrokeColor[1], e.aStrokeColor[b++] = this.feaStrokeColor[2], e.aStrokeColor[b++] = this.feaStrokeColor[3], e.aStrokeColor.currentIndex = b), p && (b = e.aOpacity.currentIndex, e.aOpacity[b++] = this.feaOpacity, e.aOpacity.currentIndex = b), this.dasharrayFn && (b = e.aDasharray.currentIndex, e.aDasharray[b++] = this.feaDash[0], e.aDasharray[b++] = this.feaDash[1], e.aDasharray[b++] = this.feaDash[2], e.aDasharray[b++] = this.feaDash[3], e.aDasharray.currentIndex = b), this.dashColorFn && (b = e.aDashColor.currentIndex, e.aDashColor[b++] = this.feaDashColor[0], e.aDashColor[b++] = this.feaDashColor[1], e.aDashColor[b++] = this.feaDashColor[2], e.aDashColor[b++] = this.feaDashColor[3], e.aDashColor.currentIndex = b), this.iconAtlas && (b = e.aTexInfo.currentIndex, e.aTexInfo[b++] = this.feaTexInfo[0], e.aTexInfo[b++] = this.feaTexInfo[1], e.aTexInfo[b++] = this.feaTexInfo[2], e.aTexInfo[b++] = this.feaTexInfo[3], e.aTexInfo.currentIndex = b), (g || m) && (b = e.aLineDxDy.currentIndex, e.aLineDxDy[b++] = this.feaLineDx || 0, e.aLineDxDy[b++] = this.feaLineDy || 0, e.aLineDxDy.currentIndex = b), (y || x) && (b = e.aLinePattern.currentIndex, e.aLinePattern[b++] = 127 * (this.feaPatternAnimSpeed || 0), e.aLinePattern[b++] = 10 * (this.feaLinePatternGap || 0), e.aLinePattern.currentIndex = b), this.maxPos = Math.max(this.maxPos, Math.abs(t) + 1, Math.abs(n) + 1);} }, { key: \"addElements\", value: function addElements(e, t, n) {_superPropGet(No, \"addElements\", this, 3)([this.offset + e, this.offset + t, this.offset + n]);} }, { key: \"_filterPolygonEdges\", value: function _filterPolygonEdges(e) {var t = this.options.EXTENT,n = this.elements;for (var _i76 = 0; _i76 < n.length; _i76 += 3) if (t === 1 / 0 || !Vo(this.data.aPosition, n[_i76], n[_i76 + 1], 3, t) && !Vo(this.data.aPosition, n[_i76 + 1], n[_i76 + 2], 3, t)) {var _t146 = e.currentIndex;e[_t146++] = n[_i76], e[_t146++] = n[_i76 + 1], e[_t146++] = n[_i76 + 2], e.currentIndex = _t146;}} }, { key: \"_filterLine\", value: function _filterLine(e) {if (e.length <= 1) return e;var t = [],n = this.options.EXTENT;var i,r = !0;for (i = 0; i < e.length - 1; i++) {var _s49 = zo(e[i], e[i + 1], n);_s49 && r || (t.push(e[i]), r = _s49);}return r || t.push(e[i]), t;} }, { key: \"updateDistance\", value: function updateDistance(e, t) {if (this.options.isTube) {var _n105 = e.dist(t),_i77 = ot(this.options) * (t.z - e.z);this.distance += Math.sqrt(_n105 * _n105 + _i77 * _i77);} else this.distance += e.dist(t);this.updateScaledDistance();} }, { key: \"updateScaledDistance\", value: function updateScaledDistance() {this.scaledDistance = this.totalDistance > 0 ? (this.clipStart + (this.clipEnd - this.clipStart) * this.distance / this.totalDistance) * (Eo - 1) : this.distance;} }], [{ key: \"mergeLineFeatures\", value: function mergeLineFeatures(e, t, n, i) {return bo(e, t, n, i);} }]);}(gs);function zo(e, t, n) {return n !== 1 / 0 && (e.x < 0 && t.x < 0 || e.x > n && t.x > n || e.y < 0 && t.y < 0 || e.y > n && t.y > n);}function Vo(e, t, n, i, r) {if (r === 1 / 0) return !1;var s = Math.floor(.5 * e[t * i]),o = Math.floor(.5 * e[t * i + 1]),a = Math.floor(.5 * e[n * i]),l = Math.floor(.5 * e[n * i + 1]);return s === a && (s < 0 || s > r) && o !== l || o === l && (o < 0 || o > r) && s !== a;}function Uo(e) {if (!Array.isArray(e)) return !1;for (var _t147 = 0; _t147 < e.length; _t147++) if (e[_t147]) return !0;return !1;}var Bo = [],Go = [];function jo(e, t, n) {var i = e.mag(),r = t.mag();Fo(Bo, n.x, n.y), Fo(Go, t.x, t.y);var s = (a = Go, (o = Bo)[0] * a[0] + o[1] * a[1]);var o, a;return -Math.sign(s) * Math.sqrt(r * r - i * i);}function Wo(e, t) {return e.equals(t) && e.z === t.z;}var Xo = \"undefined\" != typeof Float32Array ? Float32Array : Array;function Yo(e, t, n, i) {return e[0] = t, e[1] = n, e[2] = i, e;}var Zo = function Zo(e, t, n) {return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e;};!function () {var e = new Xo(3);Xo != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0);}();var qo = [],$o = [],Jo = [],Ko = [],Qo = [],ea = [],ta = [],na = [];function ia(e, t, n, i, r, s) {Yo(Qo, e[3 * t], e[3 * t + 1], e[3 * t + 2]), Yo(ea, e[3 * n], e[3 * n + 1], e[3 * n + 2]), Yo(ta, e[3 * i], e[3 * i + 1], e[3 * i + 2]);var o = Zo($o, ta, ea),a = Zo(Jo, Qo, ea),l = function (e, t, n) {var i = t[0],r = t[1],s = t[2],o = n[0],a = n[1],l = n[2];return e[0] = r * l - s * a, e[1] = s * o - i * l, e[2] = i * a - r * o, e;}(Ko, o, a);!function (e, t) {var n = t[0],i = t[1],r = t[2],s = n * n + i * i + r * r;s > 0 && (s = 1 / Math.sqrt(s), e[0] = t[0] * s, e[1] = t[1] * s, e[2] = t[2] * s);}(na, l), r[3 * t] = r[3 * t] || 0, r[3 * n] = r[3 * n] || 0, r[3 * i] = r[3 * i] || 0, r[3 * t + 1] = r[3 * t + 1] || 0, r[3 * n + 1] = r[3 * n + 1] || 0, r[3 * i + 1] = r[3 * i + 1] || 0, r[3 * t + 2] = r[3 * t + 2] || 0, r[3 * n + 2] = r[3 * n + 2] || 0, r[3 * i + 2] = r[3 * i + 2] || 0, r[3 * t] += na[0], r[3 * n] += na[0], r[3 * i] += na[0], r[3 * t + 1] += na[1], r[3 * n + 1] += na[1], r[3 * i + 1] += na[1], r[3 * t + 2] += na[2], r[3 * n + 2] += na[2], r[3 * i + 2] += na[2], s[t] += 1, s[n] += 1, s[i] += 1;}var ra = Math.pow(2, 16) / 1,sa = 45 * Math.PI / 100;function oa(e, t) {var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;var i = t && t.length,r = i ? t[0] * n : e.length;var s = aa(e, 0, r, n, !0);var o = [];if (!s || s.next === s.prev) return o;var a, l, h;if (i && (s = function (e, t, n, i) {var r = [];for (var _n106 = 0, _s50 = t.length; _n106 < _s50; _n106++) {var _o40 = aa(e, t[_n106] * i, _n106 < _s50 - 1 ? t[_n106 + 1] * i : e.length, i, !1);_o40 === _o40.next && (_o40.steiner = !0), r.push(xa(_o40));}r.sort(pa);for (var _e144 = 0; _e144 < r.length; _e144++) n = ga(r[_e144], n);return n;}(e, t, s, n)), e.length > 80 * n) {a = 1 / 0, l = 1 / 0;var _t148 = -1 / 0,_i78 = -1 / 0;for (var _s51 = n; _s51 < r; _s51 += n) {var _n107 = e[_s51],_r60 = e[_s51 + 1];_n107 < a && (a = _n107), _r60 < l && (l = _r60), _n107 > _t148 && (_t148 = _n107), _r60 > _i78 && (_i78 = _r60);}h = Math.max(_t148 - a, _i78 - l), h = 0 !== h ? 32767 / h : 0;}return ha(s, o, n, a, l, h, 0), o;}function aa(e, t, n, i, r) {var s;if (r === function (e, t, n, i) {var r = 0;for (var _s52 = t, _o41 = n - i; _s52 < n; _s52 += i) r += (e[_o41] - e[_s52]) * (e[_s52 + 1] + e[_o41 + 1]), _o41 = _s52;return r;}(e, t, n, i) > 0) for (var _r61 = t; _r61 < n; _r61 += i) s = Ca(_r61 / i | 0, e[_r61], e[_r61 + 1], s);else for (var _r62 = n - i; _r62 >= t; _r62 -= i) s = Ca(_r62 / i | 0, e[_r62], e[_r62 + 1], s);return s && Ta(s, s.next) && (ka(s), s = s.next), s;}function la(e, t) {if (!e) return e;t || (t = e);var n,i = e;do {if (n = !1, i.steiner || !Ta(i, i.next) && 0 !== Aa(i.prev, i, i.next)) i = i.next;else {if (ka(i), i = t = i.prev, i === i.next) break;n = !0;}} while (n || i !== t);return t;}function ha(e, t, n, i, r, s, o) {if (!e) return;!o && s && function (e, t, n, i) {var r = e;do {0 === r.z && (r.z = ya(r.x, r.y, t, n, i)), r.prevZ = r.prev, r.nextZ = r.next, r = r.next;} while (r !== e);r.prevZ.nextZ = null, r.prevZ = null, function (e) {var t,n = 1;do {var _i79 = void 0,_r63 = e;e = null;var _s53 = null;for (t = 0; _r63;) {t++;var _o42 = _r63,_a19 = 0;for (var _e145 = 0; _e145 < n && (_a19++, _o42 = _o42.nextZ, _o42); _e145++);var _l17 = n;for (; _a19 > 0 || _l17 > 0 && _o42;) 0 !== _a19 && (0 === _l17 || !_o42 || _r63.z <= _o42.z) ? (_i79 = _r63, _r63 = _r63.nextZ, _a19--) : (_i79 = _o42, _o42 = _o42.nextZ, _l17--), _s53 ? _s53.nextZ = _i79 : e = _i79, _i79.prevZ = _s53, _s53 = _i79;_r63 = _o42;}_s53.nextZ = null, n *= 2;} while (t > 1);}(r);}(e, i, r, s);var a = e;for (; e.prev !== e.next;) {var _l18 = e.prev,_h10 = e.next;if (s ? ua(e, i, r, s) : ca(e)) t.push(_l18.i, e.i, _h10.i), ka(e), e = _h10.next, a = _h10.next;else if ((e = _h10) === a) {o ? 1 === o ? ha(e = fa(la(e), t), t, n, i, r, s, 2) : 2 === o && da(e, t, n, i, r, s) : ha(la(e), t, n, i, r, s, 1);break;}}}function ca(e) {var t = e.prev,n = e,i = e.next;if (Aa(t, n, i) >= 0) return !1;var r = t.x,s = n.x,o = i.x,a = t.y,l = n.y,h = i.y,c = Math.min(r, s, o),u = Math.min(a, l, h),f = Math.max(r, s, o),d = Math.max(a, l, h);var p = i.next;for (; p !== t;) {if (p.x >= c && p.x <= f && p.y >= u && p.y <= d && va(r, a, s, l, o, h, p.x, p.y) && Aa(p.prev, p, p.next) >= 0) return !1;p = p.next;}return !0;}function ua(e, t, n, i) {var r = e.prev,s = e,o = e.next;if (Aa(r, s, o) >= 0) return !1;var a = r.x,l = s.x,h = o.x,c = r.y,u = s.y,f = o.y,d = Math.min(a, l, h),p = Math.min(c, u, f),g = Math.max(a, l, h),m = Math.max(c, u, f),y = ya(d, p, t, n, i),x = ya(g, m, t, n, i);var _ = e.prevZ,v = e.nextZ;for (; _ && _.z >= y && v && v.z <= x;) {if (_.x >= d && _.x <= g && _.y >= p && _.y <= m && _ !== r && _ !== o && va(a, c, l, u, h, f, _.x, _.y) && Aa(_.prev, _, _.next) >= 0) return !1;if (_ = _.prevZ, v.x >= d && v.x <= g && v.y >= p && v.y <= m && v !== r && v !== o && va(a, c, l, u, h, f, v.x, v.y) && Aa(v.prev, v, v.next) >= 0) return !1;v = v.nextZ;}for (; _ && _.z >= y;) {if (_.x >= d && _.x <= g && _.y >= p && _.y <= m && _ !== r && _ !== o && va(a, c, l, u, h, f, _.x, _.y) && Aa(_.prev, _, _.next) >= 0) return !1;_ = _.prevZ;}for (; v && v.z <= x;) {if (v.x >= d && v.x <= g && v.y >= p && v.y <= m && v !== r && v !== o && va(a, c, l, u, h, f, v.x, v.y) && Aa(v.prev, v, v.next) >= 0) return !1;v = v.nextZ;}return !0;}function fa(e, t) {var n = e;do {var _i80 = n.prev,_r64 = n.next.next;!Ta(_i80, _r64) && wa(_i80, n, n.next, _r64) && Pa(_i80, _r64) && Pa(_r64, _i80) && (t.push(_i80.i, n.i, _r64.i), ka(n), ka(n.next), n = e = _r64), n = n.next;} while (n !== e);return la(n);}function da(e, t, n, i, r, s) {var o = e;do {var _e146 = o.next.next;for (; _e146 !== o.prev;) {if (o.i !== _e146.i && ba(o, _e146)) {var _a20 = Ia(o, _e146);return o = la(o, o.next), _a20 = la(_a20, _a20.next), ha(o, t, n, i, r, s, 0), void ha(_a20, t, n, i, r, s, 0);}_e146 = _e146.next;}o = o.next;} while (o !== e);}function pa(e, t) {var n = e.x - t.x;return 0 === n && (n = e.y - t.y, 0 === n) && (n = (e.next.y - e.y) / (e.next.x - e.x) - (t.next.y - t.y) / (t.next.x - t.x)), n;}function ga(e, t) {var n = function (e, t) {var n = t;var i = e.x,r = e.y;var s,o = -1 / 0;if (Ta(e, n)) return n;do {if (Ta(e, n.next)) return n.next;if (r <= n.y && r >= n.next.y && n.next.y !== n.y) {var _e147 = n.x + (r - n.y) * (n.next.x - n.x) / (n.next.y - n.y);if (_e147 <= i && _e147 > o && (o = _e147, s = n.x < n.next.x ? n : n.next, _e147 === i)) return s;}n = n.next;} while (n !== t);if (!s) return null;var a = s,l = s.x,h = s.y;var c = 1 / 0;n = s;do {if (i >= n.x && n.x >= l && i !== n.x && _a(r < h ? i : o, r, l, h, r < h ? o : i, r, n.x, n.y)) {var _t149 = Math.abs(r - n.y) / (i - n.x);Pa(n, e) && (_t149 < c || _t149 === c && (n.x > s.x || n.x === s.x && ma(s, n))) && (s = n, c = _t149);}n = n.next;} while (n !== a);return s;}(e, t);if (!n) return t;var i = Ia(n, e);return la(i, i.next), la(n, n.next);}function ma(e, t) {return Aa(e.prev, e, t.prev) < 0 && Aa(t.next, e, e.next) < 0;}function ya(e, t, n, i, r) {return (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = (e - n) * r | 0) | e << 8)) | e << 4)) | e << 2)) | e << 1)) | (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = (t - i) * r | 0) | t << 8)) | t << 4)) | t << 2)) | t << 1)) << 1;}function xa(e) {var t = e,n = e;do {(t.x < n.x || t.x === n.x && t.y < n.y) && (n = t), t = t.next;} while (t !== e);return n;}function _a(e, t, n, i, r, s, o, a) {return (r - o) * (t - a) >= (e - o) * (s - a) && (e - o) * (i - a) >= (n - o) * (t - a) && (n - o) * (s - a) >= (r - o) * (i - a);}function va(e, t, n, i, r, s, o, a) {return !(e === o && t === a) && _a(e, t, n, i, r, s, o, a);}function ba(e, t) {return e.next.i !== t.i && e.prev.i !== t.i && !function (e, t) {var n = e;do {if (n.i !== e.i && n.next.i !== e.i && n.i !== t.i && n.next.i !== t.i && wa(n, n.next, e, t)) return !0;n = n.next;} while (n !== e);return !1;}(e, t) && (Pa(e, t) && Pa(t, e) && function (e, t) {var n = e,i = !1;var r = (e.x + t.x) / 2,s = (e.y + t.y) / 2;do {n.y > s != n.next.y > s && n.next.y !== n.y && r < (n.next.x - n.x) * (s - n.y) / (n.next.y - n.y) + n.x && (i = !i), n = n.next;} while (n !== e);return i;}(e, t) && (Aa(e.prev, e, t.prev) || Aa(e, t.prev, t)) || Ta(e, t) && Aa(e.prev, e, e.next) > 0 && Aa(t.prev, t, t.next) > 0);}function Aa(e, t, n) {return (t.y - e.y) * (n.x - t.x) - (t.x - e.x) * (n.y - t.y);}function Ta(e, t) {return e.x === t.x && e.y === t.y;}function wa(e, t, n, i) {var r = Ma(Aa(e, t, n)),s = Ma(Aa(e, t, i)),o = Ma(Aa(n, i, e)),a = Ma(Aa(n, i, t));return r !== s && o !== a || !(0 !== r || !Sa(e, n, t)) || !(0 !== s || !Sa(e, i, t)) || !(0 !== o || !Sa(n, e, i)) || !(0 !== a || !Sa(n, t, i));}function Sa(e, t, n) {return t.x <= Math.max(e.x, n.x) && t.x >= Math.min(e.x, n.x) && t.y <= Math.max(e.y, n.y) && t.y >= Math.min(e.y, n.y);}function Ma(e) {return e > 0 ? 1 : e < 0 ? -1 : 0;}function Pa(e, t) {return Aa(e.prev, e, e.next) < 0 ? Aa(e, t, e.next) >= 0 && Aa(e, e.prev, t) >= 0 : Aa(e, t, e.prev) < 0 || Aa(e, e.next, t) < 0;}function Ia(e, t) {var n = Fa(e.i, e.x, e.y),i = Fa(t.i, t.x, t.y),r = e.next,s = t.prev;return e.next = t, t.prev = e, n.next = r, r.prev = n, i.next = n, n.prev = i, s.next = i, i.prev = s, i;}function Ca(e, t, n, i) {var r = Fa(e, t, n);return i ? (r.next = i.next, r.prev = i, i.next.prev = r, i.next = r) : (r.prev = r, r.next = r), r;}function ka(e) {e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ), e.nextZ && (e.nextZ.prevZ = e.prevZ);}function Fa(e, t, n) {return { i: e, x: t, y: n, prev: null, next: null, z: 0, prevZ: null, nextZ: null, steiner: !1 };}var Oa = [],Ra = [];function Ea(e, t) {var n, i, r, o, a, l, h;for (i = 1; i <= 8; i *= 2) {for (n = [], o = !(La(r = e[e.length - 1], t) & i), a = 0; a < e.length; a++) {if ((h = !(La(l = e[a], t) & i)) !== o) {var _e148 = Da(r, l, i, t);void 0 !== l.x ? n.push(new s(_e148[0], _e148[1])) : n.push(_e148);}h && n.push(l), r = l, o = h;}if (!(e = n).length) break;}return n;}function Da(e, t, n, i) {return Oa[0] = void 0 === e.x ? e[0] : e.x, Oa[1] = void 0 === e.y ? e[1] : e.y, e = Oa, Ra[0] = void 0 === t.x ? t[0] : t.x, Ra[1] = void 0 === t.y ? t[1] : t.y, t = Ra, 8 & n ? [e[0] + (t[0] - e[0]) * (i[3] - e[1]) / (t[1] - e[1]), i[3]] : 4 & n ? [e[0] + (t[0] - e[0]) * (i[1] - e[1]) / (t[1] - e[1]), i[1]] : 2 & n ? [i[2], e[1] + (t[1] - e[1]) * (i[2] - e[0]) / (t[0] - e[0])] : 1 & n ? [i[0], e[1] + (t[1] - e[1]) * (i[0] - e[0]) / (t[0] - e[0])] : null;}function La(e, t) {Oa[0] = void 0 === e.x ? e[0] : e.x, Oa[1] = void 0 === e.y ? e[1] : e.y;var n = 0;return (e = Oa)[0] < t[0] ? n |= 1 : e[0] > t[2] && (n |= 2), e[1] < t[1] ? n |= 4 : e[1] > t[3] && (n |= 8), n;}var Ha = [0, 0, 0, 0],Na = -9999999,za = [{ type: Int16Array, width: 3, name: \"aPosition\" }];var Va = function (_No) {function Va(e, t, n) {var _this9;_classCallCheck(this, Va);(t = $e({}, t)).lineJoin = \"miter\", t.lineCap = \"butt\", _this9 = _callSuper(this, Va, [e, t, n]), _this9.options.radialSegments % 2 == 1 && _this9.options.radialSegments--;return _this9;}_inherits(Va, _No);return _createClass(Va, [{ key: \"getFormat\", value: function getFormat() {var _this$_fnTypes12 = this._fnTypes,e = _this$_fnTypes12.lineWidthFn,t = _this$_fnTypes12.lineColorFn,n = _this$_fnTypes12.lineOpacityFn,i = _this$_fnTypes12.linePatternAnimSpeedFn,r = _this$_fnTypes12.linePatternGapFn,s = [].concat(_toConsumableArray(this.getPositionFormat()), [{ type: Int8Array, width: 4, name: \"aTubeNormal\" }, { type: this.options.positionType || Uint16Array, width: 1, name: \"aLinesofar\" }]);if (this.iconAtlas) {s.push({ type: Int8Array, width: 1, name: \"aNormalDistance\" });var _e149 = this.getIconAtlasMaxValue();s.push({ type: _e149 > 255 ? Uint16Array : Uint8Array, width: 4, name: \"aTexInfo\" });}return e && s.push({ type: Uint16Array, width: 1, name: \"aLineWidth\" }), t && s.push({ type: Uint8Array, width: 4, name: \"aColor\" }), n && s.push({ type: Uint8Array, width: 1, name: \"aOpacity\" }), i && s.push({ type: Int8Array, width: 1, name: \"aLinePatternAnimSpeed\" }), r && s.push({ type: Int8Array, width: 1, name: \"aLinePatternGap\" }), s;} }, { key: \"ensureDataCapacity\", value: function ensureDataCapacity(e, t, n, i) {var r = this.options.radialSegments / 2;return _superPropGet(Va, \"ensureDataCapacity\", this, 3)([e, t, n, i * r]);} }, { key: \"addHalfVertex\", value: function addHalfVertex(e, t, n, i, r, s, o, a) {var l = e.x,h = e.y,c = e.z,u = 1 * this.scaledDistance,f = this.options.radialSegments / 2,_o$dir = o.dir,d = _o$dir.x,p = _o$dir.y,g = _o$dir.z,m = function (e, t, n, i, r, s, o, a) {Mo(Ua, n, i, r), Mo(Ba, s, o, 0), Io(Ga, Ua, Ba), Po(Ba, Ba), Po(Ga, Ga), ja[t] || (ja[t] = []);var l = ja[t];for (var h = 0; h < t; h++) {var _e150 = Math.PI * h / t,_n108 = 0,_i81 = 1 - Math.abs(_e150 - _n108) / (Math.PI / 2);l[h] = l[h] || [], Wa(Ba, Ga, l[h], 1, _e150, _i81 * (a ? -1 : 1));}return l;}(0, f, d, p, g, t, n, r);this.prevVertex && this.fillTubeElements(r), this.fillData(this.data, l, h, c || 0, m, r, u, a);} }, { key: \"fillTubeElements\", value: function fillTubeElements(e) {var t = this.options.radialSegments / 2,n = this.needAltitudeAttribute() ? 2 : 3,i = this.data.aPosition.getLength() / n;for (var _n109 = 0; _n109 < t; _n109++) {var _r65 = _n109 + i,_s54 = _n109 + i - 2 * t;var _o43 = void 0,_a21 = void 0;_n109 === t - 1 && e ? (_o43 = _n109 + i - 2 * t + 1, _a21 = _n109 + i - 2 * t - 2 * t + 1) : (_o43 = _n109 + i + 1, _a21 = _n109 + i + 1 - 2 * t), _superPropGet(Va, \"addElements\", this, 3)([_r65 - this.offset, _o43 - this.offset, _s54 - this.offset]), _superPropGet(Va, \"addElements\", this, 3)([_s54 - this.offset, _o43 - this.offset, _a21 - this.offset]);}} }, { key: \"fillData\", value: function fillData(e, t, n, i, r, s, o, a) {var _this$_fnTypes13 = this._fnTypes,l = _this$_fnTypes13.lineWidthFn,h = _this$_fnTypes13.lineColorFn,c = _this$_fnTypes13.lineOpacityFn,u = _this$_fnTypes13.linePatternAnimSpeedFn,f = _this$_fnTypes13.linePatternGapFn,d = r.length;for (var _s55 = 0; _s55 < d; _s55++) {this.fillPosition(e, t, n, i), ko(r[_s55], r[_s55], Oo);var _d6 = e.aTubeNormal.currentIndex;for (var _t150 = 0; _t150 < r[_s55].length; _t150++) e.aTubeNormal[_d6++] = r[_s55][_t150];if (e.aTubeNormal.currentIndex = _d6, _d6 = e.aLinesofar.currentIndex, e.aLinesofar[_d6++] = o, e.aLinesofar.currentIndex = _d6, this.iconAtlas && (_d6 = e.aNormalDistance.currentIndex, e.aNormalDistance[_d6++] = Oo * a, e.aNormalDistance.currentIndex = _d6, _d6 = e.aTexInfo.currentIndex, e.aTexInfo[_d6++] = this.feaTexInfo[0], e.aTexInfo[_d6++] = this.feaTexInfo[1], e.aTexInfo[_d6++] = this.feaTexInfo[2], e.aTexInfo[_d6++] = this.feaTexInfo[3], e.aTexInfo.currentIndex = _d6), l) {var _t151 = at(this.options.metric);var _n110 = this.feaLineWidth * _t151;isNaN(_n110) && (_n110 = 0), _d6 = e.aLineWidth.currentIndex, e.aLineWidth[_d6++] = Math.round(_n110), e.aLineWidth.currentIndex = _d6;}h && (_d6 = e.aColor.currentIndex, e.aColor[_d6++] = this.feaColor[0], e.aColor[_d6++] = this.feaColor[1], e.aColor[_d6++] = this.feaColor[2], e.aColor[_d6++] = this.feaColor[3], e.aColor.currentIndex = _d6), c && (_d6 = e.aOpacity.currentIndex, e.aOpacity[_d6++] = this.feaOpacity, e.aOpacity.currentIndex = _d6), u && (_d6 = e.aLinePatternAnimSpeed.currentIndex, e.aLinePatternAnimSpeed[_d6++] = 127 * (this.feaPatternAnimSpeed || 0), e.aLinePatternAnimSpeed.currentIndex = _d6), f && (_d6 = e.aLinePatternGap.currentIndex, e.aLinePatternGap[_d6++] = 10 * (this.feaLinePatternGap || 0), e.aLinePatternGap.currentIndex = _d6);}this.maxPos = Math.max(this.maxPos, Math.abs(t) + 1, Math.abs(n) + 1);} }, { key: \"createDataPack\", value: function createDataPack(e, t) {var n = _superPropGet(Va, \"createDataPack\", this, 3)([e, t]);return n && (n.is2D = !1), n;} }]);}(No);var Ua = [],Ba = [],Ga = [],ja = {};function Wa(e, t, n, i, r, s) {return Co(n, i * (Math.cos(r) * e[0] + Math.sin(r) * t[0]), i * (Math.cos(r) * e[1] + Math.sin(r) * t[1]), i * (Math.cos(r) * e[2] + Math.sin(r) * t[2]), s), n;}var Xa = [],Ya = [],Za = [],qa = [],$a = [];function Ja(e, t, n, i, r, s, o, a) {Mo(Ya, n, i, r), Mo(Za, s, o, 0), Io(qa, Ya, Za), Po(Za, Za), Po(qa, qa), Fo(Xa, e, t);var l = function (e) {var t = e[0],n = e[1];return Math.hypot(t, n);}(Xa) / e,h = Math.atan(t / e);var c = Math.PI / 2 + (Math.PI / 2 - h);return $a[0] || ($a[0] = []), Wa(Za, qa, $a[0], l, c, a ? 1 : -1), c += 2 * h, $a[1] || ($a[1] = []), Wa(Za, qa, $a[1], l, c, a ? 1 : -1), $a;}var Ka = function () {function Ka(e) {_classCallCheck(this, Ka);this.max = e, this.reset();}return _createClass(Ka, [{ key: \"reset\", value: function reset() {return this.data = {}, this.order = [], this;} }, { key: \"clear\", value: function clear() {this.reset();} }, { key: \"add\", value: function add(e, t) {return this.has(e) ? (this.order.splice(this.order.indexOf(e), 1), this.data[e] = t, this.order.push(e)) : (this.data[e] = t, this.order.push(e), this.order.length > this.max && this.getAndRemove(this.order[0])), this;} }, { key: \"has\", value: function has(e) {return e in this.data;} }, { key: \"keys\", value: function keys() {return this.order;} }, { key: \"getAndRemove\", value: function getAndRemove(e) {if (!this.has(e)) return null;var t = this.data[e];return delete this.data[e], this.order.splice(this.order.indexOf(e), 1), t;} }, { key: \"get\", value: function get(e) {return this.has(e) ? this.data[e] : null;} }, { key: \"remove\", value: function remove(e) {return this.has(e) ? (delete this.data[e], this.order.splice(this.order.indexOf(e), 1), this) : this;} }, { key: \"setMaxSize\", value: function setMaxSize(e) {for (this.max = e; this.order.length > this.max;) this.getAndRemove(this.order[0]);return this;} }]);}();var Qa = 1e20;function el(e, t, n, i, r, s, o) {this.fontSize = e || 24, this.buffer = void 0 === t ? 3 : t, this.cutoff = i || .25, this.fontFamily = r || \"sans-serif\", this.fontWeight = s || \"normal\", this.fontStyle = o || \"normal\", this.radius = n || 8;var a = this.size = this.fontSize + 2 * this.buffer;this.canvas = \"undefined\" == typeof document ? new OffscreenCanvas(a, a) : document.createElement(\"canvas\"), this.canvas.width = this.canvas.height = a, this.ctx = this.canvas.getContext(\"2d\", { willReadFrequently: !0 }), this.ctx.font = this.fontStyle + \" \" + 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.z = new Float64Array(a + 1), this.v = new Uint16Array(a), this.middle = Math.round(a / 2 * (navigator.userAgent.indexOf(\"Gecko/\") >= 0 ? 1.2 : 1));}function tl(e, t, n, i, r, s) {for (var o = 0; o < t; o++) nl(e, o, t, n, i, r, s);for (var a = 0; a < n; a++) nl(e, a * t, 1, t, i, r, s);}function nl(e, t, n, i, r, s, o) {var a, l, h, c;for (s[0] = 0, o[0] = -Qa, o[1] = Qa, a = 0; a < i; a++) r[a] = e[t + a * n];for (a = 1, l = 0, h = 0; a < i; a++) {do {c = s[l], h = (r[a] - r[c] + a * a - c * c) / (a - c) / 2;} while (h <= o[l] && --l > -1);s[++l] = a, o[l] = h, o[l + 1] = Qa;}for (a = 0, l = 0; a < i; a++) {for (; o[l + 1] < a;) l++;c = s[l], e[t + a * n] = r[c] + (a - c) * (a - c);}}el.prototype.draw = function (e, t, n) {this.ctx.clearRect(0, 0, this.size, this.size), this.ctx.textBaseline = \"top\", this.ctx.fillText(e, this.buffer, this.buffer);for (var i = this.ctx.getImageData(0, 0, t, n), r = new Uint8ClampedArray(t * n), s = 0; s < t * n; s++) {var o = i.data[4 * s + 3] / 255;this.gridOuter[s] = 1 === o ? 0 : 0 === o ? Qa : Math.pow(Math.max(0, .5 - o), 2), this.gridInner[s] = 1 === o ? Qa : 0 === o ? 0 : Math.pow(Math.max(0, o - .5), 2);}for (tl(this.gridOuter, t, n, this.f, this.v, this.z), tl(this.gridInner, t, n, this.f, this.v, this.z), s = 0; s < t * n; s++) {var a = Math.sqrt(this.gridOuter[s]) - Math.sqrt(this.gridInner[s]);r[s] = Math.round(255 - 255 * (a / this.radius + this.cutoff));}return r;};var il = 0;function rl(e) {var t = { width: e.bitmap.width, height: e.bitmap.height, data: new Uint8ClampedArray(e.bitmap.data) };return { charCode: e.charCode, bitmap: t, metrics: $e({}, e.metrics) };}var sl = Object.freeze({ __proto__: null, calculateSignedArea: b, clipPolygon: Ea, convertGeometry: N, convertRTLText: qs, generatePickingIndiceIndex: I, getFeaAltitudeAndHeight: w, getIndexArrayType: E, getPosArrayType: D, getUnsignedArrayType: L, packPosition: pt, unpackPosition: function unpackPosition(e, t, n, i) {var r = (Math.sign(t) || 1) * (Math.abs(t) % gt),s = (Math.sign(n) || 1) * (Math.abs(n) % gt),o = Math.floor(Math.abs(t) / gt),a = Math.floor(Math.abs(n) / gt);return e[0] = r, e[1] = s, e[2] = Math.sign(i + 1e-5) * (2 * o + a) * mt + i, e;} });var ol = {},al = {},ll = [];var hl = Object.freeze({ __proto__: null, loadSymbolFnTypes: function e(t, n) {if (!t) return null;var i = !1;if (Array.isArray(t)) {var r,s = [];for (var _o44 = 0; _o44 < t.length; _o44++) (r = e(t[_o44], n)) ? (s.push(r), i = !0) : s.push(t[_o44]);return i ? s : t;}var o = { __fn_types_loaded: !0 };var a = [];for (var _e151 in t) it(t, _e151) && a.push(_e151);var l = function l(e) {Object.defineProperty(o, e, { get: function get() {return this[\"__fn_\" + e] || (this[\"__fn_\" + e] = re(this[\"_\" + e])), this[\"__fn_\" + e].apply(this, n());}, set: function set(t) {this[\"_\" + e] = t;}, configurable: !0, enumerable: !0 });},h = {},c = function c(e, t) {Object.defineProperty(o, e, { get: function get() {this[\"__fn_\" + e] || (this[\"__fn_\" + e] = Wr(this[\"_\" + e], t));var i = n()[0];h.zoom = i;try {return this[\"__fn_\" + e].evaluateWithoutErrorHandling(h, ol, al, null, ll);} catch (e) {return null;}}, set: function set(t) {this[\"_\" + e] = t;}, configurable: !0, enumerable: !0 });};for (var _e152 = 0, _n111 = a.length; _e152 < _n111; _e152++) {var _n112 = a[_e152];if (ie(t[_n112])) i = !0, o[\"_\" + _n112] = t[_n112], l(_n112);else if (Xr(t[_n112])) {i = !0;var _e153 = Jr(_n112);o[\"_\" + _n112] = t[_n112], c(_n112, _e153);} else o[_n112] = t[_n112];}return i ? o : t;} });var cl = { polygonPatternFile: 1, markerFile: 1, markerPlacement: 1, markerSpacing: 1, textName: 1, textFaceName: 1, textPlacement: 1, textSpacing: 1, lineJoin: 1, lineCap: 1, linePatternFile: 1 },ul = { visible: 1, textHorizontalAlignment: 1, textVerticalAlignment: 1, textWrapWidth: 1, markerHorizontalAlignment: 1, markerVerticalAlignment: 1 },fl = { lineDasharray: 1, topPolygonFill: 1, bottomPolygonFill: 1 };Object.assign(ul, cl), Object.assign(fl, cl), e.ArrayPool = ss, e.CirclePack = function (_gs3) {function _class2() {_classCallCheck(this, _class2);return _callSuper(this, _class2, arguments);}_inherits(_class2, _gs3);return _createClass(_class2, [{ key: \"getFormat\", value: function getFormat() {return za;} }, { key: \"placeVector\", value: function placeVector(e, t) {var n = this._getAnchors(e, t);if (0 === n.length) return;var i = this.data,r = this.getAltitude(e.feature.properties);var s = i.aPosition.getLength() / za[0].width;for (var _e154 = 0; _e154 < n.length; _e154++) {var _t152 = n[_e154];i.aPosition.push(2 * _t152.x + 0, 2 * _t152.y + 0, r), i.aPosition.push(2 * _t152.x + 1, 2 * _t152.y + 0, r), i.aPosition.push(2 * _t152.x + 1, 2 * _t152.y + 1, r), i.aPosition.push(2 * _t152.x + 0, 2 * _t152.y + 1, r), this.addElements(s, s + 1, s + 2), this.addElements(s, s + 2, s + 3), s += 4;var _o45 = Math.max(Math.abs(2 * _t152.x + 1), Math.abs(2 * _t152.y + 1));_o45 > this.maxPos && (this.maxPos = _o45);}} }, { key: \"_getAnchors\", value: function _getAnchors(e, t) {var n = e.feature,i = e.symbol,r = this._getPlacement(e, i),s = n.properties,o = this._fnTypes.markerSpacingFn,a = ((o ? o(null, s) : i.markerSpacing) || 250) * t;return mo(e, null, null, t, this.options.EXTENT, r, a);} }, { key: \"_getPlacement\", value: function _getPlacement(e, t) {return this._fnTypes.markerPlacementFn ? this._fnTypes.markerPlacementFn(this.options.zoom, e.feature.properties) : t.markerPlacement;} }]);}(gs), e.DEFAULT_TEX_WIDTH = 23.25, e.FilterUtil = Kr, e.FuncTypeUtil = hl, e.GlyphRequestor = function () {function _class3(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 15;var n = arguments.length > 2 ? arguments[2] : undefined;var i = arguments.length > 3 ? arguments[3] : undefined;_classCallCheck(this, _class3);this.entries = {}, this._cachedFont = {}, this._cache = new Ka(2048, function () {}), this._framer = e, this._limit = t, this._isCompactChars = n, this._sdfURL = i;}return _createClass(_class3, [{ key: \"_isValidSDFURL\", value: function _isValidSDFURL(e) {return e && e.indexOf(\"{stack}\") >= 0 && e.indexOf(\"{range}\") > 0;} }, { key: \"getGlyphs\", value: function getGlyphs(e, t) {var _this10 = this;if (!e || !Object.keys(e).length) return void t(null, { glyphs: null });if (this._isValidSDFURL(this._sdfURL)) return void this._requestRemoteSDF(e, t);var n = this.entries,i = e.options;var r = !0;i && (r = !1 !== i.isCharsCompact), r = r || this._isCompactChars;var s = function s(i, _s56, a) {var l = 0,h = 0;for (var _t153 in e) if (\"options\" !== _t153) {n[_t153] = n[_t153] || {}, _s56[_t153] = _s56[_t153] || {};for (var _c10 in e[_t153]) {if (h++, h <= i) continue;var _e155 = r && !Os(+_c10),_u5 = _t153 + \":\" + _c10 + \":\" + _e155;var _f6 = void 0;if (_this10._cache.has(_u5) ? _f6 = _this10._cache.get(_u5) : (_f6 = _this10._tinySDF(n[_t153], _t153, _c10, _e155), _this10._cache.add(_u5, _f6), l++), _f6 = rl(_f6), _s56[_t153][_c10] = _f6, a.push(_f6.bitmap.data.buffer), _this10._framer && l > _this10._limit) return void _this10._framer(o(h, _s56, a));}}t(null, { glyphs: _s56, buffers: a });};function o(e, t, n) {return function () {s(e, t, n);};}s(0, {}, []);} }, { key: \"_requestRemoteSDF\", value: function _requestRemoteSDF(e, t) {var n = [];for (var _t154 in e) {var _iterator46 = _createForOfIteratorHelper(e[_t154]),_step46;try {for (_iterator46.s(); !(_step46 = _iterator46.n()).done;) {var _i82 = _step46.value;n.push(this._requestGlyph(_t154, _i82));}} catch (err) {_iterator46.e(err);} finally {_iterator46.f();}}Promise.all(n).then(function (e) {t(null, e);});} }, { key: \"_requestGlyph\", value: function _requestGlyph() {return Promise.resolve(null);} }, { key: \"_tinySDF\", value: function _tinySDF(e, t, n, i) {var r = t;var s = e.tinySDF;var o = i ? -1 : 2;if (!s) {var _t155 = \"400\";/bolder/i.test(r) ? _t155 = \"1000\" : /bold/i.test(r) ? _t155 = \"900\" : /medium/i.test(r) ? _t155 = \"500\" : /light/i.test(r) && (_t155 = \"200\"), s = e.tinySDF = new el(24, 2, 8, .25, r, _t155);}var a = String.fromCodePoint(n),l = s.ctx.measureText(a),h = Math.round(l.width),c = s.draw(a, h + 4, 28);if (il < 4) {var _e156 = \"undefined\" != typeof document && document.getElementById(\"sdf-debug-\" + il++);_e156 && (_e156.width = h + 4, _e156.height = s.canvas.height, _e156.getContext(\"2d\").drawImage(s.canvas, 0, 0));}return { charCode: n, bitmap: { width: h + 4, height: 28, data: c }, metrics: { width: h, height: 24, left: 1, top: -2, advance: h + 2 + o } };} }]);}(), e.INVALID_TEX_COORD = Na, e.LRUCache = Ka, e.LineExtrusionPack = function (_No2) {function _class4(e, t, n) {var _this11;_classCallCheck(this, _class4);_this11 = _callSuper(this, _class4, [e, t, n]), _this11._hasALineHeight = n.altitudeProperty;return _this11;}_inherits(_class4, _No2);return _createClass(_class4, [{ key: \"getFormat\", value: function getFormat() {var _this$_fnTypes14 = this._fnTypes,e = _this$_fnTypes14.lineColorFn,t = _this$_fnTypes14.lineWidthFn,n = [{ type: Math.max(Math.abs(this.maxPosZ), Math.abs(this.minPosZ)) >= Math.pow(2, 15) ? Float32Array : Int16Array, width: 3, name: \"aPosition\" }, { type: Uint16Array, width: 1, name: \"aLinesofar\" }, { type: Uint8Array, width: 1, name: \"aUp\" }, { type: Int16Array, width: 3, name: \"aExtrudedPosition\" }, { type: Int8Array, width: 2, name: \"aExtrude\" }];return e && n.push({ type: Uint8Array, width: 4, name: \"aColor\" }), t && n.push({ type: Uint8Array, width: 1, name: \"aLineWidth\" }), this._hasALineHeight && n.push({ type: Float32Array, width: 1, name: \"aLineHeight\" }), n;} }, { key: \"placeVector\", value: function placeVector(e) {var t = e.feature;if (this._hasALineHeight) {var _this$options4 = this.options,_e157 = _this$options4.altitudeScale,_n113 = _this$options4.altitudeProperty,_i83 = _this$options4.defaultAltitude,_r66 = _this$options4.heightProperty,_s57 = _this$options4.defaultHeight,_o46 = _this$options4.minHeightProperty,_w3 = w(t, _e157, _n113, _i83, _r66, _s57, _o46),_a22 = _w3.altitude,_l19 = _w3.height;this.feaAltitude = _a22, this.feaMinHeight = (_a22 - _l19) / _a22 * 32767, _a22 > this.maxAltitude && (this.maxAltitude = _a22);}return _superPropGet(_class4, \"placeVector\", this, 3)([e]);} }, { key: \"needAltitudeAttribute\", value: function needAltitudeAttribute() {return !1;} }, { key: \"_addLine\", value: function _addLine(e, t, n, i, r, s) {var o = this.data.aPosition.getLength() / 3;_superPropGet(_class4, \"_addLine\", this, 3)([e, t, n, i, r, s]);var a = this.data.aPosition.getLength() / 3,l = this.data.aPosition.getLength() / 3 - this.offset,h = 3 === t.type,c = !1 !== this.options.side;if (!h && l > 0 && c) {var _e158 = !1 !== this.options.top ? 1 : 0,_t156 = _e158 + 4;var _n114 = this.data.aPosition.getLength() / 3;for (var _e159 in this.data) {var _t157 = this.data[_e159],_i84 = _t157.getLength() / _n114;var _r67 = _t157.currentIndex;for (var _e160 = 0; _e160 < _i84; _e160++) _t157[_r67++] = _t157[o * _i84 + 3 * _i84 + _e160];_t157.currentIndex = _r67;}_n114 = this.data.aPosition.getLength() / 3;for (var _e161 in this.data) {var _i85 = this.data[_e161],_r68 = _i85.getLength() / _n114;var _s58 = _i85.currentIndex;for (var _e162 = 0; _e162 < _r68; _e162++) _i85[_s58++] = _i85[o * _r68 + _r68 * _t156 + _e162];_i85.currentIndex = _s58;}_n114 = this.data.aPosition.getLength() / 3;for (var _e163 in this.data) {var _i86 = this.data[_e163],_r69 = _i86.getLength() / _n114;var _s59 = _i86.currentIndex;for (var _e164 = 0; _e164 < _r69; _e164++) _i86[_s59++] = _i86[o * _r69 + _r69 * (_t156 + 3) + _e164];_i86.currentIndex = _s59;}_superPropGet(_class4, \"addElements\", this, 3)([_e158 + 1, l + 1, l]), _superPropGet(_class4, \"addElements\", this, 3)([l, l + 1, l + 2]);var _i87 = this.data.aPosition.getLength() / 3 - this.offset;_n114 = this.data.aPosition.getLength() / 3;for (var _e165 in this.data) {var _t158 = this.data[_e165],_i88 = _t158.getLength() / _n114;var _r70 = _t158.currentIndex;for (var _e166 = 0; _e166 < _i88; _e166++) _t158[_r70++] = _t158[a * _i88 - _i88 + _e166];_t158.currentIndex = _r70;}_n114 = this.data.aPosition.getLength() / 3;for (var _e167 in this.data) {var _i89 = this.data[_e167],_r71 = _i89.getLength() / _n114;var _s60 = _i89.currentIndex;for (var _e168 = 0; _e168 < _r71; _e168++) _i89[_s60++] = _i89[a * _r71 - _t156 * _r71 - _r71 + _e168];_i89.currentIndex = _s60;}_n114 = this.data.aPosition.getLength() / 3;for (var _e169 in this.data) {var _i90 = this.data[_e169],_r72 = _i90.getLength() / _n114;var _s61 = _i90.currentIndex;for (var _e170 = 0; _e170 < _r72; _e170++) _i90[_s61++] = _i90[a * _r72 - _t156 * _r72 - 3 * _r72 + _e170];_i90.currentIndex = _s61;}_superPropGet(_class4, \"addElements\", this, 3)([_i87, l - 3, _i87 + 1]), _superPropGet(_class4, \"addElements\", this, 3)([l - 3, _i87 + 2, _i87 + 1]);}} }, { key: \"fillData\", value: function fillData(e, t, n, i, r, s, o, a, l) {var h = !1 !== this.options.top,c = !1 !== this.options.side,u = this.options.EXTENT / this.options.tileSize,f = this.feaLineWidth || this.symbol.lineWidth / 2 * u,d = Oo * r,p = Oo * s,g = f * r + t,m = f * s + n;this._fillTop(e, t, n, r, s, o, a, l, g, m, d, p), c && (h && this._fillTop(e, t, n, r, s, o, a, l, g, m, d, p), this._fillTop(e, t, n, r, s, o, a, l, g, m, d, p), this._fillBottom(e, t, n, r, s, o, a, l, g, m, d, p), this._fillBottom(e, t, n, r, s, o, a, l, g, m, d, p)), this.maxPos = Math.max(this.maxPos, Math.abs(t), Math.abs(n));} }, { key: \"_fillTop\", value: function _fillTop(e, t, n, i, r, s, o, a, l, h, c, u) {var _this$_fnTypes15 = this._fnTypes,f = _this$_fnTypes15.lineColorFn,d = _this$_fnTypes15.lineWidthFn;var p = e.aPosition.currentIndex;e.aPosition[p++] = t, e.aPosition[p++] = n, e.aPosition[p++] = 32767, e.aPosition.currentIndex = p, p = e.aLinesofar.currentIndex, e.aLinesofar[p++] = a, e.aLinesofar.currentIndex = p, p = e.aUp.currentIndex, e.aUp[p++] = +o, e.aUp.currentIndex = p, p = e.aExtrudedPosition.currentIndex, e.aExtrudedPosition[p++] = l, e.aExtrudedPosition[p++] = h, e.aExtrudedPosition[p++] = 1, e.aExtrudedPosition.currentIndex = p, p = e.aExtrude.currentIndex, e.aExtrude[p++] = c, e.aExtrude[p++] = u, e.aExtrude.push(c, u), f && (p = e.aColor.currentIndex, e.aColor[p++] = this.feaColor[0], e.aColor[p++] = this.feaColor[1], e.aColor[p++] = this.feaColor[2], e.aColor[p++] = this.feaColor[3], e.aColor.currentIndex = p), d && (p = e.aLineWidth.currentIndex, e.aLineWidth[p++] = Math.round(2 * this.feaLineWidth), e.aLineWidth.currentIndex = p), this._hasALineHeight && (p = e.aLineHeight.currentIndex, e.aLineHeight[p++] = this.feaAltitude, e.aLineHeight.currentIndex = p);} }, { key: \"_fillBottom\", value: function _fillBottom(e, t, n, i, r, s, o, a, l, h, c, u) {var _this$_fnTypes16 = this._fnTypes,f = _this$_fnTypes16.lineColorFn,d = _this$_fnTypes16.lineWidthFn;var p = e.aPosition.currentIndex;e.aPosition[p++] = t, e.aPosition[p++] = n, e.aPosition[p++] = this.feaMinHeight || 0, e.aPosition.currentIndex = p, p = e.aLinesofar.currentIndex, e.aLinesofar[p++] = a, e.aLinesofar.currentIndex = p, p = e.aUp.currentIndex, e.aUp[p++] = +o, e.aUp.currentIndex = p, p = e.aExtrudedPosition.currentIndex, e.aExtrudedPosition[p++] = l, e.aExtrudedPosition[p++] = h, e.aExtrudedPosition[p++] = 1, e.aExtrudedPosition.currentIndex = p, p = e.aExtrude.currentIndex, e.aExtrude[p++] = c, e.aExtrude[p++] = u, e.aExtrude.push(c, u), f && (p = e.aColor.currentIndex, e.aColor[p++] = this.feaColor[0], e.aColor[p++] = this.feaColor[1], e.aColor[p++] = this.feaColor[2], e.aColor[p++] = this.feaColor[3], e.aColor.currentIndex = p), d && (p = e.aLineWidth.currentIndex, e.aLineWidth[p++] = Math.round(2 * this.feaLineWidth), e.aLineWidth.currentIndex = p), this._hasALineHeight && (p = e.aLineHeight.currentIndex, e.aLineHeight[p++] = this.feaAltitude, e.aLineHeight.currentIndex = p);} }, { key: \"addElements\", value: function addElements(e, t, n) {var i = !1 !== this.options.top,r = !1 !== this.options.side,s = (i ? 1 : 0) + (r ? 4 : 0),o = this.offset;if (e *= s, t *= s, n *= s, this.data.aUp[o + n + 4]) {if (i && _superPropGet(_class4, \"addElements\", this, 3)([t, e, n]), r) {var _e171 = i ? 1 : 0;_superPropGet(_class4, \"addElements\", this, 3)([t + _e171, n + _e171, n + _e171 + 2]), _superPropGet(_class4, \"addElements\", this, 3)([t + _e171 + 1, n + _e171 + 1 + 2, t + _e171 + 1 + 2]);}} else if (i && _superPropGet(_class4, \"addElements\", this, 3)([e, n, t]), r) {var _t159 = i ? 1 : 0;_superPropGet(_class4, \"addElements\", this, 3)([e + _t159, e + _t159 + 2, n + _t159]), _superPropGet(_class4, \"addElements\", this, 3)([e + _t159 + 1 + 2, n + _t159 + 1 + 2, n + _t159 + 1]);}} }, { key: \"createDataPack\", value: function createDataPack(e, t) {this.maxAltitude = 0;var n = _superPropGet(_class4, \"createDataPack\", this, 3)([e, t]);if (!n) return n;var i = n.data,r = n.indices;this.getFormat().reduce(function (e, t) {return e[t.name] = { size: t.width }, e;}, {}).aPickingId = { size: 1 };var s = i.aExtrudedPosition,o = i.aPosition,a = i.aLinesofar,l = i.aUp,h = i.aExtrude,c = i.aColor,u = i.aLineHeight,f = i.aLineWidth,d = {},p = function (e, t, n) {var i = [];i.setLength && i.setLength(e.length);var r = qo;r.length < e.length / 3 && (r.length = e.length / 3), r.fill(0, 0, e.length / 3);var s = void 0 === t.length ? t : t.length;for (var _n115 = 0; _n115 < s / 3; _n115++) void 0 === t.length ? ia(e, 3 * _n115, 3 * _n115 + 1, 3 * _n115 + 2, i, r) : ia(e, t[3 * _n115], t[3 * _n115 + 1], t[3 * _n115 + 2], i, r);for (var _e172 = 0; _e172 < i.length; _e172 += 3) {var _t160 = r[_e172 / 3];0 !== _t160 ? (i[_e172] /= _t160, i[_e172 + 1] /= _t160, i[_e172 + 2] /= _t160) : (i[_e172] = 0, i[_e172 + 1] = 0, i[_e172 + 2] = 0);}return i;}(s, r);var g,m = !0;for (var _e173 = 0; _e173 < p.length; _e173++) p[_e173] = -p[_e173], p[_e173] % 1 != 0 && (m = !1);if (!1 !== this.options.top && this.symbol.material && function (e) {for (var _t161 in e) if (_t161.indexOf(\"Texture\") >= 0 && e[_t161]) return !0;return !1;}(this.symbol.material) && (g = function (e, t, n) {var i = [];for (var _r73 = 0; _r73 < e.length; _r73 += 3) {var _e174 = t[_r73 / 3];n[_r73 / 3] ? i.push(_e174 / 256, 1) : i.push(_e174 / 256, 0);}return i;}(s, a, l)), d.aPosition = o, g && (d.aTexCoord0 = new Float32Array(g)), d.aNormal = m ? new Int8Array(p) : new Float32Array(p), d.aPickingId = i.aPickingId, d.aExtrude = h, c && (d.aColor = c), f && (d.aLineWidth = f), u) {var _e175 = D(this.maxAltitude);d.aLineHeight = new _e175(u);}var y = [];for (var _e176 in d) y.push(d[_e176].buffer);return n.data = d, n.buffers = y, n;} }]);}(No), e.LinePack = No, e.NativeLinePack = function (_gs4) {function _class5() {_classCallCheck(this, _class5);return _callSuper(this, _class5, arguments);}_inherits(_class5, _gs4);return _createClass(_class5, [{ key: \"getFormat\", value: function getFormat() {return [].concat(_toConsumableArray(this.getPositionFormat()));} }, { key: \"placeVector\", value: function placeVector(e) {var t = e.feature,n = 3 === t.type,i = t.geometry,r = this.elements;n && (this.elements = this._arrayPool.get());var s = this.needAltitudeAttribute() ? 2 : 3;for (var _e177 = 0; _e177 < i.length; _e177++) this.offset = this.data.aPosition.getLength() / s, this._addLine(i[_e177], t), n && (this._filterPolygonEdges(r), this.elements = this._arrayPool.get());n && (this.elements = r);} }, { key: \"_addLine\", value: function _addLine(e, t) {var n = 3 === t.type;var i = e.length;for (; i >= 2 && e[i - 1].equals(e[i - 2]);) i--;var r,s,o,a = 0;for (; a < i - 1 && e[a].equals(e[a + 1]);) a++;if (!(i < (n ? 3 : 2))) {this.distance = 0, this.vertexLength = 0, this.primitiveLength = 0, this.e1 = this.e2 = this.e3 = -1, n && (r = e[i - 2]);for (var _t162 = a; _t162 < i; _t162++) o = n && _t162 === i - 1 ? e[a + 1] : e[_t162 + 1], o && e[_t162].equals(o) || (r && (s = r), r = e[_t162], s && (this.distance += r.dist(s)), this.addCurrentVertex(r, this.distance));}} }, { key: \"addCurrentVertex\", value: function addCurrentVertex(e, t) {var n = this.vertexLength++;this.addLineVertex(this.data, e, t), n >= 1 && this.addElements(n - 1, n), t > ra && (this.distance = 0, this.addCurrentVertex(e, this.distance));} }, { key: \"addLineVertex\", value: function addLineVertex(e, t) {var n = this.needAltitudeAttribute();this.fillPosition(e, t.x, t.y, t.z || 0), this.maxPos = n ? Math.max(this.maxPos, Math.abs(t.x), Math.abs(t.y)) : Math.max(this.maxPos, Math.abs(t.x), Math.abs(t.y), Math.abs(t.z || 0));} }, { key: \"addElements\", value: function addElements(e, t) {this.maxIndex = Math.max(this.maxIndex, this.offset + e, this.offset + t);var n = this.elements.currentIndex;this.elements[n++] = this.offset + e, this.elements[n++] = this.offset + t, this.elements.currentIndex = n;} }, { key: \"_filterPolygonEdges\", value: function _filterPolygonEdges(e) {var t = this.options.EXTENT,n = this.elements,i = n.getLength();for (var _r74 = 0; _r74 < i; _r74 += 2) if (!A(this.data.aPosition, n[_r74], n[_r74 + 1], 3, t)) {var _t163 = e.currentIndex;e[_t163++] = n[_r74], e[_t163++] = n[_r74 + 1], e.currentIndex = _t163;}} }]);}(gs), e.NativePointPack = function (_gs5) {function _class6() {_classCallCheck(this, _class6);return _callSuper(this, _class6, arguments);}_inherits(_class6, _gs5);return _createClass(_class6, [{ key: \"getFormat\", value: function getFormat() {var e = this._fnTypes.markerFillFn;var t;return t = \"line\" === this.symbol.markerRotationAlignment ? [].concat(_toConsumableArray(this.getPositionFormat()), [{ type: Float32Array, width: 1, name: \"aXYRotation\" }, { type: Float32Array, width: 1, name: \"aZRotation\" }]) : [].concat(_toConsumableArray(this.getPositionFormat())), e && t.push({ type: Uint8Array, width: 4, name: \"aColor\" }), t;} }, { key: \"placeVector\", value: function placeVector(e) {var t = e.feature.properties,n = this._fnTypes.markerFillFn;var i;n && (i = n(this.options.zoom, t) || [255, 255, 255, 255], ie(i) ? (this.dynamicAttrs.aColor = 1, i = [0, 0, 0, 0]) : i = ht([], i));var r = this.data,s = this.symbol.markerSpacing || 250,o = this.symbol.markerPlacement || \"point\",a = \"line\" === this.symbol.markerRotationAlignment,l = this._getAnchors(e, s, o, a),h = this.needAltitudeAttribute();for (var _e178 = 0; _e178 < l.length; _e178++) {var _t164 = l[_e178];if (this.fillPosition(this.data, _t164.x, _t164.y, _t164.z), a) {var _e179 = r.aXYRotation.currentIndex;r.aXYRotation[_e179++] = _t164.xyRotation || 0, r.aXYRotation.currentIndex = _e179, _e179 = r.aZRotation.currentIndex, r.aZRotation[_e179++] = _t164.zRotation || 0, r.aZRotation.currentIndex = _e179;}if (i) {var _e180 = r.aColor.currentIndex;r.aColor[_e180++] = i[0], r.aColor[_e180++] = i[1], r.aColor[_e180++] = i[2], r.aColor[_e180++] = i[3], r.aColor.currentIndex = _e180;}var _n116 = void 0;_n116 = h ? Math.max(Math.abs(_t164.x), Math.abs(_t164.y)) : Math.max(Math.abs(_t164.x), Math.abs(_t164.y), Math.abs(_t164.z || 0)), _n116 > this.maxPos && (this.maxPos = _n116);}} }, { key: \"_getAnchors\", value: function _getAnchors(e, t, n, i) {var r = e.feature,s = this.options.EXTENT;if (\"line\" === n) {var _e181 = [];var _n117 = r.geometry;s && (_n117 = Qs(r.geometry, 0, 0, s, s));for (var _i91 = 0; _i91 < _n117.length; _i91++) {var _r75 = no(_n117[_i91], t, sa, null, 0, 24, 1, 1, s || 1 / 0);_e181.push.apply(_e181, _r75);}return _e181;}return yo(r, n, s, i, this.options.altitudeToTileScale);} }, { key: \"hasElements\", value: function hasElements() {return !1;} }]);}(gs), e.PackUtil = sl, e.PointPack = Ao, e.PolygonPack = function (_gs6) {function _class7() {var _this12;_classCallCheck(this, _class7);for (var _len4 = arguments.length, e = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {e[_key4] = arguments[_key4];}_this12 = _callSuper(this, _class7, [].concat(e)), _this12.lineElements = [];return _this12;}_inherits(_class7, _gs6);return _createClass(_class7, [{ key: \"createStyledVector\", value: function createStyledVector(e, t, n, i, r) {var s = new dt(e, t, n, i),o = s.getPolygonResource();return !this.options.atlas && o && (r[o] = [0, 0]), s;} }, { key: \"getFormat\", value: function getFormat() {var e = [].concat(_toConsumableArray(this.getPositionFormat())),_this$_fnTypes17 = this._fnTypes,t = _this$_fnTypes17.polygonFillFn,n = _this$_fnTypes17.polygonOpacityFn,i = _this$_fnTypes17.uvScaleFn,r = _this$_fnTypes17.uvOffsetFn,s = _this$_fnTypes17.polygonPatternUVFn;if (this.iconAtlas) {var _t165 = this.getIconAtlasMaxValue();e.push({ type: _t165 > 255 ? Uint16Array : Uint8Array, width: 4, name: \"aTexInfo\" });}return t && e.push({ type: Uint8Array, width: 4, name: \"aColor\" }), n && e.push({ type: Uint8Array, width: 1, name: \"aOpacity\" }), i && e.push({ type: Uint16Array, width: 2, name: \"aUVScale\" }), r && e.push({ type: Uint8Array, width: 2, name: \"aUVOffset\" }), s && e.push({ type: Float32Array, width: 2, name: \"aTexCoord\" }), e;} }, { key: \"placeVector\", value: function placeVector(e, t) {var n = e.feature,i = n.geometry;this._addPolygon(i, n, t);} }, { key: \"_addPolygon\", value: function _addPolygon(e, t) {var n, i, r, s;var _this$_fnTypes18 = this._fnTypes,o = _this$_fnTypes18.polygonFillFn,a = _this$_fnTypes18.polygonOpacityFn,l = _this$_fnTypes18.uvScaleFn,h = _this$_fnTypes18.uvOffsetFn,c = _this$_fnTypes18.uvOffsetInMeterFn,u = _this$_fnTypes18.polygonPatternUVFn,f = t.properties;o && (n = o(this.options.zoom, f) || Co([], 255, 255, 255, 255), ie(n) ? (this.dynamicAttrs.aColor = 1, n = Ha) : n = ht([], n)), a && (i = a(this.options.zoom, f), ie(i) ? (this.dynamicAttrs.aOpacity = 1, i = 255) : (Je(i) && (i = 1), i *= 255)), l && (r = l(this.options.zoom, f), ie(r) ? (r = [255, 255], this.dynamicAttrs.aUVScale = 1) : (Je(r) && (r = [1, 1]), r = [255 * r[0], 255 * r[1]])), h && (c && c(null, f) ? s = [0, 0] : (s = h(this.options.zoom, f), ie(s) ? (s = [0, 0], this.dynamicAttrs.aUVOffset = 1) : (Je(s) && (s = [0, 0]), s = [255 * s[0], 255 * s[1]])));var d = !!this.iconAtlas,p = ao(e, 500),g = [0, 0],m = [0, 0];if (d) {var _e182 = this._fnTypes.polygonPatternFileFn,_t166 = _e182 ? _e182(null, f) : this.symbol.polygonPatternFile;if (this.iconAtlas.glyphMap[_t166]) {var _e183 = this.iconAtlas.positions[_t166],_n118 = !C(_e183.displaySize[0]) || !C(_e183.displaySize[1]);g[0] = _e183.tl[0] + (_n118 ? 1 : 0), g[1] = _e183.tl[1] + (_n118 ? 1 : 0), m[0] = _e183.displaySize[0] - 1 - (_n118 ? 2 : 0), m[1] = _e183.displaySize[1] - 1 - (_n118 ? 2 : 0);}}var y,x = 0;u && (y = u(this.options.zoom, f));var _ = this.needAltitudeAttribute() ? 2 : 3,v = [-1, -1, t.extent + 1, t.extent + 1],b = this._flattened = this._flattened || this._arrayPool.getProxy(),A = this._holeIndices = this._holeIndices || this._arrayPool.getProxy();for (var _e184 = 0; _e184 < p.length; _e184++) {var _t167 = p[_e184],_o47 = this.data.aPosition.getLength() / _;b.setLength(0), A.setLength(0);for (var _e185 = 0; _e185 < _t167.length; _e185++) {var _o48 = _t167[_e185];if (this.options.EXTENT !== 1 / 0 && 0 === this.maxPosZ && 0 === this.minPosZ && (_o48 = Ea(_o48, v)), 0 === _o48.length) continue;0 !== _e185 && A.push(b.length / 3), this.ensureDataCapacity(_o48.length);var _a23 = this.data;for (var _e186 = 0; _e186 < _o48.length; _e186++) {var _t168 = _o48[_e186].x,_l20 = _o48[_e186].y,_h11 = _o48[_e186].z || 0;if (this.fillPosition(this.data, _t168, _l20, _h11), d) {var _e187 = _a23.aTexInfo.currentIndex;_a23.aTexInfo[_e187++] = g[0], _a23.aTexInfo[_e187++] = g[1], _a23.aTexInfo[_e187++] = m[0], _a23.aTexInfo[_e187++] = m[1], _a23.aTexInfo.currentIndex = _e187;}if (void 0 !== n) {var _e188 = _a23.aColor.currentIndex;_a23.aColor[_e188++] = n[0], _a23.aColor[_e188++] = n[1], _a23.aColor[_e188++] = n[2], _a23.aColor[_e188++] = n[3], _a23.aColor.currentIndex = _e188;}if (void 0 !== i) {var _e189 = _a23.aOpacity.currentIndex;_a23.aOpacity[_e189++] = i, _a23.aOpacity.currentIndex = _e189;}if (void 0 !== r) {var _e190 = _a23.aUVScale.currentIndex;_a23.aUVScale[_e190++] = r[0], _a23.aUVScale[_e190++] = r[1], _a23.aUVScale.currentIndex = _e190;}if (void 0 !== s) {var _e191 = _a23.aUVOffset.currentIndex;_a23.aUVOffset[_e191++] = s[0], _a23.aUVOffset[_e191++] = s[1], _a23.aUVOffset.currentIndex = _e191;}if (u) {var _e192 = _a23.aTexCoord.currentIndex;if (y) {var _t169 = Je(y[2 * x]) ? y[0] : y[2 * x],_n119 = Je(y[2 * x] + 1) ? y[1] : y[2 * x + 1];_a23.aTexCoord[_e192++] = _t169, _a23.aTexCoord[_e192++] = _n119;} else _a23.aTexCoord[_e192++] = Na, _a23.aTexCoord[_e192++] = Na;_a23.aTexCoord.currentIndex = _e192, x++;}var _c11 = Math.abs(_t168),_f7 = Math.abs(_l20);_c11 > this.maxPos && (this.maxPos = _c11), _f7 > this.maxPos && (this.maxPos = _f7), b.push(_t168, _l20, _h11);}}var _a24 = oa(b, A, 3);if (b.length && !_a24.length) {var _e193 = [];for (var _t170 = 0; _t170 < b.length; _t170 += 3) _e193[_t170] = b[_t170], _e193[_t170 + 1] = b[_t170 + 2], _e193[_t170 + 2] = b[_t170 + 1];if (_a24 = oa(_e193, A, 3), !_a24.length) {for (var _t171 = 0; _t171 < b.length; _t171 += 3) _e193[_t171] = b[_t171 + 1], _e193[_t171 + 1] = b[_t171 + 2], _e193[_t171 + 2] = b[_t171];_a24 = oa(_e193, A, 3);}}for (var _e194 = 0; _e194 < _a24.length; _e194 += 3) this.addElements(_o47 + _a24[_e194], _o47 + _a24[_e194 + 1], _o47 + _a24[_e194 + 2]);}} }, { key: \"ensureDataCapacity\", value: function ensureDataCapacity(e) {_superPropGet(_class7, \"ensureDataCapacity\", this, 3)([1, e]);} }]);}(gs), e.RoundTubePack = Va, e.SYMBOLS_NEED_REBUILD_IN_VECTOR = fl, e.SYMBOLS_NEED_REBUILD_IN_VT = ul, e.SquareTubePack = function (_Va) {function _class8() {_classCallCheck(this, _class8);return _callSuper(this, _class8, arguments);}_inherits(_class8, _Va);return _createClass(_class8, [{ key: \"addHalfVertex\", value: function addHalfVertex(e, t, n, i, r, s, o, a) {var l = e.x,h = e.y,c = e.z,u = 1 * this.scaledDistance,_o$dir2 = o.dir,f = _o$dir2.x,d = _o$dir2.y,p = _o$dir2.z,g = Ja(this.feaLineWidth, this.feaLineHeight, f, d, p, t, n, r);this.prevVertex && this.fillTubeElements(r), this.fillData(this.data, l, h, c || 0, g, r, u, a);} }, { key: \"ensureDataCapacity\", value: function ensureDataCapacity(e, t, n, i) {return _superPropGet(_class8, \"ensureDataCapacity\", this, 3)([e, t, n, 2 * i]);} }]);}(Va), e.StyleUtil = ft, e.StyledPoint = Js, e.StyledVector = dt, e.TEXT_MAX_ANGLE = 80, e.TextUtil = Is, e.VectorPack = gs, t().maptalks_vt_packers = e;}L({});function H() {return function () {if (\"undefined\" != typeof globalThis) return globalThis;if (\"undefined\" != typeof self) return self;if (\"undefined\" != typeof window) return window;if (\"undefined\" != typeof global) return global;throw new Error(\"unable to locate global object\");}().maptalks_vt_packers;}var N = 0;function z() {return N++;}var V = \"function\" == typeof Object.assign;function U(e) {for (var _len5 = arguments.length, t = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {t[_key5 - 1] = arguments[_key5];}if (V) return Object.assign.apply(Object, [e].concat(t)), e;for (var _n120 = 0; _n120 < t.length; _n120++) {var _i92 = t[_n120];for (var _t172 in _i92) e[_t172] = _i92[_t172];}return e;}function B(e) {return !X(e) && (\"string\" == typeof e || null !== e.constructor && e.constructor === String);}function G(e) {return \"number\" == typeof e && !isNaN(e);}function j(e) {return !X(e) && (\"function\" == typeof e || null !== e.constructor && e.constructor === Function);}function W(e) {return !Array.isArray(e) && \"object\" == _typeof(e) && !!e;}function X(e) {return null == e;}function Y(e) {for (var _t173 = 1; _t173 < arguments.length; _t173++) {var _n121 = arguments[_t173];if (_n121) for (var _t174 = 0, _i93 = _n121.length; _t174 < _i93; _t174++) e.push(_n121[_t174]);}return e.length;}function Z(e) {return (0, _functionType.isFunctionDefinition)(e) && e.property;}function q(e, t) {return Object.prototype.hasOwnProperty.call(e, t);}function $(e, t) {return t.altitudeToPoint(100, e) / 100 / 100;}function J(e, t, n) {for (var _i94 = 0; _i94 < e.length; _i94++) {var _r76 = e[_i94],_s62 = U({}, _r76),_o49 = _r76.renderPlugin,_a25 = U({}, _o49);_a25.sceneConfig && !Object.keys(_a25.sceneConfig).length && delete _a25.sceneConfig;var _l21 = -1;for (var _e195 = n.length - 1; _e195 >= 0; _e195--) if ((0, _fastDeepEqual.default)(_a25, n[_e195])) {_l21 = _e195;break;}_l21 < 0 && (_l21 = n.length, n.push(_a25)), _s62.renderPlugin = _l21, t.push(_s62);}}var K = \"function\" == typeof fetch && \"function\" == typeof AbortController,Q = { jsonp: function jsonp(e, t) {var n = \"_maptalks_jsonp_\" + z();e.match(/\\?/) ? e += \"&callback=\" + n : e += \"?callback=\" + n;var i = document.createElement(\"script\");return i.type = \"text/javascript\", i.src = e, window[n] = function (e) {t(null, e), document.getElementsByTagName(\"head\")[0].removeChild(i), i = null, delete window[n];}, document.getElementsByTagName(\"head\")[0].appendChild(i), this;}, get: function get(e, t, n) {var _this13 = this;if (j(t)) {var _e196 = n;n = t, t = _e196;}(t = t || {}).method && (t.method = t.method.toUpperCase());var i = \"POST\" === t.method;if (K) {var _i95 = new AbortController(),_r77 = t;_r77.signal = _i95.signal, _r77.referrerPolicy = _r77.referrerPolicy || \"origin\", _r77.method = _r77.method || \"GET\";var _s63 = new Request(e, _r77);return t.returnJSON && _s63.headers.set(\"Accept\", \"application/json\"), fetch(_s63).then(function (i) {var r = _this13._parseResponse(i, t.returnJSON, t.responseType);r.message ? (r.url = e, n(r)) : r.then(function (e) {\"arraybuffer\" === t.responseType ? n(null, { data: e, cacheControl: i.headers.get(\"Cache-Control\"), expires: i.headers.get(\"Expires\"), contentType: i.headers.get(\"Content-Type\") }) : n(null, e);}).catch(function (t) {t.code && t.code === DOMException.ABORT_ERR || (console.error(\"Fetch error:\", e, t), n(t));});}).catch(function (t) {t.code && t.code === DOMException.ABORT_ERR || (console.error(\"Fetch error:\", e, t), n(t));}), _i95;}{var _r78 = Q._getClient(n);if (_r78.open(t.method || \"GET\", e, !0), t) {for (var _e197 in t.headers) _r78.setRequestHeader(_e197, t.headers[_e197]);_r78.withCredentials = \"include\" === t.credentials, t.responseType && (_r78.responseType = t.responseType);}return _r78.send(i ? t.body : null), _r78;}}, _parseResponse: function _parseResponse(e, t, n) {return 200 !== e.status ? { status: e.status, statusText: e.statusText, message: \"incorrect http request with status code(\".concat(e.status, \"): \").concat(e.statusText) } : \"arraybuffer\" === n ? e.arrayBuffer() : t ? e.json() : e.text();}, _wrapCallback: function _wrapCallback(e, t) {return function () {if (4 === e.readyState) if (200 === e.status) {if (\"arraybuffer\" === e.responseType) {0 === e.response.byteLength ? t({ status: 200, statusText: e.statusText, message: \"http status 200 returned without content.\" }) : t(null, { data: e.response, cacheControl: e.getResponseHeader(\"Cache-Control\"), expires: e.getResponseHeader(\"Expires\"), contentType: e.getResponseHeader(\"Content-Type\") });} else t(null, e.responseText);} else t({ status: e.status, statusText: e.statusText, message: \"incorrect http request with status code(\".concat(e.status, \"): \").concat(e.statusText) });};}, _getClient: function _getClient(e) {var t;try {t = new XMLHttpRequest();} catch (e) {try {t = new ActiveXObject(\"Msxml2.XMLHTTP\");} catch (e) {try {t = new ActiveXObject(\"Microsoft.XMLHTTP\");} catch (e) {}}}return t.onreadystatechange = Q._wrapCallback(t, e), t;}, getArrayBuffer: function getArrayBuffer(e, t, n) {if (j(t)) {var _e198 = n;n = t, t = _e198;}return t || (t = {}), t.responseType = \"arraybuffer\", Q.get(e, t, n);}, getJSON: function getJSON(e, t, n) {if (j(t)) {var _e199 = n;n = t, t = _e199;}var i = function i(e, t) {var i = \"string\" == typeof t ? JSON.parse(t) : t || null;n(e, i);};return t && t.jsonp ? Q.jsonp(e, i) : ((t = t || {}).returnJSON = !0, Q.get(e, t, i));} };var ee = function () {function ee(e) {_classCallCheck(this, ee);this.max = e, this.reset();}return _createClass(ee, [{ key: \"reset\", value: function reset() {return this.data = {}, this.order = [], this;} }, { key: \"clear\", value: function clear() {this.reset();} }, { key: \"add\", value: function add(e, t) {return this.has(e) ? (this.order.splice(this.order.indexOf(e), 1), this.data[e] = t, this.order.push(e)) : (this.data[e] = t, this.order.push(e), this.order.length > this.max && this.getAndRemove(this.order[0])), this;} }, { key: \"has\", value: function has(e) {return e in this.data;} }, { key: \"keys\", value: function keys() {return this.order;} }, { key: \"getAndRemove\", value: function getAndRemove(e) {if (!this.has(e)) return null;var t = this.data[e];return delete this.data[e], this.order.splice(this.order.indexOf(e), 1), t;} }, { key: \"get\", value: function get(e) {if (!this.has(e)) return null;return this.data[e];} }, { key: \"remove\", value: function remove(e) {return this.has(e) ? (delete this.data[e], this.order.splice(this.order.indexOf(e), 1), this) : this;} }, { key: \"setMaxSize\", value: function setMaxSize(e) {for (this.max = e; this.order.length > this.max;) this.getAndRemove(this.order[0]);return this;} }]);}();var te = function () {function te(e) {_classCallCheck(this, te);this.options = e || {}, this._requesting = {}, this._cache = new ee(256, function () {});var t = document.createElement(\"canvas\");this.ctx = t.getContext(\"2d\", { willReadFrequently: !0 });}return _createClass(te, [{ key: \"getIcons\", value: function getIcons(e, i) {if (!e || !Object.keys(e).length) return void i(null, { icons: null });var r = Object.keys(e),s = {},o = [];var a = 0,l = 0;var h = this;function c(e, t) {s[e] = h._getCache(e, t), s[e] && \"error\" !== s[e] ? o.push(s[e].data.data.buffer) : delete s[e], l++, l === a && i(null, { icons: s, buffers: o });}function u(e) {var t = h._requesting[e.url];for (var _n122 = 0; _n122 < t.length; _n122++) t[_n122].call(e, e.url, e.size);delete h._requesting[e.url];}function f() {var e = h.ctx;var t, n;try {t = this.width, n = this.height, this.size[0] = t, this.size[1] = n, h._ensureMaxSize(null, this.size), t = this.size[0], n = this.size[1];var _i96 = e.canvas;_i96.width = t, _i96.height = n, e.imageSmoothingEnabled = !1, e.drawImage(this, 0, 0, t, n);var _r79 = e.getImageData(0, 0, _i96.width, _i96.height).data;h._addCache(this.url, _r79, _i96.width, _i96.height);} catch (e) {console.warn(e);}u(this);}function d(e) {console.warn(\"failed loading icon(\".concat(this.index, \") at \\\"\").concat(this.url, \"\\\"\")), console.warn(e), h.options.iconErrorUrl ? this.src = h.options.iconErrorUrl : (h._addCache(this.url), u(this));}var p = this.options.urlModifier;var g,m = !1;for (var _i97 = 0; _i97 < r.length; _i97++) {var _l22 = r[_i97],_h12 = e[_l22];this._ensureMaxSize(_l22, _h12);var _u6 = this._getCache(_l22, _h12);if (_u6 && \"error\" !== _u6) {s[_l22] = this._getCache(_l22, _h12);continue;}if (\"error\" === _u6) continue;var _y4 = void 0,_x5 = _l22;if (0 === _l22.indexOf(\"vector://\") && (_y4 = JSON.parse(_l22.substring(9)), \"path\" === _y4.markerType && (_x5 = _maptalks.Util.getMarkerPathBase64(_y4, _y4.markerWidth, _y4.markerHeight))), 0 === _l22.indexOf(\"vector://\") && \"path\" !== _y4.markerType) {g = g || new _maptalks.Marker([0, 0]);var _y5 = _y4,_e200 = _y5.markerFill,_t175 = _y5.markerLineColor;_e200 && Array.isArray(_e200) && (_y4.markerFill = ne(_e200)), _t175 && Array.isArray(_t175) && (_y4.markerLineColor = ne(_t175)), delete _y4.markerHorizontalAlignment, delete _y4.markerVerticalAlignment, delete _y4.markerDx, delete _y4.markerDy, delete _y4.markerPlacement, delete _y4.markerFile, _y4.markerWidth = _h12[0], _y4.markerHeight = _h12[1], g.setSymbol(_y4);var _i98 = g[\"_getSprite\".trim()]();if (_i98) {var _e201 = _i98.canvas,_t176 = _e201.width,_n123 = _e201.height,_r80 = _e201.getContext(\"2d\").getImageData(0, 0, _t176, _n123).data;s[_l22] = { data: { data: new Uint8ClampedArray(_r80), width: _t176, height: _n123 }, url: _l22 }, o.push(s[_l22].data.data.buffer), this._addCache(_l22, _r80, _t176, _n123);}} else {if (this._requesting[_l22]) {m = !0, a++, this._requesting[_l22].push(c);continue;}this._requesting[_l22] = [], this._requesting[_l22].push(c);var _e202 = new Image();_e202.index = _i97, _e202.size = _h12, _e202.onload = f, _e202.onerror = d, _e202.onabort = d, _e202.url = _l22, _e202.crossOrigin = \"Anonymous\", m = !0, a++, _e202.src = p && p(_x5) || _x5;}}m || i(null, { icons: s, buffers: o });} }, { key: \"_hasCache\", value: function _hasCache(e, t, n) {var i = this._cache.get(e);return i && \"error\" !== i && i.data.width >= t && i.data.height >= n;} }, { key: \"_addCache\", value: function _addCache(e, t, n, i) {this._hasCache(e, n, i) || (t ? this._cache.add(e, { data: { data: t, width: n, height: i }, url: e }) : this._cache.add(e, \"error\"));} }, { key: \"_getCache\", value: function _getCache(e, t) {if (!this._hasCache(e, t[0], t[1])) return null;var n = this._cache.get(e);return n ? \"error\" === n ? n : { data: { data: new Uint8ClampedArray(n.data.data), width: n.data.width, height: n.data.height }, url: n.url } : null;} }, { key: \"_ensureMaxSize\", value: function _ensureMaxSize(e, t) {if (!t[0] || !t[1]) return;var n = this.options.maxSize || 2048;var _t177 = _slicedToArray(t, 2),i = _t177[0],r = _t177[1];var s = i / r;if (e) {var _t178 = this._cache.get(e);if (_t178 && \"error\" !== _t178) {var _t178$data = _t178.data,_e203 = _t178$data.width,_n124 = _t178$data.height;_e203 > i && (i = _e203), _n124 > r && (r = _n124);}}i > n && (r = n / s, i = n), r > n && (i = n * s, r = n), t[0] = Math.floor(i), t[1] = Math.floor(r);} }]);}();function ne(e) {return 3 === e.length && e.push(1), e.reduce(function (e, t, n) {return e += n < 3 ? 255 * t + \",\" : t + \")\";}, \"rgba(\");}var _H = H(),ie = _H.GlyphRequestor,re = [\"GeoJSONVectorTileLayer\"];var se = function (_e$worker$Actor) {function se(e, t) {var _this14;_classCallCheck(this, se);_this14 = _callSuper(this, se, [e]);var n = t.getMap().id;_this14._layer = t, _this14._mapId = n, _this14._workerLayerId = \"vt_\" + z();var i = t.getJSONType();_this14._isDedicated = re.indexOf(i) >= 0, _this14._dedicatedVTWorkers = {}, _this14._iconRequestor = new te({ iconErrorUrl: t.options.iconErrorUrl, maxSize: t.options.maxIconSize, urlModifier: function urlModifier(e) {var n = t.getURLModifier();return n && n(e) || e;} });var r = !t.getRenderer().isEnableWorkAround(\"win-intel-gpu-crash\");_this14._glyphRequestor = new ie(function (e) {t.getMap().getRenderer().callInNextFrame(e);}, t.options.glyphSdfLimitPerFrame, r);return _this14;}_inherits(se, _e$worker$Actor);return _createClass(se, [{ key: \"initialize\", value: function initialize(e) {e(null);} }, { key: \"addLayer\", value: function addLayer(e) {var t = this._layer,n = t.getWorkerOptions() || {},i = this._workerLayerId,r = t.getJSONType(),s = { mapId: this._mapId, layerId: i, command: \"addLayer\", params: { type: r, options: JSON.parse(JSON.stringify(n)) } };this._isDedicated ? (void 0 === this._dedicatedVTWorkers[i] && (this._dedicatedVTWorkers[i] = this.getDedicatedWorker()), this.send(s, null, e, this._dedicatedVTWorkers[i])) : this.broadcast(s, null, e);} }, { key: \"abortTile\", value: function abortTile(e, t) {var n = this._workerLayerId,i = { mapId: this._mapId, layerId: n, command: \"abortTile\", params: { url: e } };this._isDedicated ? (void 0 === this._dedicatedVTWorkers[n] && (this._dedicatedVTWorkers[n] = this.getDedicatedWorker()), this.send(i, null, t, this._dedicatedVTWorkers[n])) : this.broadcast(i, null, t);} }, { key: \"removeLayer\", value: function removeLayer(e) {var t = this._workerLayerId,n = { mapId: this._mapId, layerId: t, command: \"removeLayer\" };this._isDedicated ? (void 0 !== this._dedicatedVTWorkers[t] && this.send(n, null, e, this._dedicatedVTWorkers[t]), delete this._dedicatedVTWorkers[t]) : this.broadcast(n, null, e);} }, { key: \"updateStyle\", value: function updateStyle(e, t) {var n = this._workerLayerId,i = { mapId: this._mapId, layerId: n, command: \"updateStyle\", params: JSON.parse(JSON.stringify(e)) };this._isDedicated ? void 0 !== this._dedicatedVTWorkers[n] && this.send(i, null, t, this._dedicatedVTWorkers[n]) : this.broadcast(i, null, t);} }, { key: \"updateOptions\", value: function updateOptions(e, t) {var n = this._workerLayerId,i = { mapId: this._mapId, layerId: n, command: \"updateOptions\", params: JSON.parse(JSON.stringify(e)) };this._isDedicated ? void 0 !== this._dedicatedVTWorkers[n] && this.send(i, null, t, this._dedicatedVTWorkers[n]) : this.broadcast(i, null, t);} }, { key: \"loadTile\", value: function loadTile(e, t) {var n = U({}, e);n.tileInfo = function (e) {var t = {};for (var _n125 in e) void 0 !== e[_n125] && null !== e[_n125] && (e[_n125].toJSON ? t[_n125] = e[_n125].toJSON() : t[_n125] = e[_n125]);return t;}(e.tileInfo);var i = this._workerLayerId,r = { mapId: this._mapId, layerId: i, command: \"loadTile\", params: n },_e$tileInfo = e.tileInfo,s = _e$tileInfo.x,o = _e$tileInfo.y,a = (s + o) % this.workers.length,l = [],h = n.tileArrayBuffer;h && h instanceof ArrayBuffer && l.push(h), this.send(r, l, t, void 0 === this._dedicatedVTWorkers[i] ? this.workers[a].id : this._dedicatedVTWorkers[i]);} }, { key: \"remove\", value: function remove() {_superPropGet(se, \"remove\", this, 3)([]), this._dedicatedVTWorkers = {};} }, { key: \"fetchIconGlyphs\", value: function fetchIconGlyphs(_ref116, n) {var _this15 = this;var e = _ref116.icons,t = _ref116.glyphs;this._glyphRequestor.getGlyphs(t, function (t, i) {if (t) throw t;var r = i.buffers || [];_this15._iconRequestor.getIcons(e, function (e, t) {if (e) throw e;t.buffers && t.buffers.length && r.push.apply(r, _toConsumableArray(t.buffers)), n(null, { icons: t.icons, glyphs: i.glyphs }, r);});});} }, { key: \"setData\", value: function setData(e, t) {var n = this._workerLayerId,i = { mapId: this._mapId, layerId: n, command: \"setData\", params: { data: e } };this.send(i, null, t, this._dedicatedVTWorkers[n]);} }, { key: \"_getTileKey\", value: function _getTileKey(e) {return e.id;} }]);}(e.worker.Actor);var oe = {},ae = { collision: !0, fading: !1, fadingDuration: 224, fadeInDelay: 600, fadeOutDelay: 100, uniquePlacement: !1, depthFunc: \"always\" };var le = function () {function le(e, t, n) {_classCallCheck(this, le);this._regl = e, this._map = t, this._color = n || [0, 1, 0];}return _createClass(le, [{ key: \"draw\", value: function draw(e, t, n, i, r) {if (this._command || this._init(), !this._data) {this._data = this._regl.buffer(he(i));var _e204 = i / n;this._textData = this._regl.buffer(ce(i, _e204));}if (i !== this._extent) {var _e205 = i / n;this._data(he(i)), this._textData(ce(i, _e205));}this._extent = i;var s = this._debugInfoCanvas;if (!s) {var _e206 = this._map.getDevicePixelRatio() > 1 ? 2 : 1;s = this._debugInfoCanvas = document.createElement(\"canvas\"), s.width = 512 * _e206, s.height = 64 * _e206;var _t179 = s.getContext(\"2d\");_t179.font = \"36px monospace\", _t179.scale(_e206, _e206), this._texture = this._regl.texture({ width: s.width, height: s.height, data: s });}var o = s.getContext(\"2d\");o.clearRect(0, 0, s.width, s.height), o.fillStyle = \"rgba(\".concat(this._color.map(function (e) {return 255 * e;}).join(), \")\"), o.fillText(e, 20, 36), this._texture({ width: s.width, height: s.height, data: s }), this._command({ transform: t, data: this._data, texData: this._texCoordData, debugLine: 1, primitive: \"lines\", framebuffer: r || null, image: this._texture, count: 8 }), this._command({ transform: t, data: this._textData, texData: this._texCoordData, debugLine: 0, primitive: \"triangle strip\", framebuffer: r || null, image: this._texture, count: 4 });} }, { key: \"delete\", value: function _delete() {this._texture && (this._texture.destroy(), delete this._texture), this._texCoordData && (this._texCoordData.destroy(), delete this._texCoordData), this._data && (this._data.destroy(), this._textData.destroy(), delete this._data, delete this._textData), this._command && (this._command.destroy(), delete this._command);} }, { key: \"_init\", value: function _init() {var _this16 = this;this._texCoordData = this._regl.buffer(new Uint8Array([0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1])), this._command = this._regl({ vert: \"\\n attribute vec2 aPosition;\\n attribute vec2 aTexCoord;\\n uniform mat4 transform;\\n\\n varying vec2 vTexCoord;\\n void main()\\n {\\n gl_Position = transform * vec4(aPosition, 0.0, 1.0);\\n vTexCoord = aTexCoord;\\n }\\n \", frag: \"\\n precision mediump float;\\n uniform sampler2D uImage;\\n uniform vec3 uColor;\\n uniform float uOpacity;\\n uniform float uDebugLine;\\n\\n varying vec2 vTexCoord;\\n\\n void main()\\n {\\n if (uDebugLine == 1.) {\\n gl_FragColor = vec4(uColor, 1.0) * uOpacity;\\n } else {\\n gl_FragColor = texture2D(uImage, vTexCoord) * uOpacity;\\n }\\n gl_FragColor *= gl_FragColor.a;\\n }\\n \", attributes: { aPosition: this._regl.prop(\"data\"), aTexCoord: this._regl.prop(\"texData\") }, uniforms: { transform: this._regl.prop(\"transform\"), uColor: this._color, uOpacity: 1, uDebugLine: this._regl.prop(\"debugLine\"), uImage: this._regl.prop(\"image\") }, count: this._regl.prop(\"count\"), primitive: this._regl.prop(\"primitive\"), depth: { enable: !1, mask: !1 }, blend: { enable: !0, func: { src: \"one\", dst: \"one minus src alpha\" }, equation: \"add\" }, stencil: { enable: !1 }, viewport: { x: 0, y: 0, width: function width() {return _this16._map.getRenderer().canvas.width;}, height: function height() {return _this16._map.getRenderer().canvas.height;} }, framebuffer: this._regl.prop(\"framebuffer\") });} }]);}();function he(e) {return new Uint16Array([0, 0, 0, e, 0, e, e, e, e, e, e, 0, e, 0, 0, 0]);}function ce(e, t) {return new Uint16Array([0, e - 64 * t, 0, e, 512 * t, e - 64 * t, 512 * t, e]);}var ue = new Uint8Array([0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1]),fe = [];var de = function () {function de(e, t, n) {_classCallCheck(this, de);this._regl = e;(this._geometry = new _gl.reshader.Geometry({ aPosition: ue }, null, ue.length / 2, { positionSize: 2 })).generateBuffers(e), this._scene = new _gl.reshader.Scene(), this._meshes = [], this._counter = 0, this._canvas = t, this._map = n, this._init(e);}return _createClass(de, [{ key: \"start\", value: function start() {this._counter = 0, this._scene.clear();} }, { key: \"add\", value: function add(e, t, n) {var i = this._getMesh(n);i.setUniform(\"ref\", e), _gl.vec3.set(fe, t, t, 1);var r = i.localTransform;_gl.mat4.fromScaling(r, fe), _gl.mat4.mul(r, n, r), i.setLocalTransform(r), this._scene.addMesh(i);} }, { key: \"render\", value: function render(e) {this._renderer.render(this._shader, { projViewMatrix: this._map.projViewMatrix }, this._scene, e);} }, { key: \"_getMesh\", value: function _getMesh() {var e = this._counter++;return this._meshes[e] || (this._meshes[e] = new _gl.reshader.Mesh(this._geometry)), this._meshes[e];} }, { key: \"_init\", value: function _init(e) {var t = this._canvas,n = { viewport: { x: 0, y: 0, width: function width() {return t.width;}, height: function height() {return t.height;} }, stencil: { enable: !0, mask: 255, func: { cmp: \"always\", ref: function ref(e, t) {return t.ref;}, mask: 255 }, op: { fail: \"replace\", zfail: \"replace\", zpass: \"replace\" } }, depth: { enable: !0, func: \"always\", mask: !1 }, colorMask: [!1, !1, !1, !1] };this._shader = new _gl.reshader.MeshShader({ vert: \"\\n#define SHADER_NAME TILE_STENCIL_VERT\\nattribute vec2 aPosition;\\nuniform mat4 projViewModelMatrix;\\n\\nvoid main()\\n{\\n gl_Position = projViewModelMatrix * vec4(aPosition, 0.0, 1.0);\\n}\\n\", frag: \"\\n#define SHADER_NAME TILE_STENCIL_FRAG\\nvoid main()\\n{\\n gl_FragColor = vec4(1.0, 0.0, 0.0, 0.1);\\n}\\n\", uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }], extraCommandProps: n }), this._renderer = new _gl.reshader.Renderer(e);} }, { key: \"remove\", value: function remove() {this._geometry.dispose();for (var _e207 = 0; _e207 < this._meshes.length; _e207++) this._meshes[_e207].dispose();this._meshes.length = 0, this._shader.dispose();} }]);}();var pe = \"__fea_idx\",ge = -999999,me = new Float32Array([-1e12])[0],ye = \"maptalks_ombb\",xe = (pe + \"\").trim();function _e(t, n, i, r, s, o) {var a = {};if (function (e) {if (!e) return !1;for (var _t180 in e) if (void 0 !== e[_t180] && null !== e[_t180]) return !0;return !1;}(t)) {for (var _l23 = 0, _h13 = (n || t).length; _l23 < _h13; _l23++) {var _h14 = n ? t[n[_l23]] : t[_l23];\"id\" === s.options.features && s.getFeature && (_h14 = s.getFeature(_h14), _h14.layer = i), s instanceof e.TileLayer && (_h14 = we(_h14, o));a[n ? n[_l23] : _h14[xe]] = { feature: _h14, symbol: r };}}return a;}var ve = \"__original_properties\",be = \"__external_properties\",Ae = { get: function get(e, t) {return t in e ? e[t] : e[ve][t] || e[be] && e[be][t];}, has: function has(e, t) {return t in e || t in e[ve] || e[be] && t in e[be];} },Te = {};function we(e, t) {var n = e.properties;if (n && n[ve]) return e;t && (e = U({}, e)), e.customProps = e.customProps || {};var i = e.customProps;return i.$layer = e.layer, i.$type = e.type, i[ve] = n || Te, e.properties = new Proxy(i, Ae), e;}function Se(e) {for (var _t181 = 1; _t181 < arguments.length; _t181++) {var _n126 = arguments[_t181];for (var _t182 in _n126) e[_t182] = _n126[_t182];}return e;}function Me(e, t, n) {return Math.min(n, Math.max(t, e));}function Pe(e, t, n) {if (e === n || e === t) return e;var i = n - t;return ((e - t) % i + i) % i + t;}function Ie(e) {return null == e;}function Ce(e) {var t = JSON.parse(JSON.stringify(e));if (Array.isArray(e)) for (var _n127 = 0; _n127 < e.length; _n127++) {if (!t[_n127]) continue;var _i99 = t[_n127].symbol;if (!_i99) continue;var _r81 = e[_n127].symbol;for (var _e208 in _r81) _i99[_e208] || (_i99[_e208] = _r81[_e208]);} else if (e) {if (e.style) {var _n128 = Ce(e.style);return t.style = _n128, t;}if (e.symbol) {var _n129 = Ce(e.symbol);return t.symbol = _n129, t;}for (var _n130 in e) t[_n130] || (t[_n130] = e[_n130]);}return t;}function ke(e, t, n, i, r, s) {t in e || Object.defineProperty(e, t, { enumerable: !0, get: function get() {var e = Ie(n[i]) || (0, _functionType.isFunctionDefinition)(n[i]) ? r : n[i];return s ? s(e) : e;} });}var Fe = [];function Oe(e) {for (var _t183 = 0; _t183 < e.length; _t183++) Fe[_t183] = e[_t183], Fe[_t183] *= 255;return 3 === e.length && (Fe[3] = 255), Fe;}function Re(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;return Ee.bind(this, e, t);}function Ee(e, t, n) {if (Array.isArray(n)) return 3 === n.length && 4 === t && n.push(1), n;if (e && e[n]) return e[n];if (void 0 !== n.r && void 0 !== n.g && void 0 !== n.b && void 0 !== n.a) {return [n.r, n.g, n.b, n.a];}var i = (0, _color.default)(n).unitArray();return 3 === i.length && 4 === t && i.push(1), e && (e[n] = i), i;}function De(e, t, n, i) {if (e.fill) e.fill(t, n, i);else for (var _r82 = n; _r82 < i; _r82++) e[_r82] = t;}function Le(e) {return \"number\" == typeof e && !isNaN(e);}function He(e) {return e && (e.markerFile || e.markerType) && void 0 !== e.textName;}function Ne(e, t) {return Object.prototype.hasOwnProperty.call(e, t);}function ze(e, t) {if (t) {var _t184 = e[e.length - 1];var _n131 = [_t184];for (var _i100 = e.length - 2; _i100 >= 0; _i100--) e[_i100] !== _t184 && (_n131.push(e[_i100]), _t184 = e[_i100]);return _n131;}{var _t185 = e[e[0]];var _n132 = [_t185];for (var _i101 = 1; _i101 < e.length; _i101++) e[_i101] !== _t185 && (_n132.push(e[_i101]), _t185 = e[_i101]);return _n132;}}var Ve = new e.Coordinate(0, 0);function Ue(e, t, n, i, r) {var s = e.distanceToPointAtRes(t, t, i, n, Ve);return r ? s.y : s.x;}var _H2 = H(),Be = _H2.FilterUtil,Ge = [],je = [0, 0, 0, 0],We = new e.Point(0, 0),Xe = [],Ye = { color: je, depth: 1, stencil: 0 },Ze = function Ze(e) {return e.isTerrainSkin();},qe = function qe(e) {return e.isTerrainVector();};var $e = exports.VectorTileLayerRenderer = function (_e$renderer$TileLayer) {function $e(e) {var _this17;_classCallCheck(this, $e);_this17 = _callSuper(this, $e, [e]), _this17._workerCacheIndex = 0, _this17.ready = !1, _this17._styleCounter = 1, _this17._requestingMVT = {}, _this17._plugins = {}, _this17._featurePlugins = {};return _this17;}_inherits($e, _e$renderer$TileLayer);return _createClass($e, [{ key: \"supportRenderMode\", value: function supportRenderMode() {return !0;} }, { key: \"getTileLevelValue\", value: function getTileLevelValue(e, t) {if (this.isBackTile(e.id)) {var _n133 = e.z,_i102 = 5;return _n133 - t >= 0 ? t + _i102 - _n133 : _i102 + (t - _n133);}return 0;} }, { key: \"getWorkerConnection\", value: function getWorkerConnection() {return this._workerConn;} }, { key: \"getStyleCounter\", value: function getStyleCounter() {return this._styleCounter;} }, { key: \"setStyle\", value: function setStyle() {var _this18 = this;if (this._groundPainter && this._groundPainter.update(), this._workerConn) {this._styleCounter++, this._preservePrevTiles();var _e209 = this.layer._getComputedStyle();_e209.styleCounter = this._styleCounter, this._workersyncing = !0, this._workerConn.updateStyle(_e209, function (e) {if (_this18._workersyncing = !1, e) throw new Error(e);_this18._needRetire = !0, _this18._initPlugins(), _this18.setToRedraw(), _this18.layer.fire(\"refreshstyle\");});} else this._initPlugins();} }, { key: \"_preservePrevTiles\", value: function _preservePrevTiles() {if (this._prevTilesInView) for (var _e210 in this._prevTilesInView) {var _t186 = this._prevTilesInView[_e210];_t186 && this.deleteTile(_t186);}this._prevTilesInView = this.tilesInView;var e = this.tileCache;for (var _t187 in this._prevTilesInView) {var _n134 = this._prevTilesInView[_t187];_n134 && _n134.info && e.getAndRemove(_n134.info.id);}e.reset(), this.tilesInView = {}, this.tilesLoading = {}, this._requestingMVT = {}, this._parentTiles = [], this._childTiles = [], this._tileZoom = void 0;} }, { key: \"updateOptions\", value: function updateOptions(e) {var _this19 = this;this._workerConn && this._workerConn.updateOptions(this.layer.getWorkerOptions(), function (t) {if (t) throw new Error(t);e && (e.features || e.pickingGeometry || e.altitudeProperty) && (_this19.clear(), _this19._clearPlugin(), _this19._initPlugins()), _this19.setToRedraw();});} }, { key: \"updateSceneConfig\", value: function updateSceneConfig(e, t, n) {var i = 0 === e ? this._getStylePlugins() : this._getFeaturePlugins();if (!i || !i[t]) return;this._needRetire = !0;var r = this.layer._getComputedStyle(),s = this.layer._getTargetStyle(e, r);i[t].config = s[t].renderPlugin, i[t].updateSceneConfig({ sceneConfig: n }), this.setToRedraw();} }, { key: \"updateDataConfig\", value: function updateDataConfig(e, t, n, i) {var r = 0 === e ? this._getStylePlugins() : this._getFeaturePlugins();r && r[t] && (this._needRetire = !0, r[t].updateDataConfig(n, i) ? this.setStyle() : this.setToRedraw());} }, { key: \"updateSymbol\", value: function updateSymbol(e, t, n) {var i = 0 === e ? this._getStylePlugins() : this._getFeaturePlugins();if (!i || !i[t]) return !1;var r = this.layer._getComputedStyle(),s = this.layer._getTargetStyle(e, r),o = i[t];o.style = s[t];var a = o.updateSymbol(n, s[t].symbol);return !a && et(n) && this.setStyle(), this.setToRedraw(), a;} }, { key: \"testIfNeedRedraw\", value: function testIfNeedRedraw() {var e = this._getFramePlugins();for (var _t188 = 0; _t188 < e.length; _t188++) if (e[_t188] && e[_t188].needToRedraw()) return !0;return _superPropGet($e, \"testIfNeedRedraw\", this, 3)([]);} }, { key: \"needRetireFrames\", value: function needRetireFrames() {if (this._needRetire) return !0;var e = this._getFramePlugins();for (var _t189 = 0; _t189 < e.length; _t189++) if (e[_t189] && e[_t189].needToRetireFrames()) return !0;return !1;} }, { key: \"isAnimating\", value: function isAnimating() {var e = this.getMap().getRenderer(),t = e.getFrameTimestamp && e.getFrameTimestamp() || e._frameTimestamp;if (this._highlightUpdated && (this._highlightFrametime = t, delete this._highlightUpdated), this._highlightFrametime === t) return !0;var n = this._getFramePlugins();for (var _e211 = 0; _e211 < n.length; _e211++) if (n[_e211] && n[_e211].isAnimating()) return !0;return !1;} }, { key: \"needToRefreshTerrainTileOnZooming\", value: function needToRefreshTerrainTileOnZooming() {var e = this._getFramePlugins();for (var _t190 = 0; _t190 < e.length; _t190++) if (e[_t190] && e[_t190].needToRefreshTerrainTileOnZooming()) return !0;return !1;} }, { key: \"_isInGroupGLLayer\", value: function _isInGroupGLLayer() {return !!(this.canvas && this.canvas.gl && this.canvas.gl.wrap);} }, { key: \"createContext\", value: function createContext() {var e = this.canvas.gl && this.canvas.gl.wrap;if (e) this.gl = this.canvas.gl.wrap(), this.regl = this.canvas.gl.regl;else {var _this$_createREGLCont = this._createREGLContext(this.canvas),_e212 = _this$_createREGLCont.gl,_t191 = _this$_createREGLCont.regl,_n135 = _this$_createREGLCont.attributes;this.gl = _e212, this.regl = _t191, this.glOptions = _n135;}if (e && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height), this._debugPainter = new le(this.regl, this.getMap()), this._prepareWorker(), this._groundPainter = new _gl.GroundPainter(this.regl, this.layer), !this.consumeTile) {var _e213 = this.getMap().VERSION;throw new Error(\"Incompatible version of maptalks: \".concat(_e213, \", upgrade maptalks >= v1.0.0-rc.14\"));}} }, { key: \"_createREGLContext\", value: function _createREGLContext(e) {var t = this.layer,n = t.options.glOptions || { alpha: !0, depth: !0, antialias: this.layer.options.antialias };n.preserveDrawingBuffer = !0, n.stencil = !0;var i = this._createGLContext(e, n);return { gl: i, attributes: n, regl: (0, _gl.createREGL)({ gl: i, attributes: n, extensions: [\"ANGLE_instanced_arrays\", \"OES_element_index_uint\", \"OES_standard_derivatives\"], optionalExtensions: t.options.glExtensions || [\"OES_vertex_array_object\", \"OES_texture_half_float\", \"OES_texture_half_float_linear\", \"OES_texture_float\", \"OES_texture_float_linear\", \"WEBGL_draw_buffers\", \"EXT_shader_texture_lod\", \"EXT_frag_depth\"] }) };} }, { key: \"_prepareWorker\", value: function _prepareWorker() {var _this20 = this;this._workerConn || (this._workerConn = new se(\"@maptalks/vt\", this.layer));this._workerConn.addLayer(function (e, t) {_this20.layer && (_this20.ready = !0, _this20.layer.onWorkerReady(e, t), _this20.layer.fire(\"workerready\"), _this20.setToRedraw());});} }, { key: \"_incrWorkerCacheIndex\", value: function _incrWorkerCacheIndex() {this._workerCacheIndex++;} }, { key: \"clearCanvas\", value: function clearCanvas() {_superPropGet($e, \"clearCanvas\", this, 3)([]), this.regl && this.regl.clear({ color: je, depth: 1, stencil: 0 });} }, { key: \"isDrawable\", value: function isDrawable() {return !0;} }, { key: \"checkResources\", value: function checkResources() {return Ge;} }, { key: \"_drawTiles\", value: function _drawTiles(e, t, n, i, r) {if (_superPropGet($e, \"_drawTiles\", this, 3)([e, t, n, i, r]), this._prevTilesInView) if (Object.keys(this._prevTilesInView).length) for (var _e214 in this._prevTilesInView) {var _t192 = this._prevTilesInView[_e214];_t192 && _t192.info && _t192.info.id && !this.tileCache.has(_t192.info.id) && this._drawTile(_t192.info, _t192.image, r);} else this._deletePrevPlugins(), delete this._prevTilesInView;} }, { key: \"_deletePrevPlugins\", value: function _deletePrevPlugins() {var e = this._styleCounter,t = [],n = [];for (var _n136 in this._plugins) if (+_n136 !== e) {t.push(_n136);this._getStylePlugins(_n136).forEach(function (e) {e.remove();});}for (var _t193 in this._featurePlugins) if (+_t193 !== e) {n.push(_t193);this._getFeaturePlugins(_t193).forEach(function (e) {e.remove();});}for (var _e215 = 0; _e215 < t.length; _e215++) delete this._plugins[t[_e215]];for (var _e216 = 0; _e216 < n.length; _e216++) delete this._featurePlugins[n[_e216]];} }, { key: \"draw\", value: function draw(e, t) {this._currentTimestamp !== e && (this._needRetire = !1, this._setPluginIndex());var n = this.layer;if (this.prepareCanvas(), !this.ready || !n.ready) return;var i = this._plugins[this._styleCounter];i || (this._initPlugins(), this._setPluginIndex(), i = this._getStylePlugins());var r = this._getFeaturePlugins();n.isDefaultRender() || i.length || r.length ? (n.options.collision && n.clearCollisionIndex(), this._frameTime = e, this._zScale = this._getCentiMeterScale(this.getMap().getGLRes()), this._parentContext = t || {}, this._startFrame(e), _superPropGet($e, \"draw\", this, 3)([e]), this._currentTimestamp !== e && this._prepareRender(e), this._endFrame(e), this._currentTimestamp = e) : this.completeRender();} }, { key: \"_setPluginIndex\", value: function _setPluginIndex() {this._getFramePlugins().forEach(function (e, t) {e && (e.renderIndex = t);});} }, { key: \"_prepareRender\", value: function _prepareRender() {var e = this._getFramePlugins();this._pluginOffsets = this._pluginOffsets || [];var t = 0;for (var _n137 = e.length - 1; _n137 >= 0; _n137--) {var _i103 = e[_n137];_i103.isVisible() && _i103.hasMesh() && (this._pluginOffsets[_n137] = t, _i103.needPolygonOffset() && t++);}this._groundPainter.isEnable() && t++, this._polygonOffsetIndex = t;} }, { key: \"getFrameTimestamp\", value: function getFrameTimestamp() {return this._frameTime;} }, { key: \"drawOnInteracting\", value: function drawOnInteracting(e, t, n) {this.draw(t, n);} }, { key: \"drawOutline\", value: function drawOutline(e) {var _this21 = this;(this._outline || this._outlineAll) && (this._outlineAll ? this.paintOutlineAll(e) : this._outline.forEach(function (t) {_this21[t[0]].apply(_this21, [e].concat(_toConsumableArray(t[1])));}));} }, { key: \"getAnalysisMeshes\", value: function getAnalysisMeshes() {return this.getShadowMeshes();} }, { key: \"getShadowMeshes\", value: function getShadowMeshes() {var _this22 = this;var e = [];return this._getAllPlugins().forEach(function (t) {if (!t) return;if (!_this22._isVisible(t)) return;var n = t.getShadowMeshes();if (Array.isArray(n)) for (var _t194 = 0; _t194 < n.length; _t194++) e.push(n[_t194]);}), e;} }, { key: \"isForeground\", value: function isForeground(e) {return !(!this._vtCurrentTiles || !this._vtCurrentTiles[e.properties.tile.id]);} }, { key: \"getCurrentTiles\", value: function getCurrentTiles() {return this._vtCurrentTiles;} }, { key: \"_getTileZoomDiff\", value: function _getTileZoomDiff(t) {var n = this.layer;var i = n._getTileZoom(this.getMap().getZoom());var r = n.getMinZoom(),s = n.getMaxZoom();i = e.Util.clamp(i, r, s);return i - t.properties.tile.z;} }, { key: \"isTileNearCamera\", value: function isTileNearCamera(e) {return this._getTileZoomDiff(e) <= 1;} }, { key: \"isBackTile\", value: function isBackTile(e) {return !(!this._vtBgTiles || !this._vtBgTiles[e]);} }, { key: \"loadTileQueue\", value: function loadTileQueue(e) {this._workersyncing || _superPropGet($e, \"loadTileQueue\", this, 3)([e]);} }, { key: \"loadTile\", value: function loadTile(t) {var _this23 = this;var n = t.url,i = this._requestingMVT[n];if (i) i.keys[t.id] || (i.tiles.push(t), i.keys[t.id] = 1);else {var _i104 = this.getMap(),_r83 = We.set(t.extent2d.xmin, t.extent2d.ymax),_s64 = _i104.pointAtResToCoord(new e.Point(_r83), t.res),_o50 = [Ue(_i104, 1, _s64, t.res) / 100, Ue(_i104, 1, _s64, t.res, 1) / 100],_a26 = this.getCentimeterToPoint(t.z),_l24 = this.getTileGLScale(t.z);this._requestingMVT[n] = { keys: {}, tiles: [t] }, this._requestingMVT[n].keys[t.id] = 1;var _h15 = this.layer.options.fetchOptions,_c12 = window && window.location.href,_u7 = this.layer.options.altitudePropertyName,_f8 = this.layer.options.disableAltitudeWarning,_d7 = { tileInfo: { res: t.res, x: t.x, y: t.y, z: t.z, url: it(t), id: t.id, extent2d: t.extent2d }, glScale: _l24, disableAltitudeWarning: _f8, altitudePropertyName: _u7, zScale: this._zScale, centimeterToPoint: _o50, verticalCentimeterToPoint: _a26, fetchOptions: _h15, styleCounter: this._styleCounter, referrer: _c12, workerCacheIndex: this._workerCacheIndex, command: \"loadTile\" };this.loadTileArrayBuffer && j(this.loadTileArrayBuffer) ? this.loadTileArrayBuffer(_d7.tileInfo.url, t, function (e, t) {e ? _this23._onReceiveMVTData(n, e) : t && t instanceof ArrayBuffer ? (_d7.tileArrayBuffer = t, _this23._workerConn.loadTile(_d7, _this23._onReceiveMVTData.bind(_this23, n))) : console.error(\"loadTileArrayBuffer return data is not ArrayBuffer:\", t);}, _d7) : this._workerConn.loadTile(_d7, this._onReceiveMVTData.bind(this, n));}return {};} }, { key: \"getTileGLScale\", value: function getTileGLScale(e) {var t = this.getMap();return this.layer.getSpatialReference().getResolution(e) / t.getGLRes();} }, { key: \"getCentimeterToPoint\", value: function getCentimeterToPoint(e) {var t = this.getMap();return $(this.layer.getSpatialReference().getResolution(e), t);} }, { key: \"getRenderedFeatures\", value: function getRenderedFeatures() {var e = this.tileCache.keys();return this._getFeaturesByKeys(e);} }, { key: \"getCurrentRenderedFeatures\", value: function getCurrentRenderedFeatures() {var e = this._vtCurrentTiles && Object.keys(this._vtCurrentTiles);return this._getFeaturesByKeys(e);} }, { key: \"_getFeaturesByKeys\", value: function _getFeaturesByKeys(e) {var t = [];for (var _n138 = 0; _n138 < e.length; _n138++) {var _i105 = this.tileCache.get(e[_n138]);if (!_i105 || !_i105.info || !_i105.image) continue;var _r84 = _i105.info,_s65 = _i105.image,_o51 = nt(_s65);t.push({ tile: { id: _r84.id, x: _r84.x, y: _r84.y, z: _r84.z, url: _r84.url }, current: !!this.tilesInView[_r84.id], features: _o51 });}return t;} }, { key: \"_onReceiveMVTData\", value: function _onReceiveMVTData(e, t, n) {if (this.setToRedraw(), !this._requestingMVT[e]) return;if (n && n.canceled) return;var i = this.layer,r = i.isDefaultRender(),s = this._requestingMVT[e].tiles;if (delete this._requestingMVT[e], t) {if (t.status && (404 === t.status || 204 === t.status)) for (var _e217 = 0; _e217 < s.length; _e217++) {var _t195 = s[_e217];this.onTileError(oe, _t195);}return;}if (!n) {for (var _e218 = 0; _e218 < s.length; _e218++) {var _t196 = s[_e218];this.consumeTile({ _empty: !0 }, _t196);}return;}if (n.styleCounter !== this._styleCounter) return;var o = !1;var a = n.features,l = [];for (var _e219 = 0; _e219 < n.data.length; _e219++) {var _t197 = n.data[_e219];if (!_t197 || !_t197.data || !_t197.styledFeatures.length) continue;var _this$_parseTileData = this._parseTileData(0, _e219, _t197, a, l),_i106 = _this$_parseTileData.isUpdated,_r85 = _this$_parseTileData.layer;l.push(_r85), _i106 && (o = _i106);}for (var _e220 = 0; _e220 < n.featureData.length; _e220++) {var _t198 = n.featureData[_e220];_t198 && _t198.data && _t198.styledFeatures.length && this._parseTileData(1, _e220, _t198, a);}o && i._compileStyle();var h = s[0].z,c = this.layer.getDataSchema(h);if (this._updateSchema(c, n.schema), delete n.features, r && n.data.length !== l.length) {var _e221 = n.data;n.data = [];for (var _t199 = 0; _t199 < _e221.length; _t199++) _e221[_t199] && _e221[_t199].features && n.data.push(_e221[_t199]);}n.layers = l;for (var _e222 = 0; _e222 < s.length; _e222++) {var _t200 = s[_e222];if (0 === _e222 && i.options.debugTileData) {var _e223 = _t200.x,_n139 = _t200.y,_r86 = _t200.z;console.log(\"tile\", { layerId: i.getId(), x: _e223, y: _n139, z: _r86, layers: Qe(Object.values(a)) });}var _r87 = 0 === _e222 ? n : Je(n);for (var _e224 = 0; _e224 < _r87.data.length; _e224++) {if (!_r87.data[_e224]) continue;var _n140 = _r87.data[_e224].features;for (var _e225 in _n140) {_n140[_e225].tile = _t200;}}_t200.extent = _r87.extent, this._receivedTileExtent || (this._receivedTileExtent = _t200.extent), _r87.features = Object.values(a), _r87.styleCounter = n.styleCounter, this.onTileLoad(_r87, _t200);}this.layer.fire(\"datareceived\", { url: e });} }, { key: \"_parseTileData\", value: function _parseTileData(e, t, n, i) {var _this$_updatePluginIf = this._updatePluginIfNecessary(e, t, n.data),r = _this$_updatePluginIf.style,s = _this$_updatePluginIf.isUpdated,o = this.layer,a = o.isDefaultRender(),l = r.symbol,h = _e(i, n.styledFeatures, t, l, o, !(!o.getData || !o.getData()));delete n.styledFeatures, n.features = h;var c = n.data;return Array.isArray(c) && (c = c[0]), { isUpdated: s, layer: a ? { layer: c.layer, type: c.type } : null };} }, { key: \"_updateSchema\", value: function _updateSchema(e, t) {for (var _n141 in t) {e[_n141] || (e[_n141] = { types: t[_n141].types, properties: {} });var _i107 = t[_n141].properties,_r88 = e[_n141].properties;for (var _e226 in _i107) (!_r88[_e226] || _r88[_e226] && \"object\" !== _i107[_e226] && \"object\" === _r88[_e226]) && (_r88[_e226] = _i107[_e226]);}} }, { key: \"_updatePluginIfNecessary\", value: function _updatePluginIfNecessary(e, t, n) {Array.isArray(n) && (n = n[0]);var i = this.layer;var r,s = !1;if (i.isDefaultRender() && 0 === e) {var _e227 = this._layerPlugins;_e227 || (_e227 = this._layerPlugins = {});var _t201 = n.layer,_i108 = n.type;_e227[_t201] || (_e227[_t201] = []);var _o52 = (\"plugin_\" + _i108).trim();_e227[_t201][_o52] ? r = _e227[_t201][_o52] : (r = this._getDefaultRenderPlugin(_i108), r.filter = n.filter, _e227[_t201].push(r), _e227[_t201][_o52] = r, s = !0);} else {var _o53 = i._getComputedStyle(),_a27 = i._getTargetStyle(e, _o53),_l25 = this._getStylePlugins();if (r = _a27[t], !r.renderPlugin) {s = !0;var _this$_getDefaultRend = this._getDefaultRenderPlugin(n.type),_e228 = _this$_getDefaultRend.plugin,_i109 = _this$_getDefaultRend.symbol,_o54 = _this$_getDefaultRend.renderPlugin;_l25[t] = _e228, r.symbol = _i109, r.renderPlugin = _o54;}}return { style: r, isUpdated: s };} }, { key: \"_getFramePlugins\", value: function _getFramePlugins(e) {var _this24 = this;var t = e && e.style;var n = this._getStylePlugins(t) || [];this.layer.isDefaultRender() && this._layerPlugins && (n = [], e ? e.layers && e.layers.forEach(function (e) {if (!e) return;var t = (\"plugin_\" + e.type).trim();n.push(_this24._layerPlugins[e.layer][t].plugin);}) : Object.keys(this._layerPlugins).forEach(function (e) {for (var _t202 = 0; _t202 < _this24._layerPlugins[e].length; _t202++) n.push(_this24._layerPlugins[e][_t202].plugin);}));var i = this._getFeaturePlugins(t);return i && i.length && (n = n.slice(), Y(n, i)), n;} }, { key: \"_getAllPlugins\", value: function _getAllPlugins() {var _this25 = this;if (this.layer.isDefaultRender() && this._layerPlugins) {var _e229 = [];return Object.keys(this._layerPlugins).forEach(function (t) {for (var _n142 = 0; _n142 < _this25._layerPlugins[t].length; _n142++) _e229.push(_this25._layerPlugins[t][_n142].plugin);}), _e229;}var e = [];for (var _t203 in this._plugins) e.push.apply(e, _toConsumableArray(this._plugins[_t203]));for (var _t204 in this._featurePlugins) e.push.apply(e, _toConsumableArray(this._featurePlugins[_t204]));return e;} }, { key: \"_getStylePlugins\", value: function _getStylePlugins(e) {return X(e) && (e = this._styleCounter), this._plugins[e] || Ge;} }, { key: \"_getFeaturePlugins\", value: function _getFeaturePlugins(e) {return X(e) && (e = this._styleCounter), this._featurePlugins[e] || Ge;} }, { key: \"_startFrame\", value: function _startFrame(e, t) {var _this26 = this;var n = this._isRenderingTerrain(),i = this.layer.isDefaultRender() && this._layerPlugins,r = this._parentContext;this._getAllPlugins().forEach(function (s, o) {if (!s || t && !t(s)) return;if (!_this26._isVisible(o)) return;var a = _this26.regl,l = _this26.gl,h = i ? s.defaultSymbol : s.style && s.style.symbol,c = { regl: a, layer: _this26.layer, symbol: h, gl: l, isRenderingTerrain: n, sceneConfig: s.config ? s.config.sceneConfig : null, dataConfig: s.config ? s.config.dataConfig : null, pluginIndex: o, timestamp: e };r && U(c, r), s.startFrame(c);});} }, { key: \"_endFrame\", value: function _endFrame(e) {var _this27 = this;var t = this._parentContext,n = t.renderMode,i = t && t.renderTarget && t.renderTarget.fbo,r = this.getMap().cameraPosition,s = this._getAllPlugins(),o = this._isRenderingTerrain(),a = !t.timestamp || t.isFinalRender;this.layer.options.collision && !t.isPostProcess ? s.forEach(function (t) {if (!_this27._isVisible(t) || !t.hasMesh()) return;if (n && \"default\" !== n && !t.supportRenderMode(n)) return;if (o && !qe(t)) return;var i = _this27._getPluginContext(t, 0, r, e);t.prepareRender(i), t.updateCollision(i);}) : s.forEach(function (t) {if (!_this27._isVisible(t) || !t.hasMesh()) return;if (n && \"default\" !== n && !t.supportRenderMode(n)) return;if (o && !qe(t)) return;var i = _this27._getPluginContext(t, 0, r, e);t.prepareRender(i);});var l = this._currentTimestamp !== t.timestamp;var h = !1;if (l && !o) {var _t205 = this.layer.getPolygonOffset() + this.layer.getPolygonOffsetCount(),_n143 = this._getPluginContext(null, _t205, r, e);_n143.offsetFactor = _t205, _n143.offsetUnits = _t205, this._groundPainter.paint(_n143);}s.forEach(function (t, s) {if (!_this27._isVisitable(t)) return;if (n && \"default\" !== n && !t.supportRenderMode(n)) return;if (o && !qe(t)) return;_this27.regl.clear({ stencil: 255, framebuffer: i });var a = _this27._pluginOffsets[s] || 0,l = _this27._getPluginContext(t, a, r, e);t.painter && t.painter.isEnableTileStencil(l) && _this27._drawTileStencil(i, t.painter);var c = t.endFrame(l);c && c.redraw && _this27.setToRedraw(), h = !0;}), h && this.layer.fire(\"canvasisdirty\"), a && this._drawDebug();} }, { key: \"getPolygonOffsetCount\", value: function getPolygonOffsetCount() {return this._polygonOffsetIndex || 0;} }, { key: \"_drawDebug\", value: function _drawDebug() {if (this.layer.options.debug) {var _e230 = this._parentContext,_t206 = [],_n144 = this.getMap().projViewMatrix;for (var _i110 in this.tilesInView) {var _r89 = this.tilesInView[_i110].info,_s66 = this.tilesInView[_i110].image;if (_s66._empty) continue;var _o55 = _r89.transform,_l26 = _s66.extent,_h16 = _e230 && _e230.renderTarget;if (_o55 && _l26) {var _e231 = this.getDebugInfo(_r89.id),_i111 = _gl.mat4.multiply(_t206, _n144, _o55),_s67 = this.layer.getTileSize().width;this._debugPainter.draw(_e231, _i111, _s67, _l26, _h16 && _h16.fbo);}}}} }, { key: \"_isVisitable\", value: function _isVisitable(e) {if (!e) return !0;var t = this._parentContext,n = this._isVisible(e),i = t && t.states && t.states.includesChanged,r = this._hasMesh(e.painter.scene.getMeshes());return !n || !i && !r ? 0 : r ? 2 : 1;} }, { key: \"_getPluginContext\", value: function _getPluginContext(e, t, n, i) {var r = this._isRenderingTerrain(),s = r && e && Ze(e),o = this.regl,a = this.gl,l = { regl: o, layer: this.layer, gl: a, isRenderingTerrain: r, isRenderingTerrainSkin: s, sceneConfig: e && e.config.sceneConfig, pluginIndex: e && e.renderIndex, polygonOffsetIndex: t, cameraPosition: n, timestamp: i },h = this._parentContext;return h && U(l, h), l;} }, { key: \"_hasMesh\", value: function _hasMesh(e) {if (!e) return !1;var t = this._parentContext && this._parentContext.sceneFilter;return t ? e.filter(function (e) {return t(e) || e.properties.hlBloomMesh && t(e.properties.hlBloomMesh);}).length > 0 : e.length > 0;} }, { key: \"_drawTileStencil\", value: function _drawTileStencil(e, t) {var n = t.isUniqueStencilRefPerTile(),i = this.getCurrentTileZoom();var r = this._stencilRenderer;r || (r = this._stencilRenderer = new de(this.regl, this.canvas, this.getMap())), r.start();var s = this._stencilTiles.tiles;var _this$_stencilTiles = this._stencilTiles,o = _this$_stencilTiles.parentTiles,a = _this$_stencilTiles.childTiles,l = 1;a = a.sort(Ke);for (var _e232 = 0; _e232 < a.length; _e232++) {var _t207 = n ? l : this.getTileLevelValue(a[_e232].info, i);this._addTileStencil(a[_e232].info, _t207), l++;}o = o.sort(Ke);for (var _e233 = 0; _e233 < o.length; _e233++) {var _t208 = n ? l : this.getTileLevelValue(o[_e233].info, i);this._addTileStencil(o[_e233].info, _t208), l++;}var h = s.sort(Ke);for (var _e234 = h.length - 1; _e234 >= 0; _e234--) {var _t209 = n ? l : this.getTileLevelValue(h[_e234].info, i);this._addTileStencil(h[_e234].info, _t209), l++;}r.render(e);} }, { key: \"_addTileStencil\", value: function _addTileStencil(e, t) {var n = We.set(e.extent2d.xmin, e.extent2d.ymax),i = e.extent || this._receivedTileExtent || 8192,r = e.transform = e.transform || this.calculateTileMatrix(n, e.z, i);e.stencilRef = t, this._stencilRenderer.add(t, i, r);} }, { key: \"onDrawTileStart\", value: function onDrawTileStart(e) {_superPropGet($e, \"onDrawTileStart\", this, 3)([e]);var t = e.tiles,n = e.childTiles,i = e.parentTiles;this._vtCurrentTiles = {}, this._vtBgTiles = {};for (var _e235 = 0; _e235 < t.length; _e235++) this._vtCurrentTiles[t[_e235].info.id] = 1;for (var _e236 = 0; _e236 < n.length; _e236++) this._vtBgTiles[n[_e236].info.id] = 1;for (var _e237 = 0; _e237 < i.length; _e237++) this._vtBgTiles[i[_e237].info.id] = 1;this._stencilTiles = e;} }, { key: \"isEnableTileStencil\", value: function isEnableTileStencil() {if (this.layer.options.altitude) return !1;var e = this._getFramePlugins();for (var _t210 = 0; _t210 < e.length; _t210++) if (e[_t210] && e[_t210].painter && !e[_t210].painter.isOnly2D()) return !1;return !0;} }, { key: \"setTerrainHelper\", value: function setTerrainHelper(e) {this._terrainLayer = e;} }, { key: \"getTerrainHelper\", value: function getTerrainHelper() {return this._terrainLayer;} }, { key: \"drawTileOnTerrain\", value: function drawTileOnTerrain() {var _$e$prototype$drawTil;for (var _len6 = arguments.length, e = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {e[_key6] = arguments[_key6];}(_$e$prototype$drawTil = $e.prototype.drawTile).call.apply(_$e$prototype$drawTil, [this].concat(e));} }, { key: \"createTerrainTexture\", value: function createTerrainTexture(e) {var t = this.layer.getTileSize().width,n = 2 * t,i = 2 * t,r = e.texture({ min: \"linear\", mag: \"linear\", type: \"uint8\", width: n, height: i });this._terrainDepthStencil || (this._terrainDepthStencil = e.renderbuffer({ width: n, height: i, format: \"depth24 stencil8\" }));var s = { width: n, height: i, colors: [r], colorFormat: \"rgba\", ignoreStatusCheck: !0 };s.depthStencil = this._terrainDepthStencil;var o = e.framebuffer(s);return o.colorTex = r, o;} }, { key: \"deleteTerrainTexture\", value: function deleteTerrainTexture(e) {e.destroy(), e.colorTex && (e.colorTex.destroy(), delete e.colorTex);} }, { key: \"renderTerrainSkin\", value: function renderTerrainSkin(e, t, n) {var i = this._currentTimestamp,r = this._parentContext,s = this.layer.getTileSize().width;this._startFrame(i);for (var _t211 = 0; _t211 < n.length; _t211++) {var _i112 = n[_t211].texture;this._parentContext = { renderTarget: { fbo: _i112 } }, Ye.framebuffer = _i112, e.clear(Ye), this._parentContext.viewport = tt(s), this._drawTerrainTile(n[_t211].tile, _i112);}this._endTerrainFrame(n), this._parentContext = r;} }, { key: \"_drawTerrainTile\", value: function _drawTerrainTile(e) {var t = e.info,n = e.image;this.drawTile(t, n, Ze);} }, { key: \"_endTerrainFrame\", value: function _endTerrainFrame(e) {var _this28 = this;var t = this._getAllPlugins(),n = this.getMap().cameraPosition,i = this._currentTimestamp || 0;this.layer.options.collision ? t.forEach(function (e) {if (!_this28._isVisible(e) || !e.hasMesh()) return;if (!Ze(e) || !_this28.layer.options.awareOfTerrain) return;var t = _this28._getPluginContext(e, 0, n, i);t.isRenderingTerrainSkin = !0, e.prepareRender(t), e.updateCollision(t);}) : t.forEach(function (e) {if (!_this28._isVisible(e) || !e.hasMesh()) return;if (!Ze(e) || !_this28.layer.options.awareOfTerrain) return;var t = _this28._getPluginContext(e, 0, n, i);t.isRenderingTerrainSkin = !0, e.prepareRender(t);}), t.forEach(function (t, n) {if (!_this28._isVisitable(t) || !Ze(t)) return;for (var _t212 = 0; _t212 < e.length; _t212++) {var _n145 = e[_t212].texture;_this28.regl.clear({ stencil: 255, framebuffer: _n145 });}var i = _this28._pluginOffsets[n] || 0,r = _this28._getPluginContext(t, i, [0, 0, 0], _this28._currentTimestamp);r.isRenderingTerrainSkin = !0, t.endFrame(r);});} }, { key: \"drawTile\", value: function drawTile(e, t, n) {var _this29 = this;if (!t.cache) return;var i = this._isRenderingTerrain(),r = t.cache,s = We.set(e.extent2d.xmin, e.extent2d.ymax),o = e.extent || this._receivedTileExtent || 8192,a = e.transform = e.transform || this.calculateTileMatrix(s, e.z, o),l = e.tileTranslationMatrix = e.tileTranslationMatrix || this.calculateTileTranslationMatrix(s, e.z),h = e.terrainTransform = e.terrainTransform || this.calculateTerrainTileMatrix(s, e.z, o),c = this._parentContext,u = [];Y(u, t.data), Y(u, t.featureData);this._getFramePlugins(t).forEach(function (s, o) {if (!s || n && !n(s)) return;if (!u[o]) return;if (!r[o]) return;if (_this29.drawingParentTiles && !s.painter.shouldDrawParentTile()) return;var f = i && Ze(s),d = _this29.regl,p = _this29.gl,g = { regl: d, layer: _this29.layer, gl: p, sceneConfig: s.config.sceneConfig, pluginIndex: o, tileCache: r[o], tileData: u[o], tileTransform: f ? h : a, tileVectorTransform: a, tileTranslationMatrix: l, tileExtent: t.extent, timestamp: _this29._frameTime, tileInfo: e, tileZoom: _this29._tileZoom, bloom: _this29._parentContext && _this29._parentContext.bloom, isRenderingTerrain: i, isRenderingTerrainSkin: f };f && c && c.renderTarget && (g.renderTarget = c.renderTarget);var m = s.paintTile(g);!_this29._needRetire && (m.retire || m.redraw) && s.supportRenderMode(\"taa\") && (_this29._needRetire = !0), m.redraw && _this29.setToRedraw();}), t && t.style === this._styleCounter && this._retirePrevTile(e), this.setCanvasUpdated();} }, { key: \"_createOneTile\", value: function _createOneTile(e, t) {var _this30 = this;if (!t.loadTime || t._empty) return;var n = t.cache;n || (n = t.cache = {});var i = this._isRenderingTerrain(),r = We.set(e.extent2d.xmin, e.extent2d.ymax),s = e.transform = e.transform || this.calculateTileMatrix(r, e.z, t.extent),o = e.tileTranslationMatrix = e.tileTranslationMatrix || this.calculateTileTranslationMatrix(r, e.z),a = e.terrainTransform = e.terrainTransform || this.calculateTerrainTileMatrix(r, e.z, e.extent),l = [];Y(l, t.data), Y(l, t.featureData);this._getFramePlugins(t).forEach(function (r, h) {if (!r) return;if (!l[h]) return;var c = i && Ze(r),u = _this30.regl,f = _this30.gl;n[h] || (n[h] = {});var d = { regl: u, layer: _this30.layer, gl: f, sceneConfig: r.config.sceneConfig, pluginIndex: h, tileCache: n[h], tileData: l[h], tileTransform: c ? a : s, tileVectorTransform: s, isRenderingTerrain: i, isRenderingTerrainSkin: c, tileTranslationMatrix: o, tileExtent: t.extent, timestamp: _this30._frameTime, tileInfo: e, tileZoom: _this30._tileZoom },p = r.createTile(d);n[h].geometry && (t.data[h] = 1), !_this30._needRetire && p.retire && r.supportRenderMode(\"taa\") && (_this30._needRetire = !0);});} }, { key: \"checkTileInQueue\", value: function checkTileInQueue(e) {return e.styleCounter === this._styleCounter;} }, { key: \"pick\", value: function pick(e, t, n) {var i = [];if (!this.layer.isVisible()) return i;return this._getFramePlugins().forEach(function (r) {if (!r) return;if (!1 === (r.painter && r.painter.sceneConfig).picking) return;if (!r.isVisible()) return;var s = r.pick(e, t, n.tolerance);s && (s.type = r.getType(), i.push(s));}), i;} }, { key: \"deleteTile\", value: function deleteTile(e) {var _this31 = this;if (e) {if (e.image && !e.image._empty) {var _t213 = e.image && e.image.style,_n146 = this._getStylePlugins(_t213);_n146 && _n146.forEach(function (t, n) {t && t.deleteTile({ pluginIndex: n, regl: _this31.regl, layer: _this31.layer, gl: _this31.gl, tileCache: e.image.cache ? e.image.cache[n] : {}, tileInfo: e.info, tileData: e.image });}), e.image.cache = {};}e.info && (delete e.info.completeTerrainQuery, delete e.info.terrainQueryStatus), _superPropGet($e, \"deleteTile\", this, 3)([e]);}} }, { key: \"abortTileLoading\", value: function abortTileLoading(e, t) {var n = t ? it(t) : \"\";t && t.url && (this._workerConn && this._workerConn.abortTile(n), delete this._requestingMVT[t.url]), this.loadTileArrayBuffer && j(this.loadTileArrayBuffer) ? this.loadTileArrayBuffer(n, t, function () {}, { command: \"abortTile\" }) : _superPropGet($e, \"abortTileLoading\", this, 3)([e, t]);} }, { key: \"resizeCanvas\", value: function resizeCanvas(e) {_superPropGet($e, \"resizeCanvas\", this, 3)([e]);var t = this.canvas;t && (!this.pickingFBO || this.pickingFBO.width === t.width && this.pickingFBO.height === t.height || (this.pickingFBO.resize(t.width, t.height), this._getFramePlugins().forEach(function (e) {e && e.resize(t.width, t.height);})));} }, { key: \"onRemove\", value: function onRemove() {this._stencilRenderer && this._stencilRenderer.remove(), this._workerConn && (this._workerConn.removeLayer(function (e) {if (e) throw e;}), this._workerConn.remove(), delete this._workerConn), this.pickingFBO && (this.canvas.pickingFBO || this.pickingFBO.destroy(), delete this.pickingFBO), this._debugPainter && (this._debugPainter.delete(), delete this._debugPainter), this._terrainDepthStencil && (this._terrainDepthStencil.destroy(), delete this._terrainDepthStencil), this._groundPainter && (this._groundPainter.dispose(), delete this._groundPainter), _superPropGet($e, \"onRemove\", this, 1) && _superPropGet($e, \"onRemove\", this, 3)([]), this._clearPlugin();} }, { key: \"_clearPlugin\", value: function _clearPlugin() {this._getAllPlugins().forEach(function (e) {e.remove();}), this.plugins = {};} }, { key: \"hitDetect\", value: function hitDetect(e) {if (!this.gl || !this.layer.options.hitDetect) return !1;var t = this.gl,n = new Uint8Array(4),i = this.canvas.height;return t.readPixels(e.x, i - e.y, 1, 1, t.RGBA, t.UNSIGNED_BYTE, n), n[3] > 0;} }, { key: \"_initPlugins\", value: function _initPlugins() {var _this32 = this;var _this$layer$_getCompu = this.layer._getComputedStyle(),e = _this$layer$_getCompu.style,t = _this$layer$_getCompu.featureStyle,n = e.map(function (e, t) {var n = e.renderPlugin;if (!n) return null;if (!n.type) throw new Error(\"invalid plugin type for style at \" + t);var i = _this32._createRenderPlugin(n);return i.styleCounter = _this32._styleCounter, i.style = e, i;}),i = [];t.forEach(function (e, t) {var n = e.renderPlugin;if (!n) return null;if (!n.type) throw new Error(\"invalid plugin type for features at \" + t);var r = _this32._createRenderPlugin(n);return r.style = e, r.styleCounter = _this32._styleCounter, i.push(r), r;});var r = this._styleCounter;if (this._plugins[r] = n, this._featurePlugins[r] = i, this.layer.fire(\"pluginsinited\"), this._highlighted && this._highlighted.size || this.layer._highlighted) {this.layer._highlighted && this.layer._resumeHighlights();this.getMap().getRenderer().callInNextFrame(function () {_this32._getFramePlugins().forEach(function (e) {e.highlight(_this32._highlighted);});});}return n;} }, { key: \"_createRenderPlugin\", value: function _createRenderPlugin(e) {var t = this.layer.constructor.getPlugins()[e.type];if (!t) throw new Error(\"Plugin for (\".concat(e.type, \") is not loaded.\"));var n = new t();return n.config = e, n.config.sceneConfig || (n.config.sceneConfig = {}), n;} }, { key: \"_createGLContext\", value: function _createGLContext(e, t) {var n = [\"webgl\", \"experimental-webgl\"];var i = null;for (var _r90 = 0; _r90 < n.length; ++_r90) {try {i = e.getContext(n[_r90], t);} catch (e) {}if (i) break;}return i;} }, { key: \"_getCentiMeterScale\", value: function _getCentiMeterScale(e) {return $(e, this.getMap());} }, { key: \"debugFBO\", value: function debugFBO(e, t) {var n = document.getElementById(e),i = t.width,r = t.height;n.width = i, n.height = r;var s = n.getContext(\"2d\"),o = this.regl.read({ framebuffer: t }),a = r / 2 | 0,l = 4 * i;for (var _e238 = 0; _e238 < o.length; _e238++) o[_e238] *= 255;var h = new Uint8Array(4 * i);for (var _e239 = 0; _e239 < a; ++_e239) {var _t214 = _e239 * l,_n147 = (r - _e239 - 1) * l;h.set(o.subarray(_t214, _t214 + l)), o.copyWithin(_t214, _n147, _n147 + l), o.set(h, _n147);}var c = new ImageData(i, r);c.data.set(o), s.putImageData(c, 0, 0);} }, { key: \"_getDefaultRenderPlugin\", value: function _getDefaultRenderPlugin(e) {var t;switch (e) {case \"native-line\":t = { type: \"native-line\", dataConfig: { type: \"native-line\", only2D: !0 } };break;case \"native-point\":t = { type: \"native-point\", dataConfig: { type: \"native-point\", only2D: !0 } };break;case \"fill\":t = { type: \"fill\", dataConfig: { type: \"fill\", only2D: !0 }, sceneConfig: { antialias: !0 } };break;default:t = null;}var n = function (e) {switch (e) {case \"native-point\":return { markerFill: \"#f00\", markerSize: 6, markerOpacity: .5 };case \"native-line\":return { lineColor: \"#bbb\", lineOpacity: .5 };case \"fill\":return { polygonFill: \"#76a6f0\", polygonOpacity: .8 };}return null;}(e),i = this._createRenderPlugin(t);return i.defaultSymbol = n, { plugin: i, symbol: n, renderPlugin: t };} }, { key: \"_isVisible\", value: function _isVisible() {return !0;} }, { key: \"isEnableWorkAround\", value: function isEnableWorkAround(e) {return \"win-intel-gpu-crash\" === e && this.layer.options.workarounds[\"win-intel-gpu-crash\"] && function (e) {var t = e.getExtension(\"WEBGL_debug_renderer_info\");if (t && \"undefined\" != typeof navigator) {var _n148 = e.getParameter(t.UNMASKED_RENDERER_WEBGL),_i113 = \"Win32\" === navigator.platform || \"Win64\" === navigator.platform;if (_n148 && _n148.toLowerCase().indexOf(\"intel\") >= 0 && _i113) return !0;}return !1;}(this.gl);} }, { key: \"getZScale\", value: function getZScale() {return this._zScale;} }, { key: \"outline\", value: function outline(e, t) {t && (Array.isArray(t) || (t = [t]), this._outline || (this._outline = []), this._outline.push([\"paintOutline\", [e, t]]), this.setToRedraw());} }, { key: \"outlineFeatures\", value: function outlineFeatures(e) {e && (Array.isArray(e) || (e = [e]), this._outline || (this._outline = []), this._outline.push([\"paintOutline\", [null, e]]), this.setToRedraw());} }, { key: \"outlineBatch\", value: function outlineBatch(e) {this._outline || (this._outline = []), this._outline.push([\"paintBatchOutline\", [e]]), this.setToRedraw();} }, { key: \"outlineAll\", value: function outlineAll() {this._outlineAll = !0, this.setToRedraw();} }, { key: \"paintOutlineAll\", value: function paintOutlineAll(e) {var t = this._getFramePlugins();for (var _n149 = 0; _n149 < t.length; _n149++) t[_n149].outlineAll(e);} }, { key: \"paintOutline\", value: function paintOutline(e, t, n) {if (!X(t)) {var _i114 = t,_r91 = this._getFramePlugins();if (!_r91[_i114] || _r91[_i114].painter && !_r91[_i114].painter.isVisible()) return;return void _r91[_i114].outline(e, n);}var i = this._getFramePlugins();for (var _t215 = 0; _t215 < n.length; _t215++) {var _r92 = n[_t215];for (var _t216 = 0; _t216 < i.length; _t216++) i[_t216].style && i[_t216].style.id === _r92 && i[_t216].outline(e, [_r92]);}} }, { key: \"paintBatchOutline\", value: function paintBatchOutline(e, t) {var n = this._getFramePlugins();!n[t] || n[t].painter && !n[t].painter.isVisible() || n[t].outlineAll(e);} }, { key: \"cancelOutline\", value: function cancelOutline() {delete this._outline, delete this._outlineAll, this.setToRedraw();} }, { key: \"setZIndex\", value: function setZIndex() {return this.setToRedraw(), this._needRetire = !0, _superPropGet($e, \"setZIndex\", this, 1).apply(this, arguments);} }, { key: \"consumeTile\", value: function consumeTile(e, t) {if (e && !e._empty) {var _this$_findTileAltitu = this._findTileAltitude(e),_this$_findTileAltitu2 = _slicedToArray(_this$_findTileAltitu, 2),_n150 = _this$_findTileAltitu2[0],_i115 = _this$_findTileAltitu2[1];t.minAltitude = _n150, t.maxAltitude = _i115;}if (this._retirePrevTile(t), _superPropGet($e, \"consumeTile\", this, 3)([e, t]), \"transient\" === this.layer.options.features && e.data) {for (var _t217 = 0; _t217 < e.data.length; _t217++) {if (!e.data[_t217]) continue;var _n151 = e.data[_t217].features;if (_n151) for (var _e240 in _n151) {var _t218 = _n151[_e240] && _n151[_e240].feature;_t218 && (_t218.fnTypeProps ? _t218.customProps[ve] = _t218.fnTypeProps : _n151[_e240] = null);}}this.layer.fire(\"_transientfeature\", { tileImage: e });}e && e.features && (e.features = []), this._createOneTile(t, e);} }, { key: \"_findTileAltitude\", value: function _findTileAltitude(e) {var t = e.data;var n = -1 / 0,i = 1 / 0;for (var _e241 = 0; _e241 < t.length; _e241++) {if (!t[_e241]) continue;var _r93 = t[_e241].data;if (_r93) for (var _e242 = 0; _e242 < _r93.length; _e242++) {var _t219 = _r93[_e242];if (!_t219 || !_t219.properties) continue;var _t219$properties = _t219.properties,_s68 = _t219$properties.maxAltitude,_o56 = _t219$properties.minAltitude;_s68 > n && (n = _s68), _o56 < i && (i = _o56);}}return Xe[0] = i === 1 / 0 ? 0 : i, Xe[1] = n === -1 / 0 ? 0 : n, Xe;} }, { key: \"onTileError\", value: function onTileError(e, t) {this._retirePrevTile(t), _superPropGet($e, \"onTileError\", this, 3)([e, t]);} }, { key: \"_retirePrevTile\", value: function _retirePrevTile(e) {var t = e.id;if (this._prevTilesInView && this._prevTilesInView[t]) {var _e243 = this._prevTilesInView[t];this.deleteTile(_e243), delete this._prevTilesInView[t];}} }, { key: \"highlight\", value: function highlight(e) {var _this33 = this;if (this._highlighted || (this._highlighted = new Map()), Array.isArray(e)) for (var _t220 = 0; _t220 < e.length; _t220++) X(e[_t220].name) && !X(e[_t220].id) && (e[_t220] = U({}, e[_t220]), e[_t220].name = e[_t220].id), this._highlighted.set(e[_t220].name, e[_t220]);else X(e.name) && !X(e.id) && ((e = U({}, e)).name = e.id), this._highlighted.set(e.name, e);this._getFramePlugins().forEach(function (e) {e.highlight(_this33._highlighted);}), this._highlightUpdated = !0;} }, { key: \"cancelHighlight\", value: function cancelHighlight(e) {var _this34 = this;if (!this._highlighted) return;if (Array.isArray(e)) for (var _t221 = 0; _t221 < e.length; _t221++) this._highlighted.delete(e[_t221]);else this._highlighted.delete(e);this._getFramePlugins().forEach(function (e) {e.highlight(_this34._highlighted);}), this._highlightUpdated = !0;} }, { key: \"cancelAllHighlight\", value: function cancelAllHighlight() {if (!this._highlighted) return;delete this._highlighted;this._getFramePlugins().forEach(function (e) {e.cancelAllHighlight();}), this._highlightUpdated = !0;} }, { key: \"_getLayerOpacity\", value: function _getLayerOpacity() {var e = this.layer.options.opacity;return this._isInGroupGLLayer() ? X(e) ? 1 : e : 1;} }, { key: \"_isRenderingTerrain\", value: function _isRenderingTerrain() {return !!this._terrainLayer && this.layer.options.awareOfTerrain;} }]);}(e.renderer.TileLayerCanvasRenderer);function Je(e) {var t;Array.isArray(e.data) ? (t = [], Y(t, e.data)) : (t = {}, U(t, e.data));var n = U({}, e);return n.data = t, n;}function Ke(e, t) {return t.info.z - e.info.z;}function Qe(e) {var t = {};for (var _n152 = 0; _n152 < e.length; _n152++) {var _i116 = e[_n152].layer || \"default\";t[_i116] || (t[_i116] = []), t[_i116].push(e[_n152]);}return t;}function et(e) {if (Array.isArray(e)) {var _t222 = e;for (var _e244 = 0; _e244 < _t222.length; _e244++) if (et(_t222[_e244])) return !0;}for (var _t223 in e) if ((0, _functionType.isFunctionDefinition)(e[_t223]) || Be.isExpression(e[_t223])) return !0;return !1;}function tt(e) {return { x: 0, y: 0, width: 2 * e, height: 2 * e };}function nt(e) {if (!e.cache) return [];for (var _t224 in e.cache) {var _n153 = e.cache[_t224];if (_n153.geometry) for (var _e245 = 0; _e245 < _n153.geometry.length; _e245++) {var _t225 = _n153.geometry[_e245] && _n153.geometry[_e245].geometry;if (_t225 && _t225.properties && _t225.properties.features) {var _e246 = _t225.properties.features.empty;delete _t225.properties.features.empty;var _n154 = Object.values(_t225.properties.features);return void 0 !== _e246 && (_t225.properties.features.empty = _e246), _n154;}}}return [];}function it(t) {return e.Util.getAbsoluteURL(t.url);}$e.include({ calculateTileMatrix: function () {var e = new Array(3),t = new Array(3),n = new Array(3);return function (i, r, s) {var l = this.getTileGLScale(r),h = i,c = this.layer.getTileSize().width,u = _gl.mat4.identity([]);return _gl.mat4.scale(u, u, _gl.vec3.set(e, l, l, this._zScale)), _gl.mat4.translate(u, u, _gl.vec3.set(t, h.x, h.y, 0)), _gl.mat4.scale(u, u, _gl.vec3.set(n, c / s, -c / s, 1)), u;};}(), calculateTerrainTileMatrix: function () {var e = new Array(3);return function (t, n, i) {var r = _gl.mat4.identity([]),s = i / 2;return _gl.mat4.scale(r, r, _gl.vec3.set(e, 1 / s, -1 / s, 0)), _gl.mat4.translate(r, r, _gl.vec3.set(e, -s, -s, 0)), r;};}(), calculateTileTranslationMatrix: function () {var e = new Array(3);return function (t, n) {var i = this.getTileGLScale(n),r = t,s = _gl.mat4.identity([]);return _gl.mat4.translate(s, s, _gl.vec3.set(e, r.x * i, r.y * i, 0)), s;};}() });var _H3 = H(),rt = _H3.PackUtil,st = new e.Point(0, 0),ot = new e.Coordinate(0, 0),at = [null, 0],lt = [];var ht = exports.VectorTileLayer = function (_e$TileLayer) {function ht(e, t) {var _this35;_classCallCheck(this, ht);_this35 = _callSuper(this, ht, [e, t]), _this35._schema = {}, _this35.VERSION = ht.VERSION;var n = t && t.style;_this35.setStyle(n);return _this35;}_inherits(ht, _e$TileLayer);return _createClass(ht, [{ key: \"setURLModifier\", value: function setURLModifier(e) {this._urlModifier = e;var t = this.getRenderer();return t && t.updateOptions(), this;} }, { key: \"getURLModifier\", value: function getURLModifier() {return this._urlModifier;} }, { key: \"onAdd\", value: function onAdd() {var e = this.getMap();this._prepareOptions();var t = this.getSpatialReference().toJSON().projection,n = e.getSpatialReference().toJSON().projection;if ((t && t.toLowerCase()) !== (n && n.toLowerCase())) throw new Error(\"VectorTileLayer's projection(\".concat(t, \") must be the same with map(\").concat(n, \").\"));} }, { key: \"setFeatureState\", value: function setFeatureState(e, t) {if (X(e.id)) throw new Error(\"missing id in first parameter of setFeatureState.\");this._featureStates || (this._featureStates = {});var n = e.layer || \"0\";var i = this._featureStates[n];return this._featureStates[n] || (i = this._featureStates[n] = new Map()), i.set(e.id, t), this._markFeatureState(), this;} }, { key: \"removeFeatureState\", value: function removeFeatureState(e, t) {if (X(e.id)) throw new Error(\"missing id in first parameter of removeFeatureState.\");if (!this._featureStates) return this;var n = e.layer || \"0\",i = this._featureStates[n];if (!i) return this;if (t) {var _n155 = i.get(e.id);if (W(t)) for (var _e247 in t) delete _n155[_e247];else delete _n155[t];i.set(e.id, _n155);} else i.delete(e.id);return this._markFeatureState(), this;} }, { key: \"getFeatureState\", value: function getFeatureState(e) {if (X(e.id)) throw new Error(\"missing id in first parameter of getFeatureState.\");if (!this._featureStates) return null;var t = e.layer || \"0\";return this._featureStates[t].get(e.id);} }, { key: \"_markFeatureState\", value: function _markFeatureState() {var e = this.getRenderer();if (!e) return;var t = e.getFrameTimestamp();this._featureStamp = t;} }, { key: \"_getFeatureStateStamp\", value: function _getFeatureStateStamp() {return this._featureStamp;} }, { key: \"_isFeatureStateDirty\", value: function _isFeatureStateDirty(e) {return this._featureStamp && this._featureStamp !== e;} }, { key: \"_prepareOptions\", value: function _prepareOptions() {var e = this.options,t = this.getMap().getProjection(),n = \"EPSG:4326\" === t.code || \"EPSG:4490\" === t.code,i = \"EPSG:3857\" === t.code;if (!e.spatialReference) {512 === this.getTileSize().width && (i ? e.spatialReference = \"preset-vt-3857\" : n && (e.spatialReference = \"preset-vt-4326\"));}e.tileSystem || (e.tms ? i ? e.tileSystem = [1, 1, -6378137 * Math.PI, -6378137 * Math.PI] : n && (e.tileSystem = [1, 1, -180, -90]) : n && (e.tileSystem = [1, -1, -180, 90]));} }, { key: \"forceReload\", value: function forceReload() {var e = this.getRenderer();return e && e._incrWorkerCacheIndex(), _superPropGet(ht, \"forceReload\", this, 3)([]);} }, { key: \"onWorkerReady\", value: function onWorkerReady() {} }, { key: \"onConfig\", value: function onConfig(e) {var t = this.getRenderer();t && t.updateOptions(e);} }, { key: \"getWorkerOptions\", value: function getWorkerOptions() {return { debug: this.options.debug, debugTile: this.options.debugTile, altitudeProperty: this.options.altitudeProperty, tileSize: this.getTileSize().width, style: this.isDefaultRender() ? { style: [], featureStyle: [] } : this._getComputedStyle(), features: this.options.debugTileData || this.options.features, schema: this.options.schema, pickingGeometry: this.options.pickingGeometry, projectionCode: this.getSpatialReference().getProjection().code, workerGlyph: this.options.workerGlyph && !this.getURLModifier(), featureIdProperty: this.options.featureIdProperty };} }, { key: \"setStyle\", value: function setStyle(e) {var _this36 = this;if (e && (B(e) || e.url)) {var _t226 = e,_n156 = _t226.lastIndexOf(\"/\"),_i117 = _n156 < 0 ? \".\" : _t226.substring(0, _n156);return this.ready = !1, Q.getJSON(e.url ? e.url : e, e.url ? e : {}, function (e, n) {if (e) throw _this36.setStyle([]), e;var r;n.style ? (r = n, r.$root || (r.$root = _i117)) : r = { $root: _i117, style: n }, _this36.options.style = _t226, _this36._setStyle(r);}), this;}return this.options.style = e, this._setStyle(e), this;} }, { key: \"_tilePointToPoint\", value: function _tilePointToPoint(e, t, n, i) {var r = i / this.getTileSize().width;return e.set(n.x + t.x / r, n.y - t.y / r);} }, { key: \"queryTilePointTerrain\", value: function queryTilePointTerrain(e, t, n, i, r) {var s = this.getRenderer(),o = s && s.getTerrainHelper();if (!s || !o) return at[0] = null, at[1] = 0, at;var a = this._tilePointToPoint(st, e, n, i);return t && o.queryTileTerrainByPointAtRes ? o.queryTileTerrainByPointAtRes(a, r, t.id, t, lt) : (at[0] = null, at[1] = 0, at);} }, { key: \"queryTerrainTiles\", value: function queryTerrainTiles(e) {var t = this.getRenderer(),n = t && t.getTerrainHelper();return t && n ? n.getTerrainTiles(this, e) : null;} }, { key: \"_setStyle\", value: function _setStyle(e) {if (e && e.$root) {var _t227 = e.$root;_t227 && \"/\" === _t227[_t227.length - 1] && (_t227 = _t227.substring(0, _t227.length - 1)), this._replacer = function (e) {return \"{$root}\" === e ? _t227 : null;};}this.ready = !0, e = e || [], Array.isArray(e) ? e = { style: e } : e.renderPlugin && (e = { style: [e] }), e = function (e) {if (!e.plugins) return e;var t = e.plugins,n = e.styles;var i = n.style,r = n.featureStyle;i = i || [], r = r || [];var s = new Array(i.length);for (var _e248 = 0; _e248 < i.length; _e248++) s[_e248] = U({}, i[_e248]), s[_e248].renderPlugin = t[i[_e248].renderPlugin];var o = new Array(r.length);for (var _e249 = 0; _e249 < r.length; _e249++) o[_e249] = U({}, r[_e249]), o[_e249].renderPlugin = t[r[_e249].renderPlugin];var a = { style: s, featureStyle: o };return e.$root && (a.$root = e.$root), a;}(e = Ce(e)), this._originFeatureStyle = e.featureStyle || [], this._featureStyle = function (e) {if (!e || !Array.isArray(e)) return [];var t = [];for (var _n157 = 0; _n157 < e.length; _n157++) {var _i118 = e[_n157].style;if (_i118 && Array.isArray(_i118) && _i118.length) for (var _r94 = 0; _r94 < _i118.length; _r94++) {var _s69 = U({}, e[_n157], _i118[_r94]);_i118[_r94]._renderIdx = t.length, delete _s69.style, t.push(_s69);} else t.push(U({}, e[_n157]));}return t;}(e.featureStyle), this._vtStyle = e.style || [];var t = e.background || {};this._background = { enable: t.enable || !1, color: ut(t.color) || [0, 0, 0, 0], opacity: ft(t.opacity, 1), patternFile: t.patternFile, depthRange: t.depthRange }, this.validateStyle(), this._replacer && this._parseStylePath(), this._compileStyle();var n = this.getRenderer();n && n.setStyle(), this.fire(\"setstyle\", { style: this.getStyle(), computedStyle: this.getComputedStyle() });} }, { key: \"getPolygonOffsetCount\", value: function getPolygonOffsetCount() {var e = this.getRenderer();return e ? e.getPolygonOffsetCount() : 0;} }, { key: \"getPolygonOffset\", value: function getPolygonOffset() {return this._polygonOffset || 0;} }, { key: \"setPolygonOffset\", value: function setPolygonOffset(e, t) {return this._polygonOffset = e, this._totalPolygonOffset = t, this;} }, { key: \"getTotalPolygonOffset\", value: function getTotalPolygonOffset() {return this._totalPolygonOffset;} }, { key: \"_convertTileFeatuers\", value: function _convertTileFeatuers(e) {for (var _t228 = 0, _n158 = e.length; _t228 < _n158; _t228++) {var _n159 = e[_t228];if (!_n159) continue;var _i119 = _n159.features || [];this._convertFeatures(_i119);}return e;} }, { key: \"_convertFeatures\", value: function _convertFeatures(e) {if (!e || !e.length) return;var t = this._getTileConfig();var n;for (var _i120 = 0, _r95 = e.length; _i120 < _r95; _i120++) {var _e$_i = e[_i120],_r96 = _e$_i.feature,_s70 = _e$_i.tile,_o57 = _r96.geometry;if (!_r96 || !_s70 || !_o57) continue;if (_o57.type) continue;var _a28 = _s70.x,_l27 = _s70.y,_h17 = _s70.res,_c13 = _s70.extent;undefined === _a28 && undefined === _l27 && undefined === _h17 || (n = t.getTilePointNW(_a28, _l27, _h17));var _u8 = _r96.type,_f9 = this._convertGeometry(_u8, _o57, n, _c13, _h17);_r96.geometry = _f9;}} }, { key: \"getCurrentRenderedFeatures\", value: function getCurrentRenderedFeatures() {var e = this.getRenderer();if (!e) return [];var t = e.getCurrentRenderedFeatures() || [];return this._convertTileFeatuers(t);} }, { key: \"getRenderedFeatures\", value: function getRenderedFeatures() {var e = this.getRenderer();if (!e) return [];var t = e.getRenderedFeatures() || [];return this._convertTileFeatuers(t);} }, { key: \"getRenderedFeaturesAsync\", value: function getRenderedFeaturesAsync() {var _this37 = this;var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};return new Promise(function (n, i) {var r = _this37.getRenderer();if (r) {if (e.MicroTask) {var _i121 = r.getRenderedFeatures() || [],_s71 = [];_i121.forEach(function (e) {var t = e.features || [];t.length && Y(_s71, t);});var _o58 = (t = Object.assign({}, { countPerTime: 1e4 }, t)).countPerTime,_a29 = Math.ceil(_s71.length / _o58);var _l28 = 1;var _h18 = function _h18() {var e = (_l28 - 1) * _o58,t = _l28 * _o58,n = _s71.slice(e, t);_this37._convertFeatures(n), _l28++;};e.MicroTask.runTaskAsync({ count: _a29, run: _h18 }).then(function () {n(_i121);});} else n(_this37.getRenderedFeatures());} else n([]);});} }, { key: \"outlineAll\", value: function outlineAll() {var e = this.getRenderer();return e ? (e.outlineAll(), this) : this;} }, { key: \"outline\", value: function outline(e, t) {var n = this.getRenderer();return n ? (n.outline(e, t), this) : this;} }, { key: \"outlineBatch\", value: function outlineBatch(e) {var t = this.getRenderer();return t ? (t.outlineBatch(e), this) : this;} }, { key: \"outlineFeatures\", value: function outlineFeatures(e) {var t = this.getRenderer();return t ? (t.outlineFeatures(e), this) : this;} }, { key: \"cancelOutline\", value: function cancelOutline() {var e = this.getRenderer();return e ? (e.cancelOutline(), this) : this;} }, { key: \"highlight\", value: function highlight(e) {this._validateHighlight(e);var t = this.getRenderer();return t ? (t.highlight(e), this) : (this._highlighted || (this._highlighted = []), this._highlighted.push(e), this);} }, { key: \"_validateHighlight\", value: function _validateHighlight(e) {if (Array.isArray(e)) for (var _t229 = 0; _t229 < e.length; _t229++) this._validateHighlight(e[_t229]);else {if (e.filter) {if (!this.options.features) throw new Error(\"options.features must be turned on to support filter in highlight\");if (!e.name) throw new Error(\"A name is required for highlight with filter\");}if (X(e.filter) && X(e.id)) throw new Error(\"id or filter must be provided for highlight\");}} }, { key: \"_resumeHighlights\", value: function _resumeHighlights() {if (this._highlighted) {for (var _e250 = 0; _e250 < this._highlighted.length; _e250++) this.highlight(this._highlighted[_e250]);delete this._highlighted;}} }, { key: \"cancelHighlight\", value: function cancelHighlight(e) {var t = this.getRenderer();return t ? (t.cancelHighlight(e), this) : this;} }, { key: \"cancelAllHighlight\", value: function cancelAllHighlight() {var e = this.getRenderer();return e ? (e.cancelAllHighlight(), this) : this;} }, { key: \"_parseStylePath\", value: function _parseStylePath() {e.Util.convertStylePath(this._vtStyle, this._replacer), e.Util.convertStylePath(this._featureStyle, this._replacer);} }, { key: \"updateSceneConfig\", value: function updateSceneConfig(e, t) {return B(e) && (e = this._getStyleIndex(e)), this._updateSceneConfig(0, e, t);} }, { key: \"updateFeatureSceneConfig\", value: function updateFeatureSceneConfig(e, t, n) {return this._updateSceneConfig(1, e, n, t);} }, { key: \"_updateSceneConfig\", value: function _updateSceneConfig(e, t, n, i) {var r = this._getTargetStyle(e);if (!r) return this;var s,o = t;if (r[t].renderPlugin.sceneConfig || (r[t].renderPlugin.sceneConfig = {}), U(r[t].renderPlugin.sceneConfig, n), void 0 !== i) {dt(this._originFeatureStyle, t, i), o = this._originFeatureStyle[t].style[i]._renderIdx;var _e251 = r[o].renderPlugin;_e251.sceneConfig || (_e251.sceneConfig = {}), s = _e251.sceneConfig;} else pt(r, t), s = r[t].renderPlugin.sceneConfig;if (U(s, n), Array.isArray(this.options.style)) {var _e252 = this.options.style[t].renderPlugin;_e252.sceneConfig || (_e252.sceneConfig = {}), U(_e252.sceneConfig, n);} else {var _r97 = this._getTargetStyle(e, this.options.style);var _s72;void 0 !== i ? (dt(_r97, t, i), _s72 = _r97[t].style[i].renderPlugin) : (pt(_r97, t), _s72 = _r97[t].renderPlugin), _s72.sceneConfig || (_s72.sceneConfig = {}), U(_s72.sceneConfig, n);}var a = this.getRenderer();return a && a.updateSceneConfig(e, o, n), 0 === e ? this.fire(\"updatesceneconfig\", { index: t, sceneConfig: n }) : 1 === e && this.fire(\"updatefeaturesceneconfig\", { index: t, styleIdx: i, sceneConfig: n }), this;} }, { key: \"updateDataConfig\", value: function updateDataConfig(e, t) {return B(e) && (e = this._getStyleIndex(e)), this._updateDataConfig(0, e, t);} }, { key: \"updateFeatureDataConfig\", value: function updateFeatureDataConfig(e, t, n) {return this._updateDataConfig(1, e, n, t);} }, { key: \"_updateDataConfig\", value: function _updateDataConfig(e, t, n, i) {var r = this._getTargetStyle(e);if (!r) return this;var s,o = t;void 0 !== i ? (dt(this._originFeatureStyle, t, i), o = this._originFeatureStyle[t].style[i]._renderIdx, s = r[o].renderPlugin.dataConfig) : (pt(r, t), s = r[t].renderPlugin.dataConfig);var a = U({}, s);if (U(s, n), Array.isArray(this.options.style)) U(this.options.style[t].renderPlugin.dataConfig, n);else {var _r98 = this._getTargetStyle(e, this.options.style);var _s73;void 0 !== i ? (dt(_r98, t, i), _s73 = _r98[t].style[i].renderPlugin) : (pt(_r98, t), _s73 = _r98[t].renderPlugin), _s73.dataConfig || (_s73.dataConfig = {}), U(_s73.dataConfig, n);}var l = this.getRenderer();return l && l.updateDataConfig(e, o, n, a), 0 === e ? this.fire(\"updatedataconfig\", { index: t, dataConfig: n }) : 1 === e && this.fire(\"updatefeaturedataconfig\", { index: t, styleIdx: i, dataConfig: n }), this;} }, { key: \"updateSymbol\", value: function updateSymbol(e, t) {return B(e) && (e = this._getStyleIndex(e)), this._updateSymbol(0, e, t);} }, { key: \"updateFeatureSymbol\", value: function updateFeatureSymbol(e, t, n) {return this._updateSymbol(1, e, n, t);} }, { key: \"_updateSymbol\", value: function _updateSymbol(t, n, i, r) {var s = this._getTargetStyle(t);if (!s) return this;var o = n;void 0 !== r && (dt(this._originFeatureStyle, n, r), o = this._originFeatureStyle[n].style[r]._renderIdx);var a = s[o];if (!a) throw new Error(\"No style defined at \".concat(n));var l = this,h = this._replacer;function c(i, s, o) {if (!i) return !1;h && (i = JSON.parse(JSON.stringify(i)), e.Util.parseSymbolPath(i, h));var a = Object.keys(i);var c = !1;for (var _e253 = 0; _e253 < a.length; _e253++) {var _t230 = a[_e253];if (ct(s[_t230]) || ct(i[_t230])) {c = !0;break;}}for (var _t231 in i) q(i, _t231) && (!e.Util.isObject(i[_t231]) || Array.isArray(i[_t231]) || (0, _functionType.isFunctionDefinition)(i[_t231]) ? s[_t231] = i[_t231] : (s[_t231] || (s[_t231] = {}), U(s[_t231], i[_t231])));var u = l.options.style;if (B(u)) return c;Array.isArray(u) || (u = l._getTargetStyle(t, l.options.style));var f = JSON.parse(JSON.stringify(s));return void 0 !== r ? (dt(u, n, r), void 0 === o ? u[n].style[r].symbol = f : u[n].style[r].symbol[o] = f) : (pt(u, n), void 0 === o ? u[n].symbol = f : u[n].symbol[o] = f), c;}var u = this.getRenderer();if (!u) return c(), this._compileStyle(), this;var f = !1;var d = a.symbol;if (Array.isArray(i)) for (var _e254 = 0; _e254 < i.length; _e254++) {var _t232 = c(i[_e254], d[_e254], _e254);_t232 && (f = _t232);} else c(i, d);return this._compileStyle(), f ? u.setStyle() : (f = u.updateSymbol(t, o, i), f && u.setStyle()), 0 === t ? this.fire(\"updatesymbol\", { index: n, symbol: i }) : 1 === t && this.fire(\"updatefeaturesymbol\", { index: n, featureStyleIndex: r, symbol: i }), this;} }, { key: \"_getTargetStyle\", value: function _getTargetStyle(e, t) {if (t) {return 0 === e ? t.style : t.featureStyle;}return 0 === e ? this._vtStyle : this._featureStyle;} }, { key: \"isDefaultRender\", value: function isDefaultRender() {return !!this._isDefaultRender && this.options.defaultRendering;} }, { key: \"validateStyle\", value: function validateStyle() {this._isDefaultRender = !1;var e = this._vtStyle;this.options.style || (this._isDefaultRender = !0, e = this._vtStyle = []), Array.isArray(e) || (e = this._vtStyle = [e]);for (var _t233 = 0; _t233 < e.length; _t233++) {var _n160 = e[_t233].filter;if (_n160 && _n160.value && (_n160 = _n160.value), _n160 || console.warn(\"render plugin at \".concat(_t233, \" doesn't define filter, its filter will be set to 'default' by default.\")), void 0 !== _n160 && \"default\" !== _n160 && !0 !== _n160 && !Array.isArray(_n160) && void 0 === _n160.condition) throw new Error(\"Invalid filter at \".concat(_t233, \" : \").concat(JSON.stringify(_n160)));}} }, { key: \"getStyle\", value: function getStyle() {return this.options.style ? JSON.parse(JSON.stringify(this.options.style)) : null;} }, { key: \"_getStyleIndex\", value: function _getStyleIndex(e) {var t = this._vtStyle;if (!t) return -1;for (var _n161 = 0; _n161 < t.length; _n161++) if (t[_n161].name === e) return _n161;throw new Error(\"No style defined with name: \".concat(e));} }, { key: \"getGroundConfig\", value: function getGroundConfig() {this._backgroundConfig || (this._backgroundConfig = { enable: !0, renderPlugin: { type: \"fill\", sceneConfig: {} }, symbol: { polygonFill: [0, 0, 0, 0], polygonOpacity: 1 } });var e = this._getComputedStyle().background || {};return this._backgroundConfig.enable = e.enable, this._backgroundConfig.symbol.polygonFill = e.color, this._backgroundConfig.symbol.polygonOpacity = e.opacity, this._backgroundConfig.symbol.polygonPatternFile = e.patternFile, this._backgroundConfig.renderPlugin.sceneConfig.depthRange = e.depthRange, this._backgroundConfig;} }, { key: \"getComputedStyle\", value: function getComputedStyle() {return JSON.parse(JSON.stringify(this._getComputedStyle()));} }, { key: \"_getComputedStyle\", value: function _getComputedStyle() {return { background: this._background, style: this._vtStyle || [], featureStyle: this._featureStyle || [] };} }, { key: \"identify\", value: function identify(t) {var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var i = this.getMap(),r = this.getRenderer();if (!i || !r) return [];var s = i.coordToContainerPoint(new e.Coordinate(t));return this.identifyAtPoint(s, n);} }, { key: \"identifyAtPoint\", value: function identifyAtPoint(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var n = this.getMap(),i = this.getRenderer();if (!n || !i) return [];var r = n.getDevicePixelRatio();var s = i.pick(e.x * r, e.y * r, t);return this.options.features && \"id\" !== this.options.features && (s = this._convertPickedFeature(s)), t && t.filter ? s.filter(function (e) {return t.filter(e);}) : s;} }, { key: \"_convertPickedFeature\", value: function _convertPickedFeature(e) {if (!this.getRenderer()) return e;var t = this._getTileConfig(),n = this.getSpatialReference();for (var _i122 = 0; _i122 < e.length; _i122++) {var _r99 = e[_i122];if (!_r99 || !_r99.data) continue;var _s74 = _r99.data.tile,_o59 = _s74.x,_a30 = _s74.y,_l29 = _s74.z,_h19 = _s74.extent,_c14 = n.getResolution(_l29),_u9 = t.getTilePointNW(_o59, _a30, _c14),_f10 = _r99.data.feature && _r99.data.feature.geometry;if (_f10) {_r99.data = U({}, _r99.data), _r99.data.feature = U({}, _r99.data.feature);var _e255 = _r99.data.feature.type;_r99.data.feature.type = \"Feature\", _r99.data.feature.geometry = this._convertGeometry(_e255, _f10, _u9, _h19, _c14);}}return e;} }, { key: \"_convertGeometry\", value: function _convertGeometry(e, t, n, i, r) {if (t.type && t.coordinates) return t;var s, o;if (1 === e) t.length <= 1 ? (s = \"Point\", o = this._convertGeometryCoords(t, n, i, r) || []) : (s = \"MultiPoint\", o = this._convertGeometryCoords(t, n, i, r));else if (2 === e) t.length <= 1 ? (s = \"LineString\", o = this._convertGeometryCoords(t, n, i, r) || []) : (s = \"MultiLineString\", o = this._convertGeometryCoords(t, n, i, r));else if (3 === e) {o = [];var _e256 = [],_a31 = 0;for (var _s75 = 0; _s75 < t.length; _s75++) {rt.calculateSignedArea(t[_s75]) > 0 && (_a31++, _e256 && _e256.length && o.push(_e256), _e256 = []), _e256.push(this._convertGeometryCoords(t[_s75], n, i, r));}_e256.length && o.push(_e256), _a31 <= 1 ? (s = \"Polygon\", o = o[0]) : s = \"MultiPolygon\";}return { type: s, coordinates: o };} }, { key: \"_convertGeometryCoords\", value: function _convertGeometryCoords(e, t, n, i) {var r = n / this.getTileSize().width,s = this.getMap(),o = function o(e) {var n = [];W(e) && (e = [e]);for (var _o60 = 0, _a32 = e.length; _o60 < _a32; _o60++) {var _a33 = e[_o60];st.x = t.x + _a33.x / r, st.y = t.y - _a33.y / r, s.pointAtResToCoord(st, i, ot), n.push(ot.toArray());}return 1 === e.length ? n[0] : n;};if (W(e)) return o(e);var a = e.length;if (1 === a) {return o(e[0]);}{var _t234 = [];for (var _n162 = 0; _n162 < a; _n162++) _t234.push(o(e[_n162]));return _t234;}} }, { key: \"getDataSchema\", value: function getDataSchema(e) {return this._schema || (this._schema = {}), X(e) || this._schema[e] || (this._schema[e] = {}), X(e) ? this._schema : this._schema[e];} }, { key: \"onRemove\", value: function onRemove() {_superPropGet(ht, \"onRemove\", this, 3)([]);} }, { key: \"_compileStyle\", value: function _compileStyle() {} }], [{ key: \"loadFrom\", value: function loadFrom(e, t) {return fetch(e, t || {}).then(function (e) {return e.json();}).then(function (e) {return ht.fromJSON(e);});} }, { key: \"fromJSON\", value: function fromJSON(e) {return e && \"VectorTileLayer\" === e.type ? new ht(e.id, e.options) : null;} }, { key: \"registerPlugin\", value: function registerPlugin(e) {ht.plugins || (ht.plugins = {}), ht.plugins[e.type] = e;} }, { key: \"getPlugins\", value: function getPlugins() {return ht.plugins || {};} }, { key: \"compressStyleJSON\", value: function compressStyleJSON(e) {return Array.isArray(e) && e.length ? function (e) {Array.isArray(e) && (e = { style: e, featureStyle: [] });var t = [],n = [],i = [];J(e.style, t, i), J(e.featureStyle, n, i);var r = { plugins: i, styles: { style: t, featureStyle: n } };return e.$root && (r.$root = e.$root), r;}(e) : e;} }]);}(e.TileLayer);function ct(e) {return !(!e || !e.properties);}function ut(e) {return e ? (Array.isArray(e) || (e = (0, _color.default)(e).unitArray()), 3 === e.length && e.push(1), e) : null;}function ft(e, t) {return null == e ? t : e;}function dt(e, t, n) {if (!e[t] || !e[t].style || !e[t].style[n]) throw new Error(\"No plugin defined at feature style of \".concat(t, \" - \").concat(n));}function pt(e, t) {if (!e[t]) throw new Error(\"No plugin defined at style of \".concat(t));}ht.prototype._getTileZoom = function (t) {return t = Math.floor(t), e.TileLayer.prototype._getTileZoom.call(this, t);}, ht.registerJSONType(\"VectorTileLayer\"), ht.mergeOptions({ urlTemplate: null, renderer: \"gl\", altitudeProperty: \"altitude\", forceRenderOnZooming: !0, forceRenderOnMoving: !0, forceRenderOnRotating: !0, tileSize: [512, 512], features: !1, schema: !1, cascadeTiles: !0, collision: !0, collisionBuffserSize: 0, picking: !0, pickingPoint: !0, pickingGeometry: !1, glyphSdfLimitPerFrame: 15, tileLimitPerFrame: 1, loadingLimitOnInteracting: 5, loadingLimit: 0, antialias: !1, iconErrorUrl: null, collisionFrameLimit: 1.5, defaultRendering: !0, textGamma: 1, maxIconSize: 254, workarounds: { \"win-intel-gpu-crash\": !1 }, pyramidMode: 1, styleScale: 1, enableAltitude: !0, fadeAnimation: !1, debugTileData: !1, fetchOptions: null, awareOfTerrain: !0, altitudeQueryTimeLimitPerFrame: 3, workerGlyph: !0, featureIdProperty: null, currentTilesFirst: !0, tileStackStartDepth: 3, tileStackDepth: 2, altitudePropertyName: null, disableAltitudeWarning: !1 }), ht.registerRenderer(\"gl\", $e), ht.registerRenderer(\"canvas\", null);var gt = new e.Size(1, 1);var mt = exports.Vector3DLayer = function (_e$OverlayLayer) {function mt() {_classCallCheck(this, mt);return _callSuper(this, mt, arguments);}_inherits(mt, _e$OverlayLayer);return _createClass(mt, [{ key: \"setURLModifier\", value: function setURLModifier(e) {return this._urlModifier = e, this;} }, { key: \"getURLModifier\", value: function getURLModifier() {return this._urlModifier;} }, { key: \"getEvents\", value: function getEvents() {var e;return e = _superPropGet(mt, \"getEvents\", this, 1) ? _superPropGet(mt, \"getEvents\", this, 3)([]) : {}, e.spatialreferencechange = this._onSpatialReferenceChange, e;} }, { key: \"onConfig\", value: function onConfig(e) {if (_superPropGet(mt, \"onConfig\", this, 3)([e]), void 0 !== e.enableBloom) {var _t235 = this.getRenderer();_t235 && _t235.updateBloom(e.enableBloom);}} }, { key: \"updateSymbol\", value: function updateSymbol(e, t) {if (!this.options.style) throw new Error(\"can't call update symbol when style is not set\");var n = Array.isArray(this.options.style) ? this.options.style : this.options.style.style;if (!n[e]) throw new Error(\"invalid style at \".concat(e));return U(n[e].symbol, t), this.setStyle(this.options.style), this;} }, { key: \"getPolygonOffsetCount\", value: function getPolygonOffsetCount() {return this.isEmpty() || this.options.altitude ? 0 : 1;} }, { key: \"getPolygonOffset\", value: function getPolygonOffset() {return this.options.altitude ? 0 : this._polygonOffset || 0;} }, { key: \"setPolygonOffset\", value: function setPolygonOffset(e, t) {return this._polygonOffset = e, this._totalPolygonOffset = t, this;} }, { key: \"getTotalPolygonOffset\", value: function getTotalPolygonOffset() {return this._totalPolygonOffset;} }, { key: \"identify\", value: function identify(t) {var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var i = this.getMap(),r = this.getRenderer();if (!i || !r) return [];var s = i.coordToContainerPoint(new e.Coordinate(t));return this.identifyAtPoint(s, n);} }, { key: \"identifyAtPoint\", value: function identifyAtPoint(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var n = this.getMap(),i = this.getRenderer();if (!n || !i) return [];var r = this.getMap().getDevicePixelRatio(),s = i.pick(e.x * r, e.y * r, t);return t && t.filter ? s.filter(function (e) {return t.filter(e);}) : s;} }, { key: \"getComputedStyle\", value: function getComputedStyle() {return { style: this.getStyle() || [] };} }, { key: \"outlineAll\", value: function outlineAll() {var e = this.getRenderer();return e ? (e.outlineAll(), this) : this;} }, { key: \"outline\", value: function outline(e) {if (!Array.isArray(e) || !e.length) return this;var t = this.getRenderer();return t ? (t.outline(e), this) : this;} }, { key: \"cancelOutline\", value: function cancelOutline() {var e = this.getRenderer();return e ? (e.cancelOutline(), this) : this;} }, { key: \"toJSON\", value: function toJSON() {var e = { type: this.getJSONType(), id: this.getId(), options: this.config(), geometries: [] },t = this.getGeometries();for (var _n163 = 0, _i123 = t.length; _n163 < _i123; _n163++) {var _i124 = t[_n163].toJSON();e.geometries.push(_i124);}return e;} }, { key: \"getTileSize\", value: function getTileSize() {return gt;} }, { key: \"_onSpatialReferenceChange\", value: function _onSpatialReferenceChange() {var e = this.getRenderer();e && e._onSpatialReferenceChange();} }], [{ key: \"registerPainter\", value: function registerPainter(e, t) {mt.painters || (mt.painters = {}), mt.painters[e] = t;} }, { key: \"get3DPainterClass\", value: function get3DPainterClass(e) {return mt.painters[e];} }]);}(e.OverlayLayer);mt.mergeOptions({ picking: !0, pickingPoint: !0, renderer: \"gl\", collision: !1, collisionBufferSize: 0, textGamma: 1, geometryEvents: !0, styleScale: 1, forceRenderOnZooming: !0, forceRenderOnMoving: !0, forceRenderOnRotating: !0, meshRenderOrder: 0, enableBloom: !1, enableAltitude: !0, workarounds: { \"win-intel-gpu-crash\": !0 } });var yt = { redraw: !1, retire: !1 },xt = [];var _t = 1;function vt(e, t) {var n = _vtPlugin.default.extend(e, { init: function init() {this._meshCache = {};}, isVisible: function isVisible() {return this.painter && this.painter.isVisible();}, supportRenderMode: function supportRenderMode(e) {return this.painter.supportRenderMode(e);}, hasMesh: function hasMesh() {return this.painter && this.painter.hasMesh();}, startFrame: function startFrame(e) {var n = e.layer,i = e.regl,r = e.sceneConfig,s = e.dataConfig,o = e.symbol;var a = this.painter;if (!a) {var _l30 = e.pluginIndex;a = this.painter = new t(i, n, o, r, _l30, s);}this._meshCache || (this._meshCache = {});var l = r.excludes;this._excludes ? l !== this._excludes && (this._excludesFunc = l ? (0, _featureFilter.createFilter)(l) : null, this._excludes = l) : l && (this._excludes = l), a.startFrame(e), this._frameCache = {};}, updateCollision: function updateCollision(e) {var t = this.painter;return t && t.isVisible() ? t.updateCollision(e) : null;}, prepareRender: function prepareRender(e) {var t = this.painter;return t && t.isVisible() ? t.prepareRender(e) : null;}, endFrame: function endFrame(e) {var t = this.painter;return t && t.isVisible() ? t.render(e) : null;}, getShadowMeshes: function getShadowMeshes() {var e = this.painter;return e && e.getShadowMeshes && e.getShadowMeshes() || xt;}, createTile: function createTile(e) {var t = e.tileCache,n = e.tileData;var i = !1;var r = this.painter;if (!r) return { retire: i };var s = this._getMeshKey(e);var o = t.geometry;if (!o) {var _s76 = n.features,_a34 = n.data;if (!_a34 || !_a34.length) return { retire: i };var _l31 = _a34;if (this.painter.colorSymbol && !function (e) {if (!e) return !0;for (var _t236 in e) return !1;return !0;}(_s76)) for (var _e257 = 0; _e257 < _a34.length; _e257++) {var _t237 = this._generateColorArray(_s76, _a34[_e257].data.aPickingId, _a34[_e257].indices, _a34[_e257].data.aPosition, _a34[_e257].positionSize);_a34[_e257].data.aColor = _t237;}o = t.geometry = r.createGeometries(_l31, _s76);for (var _t238 = 0; _t238 < o.length; _t238++) o[_t238] && o[_t238].geometry && (i = !0, o[_t238].geometry.properties.features = _s76, this._fillCommonProps(o[_t238].geometry, e));}var a = this._getMesh(s);if (!a) {var _this$_createMeshes = this._createMeshes(o, e),_t239 = _this$_createMeshes.meshes,_n164 = _this$_createMeshes.retire;i || (i = _n164), a = _t239;}return { retire: i };}, _createMeshes: function _createMeshes(e, t) {var n = t.tileInfo,i = t.tileExtent,r = t.tileTransform,s = t.tileTranslationMatrix,o = t.tileVectorTransform,a = t.tileZoom,l = t.sceneConfig;var h = !1;var c = this.painter,u = [n.extent2d.xmin, n.extent2d.ymax],f = c.createMeshes(e, r, { tileExtent: i, tilePoint: u, tileZoom: a, tileTranslationMatrix: s, tileVectorTransform: o }, t);if (f.length) {for (var _e258 = 0; _e258 < f.length; _e258++) f[_e258] && (h = !0, this._fillMeshProps(f[_e258], r, t.timestamp, _t++, c.isEnableTileStencil()));l.animation && (f._animationTime = t.timestamp);var _e259 = this._getMeshKey(t);this._meshCache[_e259] = f;}return { meshes: f, retire: h };}, paintTile: function paintTile(e) {var t = e.tileCache,n = e.tileInfo,i = e.tileZoom,r = e.sceneConfig,s = this.painter;if (!s) return yt;var o = t.geometry;if (!o) return yt;var a = !1;var l = this._getMeshKey(e);var h = this._getMesh(l);if (!h) {var _this$_createMeshes2 = this._createMeshes(o, e),_t240 = _this$_createMeshes2.meshes,_n165 = _this$_createMeshes2.retire;a || (a = _n165), h = _t240;}if (!h.length) return yt;var c = s.getTileLevelValue(n, i);h.forEach(function (e) {e.properties.tile = n, e.properties.level = c;});var u = !1;if (!this._frameCache[l]) {var _t241 = null,_n166 = r.animation;if (_n166) {var _i125 = e.sceneConfig.animationDuration || 800,_r100 = (e.timestamp - h._animationTime) / _i125,_s77 = h[0].properties.createTime;h._animationTime - _s77 < _i125 && _r100 < 1 && (!0 !== _n166 && 1 !== _n166 || (_n166 = \"linear\"), _t241 = \"linear\" === _n166 ? _r100 : (0, _animationEasings.default)(_n166, _r100), u = !0);}s.addMesh(h, _t241, e), this._frameCache[l] = 1;}return { redraw: u, retire: a };}, _fillMeshProps: function _fillMeshProps(e, t, n, i, r) {if (e.properties.tileTransform = t, e.properties.createTime = n, e.properties.meshKey = i, e.needUpdateShadow = !0, r) {var _t242 = e.defines || {};_t242.ENABLE_TILE_STENCIL = 1, e.setDefines(_t242);}\"stencilRef\" in e.uniforms || Object.defineProperty(e.uniforms, \"stencilRef\", { enumerable: !0, get: function get() {return e.properties.tile && void 0 !== e.properties.tile.stencilRef ? e.properties.tile.stencilRef : e.properties.level;} });}, _fillCommonProps: function _fillCommonProps(e, t) {var n = t.layer,i = t.tileInfo,r = n.getMap(),s = (n.getSpatialReference ? n.getSpatialReference() : r.getSpatialReference()).getResolution(i.z),o = t.tileExtent / n.getTileSize().width;e.properties.tileResolution = s, e.properties.tileRatio = o, e.properties.z = i.z, e.properties.tileExtent = t.tileExtent;}, updateSceneConfig: function updateSceneConfig(e) {var t = this.painter;t && t.updateSceneConfig(e.sceneConfig);}, updateDataConfig: function updateDataConfig(e, t) {var n = this.painter;return !n || n.updateDataConfig(e, t);}, updateSymbol: function updateSymbol(e, t) {var n = this.painter;if (!n) return !1;if (n.shouldDeleteMeshOnUpdateSymbol(e)) {if (this._meshCache) for (var _e260 in this._meshCache) n.deleteMesh(this._meshCache[_e260], !0);delete this._meshCache, delete this._frameCache;}return n.updateSymbol(e, t);}, pick: function pick(e, t, n) {return this.painter && this.painter.pick ? this.painter.pick(e, t, n) : null;}, deleteTile: function deleteTile(e) {if (!this._meshCache) return;var t = this._getMeshKey(e),n = this._meshCache[t];n && this.painter && this.painter.deleteMesh(n), delete this._meshCache[t], this._frameCache && delete this._frameCache[t];}, remove: function remove() {var e = this.painter;if (e && this._meshCache) {for (var _t243 in this._meshCache) e.deleteMesh(this._meshCache[_t243]);e.delete(), delete this.painter;}delete this._meshCache, delete this._frameCache;}, resize: function resize(e, t) {var n = this.painter;n && n.resize(e, t);}, needToRedraw: function needToRedraw() {return !!this.painter && this.painter.needToRedraw();}, needToRetireFrames: function needToRetireFrames() {return !!this.painter && this.painter.needToRetireFrames();}, isAnimating: function isAnimating() {return !!this.painter && this.painter.isAnimating();}, needToRefreshTerrainTileOnZooming: function needToRefreshTerrainTileOnZooming() {return !!this.painter && this.painter.needToRefreshTerrainTileOnZooming();}, isTerrainSkin: function isTerrainSkin() {return !!this.painter && this.painter.isTerrainSkin();}, isTerrainVector: function isTerrainVector() {return !!this.painter && this.painter.isTerrainVector();}, _generateColorArray: function _generateColorArray(e, t, n, i) {var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 3;if (!i || !e || !t.length) return null;var s = new Uint8Array(i.length / r * 4);var o, a;var l = this.painter.colorSymbol,h = {};var c;for (var _n167 = 0, _i126 = t.length; _n167 < _i126; _n167++) {var _i127 = t[_n167];if (o = e[_i127].symbol, a = h[_i127], !a) if (l) {var _t244 = void 0;_t244 = \"function\" == typeof l ? l(e[_i127].feature && e[_i127].feature.properties) : l, _t244 = (0, _color.default)(_t244), a = h[_i127] = _t244.array();} else a = h[_i127] = [255, 255, 255];c = 4 * _n167, s[c] = a[0], s[c + 1] = a[1], s[c + 2] = a[2], s[c + 3] = 255 * (o[this.painter.opacitySymbol] || 1);}return s;}, _getMeshKey: function _getMeshKey(e) {var t = e.tileInfo;return t.meshKey || (t.meshKey = _t++), t.meshKey;}, _getMesh: function _getMesh(e) {return this._meshCache[e];}, _filterElements: function _filterElements(e, t) {var _this38 = this;if (Array.isArray(e)) e.forEach(function (e, n) {var i = e.properties.features;_this38._filterGeoElements(e, t[n], i);});else {var _n168 = e.properties.features;this._filterGeoElements(e, Array.isArray(t) ? t[0] : t, _n168);}}, _filterGeoElements: function _filterGeoElements(e, t, n) {var i = t.featureIndexes || t.data.featureIndexes;if (i) if (this._excludesFunc) {var _r101 = t.indices;var _s78 = null,_o61 = !1;var _a35 = [];for (var _e261 = 0; _e261 < _r101.length; _e261++) {var _t245 = n[i[_r101[_e261]]];null !== _s78 && _s78 === _r101[_e261] || (_o61 = this._excludesFunc(_t245.feature), _s78 = _r101[_e261]), _o61 || _a35.push(_r101[_e261]);}e.setElements(new t.indices.constructor(_a35));} else e.setElements(t.indices);}, outline: function outline(e, t) {var n = this.painter;n && n.outline(e, t);}, outlineAll: function outlineAll(e) {var t = this.painter;t && t.outlineAll(e);}, needPolygonOffset: function needPolygonOffset() {var e = this.painter;return e && e.needPolygonOffset();}, highlight: function highlight(e) {var t = this.painter,n = this.style.name,i = this.renderIndex;if (e) {var _t246 = [];if (e.forEach(function (e, r) {void 0 !== e.plugin && null !== e.plugin && (Array.isArray(e.plugin) ? e.plugin.length && e.plugin.indexOf(n) < 0 && e.plugin.indexOf(i) < 0 && _t246.push(r) : e.plugin !== n && e.plugin !== i && _t246.push(r));}), _t246.length) {var _n169 = new Map(e);for (var _e262 = 0; _e262 < _t246.length; _e262++) _n169.delete(_t246[_e262]);e = _n169;}}return t && t.highlight(e);}, cancelAllHighlight: function cancelAllHighlight() {var e = this.painter;return e && e.cancelAllHighlight();} });return n;}function bt(e) {return !e || (void 0 !== e.empty || (e.empty = function (e) {for (var _t247 in e) return !1;return !0;}(e)), e.empty);}var _H4 = H(),At = _H4.StyleUtil,Tt = \"_fn_type_\",wt = \"__current_fn_types\";function St(e, t, n, i) {if (!bt(e.properties.features)) for (var _r102 = 0; _r102 < n.length; _r102++) {var _s79 = n[_r102].symbolName;(e[wt] = e[wt] || {})[_s79] = t[_s79], Mt(e, t, n[_r102], i);}}function Mt(e, t, n, i) {var r = function (e) {var t = e.properties;var n = t.aPickingId;n || (n = t.aPickingId = new e.data.aPickingId.constructor(e.data.aPickingId));return n;}(e),s = n.attrName,o = n.symbolName,a = n.related;var l = e.data[s];return l ? Lt(t[o]) || function (e, t) {if (!Array.isArray(e)) return !1;for (var _n170 = 0; _n170 < e.length; _n170++) if (Lt(t[e[_n170]])) return !0;return !1;}(a, t) ? (Lt(t[o]) && Pt(e, t, n), l) : (void 0 === n.index && (e.deleteData(s), It(e, s)), null) : Lt(t[o]) && function (e, t) {if (e.startsWith(\"marker\") && !t.properties.iconAtlas) return !1;if (e.startsWith(\"text\") && !t.properties.glyphAtlas) return !1;return !0;}(o, e) ? (l = e.data[s] = new n.type(n.width * r.length), function (e, t, n, i, r) {var s = i.attrName,o = (Tt + s + \"Index\").trim();Pt(t, n, i);var a = t.properties[o];Rt(t, a, i, r);}(l, e, t, n, i), l) : null;}function Pt(e, t, n) {var i = n.attrName,r = n.symbolName,s = e.properties,o = (Tt + i + \"Index\").trim(),a = (Tt + i).trim();if (s[o] && s[a]) return;var l = function (e) {if (!e) return Ot;var t = [];for (var _n171 = 0; _n171 < e.length; _n171++) (0, _functionType.isFunctionDefinition)(e[_n171][1]) && !(0, _functionType.interpolated)(e[_n171][1]).isZoomConstant && t.push(e[_n171][0]);return t;}(t[r].stops),h = \"identity\" === t[r].type && At.checkIfIdentityZoomDependent(r, t[r].property, s.features);if (!h && !l.length) return void (void 0 === n.index && It(e, i));var c = s.features,u = s.aPickingId,f = function (e, t, n, i, r) {var s = [];var o = 0,a = t[0];for (var _l32 = 1, _h20 = t.length; _l32 < _h20; _l32++) !e[a] || t[_l32] === a && _l32 !== _h20 - 1 || ((r || Ft(e[a].feature, n, i)) && s.push(o, _l32 === _h20 - 1 ? _h20 : _l32), a = t[_l32], o = _l32);return s;}(c, u, t[r].property, l, h);if (!f.length) return void (void 0 === n.index && It(e, i));if (s[o] = f, s[a]) return;var d = e.data[i];s[a] = d.BYTES_PER_ELEMENT ? new d.constructor(d) : new n.type(d.length);}function It(e, t) {var n = e.properties,i = (Tt + t + \"Index\").trim(),r = (Tt + t).trim();delete n[i], delete n[r];}function Ct(e, t, n, i, r, s) {if (!r) return;var o = r.geometry;if (!o) return;if (!bt(o.properties.features)) {for (var _a36 = 0; _a36 < i.length; _a36++) {var _l33 = i[_a36],_h21 = _l33.attrName;if (!(kt(o, n, _l33) || t._isFeatureStateDirty && t._isFeatureStateDirty(r.geometry._featureTimestamp))) {var _e263 = o.properties.aPickingId;if (!_e263 || o._fnDataZoom === s) continue;var _n172 = (Tt + _h21 + \"Index\").trim(),_i128 = o.properties[_n172];if (!_i128) continue;Rt(o, _i128, _l33, t);continue;}var _c15 = Mt(o, n, _l33, t),_u10 = _l33.define;if (_c15) {var _n173 = (Tt + _h21 + \"Index\").trim();if (Rt(o, o.properties[_n173], _l33, t), t._getFeatureStateStamp && (o._featureTimestamp = t._getFeatureStateStamp()), _u10) {var _e264 = r.defines;_e264[_u10] = 1, r.setDefines(_e264);}o.generateBuffers(e);} else if (_u10) {var _e265 = r.defines;_e265[_u10] && (delete _e265[_u10], r.setDefines(_e265));}}o._fnDataZoom = s;}}function kt(e, t, n) {var i = t[n.symbolName],r = e[wt];return !(0, _fastDeepEqual.default)(i, r[n.symbolName]) && (r[n.symbolName] = i, !0);}function Ft(e, t, n) {for (var _i129 = 0; _i129 < n.length; _i129++) if (\"$\" === t[0] && e[t.substring(1)] === n[_i129] || e.properties[t] === n[_i129]) return !0;return !1;}var Ot = [];function Rt(e, t, n, i) {var r = n.attrName,s = n.evaluate,o = n.index,a = n.width,_e$properties = e.properties,l = _e$properties.aPickingId,h = _e$properties.features;var c;if (t) {var _n174 = (Tt + r).trim();c = e.properties[_n174];var _u11 = a,_f11 = t.length;for (var _n175 = 0; _n175 < _f11; _n175 += 2) {var _r103 = t[_n175],_a37 = t[_n175 + 1];var _f12 = h[l[_r103]];_f12 && _f12.feature && Dt(c, _f12, s, _r103, _a37, _u11, o, e, i);}} else {if (c = e.data[r], function (e) {return Array.isArray(e) || e.constructor === Float32Array || e.constructor === Float64Array || e.constructor === Uint8Array || e.constructor === Int8Array || e.constructor === Uint16Array || e.constructor === Int16Array || e.constructor === Uint32Array || e.constructor === Int32Array || e.constructor === Uint8ClampedArray;}(c)) c.dirty = !0;else {var _t248 = (Tt + r).trim();c = e.properties[_t248], c || (c = e.properties[_t248] = new n.type(n.width * l.length), c.dirty = !0);}var _t249 = c.length / l.length,_a38 = l.length;var _u12 = 0;for (var _n176 = 0; _n176 < _a38; _n176++) {if (l[_n176] === l[_u12] && _n176 < _a38 - 1) continue;var _r104 = h[l[_u12]];_r104 && _r104.feature && (Dt(c, _r104, s, _u12, _n176 === _a38 - 1 ? _a38 : _n176, _t249, o, e, i), _u12 = _n176);}}c.dirty && (e.updateData(r, c), c.dirty = !1);}var Et = {};function Dt(e, t, n, i, r, s, o, a, l) {var h = (t = t.feature).properties || {};if (void 0 === h.$layer && (t.properties || (t.properties = h), h.$layer = t.layer, h.$type = t.type), l.getFeatureState && (Et.layer = t.layer, Et.id = t.id, t[be] && (t[be] = null), !Ie(t.id))) {var _e266 = l.getFeatureState(Et);t.properties[be] = _e266;}var c = n(h, a, e, i * s);if (Array.isArray(c)) {var _t250 = !1;for (var _n177 = 0; _n177 < s; _n177++) if (e[i * s + _n177] !== c[_n177]) {_t250 = !0;break;}if (_t250) {for (var _t251 = i * s; _t251 < r * s; _t251 += s) e.set(c, _t251);e.dirty = !0;}} else if (s > 1) for (var _t252 = i * s; _t252 < r * s; _t252 += s) e[_t252 + o] !== c && (e[_t252 + o] = c, e.dirty = !0);else e[i] !== c && (De(e, c, i, r), e.dirty = !0);}function Lt(e) {return At.isFnTypeSymbol(e);}function Ht(e) {return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;}var Nt = zt;function zt(e, t) {this.x = e, this.y = t;}zt.prototype = { clone: function clone() {return new zt(this.x, this.y);}, add: function add(e) {return this.clone()._add(e);}, sub: function sub(e) {return this.clone()._sub(e);}, multByPoint: function multByPoint(e) {return this.clone()._multByPoint(e);}, divByPoint: function divByPoint(e) {return this.clone()._divByPoint(e);}, mult: function mult(e) {return this.clone()._mult(e);}, div: function div(e) {return this.clone()._div(e);}, rotate: function rotate(e) {return this.clone()._rotate(e);}, rotateAround: function rotateAround(e, t) {return this.clone()._rotateAround(e, t);}, matMult: function matMult(e) {return this.clone()._matMult(e);}, unit: function unit() {return this.clone()._unit();}, perp: function perp() {return this.clone()._perp();}, round: function round() {return this.clone()._round();}, mag: function mag() {return Math.sqrt(this.x * this.x + this.y * this.y);}, equals: function equals(e) {return this.x === e.x && this.y === e.y;}, dist: function dist(e) {return Math.sqrt(this.distSqr(e));}, distSqr: function distSqr(e) {var t = e.x - this.x,n = e.y - this.y;return t * t + n * n;}, angle: function angle() {return Math.atan2(this.y, this.x);}, angleTo: function angleTo(e) {return Math.atan2(this.y - e.y, this.x - e.x);}, angleWith: function angleWith(e) {return this.angleWithSep(e.x, e.y);}, angleWithSep: function angleWithSep(e, t) {return Math.atan2(this.x * t - this.y * e, this.x * e + this.y * t);}, _matMult: function _matMult(e) {var t = e[0] * this.x + e[1] * this.y,n = e[2] * this.x + e[3] * this.y;return this.x = t, this.y = n, this;}, _add: function _add(e) {return this.x += e.x, this.y += e.y, this;}, _sub: function _sub(e) {return this.x -= e.x, this.y -= e.y, this;}, _mult: function _mult(e) {return this.x *= e, this.y *= e, this;}, _div: function _div(e) {return this.x /= e, this.y /= e, this;}, _multByPoint: function _multByPoint(e) {return this.x *= e.x, this.y *= e.y, this;}, _divByPoint: function _divByPoint(e) {return this.x /= e.x, this.y /= e.y, this;}, _unit: function _unit() {return this._div(this.mag()), this;}, _perp: function _perp() {var e = this.y;return this.y = this.x, this.x = -e, this;}, _rotate: function _rotate(e) {var t = Math.cos(e),n = Math.sin(e),i = t * this.x - n * this.y,r = n * this.x + t * this.y;return this.x = i, this.y = r, this;}, _rotateAround: function _rotateAround(e, t) {var n = Math.cos(e),i = Math.sin(e),r = t.x + n * (this.x - t.x) - i * (this.y - t.y),s = t.y + i * (this.x - t.x) + n * (this.y - t.y);return this.x = r, this.y = s, this;}, _round: function _round() {return this.x = Math.round(this.x), this.y = Math.round(this.y), this;} }, zt.convert = function (e) {return e instanceof zt ? e : Array.isArray(e) ? new zt(e[0], e[1]) : e;};var Vt = Ht(Nt);var Ut = [];function Bt(e, t, n, i, r) {return _gl.vec4.set(Ut, t[0], t[1], t[2], 1), _gl.vec4.transformMat4(Ut, Ut, n), e[2] = Ut[3], _gl.vec4.scale(Ut, Ut, 1 / Ut[3]), e[0] = (Ut[0] + 1) * i / 2, e[1] = (1 - Ut[1]) * r / 2, e;}var Gt = [],jt = [],Wt = [];var Xt = [-99999, -99999],Yt = new e.Point(0, 0),Zt = [];function qt(e, t, n, i, r, s, a, l) {var _n$properties$tile = n.properties.tile,h = _n$properties$tile.res,c = _n$properties$tile.extent,u = _n$properties$tile.extent2d,f = u.xmin,d = u.ymax,p = f + i.x * r,g = d - i.y * r;var m = null;if (l) for (var _e267 = 0; _e267 < l.length; _e267++) if ($t(l[_e267], p, g, h)) {m = l[_e267];break;}if (!m) return Xt;var y = Yt.set(f, d),x = s.queryTilePointTerrain(i, m, y, c, h),_ = null === x[0] ? me : x[0];if (_) {var _n178 = _gl.vec3.set(Zt, i.x, i.y, 0);return _n178[2] += 100 * _, _n178 = Bt(e, _n178, a, t.width, t.height), _n178;}return e[0] = i.x, e[1] = i.y, e;}function $t(e, t, n, i) {var r = Yt.set(t, n)._multi(i / e.res);return e.extent2d.contains(r);}var _H5 = H(),Jt = _H5.SYMBOLS_NEED_REBUILD_IN_VT,Kt = _H5.StyleUtil,Qt = _H5.FuncTypeUtil,_s$pbr$PBRUtils = _gl.reshader.pbr.PBRUtils,en = _s$pbr$PBRUtils.loginIBLResOnCanvas,tn = _s$pbr$PBRUtils.logoutIBLResOnCanvas,nn = _s$pbr$PBRUtils.getIBLResOnCanvas,rn = \"__gl_textures\",sn = [],on = new e.Point(0, 0),an = new e.Point(0, 0),ln = new Float32Array(1),hn = [],cn = function cn(e) {return 0 === e.properties.level;},un = function un(e) {return e.properties.level > 0;};var fn = function () {function fn(e, t, n, i, r, o) {var _this39 = this;_classCallCheck(this, fn);this._is2D = !0, this.regl = e, this.layer = t, this.canvas = e._gl.canvas, this.sceneConfig = i || {}, this.dataConfig = o || {}, this.pluginIndex = r, this.scene = new _gl.reshader.Scene(), this.pickingFBO = t.getRenderer().pickingFBO, this.level0Filter = cn, this.levelNFilter = un, this.loginTextureCache(), this.symbolDef = Array.isArray(n) ? n.map(function (e) {return Ce(e);}) : [Ce(n)], this._compileSymbols(), this.pickingViewport = { x: 0, y: 0, width: function width() {return _this39.canvas ? _this39.canvas.width : 1;}, height: function height() {return _this39.canvas ? _this39.canvas.height : 1;} }, this.sortByCommandKey = dn.bind(this), this.colorCache = {}, this._invisibleWhenCreated = this.symbolDef.map(function (e) {return !(!e || !1 !== e.visible);});}return _createClass(fn, [{ key: \"hasMesh\", value: function hasMesh() {var e = this.scene && this.scene.getMeshes();return this.isVisible() && e && !!e.length;} }, { key: \"getMap\", value: function getMap() {return this.layer ? this.layer.getMap() : null;} }, { key: \"getTileLevelValue\", value: function getTileLevelValue(e, t) {var n = this.layer.getRenderer();return n.getTileLevelValue && n.getTileLevelValue(e, t) || 0;} }, { key: \"getAnalysisMeshes\", value: function getAnalysisMeshes() {return this.getShadowMeshes ? this.getShadowMeshes() : hn;} }, { key: \"isVisible\", value: function isVisible() {var _this$sceneConfig = this.sceneConfig,e = _this$sceneConfig.minZoom,t = _this$sceneConfig.maxZoom,n = this.getMap().getZoom();if (!Ie(e) && n < e) return !1;if (!Ie(t) && n > t) return !1;var i = this._visibleFn;if (i.length) for (var _e268 = 0; _e268 < i.length; _e268++) if (i[_e268] && !i[_e268].isFeatureConstant) return !0;var r = this.getSymbols();for (var _e269 = 0; _e269 < r.length; _e269++) {var _t253 = r[_e269].visible;if (!1 !== _t253 && 0 !== _t253) return !0;}return !1;} }, { key: \"isMeshVisible\", value: function isMeshVisible(e) {var t = e && e.properties && e.properties.symbolIndex;if (!t) return !1;var n = this._visibleFn,i = t.index;var r;if (n[i]) {if (!n[i].isFeatureConstant) return !0;r = n[i](this.getMap().getZoom());} else r = this.getSymbol(t).visible;return !1 !== r && 0 !== r;} }, { key: \"isAnimating\", value: function isAnimating() {return !1;} }, { key: \"needToRedraw\", value: function needToRedraw() {return this.isAnimating() || this._redraw;} }, { key: \"needToRetireFrames\", value: function needToRetireFrames() {return this._needRetire;} }, { key: \"needToRefreshTerrainTileOnZooming\", value: function needToRefreshTerrainTileOnZooming() {return !0;} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {return this.layer.options.awareOfTerrain;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {return !1;} }, { key: \"isShadowIncludeChanged\", value: function isShadowIncludeChanged(e) {var t = e && e.isRenderingTerrain && this.isTerrainSkin();return e && e.states && e.states.includesChanged.shadow || t && this._includeKeys;} }, { key: \"fillIncludes\", value: function fillIncludes(e, t, n) {if (delete this._includeKeys, n && n.isRenderingTerrain && this.isTerrainSkin()) return;var i = n && n.includes;if (i) {var _r105 = \"\";for (var _s80 in i) i[_s80] && (_r105 += _s80, n[_s80].uniformDeclares && t.push.apply(t, _toConsumableArray(n[_s80].uniformDeclares)), n[_s80].defines && Se(e, n[_s80].defines));this._includeKeys = _r105;}} }, { key: \"setIncludeUniformValues\", value: function setIncludeUniformValues(e, t) {if (t && t.isRenderingTerrain && this.isTerrainSkin()) return;var n = t && t.includes;if (n) for (var _i130 in n) n[_i130] && t[_i130].renderUniforms && Se(e, t[_i130].renderUniforms);} }, { key: \"createGeometries\", value: function createGeometries(e, t) {if (!e.length) return hn;var n = [];for (var _i131 = 0; _i131 < e.length; _i131++) if (e[_i131]) if (void 0 !== e[_i131].ref) n[e[_i131].ref] ? n.push({ geometry: n[e[_i131].ref].geometry, symbolIndex: e[_i131].symbolIndex, ref: e[_i131].ref }) : n.push(null);else {e[_i131] && !e[_i131].is2D && (this._is2D = !1);var _r106 = this.createGeometry(e[_i131], t, _i131);if (_r106 && _r106.geometry) {var _s81 = _r106.geometry.properties,_this$_getIdMap = this._getIdMap(e[_i131]),_o62 = _this$_getIdMap.feaIdToPickingIdMap,_a39 = _this$_getIdMap.pickingIdToFeaIdMap,_l34 = _this$_getIdMap.hasFeaIds;_l34 && (_s81.feaIdPickingMap = _o62, _s81.feaPickingIdMap = _a39), _s81.symbolIndex = _r106.symbolIndex, _s81.features = t, _s81.is2D = e[_i131].is2D, _s81.layer = this.layer, _s81.positionBounding = e[_i131].positionBounding, this.postCreateGeometry(_r106, n);}n.push(_r106);}return n;} }, { key: \"isOnly2D\", value: function isOnly2D() {return this._is2D;} }, { key: \"postCreateGeometry\", value: function postCreateGeometry() {} }, { key: \"_getIdMap\", value: function _getIdMap(e) {if (!e) return {};if (Array.isArray(e) && !(e = e[0])) return {};var t = e.featureIds,n = {},i = {},r = t && t.length;if (r) for (var _r107 = 0; _r107 < t.length; _r107++) {var _s82 = e.data.aPickingId[_r107];void 0 === n[_s82] && (n[_s82] = t[_r107], i[t[_r107]] || (i[t[_r107]] = []), i[t[_r107]].push(e.data.aPickingId[_r107]));}return { hasFeaIds: r, pickingIdToFeaIdMap: n, feaIdToPickingIdMap: i };} }, { key: \"createGeometry\", value: function createGeometry() {throw new Error(\"not implemented\");} }, { key: \"createMeshes\", value: function createMeshes(e, t, n, i) {var r = this.layer.options.awareOfTerrain,s = [];for (var _o63 = 0; _o63 < e.length; _o63++) {if (!e[_o63]) continue;if (r && i && i.isRenderingTerrain && this.isTerrainVector()) {var _t254 = e[_o63],_n179 = _t254 && _t254.geometry;this._updateTerrainAltitude(_n179, _n179.data, _n179.properties, _n179.positionSize || _n179.desc.positionSize, i);}var _a40 = this.createMesh(e[_o63], t, n, i || {});Array.isArray(_a40) ? (_a40 = _a40.filter(function (e) {return !!e;}), s.push.apply(s, _toConsumableArray(_a40))) : _a40 && s.push(_a40);}return s;} }, { key: \"createMesh\", value: function createMesh() {throw new Error(\"not implemented\");} }, { key: \"getAltitudeOffsetMatrix\", value: function getAltitudeOffsetMatrix() {var e = 100 * (this.dataConfig.altitudeOffset || 0),t = _gl.mat4.identity([]);return _gl.vec3.set(sn, 0, 0, e), _gl.mat4.translate(t, t, sn), t;} }, { key: \"isBloom\", value: function isBloom(e) {return !!this.getSymbol(e.properties.symbolIndex).bloom;} }, { key: \"forbiddenTerrainUpscale\", value: function forbiddenTerrainUpscale() {return !0;} }, { key: \"addMesh\", value: function addMesh(e, t, n) {var _this40 = this;if (n.isRenderingTerrain && this.isTerrainSkin() && this.forbiddenTerrainUpscale()) {var _e270 = this.getMap().getResolution();if (n.tileInfo.res / _e270 > 3) return;}var i = n.isRenderingTerrain && this.isTerrainVector(),r = this.getRenderFBO(n);e = e.filter(function (e) {return _this40.isMeshVisible(e);}), i && (e = e.filter(function (e) {return e.geometry && e.geometry.data.aTerrainAltitude;}));var s = void 0 === this.sceneConfig.castShadow || !!this.sceneConfig.castShadow,o = !(!n || !n.bloom);e.forEach(function (e) {var t = _this40.isBloom(e) && o;e.bloom = t, e.castShadow = s;var a = !1;var l = e.defines || {};if (!!l.HAS_BLOOM !== t && (a = !0, t ? l.HAS_BLOOM = 1 : delete l.HAS_BLOOM), i) {if (e.geometry.data.aTerrainAltitude) {var _t255 = e.geometry;_this40._updateTerrainAltitude(_t255, _t255.data, _t255.properties, _t255.desc.positionSize, n);}e.geometry.data.aTerrainAltitude && !l.HAS_TERRAIN_ALTITUDE && (l.HAS_TERRAIN_ALTITUDE = 1, a = !0);} else l.HAS_TERRAIN_ALTITUDE && (delete l.HAS_TERRAIN_ALTITUDE, a = !0);a && e.setDefines(l), r ? e.setUniform(\"targetFramebuffer\", r) : e.uniforms.targetFramebuffer && (e.uniforms.targetFramebuffer = null), _this40._highlightMesh(e);}), this.scene.addMesh(e);} }, { key: \"updateCollision\", value: function updateCollision() {} }, { key: \"render\", value: function render(e) {return this.pluginIndex = e.pluginIndex, this.polygonOffsetIndex = e.polygonOffsetIndex, this.paint(e), { redraw: this._redraw, drawCount: this._drawCount };} }, { key: \"prepareRender\", value: function prepareRender(e) {if (this._currentTimestamp === e.timestamp) return;if (!this.createFnTypeConfig) return;var t = this.scene.getMeshes();if (!t || !t.length) return;var n = e && e.sceneFilter,i = this.getMap().getZoom();for (var _r108 = 0; _r108 < t.length; _r108++) {if (!t[_r108] || !t[_r108].geometry) continue;if (n && !n(t[_r108])) continue;var _s83 = t[_r108].properties.symbolIndex,_o64 = this.getSymbolDef(_s83);if (!_o64) continue;this._currentTimestamp = e.timestamp;var _a41 = this.getFnTypeConfig(_s83);Ct(this.regl, this.layer, _o64, _a41, t[_r108], i);}} }, { key: \"paint\", value: function paint(e) {var t = this.layer.getMap();if (!t) return { redraw: !1 };this._renderContext = e;var n = this.getUniformValues(t, e);return this.callShader(n, e), { redraw: this._redraw };} }, { key: \"setToRedraw\", value: function setToRedraw(e) {e && (this._needRetire = e), this._redraw = !0;} }, { key: \"callShader\", value: function callShader(e, t) {this.callCurrentTileShader(e, t), this.callBackgroundTileShader(e, t);} }, { key: \"callCurrentTileShader\", value: function callCurrentTileShader(e, t) {this.shader && (this.shader.filter = t && t.sceneFilter ? [this.level0Filter, t.sceneFilter] : this.level0Filter), this.callRenderer(this.shader, e, t);} }, { key: \"callBackgroundTileShader\", value: function callBackgroundTileShader(e, t) {this.shader && (this.shader.filter = t && t.sceneFilter ? [this.levelNFilter, t.sceneFilter] : this.levelNFilter), this.scene.getMeshes().sort(pn), this.callRenderer(this.shader, e, t);} }, { key: \"callRenderer\", value: function callRenderer(e, t, n) {var i = this.scene.getMeshes(),r = [];i.forEach(function (e) {e.properties.hlBloomMesh && n && n.bloom && r.push(e.properties.hlBloomMesh), r.push(e);}), this._setLayerUniforms(t), this.scene.setMeshes(r), t.painterContext = n, this._drawCount += this.renderer.render(e, t, this.scene, this.getRenderFBO(n)), this.scene.setMeshes(i);} }, { key: \"_setLayerUniforms\", value: function _setLayerUniforms(e) {var t = this.layer.options.altitude || 0,n = this.layer.getRenderer();e.layerOpacity = n._getLayerOpacity(), e.minAltitude = t;} }, { key: \"getRenderFBO\", value: function getRenderFBO(e) {return e && e.renderTarget && e.renderTarget.fbo;} }, { key: \"needPolygonOffset\", value: function needPolygonOffset() {return !1;} }, { key: \"needRebuildOnGometryPropertiesChanged\", value: function needRebuildOnGometryPropertiesChanged() {return !0;} }, { key: \"onFeatureChange\", value: function onFeatureChange() {} }, { key: \"getPolygonOffset\", value: function getPolygonOffset() {var _this41 = this;var e = this.layer;return { factor: function factor() {return e.getPolygonOffset() + (_this41.polygonOffsetIndex || 0);}, units: function units() {return e.getPolygonOffset() + (_this41.polygonOffsetIndex || 0);} };} }, { key: \"getBlendFunc\", value: function getBlendFunc() {var _this42 = this;return { src: function src() {return _this42.sceneConfig.blendSrc || \"one\";}, dst: function dst() {return _this42.sceneConfig.blendDst || \"one minus src alpha\";} };} }, { key: \"pick\", value: function pick(e, t) {var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;if (!this.layer.options.picking || !1 === this.sceneConfig.picking) return null;if (!this.pickingFBO || !this.picking) return null;var i = this.getMap(),r = this.getUniformValues(i);this._setLayerUniforms(r);for (var _s84 = 0; _s84 < this.picking.length; _s84++) {var _o65 = this.picking[_s84];_o65.render(this.scene.getMeshes(), r, !0);var _a42 = {};_o65.getRenderedMeshes().length && (_a42 = _o65.pick(e, t, n, r, { viewMatrix: i.viewMatrix, projMatrix: i.projMatrix, returnPoint: this.layer.options.pickingPoint && !1 !== this.sceneConfig.pickingPoint, logDepthBufFC: 2 / (Math.log(i.cameraFar + 1) / Math.LN2) }));var _a43 = _a42,_l35 = _a43.meshId,_h22 = _a43.pickingId,_c16 = _a43.point,_u13 = (0 === _l35 || _l35) && _o65.getMeshAt(_l35);if (!_u13 || !_u13.geometry) continue;var _f13 = _u13.geometry.properties;_f13.features || (_f13 = _u13.properties), _c16 && _c16.length && (_c16[0] = Math.round(1e5 * _c16[0]) / 1e5, _c16[1] = Math.round(1e5 * _c16[1]) / 1e5, _c16[2] = Math.round(1e5 * _c16[2]) / 1e5);var _d8 = { data: this._convertProxyFeature(_f13 && _f13.features && _f13.features[_h22]), point: _c16, coordinate: _a42.coordinate, plugin: this.pluginIndex };return Ie(_u13.properties.nodeIndex) || (_d8.data || (_d8.data = {}), _d8.data.nodeIndex = _u13.properties.nodeIndex), _d8;}return null;} }, { key: \"_convertProxyFeature\", value: function _convertProxyFeature(e) {var t = e && e.feature;if (!t || !t.customProps) return e;var n = Se({}, e);return n.feature = Se({}, e.feature), delete n.feature.customProps, n.feature.properties = Se({}, t.properties, t.properties[ve], t.properties[be]), delete n.feature.properties[be], delete n.feature.properties[ve], delete n.feature.properties.$layer, delete n.feature.properties.$type, n;} }, { key: \"updateSceneConfig\", value: function updateSceneConfig() {} }, { key: \"updateDataConfig\", value: function updateDataConfig(e) {return Se(this.dataConfig, e), !0;} }, { key: \"deleteMesh\", value: function deleteMesh(e, t) {if (e) if (this.scene.removeMesh(e), Array.isArray(e)) for (var _n180 = 0; _n180 < e.length; _n180++) {if (!e[_n180].isValid()) continue;var _i132 = e[_n180].geometry;!t && _i132 && _i132.dispose(), e[_n180].material && e[_n180].material.dispose(), e[_n180].dispose(), _gl.HighlightUtil.deleteHighlightBloomMesh(e[_n180]);} else {if (!e.isValid()) return;!t && e.geometry && e.geometry.dispose(), e.material && e.material.dispose(), e.dispose(), _gl.HighlightUtil.deleteHighlightBloomMesh(e);}} }, { key: \"startFrame\", value: function startFrame(e) {this._inited || (this.init(e), this._inited = !0), this._currentTimestamp !== e.timestamp && (this._redraw = !1, this._needRetire = !1, this._drawCount = 0), this.scene.clear();} }, { key: \"resize\", value: function resize() {} }, { key: \"delete\", value: function _delete() {if (this.scene.clear(), this.shader && this.shader.dispose(), this.picking) {for (var _e271 = 0; _e271 < this.picking.length; _e271++) this.picking[_e271].dispose();delete this.picking;}if (this._outlineShaders) {for (var _e272 = 0; _e272 < this._outlineShaders.length; _e272++) this._outlineShaders[_e272].dispose();delete this._outlineShaders;}delete this._terrainAltitudeCache, this.logoutTextureCache();} }, { key: \"updateSymbol\", value: function updateSymbol(e, t) {Array.isArray(e) || (e = [e], t = [t]);var n = !1;for (var _i133 = 0; _i133 < e.length; _i133++) if (e[_i133]) {var _r109 = this._updateChildSymbol(_i133, e[_i133], t[_i133]);_r109 && (n = _r109);}return delete this._fnTypeConfigs, this.setToRedraw(!1), n;} }, { key: \"_isNeedRefreshStyle\", value: function _isNeedRefreshStyle(e, t) {for (var _n181 in t) if (Ne(t, _n181)) {if (Kt.isFnTypeSymbol(t[_n181]) && !this.layer.options.features && (!e[_n181] || e[_n181].property !== t[_n181].property)) return !0;if (Jt[_n181] && !(0, _fastDeepEqual.default)(t[_n181], e[_n181])) return !0;}return !1;} }, { key: \"_updateChildSymbol\", value: function _updateChildSymbol(e, t, n) {if (!this._symbol) return !1;var i = this._isNeedRefreshStyle(this.symbolDef[e] || {}, n);if (this._invisibleWhenCreated[e] && !1 !== n.visible) return this._invisibleWhenCreated[e] = !1, !0;this.symbolDef[e] = Ce(n);var r = this._symbol[e];for (var _e273 in r) delete r[_e273];var s = this.getMap(),o = [],a = Qt.loadSymbolFnTypes(this.symbolDef[e], function () {return o[0] = s.getZoom(), o;});for (var _e274 in a) {var _t256 = Object.getOwnPropertyDescriptor(a, _e274);_t256.get ? Object.defineProperty(r, _e274, { get: _t256.get, set: _t256.set, configurable: !0, enumerable: !0 }) : r[_e274] = a[_e274];}return (0, _functionType.isFunctionDefinition)(n.visible) && (this._visibleFn[e] = (0, _functionType.interpolated)(n.visible)), i;} }, { key: \"getSymbolDef\", value: function getSymbolDef(e) {return this.symbolDef[e.index];} }, { key: \"getSymbols\", value: function getSymbols() {return this._symbol;} }, { key: \"getSymbol\", value: function getSymbol(e) {var t = e.index;return this._symbol[t];} }, { key: \"_compileSymbols\", value: function _compileSymbols() {var e = this.getMap(),t = [],n = function n() {return t[0] = e.getZoom(), t;};this._symbol = [], this._visibleFn = [];for (var _e275 = 0; _e275 < this.symbolDef.length; _e275++) this._symbol[_e275] = Qt.loadSymbolFnTypes(Se({}, this.symbolDef[_e275]), n), this.symbolDef[_e275] && (0, _functionType.isFunctionDefinition)(this.symbolDef[_e275].visible) && (this._visibleFn[_e275] = (0, _functionType.interpolated)(this.symbolDef[_e275].visible));} }, { key: \"getFnTypeConfig\", value: function getFnTypeConfig(e) {this._fnTypeConfigs || (this._fnTypeConfigs = []);var t = e.index;if (!this._fnTypeConfigs[t]) {var _n182 = this.getSymbolDef(e),_i134 = this.getMap();this._fnTypeConfigs[t] = this.createFnTypeConfig(_i134, _n182);}return this._fnTypeConfigs[t];} }, { key: \"_deleteFnTypeConfigs\", value: function _deleteFnTypeConfigs() {delete this._fnTypeConfigs;} }, { key: \"loginTextureCache\", value: function loginTextureCache() {var e = (rn + \"\").trim(),t = this.getMap();t[e] || (t[e] = { count: 0 }), t[e].count++;} }, { key: \"logoutTextureCache\", value: function logoutTextureCache() {var e = (rn + \"\").trim(),t = this.getMap(),n = this._myTextures;if (n) for (var _i135 in n) Ne(n, _i135) && t[e][_i135] && (t[e][_i135].count--, t[e][_i135].count <= 0 && delete t[e][_i135]);t[e].count--, t[e].count <= 0 && (t[e] = {});} }, { key: \"getCachedTexture\", value: function getCachedTexture(e) {var t = (rn + \"\").trim(),n = this.getMap()[t][e];return n ? n.data : null;} }, { key: \"addCachedTexture\", value: function addCachedTexture(e, t) {var n = (rn + \"\").trim(),i = this.getMap();var r = i[n][e];r ? r.data = t : r = i[n][e] = { data: t, count: 0 }, this._myTextures || (this._myTextures = {}), r.data.then || this._myTextures[e] || (r.count++, this._myTextures[e] = 1);} }, { key: \"disposeCachedTexture\", value: function disposeCachedTexture(e) {var t;if (t = \"string\" == typeof e ? e : e.url, !this._myTextures || !this._myTextures[t]) return;var n = (rn + \"\").trim();delete this._myTextures[t];var i = this.getMap();i[n][t] && (i[n][t].count--, i[n][t].count <= 0 && delete i[n][t]);} }, { key: \"shouldDeleteMeshOnUpdateSymbol\", value: function shouldDeleteMeshOnUpdateSymbol() {return !1;} }, { key: \"isEnableTileStencil\", value: function isEnableTileStencil() {return !0;} }, { key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return this.isOnly2D();} }, { key: \"supportRenderMode\", value: function supportRenderMode(e) {return \"taa\" === e || \"fxaa\" === e;} }, { key: \"outline\", value: function outline(e, t) {var n = {};for (var _i136 = 0; _i136 < t.length; _i136++) Ie(t[_i136]) || n[t[_i136]] || (this._outlineOne(e, t[_i136]), n[t[_i136]] = 1);} }, { key: \"_outlineOne\", value: function _outlineOne(e, t) {if (!this.picking) return;if (this._outlineScene || (this._outlineScene = new _gl.reshader.Scene()), !this._outlineShaders && (this._initOutlineShaders(), !this._outlineShaders)) return void console.warn(\"Plugin at \".concat(this.pluginIndex, \" doesn't support outline.\"));var n = this.getUniformValues(this.getMap(), this._renderContext);this._setLayerUniforms(n);var i = this._findMeshesHasFeaId(t);if (i.length) for (var _r110 = 0; _r110 < i.length; _r110++) {var _s85 = i[_r110].geometry.properties.feaIdPickingMap;if (_s85) {var _o66 = _s85[t];if (_o66) {var _t257 = {};this._outlineScene.setMeshes(i[_r110]);for (var _i137 = 0; _i137 < _o66.length; _i137++) {var _r111 = _o66[_i137];if (!_t257[_r111]) {_t257[_r111] = 1, n.highlightPickingId = _r111;for (var _t258 = 0; _t258 < this._outlineShaders.length; _t258++) this.renderer.render(this._outlineShaders[_t258], n, this._outlineScene, e);}}}}}} }, { key: \"_findMeshesHasFeaId\", value: function _findMeshesHasFeaId(e) {var t = [],n = this.scene.getMeshes();for (var _i138 = 0; _i138 < n.length; _i138++) {var _r112 = n[_i138],_s86 = _r112.geometry.properties.feaIdPickingMap;_s86 && void 0 !== _s86[e] && t.push(_r112);}return t;} }, { key: \"outlineAll\", value: function outlineAll(e) {if (!this.picking) return;if (!this._outlineShaders && (this._initOutlineShaders(), !this._outlineShaders)) return void console.warn(\"Plugin at \".concat(this.pluginIndex, \" doesn't support outline.\"));var t = this.getUniformValues(this.getMap(), this._renderContext);this._setLayerUniforms(t), t.highlightPickingId = -1;for (var _n183 = 0; _n183 < this._outlineShaders.length; _n183++) this.renderer.render(this._outlineShaders[_n183], t, this.scene, e);} }, { key: \"_initOutlineShaders\", value: function _initOutlineShaders() {if (!this.picking) return;var e = this.layer.getRenderer().canvas;this._outlineShaders = [];for (var _t259 = 0; _t259 < this.picking.length; _t259++) {var _n184 = this.picking[_t259].getPickingVert(),_i139 = { ENABLE_PICKING: 1, HAS_PICKING_ID: 1 },_r113 = this.picking[_t259].getUniformDeclares().slice(0);void 0 !== _r113.uPickingId && (_i139.HAS_PICKING_ID = 2), this._outlineShaders[_t259] = new _gl.reshader.MeshShader({ vert: _n184, frag: \"precision highp float;\\nuniform float highlightPickingId;\\nvarying float vPickingId;\\nvoid main() {\\n if(highlightPickingId < .0 || floor(highlightPickingId + .5) == floor(vPickingId + .5)) {\\n gl_FragColor = vec4(1.);\\n } else {\\n discard;\\n }\\n}\", uniforms: _r113, defines: _i139, extraCommandProps: { viewport: { x: 0, y: 0, width: function width() {return e.width;}, height: function height() {return e.height;} }, depth: { enable: !0, mask: !1, func: \"always\" }, blend: { enable: !0, func: { src: \"src alpha\", dst: \"one minus src alpha\" }, equation: \"add\" } } }), this._outlineShaders[_t259].filter = this.picking[_t259].filter;}} }, { key: \"hasIBL\", value: function hasIBL() {var e = this.getMap().getLightManager();return !!(e && e.getAmbientResource());} }, { key: \"updateIBLDefines\", value: function updateIBLDefines(e) {var t = e.shaderDefines;var n = !1;this.hasIBL() ? t[[\"HAS_IBL_LIGHTING\"]] || (t.HAS_IBL_LIGHTING = 1, n = !0) : t[[\"HAS_IBL_LIGHTING\"]] && (delete t.HAS_IBL_LIGHTING, n = !0), n && (e.shaderDefines = t);} }, { key: \"getIBLRes\", value: function getIBLRes() {var e = this.layer.getRenderer().canvas;return nn(e);} }, { key: \"createIBLTextures\", value: function createIBLTextures() {var e = this.layer.getRenderer().canvas;en(e, this.regl, this.getMap()), this.setToRedraw(!0), this.layer.fire(\"iblupdated\");} }, { key: \"disposeIBLTextures\", value: function disposeIBLTextures() {var e = this.layer.getRenderer().canvas;tn(e, this.getMap());} }, { key: \"evaluateInFnTypeConfig\", value: function evaluateInFnTypeConfig(e, t, n, i, r) {var s = this._fnCaches;s || (s = this._fnCaches = {});var o = function (e) {var t = 0;var n = e && e.length || 0;if (!n) return t;var i;for (var _r114 = 0; _r114 < n; _r114++) i = e.codePointAt(_r114), t = (t << 5) - t + i, t |= 0;return t;}(JSON.stringify(e));var a = s[o];return a || (a = s[o] = r ? (0, _functionType.piecewiseConstant)(e) : (0, _functionType.interpolated)(e)), a(n.getZoom(), i);} }, { key: \"highlight\", value: function highlight(e) {this._highlighted = e, this._highlightTimestamp = this.layer.getRenderer().getFrameTimestamp(), this.setToRedraw(!0);} }, { key: \"cancelAllHighlight\", value: function cancelAllHighlight() {this._highlighted = null, this._highlightTimestamp = this.layer.getRenderer().getFrameTimestamp(), this.setToRedraw(!0);} }, { key: \"_prepareFeatureIds\", value: function _prepareFeatureIds(e, t) {var n = t.featureIds,i = t.pickingIdIndiceMap;e.properties.aFeaIds = n, e.properties.pickingIdIndiceMap = i;} }, { key: \"_highlightMesh\", value: function _highlightMesh(e) {if (e && e.properties.isHalo) return;var t = e instanceof _gl.reshader.InstancedMesh ? e.properties : e.geometry.properties,n = t.pickingIdIndiceMap,i = this._highlighted ? function (e, t, n) {var i = e instanceof _gl.reshader.InstancedMesh ? e.properties : e.geometry.properties,r = i.aPickingId,o = i.feaIdPickingMap,a = i.features,l = new Map(),h = n.keys();var _iterator47 = _createForOfIteratorHelper(h),_step47;try {for (_iterator47.s(); !(_step47 = _iterator47.n()).done;) {var _e276 = _step47.value;var _i140 = n.get(_e276);if (_i140) if (Ie(_i140.id)) {if (_i140.filter && r) {var _e277 = null;for (var _n185 = 0; _n185 < r.length; _n185++) {r[_n185] !== _e277 && (_e277 = r[_n185]);var _s87 = a[_e277];_i140.filter(_s87 && _s87.feature, t) && l.set(_e277, _i140);}}} else {var _e278 = o[_i140.id];if (!_e278 || !_e278.length) continue;for (var _t260 = 0; _t260 < _e278.length; _t260++) l.set(_e278[_t260], _i140);}}} catch (err) {_iterator47.e(err);} finally {_iterator47.f();}return l;}(e, this.layer, this._highlighted) : null;_gl.HighlightUtil.highlightMesh(this.regl, e, i, this._highlightTimestamp, n);} }, { key: \"_updateTerrainAltitude\", value: function _updateTerrainAltitude(e, t, n, i, r) {var s = n.aAnchor;if (!s) {var _e279 = t.aPosition;s = n.aAnchor = _e279.slice(0);}var o = n.aTerrainAltitude;o || (o = n.aTerrainAltitude = new Float32Array(s.length / i), o.fill(me)), this._fillTerrainAltitude(o, s, r.tileInfo, 0, o.length - 1), t.aTerrainAltitude ? o.dirty && this._updateATerrainAltitude(e, o) : t.aTerrainAltitude = o, o.dirty = !1;} }, { key: \"_updateATerrainAltitude\", value: function _updateATerrainAltitude(e, t) {e && e.updateData && e.updateData(\"aTerrainAltitude\", t);} }, { key: \"_fillTerrainAltitude\", value: function _fillTerrainAltitude(t, n, i, r, s) {var o = i.res,a = i.extent,l = i.extent2d,h = i.id,c = this.pluginIndex,u = h + \"-\" + c;if (i.completeTerrainQuery || (i.completeTerrainQuery = []), i.completeTerrainQuery[c]) return;if (!i.completeTerrainQuery[c] && this._terrainAltitudeCache && this._terrainAltitudeCache.has(u)) {var _e280 = this._terrainAltitudeCache.getAndRemove(u);return this._terrainAltitudeCache.add(u, _e280), t.set(_e280.altitudeData), i.terrainTileInfos = _e280.terrainTileInfos, t.dirty = !0, void (i.completeTerrainQuery[c] = !0);}var f = this.layer,d = f.getMap(),p = f.getRenderer(),g = p && p.getTerrainHelper();var m = i.terrainTileInfos;m || (m = i.terrainTileInfos = this.layer.queryTerrainTiles(i)), i.terrainQueryStatus || (i.terrainQueryStatus = []);var y = !1,x = [];for (var _e281 = 0; _e281 < i.terrainTileInfos.length; _e281++) if (x[_e281] = +g.isTerrainTileLoaded(i.terrainTileInfos[_e281].id), x[_e281] && i.terrainQueryStatus[c] && !i.terrainQueryStatus[c][_e281]) {y = !0;break;}if (!y && i.terrainQueryStatus[c]) return;var _ = f.constructor;if (d.isInteracting()) {var _e282 = p.getFrameTimestamp();_.altitudeQueryFrameTimestamp !== _e282 && (_.altitudeQueryFrameTimestamp = _e282, _.altitudeQueryFrameTime = 0);var _t261 = f.options.altitudeQueryTimeLimitPerFrame;if (_.altitudeQueryFrameTime > _t261) return;}var v = performance.now();i.terrainQueryStatus[c] = x;var b = l.xmin,A = l.ymax,T = on.set(b, A),w = this.layer.getTileSize().width / i.extent,S = n.length / t.length;var M = t.queryResult;M || (M = t.queryResult = new Map());var P = !0;for (var _e283 = r; _e283 <= s; _e283++) {var _i141 = n[_e283 * S];_i141 < 0 ? _i141 = 0 : _i141 > a && (_i141 = a);var _r115 = n[_e283 * S + 1];_r115 < 0 ? _r115 = 0 : _r115 > a && (_r115 = a);var _s88 = _i141 + _r115 * a;var _l36 = void 0,_h23 = void 0,_c17 = M.get(_s88);if (_c17 || 0 === _c17) t[_e283] !== _c17 && (t[_e283] = _c17, t.dirty = !0);else {for (var _e284 = 0; _e284 < m.length; _e284++) if ($t(m[_e284], b + w * _i141, A - w * _r115, o)) {_l36 = m[_e284];break;}_l36 && (g.getRenderer().isTileCached(_l36.id) || t[_e283] === me) && (an.set(_i141, _r115), _h23 = this.layer.queryTilePointTerrain(an, _l36, T, a, o)), _c17 = t[_e283], _h23 && (_c17 = null === _h23[0] ? me : _h23[0], ln[0] = _c17, _c17 = ln[0]), t[_e283] !== _c17 && (t[_e283] = _c17, t.dirty = !0), _h23 && _h23[1] ? M.set(_s88, _c17) : P = !1;}}_.altitudeQueryFrameTime = (_.altitudeQueryFrameTime || 0) + (performance.now() - v), i.completeTerrainQuery[c] = P, P && (this._terrainAltitudeCache || (this._terrainAltitudeCache = new e.LRUCache(4 * this.layer.options.maxCacheSize)), this._terrainAltitudeCache.add(u, { altitudeData: t, terrainTileInfos: m }));} }, { key: \"shouldDrawParentTile\", value: function shouldDrawParentTile() {return !0;} }], [{ key: \"getBloomSymbol\", value: function getBloomSymbol() {return [\"bloom\"];} }]);}();function dn(e, t) {var n = e && e.getCommandKey(this.regl) || \"\",i = t && t.getCommandKey(this.regl) || \"\";return n.localeCompare(i);}function pn(e, t) {return e.properties.level - t.properties.level;}var gn = function (_fn) {function gn() {_classCallCheck(this, gn);return _callSuper(this, gn, arguments);}_inherits(gn, _fn);return _createClass(gn, [{ key: \"createGeometry\", value: function createGeometry(e, t) {if (!e.data) return { geometry: null, symbolIndex: e.symbolIndex };e.iconAtlas && e.iconAtlas.image && (e.iconAtlas.image.dataType = e.type, e.iconAtlas.image.type = \"icon\"), e.glyphAtlas && e.glyphAtlas.image && (e.glyphAtlas.image.type = \"glyph\");var n = Se({}, e.data),i = { primitive: this.getPrimitive(), positionSize: e.positionSize };n.aAltitude && (i.altitudeAttribute = \"aAltitude\");var r = new _gl.reshader.Geometry(n, e.indices, 0, i);return r.properties = { features: t }, e.iconAtlas && (r.properties.iconAtlas = e.iconAtlas.image, r.properties.iconPositions = e.iconAtlas.positions), e.glyphAtlas && (r.properties.glyphAtlas = e.glyphAtlas.image), bt(t) || (r.properties.aFeaIds = e.featureIds, this._prepareFeatureIds(r, e)), e.markerPlacement && (r.properties.markerPlacement = e.markerPlacement), e.textPlacement && (r.properties.textPlacement = e.textPlacement), Se(r.properties, e.properties), { geometry: r, symbolIndex: e.symbolIndex };} }, { key: \"getRayCastData\", value: function getRayCastData(e, t) {var _e$geometry$propertie = e.geometry.properties,n = _e$geometry$propertie.features,i = _e$geometry$propertie.aFeaIds;if (!n || !i) return null;return n[i[t]];} }, { key: \"getPrimitive\", value: function getPrimitive() {return \"triangles\";} }, { key: \"getRenderFBO\", value: function getRenderFBO(e) {return e && e.renderTarget && e.renderTarget.fbo;} }, { key: \"supportRenderMode\", value: function supportRenderMode(e) {return \"noAa\" === e;} }, { key: \"drawDebugAtlas\", value: function drawDebugAtlas(e) {if (document.getElementById(\"MAPTALKS_ICON_DEBUG\")) {var _t262 = document.getElementById(\"MAPTALKS_ICON_DEBUG\");var _n186;if (_t262.width = e.width, _t262.height = e.height, _t262.style.width = e.width + \"px\", _t262.style.height = e.height + \"px\", \"alpha\" === e.format) {_n186 = new Uint8ClampedArray(4 * e.data.length);for (var _t263 = 0; _t263 < e.data.length; _t263++) _n186[4 * _t263 + 3] = e.data[_t263];} else _n186 = new Uint8ClampedArray(e.data);var _i142 = _t262.getContext(\"2d\");_i142.imageSmoothingEnabled = !1, _i142.putImageData(new ImageData(_n186, e.width, e.height), 0, 0);}} }]);}(fn);var mn = \"#include \\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\nuniform mat4 projViewModelMatrix;\\nuniform mat4 positionMatrix;\\n#include \\n#include \\nvoid main() {\\n vec3 c = unpackVTPosition();\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\\n fbo_picking_setData(gl_Position.w, true);\\n}\";function yn(e, t, n, i) {if (i) {var _e285 = _gl.reshader.Util.resizeToPowerOfTwo(t.data, t.width, t.height);t.data = _e285;}var r = t,o = { width: r.width, height: r.height, data: r.data, format: r.format, mag: \"linear\", min: i ? \"linear mipmap linear\" : \"linear\", flipY: n, premultiplyAlpha: !0 };if (\"icon\" === t.type) {var _e286 = \"point\" !== t.dataType ? \"repeat\" : \"clamp\";o.wrapS = _e286, o.wrapT = _e286;}return e.texture(o);}var xn = [0, 0],_n = [];function vn(e) {if (!e.properties.iconPositions) return xn;var t,n = 0;for (var _i143 in e.properties.iconPositions) if (t = _i143, n++, n > 1) return xn;if (!t) return xn;var i = e.properties.iconPositions[t],r = i.displaySize[0],s = i.displaySize[1];return _n[0] = r, _n[1] = s, _n;}var _H6 = H(),bn = _H6.INVALID_TEX_COORD,An = _gl.mat4.identity([]),Tn = { polygonFill: [1, 1, 1, 1], polygonOpacity: 1, uvScale: [1, 1], uvOffset: [0, 0], patternWidth: [0, 0], patternOffset: [0, 0] },wn = [],Sn = new e.Coordinate(0, 0),Mn = new e.Coordinate(0, 0),Pn = new e.Coordinate(0, 0),In = [];var Cn = exports.FillPainter = function (_gn) {function Cn() {_classCallCheck(this, Cn);return _callSuper(this, Cn, arguments);}_inherits(Cn, _gn);return _createClass(Cn, [{ key: \"prepareSymbol\", value: function prepareSymbol(e) {var t = e.polygonFill;Array.isArray(t) && (3 === t.length && t.push(1), e.polygonFill = t.map(function (e) {return 255 * e;}));} }, { key: \"supportRenderMode\", value: function supportRenderMode(e) {return this.sceneConfig.antialias || void 0 === this.sceneConfig.antialias ? \"fxaa\" === e || \"fxaaBeforeTaa\" === e : _superPropGet(Cn, \"supportRenderMode\", this, 3)([e]);} }, { key: \"isBloom\", value: function isBloom(e) {return !!this.getSymbol(e.properties.symbolIndex)[Cn.getBloomSymbol()[0]];} }, { key: \"forbiddenTerrainUpscale\", value: function forbiddenTerrainUpscale() {return !0;} }, { key: \"needPolygonOffset\", value: function needPolygonOffset() {return !0;} }, { key: \"getAnalysisMeshes\", value: function getAnalysisMeshes() {if (!this.isVisible()) return wn;return this.scene.getMeshes().filter(function (e) {return 0 === e.properties.level;});} }, { key: \"createMesh\", value: function createMesh(t, n, i) {var _this43 = this;var r = this.getMap(),o = i.tilePoint,a = t.geometry,l = t.symbolIndex,h = t.ref,c = this.layer instanceof e.TileLayer,u = this.layer.getTileSize().width,d = a.properties.tileExtent / u,p = a.properties.tileResolution,g = r.pointAtResToCoord(Sn.set(o[0], o[1]), p),m = { tileExtent: a.properties.tileExtent, tileRatio: d },y = this.getSymbol(l),x = this.getSymbolDef(l);if ((0, _functionType.isFunctionDefinition)(x.polygonPatternFileOrigin) && this._preparePatternOrigin(x, t, c ? [0, 0] : o, p), ((0, _functionType.isFunctionDefinition)(x.polygonPatternFileWidth) || (0, _functionType.isFunctionDefinition)(x.polygonPatternFileWidth)) && this._preparePatternWidth(x, t, c ? d : 1, g, p), x.uvOffsetInMeter && (0, _functionType.isFunctionDefinition)(x.uvOffset) && this._preparePatternOffset(x, t, g, p), ke(m, \"polygonFill\", y, \"polygonFill\", Tn.polygonFill, Re(this.colorCache)), ke(m, \"polygonOpacity\", y, \"polygonOpacity\", Tn.polygonOpacity), ke(m, \"uvScale\", y, \"uvScale\", Tn.uvScale), void 0 === h) {var _e287 = this.getFnTypeConfig(l);St(a, x, _e287, this.layer), a.generateBuffers(this.regl);}var v = a.properties.iconAtlas,b = 2048;if (v && a.data.aTexInfo) {var _e288 = [];Object.defineProperty(m, \"uvOrigin\", { enumerable: !0, get: function get() {var t = m.tileScale;if (a.data.aPatternOrigin) return _e288[0] = o[0] * t % b, _e288[1] = o[1] * t % b, _e288;var n = y.polygonPatternFileOrigin;return n ? (Sn.set(n[0], n[1]), r.coordToPointAtRes(Sn, p, Mn), _gl.vec2.set(_e288, o[0] - Mn.x, o[1] - Mn.y)) : (_e288[0] = o[0] * t % b, _e288[1] = o[1] * t % b, _e288);} });var _t264 = [];Object.defineProperty(m, \"patternWidth\", { enumerable: !0, get: function get() {if (a.data.aPatternWidth) return Tn.patternWidth;var e = x.polygonPatternFileWidth,n = x.polygonPatternFileHeight;if (!e && !n) return Tn.patternWidth;var _this43$_computePatte = _this43._computePatternWidth(In, e, n, c ? d : 1, g, p),_this43$_computePatte2 = _slicedToArray(_this43$_computePatte, 2),i = _this43$_computePatte2[0],r = _this43$_computePatte2[1];return _gl.vec2.set(_t264, i, r);} }), Object.defineProperty(m, \"uvOffset\", { enumerable: !0, get: function get() {return a.data.aPatternOffset || x.uvOffsetInMeter ? Tn.uvOffset : y.uvOffset || Tn.uvOffset;} });var _n187 = [];Object.defineProperty(m, \"patternOffset\", { enumerable: !0, get: function get() {if (a.data.aPatternOffset) return Tn.uvOffset;if (!x.uvOffsetInMeter) return Tn.uvOffset;var e = x.uvOffset;if (!e) return Tn.uvOffset;var t = Ue(r, e[0], g, p),i = Ue(r, e[1], g, p);return _gl.vec2.set(_n187, t, i);} }), Object.defineProperty(m, \"tileScale\", { enumerable: !0, get: function get() {var e = x.polygonPatternFileWidth,t = x.polygonPatternFileHeight;return e || t ? 1 : a.properties.tileResolution / r.getResolution();} }), m.polygonPatternFile = yn(this.regl, v, !1, !1), m.atlasSize = [v.width, v.height], this.drawDebugAtlas(v);}var A = new _gl.reshader.Material(m, Tn),T = new _gl.reshader.Mesh(a, A, { castShadow: !1, picking: !0 }),w = {};return v && a.data.aTexInfo && (w.HAS_PATTERN = 1), v && a.data.aTexCoord && (w.HAS_TEX_COORD = 1, w.INVALID_TEX_COORD = bn + \".0\"), a.data.aAltitude && (w.HAS_ALTITUDE = 1), a.data.aColor && (w.HAS_COLOR = 1), a.data.aOpacity && (w.HAS_OPACITY = 1), a.data.aUVScale && (w.HAS_UV_SCALE = 1), a.data.aUVOffset && (w.HAS_UV_OFFSET = 1), a.data.aPatternOrigin && (w.HAS_PATTERN_ORIGIN = 1), a.data.aPatternWidth && (w.HAS_PATTERN_WIDTH = 1), a.data.aPatternOffset && (w.HAS_PATTERN_OFFSET = 1), c && (w.IS_VT = 1), T.setDefines(w), T.positionMatrix = this.getAltitudeOffsetMatrix(), T.setLocalTransform(n), T.properties.symbolIndex = l, T;} }, { key: \"_preparePatternWidth\", value: function _preparePatternWidth(e, t, n, i, r) {if (!(t = t && t.geometry)) return;var s = t.properties.features;if (bt(s)) return;var o = e.polygonPatternFileWidth,a = e.polygonPatternFileHeight,l = (0, _functionType.interpolated)(e.polygonPatternFileOrigin);var h, c;(0, _functionType.isFunctionDefinition)(o) && (h = (0, _functionType.interpolated)(o)), (0, _functionType.isFunctionDefinition)(a) && (c = (0, _functionType.interpolated)(a));var _t$data = t.data,u = _t$data.aPickingId,f = _t$data.aPatternOrigin,d = u.length,p = new Float32Array(2 * d);var g, m, y;for (var _e289 = 0, _t265 = u.length; _e289 < _t265; _e289++) {var _t266 = void 0,_d9 = void 0;if (u[_e289] === g) {p[2 * _e289] = m, p[2 * _e289 + 1] = y;continue;}var _x6 = s[u[_e289]];if (_t266 = h ? h(null, _x6.feature.properties) : o, _d9 = c ? c(null, _x6.feature.properties) : a, g = u[_e289], _t266 || _d9) {var _s89 = i;if (f) {var _e290 = l(null, _x6.feature.properties);_e290 && (_s89 = Pn.set(_e290[0], _e290[1]));}var _this$_computePattern = this._computePatternWidth(In, _t266, _d9, n, _s89, r),_this$_computePattern2 = _slicedToArray(_this$_computePattern, 2),_o67 = _this$_computePattern2[0],_a44 = _this$_computePattern2[1];m = p[2 * _e289] = _o67, y = p[2 * _e289 + 1] = _a44;} else m = p[2 * _e289] = 0, y = p[2 * _e289 + 1] = 0;}t.data.aPatternWidth = p;} }, { key: \"_preparePatternOffset\", value: function _preparePatternOffset(e, t, n, i) {if (!(t = t && t.geometry)) return;var r = t.properties.features;if (bt(r)) return;var s = this.getMap();var o = (0, _functionType.isFunctionDefinition)(e.uvOffsetInMeter) && (0, _functionType.piecewiseConstant)(e.uvOffsetInMeter);var a = (0, _functionType.interpolated)(e.uvOffset),l = (0, _functionType.interpolated)(e.polygonPatternFileOrigin),_t$data2 = t.data,h = _t$data2.aPickingId,c = _t$data2.aPatternOrigin,u = h.length,f = new Float32Array(2 * u);var d, p, g;for (var _e291 = 0, _t267 = h.length; _e291 < _t267; _e291++) {if (h[_e291] === d) {f[2 * _e291] = p, f[2 * _e291 + 1] = g;continue;}var _t268 = r[h[_e291]],_u14 = a(null, _t268.feature.properties);var _m4 = !0;if (o && (_m4 = o(null, _t268.feature.properties)), d = h[_e291], _u14 && _m4) {var _r116 = n;if (c) {var _e292 = l(null, _t268.feature.properties);_e292 && (_r116 = Pn.set(_e292[0], _e292[1]));}var _o68 = Ue(s, _u14[0], _r116, i),_a45 = Ue(s, _u14[0], _r116, i);p = f[2 * _e291] = _o68, g = f[2 * _e291 + 1] = _a45;} else p = f[2 * _e291] = 0, g = f[2 * _e291 + 1] = 0;}t.data.aPatternOffset = f;} }, { key: \"_preparePatternOrigin\", value: function _preparePatternOrigin(e, t, n, i) {if (!(t = t && t.geometry)) return;var r = t.properties.features;if (bt(r)) return;var s = this.getMap(),o = (0, _functionType.interpolated)(e.polygonPatternFileOrigin),a = t.data.aPickingId,l = a.length,h = new Float32Array(2 * l);var c, u, f;for (var _e293 = 0, _t269 = a.length; _e293 < _t269; _e293++) {if (a[_e293] === c) {h[2 * _e293] = u, h[2 * _e293 + 1] = f;continue;}c = a[_e293];var _t270 = o(null, r[c].feature.properties);_t270 ? (Sn.set(_t270[0], _t270[1]), s.coordToPointAtRes(Sn, i, Mn), u = h[2 * _e293] = Mn.x, f = h[2 * _e293 + 1] = Mn.y) : (u = h[2 * _e293] = n[0], f = h[2 * _e293 + 1] = n[1]);}t.data.aPatternOrigin = h;} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {var _this44 = this;var n = (0, _functionType.piecewiseConstant)(t.polygonFill),i = (0, _functionType.interpolated)(t.polygonOpacity),r = (0, _functionType.interpolated)(t.uvScale),s = (0, _functionType.interpolated)(t.uvOffset),o = new Uint8Array(1),a = new Uint16Array(2),l = new Uint8Array(2);return [{ attrName: \"aColor\", symbolName: \"polygonFill\", type: Uint8Array, width: 4, define: \"HAS_COLOR\", evaluate: function evaluate(t, i) {var r = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this44.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = _this44.colorCache[r] = _this44.colorCache[r] || (0, _color.default)(r).unitArray()), r = Oe(r), r;} }, { attrName: \"aOpacity\", symbolName: \"polygonOpacity\", type: Uint8Array, width: 1, define: \"HAS_OPACITY\", evaluate: function evaluate(t, n) {var r = i(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this44.evaluateInFnTypeConfig(r, n, e, t)), o[0] = 255 * r, o[0];} }, { attrName: \"aUVScale\", symbolName: \"uvScale\", type: Uint16Array, width: 2, define: \"HAS_UV_SCALE\", evaluate: function evaluate(t) {var n = r(e.getZoom(), t);return a[0] = 255 * n[0], a[1] = 255 * n[1], a;} }, { attrName: \"aUVOffset\", symbolName: \"uvOffset\", type: Uint8Array, width: 2, define: \"HAS_UV_OFFSET\", evaluate: function evaluate(t) {var n = s(e.getZoom(), t);return l[0] = 255 * n[0], l[1] = 255 * n[1], l;} }];} }, { key: \"paint\", value: function paint(e) {this.isShadowIncludeChanged(e) && (this.shader.dispose(), this._createShader(e)), _superPropGet(Cn, \"paint\", this, 3)([e]);} }, { key: \"isEnableTileStencil\", value: function isEnableTileStencil(t) {var n = \"VectorTileLayer\" === this.layer.getJSONType(),i = this.layer instanceof e.TileLayer;return !!!(t && t.isRenderingTerrain && this.isTerrainSkin()) && (n || i && this.isOnly2D());} }, { key: \"init\", value: function init(t) {var _this45 = this;var n = this.regl,i = this.canvas,r = { x: function x(e, t) {return t.viewport ? t.viewport.x : 0;}, y: function y(e, t) {return t.viewport ? t.viewport.y : 0;}, width: function width(e, t) {return t.viewport ? t.viewport.width : i ? i.width : 1;}, height: function height(e, t) {return t.viewport ? t.viewport.height : i ? i.height : 1;} };this.renderer = new _gl.reshader.Renderer(n);var o = { viewport: r, stencil: { enable: function enable(e, t) {return t.geometryProperties.is2D && _this45.isEnableTileStencil(t.painterContext);}, func: { cmp: function cmp() {return _this45.isOnly2D() ? \"=\" : \"<=\";}, ref: function ref(e, t) {return t.stencilRef;} }, op: { fail: \"keep\", zfail: \"keep\", zpass: function zpass() {var e = \"VectorTileLayer\" === _this45.layer.getJSONType(),t = _this45.isOnly2D();return e && t ? \"zero\" : \"replace\";} } }, depth: { enable: !0, range: this.sceneConfig.depthRange || [0, 1], mask: function mask(e, t) {if (!Ie(_this45.sceneConfig.depthMask)) return !!_this45.sceneConfig.depthMask;if (t.hasSSRGround) return !0;if (t.meshConfig.transparent) return !1;var n = t.polygonOpacity;return !(Le(n) && n < 1);}, func: this.sceneConfig.depthFunc || \"<=\" }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } };if (this._createShader(t, o), this.pickingFBO) {var _t271 = [],_n188 = this.layer instanceof e.TileLayer;this.picking = [new _gl.reshader.FBORayPicking(this.renderer, { vert: mn, uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, n) {return _gl.mat4.multiply(_t271, n.projViewMatrix, n.modelMatrix), _t271;} }], extraCommandProps: o, enableStencil: function enableStencil() {return _n188 && _this45.isOnly2D();} }, this.pickingFBO, this.getMap())];}} }, { key: \"_createShader\", value: function _createShader(e, t) {var n = [],i = [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }],r = {};this.fillIncludes(r, i, e), this.shader = new _gl.reshader.MeshShader({ vert: \"#define SHADER_NAME FILL\\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\n#ifdef HAS_COLOR\\nattribute vec4 aColor;\\nvarying vec4 vColor;\\n#endif\\n#ifdef HAS_OPACITY\\nattribute float aOpacity;\\nvarying float vOpacity;\\n#endif\\nuniform mat4 projViewModelMatrix;\\nuniform mat4 positionMatrix;\\n#ifndef IS_VT\\nuniform mat4 modelMatrix;\\n#endif\\n#ifdef HAS_PATTERN\\n#ifdef HAS_TEX_COORD\\nattribute vec2 aTexCoord;\\n#endif\\nattribute vec4 aTexInfo;\\nuniform vec2 patternWidth;\\nuniform vec2 patternOffset;\\nuniform vec2 uvOrigin;\\nuniform vec2 uvScale;\\n#ifdef IS_VT\\nuniform float tileRatio;\\nuniform float tileScale;\\n#else\\nuniform float glScale;\\n#endif\\n#ifdef HAS_UV_SCALE\\nattribute vec2 aUVScale;\\nvarying vec2 vUVScale;\\n#endif\\n#ifdef HAS_UV_OFFSET\\nattribute vec2 aUVOffset;\\nvarying vec2 vUVOffset;\\n#endif\\n#ifdef HAS_PATTERN_WIDTH\\nattribute vec2 aPatternWidth;\\n#endif\\n#ifdef HAS_PATTERN_ORIGIN\\nattribute vec2 aPatternOrigin;\\n#endif\\n#ifdef HAS_PATTERN_OFFSET\\nattribute vec2 aPatternOffset;\\n#endif\\nvarying vec2 vTexCoord;\\nvarying vec4 vTexInfo;\\nvec2 c(vec2 d, vec2 e) {\\n \\n#ifdef IS_VT\\nfloat f = d.x / e.x;\\n float h = d.y / e.y;\\n return vec2(f, h);\\n#else\\nfloat i = glScale;\\n#ifdef HAS_PATTERN_WIDTH\\nfloat j = sign(length(aPatternWidth));\\n i = mix(glScale, 1., j);\\n#endif\\nvec2 k = uvOrigin;\\n#ifdef HAS_PATTERN_ORIGIN\\nk = aPatternOrigin;\\n#endif\\n#ifdef HAS_PATTERN_OFFSET\\nvec2 l = aPatternOffset;\\n#else\\nvec2 l = patternOffset;\\n#endif\\nk += l;\\n float f = (d.x - k.x) * i / e.x;\\n float h = (d.y - k.y) * i / e.y;\\n return vec2(f, -h);\\n#endif\\n}\\nvec2 m(vec4 n, vec2 o) {\\n \\n#ifdef IS_VT\\n#ifdef HAS_PATTERN_OFFSET\\nvec2 l = aPatternOffset;\\n#else\\nvec2 l = patternOffset;\\n#endif\\nvec2 k = uvOrigin + l;\\n#ifdef HAS_PATTERN_ORIGIN\\nk = k - aPatternOrigin * tileScale;\\n#endif\\nfloat j = sign(length(patternWidth));\\n vec2 A = mix(o, patternWidth, j);\\n#ifdef HAS_PATTERN_WIDTH\\nA = aPatternWidth;\\n#endif\\nvec2 B = k * vec2(1., -1.) / A;\\n return mod(B, 1.) + c(n.xy * tileScale / tileRatio, A);\\n#else\\nvec2 A = o;\\n#ifdef HAS_PATTERN_WIDTH\\nfloat j = sign(length(aPatternWidth));\\n A = mix(o, aPatternWidth, j);\\n#endif\\nvec4 C = modelMatrix * n;\\n return c(C.xy, A);\\n#endif\\n}\\n#endif\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\n#include \\n#endif\\n#include \\n#include \\nvoid main() {\\n vec3 D = unpackVTPosition();\\n vec4 n = vec4(D, 1.);\\n gl_Position = projViewModelMatrix * positionMatrix * n;\\n#ifdef HAS_PATTERN\\nvec2 o = aTexInfo.zw + 1.;\\n vTexInfo = vec4(aTexInfo.xy, o);\\n#ifdef HAS_TEX_COORD\\nif(aTexCoord.x == INVALID_TEX_COORD) {\\n vTexCoord = m(n, o);\\n } else {\\n vTexCoord = aTexCoord;\\n }\\n#else\\nvTexCoord = m(n, o);\\n#endif\\n#ifdef HAS_UV_SCALE\\nvUVScale = aUVScale / 255.;\\n#endif\\n#ifdef HAS_UV_OFFSET\\nvUVOffset = aUVOffset / 255.;\\n#endif\\n#endif\\n#ifdef HAS_COLOR\\nvColor = aColor / 255.;\\n#endif\\nhighlight_setVarying();\\n#ifdef HAS_OPACITY\\nvOpacity = aOpacity / 255.;\\n#endif\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nshadow_computeShadowPars(n);\\n#endif\\n}\", frag: \"#define SHADER_NAME FILL\\nprecision mediump float;\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\n#include \\n#endif\\n#ifdef HAS_PATTERN\\n#ifdef HAS_UV_SCALE\\nvarying vec2 vUVScale;\\n#else\\nuniform highp vec2 uvScale;\\n#endif\\n#ifdef HAS_UV_OFFSET\\nvarying vec2 vUVOffset;\\n#else\\nuniform vec2 uvOffset;\\n#endif\\n#endif\\n#ifdef HAS_PATTERN\\nuniform sampler2D polygonPatternFile;\\nuniform vec2 atlasSize;\\nvarying vec2 vTexCoord;\\nvarying vec4 vTexInfo;\\nvec2 c() {\\n \\n#ifdef HAS_UV_SCALE\\nvec2 d = vUVScale;\\n#else\\nvec2 d = uvScale;\\n#endif\\n#ifdef HAS_UV_OFFSET\\nvec2 e = vUVOffset;\\n#else\\nvec2 e = uvOffset;\\n#endif\\nvec2 f = mod(vTexCoord * d + e, 1.);\\n vec2 h = vTexInfo.xy;\\n vec2 i = vTexInfo.zw;\\n return (h + f * i) / atlasSize;\\n}\\n#endif\\n#ifdef HAS_COLOR\\nvarying vec4 vColor;\\n#else\\nuniform vec4 polygonFill;\\n#endif\\n#include \\n#ifdef HAS_OPACITY\\nvarying float vOpacity;\\n#else\\nuniform lowp float polygonOpacity;\\n#endif\\nuniform float layerOpacity;\\nuniform float tileExtent;\\nvoid main() {\\n \\n#ifdef HAS_COLOR\\nvec4 j = vColor;\\n#else\\nvec4 j = polygonFill;\\n#endif\\n#ifdef HAS_PATTERN\\nif(vTexInfo.z * vTexInfo.w > 1.) {\\n vec2 f = c();\\n j = texture2D(polygonPatternFile, f);\\n }\\n#endif\\n#ifdef HAS_OPACITY\\ngl_FragColor = j * vOpacity;\\n#else\\ngl_FragColor = j * polygonOpacity;\\n#endif\\ngl_FragColor *= layerOpacity;\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nfloat k = shadow_computeShadow();\\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, k);\\n#endif\\ngl_FragColor = highlight_blendColor(gl_FragColor);\\n}\", uniforms: i, defines: r, extraCommandProps: t });} }, { key: \"getUniformValues\", value: function getUniformValues(e, t) {var n = t && t.isRenderingTerrainSkin,i = { projViewMatrix: n ? An : e.projViewMatrix, glScale: t && t.isRenderingTerrainSkin ? 1 : 1 / e.getGLScale(), viewport: n && t && t.viewport, hasSSRGround: t && t.hasSSRGround };return this.setIncludeUniformValues(i, t), i;} }, { key: \"_computePatternWidth\", value: function _computePatternWidth(e, t, n, i, r, s) {var o, a;var l = this.getMap();if (t) {o = Ue(l, t, r, s);}if (n) {a = Ue(l, n, r, s, 1);}return o = o || a, a = a || o, e[0] = o, e[1] = a, e;} }], [{ key: \"getBloomSymbol\", value: function getBloomSymbol() {return [\"polygonBloom\"];} }]);}(gn);var kn = \"#define SHADER_NAME LINE\\n#define AA_CLIP_LIMIT 2.0\\n#define AA_LINE_WIDTH 16.0\\n#define DEVICE_PIXEL_RATIO 1.0\\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\\n#define EXTRUDE_SCALE 63.0\\n#define EXTRUDE_MOD 64.0\\n#define MAX_LINE_DISTANCE 65535.0\\n#ifdef PICKING_MODE\\n#include \\n#endif\\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY)\\nattribute vec3 aExtrude;\\n#else\\nattribute vec2 aExtrude;\\n#endif\\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\\nattribute float aLinesofar;\\nvarying highp float vLinesofar;\\n#endif\\nuniform float cameraToCenterDistance;\\n#if defined(HAS_STROKE_WIDTH)\\nattribute float aLineStrokeWidth;\\n#else\\nuniform float lineStrokeWidth;\\n#endif\\nuniform mat4 positionMatrix;\\nuniform mat4 projViewModelMatrix;\\nuniform mat4 modelMatrix;\\nuniform float tileResolution;\\nuniform float resolution;\\nuniform float tileRatio;\\nuniform float isRenderingTerrain;\\n#if defined(HAS_LINE_DX) || defined(HAS_LINE_DY)\\nattribute vec2 aLineDxDy;\\n#endif\\n#ifndef HAS_LINE_DX\\nuniform float lineDx;\\n#endif\\n#ifndef HAS_LINE_DY\\nuniform float lineDy;\\n#endif\\nuniform vec2 canvasSize;\\nuniform float layerScale;\\nvarying vec2 vNormal;\\nvarying vec2 vWidth;\\nvarying float vGammaScale;\\n#ifndef ENABLE_TILE_STENCIL\\nvarying vec2 vPosition;\\n#endif\\n#ifdef USE_LINE_OFFSET\\nattribute vec2 aExtrudeOffset;\\n#endif\\n#ifdef HAS_LINE_WIDTH\\nattribute float aLineWidth;\\n#else\\nuniform float lineWidth;\\n#endif\\n#ifndef PICKING_MODE\\n#ifndef HAS_GRADIENT\\n#ifdef HAS_COLOR\\nattribute vec4 aColor;\\nvarying vec4 vColor;\\n#endif\\n#ifdef HAS_PATTERN\\n#if defined(HAS_PATTERN_ANIM) || defined(HAS_PATTERN_GAP)\\nattribute vec2 aLinePattern;\\n#endif\\n#ifdef HAS_PATTERN_ANIM\\nvarying float vLinePatternAnimSpeed;\\n#endif\\n#ifdef HAS_PATTERN_GAP\\nvarying float vLinePatternGap;\\n#endif\\nattribute vec4 aTexInfo;\\nvarying vec4 vTexInfo;\\n#endif\\n#ifdef HAS_DASHARRAY\\n#ifdef HAS_DASHARRAY_ATTR\\nattribute vec4 aDasharray;\\nvarying vec4 vDasharray;\\n#endif\\n#ifdef HAS_DASHARRAY_COLOR\\nattribute vec4 aDashColor;\\nvarying vec4 vDashColor;\\n#endif\\n#endif\\n#endif\\n#ifdef HAS_STROKE_COLOR\\nattribute vec4 aStrokeColor;\\nvarying vec4 vStrokeColor;\\n#endif\\n#ifdef HAS_OPACITY\\nattribute float aOpacity;\\nvarying float vOpacity;\\n#endif\\n#ifdef HAS_GRADIENT\\nattribute float aGradIndex;\\nvarying float vGradIndex;\\n#endif\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\n#include \\n#endif\\n#include \\n#else\\n#include \\n#endif\\nvarying vec3 vVertex;\\n#include \\nvoid main() {\\n vec3 c = unpackVTPosition();\\n float d = mod(abs(aExtrude.x), 2.);\\n float e = mod(abs(aExtrude.y), 2.);\\n vNormal = vec2(d, e * 2. - 1.);\\n vec4 f = vec4(c, 1.);\\n vec4 h = projViewModelMatrix * positionMatrix * f;\\n if(isRenderingTerrain == 1.) {\\n vVertex = (positionMatrix * f).xyz;\\n } else {\\n vVertex = (modelMatrix * positionMatrix * f).xyz;\\n }\\n#ifdef HAS_STROKE_WIDTH\\nfloat i = aLineStrokeWidth / 2. * layerScale;\\n#else\\nfloat i = lineStrokeWidth;\\n#endif\\n#ifdef HAS_LINE_WIDTH\\nfloat j = aLineWidth / 2. * layerScale;\\n#else\\nfloat j = lineWidth * layerScale;\\n#endif\\nfloat k = j / 2. + i;\\n float l = sign(i) * j / 2.;\\n float m = l + sign(l) * ANTIALIASING;\\n float n = k + sign(k) * ANTIALIASING;\\n#ifdef USE_LINE_OFFSET\\nvec2 o = lineOffset * (vNormal.y * (aExtrude.xy - aExtrudeOffset) + aExtrudeOffset);\\n vec2 u = (n * aExtrude.xy + o) / EXTRUDE_SCALE;\\n#else\\nvec2 v = aExtrude.xy / EXTRUDE_SCALE;\\n vec2 u = n * v;\\n#endif\\nfloat A = tileResolution / resolution;\\n vec4 B = vec4(c + vec3(u, .0) * tileRatio / A, 1.);\\n gl_Position = projViewModelMatrix * positionMatrix * B;\\n#ifdef HAS_LINE_DX\\nfloat C = aLineDxDy[0];\\n#else\\nfloat C = lineDx;\\n#endif\\n#ifdef HAS_LINE_DY\\nfloat D = aLineDxDy[1];\\n#else\\nfloat D = lineDy;\\n#endif\\nfloat E = gl_Position.w;\\n gl_Position.xy += vec2(C, D) * 2. / canvasSize * E;\\n#ifndef PICKING_MODE\\nvWidth = vec2(n, m);\\n if(isRenderingTerrain == 1.) {\\n vGammaScale = 1.;\\n } else {\\n vGammaScale = E / cameraToCenterDistance;\\n }\\n#ifndef ENABLE_TILE_STENCIL\\nvPosition = c.xy;\\n#ifdef USE_LINE_OFFSET\\nvPosition += tileRatio * o / EXTRUDE_SCALE;\\n#endif\\n#endif\\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT)\\n#ifdef HAS_GRADIENT\\nvLinesofar = aLinesofar / MAX_LINE_DISTANCE;\\n vGradIndex = aGradIndex;\\n#else\\nfloat F = aLinesofar - k * aExtrude.z / EXTRUDE_SCALE / A * tileRatio;\\n vLinesofar = F / tileRatio * A;\\n#endif\\n#endif\\n#ifndef HAS_GRADIENT\\n#ifdef HAS_COLOR\\nvColor = aColor;\\n#endif\\n#ifdef HAS_DASHARRAY\\n#ifdef HAS_DASHARRAY_ATTR\\nvDasharray = aDasharray;\\n#endif\\n#ifdef HAS_DASHARRAY_COLOR\\nvDashColor = aDashColor / 255.;\\n#endif\\n#endif\\n#ifdef HAS_PATTERN\\nvTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\\n#ifdef HAS_PATTERN_ANIM\\nvLinePatternAnimSpeed = aLinePattern[0] / 127.;\\n#endif\\n#ifdef HAS_PATTERN_GAP\\nvLinePatternGap = aLinePattern[1] / 10.0;\\n#endif\\n#endif\\n#endif\\n#ifdef HAS_STROKE_COLOR\\nvStrokeColor = aStrokeColor;\\n#endif\\n#ifdef HAS_OPACITY\\nvOpacity = aOpacity / 255.;\\n#endif\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nshadow_computeShadowPars(B);\\n#endif\\nhighlight_setVarying();\\n#else\\nfbo_picking_setData(E, true);\\n#endif\\n}\";var Fn = _gl.mat4.identity([]),On = [];var Rn = exports.LinePainter = function (_gn2) {function Rn() {_classCallCheck(this, Rn);return _callSuper(this, Rn, arguments);}_inherits(Rn, _gn2);return _createClass(Rn, [{ key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return !1;} }, { key: \"prepareSymbol\", value: function prepareSymbol(e) {var t = e.lineColor;Array.isArray(t) && (3 === t.length && t.push(1), e.lineColor = t.map(function (e) {return 255 * e;}));var n = e.lineStrokeColor;Array.isArray(n) && (3 === n.length && n.push(1), e.lineStrokeColor = n.map(function (e) {return 255 * e;}));var i = e.lineDashColor;Array.isArray(i) && (3 === i.length && i.push(1), e.lineDashColor = i.map(function (e) {return 255 * e;}));} }, { key: \"isAnimating\", value: function isAnimating() {if (this._hasPatternAnim) return !0;var e = this.getSymbols(),t = this.sceneConfig.trailAnimation;if (t && t.enable) return !0;for (var _t272 = 0; _t272 < e.length; _t272++) if (e[_t272].linePatternFile && e[_t272].linePatternAnimSpeed) return !0;return !1;} }, { key: \"needToRedraw\", value: function needToRedraw() {return !!_superPropGet(Rn, \"needToRedraw\", this, 3)([]) || !!this.isAnimating();} }, { key: \"isBloom\", value: function isBloom(e) {return !!this.getSymbol(e.properties.symbolIndex)[Rn.getBloomSymbol()[0]];} }, { key: \"needPolygonOffset\", value: function needPolygonOffset() {return !0;} }, { key: \"createMesh\", value: function createMesh(t, n) {if (!t.geometry) return null;var i = t.geometry,r = t.symbolIndex,o = t.ref,a = this.getSymbolDef(r);if (void 0 === o) {St(i, a, this.getFnTypeConfig(r), this.layer);}var l = this.getSymbol(r),h = { tileResolution: i.properties.tileResolution, tileRatio: i.properties.tileRatio, tileExtent: i.properties.tileExtent, fogFactor: this.layer.options.fogFactor || 0 };this.setLineUniforms(l, h), ke(h, \"lineColor\", l, \"lineColor\", \"#fff\", Re(this.colorCache)), ke(h, \"linePatterGapColor\", l, \"linePatterGapColor\", [0, 0, 0, 0], Re(this.colorCache)), ke(h, \"lineStrokeColor\", l, \"lineStrokeColor\", [0, 0, 0, 0], Re(this.colorCache)), ke(h, \"lineDasharray\", l, \"lineDasharray\", [0, 0, 0, 0], function (e) {var t;if (e && e.length) {var _n189 = e;1 === e.length ? t = [_n189[0], _n189[0], _n189[0], _n189[0]] : 2 === e.length ? t = [_n189[0], _n189[1], _n189[0], _n189[1]] : 3 === e.length ? t = [_n189[0], _n189[1], _n189[2], _n189[2]] : 4 === e.length ? t = e : e.length > 4 && (t = e.slice(0, 4));}return t || [0, 0, 0, 0];}), ke(h, \"lineDashColor\", l, \"lineDashColor\", [0, 0, 0, 0], Re(this.colorCache));var c = i.properties.iconAtlas,u = this.layer instanceof e.TileLayer;c && (h.linePatternFile = yn(this.regl, c, !1, !1), h.atlasSize = c ? [c.width, c.height] : [0, 0], h.flipY = u ? -1 : 1, this.drawDebugAtlas(c)), void 0 === o && i.generateBuffers(this.regl);var f = new _gl.reshader.Material(h),d = new _gl.reshader.Mesh(i, f, { castShadow: !1, picking: !0 });d.setLocalTransform(n), d.positionMatrix = this.getAltitudeOffsetMatrix();var p = {};return c && (p.HAS_PATTERN = 1), d.properties.symbolIndex = r, this._prepareDashDefines(d, p), i.data.aColor && (p.HAS_COLOR = 1), i.data.aStrokeColor && (p.HAS_STROKE_COLOR = 1), this.setMeshDefines(p, i, a), i.data.aAltitude && (p.HAS_ALTITUDE = 1), d.setDefines(p), d;} }, { key: \"addMesh\", value: function addMesh() {var _this46 = this;delete this._hasPatternAnim;for (var _len7 = arguments.length, e = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {e[_key7] = arguments[_key7];}var t = e[0];Array.isArray(t) ? t.forEach(function (e) {_this46._prepareMesh(e);}) : this._prepareMesh(t), _superPropGet(Rn, \"addMesh\", this, 3)(e);} }, { key: \"_prepareMesh\", value: function _prepareMesh(e) {if (!e.geometry.aLineWidth && e.material.get(\"lineWidth\") <= 0 || !e.geometry.aOpacity && e.material.get(\"lineOpacity\") <= 0) return;var t = e.defines;this._prepareDashDefines(e, t), e.setDefines(t), e.geometry.properties.hasPatternAnim && (this._hasPatternAnim = 1);} }, { key: \"_prepareDashDefines\", value: function _prepareDashDefines(e, t) {var n = e.geometry,i = this.getSymbol(e.properties.symbolIndex);n.data.aDasharray || Array.isArray(i.lineDasharray) && i.lineDasharray.reduce(function (e, t) {return e + t;}, 0) > 0 ? (t.HAS_DASHARRAY = 1, n.data.aDasharray && (t.HAS_DASHARRAY_ATTR = 1), n.data.aDashColor && (t.HAS_DASHARRAY_COLOR = 1)) : t.HAS_DASHARRAY && delete t.HAS_DASHARRAY;} }, { key: \"setLineUniforms\", value: function setLineUniforms(e, t) {ke(t, \"lineWidth\", e, \"lineWidth\", 2), ke(t, \"lineOpacity\", e, \"lineOpacity\", 1), ke(t, \"lineStrokeWidth\", e, \"lineStrokeWidth\", 0), ke(t, \"lineBlur\", e, \"lineBlur\", .7), ke(t, \"lineOffset\", e, \"lineOffset\", 0), ke(t, \"lineDx\", e, \"lineDx\", 0), ke(t, \"lineDy\", e, \"lineDy\", 0), ke(t, \"linePatternAnimSpeed\", e, \"linePatternAnimSpeed\", 0), ke(t, \"linePatternGap\", e, \"linePatternGap\", 0);} }, { key: \"setMeshDefines\", value: function setMeshDefines(e, t, n) {t.data.aOpacity && (e.HAS_OPACITY = 1), t.data.aLineWidth && (e.HAS_LINE_WIDTH = 1), t.data.aLineStrokeWidth && (e.HAS_STROKE_WIDTH = 1), Lt(n.lineDx) && (e.HAS_LINE_DX = 1), Lt(n.lineDy) && (e.HAS_LINE_DY = 1), Lt(n.linePatternAnimSpeed) && (e.HAS_PATTERN_ANIM = 1), Lt(n.linePatternGap) && (e.HAS_PATTERN_GAP = 1);} }, { key: \"paint\", value: function paint(e) {this.isShadowIncludeChanged(e) && (this.shader.dispose(), this.createShader(e)), _superPropGet(Rn, \"paint\", this, 3)([e]);} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {var _this47 = this;var n = (0, _functionType.piecewiseConstant)(t.lineColor),i = (0, _functionType.piecewiseConstant)(t.aLinePatternAnimSpeed),r = (0, _functionType.piecewiseConstant)(t.aLinePatternGap),s = this.createShapeFnTypeConfigs(e, t),o = new Int8Array(2);return [{ attrName: \"aColor\", symbolName: \"lineColor\", type: Uint8Array, width: 4, define: \"HAS_COLOR\", evaluate: function evaluate(t, i) {var r = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this47.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = _this47.colorCache[r] = _this47.colorCache[r] || (0, _color.default)(r).unitArray()), r = Oe(r), r;} }, { attrName: \"aLinePattern\", symbolName: \"linePatternAnimSpeed\", type: Int8Array, width: 2, related: [\"linePatternGap\"], define: \"HAS_LINE_PATTERN\", evaluate: function evaluate(t, n, r, s) {var a = i(e.getZoom(), t);return Ie(a) && (a = 0), 0 !== a && (n.properties.hasPatternAnim = 1), o[0] = a / 127, o[1] = r[s + 1], o;} }, { attrName: \"aLinePattern\", symbolName: \"linePatternGap\", type: Int8Array, width: 2, related: [\"linePatternAnimSpeed\"], define: \"HAS_LINE_PATTERN\", evaluate: function evaluate(t, n, i, s) {var a = r(e.getZoom(), t);return Ie(a) && (a = 0), o[1] = 10 * a, o[0] = i[s], o;} }].concat(s);} }, { key: \"createShapeFnTypeConfigs\", value: function createShapeFnTypeConfigs(e, t) {var _this48 = this;var n = (0, _functionType.interpolated)(t.lineWidth),i = (0, _functionType.interpolated)(t.lineOpacity),r = (0, _functionType.interpolated)(t.lineStrokeWidth),s = (0, _functionType.interpolated)(t.lineDx),o = (0, _functionType.interpolated)(t.lineDy),a = new Uint16Array(1),l = new Int8Array(1);return [{ attrName: \"aLineWidth\", symbolName: \"lineWidth\", type: Uint8Array, width: 1, define: \"HAS_LINE_WIDTH\", evaluate: function evaluate(t, i) {var r = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this48.evaluateInFnTypeConfig(r, i, e, t)), a[0] = Math.round(2 * r), a[0];} }, { attrName: \"aLineStrokeWidth\", symbolName: \"lineStrokeWidth\", type: Uint8Array, width: 1, define: \"HAS_STROKE_WIDTH\", evaluate: function evaluate(t) {var n = r(e.getZoom(), t);return a[0] = Math.round(2 * n), a[0];} }, { attrName: \"aLineDxDy\", symbolName: \"lineDx\", type: Int8Array, width: 2, index: 0, define: \"HAS_LINE_DX\", evaluate: function evaluate(t) {var n = s(e.getZoom(), t);return l[0] = n, l[0];} }, { attrName: \"aLineDxDy\", symbolName: \"lineDy\", type: Int8Array, width: 2, index: 1, define: \"HAS_LINE_DY\", evaluate: function evaluate(t) {var n = o(e.getZoom(), t);return l[0] = n, l[0];} }, { attrName: \"aOpacity\", symbolName: \"lineOpacity\", type: Uint8Array, width: 1, define: \"HAS_OPACITY\", evaluate: function evaluate(t, n) {var r = i(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this48.evaluateInFnTypeConfig(r, n, e, t)), a[0] = 255 * r, a[0];} }];} }, { key: \"updateSceneConfig\", value: function updateSceneConfig(e) {e.trailAnimation && this.createShader(this._context);} }, { key: \"init\", value: function init(e) {var t = this.regl;this.renderer = new _gl.reshader.Renderer(t), this.createShader(e), this.pickingFBO && (this.picking = [new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + kn, uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }], extraCommandProps: this.getExtraCommandProps() }, this.pickingFBO, this.getMap())]);} }, { key: \"createShader\", value: function createShader(e) {this._context = e;var t = [],n = {};this.fillIncludes(n, t, e), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (n.HAS_TRAIL = 1);var i = [];t.push({ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply(i, t.projViewMatrix, t.modelMatrix), i;} }), this.shader = new _gl.reshader.MeshShader({ vert: kn, frag: \"#define SHADER_NAME LINE\\n#define DEVICE_PIXEL_RATIO 1.0\\nprecision highp float;\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\n#include \\n#endif\\nuniform lowp float blendSrcIsOne;\\nuniform lowp float lineBlur;\\nuniform float isRenderingTerrain;\\n#ifdef HAS_COLOR\\nvarying vec4 vColor;\\n#else\\nuniform lowp vec4 lineColor;\\n#endif\\n#include \\n#ifdef HAS_STROKE_COLOR\\nvarying vec4 vStrokeColor;\\n#else\\nuniform lowp vec4 lineStrokeColor;\\n#endif\\n#ifdef HAS_OPACITY\\nvarying float vOpacity;\\n#else\\nuniform lowp float lineOpacity;\\n#endif\\nuniform float layerOpacity;\\n#ifdef HAS_PATTERN\\nuniform sampler2D linePatternFile;\\nuniform vec2 atlasSize;\\nuniform float flipY;\\n#ifdef HAS_PATTERN_ANIM\\nvarying float vLinePatternAnimSpeed;\\n#else\\nuniform float linePatternAnimSpeed;\\n#endif\\n#ifdef HAS_PATTERN_GAP\\nvarying float vLinePatternGap;\\n#else\\nuniform float linePatternGap;\\n#endif\\nuniform vec4 linePatterGapColor;\\nvarying vec4 vTexInfo;\\nvec2 c(vec2 d) {\\n vec2 e = mod(d, 1.);\\n vec2 f = vTexInfo.xy;\\n vec2 h = vTexInfo.zw;\\n return (f + e * h) / atlasSize;\\n}\\n#endif\\nvarying vec2 vNormal;\\nvarying vec2 vWidth;\\nvarying float vGammaScale;\\n#ifndef ENABLE_TILE_STENCIL\\nvarying vec2 vPosition;\\n#endif\\nuniform float tileExtent;\\n#ifdef HAS_DASHARRAY\\n#ifdef HAS_DASHARRAY_ATTR\\nvarying vec4 vDasharray;\\n#else\\nuniform vec4 lineDasharray;\\n#endif\\n#ifdef HAS_DASHARRAY_COLOR\\nvarying vec4 vDashColor;\\n#else\\nuniform vec4 lineDashColor;\\n#endif\\n#endif\\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\\nvarying highp float vLinesofar;\\n#endif\\n#ifdef HAS_TRAIL\\nuniform float trailSpeed;\\nuniform float trailLength;\\nuniform float trailCircle;\\n#endif\\n#if defined(HAS_TRAIL) || defined(HAS_PATTERN)\\nuniform float currentTime;\\n#endif\\nfloat i(float j, float k) {\\n float l = k / 2.;\\n float m = abs(j - l);\\n float n = (.1 + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\\n return clamp(min(m + n, l - m) / n, .0, 1.);\\n}\\nvarying vec3 vVertex;\\nuniform vec3 cameraPosition;\\nuniform float cameraToCenterDistance;\\nuniform float fogFactor;\\nvoid main() {\\n \\n#ifndef ENABLE_TILE_STENCIL\\nfloat o = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\\n if(o == .0) {\\n discard;\\n }\\n#endif\\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\\nfloat u = vLinesofar;\\n#endif\\nfloat v = length(vNormal) * vWidth.s;\\n#ifdef HAS_PATTERN\\nvec2 h = vTexInfo.zw;\\n float A = sign(h.x * h.y);\\n float B = mix(lineBlur, .0, A);\\n#else\\nfloat B = lineBlur;\\n#endif\\nfloat n = (B + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\\n float C = clamp(min(v - (vWidth.t - n), vWidth.s - v) / n, .0, 1.);\\n#ifdef HAS_COLOR\\nvec4 D = vColor / 255.;\\n#else\\nvec4 D = lineColor;\\n#endif\\n#ifdef HAS_PATTERN\\nif(A == 1.) {\\n \\n#ifdef HAS_PATTERN_GAP\\nfloat E = vLinePatternGap;\\n#else\\nfloat E = linePatternGap;\\n#endif\\n#ifdef HAS_PATTERN_ANIM\\nfloat F = vLinePatternAnimSpeed;\\n#else\\nfloat F = linePatternAnimSpeed;\\n#endif\\nfloat G = h.x * vWidth.s * 2. / h.y;\\n float H = G * (1. + E);\\n u += mod(currentTime * -F * .2, H);\\n float I = mod(u / H, 1.);\\n float J = mod((flipY * vNormal.y + 1.) / 2., 1.);\\n vec4 K = texture2D(linePatternFile, c(vec2(I * (1. + E), J)));\\n float L = clamp(sign(1. / (1. + E) - I) + .000001, .0, 1.);\\n K = mix(linePatterGapColor, K, L);\\n D *= K;\\n }\\n#endif\\n#ifdef HAS_DASHARRAY\\n#ifdef HAS_DASHARRAY_ATTR\\nvec4 M = vDasharray;\\n#else\\nvec4 M = lineDasharray;\\n#endif\\n#ifdef HAS_DASHARRAY_COLOR\\nvec4 N = vDashColor;\\n#else\\nvec4 N = lineDashColor;\\n#endif\\nfloat k = M[0] + M[1] + M[2] + M[3];\\n float j = mod(u, k);\\n float O = max(sign(M[0] - j), .0);\\n float P = j - M[0] - M[1];\\n float Q = max(sign(P), .0) * max(sign(M[2] - P), .0);\\n float R = O + Q;\\n float S = i(j, M[0]);\\n float T = i(P, M[2]);\\n float U = S * O + T * Q;\\n D = D * (1. - U) + N * U;\\n#endif\\n#ifdef HAS_STROKE_COLOR\\nvec4 V = vStrokeColor / 255.;\\n#else\\nvec4 V = lineStrokeColor;\\n#endif\\nV = mix(D, V, sign(vWidth.t));\\n D = V * C + max(sign(vWidth.t - v), .0) * D * (1. - C);\\n#ifdef HAS_TRAIL\\nfloat W = mod(u - currentTime * trailSpeed * .1, trailCircle);\\n float X = W < trailLength ? mix(.0, 1., W / trailLength) : .0;\\n D *= X;\\n#endif\\n#ifdef HAS_OPACITY\\nfloat Y = vOpacity;\\n#else\\nfloat Y = lineOpacity;\\n#endif\\ngl_FragColor = D * Y * layerOpacity;\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nfloat Z = shadow_computeShadow();\\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, Z);\\n#endif\\nfloat ba;\\n if(isRenderingTerrain == 1.) {\\n ba = 1.;\\n } else {\\n ba = clamp(cameraToCenterDistance * 1.5 / distance(vVertex, cameraPosition), .0, 1.);\\n }\\n gl_FragColor *= ba;\\n gl_FragColor = highlight_blendColor(gl_FragColor);\\n if(fogFactor > .0) {\\n vec3 bb = vec3(vVertex[0] - cameraPosition[0], vVertex[1] - cameraPosition[1], vVertex[2] - cameraPosition[2]);\\n float bc = length(bb);\\n float bd = clamp(1. - (bc * 1.2) / fogFactor, .0, 1.);\\n gl_FragColor *= bd;\\n }\\n}\", uniforms: t, defines: n, extraCommandProps: this.getExtraCommandProps(e) });} }, { key: \"isEnableTileStencil\", value: function isEnableTileStencil(e) {return !!!(e && e.isRenderingTerrain && this.isTerrainSkin());} }, { key: \"getExtraCommandProps\", value: function getExtraCommandProps() {var _this49 = this;var e = this.canvas;return { viewport: { x: function x(e, t) {return t.viewport ? t.viewport.x : 0;}, y: function y(e, t) {return t.viewport ? t.viewport.y : 0;}, width: function width(t, n) {return n.viewport ? n.viewport.width : e ? e.width : 1;}, height: function height(t, n) {return n.viewport ? n.viewport.height : e ? e.height : 1;} }, stencil: { enable: function enable(e, t) {return _this49.isEnableTileStencil(t.painterContext);}, mask: 255, func: { cmp: function cmp() {return \"<=\";}, ref: function ref(e, t) {return t.stencilRef;} }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, depth: { enable: !0, range: this.sceneConfig.depthRange || [0, 1], mask: this.sceneConfig.depthMask || !1, func: this.sceneConfig.depthFunc || \"<=\" }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } };} }, { key: \"getUniformValues\", value: function getUniformValues(e, t) {var n = t && t.isRenderingTerrainSkin,i = this.layer.getTileSize().width,r = n ? Fn : e.projViewMatrix,s = e.viewMatrix,o = e.cameraToCenterDistance,a = e.getResolution(),l = _gl.vec2.set(On, e.width, e.height);n && _gl.vec2.set(l, i, i);var h = this.getBlendFunc().src(),c = this.sceneConfig.trailAnimation || {},u = { layerScale: this.layer.options.styleScale || 1, projViewMatrix: r, viewMatrix: s, cameraToCenterDistance: o, resolution: a, canvasSize: l, trailSpeed: c.speed || 1, trailLength: c.trailLength || 500, trailCircle: c.trailCircle || 1e3, currentTime: this.layer.getRenderer().getFrameTimestamp() || 0, blendSrcIsOne: +!(1 !== h && \"one\" !== h), cameraPosition: e.cameraPosition, viewport: n && t && t.viewport, isRenderingTerrain: +!!n };return this.setIncludeUniformValues(u, t), u;} }], [{ key: \"getBloomSymbol\", value: function getBloomSymbol() {return [\"lineBloom\"];} }]);}(gn);var En = { markerFile: { type: \"identity\", default: null, property: \"_symbol_markerFile\" }, markerWidth: { type: \"identity\", default: null, property: \"_symbol_markerWidth\" }, markerHeight: { type: \"identity\", default: null, property: \"_symbol_markerHeight\" }, markerPathWidth: { type: \"identity\", default: 20, property: \"_symbol_markerPathWidth\" }, markerPathHeight: { type: \"identity\", default: 20, property: \"_symbol_markerPathHeight\" }, markerDx: { type: \"identity\", default: null, property: \"_symbol_markerDx\" }, markerDy: { type: \"identity\", default: null, property: \"_symbol_markerDy\" }, markerType: { type: \"identity\", default: null, property: \"_symbol_markerType\" }, markerPath: { type: \"identity\", default: null, property: \"_symbol_markerPath\" }, markerFill: { type: \"identity\", default: null, property: \"_symbol_markerFill\" }, markerFillPatternFile: { type: \"identity\", default: null, property: \"_symbol_markerFillPatternFile\" }, markerFillOpacity: { type: \"identity\", default: null, property: \"_symbol_markerFillOpacity\" }, markerLineColor: { type: \"identity\", default: null, property: \"_symbol_markerLineColor\" }, markerLineWidth: { type: \"identity\", default: null, property: \"_symbol_markerLineWidth\" }, markerLineOpacity: { type: \"identity\", default: null, property: \"_symbol_markerLineOpacity\" }, markerLineDasharray: { type: \"identity\", default: null, property: \"_symbol_markerLineDasharray\" }, markerLinePatternFile: { type: \"identity\", default: null, property: \"_symbol_markerLinePatternFile\" }, markerVerticalAlignment: { type: \"identity\", default: \"top\", property: \"_symbol_markerVerticalAlignment\" }, markerHorizontalAlignment: { type: \"identity\", default: \"middle\", property: \"_symbol_markerHorizontalAlignment\" }, markerOpacity: { type: \"identity\", default: 1, property: \"_symbol_markerOpacity\" }, markerPitchAlignment: { type: \"identity\", default: \"viewport\", property: \"_symbol_markerPitchAlignment\" }, markerRotationAlignment: { type: \"identity\", default: \"viewport\", property: \"_symbol_markerRotationAlignment\" }, markerRotation: { type: \"identity\", default: 0, property: \"_symbol_markerRotation\" }, markerAllowOverlap: { type: \"identity\", default: 0, property: \"_symbol_markerAllowOverlap\" }, markerIgnorePlacement: { type: \"identity\", default: 0, property: \"_symbol_markerIgnorePlacement\" }, markerTextFit: { type: \"identity\", default: null, property: \"_symbol_markerTextFit\" }, markerSpacing: { type: \"identity\", default: 250, property: \"_symbol_markerSpacing\" }, markerTextFitPadding: { type: \"identity\", default: null, property: \"_symbol_markerTextFitPadding\" }, markerPlacement: { type: \"identity\", default: \"point\", property: \"_symbol_markerPlacement\" } },Dn = { textName: { type: \"identity\", default: null, property: \"_symbol_textName\" }, textFaceName: { type: \"identity\", default: null, property: \"_symbol_textFaceName\" }, textWrapWidth: { type: \"identity\", default: null, property: \"_symbol_textWrapWidth\" }, textHorizontalAlignment: { type: \"identity\", default: null, property: \"_symbol_textHorizontalAlignment\" }, textVerticalAlignment: { type: \"identity\", default: null, property: \"_symbol_textVerticalAlignment\" }, textFill: { type: \"identity\", default: null, property: \"_symbol_textFill\" }, textSize: { type: \"identity\", default: null, property: \"_symbol_textSize\" }, textHaloRadius: { type: \"identity\", default: null, property: \"_symbol_textHaloRadius\" }, textHaloFill: { type: \"identity\", default: null, property: \"_symbol_textHaloFill\" }, textHaloOpacity: { type: \"identity\", default: 255, property: \"_symbol_textHaloOpacity\" }, textDx: { type: \"identity\", default: 0, property: \"_symbol_textDx\" }, textDy: { type: \"identity\", default: 0, property: \"_symbol_textDy\" }, textOpacity: { type: \"identity\", default: 1, property: \"_symbol_textOpacity\" }, textPitchAlignment: { type: \"identity\", default: \"viewport\", property: \"_symbol_textPitchAlignment\" }, textRotationAlignment: { type: \"identity\", default: \"viewport\", property: \"_symbol_textRotationAlignment\" }, textRotation: { type: \"identity\", default: 0, property: \"_symbol_textRotation\" }, textAllowOverlap: { type: \"identity\", default: 0, property: \"_symbol_textAllowOverlap\" }, textIgnorePlacement: { type: \"identity\", default: 0, property: \"_symbol_textIgnorePlacement\" }, textSpacing: { type: \"identity\", default: 250, property: \"_symbol_textSpacing\" }, textPlacement: { type: \"identity\", default: \"point\", property: \"_symbol_textPlacement\" } },Ln = { lineWidth: { type: \"identity\", default: 2, property: \"_symbol_lineWidth\" }, lineStrokeWidth: { type: \"identity\", default: 0, property: \"_symbol_lineStrokeWidth\" }, lineColor: { type: \"identity\", default: [1, 1, 1, 1], property: \"_symbol_lineColor\" }, lineStrokeColor: { type: \"identity\", default: [0, 0, 0, 0], property: \"_symbol_lineStrokeColor\" }, lineDx: { type: \"identity\", default: 0, property: \"_symbol_lineDx\" }, lineDy: { type: \"identity\", default: 0, property: \"_symbol_lineDy\" }, linePatternFile: { type: \"identity\", default: null, property: \"_symbol_linePatternFile\" }, linePatternAnimSpeed: { type: \"identity\", default: 0, property: \"_symbol_linePatternAnimSpeed\" }, linePatternGap: { type: \"identity\", default: 0, property: \"_symbol_linePatternGap\" }, lineOpacity: { type: \"identity\", default: 1, property: \"_symbol_lineOpacity\" }, lineJoin: { type: \"identity\", default: null, property: \"_symbol_lineJoin\" }, lineCap: { type: \"identity\", default: null, property: \"_symbol_lineCap\" }, lineDasharray: { type: \"identity\", default: null, property: \"_symbol_lineDasharray\" }, lineDashColor: { type: \"identity\", default: null, property: \"_symbol_lineDashColor\" } },Hn = \"_line_gradient_property\",_H7 = H(),Nn = _H7.PackUtil,zn = new e.Point(0, 0),Vn = \"_vector3dlayer_id\",Un = (Hn + \"\").trim();function Bn(t, n, i) {var r = (pe + \"\").trim(),s = t.getMap(),o = s.getGLRes();var a = t.getCoordinates();var l = [],h = [];var c = 1;if (t instanceof e.Marker || t instanceof e.MultiPoint) {t instanceof e.Marker && (a = [a]);for (var _e294 = 0; _e294 < a.length; _e294++) s.coordToPointAtRes(a[_e294], o, zn), l.push([zn.x, zn.y, a[_e294].z || 0]), h.push([a[_e294].x, a[_e294].y]);} else if (t instanceof e.LineString || t instanceof e.MultiLineString) {c = 2, t instanceof e.LineString && (a = [a]);for (var _e295 = 0; _e295 < a.length; _e295++) {l[_e295] = [], h[_e295] = [];for (var _t273 = 0; _t273 < a[_e295].length; _t273++) s.coordToPointAtRes(a[_e295][_t273], o, zn), l[_e295].push([zn.x, zn.y, a[_e295][_t273].z || 0]), h[_e295].push([a[_e295][_t273].x, a[_e295][_t273].y]);}} else if (t instanceof e.Polygon || t instanceof e.MultiPolygon) {c = 3, t instanceof e.Circle || t instanceof e.Rectangle || t instanceof e.Ellipse || t instanceof e.Sector ? a = [[t.getShell()]] : t instanceof e.Polygon && (a = [a]);var _n190 = 0;for (var _e296 = 0; _e296 < a.length; _e296++) {var _t274 = !1;for (var _i144 = 0; _i144 < a[_e296].length; _i144++) {if (l[_n190] = [], h[_n190] = [], _t274) for (var _t275 = a[_e296][_i144].length - 1; _t275 >= 0; _t275--) s.coordToPointAtRes(a[_e296][_i144][_t275], o, zn), l[_n190].push([zn.x, zn.y, a[_e296][_i144][_t275].z || 0]), h[_n190].push([a[_e296][_i144][_t275].x, a[_e296][_i144][_t275].y]);else for (var _t276 = 0; _t276 < a[_e296][_i144].length; _t276++) s.coordToPointAtRes(a[_e296][_i144][_t276], o, zn), l[_n190].push([zn.x, zn.y, a[_e296][_i144][_t276].z || 0]), h[_n190].push([a[_e296][_i144][_t276].x, a[_e296][_i144][_t276].y]);0 === _i144 && (_t274 = Nn.calculateSignedArea(l[_n190]) < 0, _t274 && (l[_n190] = l[_n190].reverse(), h[_n190] = h[_n190].reverse())), _n190++;}}}var u = t.getProperties() ? Object.assign({}, t.getProperties()) : {},f = t._getInternalSymbol() || function (t) {if (t instanceof e.Marker || t instanceof e.MultiPoint) return { markerType: \"ellipse\", markerWidth: 8, markerHeight: 0, markerFill: \"#000\" };if (t instanceof e.LineString || t instanceof e.MultiLineString) return { lineColor: \"#000\", lineWidth: 1 };if (t instanceof e.Polygon || t instanceof e.MultiPolygon) return { polygonFill: \"#fff\", lineColor: \"#000\", lineWidth: 1 };}(t),d = i ? Array.isArray(i) ? i[0].id : i.id : n.id++;if (Array.isArray(f) && f.length) {var _e297 = [],_s90 = f.length;for (var _o69 = 0; _o69 < _s90; _o69++) {var _a46 = _o69 === _s90 - 1 ? u : U({}, u),_p5 = Gn(f[_o69], _a46);for (var _e298 in f[_o69]) if (q(f[_o69], _e298)) {_a46[(\"_symbol_\" + _e298).trim()] = f[_o69][_e298];}_p5 && (f[_o69].lineGradientProperty = _p5);var _g5 = i && i[_o69] ? i[_o69][r] : n.pickingId++,_m5 = { type: c, id: d, properties: _a46, visible: t.isVisible(), geometry: l, coordinates: h, extent: 1 / 0 };_m5[r] = _g5, _e297.push(_m5);}return _e297;}if (f) {var _e299 = Gn(f, u);for (var _e300 in f) if (q(f, _e300)) {u[(\"_symbol_\" + _e300).trim()] = f[_e300];}_e299 && (f.lineGradientProperty = _e299);}var p = i ? i.id : n.pickingId++,g = { type: c, id: d, properties: u, visible: t.isVisible(), geometry: l, coordinates: h, extent: 1 / 0 };return g[r] = p, g;}function Gn(e, t) {var n = e.lineGradientProperty;return n && (t[Un] = t[n], t.mapbox_clip_start = 0, t.mapbox_clip_end = 1, delete t[n]), n;}var jn = function (_Rn) {function jn() {_classCallCheck(this, jn);return _callSuper(this, jn, arguments);}_inherits(jn, _Rn);return _createClass(jn, [{ key: \"postCreateGeometry\", value: function postCreateGeometry(e) {this.generateGradProperties(e);} }, { key: \"startFrame\", value: function startFrame() {for (var _len8 = arguments.length, e = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {e[_key8] = arguments[_key8];}_superPropGet(jn, \"startFrame\", this, 3)(e), this._updateMeshGradient();} }, { key: \"_updateMeshGradient\", value: function _updateMeshGradient() {if (this._changedMeshes) {for (var _e301 = 0; _e301 < this._changedMeshes.length; _e301++) {if (!this._changedMeshes[_e301] || !this._changedMeshes[_e301].isValid()) continue;var _this$_changedMeshes$ = this._changedMeshes[_e301],_t277 = _this$_changedMeshes$.geometry,_n191 = _this$_changedMeshes$.material,_i145 = _t277.properties.symbolIndex;this.generateGradProperties({ geometry: _t277, symbolIndex: _i145 });var _r117 = this._genGradientTexture(_t277.properties.gradients),_s91 = _n191.get(\"lineGradientTexture\");_s91 && _s91.destroy(), _t277.generateBuffers(this.regl), _n191.set(\"lineGradientTexture\", _r117), _n191.set(\"lineGradientTextureHeight\", _r117.height);}delete this._changedMeshes;}} }, { key: \"onFeatureChange\", value: function onFeatureChange(e, t) {this._changedMeshes || (this._changedMeshes = []);for (var _n192 = 0; _n192 < t.length; _n192++) {if (!t[_n192] || !t[_n192].isValid()) continue;var _i146 = t[_n192].geometry,_r118 = _i146.properties.features;if (!_r118) continue;var _s92 = e && e[Vn];_r118[_s92] && (_r118[_s92].feature.properties[Hn] = e.properties[Hn], this._changedMeshes.push(t[_n192]), this.setToRedraw());}} }, { key: \"needRebuildOnGometryPropertiesChanged\", value: function needRebuildOnGometryPropertiesChanged() {return !1;} }, { key: \"generateGradProperties\", value: function generateGradProperties(e) {var t = e.symbolIndex,n = e.geometry,i = n.properties.features,r = this.getSymbol(t).lineGradientProperty,s = n.properties.aPickingId || n.data.aPickingId,o = new Uint8Array(s.length),a = [],l = new Map();function h(e) {var t = e && e[r];Array.isArray(t) || (t = [0, \"black\", 1, \"black\"]);var n,i = t.join();return l.has(i) ? n = l.get(i) : (n = a.length, l.set(i, n), a.push(t)), n;}var c = s[0],u = i[c].feature.properties,f = h(u);for (var _e302 = 1; _e302 < s.length; _e302++) s[_e302] !== c && (c = s[_e302], u = i[c].feature.properties, f = h(u)), o[_e302] = f;if (n.data.aGradIndex) {var _e303 = n.data.aGradIndex;_e303 && _e303.buffer && _e303.buffer.destroy && _e303.buffer.destroy();}n.data.aGradIndex = o, n.properties.gradients = a;} }, { key: \"createMesh\", value: function createMesh(e, t) {var n = e.geometry,i = e.symbolIndex,r = e.ref,o = this.getSymbolDef(i);if (void 0 === r) {St(n, o, this.getFnTypeConfig(i), this.layer);}var a = { tileResolution: n.properties.tileResolution, tileRatio: n.properties.tileRatio, tileExtent: n.properties.tileExtent },l = this.getSymbol(i);this.setLineUniforms(l, a);var h = this._genGradientTexture(n.properties.gradients);a.lineGradientTexture = h, a.lineGradientTextureHeight = h.height, void 0 === r && n.generateBuffers(this.regl);var c = new _gl.reshader.Material(a),u = new _gl.reshader.Mesh(n, c, { castShadow: !1, picking: !0 });u.setLocalTransform(t);var f = { HAS_GRADIENT: 1 };return n.data.aAltitude && (f.HAS_ALTITUDE = 1), this.setMeshDefines(f, n, o), u.setDefines(f), u.properties.symbolIndex = i, u;} }, { key: \"_genGradientTexture\", value: function _genGradientTexture(e) {var t = 2 * e.length;return this.regl.texture({ width: 256, height: t, data: Wn(e), format: \"rgba\", mag: \"linear\", min: \"linear\", flipY: !1 });} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {return this.createShapeFnTypeConfigs(e, t);} }, { key: \"createShader\", value: function createShader(e) {this._context = e;var t = [],n = {};this.fillIncludes(n, t, e), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (n.HAS_TRAIL = 1);var i = [];t.push({ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply(i, t.projViewMatrix, t.modelMatrix), i;} }), this.shader = new _gl.reshader.MeshShader({ vert: kn, frag: \"#define SHADER_NAME LINE_GRADIENT\\n#define DEVICE_PIXEL_RATIO 1.0\\n#define MAX_LINE_COUNT 128.0\\nprecision mediump float;\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\n#include \\n#endif\\n#ifdef HAS_OPACITY\\nvarying float vOpacity;\\n#else\\nuniform lowp float lineOpacity;\\n#endif\\nuniform float layerOpacity;\\nuniform lowp float lineBlur;\\nuniform float lineGradientTextureHeight;\\nuniform float tileExtent;\\nuniform sampler2D lineGradientTexture;\\nvarying vec2 vNormal;\\nvarying vec2 vWidth;\\nvarying float vGammaScale;\\nvarying highp float vLinesofar;\\nvarying float vGradIndex;\\n#ifndef ENABLE_TILE_STENCIL\\nvarying vec2 vPosition;\\n#endif\\n#ifdef HAS_TRAIL\\nuniform float trailSpeed;\\nuniform float trailLength;\\nuniform float trailCircle;\\nuniform float currentTime;\\n#endif\\n#include \\nvoid main() {\\n \\n#ifndef ENABLE_TILE_STENCIL\\nfloat c = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\\n if(c == .0) {\\n discard;\\n }\\n#endif\\nfloat d = length(vNormal) * vWidth.s;\\n float e = (lineBlur + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\\n float f = clamp(min(d - (vWidth.t - e), vWidth.s - d) / e, .0, 1.);\\n float h = vLinesofar;\\n vec4 i = texture2D(lineGradientTexture, vec2(h, (vGradIndex * 2. + .5) / lineGradientTextureHeight)) * f;\\n i *= max(sign(MAX_LINE_COUNT - vGradIndex), .0);\\n#ifdef HAS_TRAIL\\nfloat j = mod(h - currentTime * trailSpeed * .1, trailCircle);\\n float k = j < trailLength ? mix(.0, 1., j / trailLength) : .0;\\n i *= k;\\n#endif\\n#ifdef HAS_OPACITY\\nfloat l = vOpacity;\\n#else\\nfloat l = lineOpacity;\\n#endif\\ngl_FragColor = i * l * layerOpacity;\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nfloat m = shadow_computeShadow();\\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, m);\\n#endif\\ngl_FragColor = highlight_blendColor(gl_FragColor);\\n}\", uniforms: t, defines: n, extraCommandProps: this.getExtraCommandProps() });} }]);}(Rn);function Wn(e) {e.length > 2048 && console.warn(\"Gradients count is (\".concat(e.length, \"), it may be slow to render.\"));var t = document.createElement(\"canvas\"),n = t.getContext(\"2d\");t.width = 256, t.height = 2 * e.length;for (var _t278 = 0; _t278 < e.length; _t278++) {var _i147 = e[_t278],_r119 = n.createLinearGradient(0, 0, 256, 0);for (var _e304 = 0; _e304 < _i147.length; _e304 += 2) _r119.addColorStop(+_i147[_e304], _i147[_e304 + 1]);n.fillStyle = _r119;var _s93 = _t278 % 256;n.fillRect(0, 2 * _s93, 256, 2 * _s93 + 2);}return n.canvas;}var Xn = function () {function Xn(e) {_classCallCheck(this, Xn);this._meshes = e || [], this.properties = {};}return _createClass(Xn, [{ key: \"meshes\", get: function get() {return this._meshes;}, set: function set(e) {this._meshes = e;} }]);}();var Yn = 224,Zn = 600,qn = 100,$n = new Uint8Array(1),Jn = [],Kn = { collides: 0, boxes: [] },Qn = [],ei = [];var ti = function (_gn3) {function ti() {_classCallCheck(this, ti);return _callSuper(this, ti, arguments);}_inherits(ti, _gn3);return _createClass(ti, [{ key: \"createGeometry\", value: function createGeometry() {for (var _len9 = arguments.length, t = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {t[_key9] = arguments[_key9];}var n = _superPropGet(ti, \"createGeometry\", this, 3)(t);if (!n || !n.geometry) return n;var i = n.geometry,r = t[0];i.properties.collideIds = r.featureIds && r.featureIds.length && r.isIdUnique ? r.featureIds : r.data.aPickingId;var s = this.layer instanceof e.TileLayer;return i.properties.uniqueCollideIds = ze(i.properties.collideIds, !s), n;} }, { key: \"supportRenderMode\", value: function supportRenderMode(e) {var t = this.sceneConfig.renderToPointRenderTarget;return t || void 0 === t ? \"point\" === e : \"fxaa\" === e || \"fxaaAfterTaa\" === e;} }, { key: \"addMesh\", value: function addMesh(e, t, n) {if (e && !this.isEnableCollision()) {var _t279 = e;Array.isArray(_t279) || (Qn[0] = e, _t279 = Qn);for (var _e305 = 0; _e305 < _t279.length; _e305++) {var _n193 = _t279[_e305].defines;delete _n193.ENABLE_COLLISION, _t279[_e305].setDefines(_n193);var _t279$_e305$geometry$ = _t279[_e305].geometry.properties,_i148 = _t279$_e305$geometry$.elements,_r120 = _t279$_e305$geometry$.visElemts;_r120 && void 0 !== _r120.count && _r120.count !== _i148.length && (_t279[_e305].geometry.setElements(_i148), _r120.count = _i148.length);}}return _superPropGet(ti, \"addMesh\", this, 3)([e, t, n]);} }, { key: \"startMeshCollision\", value: function startMeshCollision(e) {var t = e.properties.meshKey,n = this._cachedInstances.renderer,i = n.isForeground(e instanceof Xn ? e.meshes[0] : e);if (e.properties.isForeground = i, e instanceof Xn && e.meshes.length) for (var _t280 = 0; _t280 < e.meshes.length; _t280++) e.meshes[_t280].properties.isForeground = i;this._startTime = performance.now(), this._canProceed = this._canProceedCollision(), this._meshCollisionStale = this._isCachedCollisionStale(t);} }, { key: \"endMeshCollision\", value: function endMeshCollision(t) {var n = this._collisionContext.tags[t];if (this._canProceed && n && this._meshCollisionStale) {var _t281 = this.getMap();this._anchorCoord0 || (this._anchorCoord0 = new e.Coordinate(0, 0), this._anchorCoord1 = new e.Coordinate(0, 0)), n.anchor0 = _t281.containerPointToCoord(this._containerAnchor0, this._anchorCoord0), n.anchor1 = _t281.containerPointToCoord(this._containerAnchor1, this._anchorCoord1), n.anchor0.z = _t281.getZoom(), n.anchor0.width = _t281.width, n.anchor0.height = _t281.height, n.anchor0.pitch = _t281.getPitch();}this.getMap().collisionFrameTime += performance.now() - this._startTime;} }, { key: \"_isCachedCollisionStale\", value: function _isCachedCollisionStale(e) {var t = this.getMap(),n = t.getZoom(),i = t.getPitch(),_this$_getMeshAnchor = this._getMeshAnchor(e),_this$_getMeshAnchor2 = _slicedToArray(_this$_getMeshAnchor, 2),r = _this$_getMeshAnchor2[0],s = _this$_getMeshAnchor2[1];return !r || !s || r.z !== n || r.width !== t.width || r.height !== t.height || r.pitch !== i || r.distanceTo(this._containerAnchor0) > 3 || s.distanceTo(this._containerAnchor1) > 3;} }, { key: \"_startCollision\", value: function _startCollision() {var t = this.getMap();this._coordCache = {}, this._containerAnchor0 = new e.Point(t.width / 3, t.height / 2), this._containerAnchor1 = new e.Point(2 * t.width / 3, t.height / 2), delete this._canProceed, this._collisionContext || (this._collisionContext = { tags: {} }), this._cachedInstances = { layer: this.layer, renderer: this.layer.getRenderer(), frameTimestamp: this.layer.getRenderer().getFrameTimestamp(), map: this.getMap(), zoom: t.getZoom(), collisionTags: this._collisionContext.tags, isEnableUniquePlacement: this.isEnableUniquePlacement() };} }, { key: \"_endCollision\", value: function _endCollision() {} }, { key: \"_getCachedCollision\", value: function _getCachedCollision(e, t) {var n = this._collisionContext;return n.tags[e] && n.tags[e][t];} }, { key: \"_setCollisionCache\", value: function _setCollisionCache(e, t, n) {var i = this._collisionContext;i.tags[e] = i.tags[e] || [], i.tags[e][t] = n;} }, { key: \"_canProceedCollision\", value: function _canProceedCollision() {var e = this.getMap();if (!e.isInteracting()) return !0;var t = this.layer.options.collisionFrameLimit;return e.collisionFrameTime <= t;} }, { key: \"_getMeshAnchor\", value: function _getMeshAnchor(e) {var t = \"__meshAnchorKey\".trim(),n = this._collisionContext.tags[e];if (n && n.anchor0) {var _e306 = n.anchor0,_i149 = n.anchor1,_r121 = _e306[t] = _e306[t] || _e306.x + \",\" + _e306.y,_s94 = _i149[t] = _i149[t] || _i149.x + \",\" + _i149.y;var _o70 = this._coordCache[_r121],_a47 = this._coordCache[_s94];if (!_o70 || !_a47) {var _t282 = this.getMap();_o70 = this._coordCache[_r121] = _t282.coordToContainerPoint(_e306), _a47 = this._coordCache[_s94] = _t282.coordToContainerPoint(_i149);}return _o70.z = _e306.z, Jn[0] = _o70, Jn[1] = _a47, _o70.width = _e306.width, _o70.height = _e306.height, Jn;}return Jn[0] = Jn[1] = null, Jn;} }, { key: \"updateBoxCollisionFading\", value: function updateBoxCollisionFading(e, t, n, i, r) {var _this$_cachedInstance = this._cachedInstances,s = _this$_cachedInstance.layer,o = _this$_cachedInstance.renderer,a = _this$_cachedInstance.zoom,l = _this$_cachedInstance.collisionTags,h = _this$_cachedInstance.isEnableUniquePlacement,_t$properties = t.properties,c = _t$properties.meshKey,u = _t$properties.isForeground;if (h && this._isReplacedPlacement(c, r)) return !1;var f = n.length;var d = l[c] && l[c][r];var p = d,g = this._zooming && d;if (!(g && 0 !== d.collides) && e) {var _e307 = g && 0 === d.collides;if (this._canProceed || _e307) if ((this._meshCollisionStale || d && d.z !== a) && (d = null), d) {if (d.boxes && d.boxes.length) {var _d10 = d,_e308 = _d10.boxes,_t283 = _d10.isAllowOverlap;var _n194 = 0;if (!_t283) {var _t284 = 0;for (var _i150 = 0; _i150 < _e308.length; _i150++) if (!_n194) {var _r122 = this.isCollides(_e308[_i150]);if (-1 === _r122) _t284++;else if (1 === _r122) {_n194 = 1;break;}}_t284 === _e308.length && (_n194 = -1);}d.collides = _n194;}} else {d = p || { collides: 0, boxes: [] }, d.boxes.length = 0, d.z = a;var _e309 = 0;for (var _t285 = 0; _t285 < f; _t285++) {var _d$boxes;var _n$_t = n[_t285],_s95 = _n$_t.mesh,_o71 = _n$_t.allElements,_a48 = _n$_t.boxCount,_l37 = _n$_t.start,_h24 = _n$_t.end,_c18 = this._isBoxVisible(_s95, _o71, _a48, _l37, _h24, i, r);_c18.isAllowOverlap && (d.isAllowOverlap = 1), 0 === _e309 && (_e309 = _c18.collides), _c18.boxes && (_d$boxes = d.boxes).push.apply(_d$boxes, _toConsumableArray(_c18.boxes));}d.collides = _e309, this._setCollisionCache(c, r, d);}}var m = e && d && 0 === d.collides,y = 1,x = !1;if (this.sceneConfig.fading) {var _e310 = this._getBoxTimestamps(t);if (this._zoomingOut) _e310[r] = m ? 1 : -1;else if (u && delete t._fadeOutStartTime, y = this._getBoxFading(u, m, _e310, r), u ? (y > 0 && (m = !0), x = this.isBoxFading(t, r), x && this.setToRedraw()) : m || (this._markFadingCollided(_e310, r), y = 0), m) {var _n195 = t._fadeOutStartTime;if (_n195 && 1 === y && _e310[r] > 0) {var _this$sceneConfig2 = this.sceneConfig,_e311 = _this$sceneConfig2.fadeOutDelay,_t286 = _this$sceneConfig2.fadingDuration;Ie(_t286) && (_t286 = Yn), Ie(_e311) && (_e311 = qn);var _i151 = Me(1 - (o.getFrameTimestamp() - _n195 - _e311) / _t286, 0, 1);y *= _i151, _i151 > 0 && this.setToRedraw();}}}if (d && s.options.debugCollision && this.addCollisionDebugBox(d.boxes, d.collides ? 0 : 1), m || x) {var _n$ = n[0],_e312 = _n$.mesh,_t287 = _n$.start,_i152 = this.getSymbol(_e312.properties.symbolIndex);!this._isIgnorePlacement(_i152, _e312, _t287) && d && d.boxes && this._fillCollisionIndex(d.boxes, _e312);}if (m) {var _e313 = $n[0] = 255 * y;for (var _t288 = 0; _t288 < f; _t288++) {var _n$_t2 = n[_t288],_i153 = _n$_t2.mesh,_r123 = _n$_t2.allElements,_s96 = _n$_t2.start,_o72 = _n$_t2.boxStart,_a49 = _n$_t2.end,_l38 = _n$_t2.boxIndex,_h25 = void 0 === _o72 ? _s96 : _o72;this.setCollisionOpacity(_i153, _r123, _e313, _h25, _a49, _l38);}}return m && y > 0;} }, { key: \"isMeshIterable\", value: function isMeshIterable() {return !0;} }, { key: \"setCollisionOpacity\", value: function setCollisionOpacity(e, t, n, i, r) {var s = t[i],o = t[r - 1];this._updateOpacityData(e, n, s, o);} }, { key: \"_updateOpacityData\", value: function _updateOpacityData(e, t, n, i) {var r = e.geometry.properties.aOpacity;if (!r) return;var s = n;if (r[s] !== t) {var _e314 = i;for (var _n196 = s; _n196 <= _e314; _n196++) r[_n196] = t;r.dirty = !0;}} }, { key: \"isBoxFading\", value: function isBoxFading(e, t) {var n = this._cachedInstances.frameTimestamp;var i = this.sceneConfig.fadingDuration;Ie(i) && (i = Yn);return n - Math.abs(this._getBoxTimestamps(e)[t]) < i;} }, { key: \"_isBoxVisible\", value: function _isBoxVisible(e, t, n, i, r, s, o) {var a = this.getSymbol(e.properties.symbolIndex),l = this._isIgnorePlacement(a, e, t[i]),h = this._isAllowOverlap(a, e, t[i]);if (!this.isEnableCollision() || l && h) return Kn;var c = this.isBoxCollides(e, t, n, i, r, s, o);return h && (c.collides = 0, c.isAllowOverlap = 1), c;} }, { key: \"_isIgnorePlacement\", value: function _isIgnorePlacement(e, t, n) {if (!this.isEnableCollision()) return !0;var i = t.geometry.properties.aOverlap;if (!i) return 1 == +e[this.propIgnorePlacement];var r = i[n],s = r % 8;return r < 2 ? 1 == +e[this.propIgnorePlacement] : s % 2;} }, { key: \"_isAllowOverlap\", value: function _isAllowOverlap(e, t, n) {if (!this.isEnableCollision()) return !0;var i = t.geometry.properties.aOverlap;if (!i) return 1 == +e[this.propAllowOverlap];var r = i[n],s = r >> 2;return r < 2 ? 1 == +e[this.propAllowOverlap] : s % 2;} }, { key: \"_fillCollisionIndex\", value: function _fillCollisionIndex(e) {if (Array.isArray(e[0])) for (var _t289 = 0; _t289 < e.length; _t289++) this.insertCollisionBox(e[_t289]);else this.insertCollisionBox(e);} }, { key: \"_getBoxFading\", value: function _getBoxFading(e, t, n, i) {var _this$sceneConfig3 = this.sceneConfig,r = _this$sceneConfig3.fadingDuration,s = _this$sceneConfig3.fadeInDelay,o = _this$sceneConfig3.fadeOutDelay;Ie(r) && (r = Yn), Ie(s) && (s = Zn), Ie(o) && (o = qn);var a = this._cachedInstances.frameTimestamp;var l = n[i],h = t ? 1 : 0;if (!l) return t && e && (n[i] = a + s), 0;if (a < Math.abs(l) && (!t && l > 0 || t && l < 0)) {var _e315 = a - r;n[i] = l = t ? _e315 : -_e315;}return a - Math.abs(l) < r ? h = l > 0 ? (a - l) / r : 1 - (a + l) / r : t ? (l < 0 && (n[i] = l = a + s), h = (a - l) / r) : (l > 0 && (n[i] = l = -(a + o)), h = 1 - (a + l) / r), (h < 0 || h > 1) && (h = Me(h, 0, 1)), h;} }, { key: \"_getBoxTimestamps\", value: function _getBoxTimestamps(e) {this._boxTimestamps || (this._boxTimestamps = {});var t = e.properties.meshKey;if (!this._boxTimestamps[t]) {var _e316 = this._cachedInstances.frameTimestamp;this._boxTimestamps[t] = { timestamp: _e316 };}return this._boxTimestamps[t];} }, { key: \"_refreshTimeStamps\", value: function _refreshTimeStamps(e) {if (!this._prevTimestamp) return void (this._prevTimestamp = e);var t = this.scene.getMeshes();if (t && t.length) {for (var _n197 = 0; _n197 < t.length; _n197++) {var _i154 = this._getBoxTimestamps(t[_n197]);_i154.timestamp < this._prevTimestamp ? delete t[_n197]._fading_timestamps : _i154.timestamp = e;}this._prevTimestamp = e;}} }, { key: \"_markFadingCollided\", value: function _markFadingCollided(e, t) {if (!e) return;var n = this._cachedInstances.frameTimestamp;var i = this.sceneConfig.fadingDuration;Ie(i) && (i = Yn), e[t] = -(n - i - 1);} }, { key: \"deleteMesh\", value: function deleteMesh(e, t) {if (e) {if (Array.isArray(e)) for (var _t290 = 0; _t290 < e.length; _t290++) {var _n198 = e[_t290].properties.meshKey;this._collisionContext && delete this._collisionContext.tags[_n198], this._boxTimestamps && delete this._boxTimestamps[_n198];} else {var _t291 = e.properties.meshKey;this._collisionContext && delete this._collisionContext.tags[_t291], this._boxTimestamps && delete this._boxTimestamps[_t291];}_superPropGet(ti, \"deleteMesh\", this, 3)([e, t]);}} }, { key: \"delete\", value: function _delete(e) {this._collisionMesh && (this._collisionMesh.geometry.dispose(), this._collisionShader.dispose(), this._collisionMesh.dispose(), delete this._collisionMesh, delete this._collisionShader, delete this._collisionRenderer), delete this._collisionContext, _superPropGet(ti, \"delete\", this, 3)([e]);} }, { key: \"isCollides\", value: function isCollides(e) {var t = this.layer,n = t.getMap(),i = n.getDevicePixelRatio();if (_gl.vec4.scale(ei, e, 1 / i), n.isOffscreen(ei)) return -1;var r = t.getCollisionIndex(),s = this.sceneConfig.collisionBufferSize || t.options.collisionBufferSize || 0;return s && (e = si(ei, e, s)), +r.collides(e);} }, { key: \"insertCollisionBox\", value: function insertCollisionBox(e) {var t = this.layer,n = t.getCollisionIndex(),i = this.sceneConfig.collisionBufferSize || t.options.collisionBufferSize || 0;var r = e;i && (r = e._buffered = e._buffered || [], e = si(r, e, i)), n.insertBox(r);} }, { key: \"addCollisionDebugBox\", value: function addCollisionDebugBox(e, t) {if (e && e.length) if (Array.isArray(e[0])) for (var _n199 = 0; _n199 < e.length; _n199++) {var _i155 = e[_n199];this._addCollisionBox(_i155, t);} else this._addCollisionBox(e, t);} }, { key: \"_addCollisionBox\", value: function _addCollisionBox(e, t) {if (!e) return;var n = this._collisionBoxes = this._collisionBoxes || { aPosition: [], aVisible: [], indices: [] },i = this.sceneConfig.collisionBufferSize || this.layer.options.collisionBufferSize || 0;i && (e = si(ei, e, i));var r = this.getMap(),s = r.getDevicePixelRatio();if (_gl.vec4.scale(ei, e, 1 / s), r.isOffscreen(ei)) return;var o = n.aPosition.length / 2;n.aPosition.push(e[0], e[1], e[2], e[1], e[2], e[3], e[0], e[3]), n.aVisible.push(t, t, t, t), n.indices.push(o, o + 1, o + 1, o + 2, o + 2, o + 3, o + 3, o);} }, { key: \"updateCollision\", value: function updateCollision(e) {_superPropGet(ti, \"updateCollision\", this, 3)([e]), this._startCollision(), this._prepareZoomEndMeshes(), this._zoomEndMeshes && this._zoomEndMeshes.length && (this._updateZoomMeshesLevel(), this._zoomEndMeshes && (this.setToRedraw(), this.scene.addMesh(this._zoomEndMeshes)));(this.getMap().isZooming() || this._zoomEndMeshes && this._zoomEndMeshes.length) && (this._updateUniquePlacements(), this._mergeUniquePlacements(this.scene.getMeshes()));} }, { key: \"paint\", value: function paint(e) {var t = _superPropGet(ti, \"paint\", this, 3)([e]);return this._renderCollisionBox(e), !1 === this._canProceed && this.setToRedraw(), t;} }, { key: \"shouldIgnoreBackground\", value: function shouldIgnoreBackground() {return !this.getMap().isZooming() && !this._zoomEndMeshes;} }, { key: \"_prepareZoomEndMeshes\", value: function _prepareZoomEndMeshes() {var _this50 = this;var e = this.getMap(),t = e.isZooming();if (!t && this._zooming) {var _e317 = this.layer.getRenderer();this._zoomEndMeshes = this.scene.getMeshes().filter(function (t) {return !_e317.isForeground(t) && !t.properties.isLinePlacement;});} else t && !this._zooming && (this._preRes = e.getResolution());if (t) this._clearTimeout && (clearTimeout(this._clearTimeout), delete this._zoomingOut, delete this._clearTimeout), this._zoomingOut = this._preRes && e.getResolution() > this._preRes;else if (this._zooming && !this._clearTimeout) {var _this$sceneConfig4 = this.sceneConfig,_e318 = _this$sceneConfig4.fadeOutDelay,_t292 = _this$sceneConfig4.fadingDuration;Ie(_e318) && (_e318 = qn), Ie(_t292) && (_t292 = Yn), this._clearTimeout = setTimeout(function () {delete _this50._zoomingOut, delete _this50._clearTimeout;}, _e318 + _t292 + 1);}this._zooming = t;} }, { key: \"_renderCollisionBox\", value: function _renderCollisionBox(e) {if (!this._collisionBoxes || !this.layer.options.debugCollision) return;this._collisionRenderer || this._initCollisionShader();var _this$_collisionBoxes = this._collisionBoxes,t = _this$_collisionBoxes.aPosition,n = _this$_collisionBoxes.aVisible,i = _this$_collisionBoxes.indices;if (!this._collisionMesh) {var _e319 = new _gl.reshader.Geometry({ aPosition: [], aVisible: [] }, [], 0, { positionSize: 2, primitive: \"lines\" });this._collisionMesh = new _gl.reshader.Mesh(_e319), this._collisionScene = new _gl.reshader.Scene(), this._collisionScene.addMesh(this._collisionMesh);}var r = this._collisionMesh.geometry;r.updateData(\"aPosition\", new Float32Array(t)), r.updateData(\"aVisible\", new Uint8Array(n)), r.setElements(i), this._collisionRenderer.render(this._collisionShader, { size: [this.canvas.width, this.canvas.height] }, this._collisionScene, this.getRenderFBO(e)), delete this._collisionBoxes;} }, { key: \"_initCollisionShader\", value: function _initCollisionShader() {var e = this.regl;this._collisionRenderer = new _gl.reshader.Renderer(e);var t = this.canvas,n = { x: 0, y: 0, width: function width() {return t ? t.width : 1;}, height: function height() {return t ? t.height : 1;} };this._collisionShader = new _gl.reshader.MeshShader({ vert: \"attribute vec2 aPosition;\\nattribute float aVisible;\\nuniform vec2 size;\\nvarying vec4 vColor;\\nvoid main() {\\n vec2 c = (aPosition / size - .5) * 2. * vec2(1., -1.);\\n gl_Position = vec4(c, .0, 1.);\\n vColor = mix(vec4(1., .0, .0, 1.5) * .5, vec4(.0, 1., .0, 1.) * .4, aVisible);\\n}\", frag: \"precision mediump float;\\nvarying vec4 vColor;\\nvoid main() {\\n gl_FragColor = vec4(vColor.rgb, .5);\\n}\", uniforms: [\"size\"], extraCommandProps: { viewport: n, depth: { enable: !1 }, blend: { enable: !0, func: { src: \"src alpha\", dst: \"one minus src alpha\" }, equation: \"add\" } } });} }, { key: \"_updateZoomMeshesLevel\", value: function _updateZoomMeshesLevel() {var _this$sceneConfig5 = this.sceneConfig,e = _this$sceneConfig5.fadeOutDelay,t = _this$sceneConfig5.fadingDuration;Ie(e) && (e = qn), Ie(t) && (t = Yn);var n = this.layer.getRenderer(),i = n.getCurrentTileZoom(),r = n.getFrameTimestamp(),s = [];for (var _o73 = 0; _o73 < this._zoomEndMeshes.length; _o73++) {var _a50 = this._zoomEndMeshes[_o73],_l39 = _a50.properties.tile;!_a50._fadeOutStartTime && n.isBackTile(_l39.id) && (_a50._fadeOutStartTime = r);var _h26 = _l39.z - i > 0 ? 2 * (_l39.z - i) - 1 : 2 * (i - _l39.z);_a50.properties.level = _h26, n.isForeground(_a50) || _a50._fadeOutStartTime && r - _a50._fadeOutStartTime > e + t ? delete _a50._fadeOutStartTime : s.push(_a50);}delete this._zoomEndMeshes, s.length && (this._zoomEndMeshes = s);} }, { key: \"isEnableCollision\", value: function isEnableCollision() {return this.layer.options.collision && !!this.sceneConfig.collision;} }, { key: \"isEnableUniquePlacement\", value: function isEnableUniquePlacement() {return this.isEnableCollision() && this.sceneConfig.uniquePlacement;} }, { key: \"isMeshUniquePlaced\", value: function isMeshUniquePlaced(e) {return this.isMeshIterable(e);} }, { key: \"_updateUniquePlacements\", value: function _updateUniquePlacements() {var _this51 = this;if (!this.isEnableUniquePlacement()) return;var e = this.scene.getMeshes(),t = function t(e, _t294, n, i) {var _t$ = _t294[0],r = _t$.start,s = _t$.end,o = e.geometry.properties,a = o.elements;var l = o.uniquePlacements;if (l || (l = o.uniquePlacements = []), void 0 === l[i]) {var _t293 = _this51.getUniqueEntryKey(e, a[r], i);l[i] = _t293 ? { key: _t293, index: i, start: a[r], end: a[s - 1] } : null;}};for (var _n200 = 0; _n200 < e.length; _n200++) {var _i156 = e[_n200];this.isMeshUniquePlaced(_i156) && this.forEachBox(_i156, t);}} }, { key: \"_mergeUniquePlacements\", value: function _mergeUniquePlacements(e) {if (!this.isEnableUniquePlacement()) return;var t = this.getMap().getZoom();var n = !this._mergedMeshes || this._mergedMehesZoom !== t;if (!n) for (var _t295 = 0; _t295 < e.length; _t295++) if (!this._mergedMeshes[e[_t295].properties.meshKey]) {n = !0;break;}if (!n) return;this._mergedMehesZoom = t, this._replacedPlacements = {}, this._mergedMeshes = {}, e = e.sort(ri);var i = this.getMap().getGLScale(),r = {};for (var _t296 = 0; _t296 < e.length; _t296++) {var _n201 = e[_t296];if (!_n201.geometry) continue;var _s97 = _n201.properties.meshKey;this._mergedMeshes[_s97] = 1;var _o74 = _n201.geometry.properties.uniquePlacements;if (_o74) for (var _e320 = 0; _e320 < _o74.length; _e320++) {if (!_o74[_e320]) continue;var _o74$_e = _o74[_e320],_t297 = _o74$_e.key,_s98 = _o74$_e.index,_a51 = this._getBoxTimestamps(_n201),_l40 = ii(_t297, i),_h27 = r[_l40];if (_h27) {var _e321 = _h27.length,_t298 = _h27[_e321 - 3].properties.meshKey,_i157 = _h27[_e321 - 2],_r124 = _h27[_e321 - 1];this._replacedPlacements[_t298] = this._replacedPlacements[_t298] || {}, this._replacedPlacements[_t298][_r124] = 1, this._updatePlacementStamps(_a51, _s98, _i157, _r124), _h27.push(_n201, _a51, _s98);} else r[_l40] = [_n201, _a51, _s98];}}for (var _e322 in r) {var _t299 = r[_e322];if (_t299.length <= 6) continue;var _n202 = _t299.length,_i158 = _t299[_n202 - 2][_t299[_n202 - 1]];if (_t299[1][_t299[2]] !== _i158) for (var _e323 = 0; _e323 < _n202 - 6; _e323 += 3) {_t299[_e323 + 1][_t299[_e323 + 2]] = _i158;}}} }, { key: \"_updatePlacementStamps\", value: function _updatePlacementStamps(e, t, n, i) {if (void 0 !== n[i]) {if (void 0 === e[t]) e[t] = n[i];else {var _r125 = e[t];Math.abs(n[i]) > Math.abs(_r125) ? e[t] = n[i] : n[i] = e[t];}} else void 0 !== e[t] && (n[i] = e[t]);} }, { key: \"_isReplacedPlacement\", value: function _isReplacedPlacement(e, t) {return this._replacedPlacements && this._replacedPlacements[e] && this._replacedPlacements[e][t];} }, { key: \"_getCollideBoxes\", value: function _getCollideBoxes(e, t) {var n = e.properties.symbolIndex,i = n.type || 0;var r = e.properties._collidesBoxes;r || (r = e.properties._collidesBoxes = []);var s = r[n.index];s || (s = e.properties._collidesBoxes = []), s[i] || (s[i] = []), s = s[i];var o = t / 6;if (!s[o]) {var _e324 = [];s[o] = { boxes: _e324, collision: { boxes: _e324 } };}return s[o];} }, { key: \"_getMeshBoxes\", value: function _getMeshBoxes(e) {var t = this._MeshBoxes;if (t || (t = this._MeshBoxes = []), !t[e]) {t[e] = [];for (var _n203 = 0; _n203 < e; _n203++) t[e][_n203] = {};}return t[e];} }, { key: \"_isHalo0\", value: function _isHalo0(e) {if (!e || !e.geometry) return !0;var t = Lt(this.getSymbolDef(e.geometry.properties.symbolIndex).textHaloRadius);if (!e.geometry.properties.glyphAtlas || !e.material.get(\"isHalo\") || t && e.geometry.properties.hasHalo) return !1;if (t && !e.geometry.properties.hasHalo) return !0;return !this.getSymbol(e.geometry.properties.symbolIndex).textHaloRadius;} }]);}(gn);var ni = 10;function ii(e, t) {return Math.round(e[0] / t / ni) * Math.round(e[1] / t / ni) * (e[2] ? Math.round(e[2] / ni) : 1) + \"-\" + e[3];}function ri(e, t) {var n = t.properties.level - e.properties.level;return 0 === n ? e.properties.meshKey - t.properties.meshKey : n;}function si(e, t, n) {return e[0] = t[0] - n, e[1] = t[1] - n, e[2] = t[2] + n, e[3] = t[3] + n, e;}var oi = \"#include \\n#define SHADER_NAME MARKER\\n#define RAD 0.0174532925\\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\nattribute vec4 aShape;\\n#ifdef ENABLE_COLLISION\\nattribute float aOpacity;\\n#endif\\n#ifdef HAS_OPACITY\\nattribute vec2 aColorOpacity;\\n#endif\\n#ifdef HAS_TEXT_SIZE\\nattribute float aTextSize;\\n#else\\nuniform float textSize;\\n#endif\\n#if defined(HAS_TEXT_DX) || defined(HAS_TEXT_DY) || defined(HAS_MARKER_DX) || defined(HAS_MARKER_DY)\\nattribute vec4 aDxDy;\\n#endif\\n#ifndef HAS_MARKER_DX\\nuniform float markerDx;\\n#endif\\n#ifndef HAS_MARKER_DY\\nuniform float markerDy;\\n#endif\\n#ifndef HAS_TEXT_DX\\nuniform float textDx;\\n#endif\\n#ifndef HAS_TEXT_DY\\nuniform float textDy;\\n#endif\\n#ifdef HAS_MARKER_WIDTH\\nattribute float aMarkerWidth;\\n#else\\nuniform float markerWidth;\\n#endif\\n#ifdef HAS_MARKER_HEIGHT\\nattribute float aMarkerHeight;\\n#else\\nuniform float markerHeight;\\n#endif\\n#if defined(HAS_MARKER_PITCH_ALIGN) || defined(HAS_TEXT_PITCH_ALIGN)\\nattribute vec2 aPitchAlign;\\n#endif\\n#ifndef HAS_MARKER_PITCH_ALIGN\\nuniform float markerPitchWithMap;\\n#endif\\n#ifndef HAS_TEXT_PITCH_ALIGN\\nuniform float textPitchWithMap;\\n#endif\\n#if defined(HAS_MARKER_ROTATION_ALIGN) || defined(HAS_TEXT_ROTATION_ALIGN)\\nattribute vec2 aRotationAlign;\\n#endif\\n#ifndef HAS_MARKER_ROTATION_ALIGN\\nuniform float markerRotateWithMap;\\n#endif\\n#ifndef HAS_TEXT_ROTATION_ALIGN\\nuniform float textRotateWithMap;\\n#endif\\nuniform float flipY;\\n#if defined(HAS_MARKER_ROTATION) || defined(HAS_TEXT_ROTATION)\\nattribute vec2 aRotation;\\n#endif\\n#ifndef HAS_MARKER_ROTATION\\nuniform float markerRotation;\\n#endif\\n#ifndef HAS_TEXT_ROTATION\\nuniform float textRotation;\\n#endif\\n#ifdef HAS_PAD_OFFSET\\nattribute vec2 aPadOffset;\\n#endif\\nuniform float cameraToCenterDistance;\\nuniform mat4 positionMatrix;\\nuniform mat4 projViewModelMatrix;\\nuniform float textPerspectiveRatio;\\nuniform float markerPerspectiveRatio;\\nuniform float glyphSize;\\nuniform vec2 iconSize;\\nuniform vec2 canvasSize;\\nuniform vec2 iconTexSize;\\nuniform vec2 glyphTexSize;\\nuniform float mapPitch;\\nuniform float mapRotation;\\nuniform float zoomScale;\\nuniform float tileRatio;\\nuniform float layerScale;\\nuniform float isRenderingTerrain;\\n#include \\nvarying float vIsText;\\n#ifndef PICKING_MODE\\nvarying vec2 vTexCoord;\\nvarying float vOpacity;\\nvarying float vGammaScale;\\nvarying float vTextSize;\\nvarying float vHalo;\\n#ifdef HAS_TEXT_FILL\\nattribute vec4 aTextFill;\\nvarying vec4 vTextFill;\\n#endif\\n#ifdef HAS_TEXT_HALO_FILL\\nattribute vec4 aTextHaloFill;\\nvarying vec4 vTextHaloFill;\\n#endif\\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\\nattribute vec2 aTextHalo;\\nvarying vec2 vTextHalo;\\n#endif\\n#include \\n#else\\n#include \\n#endif\\nvoid main() {\\n vec3 c = unpackVTPosition();\\n#ifdef HAS_TEXT_SIZE\\nfloat d = aTextSize * layerScale;\\n#else\\nfloat d = textSize * layerScale;\\n#endif\\n#ifdef HAS_TEXT_DX\\nfloat e = aDxDy.z;\\n#else\\nfloat e = textDx;\\n#endif\\n#ifdef HAS_TEXT_DY\\nfloat f = aDxDy.w;\\n#else\\nfloat f = textDy;\\n#endif\\n#ifdef HAS_MARKER_WIDTH\\nfloat h = aMarkerWidth;\\n#else\\nfloat h = markerWidth;\\n#endif\\n#ifdef HAS_MARKER_HEIGHT\\nfloat i = aMarkerHeight;\\n#else\\nfloat i = markerHeight;\\n#endif\\n#ifdef HAS_MARKER_DX\\nfloat j = aDxDy.x;\\n#else\\nfloat j = markerDx;\\n#endif\\n#ifdef HAS_MARKER_DY\\nfloat k = aDxDy.y;\\n#else\\nfloat k = markerDy;\\n#endif\\nfloat l = mod(aShape.z, 2.);\\n float m;\\n if(l > .5) {\\n \\n#ifdef HAS_TEXT_PITCH_ALIGN\\nm = aPitchAlign.y;\\n#else\\nm = textPitchWithMap;\\n#endif\\n } else {\\n \\n#ifdef HAS_MARKER_PITCH_ALIGN\\nm = aPitchAlign.x;\\n#else\\nm = markerPitchWithMap;\\n#endif\\n }\\n float n;\\n if(l > .5) {\\n \\n#ifdef HAS_TEXT_ROTATION_ALIGN\\nn = aRotationAlign.y;\\n#else\\nn = textRotateWithMap;\\n#endif\\n } else {\\n \\n#ifdef HAS_MARKER_ROTATION_ALIGN\\nn = aRotationAlign.x;\\n#else\\nn = markerRotateWithMap;\\n#endif\\n }\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\\n float o = gl_Position.w;\\n float u;\\n if(isRenderingTerrain == 1. && m == 1.) {\\n u = 1.;\\n } else {\\n float v = (1. - cameraToCenterDistance / o) * markerPerspectiveRatio;\\n u = clamp(.5 + .5 * (1. - v), .0, 4.);\\n }\\n float A;\\n if(l > .5) {\\n \\n#ifdef HAS_TEXT_ROTATION\\nA = -aRotation.y / 9362. - mapRotation * n;\\n#else\\nA = -textRotation - mapRotation * n;\\n#endif\\n } else {\\n \\n#ifdef HAS_MARKER_ROTATION\\nA = -aRotation.x / 9362. - mapRotation * n;\\n#else\\nA = -markerRotation - mapRotation * n;\\n#endif\\n }\\n if(m == 1.) {\\n \\n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\\nA += mapRotation;\\n#else\\nif(l > .5) {\\n A -= mapRotation;\\n } else {\\n A += mapRotation;\\n }\\n#endif\\n }\\n float B = sin(A);\\n float C = cos(A);\\n mat2 D = mat2(C, -1. * B, B, C);\\n vec2 E = (aShape.xy / 10.0);\\n if(m == 1. && flipY == .0) {\\n E *= vec2(1., -1.);\\n }\\n vIsText = l;\\n if(l > .5) {\\n E = E / glyphSize * d;\\n } else {\\n \\n#ifdef HAS_PAD_OFFSET\\nfloat F = aPadOffset.x - 1.;\\n float G = aPadOffset.y;\\n#else\\nfloat F = .0;\\n float G = .0;\\n#endif\\nE = (E / iconSize * vec2(h, i) + vec2(F, G)) * layerScale;\\n }\\n E = D * E;\\n float H;\\n if(isRenderingTerrain == 1.) {\\n H = 1.;\\n } else {\\n H = o / cameraToCenterDistance;\\n }\\n if(m == .0) {\\n vec2 I = E * 2. / canvasSize;\\n gl_Position.xy += I * u * o;\\n } else if(l > .5) {\\n float J;\\n if(isRenderingTerrain == 1.) {\\n J = tileRatio / zoomScale;\\n } else {\\n J = tileRatio / zoomScale * H * u;\\n }\\n vec2 I = E;\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(I, .0) * J, 1.);\\n } else {\\n vec2 I = E;\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(I, .0) * tileRatio / zoomScale * H * u, 1.);\\n }\\n if(l > .5) {\\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * o;\\n } else {\\n gl_Position.xy += vec2(j, -k) * 2. / canvasSize * o;\\n }\\n#ifndef PICKING_MODE\\nif(m == .0) {\\n vGammaScale = mix(1., H, textPerspectiveRatio);\\n } else {\\n vGammaScale = H + mapPitch / 4.;\\n }\\n vGammaScale = clamp(vGammaScale, .0, 1.);\\n vec2 K = floor(aShape.zw / 2.);\\n if(l > .5) {\\n vTexCoord = K / glyphTexSize;\\n } else {\\n vTexCoord = K / iconTexSize;\\n }\\n vHalo = mod(aShape.w, 2.);\\n vTextSize = d;\\n#ifdef ENABLE_COLLISION\\nvOpacity = aOpacity / 255.;\\n#else\\nvOpacity = 1.;\\n#endif\\n#ifdef HAS_OPACITY\\nif(l > .5) {\\n vOpacity *= aColorOpacity.y / 255.;\\n } else {\\n vOpacity *= aColorOpacity.x / 255.;\\n }\\n#endif\\n#ifdef HAS_TEXT_FILL\\nvTextFill = aTextFill / 255.;\\n#endif\\n#ifdef HAS_TEXT_HALO_FILL\\nvTextHaloFill = aTextHaloFill / 255.;\\n#endif\\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\\nvTextHalo = aTextHalo;\\n#endif\\nhighlight_setVarying();\\n#else\\n#ifdef ENABLE_COLLISION\\nbool L = aOpacity == 255.;\\n#else\\nbool L = true;\\n#endif\\nfbo_picking_setData(gl_Position.w, L);\\n#endif\\n}\";var ai = [],li = [],hi = [],ci = [],ui = [],fi = [];function di(e, t, n, i, r, s, a, l, h, u, d, p, g, m) {var y = h.tileRatio,x = h.tileResolution,_ = y / (x / u.getResolution()) * (d / u.cameraToCenterDistance) * p;_gl.vec2.scale(n, n, _), _gl.vec2.scale(i, i, _), _gl.vec2.scale(r, r, _), _gl.vec2.scale(s, s, _), _gl.vec3.set(ai, n[0], n[1], g ? n[2] / m : 0), _gl.vec3.set(li, i[0], i[1], g ? i[2] / m : 0), _gl.vec3.set(hi, r[0], r[1], g ? r[2] / m : 0), _gl.vec3.set(ci, s[0], s[1], g ? s[2] / m : 0), _gl.vec3.add(ai, ai, t), _gl.vec3.add(li, li, t), _gl.vec3.add(hi, hi, t), _gl.vec3.add(ci, ci, t), Bt(n, ai, a, u.width, u.height), Bt(i, li, a, u.width, u.height), Bt(r, hi, a, u.width, u.height), Bt(s, ci, a, u.width, u.height), _gl.vec2.set(ui, Math.min(n[0], i[0], r[0], s[0]), Math.min(n[1], i[1], r[1], s[1])), _gl.vec2.set(fi, Math.max(n[0], i[0], r[0], s[0]), Math.max(n[1], i[1], r[1], s[1])), _gl.vec4.set(e, ui[0] + l[0], ui[1] + l[1], fi[0] + l[0], fi[1] + l[1]);}function pi(e, t, n, i, r, s, o, a) {1 !== a && (_gl.vec2.scale(n, n, a), _gl.vec2.scale(i, i, a), _gl.vec2.scale(r, r, a), _gl.vec2.scale(s, s, a)), _gl.vec2.set(ui, Math.min(n[0], i[0], r[0], s[0]), Math.min(n[1], i[1], r[1], s[1])), _gl.vec2.set(fi, Math.max(n[0], i[0], r[0], s[0]), Math.max(n[1], i[1], r[1], s[1])), _gl.vec4.set(e, t[0] + ui[0] + o[0], t[1] + ui[1] - o[1], t[0] + fi[0] + o[0], t[1] + fi[1] - o[1]);}function gi(e, t, n, i, r) {t -= n * i, 1 === r && (t += n);var s = Math.sin(t),o = Math.cos(t);return _gl.mat2.set(e, o, -s, s, o);}var mi = 15,yi = 15,xi = 2048,_i = 24,vi = .01,bi = [],Ai = [],Ti = [],wi = [],Si = [],Mi = [],Pi = [],Ii = [],Ci = [1, -1],ki = [1, 1];function Fi(e, t, n, i, r) {var s = t.material.uniforms,a = r.cameraToCenterDistance,l = t.geometry.properties,h = this.getSymbol(l.symbolIndex),c = t.geometry.desc.positionSize,u = l.aAnchor,d = _gl.vec3.set(bi, u[n * c], u[n * c + 1], 2 === c ? 0 : u[n * c + 2]),p = l.aTerrainAltitude;if (p) {var _e325 = 100 * p[2 * n];_e325 && (d[2] += _e325);}var g = Bt(Ai, d, i, r.width, r.height);var m = g[2];var y = 1;if (s.markerPerspectiveRatio) {y = Me(.5 + .5 * (1 - (1 - a / m) * s.markerPerspectiveRatio), 0, 4);}var x = l.aShape,_ = l.aMarkerDx,v = l.aMarkerDy,b = l.aMarkerWidth,A = l.aMarkerHeight,T = l.aPitchAlign,w = l.aRotationAlign,S = l.aRotation,M = _ ? _[n] : h.markerDx,P = v ? v[n] : h.markerDy,I = T ? T[2 * n] : s.markerPitchWithMap,C = w ? w[2 * n] : s.markerRotateWithMap,k = _gl.vec2.set(Ii, M || 0, -(P || 0));var F = _gl.vec2.set(wi, x[2 * n] / 10, x[2 * n + 1] / 10),O = _gl.vec2.set(Si, x[2 * n + 2] / 10, x[2 * n + 3] / 10),R = _gl.vec2.set(Mi, x[2 * n + 4] / 10, x[2 * n + 5] / 10),E = _gl.vec2.set(Pi, x[2 * n + 6] / 10, x[2 * n + 7] / 10);0 === s.flipY && 1 === I && (_gl.vec2.multiply(F, F, Ci), _gl.vec2.multiply(O, O, Ci), _gl.vec2.multiply(R, R, Ci), _gl.vec2.multiply(E, E, Ci));var _vn = vn(t.geometry),_vn2 = _slicedToArray(_vn, 2),D = _vn2[0],L = _vn2[1];var H = b ? b[n] : h.markerWidth;Ie(H) && (H = D || mi);var N = A ? A[n] : h.markerHeight;Ie(N) && (N = L || yi);var z = _gl.vec2.set(ki, H / xi, N / xi);var V;_gl.vec2.mul(F, F, z), _gl.vec2.mul(O, O, z), _gl.vec2.mul(R, R, z), _gl.vec2.mul(E, E, z), V = S ? S[2 * n] / 9362 : -(h.markerRotation || 0) * Math.PI / 180;var U = -V,B = r.getBearing() * Math.PI / 180;if (B * C || U) {var _e326 = gi(Ti, U, B, C, I);F = _gl.vec2.transformMat2(F, F, _e326), O = _gl.vec2.transformMat2(O, O, _e326), R = _gl.vec2.transformMat2(R, R, _e326), E = _gl.vec2.transformMat2(E, E, _e326);}1 === I ? di(e, d, F, O, R, E, i, k, s, r, m, y) : (_gl.vec2.multiply(F, F, Ci), _gl.vec2.multiply(O, O, Ci), _gl.vec2.multiply(R, R, Ci), _gl.vec2.multiply(E, E, Ci), pi(e, g, F, O, R, E, k, y));var G = this.getMap().getDevicePixelRatio();return 1 !== G && (e[0] *= G, e[1] *= G, e[2] *= G, e[3] *= G), e;}var _H8 = H(),Oi = _H8.PackUtil,Ri = 1,Ei = [],Di = [],Li = [],Hi = [],Ni = [],zi = [],Vi = [1, -1];function Ui(e, t, n, i, r, s, a, l, h) {var c = i.material.uniforms,u = h.cameraToCenterDistance,d = i.geometry.properties,p = this.getSymbol(d.symbolIndex),g = \"line\" === p.textPlacement && !He(p),m = _i,y = n[2];var x = 1;if (c.textPerspectiveRatio) {x = Me(.5 + .5 * (1 - (1 - u / y) * c.textPerspectiveRatio), 0, 4);}var _i$geometry$propertie = i.geometry.properties,_ = _i$geometry$propertie.aTextDx,v = _i$geometry$propertie.aTextDy,b = _i$geometry$propertie.aPitchAlign,A = _i$geometry$propertie.aRotationAlign,T = _i$geometry$propertie.aRotation,w = _i$geometry$propertie.aType,S = _i$geometry$propertie.aDxDy;var M, P, I;S ? (M = S[4 * a + 2], P = S[4 * a + 3]) : (M = _ ? _[a] : p.textDx, P = v ? v[a] : p.textDy), b && (I = w ? b[2 * a + 1] : b[a]);var C = b ? I : c.textPitchWithMap;var k;A && (k = w ? A[2 * a + 1] : A[a]);var F = A ? k : c.textRotateWithMap,O = _gl.vec2.set(zi, M || 0, -(P || 0));if (g) {var _i159 = d.aOffset,_r126 = d.aShape,_s99 = _i159.length !== _r126.length;var _u15, _p6, _g6, _m6;if (_s99 ? (_u15 = _gl.vec3.set(Di, _i159[3 * a] / 10, _i159[3 * a + 1] / 10, _i159[3 * a + 2] / 10), _p6 = _gl.vec3.set(Li, _i159[3 * a + 3] / 10, _i159[3 * a + 4] / 10, _i159[3 * a + 5] / 10), _g6 = _gl.vec3.set(Hi, _i159[3 * a + 6] / 10, _i159[3 * a + 7] / 10, _i159[3 * a + 8] / 10), _m6 = _gl.vec3.set(Ni, _i159[3 * a + 9] / 10, _i159[3 * a + 10] / 10, _i159[3 * a + 11] / 10)) : (_u15 = _gl.vec2.set(Di, _i159[2 * a] / 10, _i159[2 * a + 1] / 10), _p6 = _gl.vec2.set(Li, _i159[2 * a + 2] / 10, _i159[2 * a + 3] / 10), _g6 = _gl.vec2.set(Hi, _i159[2 * a + 4] / 10, _i159[2 * a + 5] / 10), _m6 = _gl.vec2.set(Ni, _i159[2 * a + 6] / 10, _i159[2 * a + 7] / 10)), 1 === C) {var _n204 = $(h.getResolution(), h);di(e, t, _u15, _p6, _g6, _m6, l, O, c, h, y, x, _s99, _n204);} else _gl.vec2.multiply(_u15, _u15, Vi), _gl.vec2.multiply(_p6, _p6, Vi), _gl.vec2.multiply(_g6, _g6, Vi), _gl.vec2.multiply(_m6, _m6, Vi), pi(e, n, _u15, _p6, _g6, _m6, O, x);} else {var _i160 = d.aShape;var _s100,_o75 = _gl.vec2.set(Di, _i160[2 * a] / 10, -_i160[2 * a + 1] / 10),_u16 = _gl.vec2.set(Li, _i160[2 * a + 2] / 10, -_i160[2 * a + 3] / 10),_7 = _gl.vec2.set(Hi, _i160[2 * a + 4] / 10, -_i160[2 * a + 5] / 10),_v5 = _gl.vec2.set(Ni, _i160[2 * a + 6] / 10, -_i160[2 * a + 7] / 10);0 === c.flipY && 1 === C && (_gl.vec2.multiply(_o75, _o75, Vi), _gl.vec2.multiply(_u16, _u16, Vi), _gl.vec2.multiply(_7, _7, Vi), _gl.vec2.multiply(_v5, _v5, Vi)), _s100 = T ? w && T.length > w.length ? T[2 * a + 1] / 9362 : T[a] / 9362 : (p.textRotation || 0) * Math.PI / 180;var _b5 = g ? 0 : h.getBearing() * Math.PI / 180;if (_s100 || _b5) {var _e327 = gi(Ei, _s100, _b5, F, C);_o75 = _gl.vec2.transformMat2(_o75, _o75, _e327), _u16 = _gl.vec2.transformMat2(_u16, _u16, _e327), _7 = _gl.vec2.transformMat2(_7, _7, _e327), _v5 = _gl.vec2.transformMat2(_v5, _v5, _e327);}var _A5 = r / m;_gl.vec2.scale(_o75, _o75, _A5), _gl.vec2.scale(_u16, _u16, _A5), _gl.vec2.scale(_7, _7, _A5), _gl.vec2.scale(_v5, _v5, _A5), 1 === C ? di(e, t, _o75, _u16, _7, _v5, l, O, c, h, y, x) : pi(e, n, _o75, _u16, _7, _v5, O, x);}s = s || 0, e[0] -= s + Ri, e[1] -= s + Ri, e[2] += s + Ri, e[3] += s + Ri;var R = this.getMap().getDevicePixelRatio();return 1 !== R && (e[0] *= R, e[1] *= R, e[2] *= R, e[3] *= R), e;}function Bi(e, t, n) {var i = t.geometry.desc.positionSize,_t$geometry$propertie = t.geometry.properties,r = _t$geometry$propertie.aAnchor,s = _t$geometry$propertie.aAltitude,a = _t$geometry$propertie.aTerrainAltitude,l = n * i;if (s ? _gl.vec3.set(e, r[l], r[l + 1], s[n]) : 3 === i ? Oi.unpackPosition(e, r[l], r[l + 1], r[l + 2]) : _gl.vec3.set(e, r[l], r[l + 1], 0), a) {var _t300 = 100 * a[2 * n];_t300 && (e[2] += _t300);}return e;}_gl.reshader.ShaderLib.register(\"text_render_frag\", \"#define HAS_HIGHLIGHT_COLOR_POINT 1\\n#define SDF_PX 8.0\\n#define DEVICE_PIXEL_RATIO 1.0\\n#define EDGE_GAMMA 0.105 / DEVICE_PIXEL_RATIO\\nuniform sampler2D glyphTex;\\nuniform float textOpacity;\\nuniform highp float gammaScale;\\nuniform float isHalo;\\nuniform highp float textHaloBlur;\\n#if defined(HAS_TEXT_HALO_OPACITY) || defined(HAS_TEXT_HALO_RADIUS)\\n varying vec2 vTextHalo;\\n#endif\\n#ifndef HAS_TEXT_HALO_OPACITY\\n uniform float textHaloOpacity;\\n#endif\\n#ifndef HAS_TEXT_HALO_RADIUS\\n uniform highp float textHaloRadius;\\n#endif\\nvarying float vTextSize;\\nvarying float vGammaScale;\\n#ifdef HAS_TEXT_FILL\\n varying vec4 vTextFill;\\n#else\\n uniform vec4 textFill;\\n#endif\\n#ifdef HAS_TEXT_HALO_FILL\\n varying vec4 vTextHaloFill;\\n#else\\n uniform vec4 textHaloFill;\\n#endif\\nvec4 renderText(vec2 texCoord) {\\n #ifdef HAS_TEXT_FILL\\n vec4 myTextFill = vTextFill;\\n #else\\n vec4 myTextFill = textFill;\\n #endif\\n float fontScale = vTextSize / 24.0;\\n vec4 color = myTextFill;\\n highp float gamma = EDGE_GAMMA / (fontScale * gammaScale);\\n lowp float buff = 185.0 / 256.0; bool isHaloText;\\n #ifdef HAS_HALO_ATTR\\n isHaloText = vHalo > 0.5;\\n #else\\n isHaloText = isHalo == 1.0;\\n #endif\\n if (isHaloText) {\\n #ifdef HAS_TEXT_HALO_FILL\\n vec4 haloFill = vTextHaloFill;\\n #else\\n vec4 haloFill = textHaloFill;\\n #endif\\n #ifdef HAS_TEXT_HALO_RADIUS\\n float haloRadius = vTextHalo.x;\\n #else\\n float haloRadius = textHaloRadius;\\n #endif\\n if (haloRadius == 0.0) {\\n discard;\\n }\\n color = haloFill;\\n gamma = (textHaloBlur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * gammaScale);\\n buff = (6.0 - haloRadius / fontScale) / SDF_PX;\\n #ifdef HAS_TEXT_HALO_OPACITY\\n float haloOpacity = vTextHalo.y / 255.0;\\n #else\\n float haloOpacity = textHaloOpacity;\\n #endif\\n color *= haloOpacity * 1.25;\\n }\\n float dist = texture2D(glyphTex, texCoord).a;\\n highp float gammaScaled = gamma * vGammaScale * 0.7;\\n float alpha = clamp(smoothstep(buff - gammaScaled, buff + gammaScaled, dist), 0.0, 1.0);\\n return color * (alpha * textOpacity);\\n}\");var Gi = { textFill: [0, 0, 0, 1], textOpacity: 1, textPitchAlignment: 0, textRotationAlignment: 0, textHaloRadius: 0, textHaloFill: [1, 1, 1, 1], textHaloBlur: 0, textHaloOpacity: 1, textPerspectiveRatio: 0, textSize: 14, textDx: 0, textDy: 0, textRotation: 0 };function ji(e, t, n, i, r, o, a, l, h) {var _this52 = this;var c = [];if (t.isDisposed() || 0 === t.data.aPosition.length) return c;var u = t.properties.glyphAtlas;if (!u) return c;if (0 === i.textSize || 0 === i.textOpacity) return c;Xi.call(this, t, i, o, a, l, h);var f = Yi.call(this, {}, e, t, r);var d = !1;r.textOpacity < 1 && (d = !0), t.properties.memorySize = t.getMemorySize(), t.generateBuffers(e, { excludeElementsInVAO: !0 });var p = new _gl.reshader.Material(f, Gi),g = new _gl.reshader.Mesh(t, p, { disableVAO: !0, transparent: d, castShadow: !1, picking: !0 });if (g.setLocalTransform(n), g.setUniform(\"alphaTest\", vi), f.isHalo && (g.properties.isHalo = !0), a && g.setDefines({ ENABLE_COLLISION: 1 }), c.push(g), f.isHalo) {var _e328 = Wi.call(this, t, r, f.glyphTex, u, a, n);_e328.properties.haloMesh = g, c.push(_e328);}return c.forEach(function (e) {var n = e.defines || {};Zi.call(_this52, n, e), e.setDefines(n), e.properties.symbolIndex = t.properties.symbolIndex;}), c;}function Wi(e, t, n, i, r, o) {var a = !1;t.textOpacity < 1 && (a = !0);var l = { flipY: 0, tileResolution: e.properties.tileResolution, tileRatio: e.properties.tileRatio, glyphTex: n, glyphTexSize: [i.width, i.height], isHalo: 0 };$i(e, l, t);var h = new _gl.reshader.Material(l, Gi),c = new _gl.reshader.Mesh(e, h, { disableVAO: !0, transparent: a, castShadow: !1, picking: !0 });return c.setUniform(\"alphaTest\", vi), Object.defineProperty(c.properties, \"textSize\", { enumerable: !0, get: function get() {return l.textSize;} }), r && c.setDefines({ ENABLE_COLLISION: 1 }), c.setLocalTransform(o), c;}function Xi(e, t, n, i, r, s) {St(e, t, n, this.layer);var o = e.properties;if (!o.textInitialized) {qi.call(this, e, i || s, r), o.textInitialized = !0;var _e$data = e.data,_t301 = _e$data.aTextSize,_n205 = _e$data.aTextDx,_a52 = _e$data.aTextDy,_l41 = _e$data.aPitchAlign,_h28 = _e$data.aRotationAlign,_c19 = _e$data.aRotation,_u17 = _e$data.aOverlap,_f14 = _e$data.aAltitude;if (_t301) {var _e329 = (Tt + \"aTextSize\").trim();o.aTextSize = o[_e329] || new _t301.constructor(_t301);}if (_n205) {var _e330 = (Tt + \"aTextDx\").trim();o.aTextDx = o[_e330] || new _n205.constructor(_n205);}if (_a52) {var _e331 = (Tt + \"aTextDy\").trim();o.aTextDy = o[_e331] || new _a52.constructor(_a52);}if (_l41) {var _e332 = (Tt + \"aPitchAlign\").trim();o.aPitchAlign = o[_e332] || new _l41.constructor(_l41);}if (_h28) {var _e333 = (Tt + \"aRotationAlign\").trim();o.aRotationAlign = o[_e333] || new _h28.constructor(_h28);}if (_c19) {var _e334 = (Tt + \"aRotation\").trim();o.aRotation = o[_e334] || new _c19.constructor(_c19);}if (_u17) {var _e335 = (Tt + \"aOverlap\").trim();o.aOverlap = o[_e335] || new _u17.constructor(_u17);}if (_f14) {var _e336 = (Tt + \"aAltitude\").trim();o.aAltitude = o[_e336] || new _f14.constructor(_f14);}}}function Yi(e, t, n, i) {var r = n.properties.glyphAtlas,s = r && yn(t, r, !1);return Se(e = e || {}, { flipY: 0, tileResolution: n.properties.tileResolution, tileRatio: n.properties.tileRatio, glyphTex: s || this._emptyTexture, glyphTexSize: [r && r.width || 0, r && r.height || 0] }), $i(n, e, i), e;}function Zi(e, t) {var n = t.geometry;n.data.aTextFill && (e.HAS_TEXT_FILL = 1), n.data.aTextSize && (e.HAS_TEXT_SIZE = 1), n.data.aColorOpacity && (e.HAS_OPACITY = 1), n.data.aTextHaloFill && t.material.uniforms.isHalo && (e.HAS_TEXT_HALO_FILL = 1);var i = this.getSymbolDef(n.properties.symbolIndex);Lt(i.textHaloRadius) && t.material.uniforms.isHalo && (e.HAS_TEXT_HALO_RADIUS = 1), Lt(i.textHaloOpacity) && t.material.uniforms.isHalo && (e.HAS_TEXT_HALO_OPACITY = 1), Lt(i.textDx) && (e.HAS_TEXT_DX = 1), Lt(i.textDy) && (e.HAS_TEXT_DY = 1), n.data.aPitchAlign && (e.HAS_PITCH_ALIGN = 1), Lt(i.textRotationAlignment) && (e.HAS_TEXT_ROTATION_ALIGN = 1), n.data.aRotation && (e.HAS_TEXT_ROTATION = 1), n.data.aAltitude && (e.HAS_ALTITUDE = 1), n.properties.aOffset && n.properties.aShape && n.properties.aOffset.length !== n.properties.aShape.length && (e.HAS_OFFSET_Z = 1);}function qi(e, t, n) {var i = e.properties,r = this.getSymbol(i.symbolIndex),s = \"line\" === i.textPlacement && !He(r),_e$data2 = e.data,o = _e$data2.aPosition,a = _e$data2.aShape,l = o.length / e.desc.positionSize;if (i.vertexCount = l, i.aPickingId = e.data.aPickingId, i.aCount || (i.aCount = e.data.aCount, delete e.data.aCount), t || s) {var _e337 = a;if (a.length === 4 * l) {_e337 = new a.constructor(2 * l);for (var _t302 = 0; _t302 < l; _t302++) _e337[2 * _t302] = a[4 * _t302], _e337[2 * _t302 + 1] = a[4 * _t302 + 1];}i.aAnchor = o, i.aShape = _e337;}if (i.visElemts || (i.elements = e.elements, i.visElemts = new e.elements.constructor(e.elements.length)), s) {var _e$data3 = e.data,_t303 = _e$data3.aVertical,_n206 = _e$data3.aSegment,_r127 = _e$data3.aGlyphOffset,_s101 = _e$data3.aPitchRotation,_o76 = !!_s101;i.aGlyphOffset = _r127, i.aPitchRotation = _s101, i.aSegment = _n206, i.aVertical = _t303, delete e.data.aSegment, delete e.data.aVertical, delete e.data.aGlyphOffset, delete e.data.aPitchRotation;var _a53 = l * (_o76 ? 3 : 2);e.data.aOffset = { usage: \"dynamic\", data: new Int16Array(_a53) }, i.aOffset = new Int16Array(_a53);}if (t) {e.data.aOpacity = { usage: \"dynamic\", data: new Uint8Array(l) }, i.aOpacity = new Uint8Array(l), n && (i.aOpacity.fill(255, 0), e.data.aOpacity.data.fill(255, 0));var _t304 = e.data.aTextHalo;if (_t304 && !i.aTextHalo) {var _e338 = (Tt + \"aTextHalo\").trim();i.aTextHalo = i[_e338] || new _t304.constructor(_t304);}}}function $i(e, t, n) {void 0 === t.isHalo && (t.isHalo = 1), ke(t, \"textOpacity\", n, \"textOpacity\", Gi.textOpacity), ke(t, \"textFill\", n, \"textFill\", Gi.textFill, Re()), ke(t, \"textHaloFill\", n, \"textHaloFill\", Gi.textHaloFill, Re()), ke(t, \"textHaloBlur\", n, \"textHaloBlur\", Gi.textHaloBlur), ke(t, \"textHaloRadius\", n, \"textHaloRadius\", Gi.textHaloRadius), ke(t, \"textHaloOpacity\", n, \"textHaloOpacity\", Gi.textHaloOpacity), ke(t, \"textPerspectiveRatio\", n, \"textPerspectiveRatio\", Gi.textPerspectiveRatio, function (t) {return \"line\" === e.properties.textPlacement ? 1 : t;}), ke(t, \"textRotateWithMap\", n, \"textRotationAlignment\", Gi.textRotationAlignment, function (e) {return +(\"map\" === e);}), ke(t, \"textPitchWithMap\", n, \"textPitchAlignment\", Gi.textPitchAlignment, function (e) {return +(\"map\" === e);}), ke(t, \"textSize\", n, \"textSize\", Gi.textSize), ke(t, \"textDx\", n, \"textDx\", Gi.textDx), ke(t, \"textDy\", n, \"textDy\", Gi.textDy), ke(t, \"textRotation\", n, \"textRotation\", Gi.textRotation, function (e) {return e * Math.PI / 180;});}function Ji(e) {var _this53 = this;var t = [];return { uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, n) {return _gl.mat4.multiply(t, n.projViewMatrix, n.modelMatrix);} }, { name: \"zoomScale\", type: \"function\", fn: function fn(e, t) {return t.tileResolution / t.resolution;} }], extraCommandProps: { viewport: { x: 0, y: 0, width: function width() {return e ? e.width : 1;}, height: function height() {return e ? e.height : 1;} }, stencil: { enable: !0, mask: 255, func: { cmp: \"<=\", ref: function ref(e, t) {return t.stencilRef;}, mask: 255 }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, depth: { enable: !0, range: function range() {return _this53.sceneConfig.depthRange || [0, 1];}, func: function func() {return _this53.sceneConfig.depthFunc || \"always\";}, mask: !1 }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } } };}function Ki(e, t) {var _this54 = this;var n = (0, _functionType.interpolated)(t.textFill),i = (0, _functionType.interpolated)(t.textSize),r = (0, _functionType.interpolated)(t.textHaloFill),s = (0, _functionType.interpolated)(t.textHaloRadius),o = (0, _functionType.interpolated)(t.textHaloOpacity),a = (0, _functionType.interpolated)(t.textDx),l = (0, _functionType.interpolated)(t.textDy),h = (0, _functionType.interpolated)(t.textOpacity),c = (0, _functionType.piecewiseConstant)(t.textPitchAlignment),u = (0, _functionType.piecewiseConstant)(t.textRotationAlignment),f = (0, _functionType.interpolated)(t.textRotation),d = (0, _functionType.piecewiseConstant)(t.textAllowOverlapFn),p = (0, _functionType.piecewiseConstant)(t.textIgnorePlacement),g = {},m = new Int16Array(1),x = new Uint16Array(1);return [{ attrName: \"aTextFill\", symbolName: \"textFill\", define: \"HAS_TEXT_FILL\", type: Uint8Array, width: 4, evaluate: function evaluate(t, i) {var r = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this54.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = g[r] = g[r] || (0, _color.default)(r).unitArray()), r = Oe(r), r;} }, { attrName: \"aTextSize\", symbolName: \"textSize\", define: \"HAS_TEXT_SIZE\", type: Uint8Array, width: 1, evaluate: function evaluate(t, n) {var r = i(e.getZoom(), t) || Gi.textSize;return (0, _functionType.isFunctionDefinition)(r) && (r = _this54.evaluateInFnTypeConfig(r, n, e, t)), m[0] = r, m[0];} }, { attrName: \"aTextHaloFill\", symbolName: \"textHaloFill\", define: \"HAS_TEXT_HALO_FILL\", type: Uint8Array, width: 4, evaluate: function evaluate(t) {var n = r(e.getZoom(), t);return Array.isArray(n) || (n = g[n] = g[n] || (0, _color.default)(n).unitArray()), n = Oe(n), n;} }, { attrName: \"aTextHalo\", symbolName: \"textHaloRadius\", define: \"HAS_TEXT_HALO_RADIUS\", type: Uint8Array, index: 0, width: 2, evaluate: function evaluate(t) {var n = s(e.getZoom(), t);return m[0] = n, m[0];} }, { attrName: \"aTextHalo\", symbolName: \"textHaloOpacity\", define: \"HAS_TEXT_HALO_OPACITY\", type: Uint8Array, index: 1, width: 2, evaluate: function evaluate(t) {var n = o(e.getZoom(), t);return m[0] = 255 * n, m[0];} }, { attrName: \"aTextDx\", symbolName: \"textDx\", define: \"HAS_TEXT_DX\", type: Uint8Array, width: 1, evaluate: function evaluate(t, n) {var i = a(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(i) && (i = _this54.evaluateInFnTypeConfig(i, n, e, t)), m[0] = i, m[0];} }, { attrName: \"aTextDy\", symbolName: \"textDy\", define: \"HAS_TEXT_DY\", type: Uint8Array, width: 1, evaluate: function evaluate(t, n) {var i = l(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(i) && (i = _this54.evaluateInFnTypeConfig(i, n, e, t)), m[0] = i, m[0];} }, { attrName: \"aColorOpacity\", symbolName: \"textOpacity\", define: \"HAS_OPACITY\", type: Uint8Array, width: 1, evaluate: function evaluate(t, n) {var i = h(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(i) && (i = _this54.evaluateInFnTypeConfig(i, n, e, t)), m[0] = 255 * i, m[0];} }, { attrName: \"aPitchAlign\", symbolName: \"textPitchAlignment\", type: Uint8Array, width: 1, define: \"HAS_PITCH_ALIGN\", evaluate: function evaluate(t) {return +(\"map\" === c(e.getZoom(), t));} }, { attrName: \"aRotationAlign\", symbolName: \"textRotationAlignment\", type: Uint8Array, width: 1, define: \"HAS_ROTATION_ALIGN\", evaluate: function evaluate(t) {return +(\"map\" === u(e.getZoom(), t));} }, { attrName: \"aRotation\", symbolName: \"textRotation\", type: Uint16Array, width: 1, define: \"HAS_TEXT_ROTATION\", evaluate: function evaluate(t) {var n = Pe(f(e.getZoom(), t), 0, 360) * Math.PI / 180;return x[0] = 9362 * n, x[0];} }, { attrName: \"aOverlap\", symbolName: \"textAllowOverlap\", type: Uint8Array, width: 1, evaluate: function evaluate(n) {var i = d(e.getZoom(), n) || 0,r = (p ? p(e.getZoom(), n) : t.textIgnorePlacement) || 0;return i = 1 << 3 + 4 * i, r = (p ? 2 : 0) + r, i + r;} }, { attrName: \"aOverlap\", symbolName: \"textIgnorePlacement\", type: Uint8Array, width: 1, evaluate: function evaluate(n) {var i = (d ? d(e.getZoom(), n) : t.textAllowOverlap) || 0,r = p(e.getZoom(), n) || 0;return i = (d ? 8 : 0) + 4 * i, r = 1 << 1 + r, i + r;} }];}var Qi = [],er = [],tr = [],nr = [];function ir(e, t, n, i, r, s, o) {e = 1 === e ? 1 : 0;var a = this.getMap(),l = t.geometry.properties,h = this.getSymbol(l.symbolIndex),c = \"line\" === l.textPlacement && !He(h),u = l.aTextSize,f = l.aTextHalo,d = l.aShape;var p = u ? u[n[r]] : h.textSize;null == p && (p = Gi.textSize);var g = f ? f[2 * n[r]] : t.properties.textHaloRadius,m = Bi(tr, t, n[r]),y = t.geometry.properties.aProjectedAnchor;var x = nr;var _ = 3 * n[r];y && y[_] !== ge ? (nr[0] = y[_], nr[1] = y[_ + 1], nr[2] = y[_ + 2]) : x = Bt(nr, m, o, a.width, a.height);var v = i,_this$_getCollideBoxe = this._getCollideBoxes(t, r),b = _this$_getCollideBoxe.boxes,A = _this$_getCollideBoxe.collision;var T = 0;if (c || 1 === t.material.uniforms.textRotateWithMap || h.textRotation) {var _i161 = 0;for (var _s102 = r; _s102 < r + 6 * v; _s102 += 6) {var _r128 = b[T] = b[T] || [];T++;var _l42 = Ui.call(this, _r128, m, x, t, p, g, n[_s102], o, a);if (!e) {var _t305 = this.isCollides(_l42);1 === _t305 ? e = 1 : -1 === _t305 && _i161++;}}_i161 === v && (e = -1);} else {var _i162 = n[r],_l43 = d[2 * _i162 + 1];for (var _h29 = r; _h29 < s; _h29 += 6) {var _r129 = d[2 * n[_h29] + 1];if (_l43 !== _r129 || _h29 === s - 6) {var _c20 = n[_h29 === s - 6 ? _h29 : _h29 - 6],_u18 = Ui.call(this, Qi, m, x, t, p, g, _i162, o, a),_f15 = Ui.call(this, er, m, x, t, p, g, _c20, o, a),_d11 = b[T] = b[T] || [];T++, _d11[0] = Math.min(_u18[0], _f15[0]), _d11[1] = Math.min(_u18[1], _f15[1]), _d11[2] = Math.max(_u18[2], _f15[2]), _d11[3] = Math.max(_u18[3], _f15[3]), _i162 = n[_h29], _l43 = _r129, !e && this.isCollides(_d11) && (e = 1);}}}return A.collides = e, A;}function rr(e, t) {var n = function (e, t) {var _e$geometry$propertie2 = e.geometry.properties,n = _e$geometry$propertie2.aPickingId,i = _e$geometry$propertie2.features,r = n[t],s = i && i[r] && i[r].feature;return s && s.label;}(e, t);return n ? function (e, t, n) {if (!n) return null;var i = e.localTransform,r = Bi(sr, e, t);_gl.vec4.set(or, r[0], r[1], r[2], 1);var s = _gl.vec4.transformMat4(or, or, i);var o = 0;var _iterator48 = _createForOfIteratorHelper(n),_step48;try {for (_iterator48.s(); !(_step48 = _iterator48.n()).done;) {var _e339 = _step48.value;o += _e339.codePointAt(0);}} catch (err) {_iterator48.e(err);} finally {_iterator48.f();}return [Math.floor(s[0]), Math.floor(s[1]), Math.floor(s[2]), o];}(e, t, n) : null;}var sr = [],or = [];var ar = 6,lr = 4,hr = new Uint16Array(1),cr = new Int8Array(1);function ur(e, t, n, i, r, o, a, l, h) {if (t.isDisposed() || 0 === t.data.aPosition.length) return null;var c = !!t.properties.iconAtlas,u = !!t.properties.glyphAtlas;if (!c && !u && !t.properties.isEmpty) return null;if (!t.properties.aShape) {var _t$data3 = t.data,_e340 = _t$data3.aPosition,_n207 = _t$data3.aShape,_i163 = t.data.aPosition.length / t.desc.positionSize,_r130 = new Uint8Array(_i163);l && _r130.fill(255, 0), t.data.aOpacity = { usage: \"dynamic\", data: _r130 }, t.properties.aOpacity = new Uint8Array(_i163), l && t.properties.aOpacity.fill(255, 0), t.properties.aAnchor = _e340;var _s103 = _n207.length / 4,_o77 = new _n207.constructor(2 * _s103);for (var _e341 = 0; _e341 < _s103; _e341++) _o77[2 * _e341] = _n207[4 * _e341], _o77[2 * _e341 + 1] = _n207[4 * _e341 + 1];t.properties.aShape = _o77;}t.properties.visElemts || (t.properties.elements = t.elements, t.properties.visElemts = new t.elements.constructor(t.elements.length)), u && Xi.call(this, t, i, o.text, a, l, h), t.properties.memorySize = t.getMemorySize(), t.generateBuffers(e, { excludeElementsInVAO: !0 });var f = { flipY: 0, tileResolution: t.properties.tileResolution, tileRatio: t.properties.tileRatio };dr.call(this, f, e, t, r), Yi.call(this, f, e, t, r), f.isHalo = 0;var d = [],p = { disableVAO: !0, transparent: !0, castShadow: !1, picking: !0 };var g;if (u) {var _e342 = Se({}, f);_e342.isHalo = 1;var _i164 = new _gl.reshader.Material(_e342);g = new _gl.reshader.Mesh(t, _i164, p), g.properties.isHalo = 1, g.setUniform(\"alphaTest\", vi), g.setLocalTransform(n);}var m = new _gl.reshader.Material(f),y = new _gl.reshader.Mesh(t, m, p),x = { HAS_HALO_ATTR: 1 };if (a && (x.ENABLE_COLLISION = 1), pr.call(this, t, x), g) {var _e343 = Se({}, x);Zi.call(this, x, g), g.setDefines(_e343);}return u && Zi.call(this, x, y), y.setDefines(x), y.setUniform(\"alphaTest\", vi), y.setLocalTransform(n), y.properties.symbolIndex = t.properties.symbolIndex, d.push(y), d;}function fr(e) {var _e$data4 = e.data,t = _e$data4.aMarkerDx,n = _e$data4.aMarkerDy,i = _e$data4.aTextDx,r = _e$data4.aTextDy,s = i || r || t || n;if (s) {var _o78 = new s.constructor(4 * s.length);for (var _e344 = 0; _e344 < _o78.length; _e344 += 4) {var _s104 = _e344 / 4;t && (_o78[_e344] = t[_s104]), n && (_o78[_e344 + 1] = n[_s104]), i && (_o78[_e344 + 2] = i[_s104]), r && (_o78[_e344 + 3] = r[_s104]);}e.data.aDxDy = _o78, e.properties.aDxDy = _o78.slice(), t && (e.properties.aMarkerDx = t), n && (e.properties.aMarkerDy = n), i && (e.properties.aTextDx = i), r && (e.properties.aTextDy = r);}}function dr(e, t, n, i) {var _vn3 = vn(n),_vn4 = _slicedToArray(_vn3, 2),r = _vn4[0],s = _vn4[1];ke(e, \"markerOpacity\", i, \"markerOpacity\", 1), ke(e, \"markerPerspectiveRatio\", i, \"markerPerspectiveRatio\", i.markerTextFit ? 0 : 1), ke(e, \"markerWidth\", i, \"markerWidth\", r || mi), ke(e, \"markerHeight\", i, \"markerHeight\", s || yi), ke(e, \"markerDx\", i, \"markerDx\", 0), ke(e, \"markerDy\", i, \"markerDy\", 0), ke(e, \"markerRotation\", i, \"markerRotation\", 0, function (e) {return e * Math.PI / 180;}), ke(e, \"markerPitchWithMap\", i, \"markerPitchAlignment\", 0, function (e) {return \"map\" === e ? 1 : 0;}), ke(e, \"markerRotateWithMap\", i, \"markerRotationAlignment\", 0, function (e) {return \"map\" === e ? 1 : 0;});var o = n.properties.iconAtlas;e.iconTex = o ? yn(t, o, !1) : this._emptyTexture, e.iconTexSize = o ? [o.width, o.height] : [0, 0];}function pr(e, t) {e.data.aMarkerWidth && (t.HAS_MARKER_WIDTH = 1), e.data.aMarkerHeight && (t.HAS_MARKER_HEIGHT = 1), e.data.aColorOpacity && (t.HAS_OPACITY = 1);var n = this.getSymbolDef(e.properties.symbolIndex);Lt(n.markerDx) && (t.HAS_MARKER_DX = 1), Lt(n.markerDy) && (t.HAS_MARKER_DY = 1), Lt(n.textDx) && (t.HAS_TEXT_DX = 1), Lt(n.textDy) && (t.HAS_TEXT_DY = 1), Lt(n.markerPitchAlignment) && (t.HAS_MARKER_PITCH_ALIGN = 1), Lt(n.textPitchAlignment) && (t.HAS_TEXT_PITCH_ALIGN = 1), Lt(n.markerRotationAlignment) && (t.HAS_MARKER_ROTATION_ALIGN = 1), Lt(n.textRotationAlignment) && (t.HAS_TEXT_ROTATION_ALIGN = 1), Lt(n.markerRotation) && (t.HAS_MARKER_ROTATION = 1), Lt(n.textRotation) && (t.HAS_TEXT_ROTATION = 1), e.data.aPadOffset && (t.HAS_PAD_OFFSET = 1), e.data.aAltitude && (t.HAS_ALTITUDE = 1);}function gr(e, t, n, i) {St(e, t, n, i), function (e) {var _e$data5 = e.data,t = _e$data5.aMarkerWidth,n = _e$data5.aMarkerHeight,i = _e$data5.aMarkerDx,r = _e$data5.aMarkerDy,s = _e$data5.aPitchAlign,o = _e$data5.aRotationAlign,a = _e$data5.aRotation,l = _e$data5.aOverlap;if (t) {var _n208 = (Tt + \"aMarkerWidth\").trim();e.properties.aMarkerWidth = e.properties[_n208] || new t.constructor(t);}if (n) {var _t306 = (Tt + \"aMarkerHeight\").trim();e.properties.aMarkerHeight = e.properties[_t306] || new n.constructor(n);}if (i) {var _t307 = (Tt + \"aMarkerDx\").trim();e.properties.aMarkerDx = e.properties[_t307] || new i.constructor(i);}if (r) {var _t308 = (Tt + \"aMarkerDy\").trim();e.properties.aMarkerDy = e.properties[_t308] || new r.constructor(r);}if (s) {var _t309 = (Tt + \"aPitchAlign\").trim();e.properties.aPitchAlign = e.properties[_t309] || new s.constructor(s);}if (o) {var _t310 = (Tt + \"aRotationAlign\").trim();e.properties.aRotationAlign = e.properties[_t310] || new o.constructor(o);}if (a) {var _t311 = (Tt + \"aRotation\").trim();e.properties.aRotation = e.properties[_t311] || new a.constructor(a);}if (l) {var _t312 = (Tt + \"aOverlap\").trim();e.properties.aOverlap = e.properties[_t312] || new l.constructor(l);}}(e);}function mr(e, t) {var _this55 = this;var n = (0, _functionType.interpolated)(t.markerWidth),i = (0, _functionType.interpolated)(t.markerHeight),r = (0, _functionType.interpolated)(t.markerDx),s = (0, _functionType.interpolated)(t.markerDy),o = (0, _functionType.interpolated)(t.markerOpacity),a = (0, _functionType.interpolated)(t.markerTextFit),l = (0, _functionType.piecewiseConstant)(t.markerPitchAlignment),h = (0, _functionType.piecewiseConstant)(t.textPitchAlignment),c = (0, _functionType.piecewiseConstant)(t.markerRotationAlignment),u = (0, _functionType.piecewiseConstant)(t.textRotationAlignment),f = (0, _functionType.interpolated)(t.markerRotation),d = (0, _functionType.interpolated)(t.textRotation),p = (0, _functionType.piecewiseConstant)(t.markerAllowOverlapFn),g = (0, _functionType.piecewiseConstant)(t.markerIgnorePlacement),m = (0, _functionType.interpolated)(t.textOpacity),y = (0, _functionType.interpolated)(t.textDx),x = (0, _functionType.interpolated)(t.textDy),A = new Int16Array(1),T = new Uint16Array(1);return [{ attrName: \"aMarkerWidth\", symbolName: \"markerWidth\", type: Uint16Array, width: 1, define: \"HAS_MARKER_WIDTH\", evaluate: function evaluate(i, r, s, o) {var l = s[o],h = t.markerTextFit,c = a ? a(e.getZoom(), i) : h;if (\"both\" === c || \"width\" === c) return l;var u = n(e.getZoom(), i);return (0, _functionType.isFunctionDefinition)(u) && (u = _this55.evaluateInFnTypeConfig(u, r, e, i)), A[0] = u, A[0];} }, { attrName: \"aMarkerHeight\", symbolName: \"markerHeight\", type: Uint16Array, width: 1, define: \"HAS_MARKER_HEIGHT\", evaluate: function evaluate(n, r, s, o) {var l = s[o],h = t.markerTextFit,c = a ? a(e.getZoom(), n) : h;if (\"both\" === c || \"height\" === c) return l;var u = i(e.getZoom(), n);return (0, _functionType.isFunctionDefinition)(u) && (u = _this55.evaluateInFnTypeConfig(u, r, e, n)), A[0] = u, A[0];} }, { attrName: \"aDxDy\", symbolName: \"markerDx\", type: Int8Array, width: 4, index: 0, define: \"HAS_MARKER_DX\", evaluate: function evaluate(t, n, i, s) {var o = r(e.getZoom(), t);(0, _functionType.isFunctionDefinition)(o) && (o = _this55.evaluateInFnTypeConfig(o, n, e, t));var a = n.properties.aMarkerDx;return a && (a[s / 4] = o), A[0] = o, A[0];} }, { attrName: \"aDxDy\", symbolName: \"markerDy\", type: Int8Array, width: 4, index: 1, define: \"HAS_MARKER_DY\", evaluate: function evaluate(t, n, i, r) {var o = s(e.getZoom(), t);(0, _functionType.isFunctionDefinition)(o) && (o = _this55.evaluateInFnTypeConfig(o, n, e, t));var a = n.properties.aMarkerDy;return a && (a[Math.floor(r / 4)] = o), A[0] = o, A[0];} }, { attrName: \"aDxDy\", symbolName: \"textDx\", type: Int8Array, width: 4, index: 2, define: \"HAS_TEXT_DX\", evaluate: function evaluate(t, n, i, r) {var s = y(e.getZoom(), t);(0, _functionType.isFunctionDefinition)(s) && (s = _this55.evaluateInFnTypeConfig(s, n, e, t));var o = n.properties.aTextDx;return o && (o[Math.floor(r / 4)] = s), A[0] = s, A[0];} }, { attrName: \"aDxDy\", symbolName: \"textDy\", type: Int8Array, width: 4, index: 3, define: \"HAS_TEXT_DY\", evaluate: function evaluate(t, n, i, r) {var s = x(e.getZoom(), t);(0, _functionType.isFunctionDefinition)(s) && (s = _this55.evaluateInFnTypeConfig(s, n, e, t));var o = n.properties.aTextDy;return o && (o[Math.floor(r / 4)] = s), A[0] = s, A[0];} }, { attrName: \"aColorOpacity\", symbolName: \"markerOpacity\", type: Uint8Array, width: 2, index: 0, define: \"HAS_OPACITY\", evaluate: function evaluate(t, n) {var i = 1;return o && (i = o(e.getZoom(), t), (0, _functionType.isFunctionDefinition)(i) && (i = _this55.evaluateInFnTypeConfig(i, n, e, t))), A[0] = 255 * i, A[0];} }, { attrName: \"aColorOpacity\", symbolName: \"textOpacity\", type: Uint8Array, width: 2, index: 1, define: \"HAS_OPACITY\", evaluate: function evaluate(t, n) {var i = 1;return m && (i = m(e.getZoom(), t), (0, _functionType.isFunctionDefinition)(i) && (i = _this55.evaluateInFnTypeConfig(i, n, e, t))), A[0] = 255 * i, A[0];} }, { attrName: \"aPitchAlign\", symbolName: \"markerPitchAlignment\", type: Uint8Array, width: 2, index: 0, define: \"HAS_PITCH_ALIGN\", evaluate: function evaluate(t) {return +(\"map\" === l(e.getZoom(), t));} }, { attrName: \"aPitchAlign\", symbolName: \"textPitchAlignment\", type: Uint8Array, width: 2, index: 1, define: \"HAS_PITCH_ALIGN\", evaluate: function evaluate(t) {return +(\"map\" === h(e.getZoom(), t));} }, { attrName: \"aRotationAlign\", symbolName: \"markerRotationAlignment\", type: Uint8Array, width: 2, index: 0, define: \"HAS_MARKER_ROTATION_ALIGN\", evaluate: function evaluate(t) {return +(\"map\" === c(e.getZoom(), t));} }, { attrName: \"aRotationAlign\", symbolName: \"textRotationAlignment\", type: Uint8Array, width: 2, index: 1, define: \"HAS_TEXT_ROTATION_ALIGN\", evaluate: function evaluate(t) {return +(\"map\" === u(e.getZoom(), t));} }, { attrName: \"aRotation\", symbolName: \"markerRotation\", type: Uint16Array, width: 2, index: 0, define: \"HAS_MARKER_ROTATION\", evaluate: function evaluate(t) {var n = Pe(f(e.getZoom(), t), 0, 360) * Math.PI / 180;return T[0] = 9362 * n, T[0];} }, { attrName: \"aRotation\", symbolName: \"textRotation\", type: Uint16Array, width: 2, index: 1, define: \"HAS_TEXT_ROTATION\", evaluate: function evaluate(t) {var n = Pe(d(e.getZoom(), t), 0, 360) * Math.PI / 180;return T[0] = 9362 * n, T[0];} }, { attrName: \"aOverlap\", symbolName: \"markerAllowOverlap\", type: Uint8Array, width: 1, evaluate: function evaluate(n) {var i = p(e.getZoom(), n) || 0,r = (g ? g(e.getZoom(), n) : t.markerIgnorePlacement) || 0;return i = 1 << 3 + 4 * i, r = (g ? 2 : 0) + r, i + r;} }, { attrName: \"aOverlap\", symbolName: \"markerIgnorePlacement\", type: Uint8Array, width: 1, evaluate: function evaluate(n) {var i = (p ? p(e.getZoom(), n) : t.markerAllowOverlap) || 0,r = g(e.getZoom(), n) || 0;return i = (p ? 8 : 0) + 4 * i, r = 2 + r, i + r;} }];}function yr(e, t, n) {if (!t || !n || \"none\" === n) return;var _t$properties2 = t.properties,i = _t$properties2.iconAtlas,r = _t$properties2.glyphAtlas;if (!i || !r) return;!function (e) {if (e.properties.iconElements) return;var t = [],n = [],i = e.elements,r = e.properties.aType;for (var _e345 = 0; _e345 < i.length; _e345++) {var _s105 = i[_e345];0 === r[_s105] ? t.push(_s105) : n.push(_s105);}e.properties.iconElements = new i.constructor(t), e.properties.textElements = new i.constructor(n);}(t);var s = function (e, t) {var n = e.properties.textFitFn;(0, _functionType.isFunctionDefinition)(t) && (n = e.properties.textFitFn = (0, _functionType.piecewiseConstant)(t));var i = \"none\" !== t,r = [],s = e.properties.iconElements,o = e.data.aPickingId,a = e.properties.textElements,l = e.data.aPickingId,h = e.properties.aCount,c = e.properties.features;var u,f = a[0];u = { pickingId: l[f], start: 0, end: h[f] * ar };var d = !1,p = !1,g = 0;var m = new Set();for (var _e346 = 0; _e346 < s.length; _e346 += ar) {var _f16 = o[s[_e346]];if (!d && u) for (; u.pickingId < _f16 && u.end < a.length;) {var _e347 = u.end,_t313 = a[_e347];u.start = _e347, u.end = _e347 + h[_t313] * ar, u.pickingId = l[_t313];}if (!d && u && u.pickingId < _f16 && (d = !0, !i)) {if (!p) return [];for (var _t314 = _e346; _t314 < s.length; _t314 += ar) r[g++] = [-1, -1];return r;}var _y6 = c[_f16] && c[_f16].feature,_x7 = _y6 && _y6.properties || {},_8 = n ? n(null, _x7) : t;if (u && _f16 === u.pickingId) {r[g++] = [u.start, u.end];var _e348 = u.end,_t315 = a[_e348];u.start = _e348, u.end = _e348 + h[_t315] * ar, u.pickingId = l[_t315], p = !0;} else if (_8 && \"none\" !== _8) for (var _t316 = _e346; _t316 < _e346 + ar; _t316++) m.add(_t316);else r[g++] = [-1, -1];}if (m.size) if (m.size === s.length) e.setElements([]);else {var _t317 = [];for (var _e349 = 0; _e349 < s.length; _e349++) m.has(_e349) || _t317.push(s[_e349]);e.setElements(new s.constructor(_t317));}if (!p) return [];return r;}(t, n);if (!t.getElements().length) return;if (!s.length) return;t.properties.labelIndex = s;if (s.length && n && \"none\" !== n) {var _n209 = function (e) {var t = [],n = e.properties.labelIndex,i = e.data.aShape;var r = !1;for (var _s106 = 0; _s106 < n.length; _s106++) {var _n$_s = _slicedToArray(n[_s106], 2),_o79 = _n$_s[0],_a54 = _n$_s[1];if (-1 === _o79) t.push(0, 0, 0, 0);else {r = !0;var _n210 = 1 / 0,_s107 = 1 / 0,_l44 = -1 / 0,_h30 = -1 / 0;var _c21 = e.properties.textElements;for (var _e350 = _o79; _e350 < _a54; _e350++) {var _t318 = _c21[_e350],_r131 = i[4 * _t318],_o80 = i[4 * _t318 + 1];_r131 < _n210 && (_n210 = _r131), _r131 > _l44 && (_l44 = _r131), _o80 < _s107 && (_s107 = _o80), _o80 > _h30 && (_h30 = _o80);}t.push(_n210, _s107, _l44, _h30);}}if (!r) return [];return t;}(t);_n209.length && (t.properties.labelShape = _n209, xr.call(this, e, t));}}function xr(e, t) {var n = this.getSymbolDef(t.properties.symbolIndex),i = n.markerTextFit,r = t.properties;var s = \"both\" === i || \"width\" === i,o = \"both\" === i || \"height\" === i;if ((0, _functionType.isFunctionDefinition)(n.markerTextFit)) {var _e351 = t.properties.textFitFn;_e351 || (_e351 = t.properties.textFitFn = (0, _functionType.interpolated)(n.markerTextFit));var _i165 = t.properties.features,_a55 = t.properties.iconElements,_l45 = t.data.aPickingId,_h31 = [],_c22 = [];var _u19 = !0;for (var _t319 = 0; _t319 < _a55.length; _t319 += ar) {var _n211 = _i165[_l45[_a55[_t319]]],_r132 = (_n211 && _n211.feature || {}).properties || {};var _s108 = _e351(null, _r132);if ((0, _functionType.isFunctionDefinition)(_s108)) {_s108 = (_r132.textFitFn = _r132.textFitFn || (0, _functionType.interpolated)(_s108))(null, _r132);}\"both\" === _s108 ? (_h31.push(_t319 / ar), _c22.push(_t319 / ar)) : \"width\" === _s108 ? (_u19 = !1, _h31.push(_t319 / ar)) : \"height\" === _s108 && (_u19 = !1, _c22.push(_t319 / ar));}_u19 ? (r.fitIcons = _h31, s = !0, o = !0) : (_h31.length && (r.fitWidthIcons = _h31, s = !0), _c22.length && (r.fitHeightIcons = _c22, o = !0));}r.aPickingId || (r.aPickingId = new t.data.aPickingId.constructor(t.data.aPickingId));var a = r.aMarkerWidth,l = r.aMarkerHeight,h = r.aPickingId,c = h.length;if (s) if (a) {var _e352 = t.data.aMarkerWidth;t.data.aMarkerWidth = new Uint16Array(_e352), r.aMarkerWidth = new Uint16Array(_e352);var _n212 = (Tt + \"aMarkerWidth\").trim();r[_n212] && (r[_n212] = r.aMarkerWidth);} else {var _e353 = this.getSymbol(t.properties.symbolIndex).markerWidth || 0;r.aMarkerWidth = new Uint16Array(c), r.aMarkerWidth.fill(_e353), _e353 && (r.aMarkerWidth.dirty = !0), t.data.aMarkerWidth = new Uint16Array(c);}if (o) if (l) {var _e354 = t.data.aMarkerHeight;t.data.aMarkerHeight = new Uint16Array(_e354), r.aMarkerHeight = new Uint16Array(_e354);var _n213 = (Tt + \"aMarkerHeight\").trim();r[_n213] && (r[_n213] = r.aMarkerHeight);} else {var _e355 = this.getSymbol(t.properties.symbolIndex).markerHeight || 0;r.aMarkerHeight = new Uint16Array(c), r.aMarkerHeight.fill(_e355), _e355 && (r.aMarkerHeight.dirty = !0), t.data.aMarkerHeight = new Uint16Array(c);}var u = this.getSymbolDef(t.properties.symbolIndex),f = (0, _functionType.interpolated)(u.textSize);vr.call(this, e, t), (!(0, _functionType.isFunctionDefinition)(u.textSize) || f.isZoomConstant && f.isFeatureConstant) && (r.isFitConstant = !0);}var _r = [0, 0, 0, 0];function vr(e, t) {var n = t.properties;if (!n.glyphAtlas || !n.textElements || !n.textElements.length) return;var i = t.properties;if (i.isFitConstant || !i.labelShape || !i.labelShape.length) return;var r = this.getSymbolDef(t.properties.symbolIndex),s = r.textSize;var o;(0, _functionType.isFunctionDefinition)(s) && (o = n._textSizeFn ? n._textSizeFn : n._textSizeFn = (0, _functionType.interpolated)(s));var a = r.markerTextFitPadding || _r;var l;(0, _functionType.isFunctionDefinition)(a) && (l = i._paddingFn ? i._paddingFn : i._paddingFn = (0, _functionType.piecewiseConstant)(a));var h = e.getZoom(),c = i.fitIcons,u = i.fitWidthIcons,f = i.fitHeightIcons,d = i.aMarkerWidth,p = i.aMarkerHeight,g = i.labelShape,m = t.properties.iconElements,y = i.features,x = i.aPickingId,A = function A(e, t, n, r) {var c = g[4 * t],u = g[4 * t + 1],f = g[4 * t + 2],m = g[4 * t + 3];if (!(c || u || f || m)) return;var A = x[e],T = y[A] && y[A].feature,w = T && T.properties || {};var S = o ? o(h, w) : s;if ((0, _functionType.isFunctionDefinition)(S)) {S = (w.textSizeFn = w.textSizeFn || (0, _functionType.interpolated)(S))(h, w);}S /= _i;var M,P = l && l(h, w) || a;if ((0, _functionType.isFunctionDefinition)(P)) {P = (w.fitPaddingFn = w.fitPaddingFn || (0, _functionType.piecewiseConstant)(P))(h, w);}if (P = P || _r, P[0] === P[2] && P[1] === P[3] || (M = i.aPadOffset, M || (M = i.aPadOffset = new Int8Array(2 * d.length))), d && n) {var _t320 = Math.abs((f - c) / 10 * S) + (P[1] + P[3] || 0);if (hr[0] = _t320, d[e] !== hr[0] && (De(d, hr[0], e, e + lr), d.dirty = !0), M) {var _t321 = (P[1] + P[3]) / 2 - P[3];if (cr[0] = _t321, M[2 * e] !== cr[0]) {for (var _n214 = e; _n214 < e + lr; _n214++) M[2 * _n214] = _t321;M.dirty = !0;}}}if (p && r) {var _t322 = Math.abs((m - u) / 10 * S) + (P[0] + P[2] || 0);if (hr[0] = _t322, p[e] !== hr[0] && (De(p, hr[0], e, e + lr), p.dirty = !0), M) {var _t323 = P[0] - (P[0] + P[2]) / 2;if (cr[0] = _t323, M[2 * e + 1] !== cr[0]) {for (var _n215 = e; _n215 < e + lr; _n215++) M[2 * _n215 + 1] = _t323;M.dirty = !0;}}}};if (c || u || f) {if (c) for (var _e356 = 0; _e356 < c.length; _e356++) {var _t324 = c[_e356];A(m[_t324 * ar], _t324, !0, !0);} else if (u || f) {if (u) for (var _e357 = 0; _e357 < u.length; _e357++) {var _t325 = u[_e357];A(m[_t325 * ar], _t325, !0, !1);}if (f) for (var _e358 = 0; _e358 < f.length; _e358++) {var _t326 = f[_e358];A(m[_t326 * ar], _t326, !1, !0);}}} else for (var _e359 = 0; _e359 < m.length; _e359 += ar) {var _t327 = _e359 / ar;A(m[_e359], _t327, !0, !0);}var T = i.aPadOffset;T && (t.data.aPadOffset = T);}var _H9 = H(),br = _H9.FilterUtil,Ar = [],Tr = { collides: -1 },wr = [xi, xi],Sr = _gl.mat4.identity([]),Mr = [];var Pr = exports.IconPainter = function (_ti) {function Pr(e, t, n, i, r, s) {var _this56;_classCallCheck(this, Pr);_this56 = _callSuper(this, Pr, [e, t, n, i, r, s]), _this56.propAllowOverlap = \"markerAllowOverlap\", _this56.propIgnorePlacement = \"markerIgnorePlacement\", _this56._fnTypeConfigs = {}, _this56.isLabelCollides = ir.bind(_assertThisInitialized(_this56)), _this56._meshesToCheck = [], _this56._emptyTexture = e.texture(2);return _this56;}_inherits(Pr, _ti);return _createClass(Pr, [{ key: \"needToRefreshTerrainTileOnZooming\", value: function needToRefreshTerrainTileOnZooming() {for (var _e360 = 0; _e360 < this.symbolDef.length; _e360++) {var _t328 = this.symbolDef[_e360].markerPitchAlignment;if (\"map\" === _t328 || (0, _functionType.isFunctionDefinition)(_t328) || br.isExpression(_t328)) return !0;}return !1;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {return this.layer.options.awareOfTerrain && !this.needToRefreshTerrainTileOnZooming();} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {return _superPropGet(Pr, \"isTerrainSkin\", this, 3)([]) && this.needToRefreshTerrainTileOnZooming();} }, { key: \"setShaderDefines\", value: function setShaderDefines(e) {this._shaderDefines = e;} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {var n = mr.call(this, e, t),i = Ki.call(this, e, t);for (var _e361 = i.length - 1; _e361 >= 0; _e361--) {var _t329 = i[_e361].attrName;\"aTextDx\" !== _t329 && \"aTextDy\" !== _t329 && \"aPitchAlign\" !== _t329 && \"aRotation\" !== _t329 && \"aRotationAlign\" !== _t329 && \"aColorOpacity\" !== _t329 && \"aOverlap\" !== _t329 || i.splice(_e361, 1);}var r = n.concat(i);return r.text = i, r.icon = n, r;} }, { key: \"startFrame\", value: function startFrame() {for (var _len10 = arguments.length, e = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {e[_key10] = arguments[_key10];}return this._meshesToCheck.length = 0, _superPropGet(Pr, \"startFrame\", this, 3)(e);} }, { key: \"createGeometry\", value: function createGeometry(e, t) {return e && e.empty && (e.data = { aPosition: new Uint8Array(e.data.aPosition), aPickingId: e.data.aPickingId }), _superPropGet(Pr, \"createGeometry\", this, 3)([e, t]);} }, { key: \"postCreateGeometry\", value: function postCreateGeometry(e) {var t = e.geometry,n = e.symbolIndex,i = this.getSymbolDef(n),r = this.getFnTypeConfig(n),_t$properties3 = t.properties,s = _t$properties3.iconAtlas,o = _t$properties3.glyphAtlas;if (s || o) {if (this._prepareRequiredProps(t), s && (this.drawDebugAtlas(s), gr(t, i, r.icon, this.layer)), o) {var _e362 = i.markerTextFit;if (_e362) {var _n216 = this.getMap();yr.call(this, _n216, t, _e362);}}} else t.properties.isEmpty = !0;} }, { key: \"_prepareRequiredProps\", value: function _prepareRequiredProps(e) {var _e$data6 = e.data,t = _e$data6.aCount,n = _e$data6.aShape;e.properties.aCount = t, delete e.data.aCount;var i = n.length / 4,r = new Uint8Array(i),s = new Uint8Array(i);for (var _e363 = 0; _e363 < i; _e363++) r[_e363] = n[4 * _e363 + 2] % 2, s[_e363] = n[4 * _e363 + 3] % 2;e.properties.aType = r, e.properties.aHalo = s, fr.call(this, e);} }, { key: \"prepareCollideIndex\", value: function prepareCollideIndex(e) {var _e$properties2 = e.properties,t = _e$properties2.collideIds,n = _e$properties2.elements,i = _e$properties2.aCount,r = _e$properties2.aType;if (!t) return;var s = {};if (!n) return void (e.properties.collideBoxIndex = s);var o = 0,a = n[0],l = 0,h = t[a],c = r[0],u = 1;i && (u = i[n[l]]);for (var _e364 = 0; _e364 <= n.length; _e364 += ar) if (a = n[_e364], t[a] !== h || c !== r[a] || _e364 === n.length) {s[h] || (s[h] = []);var _f17 = _e364;var _d12 = l;1 === c && (_d12 = l + (_f17 - l) / 2), s[h].push([_d12, _f17, (_f17 - _d12) / (u * ar), o++, l]), h = t[a], c = r[a], l = _e364, i && (u = i[n[l]]);}e.properties.collideBoxIndex = s;} }, { key: \"createMesh\", value: function createMesh(e, t) {var n = this.isEnableCollision(),i = this.layer,r = e.geometry,s = e.symbolIndex;r.properties.symbolIndex = s;var o = this.getSymbolDef(s),a = this.getSymbol(s),l = this.getFnTypeConfig(s),h = [],c = this.isEnableUniquePlacement(),u = ur.call(this, this.regl, r, t, o, a, l, i.options.collision, !n, c);if (u.length) {var _e365 = this.getAltitudeOffsetMatrix();u[0].positionMatrix = _e365, u[1] && (u[1].positionMatrix = _e365), h.push.apply(h, _toConsumableArray(u));}return \"line\" === r.properties.markerPlacement && (this._rebuildCollideIds(r), h.forEach(function (e) {return e.properties.isLinePlacement = !0;})), this.prepareCollideIndex(r), h;} }, { key: \"_rebuildCollideIds\", value: function _rebuildCollideIds(t) {var n = this.layer instanceof e.TileLayer,_t$properties4 = t.properties,i = _t$properties4.collideIds,r = _t$properties4.glyphAtlas,s = _t$properties4.iconAtlas,o = new Uint16Array(i.length),a = !!r;if (!!s) {var _t$properties5 = t.properties,_e366 = _t$properties5.collideIds,_i166 = _t$properties5.aType;if (r) {var _t330 = 0,_n217 = _i166[0],_r133 = 0;for (var _s109 = 1; _s109 < _e366.length; _s109++) 0 === _i166[_s109] && 1 === _n217 && (o.fill(_t330++, _r133, _s109), _r133 = _s109), _n217 = _i166[_s109];_r133 < _e366.length && o.fill(_t330++, _r133, _e366.length);} else {var _t331 = 0;for (var _n218 = 0; _n218 < _e366.length; _n218 += lr) o.fill(_t331++, _n218, _n218 + lr);}t.properties.collideIds = o, t.properties.uniqueCollideIds = ze(o, !n);} else if (a) {var _t$properties6 = t.properties,_e367 = _t$properties6.collideIds,_i167 = _t$properties6.aCount;if (!_i167) return;var _r134 = 0,_s110 = _i167[0];for (var _t332 = 0; _t332 < _e367.length;) {var _n219 = _t332 + _s110 * lr;_e367.fill(_r134++, _t332, _n219), _t332 += _s110 * lr, _n219 < _e367.length && (_s110 = _i167[_n219]);}t.properties.uniqueCollideIds = ze(_e367, !n);}} }, { key: \"addMesh\", value: function addMesh(e) {if (this.isEnableCollision() && e.length > 0) {var _t333 = new Xn(e);_t333.properties.uniqueCollideIds = e[0].geometry.properties.uniqueCollideIds, _t333.properties.meshKey = e[0].properties.meshKey, _t333.properties.level = e[0].properties.level, this._meshesToCheck.push(_t333);}for (var _t334 = 0; _t334 < e.length; _t334++) {if (!this.isMeshIterable(e[_t334])) continue;var _n220 = e[_t334].geometry,_i168 = _n220.properties.symbolIndex;He(this.getSymbolDef(_i168)) && vr.call(this, this.getMap(), _n220);}var t = this.getMap().getZoom();for (var _n221 = 0; _n221 < e.length; _n221++) {if (!this.isMeshIterable(e[_n221])) continue;var _i169 = e[_n221].geometry,_r135 = _i169.properties.symbolIndex,_s111 = this.getSymbolDef(_r135),_o81 = this.getFnTypeConfig(_r135);Ct(this.regl, this.layer, _s111, _o81, e[_n221], t);var _i169$properties = _i169.properties,_a56 = _i169$properties.aMarkerWidth,_l46 = _i169$properties.aMarkerHeight,_h32 = _i169$properties.aPadOffset;_a56 && _a56.dirty && (_i169.updateData(\"aMarkerWidth\", _a56), _a56.dirty = !1), _l46 && _l46.dirty && (_i169.updateData(\"aMarkerHeight\", _l46), _l46.dirty = !1), _h32 && _h32.dirty && (_i169.updateData(\"aPadOffset\", _h32), _h32.dirty = !1);}_superPropGet(Pr, \"addMesh\", this, 3)(arguments);} }, { key: \"updateCollision\", value: function updateCollision(e) {if (!this.isEnableCollision()) return;_superPropGet(Pr, \"updateCollision\", this, 3)([e]);var t = this.scene.getMeshes();t && t.length ? (this._updateIconCollision(e.timestamp), this._meshesToCheck = [], this._endCollision()) : this._endCollision();} }, { key: \"isMeshIterable\", value: function isMeshIterable(e) {return e && e.geometry && !e.geometry.properties.isEmpty && e.material && this.isMeshVisible(e) && !(this.shouldIgnoreBackground() && !this.layer.getRenderer().isForeground(e));} }, { key: \"_updateIconCollision\", value: function _updateIconCollision() {if (!this.isEnableCollision()) return;var e = this._meshesToCheck;e && e.length && this._updateIconAndText(e);} }, { key: \"_updateBox\", value: function _updateBox(e, t, n, i) {return this.updateBoxCollisionFading(!0, e, t, n, i);} }, { key: \"isEnableUniquePlacement\", value: function isEnableUniquePlacement() {return this.isEnableCollision() && !0 === this.sceneConfig.uniquePlacement;} }, { key: \"_updateIconAndText\", value: function _updateIconAndText(e) {var t = this.layer.getRenderer();e = e.sort(Ir);for (var _n222 = 0; _n222 < e.length; _n222++) {var _i170 = e[_n222];if (!_i170 || !_i170.meshes.length) continue;var _r136 = !1;if (1 === _i170.meshes.length) _r136 = this.isMeshIterable(_i170.meshes[0]);else for (var _e368 = 0; _e368 < _i170.meshes.length; _e368++) if (this.isMeshIterable(_i170.meshes[_e368])) {_r136 = !0;break;}if (!_r136) continue;var _s112 = t.isForeground(_i170.meshes[0]);if (this.shouldIgnoreBackground() && !_s112) continue;var _o82 = _i170.properties.meshKey;this.startMeshCollision(_i170), this._startCheckMesh(_i170), this.forEachBox(_i170, this._updateBox), this._endCheckMesh(_i170), this.endMeshCollision(_o82);for (var _e369 = 0; _e369 < _i170.meshes.length; _e369++) this._updateOpacity(_i170.meshes[_e369]);}} }, { key: \"_updateOpacity\", value: function _updateOpacity(e) {var t = e && e.geometry && e.geometry.properties.aOpacity;t && t.dirty && (e.geometry.updateData(\"aOpacity\", t), t.dirty = !1);} }, { key: \"forEachBox\", value: function forEachBox(e, t) {var n = e.properties.uniqueCollideIds;if (!n) return;var i = { boxIndex: 0 },r = n.length;for (var _s113 = 0; _s113 < r; _s113++) this._iterateMeshBox(e, n[_s113], t, i);} }, { key: \"_iterateMeshBox\", value: function _iterateMeshBox(e, t, n, i) {var r = this.getMap(),s = e.meshes[0].geometry.properties.collideBoxIndex,o = s && s[t];if (!o || !o.length) return !1;var l = _gl.mat4.multiply(Ar, r.projViewMatrix, e.meshes[0].localTransform);var h,c = !1;var u = e.meshes;var f = 0;for (var _e370 = 0; _e370 < u.length; _e370++) {if (!this.isMeshIterable(u[_e370])) continue;var _n223 = u[_e370].geometry.properties.collideBoxIndex,_i171 = _n223[t];_i171 && (f += _i171.length);}if (!f) return !1;h = this._getMeshBoxes(f);var d = 0;for (var _e371 = 0; _e371 < u.length; _e371++) {var _n224 = u[_e371];if (!this.isMeshIterable(_n224)) continue;c = !0;var _i172 = _n224.geometry.properties,_r137 = _i172.elements,_s114 = _i172.aCount,_o83 = _i172.collideBoxIndex,_a57 = _o83[t];if (_a57) for (var _e372 = 0; _e372 < _a57.length; _e372++) {var _a57$_e = _slicedToArray(_a57[_e372], 3),_t335 = _a57$_e[0],_o84 = _a57$_e[1],_l47 = _a57$_e[2];var _c23 = 1;_s114 && (_c23 = _s114[_r137[_t335]]);var _u20 = _t335 + 0 * _c23 * ar;h[d].mesh = _n224, h[d].start = _u20, h[d].end = _o84, h[d].boxStart = _a57[_e372][4], h[d].boxCount = _i172.glyphAtlas ? _c23 : _l47, h[d].allElements = _r137, d++;}}if (!c) return !1;return n.call(this, e, h, l, i.boxIndex++) && this._markerVisible(e, t), !0;} }, { key: \"_startCheckMesh\", value: function _startCheckMesh(e) {var t = e.meshes;for (var _e373 = 0; _e373 < t.length; _e373++) {var _n225 = t[_e373],_i173 = _n225 && _n225.geometry;_i173 && (_i173.properties.visElemts.count = 0);}} }, { key: \"_markerVisible\", value: function _markerVisible(e, t) {var n = e.meshes;for (var _e374 = 0; _e374 < n.length; _e374++) {var _i174 = n[_e374],_r138 = _i174 && _i174.geometry;if (!_r138 || _r138.properties.isEmpty) continue;var _r138$properties = _r138.properties,_s115 = _r138$properties.collideBoxIndex,_o85 = _r138$properties.elements,_a58 = _r138$properties.visElemts,_l48 = _s115[t];if (_l48 && _l48.length) for (var _e375 = 0; _e375 < _l48.length; _e375++) {var _t336 = _l48[_e375][4],_n226 = _l48[_e375][1];var _i175 = _a58.count;for (var _e376 = _t336; _e376 < _n226; _e376++) _a58[_i175++] = _o85[_e376];_a58.count = _i175;}}} }, { key: \"_endCheckMesh\", value: function _endCheckMesh(e) {var t = e.meshes;for (var _e377 = 0; _e377 < t.length; _e377++) {var _n227 = t[_e377],_i176 = _n227 && _n227.geometry;if (!_i176) continue;var _r139 = _i176.properties.visElemts;_i176.setElements(_r139, _r139.count);}} }, { key: \"isBoxCollides\", value: function isBoxCollides(e, t, n, i, r, s) {if (this._isTextGeo(e, t, i)) return ir.call(this, 0, e, t, n, i, r, s);if (e.geometry.properties.isEmpty) return Tr;var o = e.geometry.properties.aTerrainAltitude;if (o) {if (o[2 * t[i]] === me) return Tr;}var a = this.getMap(),_this$_getCollideBoxe2 = this._getCollideBoxes(e, i),l = _this$_getCollideBoxe2.boxes,h = _this$_getCollideBoxe2.collision;var c = 0,u = 0,f = 0;for (var _n228 = i; _n228 < r; _n228 += ar) {var _i177 = l[f] = l[f] || [];f++;var _r140 = Fi.call(this, _i177, e, t[_n228], s, a);if (!c) {var _e378 = this.isCollides(_r140);1 === _e378 ? c = 1 : -1 === _e378 && u++;}}return u === n && (c = -1), h.collides = c, h;} }, { key: \"deleteMesh\", value: function deleteMesh(e, t) {e && (e instanceof Xn && (e = e.meshes), t && (Array.isArray(e) ? e.forEach(function (e) {e && e.material && delete e.material.uniforms.iconTex;}) : e.material && delete e.material.uniforms.iconTex), _superPropGet(Pr, \"deleteMesh\", this, 3)([e, t]));} }, { key: \"isBloom\", value: function isBloom(e) {var t = e && e.material && !Ie(e.material.get(\"markerOpacity\")),n = this.getSymbol(e.properties.symbolIndex);return !!(t ? n.markerBloom : n.textBloom);} }, { key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return !1;} }, { key: \"init\", value: function init() {var _this57 = this;var e = this.regl,t = this.canvas;this.renderer = new _gl.reshader.Renderer(e);var n = { viewport: { x: function x(e, t) {return t.viewport ? t.viewport.x : 0;}, y: function y(e, t) {return t.viewport ? t.viewport.y : 0;}, width: function width(e, n) {return n.viewport ? n.viewport.width : t ? t.width : 1;}, height: function height(e, n) {return n.viewport ? n.viewport.height : t ? t.height : 1;} }, stencil: { enable: !0, func: { cmp: \"<=\", ref: function ref(e, t) {return t.stencilRef;} }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, depth: { enable: !0, range: function range() {return _this57.sceneConfig.depthRange || [0, 1];}, func: function func() {return _this57.sceneConfig.depthFunc || \"always\";}, mask: !!Ie(this.sceneConfig.depthMask) || this.sceneConfig.depthMask }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } },i = this._shaderDefines || {};if (this.shader = new _gl.reshader.MeshShader({ vert: oi, frag: \"#define SHADER_NAME MARKER\\n#define HAS_HIGHLIGHT_COLOR_POINT 1\\nprecision mediump float;\\n#include \\nuniform float alphaTest;\\nuniform sampler2D iconTex;\\nuniform lowp float markerOpacity;\\nuniform lowp float blendSrcIsOne;\\nuniform float layerOpacity;\\n#include \\nvarying vec2 vTexCoord;\\nvarying float vOpacity;\\nvarying float vIsText;\\nvarying float vHalo;\\n#include \\nvoid main() {\\n vec4 c;\\n if(vIsText > .5) {\\n c = renderText(vTexCoord);\\n } else {\\n c = texture2D(iconTex, vTexCoord) * markerOpacity;\\n }\\n c = c * vOpacity * layerOpacity;\\n if(c.a < .05) {\\n discard;\\n }\\n glFragColor = c;\\n if(glFragColor.a < alphaTest) {\\n discard;\\n }\\n glFragColor = highlight_blendColor(glFragColor);\\n#if __VERSION__ == 100\\ngl_FragColor = glFragColor;\\n#endif\\n}\", uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply([], t.projViewMatrix, t.modelMatrix);} }, { name: \"zoomScale\", type: \"function\", fn: function fn(e, t) {return t.tileResolution / t.resolution;} }], extraCommandProps: n, defines: i }), this.shader.version = 300, this.pickingFBO) {var _e379 = new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + oi, uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply([], t.projViewMatrix, t.modelMatrix);} }, { name: \"zoomScale\", type: \"function\", fn: function fn(e, t) {return t.tileResolution / t.resolution;} }], extraCommandProps: n }, this.pickingFBO, this.getMap());this.picking = [_e379];}} }, { key: \"getUniformValues\", value: function getUniformValues(t, n) {var i = n && n.isRenderingTerrainSkin,r = this.layer.getTileSize().width,s = i ? Sr : t.projViewMatrix,o = t.cameraToCenterDistance,a = _gl.vec2.set(Mr, t.width, t.height);i && _gl.vec2.set(a, r, r);var l = this.getBlendFunc(),h = e.Util.isFunction(l.src) ? l.src() : l.src;return { layerScale: this.layer.options.styleScale || 1, mapPitch: t.getPitch() * Math.PI / 180, mapRotation: t.getBearing() * Math.PI / 180, projViewMatrix: s, cameraToCenterDistance: o, canvasSize: a, iconSize: wr, resolution: t.getResolution(), glyphSize: _i, gammaScale: 1, blendSrcIsOne: +!(\"one\" !== h && 1 !== h), viewport: i && n && n.viewport, isRenderingTerrain: +!!i };} }, { key: \"getUniqueEntryKey\", value: function getUniqueEntryKey(e, t) {if (!this._isTextGeo(e.geometry)) return null;var n = e.geometry.properties.elements;return rr(e, n[t]);} }, { key: \"_isTextGeo\", value: function _isTextGeo(e, t, n) {var i = e.geometry.properties.aType;return 1 === i[t[n]];} }, { key: \"delete\", value: function _delete() {return this._emptyTexture && (_gl.reshader.Util.isTextureDestroyed(this._emptyTexture) || this._emptyTexture.destroy(), this._emptyTexture = null), _superPropGet(Pr, \"delete\", this, 3)([]);} }], [{ key: \"getBloomSymbol\", value: function getBloomSymbol() {return [\"markerBloom\", \"textBloom\"];} }]);}(ti);function Ir(e, t) {return e.properties.level - t.properties.level || e.properties.meshKey - t.properties.meshKey;}var Cr = [],kr = [],Fr = [];function Or(e, t, n, i, r, s, a, l, h, c, u, d, p) {var _t$geometry$propertie2 = t.geometry.properties,g = _t$geometry$propertie2.aGlyphOffset,m = _t$geometry$propertie2.aSegment,y = _t$geometry$propertie2.aTextDx,x = _t$geometry$propertie2.aTextDy,_ = _t$geometry$propertie2.symbolIndex,v = this.getSymbol(_),b = y ? y[r] : v.textDx,A = x ? x[r] : v.textDy,T = _gl.vec2.set(Fr, b || 0, A || 0),w = _gl.vec2.set(Cr, g[2 * r], g[2 * r + 1]),S = _gl.vec3.set(kr, m[3 * r], m[3 * r + 1], m[3 * r + 2]),M = function (e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g, m, y) {p || (p = i);var x = t.geometry.properties.line,_ = s[0] * u,v = f ? _ - o : _ + o;var b = v > 0 ? 1 : -1,A = 0;f && (b *= -1, A = Math.PI), b < 0 && (A += Math.PI);var T = h + c,w = Math.abs(v);var S = b > 0 ? l : l + 1,M = Vt.convert(i),P = Vt.convert(i),I = Vt.convert(r),C = Vt.convert(r),k = 0,F = 0;for (; k + F <= w;) {if (S += b, S < h || S >= T) return null;P.x = M.x, P.y = M.y, C.x = I.x, C.y = I.y, M.x = n[3 * S], M.y = n[3 * S + 1], I.x = x[3 * S], I.y = x[3 * S + 1], k += F, F = P.dist(M) / d;}var O = (w - k) / F,R = g && g.getRenderer(),E = R && R.getTerrainHelper(),D = t.properties.tile.terrainTileInfos;if (!y && E) {var _n229 = t.properties.tile.extent,_i178 = g.getTileSize().width / _n229,_r141 = g.getMap();var _s116 = I.sub(C).mult(O)._add(C);M = qt(Gt, _r141, t, I, _i178, g, m, D), P = qt(jt, _r141, t, C, _i178, g, m, D), _s116 = qt(Wt, _r141, t, _s116, _i178, g, m, D);var _o86 = A + Math.atan2(M[1] - P[1], M[0] - P[0]);return e[0] = (_s116[0] - p[0]) / d, e[1] = (_s116[1] - p[1]) / d, e[2] = _o86, e;}var L = M.sub(P),H = L.mult(O)._add(P);H._add(L._unit()._perp()._mult(a * b));var N = A + Math.atan2(M.y - P.y, M.x - P.x);return e[0] = (H.x - i[0]) / d, e[1] = (H.y - i[1]) / d, e[2] = N, e;}(e, t, i, s, a, w, T[0], T[1], S[0], S[1], S[2], n / 24, h, l, c, u, d, p);return M;}var Rr = [],Er = [];function Dr(e, t, n, i, r, s, a, l, h, c, u, d, p) {var g = n.geometry.properties.aVertical,m = g[s];var y,x,_ = Or.call(this, Rr, n, i, r, s, l, h, c, !1);if (!_) return null;if (_gl.vec3.copy(e, _), _ = Or.call(this, Er, n, i, r, a, l, h, c, !1), p = Math.PI * p / 180, !_ || Math.abs(_[2]) > p) return null;if (_gl.vec3.copy(t, _), d && (_gl.vec2.transformMat2(Rr, Rr, d), _gl.vec2.transformMat2(Er, Er, d)), m) {var _e380 = Math.abs(Er[1] - Rr[1]),_t337 = Math.abs(Er[0] - Rr[0]) * u;x = Rr[0] > Er[0] ? 1 : 0, _e380 > _t337 ? (y = 1, x = Rr[1] < Er[1] ? 0 : 1) : y = 0;} else y = 0, x = Rr[0] > Er[0] ? 1 : 0;return 2 * x + y;}var Lr = \"#define SHADER_NAME TEXT_VERT\\n#define RAD 0.0174532925\\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\nattribute vec4 aShape;\\n#ifdef ENABLE_COLLISION\\nattribute float aOpacity;\\n#endif\\n#ifdef HAS_OPACITY\\nattribute float aColorOpacity;\\n#endif\\n#ifdef HAS_TEXT_SIZE\\nattribute float aTextSize;\\n#else\\nuniform float textSize;\\n#endif\\n#ifdef HAS_TEXT_DX\\nattribute float aTextDx;\\n#else\\nuniform float textDx;\\n#endif\\n#ifdef HAS_TEXT_DY\\nattribute float aTextDy;\\n#else\\nuniform float textDy;\\n#endif\\n#if defined(HAS_PITCH_ALIGN)\\nattribute float aPitchAlign;\\n#else\\nuniform float textPitchWithMap;\\n#endif\\n#if defined(HAS_TEXT_ROTATION_ALIGN)\\nattribute float aRotationAlign;\\n#else\\nuniform float textRotateWithMap;\\n#endif\\nuniform float flipY;\\n#if defined(HAS_TEXT_ROTATION)\\nattribute float aRotation;\\n#else\\nuniform float textRotation;\\n#endif\\nuniform float cameraToCenterDistance;\\nuniform mat4 positionMatrix;\\nuniform mat4 projViewModelMatrix;\\nuniform float textPerspectiveRatio;\\nuniform vec2 glyphTexSize;\\nuniform vec2 canvasSize;\\nuniform float glyphSize;\\nuniform float mapPitch;\\nuniform float mapRotation;\\nuniform float zoomScale;\\nuniform float tileRatio;\\nuniform float layerScale;\\nuniform float isRenderingTerrain;\\n#ifndef PICKING_MODE\\nvarying vec2 vTexCoord;\\nvarying float vGammaScale;\\nvarying float vTextSize;\\nvarying float vOpacity;\\n#ifdef HAS_TEXT_FILL\\nattribute vec4 aTextFill;\\nvarying vec4 vTextFill;\\n#endif\\n#ifdef HAS_TEXT_HALO_FILL\\nattribute vec4 aTextHaloFill;\\nvarying vec4 vTextHaloFill;\\n#endif\\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\\nattribute vec2 aTextHalo;\\nvarying vec2 vTextHalo;\\n#endif\\n#include \\n#else\\n#include \\n#endif\\n#include \\nvoid main() {\\n vec3 c = unpackVTPosition();\\n#ifdef HAS_TEXT_SIZE\\nfloat d = aTextSize * layerScale;\\n#else\\nfloat d = textSize * layerScale;\\n#endif\\n#ifdef HAS_TEXT_DX\\nfloat e = aTextDx;\\n#else\\nfloat e = textDx;\\n#endif\\n#ifdef HAS_TEXT_DY\\nfloat f = aTextDy;\\n#else\\nfloat f = textDy;\\n#endif\\n#if defined(HAS_PITCH_ALIGN)\\nfloat h = aPitchAlign;\\n#else\\nfloat h = textPitchWithMap;\\n#endif\\n#if defined(HAS_ROTATION_ALIGN)\\nfloat i = aRotationAlign;\\n#else\\nfloat i = textRotateWithMap;\\n#endif\\ngl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\\n float j = gl_Position.w;\\n float k;\\n if(isRenderingTerrain == 1. && h == 1.) {\\n k = 1.;\\n } else {\\n float l = (1. - cameraToCenterDistance / j) * textPerspectiveRatio;\\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\\n }\\n#ifdef HAS_TEXT_ROTATION\\nfloat m = -aRotation / 9362. - mapRotation * i;\\n#else\\nfloat m = -textRotation - mapRotation * i;\\n#endif\\nif(h == 1.) {\\n \\n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\\nm += mapRotation;\\n#else\\nm -= mapRotation;\\n#endif\\n }\\n float n = sin(m);\\n float o = cos(m);\\n mat2 u = mat2(o, -1. * n, n, o);\\n vec2 v = aShape.xy / 10.0;\\n if(h == 1. && flipY == .0) {\\n v = v * vec2(1., -1.);\\n }\\n vec2 A = aShape.zw;\\n v = u * (v / glyphSize * d);\\n float B;\\n if(isRenderingTerrain == 1.) {\\n B = 1.;\\n } else {\\n B = j / cameraToCenterDistance;\\n }\\n if(h == .0) {\\n vec2 C = v * 2. / canvasSize;\\n gl_Position.xy += C * k * j;\\n } else {\\n float D;\\n if(isRenderingTerrain == 1.) {\\n D = tileRatio / zoomScale;\\n } else {\\n D = tileRatio / zoomScale * B * k;\\n }\\n vec2 C = v;\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(C, .0) * D, 1.);\\n }\\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * j;\\n#ifndef PICKING_MODE\\nif(h == .0) {\\n vGammaScale = mix(1., B, textPerspectiveRatio);\\n } else {\\n vGammaScale = B + mapPitch / 4.;\\n }\\n vTexCoord = A / glyphTexSize;\\n vGammaScale = clamp(vGammaScale, .0, 1.);\\n vTextSize = d;\\n#ifdef ENABLE_COLLISION\\nvOpacity = aOpacity / 255.;\\n#else\\nvOpacity = 1.;\\n#endif\\n#ifdef HAS_OPACITY\\nvOpacity *= aColorOpacity / 255.;\\n#endif\\n#ifdef HAS_TEXT_FILL\\nvTextFill = aTextFill / 255.;\\n#endif\\n#ifdef HAS_TEXT_HALO_FILL\\nvTextHaloFill = aTextHaloFill / 255.;\\n#endif\\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\\nvTextHalo = aTextHalo;\\n#endif\\nhighlight_setVarying();\\n#else\\n#ifdef ENABLE_COLLISION\\nbool E = aOpacity == 255.;\\n#else\\nbool E = true;\\n#endif\\nfbo_picking_setData(gl_Position.w, E);\\n#endif\\n}\",Hr = \"#define SHADER_NAME TEXT_LINE\\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\nattribute vec2 aTexCoord;\\n#ifdef HAS_OFFSET_Z\\nattribute vec3 aOffset;\\nuniform float altitudeScale;\\n#else\\nattribute vec2 aOffset;\\n#endif\\n#ifdef ENABLE_COLLISION\\nattribute float aOpacity;\\n#endif\\n#ifdef HAS_OPACITY\\nattribute float aColorOpacity;\\n#endif\\n#ifdef HAS_TEXT_SIZE\\nattribute float aTextSize;\\n#else\\nuniform float textSize;\\n#endif\\n#ifdef HAS_TEXT_DX\\nattribute float aTextDx;\\n#else\\nuniform float textDx;\\n#endif\\n#ifdef HAS_TEXT_DY\\nattribute float aTextDy;\\n#else\\nuniform float textDy;\\n#endif\\n#if defined(HAS_PITCH_ALIGN)\\nattribute float aPitchAlign;\\n#else\\nuniform float textPitchWithMap;\\n#endif\\nuniform float zoomScale;\\nuniform float cameraToCenterDistance;\\nuniform mat4 projViewModelMatrix;\\nuniform float textPerspectiveRatio;\\nuniform float mapPitch;\\nuniform vec2 glyphTexSize;\\nuniform vec2 canvasSize;\\nuniform float tileRatio;\\nuniform float layerScale;\\nuniform float isRenderingTerrain;\\nuniform float textPitchFilter;\\n#ifndef PICKING_MODE\\nvarying vec2 vTexCoord;\\nvarying float vGammaScale;\\nvarying float vTextSize;\\nvarying float vOpacity;\\n#ifdef HAS_TEXT_FILL\\nattribute vec4 aTextFill;\\nvarying vec4 vTextFill;\\n#endif\\n#ifdef HAS_TEXT_HALO_FILL\\nattribute vec4 aTextHaloFill;\\nvarying vec4 vTextHaloFill;\\n#endif\\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\\nattribute vec2 aTextHalo;\\nvarying vec2 vTextHalo;\\n#endif\\n#include \\n#else\\n#include \\n#endif\\n#include \\nvoid main() {\\n vec3 c = unpackVTPosition();\\n#ifdef HAS_TEXT_DX\\nfloat d = aTextDx;\\n#else\\nfloat d = textDx;\\n#endif\\n#ifdef HAS_TEXT_DY\\nfloat e = aTextDy;\\n#else\\nfloat e = textDy;\\n#endif\\n#ifdef HAS_TEXT_SIZE\\nfloat f = aTextSize * layerScale;\\n#else\\nfloat f = textSize * layerScale;\\n#endif\\n#ifdef HAS_PITCH_ALIGN\\nfloat h = aPitchAlign;\\n#else\\nfloat h = textPitchWithMap;\\n#endif\\ngl_Position = projViewModelMatrix * vec4(c, 1.);\\n float i = gl_Position.w;\\n float j = i / cameraToCenterDistance;\\n float k;\\n if(isRenderingTerrain == 1.) {\\n k = 1.;\\n } else {\\n float l = (1. - cameraToCenterDistance / i) * textPerspectiveRatio;\\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\\n }\\n#ifdef HAS_OFFSET_Z\\nvec3 m = aOffset / 10.0;\\n m[2] /= altitudeScale;\\n#else\\nvec3 m = vec3(aOffset / 10.0, .0);\\n#endif\\nvec2 n = aTexCoord;\\n if(h == 1.) {\\n float o;\\n if(isRenderingTerrain == 1.) {\\n o = tileRatio;\\n } else {\\n o = tileRatio / zoomScale * j * k;\\n }\\n m.xy *= o;\\n gl_Position = projViewModelMatrix * vec4(c + m, 1.);\\n } else {\\n gl_Position.xy += m.xy * 2. / canvasSize * k * i;\\n }\\n gl_Position.xy += vec2(d, -e) * 2. / canvasSize * i;\\n if(textPitchFilter > .0) {\\n if(textPitchFilter == 1. && h == .0 || textPitchFilter == 2. && h == 1.) {\\n gl_Position = vec4(-9999., -9999., .0, 1.);\\n }\\n }\\n#ifndef PICKING_MODE\\nif(h == 1.) {\\n vGammaScale = j + mapPitch / 4.;\\n } else {\\n vGammaScale = mix(1., j, textPerspectiveRatio);\\n }\\n vGammaScale = clamp(vGammaScale, .0, 1.);\\n vTexCoord = n / glyphTexSize;\\n vTextSize = f;\\n#ifdef ENABLE_COLLISION\\nvOpacity = aOpacity / 255.;\\n#else\\nvOpacity = 1.;\\n#endif\\n#ifdef HAS_OPACITY\\nvOpacity *= aColorOpacity / 255.;\\n#endif\\n#ifdef HAS_TEXT_FILL\\nvTextFill = aTextFill / 255.;\\n#endif\\n#ifdef HAS_TEXT_HALO_FILL\\nvTextHaloFill = aTextHaloFill / 255.;\\n#endif\\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\\nvTextHalo = aTextHalo;\\n#endif\\nhighlight_setVarying();\\n#else\\n#ifdef ENABLE_COLLISION\\nbool u = aOpacity == 255.;\\n#else\\nbool u = true;\\n#endif\\nfbo_picking_setData(gl_Position.w, u);\\n#endif\\n}\",Nr = \"#define SHADER_NAME TEXT_FRAG\\nprecision mediump float;\\nuniform float layerOpacity;\\nvarying vec2 vTexCoord;\\nvarying float vOpacity;\\nuniform float alphaTest;\\n#include \\n#include \\nvoid main() {\\n gl_FragColor = renderText(vTexCoord) * vOpacity * layerOpacity;\\n if(gl_FragColor.a < alphaTest) {\\n discard;\\n }\\n gl_FragColor = highlight_blendColor(gl_FragColor);\\n}\";var _H10 = H(),zr = _H10.TextUtil,Vr = _H10.PackUtil,Ur = _H10.FilterUtil,Br = _H10.TEXT_MAX_ANGLE,Gr = function Gr(e) {var t = this.layer.getRenderer();return !this._isHalo0(e) && t.isTileNearCamera(e) && \"line\" !== e.geometry.properties.textPlacement;},jr = function jr(e) {var t = this.layer.getRenderer();return !this._isHalo0(e) && !t.isForeground(e) && \"line\" !== e.geometry.properties.textPlacement;},Wr = function Wr(e) {var t = this.layer.getRenderer();return !this._isHalo0(e) && t.isTileNearCamera(e) && \"line\" === e.geometry.properties.textPlacement;},Xr = function Xr(e) {var t = this.layer.getRenderer(),n = e.properties.tile.z,i = t.getCurrentTileZoom();return !this._isHalo0(e) && !t.isForeground(e) && \"line\" === e.geometry.properties.textPlacement && n < i;},Yr = [0, 0, 3],Zr = [],qr = [],$r = [],Jr = [],Kr = [],Qr = [],es = [],ts = [],ns = [1, -1],is = new Int16Array(3),rs = [],ss = [],os = [],as = [],ls = [],hs = [],cs = [],us = {},fs = {},ds = {},ps = [],gs = [],ms = _gl.mat4.identity([]),ys = [];var xs = exports.TextPainter = function (_ti2) {function xs(e, t, n, i, r, s) {var _this58;_classCallCheck(this, xs);_this58 = _callSuper(this, xs, [e, t, n, i, r, s]), _this58.propAllowOverlap = \"textAllowOverlap\", _this58.propIgnorePlacement = \"textIgnorePlacement\", _this58.colorCache = {}, _this58._filter0 = Gr.bind(_assertThisInitialized(_this58)), _this58._filter1 = jr.bind(_assertThisInitialized(_this58)), _this58._lineFilter0 = Wr.bind(_assertThisInitialized(_this58)), _this58._lineFilter1 = Xr.bind(_assertThisInitialized(_this58)), _this58.isLabelCollides = ir.bind(_assertThisInitialized(_this58)), _this58._genTextNames();return _this58;}_inherits(xs, _ti2);return _createClass(xs, [{ key: \"prepareRender\", value: function prepareRender() {for (var _len11 = arguments.length, e = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {e[_key11] = arguments[_key11];}_superPropGet(xs, \"prepareRender\", this, 3)(e);var t = this.scene.getMeshes();if (t && t.length) for (var _e381 = 0; _e381 < t.length; _e381++) {if (t[_e381].properties.isHalo) continue;var _n230 = t[_e381].properties.haloMesh;_n230.dirtyDefines && t[_e381].setDefines(_n230.defines);}} }, { key: \"updateSymbol\", value: function updateSymbol() {this._tagTerrainVector = void 0, this._tagTerrainSkin = void 0;for (var _len12 = arguments.length, e = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {e[_key12] = arguments[_key12];}var t = _superPropGet(xs, \"updateSymbol\", this, 3)(e);return this._genTextNames(), t;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {if (!_superPropGet(xs, \"isTerrainSkin\", this, 3)([])) return !1;if (void 0 !== this._tagTerrainVector) return this._tagTerrainVector;for (var _e382 = 0; _e382 < this.symbolDef.length; _e382++) {if (\"map\" !== this.symbolDef[_e382].textPitchAlignment) return this._tagTerrainVector = !0, !0;}return this._tagTerrainVector = !1, !1;} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {if (!_superPropGet(xs, \"isTerrainSkin\", this, 3)([])) return !1;if (void 0 !== this._tagTerrainSkin) return this._tagTerrainSkin;for (var _e383 = 0; _e383 < this.symbolDef.length; _e383++) {var _t338 = this.symbolDef[_e383].textPitchAlignment;if (\"map\" === _t338 || (0, _functionType.isFunctionDefinition)(_t338) || Ur.isExpression(_t338)) return this._tagTerrainSkin = !0, !0;}return this._tagTerrainSkin = !1, !1;} }, { key: \"_genTextNames\", value: function _genTextNames() {var _this59 = this;this._textNameFn = [];var _loop2 = function _loop2() {var t = _this59.symbolDef[_e384];if (Ur.isExpression(t.textName)) {var _n231 = Ur.createExpression(t.textName, \"string\");_this59._textNameFn[_e384] = function (e, t) {var i;us.zoom = e, fs.properties = t;try {i = _n231.evaluateWithoutErrorHandling(us, fs, ds, null, ps);} catch (e) {i = null;}return i;};} else (0, _functionType.isFunctionDefinition)(t.textName) && (_this59._textNameFn[_e384] = (0, _functionType.interpolated)(t.textName));};for (var _e384 = 0; _e384 < this.symbolDef.length; _e384++) {_loop2();}} }, { key: \"shouldDeleteMeshOnUpdateSymbol\", value: function shouldDeleteMeshOnUpdateSymbol(e) {if (!Array.isArray(e)) return (0 === e.textHaloRadius || 0 === this.symbolDef[0].textHaloRadius) && e.textHaloRadius !== this.symbolDef[0].textHaloRadius;for (var _t339 = 0; _t339 < e.length; _t339++) if (e[_t339] && (0 === e[_t339].textHaloRadius || 0 === this.symbolDef[_t339].textHaloRadius) && e[_t339].textHaloRadius !== this.symbolDef[_t339].textHaloRadius) return !0;return !1;} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {return Ki(e, t);} }, { key: \"isBloom\", value: function isBloom(e) {return !!this.getSymbol(e.properties.symbolIndex)[xs.getBloomSymbol()[0]];} }, { key: \"createGeometry\", value: function createGeometry(e, t, n) {var i = e;if (!i.glyphAtlas) return null;var r = _superPropGet(xs, \"createGeometry\", this, 3)([i, t]);if (!r || !r.geometry) return null;var s = r.geometry;return s.properties.glyphAtlas && this.drawDebugAtlas(s.properties.glyphAtlas), s && i.lineVertex && (s.properties.line = i.lineVertex, s.properties.line.id = n), r;} }, { key: \"createMesh\", value: function createMesh(e, t, _ref117) {var _this60 = this;var n = _ref117.tileVectorTransform;var i = this.isEnableCollision(),r = this.isEnableUniquePlacement(),s = e.geometry,o = e.symbolIndex;s.properties.symbolIndex = o;var a = this.getSymbol(o),l = this.getSymbolDef(o),h = this.getFnTypeConfig(o),c = ji.call(this, this.regl, s, t, l, a, h, this.layer.options.collision, !i, r);if (c.length) {\"line\" === s.properties.textPlacement ? this._hasLineText = !0 : this._hasNormalText = !0;}return c.forEach(function (e) {e.positionMatrix = _this60.getAltitudeOffsetMatrix(), e.properties.tileVectorTransform = n;}), c;} }, { key: \"updateCollision\", value: function updateCollision(e) {_superPropGet(xs, \"updateCollision\", this, 3)([e]);var t = this.scene.getMeshes();t && t.length ? (this._projectedLinesCache = {}, this._updateLabels(e.timestamp), this._endCollision()) : this._endCollision();} }, { key: \"callCurrentTileShader\", value: function callCurrentTileShader(e, t) {this.shader.filter = t.sceneFilter ? [this._filter0, t.sceneFilter] : this._filter0, this.callRenderer(this.shader, e, t), this._shaderAlongLine.filter = t.sceneFilter ? [this._lineFilter0, t.sceneFilter] : this._lineFilter0, this.callRenderer(this._shaderAlongLine, e, t);} }, { key: \"callBackgroundTileShader\", value: function callBackgroundTileShader(e, t) {this.shader.filter = t.sceneFilter ? [this._filter1, t.sceneFilter] : this._filter1, this.callRenderer(this.shader, e, t), this._shaderAlongLine.filter = t.sceneFilter ? [this._lineFilter1, t.sceneFilter] : this._lineFilter1, this.callRenderer(this._shaderAlongLine, e, t);} }, { key: \"callRenderer\", value: function callRenderer(e, t, n) {n && n.isRenderingTerrain && (0, _functionType.isFunctionDefinition)(this.symbolDef.textPitchAlignment) && (n.isRenderingTerrainSkin ? t.textPitchFilter = 1 : t.textPitchFilter = 2), _superPropGet(xs, \"callRenderer\", this, 3)([e, t, n]);} }, { key: \"_updateLabels\", value: function _updateLabels() {var _this61 = this;var e = this.scene.getMeshes();if (!e || !e.length) return;var t = -this.getMap().getBearing() * Math.PI / 180,n = _gl.mat2.fromRotation($r, t),i = function i(e, t, n, _i179) {var _t$2 = t[0],r = _t$2.start,s = _t$2.end,o = _t$2.mesh,a = _t$2.allElements;if (_this61.updateBoxCollisionFading(!0, o, t, n, _i179)) {var _t340 = e.count;for (var _n232 = r; _n232 < s; _n232++) e[_t340++] = a[_n232];e.count = _t340;}},r = this.isEnableCollision(),s = this.layer.getRenderer();e = e.sort(vs);var _loop3 = function _loop3() {var o = e[_t341];if (!_this61.isMeshIterable(o)) return 0;if (!s.isTileNearCamera(o)) {var _e385 = o.geometry.properties.visElemts;_e385 && (_e385.count = 0), o.geometry.setElements(_e385, 0);return 0;}var a = o.geometry,l = _this61.getSymbol(o.properties.symbolIndex);o.properties.textHaloRadius = Ie(l.textHaloRadius) ? Gi.textHaloRadius : l.textHaloRadius;var h = o.properties.meshKey;if (\"line\" === a.properties.textPlacement) {if (!a.properties.line) return 0;r && _this61.startMeshCollision(o), _this61._updateLineLabel(o, n);var _a$properties = a.properties,_e386 = _a$properties.aOffset,_t342 = _a$properties.aOpacity;_e386.dirty && (a.updateData(\"aOffset\", _e386), _e386.dirty = !1), _t342 && _t342.dirty && (a.updateData(\"aOpacity\", _t342), _t342.dirty = !1), r && _this61.endMeshCollision(h);} else if (r) {_this61.startMeshCollision(o);var _a$properties2 = a.properties,_e387 = _a$properties2.elements,_t343 = _a$properties2.aOpacity,_n233 = _a$properties2.visElemts;_n233.count = 0, _this61.forEachBox(o, function (e, t, r, s, o) {i(_n233, t, r, s);}), _t343 && _t343.dirty && a.updateData(\"aOpacity\", _t343);var _r142 = _n233.count === _e387.length && a.count === _e387.length,_s117 = !_n233.count && !a.count;_r142 || _s117 || a.setElements(_n233, _n233.count), _this61.endMeshCollision(h);}},_ret;for (var _t341 = 0; _t341 < e.length; _t341++) {_ret = _loop3();if (_ret === 0) continue;}} }, { key: \"isMeshIterable\", value: function isMeshIterable(e) {return e.isValid() && e.material && !e.material.get(\"isHalo\") && !(this.shouldIgnoreBackground() && !this.layer.getRenderer().isForeground(e));} }, { key: \"isMeshUniquePlaced\", value: function isMeshUniquePlaced(e) {if (!this.isMeshIterable(e)) return !1;return \"line\" !== this.getSymbol(e.properties.symbolIndex).textPlacement;} }, { key: \"getUniqueEntryKey\", value: function getUniqueEntryKey(e, t) {return rr(e, t);} }, { key: \"_updateLineLabel\", value: function _updateLineLabel(e, t) {var _this62 = this;var n = this.getMap(),i = e.geometry,r = i.properties;var s = r.line;if (!s) return;var o = n.getPitch(),l = n.getBearing(),_e$properties3 = e.properties,h = _e$properties3.lineTextPitch,c = _e$properties3.lineTextBearing,u = 1 === e.material.uniforms.textPitchWithMap,f = r.elements;if (!u) {var _t344 = _gl.mat4.multiply(Zr, n.projViewMatrix, e.localTransform),_i180 = s.id + \"-\" + _t344.join();var _o87;this._projectedLinesCache[_i180] ? s = this._projectedLinesCache[_i180] : (_o87 = r.projectedLine = r.projectedLine || new Array(s.length), s = this._projectLine(_o87, s, _t344, n.width, n.height), this._projectedLinesCache[_i180] = _o87);}var d = this.isEnableCollision(),p = i.properties.visElemts = i.properties.visElemts || new f.constructor(f.length),g = i.properties.visCache = i.properties.visCache || [];d && (p.count = 0);var m = void 0 === h || !n.isInteracting() || Math.abs(o - h) > 2 || Math.abs(l - c) > 2;m && (this._meshCollisionStale = !0), this.forEachBox(e, function (e, n, i, r) {var _n$2 = n[0],o = _n$2.start,a = _n$2.end;var l = g[r];if ((void 0 === l || m) && (l = _this62._updateLabelAttributes(e, f, o, a, s, i, u ? t : null, r)), g[r] = l, d && (l = _this62.updateBoxCollisionFading(l, e, n, i, r), l)) {var _e388 = p.count;for (var _t345 = o; _t345 < a; _t345++) p[_e388++] = f[_t345];p.count = _e388;}}), m && (e.properties.lineTextPitch = o, e.properties.lineTextBearing = l);var y = e.geometry.properties.aAltitude;y && y.dirty && (i.updateData(\"aAltitude\", y), y.dirty = !1), !d || p.count === f.length && i.count === p.count || i.setElements(p, p.count);} }, { key: \"_projectLine\", value: function _projectLine(e, t, n, i, r) {var s = function (e, t, n, i, r) {for (var _s118 = 0; _s118 < t.length; _s118 += 3) _gl.vec4.set(Ut, t[_s118], t[_s118 + 1], t[_s118 + 2], 1), Bt(Ut, Ut, n, i, r), e[_s118] = Ut[0], e[_s118 + 1] = Ut[1], e[_s118 + 2] = t[_s118 + 2];return e;}(e, t, n, i, r);return s;} }, { key: \"forEachBox\", value: function forEachBox(e, t) {var n = this.getMap(),i = _gl.mat4.multiply(Zr, n.projViewMatrix, e.properties.tileVectorTransform),_e$geometry$propertie3 = e.geometry.properties,r = _e$geometry$propertie3.collideIds,s = _e$geometry$propertie3.aCount,o = _e$geometry$propertie3.features,l = _e$geometry$propertie3.elements;if (!r) return;var h = this.isEnableUniquePlacement(),c = this._getMeshBoxes(1);c[0].allElements = l, c[0].mesh = e;var u = 0,f = l[0],d = 0,p = r[f];for (var _n234 = 0; _n234 <= l.length; _n234 += 6) if (f = l[_n234], r[f] !== p || _n234 === l.length) {var _a59 = o[p] && o[p].feature;if (h && this.isMeshUniquePlaced(e) && _a59 && !_a59.label) {var _t346 = _a59.properties || {},_n235 = e.properties.symbolIndex,_i181 = _n235 && this._textNameFn[_n235.index] ? this._textNameFn[_n235.index](e.properties.z, _t346) : this.getSymbol(e.properties.symbolIndex).textName,_r143 = zr.resolveText(_i181, _t346);_a59.label = _r143;}var _g7 = _n234,_m7 = s[l[d]];for (var _n236 = d; _n236 < _g7; _n236 += 6 * _m7) c[0].start = _n236, c[0].end = _n236 + 6 * _m7, c[0].boxCount = _m7, t.call(this, e, c, i, u++);p = r[f], d = _n234;}} }, { key: \"_updateLabelAttributes\", value: function _updateLabelAttributes(e, t, n, i, r, s, l) {var h = this.layer.getRenderer(),u = e.material.uniforms,d = 1 === u.textPitchWithMap,g = !d && h.getTerrainHelper && h.getTerrainHelper(),m = this.isEnableCollision(),y = this.getMap(),x = e.geometry,_ = x.desc.positionSize,_x$properties = x.properties,v = _x$properties.aShape,b = _x$properties.aOffset,A = _x$properties.aAnchor,T = _x$properties.aAltitude,w = _x$properties.aPitchRotation;var S = x.properties.aProjectedAnchor;S || (S = x.properties.aProjectedAnchor = new Array(A.length / _ * 3));var M = x.properties.aTextSize,P = !l,I = t[n],C = I * _;var k;k = x.data.aAltitude ? _gl.vec3.set(Jr, A[C], A[C + 1], T[I]) : Vr.unpackPosition(Jr, A[C], A[C + 1], A[C + 2]);var F = Bt(Kr, k, s, y.width, y.height),O = x.properties.aTerrainAltitude;var R;if (O) {var _e389 = O[I];if (_e389 === me) return S[3 * I] = ge, S[3 * I + 1] = ge, S[3 * I + 2] = ge, !1;_e389 ? (R = _gl.vec3.set.apply(o, [gs].concat(_toConsumableArray(k))), R[2] = 100 * _e389, R = Bt(R, R, s, y.width, y.height)) : R = F;} else R = F;var E = y.getDevicePixelRatio();if (_gl.vec4.scale(ys, R, 1 / E), y.isOffscreen(ys)) return m || _s(b, t, n, i), S[3 * I] = ge, S[3 * I + 1] = ge, S[3 * I + 2] = ge, !1;P && (k = F), S[3 * I] = R[0], S[3 * I + 1] = R[1], S[3 * I + 2] = R[2];var D = P ? 1 : x.properties.tileExtent / this.layer.getTileSize().width;var L = !0;var H = t[n],N = t[i - 1],z = M ? M[H] : e.properties.textSize,V = this._updateNormal(e, z, r, H, N, k, Jr, D, l);if (null === V) return _s(b, t, n, i), !1;var U = N - H <= 3,B = Math.floor(V / 2),G = V % 2;for (var _l49 = n; _l49 < i; _l49 += 6) {var _h33 = t[_l49];var _c24 = void 0;if (_c24 = B || _l49 !== n || U || g ? B || _l49 !== i - 6 || U || g ? Or.call(this, qr, e, z, r, _h33, k, Jr, D, B, R, this.layer, s, d) : cs : hs, !_c24) {L = !1, m || _s(b, t, n, i);break;}var _y7 = _c24[2];G && (_y7 -= Math.PI / 2);var _x8 = gi(Qr, _y7, 0, u.textRotateWithMap, u.textPitchWithMap),_9 = b.length > v.length;var _A6 = void 0;if (_9) {_gl.vec3.set(as, w[3 * _h33], w[3 * _h33 + 1], 0);var _e390 = _gl.vec3.normalize(as, as),_t347 = -w[3 * _h33 + 2];if (_t347) {var _n237 = _gl.quat.setAxisAngle(rs, _e390, _t347);_gl.mat4.fromTranslation(ss, Yr), _gl.mat4.fromQuat(os, _n237), _A6 = _gl.mat4.multiply(os, os, ss);}}for (var _e391 = 0; _e391 < 4; _e391++) {var _t348 = 2 * (_h33 + _e391);_gl.vec2.set(es, v[_t348] / 10, v[_t348 + 1] / 10), _gl.vec2.scale(es, es, z / 24), _gl.vec2.transformMat2(es, es, _x8), d ? (_gl.vec2.multiply(es, es, ns), _gl.vec2.add(ts, es, _c24), _9 && (ts[2] = 0, _A6 && _gl.vec3.transformMat4(ts, ts, _A6))) : (_gl.vec2.multiply(ts, _c24, ns), _gl.vec2.add(ts, es, ts)), is[0] = 10 * ts[0], is[1] = 10 * ts[1], _9 && (is[2] = 10 * ts[2]);var _n238 = (_9 ? 3 : 2) * (_h33 + _e391);(b[_n238] !== is[0] || b[_n238 + 1] !== is[1] || _9 && b[_n238 + 2] !== is[2]) && (b.dirty = !0, b[_n238] = is[0], b[_n238 + 1] = is[1], _9 && (b[_n238 + 2] = is[2]));}}return L;} }, { key: \"_updateNormal\", value: function _updateNormal(e, t, n, i, r, s, o, a, l) {var h = r - i <= 3,c = this.getMap(),u = this.getSymbol(e.geometry.properties.symbolIndex);return h ? 0 : Dr.call(this, hs, cs, e, t, n, i, r, s, o, a, c.width / c.height, l, u.textMaxAngle || Br);} }, { key: \"isBoxCollides\", value: function isBoxCollides(e, t, n, i, r, s) {return this.isLabelCollides(0, e, t, n, i, r, s);} }, { key: \"deleteMesh\", value: function deleteMesh(e, t) {e && (t && (Array.isArray(e) ? e.forEach(function (e) {e && e.material && delete e.material.uniforms.texture;}) : e.material && delete e.material.uniforms.texture), _superPropGet(xs, \"deleteMesh\", this, 3)([e, t]));} }, { key: \"delete\", value: function _delete() {_superPropGet(xs, \"delete\", this, 3)([]), this._shaderAlongLine.dispose(), delete this._projectedLinesCache, this._linePicking && this._linePicking.dispose();} }, { key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return !1;} }, { key: \"isEnableTileStencil\", value: function isEnableTileStencil() {return !this.layer.getRenderer().isEnableWorkAround(\"win-intel-gpu-crash\");} }, { key: \"init\", value: function init() {var _this63 = this;var e = this.regl;this.renderer = new _gl.reshader.Renderer(e);var _Ji$call = Ji.call(this, this.canvas, this.sceneConfig),t = _Ji$call.uniforms,n = _Ji$call.extraCommandProps,i = this.canvas,r = { x: function x(e, t) {return t.viewport ? t.viewport.x : 0;}, y: function y(e, t) {return t.viewport ? t.viewport.y : 0;}, width: function width(e, t) {return t.viewport ? t.viewport.width : i ? i.width : 1;}, height: function height(e, t) {return t.viewport ? t.viewport.height : i ? i.height : 1;} };n.viewport = r, this.shader = new _gl.reshader.MeshShader({ vert: Lr, frag: Nr, uniforms: t, extraCommandProps: n });var o = n;if (this.layer.getRenderer().isEnableWorkAround(\"win-intel-gpu-crash\") && (o = Se({}, n), o.stencil = Se({}, n.stencil), o.stencil.enable = !0, o.stencil.func.cmp = \"<\", o.stencil.func.ref = function (e, t) {return 2 * t.level + (t.isHalo || 0) + 1;}), this._shaderAlongLine = new _gl.reshader.MeshShader({ vert: Hr, frag: Nr, uniforms: t, extraCommandProps: o }), this.pickingFBO) {var _e392 = new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + Lr, uniforms: t, extraCommandProps: { viewport: this.pickingViewport } }, this.pickingFBO, this.getMap());_e392.filter = function (e) {var t = e.properties.symbolIndex;return \"line\" !== _this63.getSymbol(t).textPlacement;};var _n239 = new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + Hr, uniforms: t, extraCommandProps: { viewport: this.pickingViewport } }, this.pickingFBO, this.getMap());_n239.filter = function (e) {return \"line\" === e.geometry.properties.textPlacement;}, this.picking = [_e392, _n239];}} }, { key: \"getUniformValues\", value: function getUniformValues(e, t) {var n = t && t.isRenderingTerrainSkin,i = this.layer.getTileSize().width,r = n ? ms : e.projViewMatrix,s = e.cameraToCenterDistance,o = _gl.vec2.set(ls, e.width, e.height);n && _gl.vec2.set(o, i, i);var a = $(e.getResolution(), e);return { layerScale: this.layer.options.styleScale || 1, mapPitch: e.getPitch() * Math.PI / 180, mapRotation: e.getBearing() * Math.PI / 180, projViewMatrix: r, viewMatrix: e.viewMatrix, cameraToCenterDistance: s, canvasSize: o, glyphSize: _i, gammaScale: 1 * (this.layer.options.textGamma || 1), resolution: e.getResolution(), altitudeScale: a, viewport: n && t && t.viewport, textPitchFilter: 0, isRenderingTerrain: +!!n };} }], [{ key: \"getBloomSymbol\", value: function getBloomSymbol() {return [\"textBloom\"];} }]);}(ti);function _s(e, t, n, i) {for (var _r144 = n; _r144 < i; _r144 += 6) {var _n240 = t[_r144];for (var _t349 = 0; _t349 < 4; _t349++) {var _i182 = 3 * (_n240 + _t349);(e[_i182] || e[_i182 + 1] || e[_i182 + 2]) && (e.dirty = !0, e[_i182] = 0, e[_i182 + 1] = 0, e[_i182 + 2] = 0);}}}function vs(e, t) {var n = e.properties.level - t.properties.level;return 0 === n ? e.properties.meshKey - t.properties.meshKey : n;}var bs = \"#define SHADER_NAME NATIVE_POINT\\n#include \\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\n#ifdef HAS_COLOR\\nattribute vec4 aColor;\\nvarying vec4 vColor;\\n#endif\\nuniform mat4 positionMatrix;\\nuniform mat4 projViewModelMatrix;\\nuniform float markerSize;\\n#ifdef PICKING_MODE\\n#include \\n#endif\\n#include \\nvoid main() {\\n vec3 c = unpackVTPosition();\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\\n gl_PointSize = markerSize;\\n#ifdef HAS_COLOR\\nvColor = aColor / 255.;\\n#endif\\n#ifdef PICKING_MODE\\nfbo_picking_setData(gl_Position.w, true);\\n#endif\\n}\";var As = { markerFill: [0, 0, 0], markerOpacity: 1, markerSize: 10 };var Ts = exports.NativePointPainter = function (_gn4) {function Ts() {_classCallCheck(this, Ts);return _callSuper(this, Ts, arguments);}_inherits(Ts, _gn4);return _createClass(Ts, [{ key: \"getPrimitive\", value: function getPrimitive() {return \"points\";} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {return !1;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {return this.layer.options.awareOfTerrain;} }, { key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return !1;} }, { key: \"createMesh\", value: function createMesh(e, t) {var n = e.geometry,i = e.symbolIndex,r = e.ref,o = this.getSymbol(i);if (void 0 === r) {St(n, this.getSymbolDef(i), this.getFnTypeConfig(i), this.layer), n.generateBuffers(this.regl);}var a = {};ke(a, \"markerOpacity\", o, \"markerOpacity\", 1), ke(a, \"markerSize\", o, \"markerSize\", 10), ke(a, \"markerFill\", o, \"markerFill\", \"#000\", Re(this.colorCache, 3));var l = new _gl.reshader.Material(a, As);l.createDefines = function () {return \"square\" !== o.markerType ? { USE_CIRCLE: 1 } : null;}, l.appendDefines = function (e) {return \"square\" !== o.markerType && (e.USE_CIRCLE = 1), e;};var h = new _gl.reshader.Mesh(n, l, { castShadow: !1, picking: !0 }),c = {};return h.geometry.data.aAltitude && (c.HAS_ALTITUDE = 1), n.data.aColor && (c.HAS_COLOR = 1), h.setDefines(c), h.positionMatrix = this.getAltitudeOffsetMatrix(), h.setLocalTransform(t), h.properties.symbolIndex = i, h;} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {var _this64 = this;var n = (0, _functionType.piecewiseConstant)(t.markerFill);return [{ attrName: \"aColor\", symbolName: \"markerFill\", type: Uint8Array, width: 4, define: \"HAS_COLOR\", evaluate: function evaluate(t, i) {var r = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this64.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = _this64.colorCache[r] = _this64.colorCache[r] || (0, _color.default)(r).unitArray()), r = Oe(r), r;} }];} }, { key: \"init\", value: function init() {var _this65 = this;var e = this.regl;this.renderer = new _gl.reshader.Renderer(e);var t = [],n = { vert: bs, frag: \"#define SHADER_NAME NATIVE_POINT\\nprecision mediump float;\\n#include \\n#ifdef USE_CIRCLE\\n#if __VERSION__ == 100\\n#ifdef GL_OES_standard_derivatives\\n#define STANDARD_DERIVATIVES_ENABLED 1\\n#extension GL_OES_standard_derivatives : enable\\n#endif\\n#else\\n#define STANDARD_DERIVATIVES_ENABLED 1\\n#endif\\n#endif\\n#ifdef HAS_COLOR\\nvarying vec4 vColor;\\n#else\\nuniform vec3 markerFill;\\n#endif\\nuniform float markerOpacity;\\nuniform float layerOpacity;\\nvoid main() {\\n float c = 1.;\\n#ifdef USE_CIRCLE\\nfloat r = .0, d = .0;\\n vec2 e = 2. * gl_PointCoord - 1.;\\n r = dot(e, e);\\n if(r > 1.) {\\n discard;\\n }\\n#ifdef STANDARD_DERIVATIVES_ENABLED\\nd = fwidth(r);\\n c = 1. - smoothstep(1. - d, 1. + d, r);\\n#endif\\n#endif\\n#ifdef HAS_COLOR\\nvec4 f = vColor;\\n#else\\nvec4 f = vec4(markerFill, 1.);\\n#endif\\nglFragColor = f * markerOpacity * c * layerOpacity;\\n#if __VERSION__ == 100\\ngl_FragColor = glFragColor;\\n#endif\\n}\", uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, n) {return _gl.mat4.multiply(t, n.projViewMatrix, n.modelMatrix), t;} }], defines: null, extraCommandProps: { viewport: { x: 0, y: 0, width: function width() {return _this65.canvas ? _this65.canvas.width : 1;}, height: function height() {return _this65.canvas ? _this65.canvas.height : 1;} }, depth: { enable: !0, mask: !1, range: this.sceneConfig.depthRange || [0, 1], func: this.sceneConfig.depthFunc || \"always\" }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" } } };if (this.shader = new _gl.reshader.MeshShader(n), this.shader.version = 300, this.pickingFBO) {var _e393 = [];this.picking = [new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + bs, uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(t, n) {return _gl.mat4.multiply(_e393, n.projViewMatrix, n.modelMatrix), _e393;} }], extraCommandProps: { viewport: this.pickingViewport } }, this.pickingFBO, this.getMap())];}} }, { key: \"getUniformValues\", value: function getUniformValues(e) {return { projViewMatrix: e.projViewMatrix };} }]);}(gn);var ws = \"#define SHADER_NAME NATIVE_LINE\\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\nuniform mat4 projViewModelMatrix;\\nuniform mat4 positionMatrix;\\n#ifndef PICKING_MODE\\n#if defined(HAS_COLOR)\\nattribute vec4 aColor;\\nvarying vec4 vColor;\\n#endif\\n#else\\n#include \\n#endif\\n#include \\nvoid main() {\\n vec3 c = unpackVTPosition();\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\\n#ifndef PICKING_MODE\\n#if defined(HAS_COLOR)\\nvColor = aColor / 255.;\\n#endif\\n#else\\nfbo_picking_setData(gl_Position.w, true);\\n#endif\\n}\";var Ss = _gl.mat4.identity([]);var Ms = exports.NativeLinePainter = function (_gn5) {function Ms(e, t, n, i, r, s) {var _this66;_classCallCheck(this, Ms);if (_this66 = _callSuper(this, Ms, [e, t, n, i, r, s]), _this66.primitive = \"lines\", (0, _functionType.isFunctionDefinition)(_this66.symbolDef.lineColor)) {var _e394 = t.getMap(),_n241 = (0, _functionType.piecewiseConstant)(_this66.symbolDef.lineColor);_this66.colorSymbol = function (t) {return _n241(_e394.getZoom(), t);};}return _this66;}_inherits(Ms, _gn5);return _createClass(Ms, [{ key: \"needPolygonOffset\", value: function needPolygonOffset() {return !0;} }, { key: \"createMesh\", value: function createMesh(e, t) {var n = e.geometry,i = e.symbolIndex,r = e.ref,o = this.getSymbol(i),a = this.getMeshUniforms(n, o);void 0 === r && n.generateBuffers(this.regl);var l = new _gl.reshader.Material(a),h = new _gl.reshader.Mesh(n, l, { castShadow: !1, picking: !0 });h.setLocalTransform(t), h.properties.symbolIndex = i;var c = {};return h.geometry.data.aAltitude && (c.HAS_ALTITUDE = 1), h.setDefines(c), h;} }, { key: \"getMeshUniforms\", value: function getMeshUniforms(e, t) {var n = {};return ke(n, \"lineColor\", t, \"lineColor\", \"#000\", Re(this.colorCache)), ke(n, \"lineOpacity\", t, \"lineOpacity\", 1), n;} }, { key: \"isEnableTileStencil\", value: function isEnableTileStencil(e) {return !!!(e && e.isRenderingTerrain && this.isTerrainSkin());} }, { key: \"init\", value: function init() {var _this67 = this;var e = this.regl;this.renderer = new _gl.reshader.Renderer(e);var t = this.canvas,n = { x: function x(e, t) {return t.viewport ? t.viewport.x : 0;}, y: function y(e, t) {return t.viewport ? t.viewport.y : 0;}, width: function width(e, n) {return n.viewport ? n.viewport.width : t ? t.width : 1;}, height: function height(e, n) {return n.viewport ? n.viewport.height : t ? t.height : 1;} },i = [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }],r = this.sceneConfig.depthRange,o = { vert: ws, frag: \"#define SHADER_NAME NATIVE_LINE\\nprecision mediump float;\\nuniform float lineOpacity;\\nuniform vec4 lineColor;\\nuniform float layerOpacity;\\n#if defined(HAS_COLOR)\\nvarying vec4 vColor;\\n#endif\\nvoid main() {\\n gl_FragColor = lineColor * lineOpacity;\\n#if defined(HAS_COLOR)\\ngl_FragColor *= vColor;\\n#endif\\ngl_FragColor *= layerOpacity;\\n}\", uniforms: i, defines: null, extraCommandProps: { viewport: n, stencil: { enable: function enable(e, t) {return _this67.isEnableTileStencil(t.painterContext);}, mask: 255, func: { cmp: function cmp() {return _this67.isOnly2D() ? \"=\" : \"<=\";}, ref: function ref(e, t) {return t.stencilRef;}, mask: 255 }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, depth: { enable: !0, range: r || [0, 1], func: this.sceneConfig.depthFunc || \"<=\" }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } } };this.shader = new _gl.reshader.MeshShader(o), this.pickingFBO && (this.picking = [new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + ws, uniforms: i, extraCommandProps: { viewport: this.pickingViewport } }, this.pickingFBO, this.getMap())]);} }, { key: \"getUniformValues\", value: function getUniformValues(e, t) {var n = t && t.isRenderingTerrainSkin;return { projViewMatrix: n ? Ss : e.projViewMatrix, viewport: n && t && t.viewport };} }, { key: \"getPrimitive\", value: function getPrimitive() {return \"lines\";} }]);}(gn);var _H11 = H(),Ps = _H11.DEFAULT_TEX_WIDTH,Is = [1, 1, 1],Cs = [1, 1, 1, 1],ks = [0, 0],Fs = [1, 1],Os = [],Rs = new e.Coordinate(0, 0),Es = new e.Coordinate(0, 0),Ds = [],Ls = [];var Hs = function (_fn2) {function Hs() {_classCallCheck(this, Hs);return _callSuper(this, Hs, arguments);}_inherits(Hs, _fn2);return _createClass(Hs, [{ key: \"isEnableTileStencil\", value: function isEnableTileStencil() {return !1;} }, { key: \"supportRenderMode\", value: function supportRenderMode(e) {return this.isAnimating() ? \"fxaa\" === e || \"fxaaAfterTaa\" === e : \"taa\" === e || \"fxaa\" === e;} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {return !1;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {return this.layer.options.awareOfTerrain;} }, { key: \"isAnimating\", value: function isAnimating() {return !1;} }, { key: \"createMesh\", value: function createMesh(t, n, _ref118) {var _this68 = this;var i = _ref118.tilePoint;if (!this.material) return this.setToRedraw(), null;var r = t.geometry,o = t.symbolIndex,l = this.layer instanceof e.TileLayer,h = new _gl.reshader.Mesh(r, this.material);if (this.sceneConfig.animation) {Is[2] = .01;var _e395 = [];_gl.mat4.fromScaling(_e395, Is), _gl.mat4.multiply(_e395, n, _e395), n = _e395;}var c = this.getSymbolDef(o),u = this.getFnTypeConfig(o);St(r, c, u, this.layer);var f = this.getShader(),d = f.getGeometryDefines ? f.getGeometryDefines(r) : {},p = this.getSymbol(o),g = Re(this.colorCache);if (r.data.aExtrude) {d.IS_LINE_EXTRUSION = 1;var _r$properties = r.properties,_e396 = _r$properties.tileResolution,_t350 = _r$properties.tileRatio,_n242 = this.getMap();Object.defineProperty(h.uniforms, \"linePixelScale\", { enumerable: !0, get: function get() {return _t350 * _n242.getResolution() / _e396;} }), ke(h.uniforms, \"lineWidth\", p, \"lineWidth\", 4), ke(h.uniforms, \"lineOpacity\", p, \"lineOpacity\", 1), ke(h.uniforms, \"lineColor\", p, \"lineColor\", \"#fff\", g), Object.defineProperty(h.uniforms, \"lineHeight\", { enumerable: !0, get: function get() {var e = _this68.dataConfig.defaultAltitude * (_this68.dataConfig.altitudeScale || 1);return Le(e) ? e : 0;} });} else {ke(h.uniforms, \"polygonFill\", p, \"polygonFill\", Cs, g), ke(h.uniforms, \"polygonOpacity\", p, \"polygonOpacity\", 1);var _e397 = [];Object.defineProperty(h.uniforms, \"vertexColorsOfType\", { enumerable: !0, get: function get() {var t = g(p.bottomPolygonFill || Cs),n = g(p.topPolygonFill || Cs);_e397[0] = t[0], _e397[1] = t[1], _e397[2] = t[2], _e397[3] = t[3], _e397[4] = n[0], _e397[5] = n[1], _e397[6] = n[2], _e397[7] = n[3];var i = h.geometry.properties.vertexColors;if (i) {var _t351 = 8;_e397.length = 8 + i.length;for (var _n243 = 0; _n243 < i.length; _n243++) _e397[_t351++] = i[_n243][0], _e397[_t351++] = i[_n243][1], _e397[_t351++] = i[_n243][2], _e397[_t351++] = i[_n243][3];}return _e397;} });}if (r.data.aColor && (d.HAS_COLOR = 1), r.data.aOpacity && (d.HAS_OPACITY = 1), r.data.aLineWidth && (d.HAS_LINE_WIDTH = 1), r.data.aLineHeight && (d.HAS_LINE_HEIGHT = 1), r.data.aTerrainAltitude && (d.HAS_TERRAIN_ALTITUDE = 1), r.data.aVertexColorType) {var _e398 = h.geometry.properties.vertexColors;var _t352 = 2;_e398 && (_t352 += _e398.length), d.VERTEX_TYPES_COUNT = _t352;}if (r.data.aOpacity) {var _e399 = r.data.aOpacity;for (var _t353 = 0; _t353 < _e399.length; _t353++) if (_e399[_t353] < 255) {r.properties.hasAlpha = !0;break;}}d.HAS_MIN_ALTITUDE = 1, d.HAS_LAYER_OPACITY = 1, r.generateBuffers(this.regl), h.setDefines(d), h.setPositionMatrix(this.getAltitudeOffsetMatrix()), h.setLocalTransform(n), (r.properties.maxAltitude <= 0 || h.properties.level >= 3) && (h.castShadow = !1), h.setUniform(\"maxAltitude\", h.geometry.properties.maxAltitude), Object.defineProperty(h.uniforms, \"minAltitude\", { enumerable: !0, get: function get() {return _this68.layer.options.altitude || 0;} });var m = r.properties.tileResolution,y = this.getMap(),x = this.layer.getRenderer(),_ = y.pointAtResToCoord(new e.Point(i), m),v = function (e, t, n, i, r) {return e.pointAtResToDistance(t, 0, i, n);}(y, 1, _, m),b = [];Object.defineProperty(h.uniforms, \"uvOrigin\", { enumerable: !0, get: function get() {return _this68._computeUVOffset(b, o, i, m, v, l);} }), h.setUniform(\"uvOffset\", [0, 0]), Object.defineProperty(h.uniforms, \"hasAlpha\", { enumerable: !0, get: function get() {var e = _this68.getSymbol(o);return r.properties.hasAlpha || e.polygonOpacity < 1 || e.lineOpacity < 1 || h.material && (h.material.uniforms.baseColorTexture || h.material.uniforms.emissiveTexture);} });var A = this.layer.getMap().getMaxNativeZoom();return Object.defineProperty(h.uniforms, \"stencilRef\", { enumerable: !0, get: function get() {return x.isForeground(h) ? 0 : A - h.properties.tile.z;} }), h.properties.symbolIndex = o, h;} }, { key: \"_computeUVOffset\", value: function _computeUVOffset(e, t, n, i, r, s) {if (1 === this.dataConfig.topUVMode) return e[0] = 0, e[1] = 0, e;var o = this.getMap(),a = this.getSymbol(t).material;var l = n;!this.dataConfig.side && a && a.textureOrigin && (Rs.set(a.textureOrigin[0], a.textureOrigin[1]), o.coordToPointAtRes(Rs, i, Es), l = _gl.vec2.set(Ds, n[0] - Es.x, n[1] - Es.y));var h = !!a && a.uvOffsetInMeter;var c = a && a.uvOffset || ks;var u = this.getUVOffsetAnim();u && (c = this.getUVOffset(u));var d = a && a.uvScale || Fs;var p = this.dataConfig.side ? 0 : l[0],g = this.dataConfig.side ? 0 : l[1];var m = a && a.textureWidth || Ps,y = m * d[1] / d[0];h && (p += c[0] / r, g += c[1] / r);var x = h ? 0 : c[0],_ = h ? 0 : c[1],v = _gl.vec2.set(e, p * r * d[0] / m + x, g * r * d[1] / y + _);return s || (v[1] *= -1), v;} }, { key: \"callShader\", value: function callShader(e, t) {var n = this.sceneConfig.cullFace;this.sceneConfig.cullFace = \"front\", this.callBackgroundTileShader(e, t), void 0 === n ? delete this.sceneConfig.cullFace : this.sceneConfig.cullFace = n, _superPropGet(Hs, \"callShader\", this, 3)([e, t]);} }, { key: \"getShadowMeshes\", value: function getShadowMeshes() {if (!this.isVisible()) return Os;this.shadowCount = this.scene.getMeshes().length;var e = this.scene.getMeshes().filter(function (e) {return 0 === e.properties.level;});for (var _t354 = 0; _t354 < e.length; _t354++) {var _n244 = e[_t354];_n244.material !== this.material && _n244.setMaterial(this.material);}return e;} }, { key: \"getUVOffsetAnim\", value: function getUVOffsetAnim() {var e = this.getSymbols()[0];return e.material && e.material.uvOffsetAnim;} }, { key: \"getUVOffset\", value: function getUVOffset(e) {var t = this.getSymbols()[0],n = t.material && t.material.uvOffset || ks,i = !!t.material && t.material.uvOffsetInMeter,r = performance.now() / 1e3,s = _gl.vec2.set(Ls, n[0], n[1]);return s[0] = r * e[0], s[1] = r * e[0], i || (s[0] %= 1, s[1] %= 1), s;} }, { key: \"needPolygonOffset\", value: function needPolygonOffset() {return this._needPolygonOffset;} }, { key: \"startFrame\", value: function startFrame() {for (var _len13 = arguments.length, e = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {e[_key13] = arguments[_key13];}return delete this._needPolygonOffset, _superPropGet(Hs, \"startFrame\", this, 3)(e);} }, { key: \"addMesh\", value: function addMesh(e, t) {var _this69 = this;e.forEach(function (e) {_this69._prepareMesh(e, t);}), _superPropGet(Hs, \"addMesh\", this, 3)(arguments);} }, { key: \"_prepareMesh\", value: function _prepareMesh(e, t) {if (null !== t) {var _n245 = e.localTransform;0 === t && (t = .01), Is[2] = t, _gl.mat4.fromScaling(_n245, Is), _gl.mat4.multiply(_n245, e.properties.tileTransform, _n245), e.setLocalTransform(_n245);} else e.setLocalTransform(e.properties.tileTransform);e.material !== this.material && e.setMaterial(this.material), e.geometry.properties.maxAltitude <= 0 && (this._needPolygonOffset = !0), this.getSymbol(e.properties.symbolIndex).ssr ? e.ssr = 1 : e.ssr = 0;} }, { key: \"deleteMaterial\", value: function deleteMaterial() {this.material && (this.material.dispose(), delete this.material);} }, { key: \"deleteMesh\", value: function deleteMesh(e, t) {if (e) if (this.scene.removeMesh(e), Array.isArray(e)) for (var _n246 = 0; _n246 < e.length; _n246++) t || (e[_n246].geometry.dispose(), delete e[_n246].geometry.properties.layer), e[_n246].dispose();else t || (e.geometry.dispose(), delete e.geometry.properties.layer), e.dispose();} }, { key: \"updateDataConfig\", value: function updateDataConfig(e, t) {return !(\"line-extrusion\" === this.dataConfig.type && !e.altitudeProperty && !t.altitudeProperty);} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {var _this70 = this;var n = (0, _functionType.piecewiseConstant)(t.polygonFill || t.lineColor),i = (0, _functionType.interpolated)(t.polygonOpacity || t.lineOpacity),r = (0, _functionType.interpolated)(t.lineWidth),s = new Uint8Array(1),o = new Uint16Array(1),a = t.polygonFill ? \"polygonFill\" : t.lineColor ? \"lineColor\" : \"polygonFill\",l = t.polygonOpacity ? \"polygonOpacity\" : t.lineOpacity ? \"lineOpacity\" : \"polygonOpacity\";return [{ attrName: \"aColor\", type: Uint8Array, width: 4, symbolName: a, define: \"HAS_COLOR\", evaluate: function evaluate(t, i) {var r = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this70.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = _this70.colorCache[r] = _this70.colorCache[r] || (0, _color.default)(r).unitArray()), r = Oe(r), r;} }, { attrName: \"aOpacity\", type: Uint8Array, width: 1, symbolName: l, evaluate: function evaluate(t, n) {var r = i(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this70.evaluateInFnTypeConfig(r, n, e, t, !1)), s[0] = 255 * r, s[0] < 255 && (n.properties.hasAlpha = !0), s[0];} }, { attrName: \"aLineWidth\", type: Uint8Array, width: 1, symbolName: \"lineWidth\", define: \"HAS_LINE_WIDTH\", evaluate: function evaluate(t) {var n = r(e.getZoom(), t);return o[0] = Math.round(2 * n), o[0];} }];} }, { key: \"updateSymbol\", value: function updateSymbol(e, t) {var n = !1;e && e.material && (n = function (e, t) {for (var _n247 in t) if (zs[_n247] && t[_n247] !== e[_n247] && (!e[_n247] || !t[_n247])) return !0;return !1;}(this.symbolDef[0].material || {}, e.material));var i = _superPropGet(Hs, \"updateSymbol\", this, 3)([e, t]);return e && e.material && this._updateMaterial(e.material), n || i;} }, { key: \"_isNeedRefreshStyle\", value: function _isNeedRefreshStyle(e, t) {return Ns(e) !== Ns(t);} }]);}(fn);function Ns(e) {if (!e || !e.material) return !1;for (var _t355 in e.material) if (_t355.indexOf(\"Texture\") > 0 && e.material[_t355]) return !0;return !1;}var zs = { normalTexture: 1, bumpTexture: 1 };var Vs = exports.PhongPainter = function (_Hs) {function Vs() {_classCallCheck(this, Vs);return _callSuper(this, Vs, arguments);}_inherits(Vs, _Hs);return _createClass(Vs, [{ key: \"createGeometry\", value: function createGeometry(e) {var t = e.data,n = this.getSymbols()[0];if (n.material && n.material.extrusionOpacity) {var _e400 = new Uint8Array(t.aPosition.length / 3);for (var _n248 = 0; _n248 < t.aPosition.length; _n248 += 3) t.aPosition[_n248 + 2] > 0 ? _e400[_n248 / 3] = 0 : _e400[_n248 / 3] = 1;t.aExtrusionOpacity = _e400;}var i = new _gl.reshader.Geometry(t, e.indices);return Se(i.properties, e.properties), this._prepareFeatureIds(i, e), { geometry: i, symbolIndex: { index: 0 } };} }, { key: \"updateSceneConfig\", value: function updateSceneConfig(e) {var t;if (this.sceneConfig.cullFace !== e.cullFace && (t = !0), Se(this.sceneConfig, e), t) {var _e401 = this.getShaderConfig();this.shader.dispose(), this.shader = new _gl.reshader.PhongShader(_e401);}this.setToRedraw();} }, { key: \"getShader\", value: function getShader() {return this.shader;} }, { key: \"delete\", value: function _delete(e) {this.getMap().off(\"updatelights\", this._updateLights, this), _superPropGet(Vs, \"delete\", this, 3)([e]), this.material.dispose();} }, { key: \"init\", value: function init() {this.getMap().on(\"updatelights\", this._updateLights, this);var e = this.regl;this.renderer = new _gl.reshader.Renderer(e);var t = this.getShaderConfig();this.shader = new _gl.reshader.PhongShader(t), this._updateMaterial();var n = { vert: this.getPickingVert(), uniforms: [\"projViewMatrix\", \"modelMatrix\", \"positionMatrix\", { name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply([], t.projViewMatrix, t.modelMatrix);} }], extraCommandProps: { viewport: this.pickingViewport } };this.picking = [new _gl.reshader.FBORayPicking(this.renderer, n, this.layer.getRenderer().pickingFBO, this.getMap())];} }, { key: \"_updateLights\", value: function _updateLights() {this.setToRedraw();} }, { key: \"getShaderConfig\", value: function getShaderConfig() {var _this71 = this;var e = this.canvas,t = { x: 0, y: 0, width: function width() {return e ? e.width : 1;}, height: function height() {return e ? e.height : 1;} };return { extraCommandProps: { cull: { enable: function enable() {return void 0 === _this71.sceneConfig.cullFace || !!_this71.sceneConfig.cullFace;}, face: function face() {var e = _this71.sceneConfig.cullFace;return !0 === e && (e = \"back\"), e || \"back\";} }, stencil: { enable: !0, func: { cmp: \"<=\", ref: function ref(e, t) {return t.level;} }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, depth: { enable: !0, range: this.sceneConfig.depthRange || [0, 1], func: this.sceneConfig.depthFunc || \"<=\" }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, viewport: t, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } } };} }, { key: \"_updateMaterial\", value: function _updateMaterial() {this.material && this.material.dispose();var t = this.layer instanceof e.TileLayer,n = this.getSymbols()[0].material,i = {};for (var _e402 in n) Ne(n, _e402) && (i[_e402] = n[_e402], \"uvRotation\" === _e402 && (i[_e402] = i[_e402] * Math.PI / 180, t || (i[_e402] *= -1)));this.material = new _gl.reshader.PhongMaterial(i);} }, { key: \"getUniformValues\", value: function getUniformValues(e, t) {var n = e.viewMatrix,i = e.projMatrix,r = e.cameraPosition,s = this._getLightUniformValues(),o = Se({ viewMatrix: n, projMatrix: i, cameraPosition: r, projViewMatrix: e.projViewMatrix }, s);t && t.jitter ? o.halton = t.jitter : o.halton = [0, 0];var a = this.layer.getRenderer().canvas;return o.outSize = [a.width, a.height], o;} }, { key: \"getPickingVert\", value: function getPickingVert() {return \"\\n attribute vec3 aPosition;\\n uniform mat4 projViewModelMatrix;\\n uniform mat4 modelMatrix;\\n uniform mat4 positionMatrix;\\n //引入fbo picking的vert相关函数\\n #include \\n #include \\n void main()\\n {\\n mat4 localPositionMatrix = getPositionMatrix();\\n vec4 localPosition = getPosition(aPosition);\\n\\n gl_Position = projViewModelMatrix * localPositionMatrix * localPosition;\\n //传入gl_Position的depth值\\n fbo_picking_setData(gl_Position.w, true);\\n }\\n \";} }, { key: \"_getLightUniformValues\", value: function _getLightUniformValues() {var e = this.getMap().getLightManager(),t = e && e.getAmbientLight() || {},n = e && e.getDirectionalLight() || {};return { ambientColor: t.color || [.2, .2, .2], light0_diffuse: [].concat(_toConsumableArray(n.color || [.1, .1, .1]), [1]), lightSpecular: n.specular || [.8, .8, .8], light0_viewDirection: n.direction || [1, 1, -1] };} }]);}(Hs);var Us = [1, 1, 1];var Bs = exports.WireframePainter = function (_fn3) {function Bs() {_classCallCheck(this, Bs);return _callSuper(this, Bs, arguments);}_inherits(Bs, _fn3);return _createClass(Bs, [{ key: \"createGeometry\", value: function createGeometry(e) {var t = e.data,n = e.indices,i = new _gl.reshader.Geometry(t, n, 0, { primitive: \"lines\" });return i.generateBuffers(this.regl), { geometry: i, symbolIndex: { index: 0 } };} }, { key: \"createMesh\", value: function createMesh(e, t) {var n = e.geometry,i = new _gl.reshader.Mesh(n);if (i.castShadow = !1, this.sceneConfig.animation) {Us[2] = .01;var _e403 = [];_gl.mat4.fromScaling(_e403, Us), _gl.mat4.multiply(_e403, t, _e403), t = _e403;}return i.setLocalTransform(t), i.properties.symbolIndex = { index: 0 }, i;} }, { key: \"addMesh\", value: function addMesh(e, t) {if (!e.length) return this;var n;null !== t ? (0 === t && (t = .01), n = e[0].localTransform, Us[2] = t, _gl.mat4.fromScaling(n, Us), _gl.mat4.multiply(n, e[0].properties.tileTransform, n)) : n = e[0].properties.tileTransform;for (var _t356 = 0; _t356 < e.length; _t356++) e[_t356].setLocalTransform(n);return this.scene.addMesh(e), this;} }, { key: \"init\", value: function init() {var _this72 = this;var e = this.regl;this.scene = new _gl.reshader.Scene(), this.renderer = new _gl.reshader.Renderer(e);var t = { x: 0, y: 0, width: function width() {return _this72.canvas ? _this72.canvas.width : 1;}, height: function height() {return _this72.canvas ? _this72.canvas.height : 1;} },n = { vert: \"\\n attribute vec3 aPosition;\\n attribute vec4 aColor;\\n\\n uniform mat4 projViewModelMatrix;\\n uniform vec2 outSize;\\n\\n varying vec4 vColor;\\n\\n void main()\\n {\\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.0);\\n vColor = aColor / 255.0;\\n }\\n\", frag: \"\\n #ifdef GL_ES\\n precision lowp float;\\n #endif\\n\\n uniform float opacity;\\n\\n varying vec4 vColor;\\n\\n void main()\\n {\\n gl_FragColor = vColor * opacity;\\n }\\n\", uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }], extraCommandProps: { stencil: { enable: !0, func: { cmp: \"<=\", ref: function ref(e, t) {return t.level;} }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, viewport: t } };this.shader = new _gl.reshader.MeshShader(n);} }, { key: \"getUniformValues\", value: function getUniformValues(e) {var t = this.sceneConfig.opacity || .3,n = this.layer.getRenderer().canvas;return { projViewMatrix: e.projViewMatrix, outSize: [n.width, n.height], opacity: t };} }]);}(fn);var Gs = _gl.reshader.pbr.PBRUtils.getPBRUniforms;var js = function (_Hs2) {function js() {var _this73;_classCallCheck(this, js);for (var _len14 = arguments.length, e = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {e[_key14] = arguments[_key14];}_this73 = _callSuper(this, js, [].concat(e)), _this73._loader = new _gl.reshader.ResourceLoader(null, _this73.layer.getURLModifier()), _this73.scene.sortFunction = _this73.sortByCommandKey;return _this73;}_inherits(js, _Hs2);return _createClass(js, [{ key: \"supportRenderMode\", value: function supportRenderMode(e) {return this.getSymbols()[0].ssr ? \"fxaa\" === e || \"fxaaAfterTaa\" === e : _superPropGet(js, \"supportRenderMode\", this, 3)([e]);} }, { key: \"isAnimating\", value: function isAnimating() {var e = this._getUVOffsetAnim();if (e && (e[0] || e[1])) return !0;} }, { key: \"needToRedraw\", value: function needToRedraw() {var e = this._getUVOffsetAnim();return !(!e || !e[0] && !e[1]) || _superPropGet(js, \"needToRedraw\", this, 3)([]);} }, { key: \"_getUVOffsetAnim\", value: function _getUVOffsetAnim() {var e = this.getSymbols()[0];return e.material && e.material.uvOffsetAnim;} }, { key: \"createGeometry\", value: function createGeometry(e) {if (!e.data || !e.data.aPosition || !e.data.aPosition.length) return null;var t = { uv0Attribute: \"aTexCoord0\" };e.data.aAltitude && (t.altitudeAttribute = \"aAltitude\");var n = new _gl.reshader.Geometry(e.data, e.indices, 0, t);return Se(n.properties, e.properties), e.vertexColors && (n.properties.vertexColors = e.vertexColors), this.material.uniforms.normalTexture && !n.data[n.desc.tangentAttribute] && n.data[n.desc.uv0Attribute] && (n.data[n.desc.normalAttribute] || n.createNormal(), n.createTangent()), this._prepareFeatureIds(n, e), { geometry: n, symbolIndex: { index: 0 } };} }, { key: \"paint\", value: function paint(e) {var t = !!e.shadow;e.states && e.states.includesChanged && (this.shader.dispose(), delete this.shader, this._updateDepthShader.dispose(), delete this._updateDepthShader, this._createShader(e));var n = !!e.ssr && this.getSymbols()[0].ssr;var i = this.shader,r = i.shaderDefines;if (n) {var _t357 = Se({}, r, e.ssr.defines);i.shaderDefines = _t357;}if (e.onlyUpdateDepthInTaa && (this.shader = this._updateDepthShader, !n && this._previousSSR && (this.shader = i, this.setToRedraw(!0))), this.updateIBLDefines(i), _superPropGet(js, \"paint\", this, 3)([e]), void 0 !== this.shadowCount && t) {var _e404 = this.scene.getMeshes().length;this.shadowCount !== _e404 && this.setToRedraw();}this.shader = i, n && (i.shaderDefines = r), delete this.shadowCount, this._previousSSR = n;} }, { key: \"updateSceneConfig\", value: function updateSceneConfig(e) {Se(this.sceneConfig, e), this.setToRedraw();} }, { key: \"delete\", value: function _delete() {_superPropGet(js, \"delete\", this, 3)([]), this.disposeIBLTextures(), this.material.dispose(), this._updateDepthShader && (this._updateDepthShader.dispose(), delete this._updateDepthShader);} }, { key: \"init\", value: function init(e) {this.getMap().on(\"updatelights\", this._onUpdatelights, this), this.createIBLTextures(), this._context = this._context || e;var t = this.regl;this.renderer = new _gl.reshader.Renderer(t), this._bindedOnTextureLoad = this._onTextureLoad.bind(this), this._bindDisposeCachedTexture = this.disposeCachedTexture.bind(this), this._bindOnMaterialComplete = this._onMaterialComplete.bind(this), this._updateMaterial(), this._createShader(e);var n = { vert: \"\\n #include \\n attribute vec3 aPosition;\\n uniform mat4 projViewModelMatrix;\\n uniform mat4 positionMatrix;\\n //引入fbo picking的vert相关函数\\n #include \\n #include \\n #include \\n void main() {\\n mat4 localPositionMatrix = getPositionMatrix();\\n #ifdef IS_LINE_EXTRUSION\\n vec3 linePosition = getLineExtrudePosition(aPosition);\\n vec4 localVertex = getPosition(linePosition);\\n #else\\n vec4 localVertex = getPosition(aPosition);\\n #endif\\n\\n gl_Position = projViewModelMatrix * localPositionMatrix * localVertex;\\n fbo_picking_setData(gl_Position.w, true);\\n }\\n \", uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply([], t.projViewMatrix, t.modelMatrix);} }], extraCommandProps: { viewport: this.pickingViewport, depth: { enable: !0, range: this.sceneConfig.depthRange || [0, 1], func: this.sceneConfig.depthFunc || \"<=\", mask: !!Ie(this.sceneConfig.depthMask) || this.sceneConfig.depthMask } } };this.picking = [new _gl.reshader.FBORayPicking(this.renderer, n, this.layer.getRenderer().pickingFBO, this.getMap())];} }, { key: \"_createShader\", value: function _createShader(e) {var _this74 = this;var t = { x: 0, y: 0, width: function width() {return _this74.canvas ? _this74.canvas.width : 1;}, height: function height() {return _this74.canvas ? _this74.canvas.height : 1;} },n = {},i = [];i.push.apply(i, _toConsumableArray(_gl.reshader.SsrPass.getUniformDeclares())), this.fillIncludes(n, i, e);var r = { cull: { enable: function enable(e, t) {return !(t.geometryProperties.hasNegativeHeight || void 0 !== _this74.sceneConfig.cullFace && !_this74.sceneConfig.cullFace);}, face: function face() {return _this74.sceneConfig.cullFace || \"back\";} }, stencil: { enable: !1 }, viewport: t, depth: { enable: !0, range: this.sceneConfig.depthRange || [0, 1], func: this.sceneConfig.depthFunc || \"<=\" }, blend: { enable: function enable(e, t) {return void 0 === t.hasAlpha || !!t.hasAlpha;}, func: this.getBlendFunc(), equation: \"add\" }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } },o = { uniforms: i, defines: this._getDefines(n), extraCommandProps: r };this.shader = new _gl.reshader.pbr.StandardShader(o), o.frag = \"\\n precision mediump float;\\n #include \\n void main() {\\n glFragColor = vec4(0.0);\\n #if __VERSION__ == 100\\n gl_FragColor = glFragColor;\\n #endif\\n }\\n \", this._updateDepthShader = new _gl.reshader.pbr.StandardShader(o);} }, { key: \"_onTextureLoad\", value: function _onTextureLoad(_ref119) {var e = _ref119.resources;for (var _t358 = 0; _t358 < e.length; _t358++) this.addCachedTexture(e[_t358].url, e[_t358].data);this.setToRedraw(!0);} }, { key: \"_onMaterialComplete\", value: function _onMaterialComplete() {this.setToRedraw(!0);} }, { key: \"_updateMaterial\", value: function _updateMaterial(t) {if (t) {var _e405 = this.getSymbols()[0].material;_e405 && Se(_e405, t);}var n = this.layer instanceof e.TileLayer,i = this.dataConfig,r = t || this.getSymbols()[0].material,o = {};var a = !1;for (var _e406 in r) if (Ne(r, _e406)) if (_e406.indexOf(\"Texture\") > 0) {var _t359 = r[_e406];if (!_t359) {o[_e406] = void 0;continue;}var _n249 = \"string\" == typeof _t359 ? _t359 : _t359.url,_l50 = this.getCachedTexture(_n249);_l50 ? _l50.then ? _n249 === _t359 ? _t359 = { promise: _l50, wrap: \"repeat\" } : _t359.promise = _l50 : _n249 === _t359 ? _t359 = { data: _l50, wrap: \"repeat\" } : _t359.data = _l50 : _n249 === _t359 && (_t359 = { url: _n249, wrap: \"repeat\" }), _t359.flipY = !i.upsideUpTexture, _t359.min = \"linear mipmap linear\", _t359.mag = \"linear\", o[_e406] = new _gl.reshader.Texture2D(_t359, this._loader), o[_e406].once(\"complete\", this._bindedOnTextureLoad), o[_e406].once(\"disposed\", this._bindDisposeCachedTexture), o[_e406].promise && this.addCachedTexture(_n249, o[_e406].promise), a = !0;} else o[_e406] = r[_e406], \"uvRotation\" === _e406 && (o[_e406] = Math.PI * o[_e406] / 180, n || (o[_e406] *= -1));if (void 0 === o.alphaTest && this.getMaterialClazz && (o.alphaTest = .05), this.material) {for (var _e407 in o) this.material.set(_e407, o[_e407]);this.setToRedraw(!0);} else this.material = new _gl.reshader.pbr.StandardMaterial(o), this.material.once(\"complete\", this._bindOnMaterialComplete);a || this._onMaterialComplete();} }, { key: \"getShader\", value: function getShader() {return this.shader;} }, { key: \"getUniformValues\", value: function getUniformValues(e, t) {var _this$getIBLRes = this.getIBLRes(),n = _this$getIBLRes.iblTexes,i = _this$getIBLRes.dfgLUT,r = Gs(e, n, i, t && t.ssr, t && t.jitter);return this.setIncludeUniformValues(r, t), r;} }, { key: \"_getDefines\", value: function _getDefines(e) {return this.hasIBL() ? e.HAS_IBL_LIGHTING = 1 : delete e.HAS_IBL_LIGHTING, e;} }, { key: \"_onUpdatelights\", value: function _onUpdatelights() {if (!this.shader) return;var e = this.shader.shaderDefines;this._getDefines(e), this.shader.shaderDefines = e;} }]);}(Hs);var Ws = \"#include \\n#define EXTRUDE_SCALE 63.0\\n#define EXTRUDE_MOD 64.0\\n#define MAX_LINE_DISTANCE 65535.0\\nuniform mat4 projViewModelMatrix;\\nuniform mat4 positionMatrix;\\nuniform vec2 centiMeterToLocal;\\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\nattribute vec4 aTubeNormal;\\n#ifdef HAS_LINE_WIDTH\\nattribute float aLineWidth;\\n#else\\nuniform float lineWidth;\\n#endif\\n#include \\n#ifdef PICKING_MODE\\n#include \\n#else\\nuniform mat4 modelViewMatrix;\\nuniform mat3 modelNormalMatrix;\\nuniform mat4 modelMatrix;\\n#if defined(HAS_PATTERN)\\nuniform float resolution;\\nuniform float tileResolution;\\nuniform float tileRatio;\\nattribute float aLinesofar;\\nvarying highp float vLinesofar;\\nattribute vec4 aTexInfo;\\nvarying vec4 vTexInfo;\\nvarying float vNormalY;\\nvarying float vPatternHeight;\\nattribute float aNormalDistance;\\n#if defined(HAS_PATTERN_ANIM)\\nattribute float aLinePatternAnimSpeed;\\nvarying float vLinePatternAnimSpeed;\\n#endif\\n#if defined(HAS_PATTERN_GAP)\\nattribute float aLinePatternGap;\\nvarying float vLinePatternGap;\\n#endif\\n#endif\\n#ifdef HAS_COLOR\\nattribute vec4 aColor;\\nvarying vec4 vColor;\\n#endif\\n#ifdef HAS_OPACITY\\nattribute float aOpacity;\\n#endif\\nvarying float vOpacity;\\nvarying vec3 vModelNormal;\\nvarying vec4 vViewVertex;\\nvarying vec3 vModelVertex;\\n#endif\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\n#include \\n#endif\\n#include \\nvoid main() {\\n \\n#ifdef HAS_LINE_WIDTH\\nfloat c = aLineWidth;\\n#else\\nfloat c = lineWidth;\\n#endif\\nfloat d = c / 2.;\\n vec3 e = aTubeNormal.xyz / EXTRUDE_SCALE;\\n vec3 f = unpackVTPosition();\\n vec4 h = vec4(f, 1.);\\n h.xy += e.xy * d * centiMeterToLocal;\\n h.z += e.z * d;\\n gl_Position = projViewModelMatrix * h;\\n#ifdef PICKING_MODE\\nfbo_picking_setData(gl_Position.w, true);\\n#else\\nvViewVertex = modelViewMatrix * h;\\n vec3 i = normalize(e);\\n vModelNormal = modelNormalMatrix * i;\\n vModelVertex = (modelMatrix * h).xyz;\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nshadow_computeShadowPars(h);\\n#endif\\n#ifdef HAS_COLOR\\nvColor = aColor / 255.;\\n#endif\\n#ifdef HAS_OPACITY\\nvOpacity = aOpacity / 255.;\\n#else\\nvOpacity = 1.;\\n#endif\\n#ifdef HAS_PATTERN\\nfloat j = tileResolution / resolution;\\n float k = aLinesofar - d * centiMeterToLocal.y * aNormalDistance / EXTRUDE_SCALE;\\n vLinesofar = k / tileRatio * j;\\n vTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\\n vPatternHeight = c * centiMeterToLocal.x / tileRatio * j;\\n vNormalY = aTubeNormal.w / EXTRUDE_SCALE;\\n#if defined(HAS_PATTERN_ANIM)\\nvLinePatternAnimSpeed = aLinePatternAnimSpeed / 127.;\\n#endif\\n#if defined(HAS_PATTERN_GAP)\\nvLinePatternGap = aLinePatternGap / 10.0;\\n#endif\\n#endif\\nhighlight_setVarying();\\n#endif\\n}\";var _H12 = H(),Xs = _H12.StyleUtil,Ys = _gl.reshader.pbr.PBRUtils.getPBRUniforms;var Zs = function (_gn6) {function Zs() {_classCallCheck(this, Zs);return _callSuper(this, Zs, arguments);}_inherits(Zs, _gn6);return _createClass(Zs, [{ key: \"needToRedraw\", value: function needToRedraw() {return _superPropGet(Zs, \"needToRedraw\", this, 3)([]) || this.isAnimating();} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {return !1;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {return !0;} }, { key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return !1;} }, { key: \"supportRenderMode\", value: function supportRenderMode(e) {return this.isAnimating() ? \"fxaa\" === e || \"fxaaAfterTaa\" === e : \"taa\" === e || \"fxaa\" === e;} }, { key: \"isAnimating\", value: function isAnimating() {if (this._hasPatternAnim) return !0;var e = this.getSymbols();for (var _t360 = 0; _t360 < e.length; _t360++) if (e[_t360].linePatternFile && e[_t360].linePatternAnimSpeed) return !0;return !1;} }, { key: \"isBloom\", value: function isBloom(e) {return !!this.getSymbol(e.properties.symbolIndex).lineBloom;} }, { key: \"createMesh\", value: function createMesh(t, n) {var _this75 = this;if (!t.geometry) return null;var i = this.getMap(),r = t.geometry,o = t.symbolIndex,a = t.ref,l = this.getSymbolDef(o);if (void 0 === a) {St(r, l, this.getFnTypeConfig(o), this.layer);}var h = this.getSymbol(o),_r$properties2 = r.properties,c = _r$properties2.tileResolution,u = _r$properties2.tileRatio,f = { tileResolution: c, tileRatio: u };ke(f, \"lineColor\", h, \"lineColor\", \"#fff\", Re(this.colorCache)), ke(f, \"linePatternGapColor\", h, \"linePatternGapColor\", [1, 1, 1, 1], Re(this.colorCache)), ke(f, \"lineWidth\", h, \"lineWidth\", 2, function (e) {return Xs.getTubeSizeScale(_this75.dataConfig.metric) * e;}), ke(f, \"lineOpacity\", h, \"lineOpacity\", 1), ke(f, \"linePatternAnimSpeed\", h, \"linePatternAnimSpeed\", 0), ke(f, \"linePatternGap\", h, \"linePatternGap\", 0), ke(f, \"metallicFactor\", h, \"metallicFactor\", 0), ke(f, \"roughnessFactor\", h, \"roughnessFactor\", .4), ke(f, \"emissiveFactor\", h, \"emissiveFactor\", [0, 0, 0]), ke(f, \"uvScale\", h, \"uvScale\", [1, 1]);var d = r.properties.iconAtlas,p = this.layer instanceof e.TileLayer;d && (f.linePatternFile = yn(this.regl, d, !1), f.atlasSize = d ? [d.width, d.height] : [0, 0], f.flipY = p ? -1 : 1, this.drawDebugAtlas(d)), void 0 === a && r.generateBuffers(this.regl), f.alphaTest = -1;var g = new _gl.reshader.pbr.StandardMaterial(f),m = new _gl.reshader.Mesh(r, g, { castShadow: !1, picking: !0 }),y = i.distanceToPointAtRes(100, 100, r.properties.tileResolution)._multi(u / 1e4).toArray();m.setUniform(\"centiMeterToLocal\", y);var x = i.getResolution(i.getMaxNativeZoom());m.setUniform(\"animSpeedScale\", c / x), m.setLocalTransform(n);var _ = { IS_LINE_EXTRUSION: 1, HAS_LAYER_OPACITY: 1 };return \"square-tube\" === this.dataConfig.type && (_.IS_SQUARE_TUBE = 1), d && (_.HAS_PATTERN = 1), m.properties.symbolIndex = o, r.data.aColor && (_.HAS_COLOR = 1), this.setMeshDefines(_, r, l), r.data.aAltitude && (_.HAS_ALTITUDE = 1), m.setDefines(_), m;} }, { key: \"setMeshDefines\", value: function setMeshDefines(e, t, n) {t.data.aOpacity && (e.HAS_OPACITY = 1), t.data.aLineWidth && (e.HAS_LINE_WIDTH = 1), Lt(n.linePatternAnimSpeed) && (e.HAS_PATTERN_ANIM = 1), Lt(n.linePatternGap) && (e.HAS_PATTERN_GAP = 1);} }, { key: \"paint\", value: function paint(e) {e.states && e.states.includesChanged.shadow && (this.shader.dispose(), this.createShader(e)), _superPropGet(Zs, \"paint\", this, 3)([e]);} }, { key: \"init\", value: function init(e) {this.getMap().on(\"updatelights\", this._onUpdatelights, this), this.createIBLTextures();var t = this.regl;if (this.renderer = new _gl.reshader.Renderer(t), this.createShader(e), this.pickingFBO) {var _e408 = [];this.picking = [new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + Ws, uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }, { name: \"modelNormalMatrix\", type: \"function\", fn: function fn(t, n) {return _gl.mat3.fromMat4(_e408, n.modelMatrix);} }], extraCommandProps: this.getExtraCommandProps() }, this.pickingFBO, this.getMap())];}} }, { key: \"createShader\", value: function createShader(e) {this._context = e;var t = [],n = {};this.fillIncludes(n, t, e), t.push({ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }), this.shader = new _gl.reshader.pbr.StandardShader({ vert: Ws, uniforms: t, defines: this._getDefines(n), extraCommandProps: this.getExtraCommandProps() });} }, { key: \"getExtraCommandProps\", value: function getExtraCommandProps() {var _this76 = this;var e = this.canvas,t = { x: 0, y: 0, width: function width() {return e ? e.width : 1;}, height: function height() {return e ? e.height : 1;} },n = this.sceneConfig.depthRange;return { viewport: t, stencil: { enable: !0, func: { cmp: function cmp() {return \"<=\";}, ref: function ref(e, t) {return t.level;} }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, cull: { enable: function enable() {return !!_this76.sceneConfig.cullFace;}, face: this.sceneConfig.cullFace || \"back\" }, depth: { enable: !0, range: n || [0, 1], mask: this.sceneConfig.depthMask || !0, func: this.sceneConfig.depthFunc || \"<=\" }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } };} }, { key: \"getUniformValues\", value: function getUniformValues(e, t) {var _this$getIBLRes2 = this.getIBLRes(),n = _this$getIBLRes2.iblTexes,i = _this$getIBLRes2.dfgLUT,r = Ys(e, n, i, null, t && t.jitter),s = e.projViewMatrix,o = e.viewMatrix;return r.projViewMatrix = s, r.viewMatrix = o, r.resolution = e.getResolution(), r.currentTime = this.layer.getRenderer().getFrameTimestamp() || 0, this.setIncludeUniformValues(r, t), r;} }, { key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {var _this77 = this;var n = (0, _functionType.piecewiseConstant)(t.lineColor),i = (0, _functionType.piecewiseConstant)(t.aLinePatternAnimSpeed),r = (0, _functionType.piecewiseConstant)(t.aLinePatternGap),s = this.createShapeFnTypeConfigs(e, t),o = new Int8Array(2);return [{ attrName: \"aColor\", symbolName: \"lineColor\", type: Uint8Array, width: 4, define: \"HAS_COLOR\", evaluate: function evaluate(t, i) {var r = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(r) && (r = _this77.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = _this77.colorCache[r] = _this77.colorCache[r] || (0, _color.default)(r).unitArray()), r = Oe(r), r;} }, { attrName: \"aLinePattern\", symbolName: \"linePatternAnimSpeed\", type: Int8Array, width: 2, related: [\"linePatternGap\"], define: \"HAS_LINE_PATTERN\", evaluate: function evaluate(t, n, r, s) {var a = i(e.getZoom(), t);return Ie(a) && (a = 0), 0 !== a && (n.properties.hasPatternAnim = 1), o[0] = a / 127, o[1] = r[s + 1], o;} }, { attrName: \"aLinePattern\", symbolName: \"linePatternGap\", type: Int8Array, width: 2, related: [\"linePatternAnimSpeed\"], define: \"HAS_LINE_PATTERN\", evaluate: function evaluate(t, n, i, s) {var a = r(e.getZoom(), t);return Ie(a) && (a = 0), o[1] = 10 * a, o[0] = i[s], o;} }].concat(s);} }, { key: \"createShapeFnTypeConfigs\", value: function createShapeFnTypeConfigs(e, t) {var _this78 = this;var n = (0, _functionType.interpolated)(t.lineWidth),i = (0, _functionType.interpolated)(t.lineOpacity),r = new Uint16Array(1);return [{ attrName: \"aLineWidth\", symbolName: \"lineWidth\", type: Uint8Array, width: 1, define: \"HAS_LINE_WIDTH\", evaluate: function evaluate(t, i) {var s = n(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(s) && (s = _this78.evaluateInFnTypeConfig(s, i, e, t)), r[0] = Math.round(2 * s), r[0];} }, { attrName: \"aOpacity\", symbolName: \"lineOpacity\", type: Uint8Array, width: 1, define: \"HAS_OPACITY\", evaluate: function evaluate(t, n) {var s = i(e.getZoom(), t);return (0, _functionType.isFunctionDefinition)(s) && (s = _this78.evaluateInFnTypeConfig(s, n, e, t)), r[0] = 255 * s, r[0];} }];} }, { key: \"_getDefines\", value: function _getDefines(e) {return this.hasIBL() ? e.HAS_IBL_LIGHTING = 1 : delete e.HAS_IBL_LIGHTING, e;} }, { key: \"_onUpdatelights\", value: function _onUpdatelights() {if (!this.shader) return;var e = this.shader.shaderDefines;this._getDefines(e), this.shader.shaderDefines = e;} }, { key: \"delete\", value: function _delete() {_superPropGet(Zs, \"delete\", this, 3)([]), this.disposeIBLTextures(), this.shader && (this.shader.dispose(), delete this.shader);} }]);}(gn);var _H13 = H(),qs = _H13.PackUtil,$s = [],Js = [],Ks = [],Qs = [],eo = [],to = [],no = [],io = [0, 0, 0],ro = [0, 0, 0],so = [1, 1, 1],oo = [],ao = [1, 1, 1, 1],lo = [],ho = [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1],co = function co(e) {return function (_e409) {function _class9(e, t, n, i, r, o) {var _this79;_classCallCheck(this, _class9);_this79 = _callSuper(this, _class9, [e, t, n, i, r, o]), _this79._ready = !1, _this79.scene.sortFunction = _this79.sortByCommandKey;var a = i.fetchOptions || {};a.referrer = window && window.location.href, _this79._gltfManager = e.gltfManager = e.gltfManager || new _gl.reshader.GLTFManager(e, { fetchOptions: a, urlModifier: function urlModifier(e) {var n = t.getURLModifier();return n && n(e) || e;} }), _this79._initTRSFuncType(), _this79._initGLTF();return _this79;}_inherits(_class9, _e409);return _createClass(_class9, [{ key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return !1;} }, { key: \"isAnimating\", value: function isAnimating() {var e = this.getSymbols();for (var _t361 = 0; _t361 < e.length; _t361++) {if (e[_t361] && this._gltfPack[_t361] && this._isSkinAnimating(_t361)) return !0;}return !1;} }, { key: \"createGeometry\", value: function createGeometry(e, t) {var n = e.data,i = e.positionSize;return { geometry: { properties: Se({}, e.properties), data: n, positionSize: i, features: t }, symbolIndex: e.symbolIndex };} }, { key: \"getFnTypeConfig\", value: function getFnTypeConfig() {return oo;} }, { key: \"createMesh\", value: function createMesh(e, t, _ref120, _ref121) {var _this80 = this;var n = _ref120.tileTranslationMatrix,i = _ref120.tileExtent,r = _ref120.tilePoint;var l = _ref121.timestamp;if (!this._ready) return null;var h = this.getMap(),c = e.geometry,u = c.positionSize,f = c.features;if (!c.data.aPosition || 0 === c.data.aPosition.length) return null;\"native-line\" === this.dataConfig.type && this._arrangeAlongLine(0, c, r);var d = c.data.aPosition;var p = d.length / u;var g = { instance_vectorA: new Float32Array(4 * p), instance_vectorB: new Float32Array(4 * p), instance_vectorC: new Float32Array(4 * p), aPickingId: [] },m = this._updateInstanceData(g, n, i, c.properties.z, c.data, u, f);c.data.aTerrainAltitude && (g.aTerrainAltitude = c.data.aTerrainAltitude);var y = {},x = g.aPickingId,_ = function (e) {var t = new Map();for (var _n250 = 0; _n250 < e.length; _n250++) {var _i183 = e[_n250];var _r145 = t.get(_i183);_r145 || (_r145 = [], t.set(_i183, _r145)), _r145.push(_n250);}return t;}(x);for (var _e410 in g) y[_e410] = { buffer: this.regl.buffer({ dimension: g[_e410].length / p, data: g[_e410] }), divisor: 1 };var v = this._hasFuncType(),b = this._getMeterScale(),A = _gl.mat4.identity([]);_gl.mat4.scale(A, A, [b, b, b]);var T = [],w = this.getSymbols();var _loop4 = function _loop4(_e411) {var t = w[_e411],i = _this80._gltfMeshInfos[_e411];if (!i) return 1;var r = _this80._gltfPack[_e411][0],u = t.fixSizeOnZoom;var f = _gl.mat4.identity([]);v || (f = _this80._getSymbolTRSMatrix(f));var d = 0;i.forEach(function (e) {var n = e.geometry,i = e.nodeMatrix;_gl.mat4.multiply(lo, ho, i), _gl.mat4.multiply(lo, f, lo);var r = _gl.mat4.multiply(lo, A, lo),s = n.boundingBox.copy();s.transform(r);var o = _this80._calAnchorTranslation(s, t);Math.abs(o) > Math.abs(d) && (d = o);});var b = [0, 0, d],S = i.map(function (i, v) {var T = i.geometry,w = i.materialInfo,S = i.morphWeights,M = i.extraInfo,P = i.nodeIndex;t.alphaTest && (w.alphaTest = t.alphaTest);var I = new (_this80.getMaterialClazz(w))(w),C = {},k = new _gl.reshader.InstancedMesh(y, p, T, I, { transparent: !1, picking: !0 });if (r.hasSkinAnimation()) {var _t362 = _this80._updateAnimation(k, _e411, 0)[P];k.setUniform(\"jointTexture\", _t362.jointTexture), k.setUniform(\"jointTextureSize\", _t362.jointTextureSize), k.setUniform(\"numJoints\", _t362.numJoints), k.setUniform(\"skinAnimation\", +_this80._isSkinAnimating(_e411)), k.properties.startTime = l, C.HAS_SKIN = 1;}S && (k.setUniform(\"morphWeights\", S), C.HAS_MORPH = 1), k.setUniform(\"hasAlpha\", M.alphaMode && \"BLEND\" === M.alphaMode.toUpperCase()), ke(k.uniforms, \"polygonFill\", t, \"markerFill\", ao, Re(_this80.colorCache)), ke(k.uniforms, \"polygonOpacity\", t, \"markerOpacity\", 1);var F = [];k.setPositionMatrix(function () {var t = _this80._getMeshNodeMatrix(_e411, v, P);_gl.mat4.multiply(F, ho, t), _gl.mat4.multiply(F, f, F), _gl.mat4.multiply(F, A, F);var n = _gl.mat4.identity(lo);if (0 !== d && (_gl.mat4.fromTranslation(n, b), _gl.mat4.multiply(F, n, F)), Le(u)) {var _e412 = h.getGLScale() / h.getGLScale(u);return _gl.vec3.set($s, _e412, _e412, _e412), _gl.mat4.fromScaling(n, $s), _gl.mat4.multiply(n, n, F);}return F;});var O = _this80.layer.getRenderer().getZScale(),R = [],E = [];return k.setLocalTransform(function () {var e = _this80.layer.options.altitude || 0;return _gl.vec3.copy(E, m), E[2] += 100 * e * O, _gl.mat4.translate(R, n, E), R;}), T.generateBuffers(_this80.regl, { excludeElementsInVAO: !0 }), g.instance_color && (C.HAS_INSTANCE_COLOR = 1), g.aTerrainAltitude && (C.HAS_INSTANCE_TERRAIN_ALTITUDE = 1, k.setUniform(\"terrainAltitudeScale\", 100 * _this80.layer.getRenderer().getZScale())), C.HAS_LAYER_OPACITY = 1, Se(k.properties, c.properties), k.properties.aPickingId = x, k.properties.nodeIndex = P, k.properties.pickingIdIndiceMap = _, k.setDefines(C), k.properties.symbolIndex = { index: _e411 }, k;});T.push.apply(T, _toConsumableArray(S));};for (var _e411 = 0; _e411 < w.length; _e411++) {if (_loop4(_e411)) continue;}return T.insContext = { instanceData: g, tileTranslationMatrix: n, tileExtent: i, aPosition: d, positionSize: u }, T;} }, { key: \"_arrangeAlongLine\", value: function _arrangeAlongLine(e, t) {var _t$properties7 = t.properties,n = _t$properties7.tileExtent,r = _t$properties7.z,s = t.data,a = t.positionSize;var l = this._calGLTFScale(e);var h = this._getMeterScale();l = _gl.vec3.scale([], l, h);var c = { gapLength: this.dataConfig.gapLength || 0, direction: this.dataConfig.direction || 0, scaleVertex: !0 },u = this._gltfPack[0][0],f = s.aPosition,d = s.aAltitude,p = s.aPickingId,g = new _maptalks.Coordinate(0, 0, 0),m = new _maptalks.Coordinate(0, 0, 0),y = [],x = d ? [] : y,_ = [],v = [],b = [],A = [],T = [],w = [],S = this.layer.getTileSize().width / n * this.layer.getRenderer().getTileGLScale(r),M = this.layer.getRenderer().getZScale();var P = p[0];for (var _e413 = 0; _e413 < f.length - a; _e413 += a) {var _t363 = p[_e413 / a + 1];if (_t363 !== P) {P = _t363;continue;}d ? _gl.vec3.set(T, f[_e413], f[_e413 + 1], d[_e413 / a]) : qs.unpackPosition(T, f[_e413], f[_e413 + 1], f[_e413 + 2]);var _n251 = T[0],_i184 = T[1],_r146 = T[2];var _s119 = _e413 + a;d ? _gl.vec3.set(w, f[_s119], f[_s119 + 1], d[_s119 / a]) : qs.unpackPosition(w, f[_s119], f[_s119 + 1], f[_s119 + 2]);var _h34 = w[0],_I = w[1],_C = w[2],_k = p[_e413 / a],_F = g.set(_n251 * S, _i184 * S, _r146 * M),_O = m.set(_h34 * S, _I * S, _C * M),_R = _F.distanceTo(_O),_E = u.arrangeAlongLine(_F, _O, _R, l, 1, c);for (var _e414 = 0; _e414 < _E.length; _e414++) {var _t364 = _E[_e414];g.set(_n251, _i184, _r146), m.set(_h34, _I, _C);var _s120 = uo(g, m, _t364.t);y.push(_s120.x, _s120.y), x.push(_s120.z), _.push(_k), v.push(-_t364.rotationZ * Math.PI / 180), b.push(_t364.rotationXY * Math.PI / 180), A.push.apply(A, _toConsumableArray(_t364.scale));}}t.data = { aPosition: new f.constructor(y), aPickingId: new p.constructor(_), aZRotation: v, aXYRotation: b, aScaleXYZ: A }, d && (t.data.aAltitude = new d.constructor(x));} }, { key: \"_calGLTFScale\", value: function _calGLTFScale(e) {var t = this.getSymbols()[e],n = [1, 1, 1],i = t.modelHeight;if (i) {this._gltfPack[e][0].calModelHeightScale(n, i);}return _gl.vec3.set(eo, t.scaleX || 1, t.scaleY || 1, t.scaleZ || 1), _gl.vec3.multiply(n, n, eo);} }, { key: \"_getMeshNodeMatrix\", value: function _getMeshNodeMatrix(e, t, n) {var i = e,r = this._gltfMeshInfos[i][t];return this._isSkinAnimating(e) && this._nodeMatrixMap && this._nodeMatrixMap[n] || r.nodeMatrix;} }, { key: \"_updateAnimation\", value: function _updateAnimation(e, t, n) {if (!this._gltfPack) return;var i = this._gltfPack[t][0];this._skinMap || (this._skinMap = {}), this._nodeMatrixMap = {}, this._skinMap[e.uuid] || (this._skinMap[e.uuid] = {});var r = this.getSymbols()[t],s = this._gltfJSON[t],o = r.loop,a = r.speed,l = r.animationName,h = l || s.animations[0].name;return i.updateAnimation(n, o || !1, a || 1, h, e.properties.startTime || 0, this._nodeMatrixMap, this._skinMap[e.uuid]), this._skinMap[e.uuid];} }, { key: \"_calAnchorTranslation\", value: function _calAnchorTranslation(e, t) {var n = t.anchorZ || \"center\";var i = 0;var r = e.max[2] - e.min[2];return \"bottom\" === n ? i = r / 2 : \"top\" === n && (i = -r / 2), i;} }, { key: \"addMesh\", value: function addMesh(e, t, n) {if (!e) return null;if (e[0].properties.level > 2) return null;var i = n.timestamp;for (var _t365 = 0; _t365 < e.length; _t365++) {if (!e[_t365] || !e[_t365].geometry) continue;e[_t365].instancedData.aTerrainAltitude && this._updateTerrainAltitude(e[_t365], e[_t365].instancedData, e[_t365].properties, 3, n);var _r147 = e[_t365].properties.symbolIndex.index,_s121 = this._isSkinAnimating(_r147);_s121 && this._updateAnimation(e[_t365], _r147, i), e[_t365].setUniform(\"skinAnimation\", +_s121), this._highlightMesh(e[_t365]);}return this.scene.addMesh(e), this;} }, { key: \"_updateATerrainAltitude\", value: function _updateATerrainAltitude(e, t) {e && e.updateInstancedData && e.updateInstancedData(\"aTerrainAltitude\", t);} }, { key: \"prepareRender\", value: function prepareRender(e) {var t = this.getSymbols();var n = !1;for (var _e415 = 0; _e415 < t.length; _e415++) {if (!t[_e415] || !this._gltfPack[_e415]) continue;if (this._isSkinAnimating(_e415) && this._gltfPack[_e415] && !n) {n = !0;break;}}n && this.setToRedraw(!0), _superPropGet(_class9, \"prepareRender\", this, 3)([e]);} }, { key: \"getShadowMeshes\", value: function getShadowMeshes() {if (!this.isVisible()) return oo;this.shadowCount = this.scene.getMeshes().length;return this.scene.getMeshes().filter(function (e) {return 0 === e.properties.level;});} }, { key: \"_isSkinAnimating\", value: function _isSkinAnimating(e) {var t = this.getSymbols()[e];return !!(t && t.animation && this._gltfPack[e] && this._gltfPack[e][0] && this._gltfPack[e][0].hasSkinAnimation());} }, { key: \"_updateInstanceData\", value: function _updateInstanceData(e, t, n, i, r, s, l) {function h(t, n, i, r) {e[t][4 * n] = i[r], e[t][4 * n + 1] = i[r + 4], e[t][4 * n + 2] = i[r + 8], e[t][4 * n + 3] = i[r + 12];}var c = r.aPosition,u = r.aPickingId,f = r.aXYRotation,d = r.aZRotation,p = r.aAltitude,g = r.aScaleXYZ,m = c.length / s,y = this.layer.getTileSize().width / n * this.layer.getRenderer().getTileGLScale(i),x = this.layer.getRenderer().getZScale(),_ = 100 * (this.dataConfig.altitudeOffset || 0);var v = 1 / 0,b = 1 / 0,A = 1 / 0,T = -1 / 0,w = -1 / 0,S = -1 / 0;var M = [],P = [];for (var _e416 = 0; _e416 < m; _e416++) {p ? _gl.vec3.set(P, c[_e416 * s], c[_e416 * s + 1], p[_e416]) : qs.unpackPosition(P, c[_e416 * s], c[_e416 * s + 1], c[_e416 * s + 2]);var _t366 = _gl.vec3.set(M, P[0] * y, -P[1] * y, (P[2] + _) * x);_t366[0] < v && (v = _t366[0]), _t366[0] > T && (T = _t366[0]), _t366[1] < b && (b = _t366[1]), _t366[1] > w && (w = _t366[1]), _t366[2] < A && (A = _t366[2]), _t366[2] > S && (S = _t366[2]);}var I = (v + T) / 2,C = (b + w) / 2,k = (A + S) / 2,F = [],O = this._hasFuncType(),R = [0, 0, 1],E = [0, 0, 0];for (var _t367 = 0; _t367 < m; _t367++) {p ? _gl.vec3.set(P, c[_t367 * s], c[_t367 * s + 1], p[_t367]) : qs.unpackPosition(P, c[_t367 * s], c[_t367 * s + 1], c[_t367 * s + 2]);var _n252 = P[0],_i185 = P[1],_r148 = _gl.vec3.set(M, _n252 * y - I, -_i185 * y - C, (P[2] + _) * x - k),_m8 = _gl.vec3.set(eo, 1, 1, 1);g && (_gl.vec3.set(_m8, g[3 * _t367], g[3 * _t367 + 1], g[3 * _t367 + 2]), _gl.mat4.fromScaling(to, _m8));var _v6 = f && f[_t367] || 0,_b6 = d && d[_t367] || 0;if (_v6 || _b6) {_gl.mat4.fromRotation(F, _b6, R);var _e417 = _gl.vec3.set($s, Math.cos(_b6), Math.sin(_b6), 0),_t368 = _gl.vec3.rotateZ(_e417, _e417, E, 90 * Math.PI / 180);_gl.mat4.rotate(F, F, _v6, _t368), g && _gl.mat4.multiply(F, F, to);var _n253 = _gl.mat4.fromTranslation(lo, _r148);_gl.mat4.multiply(F, _n253, F);} else _gl.mat4.fromTranslation(F, _r148), g && _gl.mat4.multiply(F, F, to);if (O) {var _e418 = this._getSymbolTRSMatrix(lo, l, u, _t367);_gl.mat4.multiply(F, F, _e418);}h(\"instance_vectorA\", _t367, F, 0), h(\"instance_vectorB\", _t367, F, 1), h(\"instance_vectorC\", _t367, F, 2), e.aPickingId[_t367] = u[_t367];}return _gl.vec3.set(M, I, C, k), M;} }, { key: \"_getMeterScale\", value: function _getMeterScale() {if (!this._meterScale) {var _e419 = this.getMap();this._meterScale = 100 * $(_e419.getGLRes(), _e419);}return this._meterScale;} }, { key: \"_getSymbolTRSMatrix\", value: function _getSymbolTRSMatrix(e, t, n, i) {var r = this.getMap(),s = this.symbolDef[0],a = this._getMeterScale();var l = s.translationX || 0,h = s.translationY || 0,c = s.translationZ || 0,u = s.rotationX || 0,f = s.rotationY || 0,d = s.rotationZ || 0,p = s.scaleX || 1,g = s.scaleY || 1,m = s.scaleZ || 1;var y = n && n[i],x = t && t[y],_ = r.getZoom(),v = x && x.feature && x.feature.properties,b = this._getModelHeightScale(_, v);this._txFn && (l = this._txFn(_, v)), this._tyFn && (h = this._tyFn(_, v)), this._tzFn && (c = this._tzFn(_, v));var A = _gl.vec3.set(Js, l * a, h * a, c * a);this._rxFn && (u = this._rxFn(_, v)), this._ryFn && (f = this._ryFn(_, v)), this._rzFn && (d = this._rzFn(_, v));var T = _gl.vec3.set(Ks, u, f, d);this._sxFn && (p = this._sxFn(_, v)), this._syFn && (g = this._syFn(_, v)), this._szFn && (m = this._szFn(_, v));var w = _gl.vec3.set(Qs, p * b, g * b, m * b);return this._getGLTFMatrix(e, A, T, w);} }, { key: \"_getModelHeightScale\", value: function _getModelHeightScale(e, t) {var n = this.symbolDef[0];var i = this._modelHeightFn ? this._modelHeightFn(e, t) : n.modelHeight;if (X(i)) return 1;var r = this._gltfBBox[0];return i / Math.abs(r.max[1] - r.min[1]);} }, { key: \"getShaderConfig\", value: function getShaderConfig() {var e = _superPropGet(_class9, \"getShaderConfig\", this, 3)([]);return e.positionAttribute = \"POSITION\", e.normalAttribute = \"NORMAL\", e;} }, { key: \"init\", value: function init(e) {_superPropGet(_class9, \"init\", this, 3)([e]), this._initGLTF();} }, { key: \"_initTRSFuncType\", value: function _initTRSFuncType() {var e = this.symbolDef[0];(0, _functionType.isFunctionDefinition)(e.modelHeight) && (this._modelHeightFn = (0, _functionType.interpolated)(e.modelHeight)), (0, _functionType.isFunctionDefinition)(e.translationX) && (this._txFn = (0, _functionType.interpolated)(e.translationX)), (0, _functionType.isFunctionDefinition)(e.translationY) && (this._tyFn = (0, _functionType.interpolated)(e.translationY)), (0, _functionType.isFunctionDefinition)(e.translationZ) && (this._tzFn = (0, _functionType.interpolated)(e.translationZ)), (0, _functionType.isFunctionDefinition)(e.rotationX) && (this._rxFn = (0, _functionType.interpolated)(e.rotationX)), (0, _functionType.isFunctionDefinition)(e.rotationY) && (this._ryFn = (0, _functionType.interpolated)(e.rotationY)), (0, _functionType.isFunctionDefinition)(e.rotationZ) && (this._rzFn = (0, _functionType.interpolated)(e.rotationZ)), (0, _functionType.isFunctionDefinition)(e.scaleX) && (this._sxFn = (0, _functionType.interpolated)(e.scaleX)), (0, _functionType.isFunctionDefinition)(e.scaleY) && (this._syFn = (0, _functionType.interpolated)(e.scaleY)), (0, _functionType.isFunctionDefinition)(e.scaleZ) && (this._szFn = (0, _functionType.interpolated)(e.scaleZ));} }, { key: \"_hasFuncType\", value: function _hasFuncType() {return !!(this._modelHeightFn && !this._modelHeightFn.isFeatureConstant || this._txFn && !this._txFn.isFeatureConstant || this._tyFn && !this._tyFn.isFeatureConstant || this._tzFn && !this._tzFn.isFeatureConstant || this._rxFn && !this._rxFn.isFeatureConstant || this._ryFn && !this._ryFn.isFeatureConstant || this._rzFn && !this._rzFn.isFeatureConstant || this._sxFn && !this._sxFn.isFeatureConstant || this._syFn && !this._syFn.isFeatureConstant || this._szFn && !this._szFn.isFeatureConstant);} }, { key: \"_initGLTF\", value: function _initGLTF() {var _this81 = this;if (this._gltfPack) return;this._gltfPack = [], this._gltfJSON = [], this._gltfBBox = [], this._gltfMeshInfos = [];var e = this.getSymbols();this._loaded = 0;var _loop5 = function _loop5(_t369) {var n = e[_t369].url || \"pyramid\";_this81._gltfManager.loginGLTF(n);var i = _this81._gltfManager.getGLTF(n);if (i.then) i.then(function (n) {if (!n.gltfPack) return _this81._loaded++, void (_this81._loaded >= e.length && (_this81._ready = !0, _this81.setToRedraw(!0)));var i = n.gltfPack,r = n.json,s = n.bbox;_this81._gltfPack[_t369] = [i], _this81._gltfMeshInfos[_t369] = i.getMeshesInfo(), _this81._gltfJSON[_t369] = r, _this81._gltfBBox[_t369] = s, _this81._loaded++, _this81._loaded >= e.length && (_this81._ready = !0), _this81.setToRedraw(!0);});else {var _e420 = i.gltfPack,_n254 = i.json,_r149 = i.bbox;_e420 && (_this81._gltfPack[_t369] = [_e420], _this81._gltfMeshInfos[_t369] = _e420.getMeshesInfo(), _this81._gltfJSON[_t369] = _n254, _this81._gltfBBox[_t369] = _r149, _this81._loaded++);}};for (var _t369 = 0; _t369 < e.length; _t369++) {_loop5(_t369);}this._loaded >= e.length && (this._ready = !0);} }, { key: \"getPickingVert\", value: function getPickingVert() {return \"\\n attribute vec3 aPosition;\\n uniform mat4 projViewModelMatrix;\\n uniform mat4 modelMatrix;\\n uniform mat4 positionMatrix;\\n //引入fbo picking的vert相关函数\\n #include \\n #include \\n void main()\\n {\\n mat4 localPositionMatrix = getPositionMatrix();\\n vec4 localPosition = getPosition(aPosition);\\n\\n gl_Position = projViewModelMatrix * localPositionMatrix * localPosition;\\n //传入gl_Position的depth值\\n fbo_picking_setData(gl_Position.w, true);\\n }\";} }, { key: \"deleteMesh\", value: function deleteMesh(e) {if (e) {this.scene.removeMesh(e);for (var _t370 = 0; _t370 < e.length; _t370++) {var _n255 = this._skinMap && this._skinMap[e[_t370].uuid];if (_n255) {for (var _e421 in _n255) _n255[_e421].jointTexture && _n255[_e421].jointTexture.destroy();delete this._skinMap[e[_t370].uuid];}e[_t370].disposeInstancedData(), e[_t370].dispose();}}} }, { key: \"delete\", value: function _delete() {_superPropGet(_class9, \"delete\", this, 3)([]);var e = this.getSymbols();for (var _t371 = 0; _t371 < e.length; _t371++) {var _n256 = e[_t371].url || \"pyramid\";this._gltfManager.logoutGLTF(_n256);}if (this._skinMap) {for (var _e422 in this._skinMap) {var _t372 = this._skinMap[_e422];for (var _e423 in _t372) _t372[_e423].jointTexture && _t372[_e423].jointTexture.destroy();}delete this._skinMap;}delete this._nodeMatrixMap;} }, { key: \"_getGLTFMatrix\", value: function _getGLTFMatrix(e, t, n, i) {var r = _gl.vec3.set.apply(o, [$s].concat(_toConsumableArray(t || io))),s = n || ro,l = i || so,h = _gl.quat.fromEuler(no, s[0], s[1], s[2]);return _gl.mat4.fromRotationTranslationScale(e, h, r, l);} }, { key: \"shouldDrawParentTile\", value: function shouldDrawParentTile() {return !1;} }]);}(e);};function uo(e, t, n) {var i = fo(e.x, t.x, n),r = fo(e.y, t.y, n),s = fo(e.z || 0, t.z || 0, n);return new e.constructor(i, r, s);}function fo(e, t, n) {return e + n * (t - e);}var po = function (_co) {function po() {_classCallCheck(this, po);return _callSuper(this, po, arguments);}_inherits(po, _co);return _createClass(po, [{ key: \"getMaterialClazz\", value: function getMaterialClazz(e) {return e.diffuseFactor ? _gl.reshader.PhongSpecularGlossinessMaterial : _gl.reshader.PhongMaterial;} }]);}(co(Vs));var go = function (_co2) {function go() {_classCallCheck(this, go);return _callSuper(this, go, arguments);}_inherits(go, _co2);return _createClass(go, [{ key: \"getMaterialClazz\", value: function getMaterialClazz(e) {return e.specularGlossinessTexture || e.diffuseTexture ? _gl.reshader.pbr.StandardSpecularGlossinessMaterial : _gl.reshader.pbr.StandardMaterial;} }]);}(co(js));var mo = _gl.reshader.pbr.PBRUtils.getPBRUniforms,yo = { color: [2.0303, 2.028, 2.028], direction: [0, -.2717, -1] },xo = .3737,_o = { index: 0 },vo = [0, 0, 0],bo = [2, 2];var Ao = function (_gn7) {function Ao() {_classCallCheck(this, Ao);return _callSuper(this, Ao, arguments);}_inherits(Ao, _gn7);return _createClass(Ao, [{ key: \"supportRenderMode\", value: function supportRenderMode(e) {return \"fxaa\" === e || \"fxaaBeforeTaa\" === e;} }, { key: \"needPolygonOffset\", value: function needPolygonOffset() {return !0;} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {return !1;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {return !0;} }, { key: \"needToRedraw\", value: function needToRedraw() {if (_superPropGet(Ao, \"needToRedraw\", this, 3)([])) return !0;return this.getSymbol(_o).animation;} }, { key: \"createMesh\", value: function createMesh(e, t) {var n = e.geometry;n.generateBuffers(this.regl);var i = new _gl.reshader.Mesh(n, null, { castShadow: !1, picking: !0 });return i.properties.symbolIndex = _o, i.setLocalTransform(t), i;} }, { key: \"callShader\", value: function callShader(e, t) {_superPropGet(Ao, \"callShader\", this, 3)([e, t]), this.transformWater();var n = this._getWaterUniform(this.getMap(), t);this._drawCount += this.renderer.render(this._waterShader, n, this._waterScene, this.getRenderFBO(t));} }, { key: \"addMesh\", value: function addMesh(e, t) {this._prepareMesh(e, t), _superPropGet(Ao, \"addMesh\", this, 3)(arguments);} }, { key: \"_prepareMesh\", value: function _prepareMesh(e) {var t = this.getSymbol(_o).ssr;for (var _n257 = 0; _n257 < e.length; _n257++) e[_n257].ssr = t ? 1 : 0;} }, { key: \"paint\", value: function paint(e) {e.states && e.states.includesChanged && (this.shader.dispose(), this._waterShader.dispose(), this._createShader(e));var t = !!e.ssr && this.getSymbol(_o).ssr,n = this._waterShader,i = n.shaderDefines;if (t) {var _t373 = Se({}, i, e.ssr.defines);n.shaderDefines = _t373;}this.updateIBLDefines(n), this._water.ssr = t ? 1 : 0, _superPropGet(Ao, \"paint\", this, 3)([e]), t && (n.shaderDefines = i);} }, { key: \"isEnableTileStencil\", value: function isEnableTileStencil() {return !1;} }, { key: \"init\", value: function init(e) {this.createIBLTextures();var t = this.regl;this.renderer = new _gl.reshader.Renderer(t), this.createGround(), this._createShader(e), this.pickingFBO && (this.picking = [new _gl.reshader.FBORayPicking(this.renderer, { vert: mn, uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }], extraCommandProps: { viewport: this.pickingViewport } }, this.pickingFBO, this.getMap())]), this._loadTextures();} }, { key: \"_loadTextures\", value: function _loadTextures() {var _this82 = this;var e = this.regl;this._emptyTex || (this._emptyTex = e.texture(2));var t = this.layer.getURLModifier(),n = this.getSymbol({ index: 0 }),i = n.texWaveNormal,r = this.getCachedTexture(i),s = this;if (r) this._normalTex || (r.isLoading ? setTimeout(function () {_this82.shader && _this82._loadTextures();}, 20) : this._normalTex = this._createTex(e, r));else {var _n258 = new Image();_n258.isLoading = !0, _n258.onload = function () {delete this.isLoading, s._normalTex = s._createTex(e, this), s.setToRedraw();}, _n258.onerror = function () {console.error(\"invalid water wave normal texture:\" + i);}, this.addCachedTexture(i, _n258), _n258.src = t && t(i) || i;}var o = n.texWavePerturbation,a = this.getCachedTexture(o);if (a) this._pertTex || (a.isLoading ? setTimeout(function () {_this82._loadTextures(), _this82.shader;}, 20) : this._pertTex = this._createTex(e, a));else {var _n259 = new Image();_n259.isLoading = !0, _n259.onload = function () {delete this.isLoading, s._pertTex = s._createTex(e, this), s.setToRedraw();}, _n259.onerror = function () {console.error(\"invalid water wave perturbation texture:\" + o);}, this.addCachedTexture(o, _n259), _n259.src = t && t(o) || o;}} }, { key: \"_createTex\", value: function _createTex(e, t) {return this._emptyTex ? e.texture({ width: t.width, height: t.height, mag: \"linear\", min: \"linear mipmap linear\", wrapS: \"repeat\", wrapT: \"repeat\", flipY: !0, data: t }) : null;} }, { key: \"_createShader\", value: function _createShader(e) {var t = this.canvas,n = [],i = [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }, { name: \"modelViewNormalMatrix\", type: \"function\", fn: function fn(e, t) {var n = _gl.mat4.multiply([], t.viewMatrix, t.modelMatrix),i = _gl.mat4.invert(n, n),r = _gl.mat4.transpose(i, i);return _gl.mat3.fromMat4([], r);} }, { name: \"modelViewMatrix\", type: \"function\", fn: function fn(e, t) {return _gl.mat4.multiply([], t.viewMatrix, t.modelMatrix);} }, { name: \"environmentTransform\", type: \"function\", fn: function fn(e, t) {var i = t.environmentOrientation || 0;return _gl.mat3.fromRotation(n, Math.PI * i / 180);} }],r = { TIME_NOISE_TEXTURE_REPEAT: xo };this.fillIncludes(r, i, e);var o = { x: 0, y: 0, width: function width() {return t ? t.width : 1;}, height: function height() {return t ? t.height : 1;} },l = this.sceneConfig.depthRange;this.shader = new _gl.reshader.MeshShader({ vert: \"\\n attribute vec3 aPosition;\\n\\n uniform mat4 projViewModelMatrix;\\n uniform float minAltitude;\\n\\n void main() {\\n vec3 position = aPosition;\\n position.z += minAltitude * 100.0;\\n gl_Position = projViewModelMatrix * vec4(position, 1.);\\n }\\n \", frag: \"\\n #define SHADER_NAME WATER_STENCIL\\n precision mediump float;\\n void main() {\\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\\n }\\n\", uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, t) {var n = [];return _gl.mat4.multiply(n, t.projViewMatrix, t.modelMatrix), n;} }], extraCommandProps: { viewport: o, colorMask: [!1, !1, !1, !1], stencil: { enable: !0, mask: 255, func: { cmp: \"<=\", ref: 254, mask: 255 }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, depth: { enable: !0, range: l || [0, 1], func: this.sceneConfig.depthFunc || \"<=\" }, polygonOffset: { enable: !0, offset: this.getPolygonOffset() } } });var h = { viewport: o, stencil: { enable: !0, mask: 255, func: { cmp: \"==\", ref: 254, mask: 255 }, op: { fail: \"keep\", zfail: \"keep\", zpass: \"replace\" } }, depth: { enable: !1 } };i.push.apply(i, _toConsumableArray(_gl.reshader.SsrPass.getUniformDeclares())), this._waterShader = new _gl.reshader.MeshShader({ vert: \"#define SHADER_NAME WATER\\nuniform mat4 modelMatrix;\\nuniform mat4 projViewModelMatrix;\\nattribute vec3 aPosition;\\nattribute vec2 aTexCoord;\\nuniform vec2 uvOffset;\\nuniform vec2 noiseUvOffset;\\nuniform vec2 uvScale;\\nvarying vec2 vUv;\\nvarying vec2 vNoiseUv;\\nvarying vec3 vPos;\\nvarying mat3 vTbnMatrix;\\n#ifdef HAS_SSR\\nuniform mat4 modelViewMatrix;\\nvarying vec4 vViewVertex;\\n#endif\\n#include \\nmat3 c(in vec3 d) {\\n vec3 t = normalize(cross(d, vec3(.0, 1., .0)));\\n vec3 e = normalize(cross(d, t));\\n return mat3(t, e, d);\\n}\\n#if defined(HAS_SHADOWING)\\n#include \\n#endif\\nconst vec3 f = vec3(0., 0., 1.);\\nvoid main(void) {\\n vec4 h = vec4(aPosition, 1.);\\n vec4 i = modelMatrix * h;\\n vPos = i.xyz;\\n vTbnMatrix = c(f);\\n gl_Position = projViewModelMatrix * h;\\n vUv = aTexCoord * uvScale + uvOffset;\\n vNoiseUv = aTexCoord * uvScale * TIME_NOISE_TEXTURE_REPEAT + noiseUvOffset;\\n#ifdef HAS_SSR\\nvec4 j = modelViewMatrix * h;\\n vViewVertex = j;\\n#endif\\n#if defined(HAS_SHADOWING)\\nshadow_computeShadowPars(h);\\n#endif\\nhighlight_setVarying();\\n}\", frag: \"#define SHADER_NAME WATER\\nprecision highp float;\\nprecision highp sampler2D;\\n#include \\nuniform vec3 hsv;\\nuniform float contrast;\\nuniform float layerOpacity;\\n#if defined(HAS_SHADOWING)\\n#include \\n#endif\\n#include \\n#if defined(HAS_IBL_LIGHTING)\\nuniform vec3 hdrHSV;\\nuniform samplerCube prefilterMap;\\nuniform sampler2D brdfLUT;\\nuniform mat3 environmentTransform;\\nuniform vec3 diffuseSPH[9];\\nvec3 c(const in vec3 d) {\\n vec3 e = environmentTransform * d;\\n float x = e.x;\\n float y = e.y;\\n float z = e.z;\\n vec3 f = (diffuseSPH[0] + diffuseSPH[1] * x + diffuseSPH[2] * y + diffuseSPH[3] * z + diffuseSPH[4] * z * x + diffuseSPH[5] * y * z + diffuseSPH[6] * y * x + diffuseSPH[7] * (3. * z * z - 1.) + diffuseSPH[8] * (x * x - y * y));\\n if(length(hdrHSV) > .0) {\\n f = hsv_apply(f, hdrHSV);\\n }\\n return max(f, vec3(.0));\\n}\\nvec3 h(const in vec3 i, const in float j, const in float k, const in float l) {\\n vec4 rgba = texture2D(brdfLUT, vec2(k, j));\\n float b = (rgba[3] * 65280.0 + rgba[2] * 255.);\\n float a = (rgba[1] * 65280.0 + rgba[0] * 255.);\\n const float m = 1. / 65535.;\\n return (i * a + b * l) * m;\\n}\\n#else\\nuniform vec3 ambientColor;\\n#endif\\nstruct PBRShadingWater {\\n float NdotL;\\n float NdotV;\\n float NdotH;\\n float VdotH;\\n float LdotH;\\n float VdotN;\\n};\\nvec3 o(const in vec4 u, const in float v) {\\n if(v <= .0)\\n return u.rgb;\\n return v * u.rgb * u.a;\\n}\\n#ifdef HAS_SSR\\nvarying vec4 vViewVertex;\\nuniform mat3 modelViewNormalMatrix;\\nuniform sampler2D TextureDepth;\\nuniform highp vec2 outSize;\\nuniform float ssrFactor;\\nuniform float ssrQuality;\\nuniform sampler2D TextureReflected;\\nuniform highp mat4 projMatrix;\\nuniform mat4 invProjMatrix;\\nuniform vec4 outputFovInfo[2];\\nuniform mat4 reprojViewProjMatrix;\\nuniform vec2 cameraNearFar;\\nfloat A(const in vec4 B) {\\n return B.r + B.g / 255.;\\n}\\nfloat C(const in vec2 D, const in float E) {\\n vec3 F = vec3(.06711056, .00583715, 52.9829189);\\n return fract(F.z * fract(dot(D.xy + E * vec2(47., 17.) * .695, F.xy))) * .5;\\n}\\nvec3 G(const in float H, const in float I, const in vec2 J) {\\n float K = min(I - .01, H);\\n float L = floor(K);\\n float M = min(I, L + 1.);\\n float N = pow(2., M);\\n vec2 O = 2. * N / J;\\n if(K - L > .5)\\n N *= 2.;\\n return vec3(O, N);\\n}\\nvec2 P(const in vec2 Q, const in vec3 R) {\\n vec2 S = max(R.xy, min(1. - R.xy, Q));\\n return vec2(2. * S.x, R.z - 1. - S.y) / R.z;\\n}\\nvec3 T(const in mat4 U, const in vec3 V) {\\n vec4 W = U * vec4(V, 1.);\\n return vec3(.5 + .5 * W.xy / W.w, W.w);\\n}\\nvec3 X(const in float Y, const in vec2 S) {\\n return texture2D(TextureReflected, S).rgb;\\n}\\nfloat Z(float ba) {\\n highp mat4 U = projMatrix;\\n highp float z = ba * 2. - 1.;\\n return -U[3].z / (z + U[2].z);\\n}\\nfloat bb(const vec2 S) {\\n float ba = A(texture2D(TextureDepth, S));\\n return ba;\\n}\\nvec3 bc(const in float E, const in vec3 bd, const in vec3 be, const in vec3 bf, const in vec3 bg, const in float bh) {\\n vec2 bi;\\n bi.x = C(gl_FragCoord.yx, E);\\n bi.y = fract(bi.x * 52.9829189);\\n bi.y = mix(bi.y, 1., .7);\\n float bj = 2. * 3.14159 * bi.x;\\n float bk = pow(max(bi.y, .000001), bh / (2. - bh));\\n float bl = sqrt(1. - bk * bk);\\n vec3 bm = vec3(bl * cos(bj), bl * sin(bj), bk);\\n bm = bm.x * bd + bm.y * be + bm.z * bf;\\n return normalize((2. * dot(bg, bm)) * bm - bg);\\n}\\nfloat bn(const in float E) {\\n return (C(gl_FragCoord.xy, E) - .5);\\n}\\nvec3 bo(const in vec3 bp, const in float bq, const in vec3 br) {\\n vec3 bs = T(projMatrix, vViewVertex.xyz + br * bq);\\n bs.z = 1. / bs.z;\\n bs -= bp;\\n float bt = min(1., .99 * (1. - bp.x) / max(1e-5, bs.x));\\n float bu = min(1., .99 * (1. - bp.y) / max(1e-5, bs.y));\\n float bv = min(1., .99 * bp.x / max(1e-5, -bs.x));\\n float bw = min(1., .99 * bp.y / max(1e-5, -bs.y));\\n return bs * min(bt, bu) * min(bv, bw);\\n}\\nfloat bx(const in vec3 bp, const in vec3 bs, inout float by, inout float bz) {\\n float bA = (bz + by) * .5;\\n vec3 bB = bp + bs * bA;\\n float z = bb(bB.xy);\\n float ba = Z(z);\\n float bC = -1. / bB.z;\\n by = ba > bC ? by : bA;\\n bz = ba > bC ? bA : bz;\\n return bA;\\n}\\nvec4 bD(const in vec3 bp, const in float bq, in float bE, const in vec3 br, const in float j, const in float E) {\\n const int bF = 20;\\n float bG = 1. / float(bF);\\n bE *= bG;\\n vec3 bs = bo(bp, bq, br);\\n float bH = bG;\\n vec3 bI = vec3(.0, bH, 1.);\\n vec3 bB;\\n float z, ba, bC, bJ, bK, bL;\\n bool bM;\\n float bN = 1.;\\n float bA;\\n for(int bO = 0; bO < bF; bO++) {\\n bB = bp + bs * bI.y;\\n z = bb(bB.xy);\\n ba = Z(z);\\n bC = -1. / bB.z;\\n bJ = bC - ba;\\n bJ *= clamp(sign(abs(bJ) - bq * bG * bG), .0, 1.);\\n bM = abs(bJ + bE) < bE;\\n bK = clamp(bI.x / (bI.x - bJ), .0, 1.);\\n bL = bM ? bI.y + bK * bG - bG : 1.;\\n bI.z = min(bI.z, bL);\\n bI.x = bJ;\\n if(bM) {\\n float by = bI.y - bG;\\n float bz = bI.y;\\n bA = bx(bp, bs, by, bz);\\n bA = bx(bp, bs, by, bz);\\n bA = bx(bp, bs, by, bz);\\n bN = bA;\\n break;\\n }\\n bI.y += bG;\\n }\\n return vec4(bp + bs * bN, 1. - bN);\\n}\\nvec3 bP(in vec4 bQ, const in float bR, const in vec3 bS, const in vec3 bT, const in float j) {\\n vec4 bU = mix(outputFovInfo[0], outputFovInfo[1], bQ.x);\\n bQ.xyz = vec3(mix(bU.xy, bU.zw, bQ.y), 1.) * -1. / bQ.z;\\n bQ.xyz = (reprojViewProjMatrix * vec4(bQ.xyz, 1.)).xyw;\\n bQ.xy /= bQ.z;\\n float bV = clamp(6. - 6. * max(abs(bQ.x), abs(bQ.y)), .0, 1.);\\n bQ.xy = .5 + .5 * bQ.xy;\\n return vec3(bQ.xy, 1.);\\n}\\nvec3 ssr(const in vec3 bS, const in vec3 bT, const in float j, const in vec3 d, const in vec3 bg) {\\n float bW = .0;\\n vec4 f = vec4(.0);\\n float bh = j * j;\\n bh = bh * bh;\\n vec3 bX = abs(d.z) < .999 ? vec3(.0, .0, 1.) : vec3(1., .0, .0);\\n vec3 bd = normalize(cross(bX, d));\\n vec3 be = cross(d, bd);\\n float bR = ssrFactor * clamp(-4. * dot(bg, d) + 3.8, .0, 1.);\\n bR *= clamp(4.7 - j * 5., .0, 1.);\\n vec3 bp = T(projMatrix, vViewVertex.xyz);\\n bp.z = 1. / bp.z;\\n vec3 br = bc(bW, bd, be, d, bg, bh);\\n float bq = mix(cameraNearFar.y + vViewVertex.z, -vViewVertex.z - cameraNearFar.x, br.z * .5 + .5);\\n float bE = .5 * bq;\\n vec4 bQ;\\n if(dot(br, d) > .001 && bR > .0) {\\n bQ = bD(bp, bq, bE, br, j, bW);\\n if(bQ.w > .0)\\n return bP(bQ, bR, bS, bT, j);\\n \\n }\\n return vec3(.0);\\n}\\n#endif\\nconst vec3 bY = vec3(0., 0., 1.);\\nuniform mat4 viewMatrix;\\nuniform sampler2D normalTexture;\\nuniform sampler2D heightTexture;\\nuniform vec4 waveParams;\\nuniform vec2 waterDir;\\nuniform vec4 waterBaseColor;\\nuniform vec3 lightDirection;\\nuniform vec3 lightColor;\\nuniform vec3 camPos;\\nuniform float timeElapsed;\\nvarying vec2 vUv;\\nvarying vec2 vNoiseUv;\\nvarying vec3 vPos;\\nvarying mat3 vTbnMatrix;\\nfloat bZ(vec3 e, float ca) {\\n float cb = max(.015, ca);\\n return max((e.x + e.y) * .3303545 / cb + .3303545, .0);\\n}\\nconst vec2 cc = vec2(6. / 25., 5. / 24.);\\nvec2 cd(sampler2D ce, vec2 S) {\\n return 2. * texture2D(ce, S).rg - 1.;\\n}\\nfloat cf(vec2 S) {\\n return texture2D(heightTexture, S).b;\\n}\\nvec3 cg(sampler2D ce, vec2 S) {\\n return 2. * texture2D(ce, S).rgb - 1.;\\n}\\nfloat ch(vec2 S, float ci) {\\n return fract(ci);\\n}\\nfloat cj(vec2 S, float ci) {\\n float ck = ch(S, ci);\\n return 1. - abs(1. - 2. * ck);\\n}\\nvec3 cl(sampler2D cm, vec2 S, float ci, float cn) {\\n float co = waveParams[2];\\n float cp = waveParams[3];\\n vec2 cq = cd(cm, S) * co;\\n float ck = ch(S, ci + cn);\\n float cr = cj(S, ci + cn);\\n vec2 f = S;\\n f -= cq * (ck + cp);\\n f += cn;\\n f += (ci - ck) * cc;\\n return vec3(f, cr);\\n}\\nconst float cs = 7.77;\\nvec3 ct(sampler2D cu, sampler2D cv, vec2 cw, vec2 cx, float ci) {\\n float ca = waveParams[0];\\n vec2 cy = ci * -cx;\\n float cz = cf(vNoiseUv) * cs;\\n vec3 cA = cl(cv, cw + cy, ci + cz, .0);\\n vec3 cB = cl(cv, cw + cy, ci + cz, .5);\\n vec3 cC = cg(cu, cA.xy) * cA.z;\\n vec3 cD = cg(cu, cB.xy) * cB.z;\\n vec3 cE = normalize(cC + cD);\\n cE.xy *= ca;\\n cE.z = sqrt(1. - dot(cE.xy, cE.xy));\\n return cE;\\n}\\nvec4 cF(vec2 cw, float cG) {\\n float cH = waveParams[1];\\n vec3 d = ct(normalTexture, heightTexture, cw * cH, waterDir, cG);\\n float cI = bZ(d, waveParams[0]);\\n return vec4(d, cI);\\n}\\nconst float cJ = 3.141592653589793;\\nconst float cK = 1. / cJ;\\nconst float cL = .3183098861837907;\\nconst float cM = 1.570796326794897;\\nconst float cN = .4;\\nfloat cO = 2.2;\\nvec3 cP(float cQ, vec3 cR, float l) {\\n return cR + (l - cR) * pow(1. - cQ, 5.);\\n}\\nfloat cS(float cT, float j) {\\n float cU = j * j;\\n float cV = cT * cT;\\n float cW = pow((cV * (cU - 1.) + 1.), cO) * cJ;\\n return cU / cW;\\n}\\nfloat cX(float cY) {\\n return .25 / (cY * cY);\\n}\\nvec3 cZ(const vec3 x) {\\n return (x * (2.51 * x + .03)) / (x * (2.43 * x + .59) + .14);\\n}\\nconst float da = 2.2;\\nconst float db = .4545454545;\\nvec4 dc(vec4 u) {\\n return vec4(pow(u.rgb, vec3(db)), u.w);\\n}\\nvec3 dd(vec3 u) {\\n return pow(u, vec3(da));\\n}\\nconst vec3 de = vec3(.02, 1., 5.);\\nconst vec2 df = vec2(.02, .1);\\nconst float j = .06;\\nconst float dg = 1.7;\\nconst vec3 dh = vec3(0, .6, .9);\\nconst vec3 di = vec3(.72, .92, 1.);\\nconst float dj = .65;\\nconst float dk = 300000.0;\\nconst float dl = 500000.0;\\nconst float dm = .775;\\nconst float dn = .8;\\nPBRShadingWater dp;\\nvec3 dq(in PBRShadingWater dr, float j, vec3 ds, float dt) {\\n vec3 du = cP(dr.VdotH, ds, dt);\\n float dv = cS(dr.NdotH, j);\\n float dw = cX(dr.LdotH);\\n float dx = mix(j + .045, j + .385, 1. - dr.VdotH);\\n float dy = 1.2;\\n float dz = cS(dr.NdotH, dx) * dy;\\n return ((dv + dz) * dw) * du;\\n}\\nvec3 dA(float dg, float dB, vec3 dh, float dC) {\\n return dg * (.075 * dh * pow(dB, 4.) + 50. * pow(dB, 23.)) * dC;\\n}\\nvec3 dD(in float bk, in vec3 dE, in vec3 dF) {\\n float dG = pow((1. - bk), de[2]);\\n return mix(dF, dE, dG);\\n}\\nvec3 dH(in vec3 e, in vec3 dI, in float dJ, in float j) {\\n \\n#ifdef HAS_IBL_LIGHTING\\nvec3 dK = reflect(-dI, e);\\n vec3 dL = textureCube(prefilterMap, environmentTransform * dK).rgb;\\n float dM = clamp(1. + dot(dK, e), .0, 1.);\\n dL *= dM * dM;\\n vec3 i = dL;\\n vec3 dN = c(e);\\n float l = clamp(50.0 * waterBaseColor.g, .0, 1.);\\n vec3 dO = h(waterBaseColor.rgb, j, dot(e, dI), l);\\n return i * dO + dN;\\n#else\\nvec3 dP = dd(di);\\n vec3 dQ = dd(dh);\\n vec3 di = dD(dJ, dP, dQ);\\n return di;\\n#endif\\n}\\nvec3 dR(in vec3 e, in vec3 dI, in vec3 dS, vec3 u, in vec3 dT, in vec3 dU, in float dV, float dW, vec3 dX) {\\n float dY = 0.;\\n vec3 dZ = dd(u);\\n vec3 bm = normalize(dS + dI);\\n dp.NdotL = clamp(dot(e, dS), .0, 1.);\\n dp.NdotV = clamp(dot(e, dI), .001, 1.);\\n dp.VdotN = clamp(dot(dI, e), .001, 1.);\\n dp.NdotH = clamp(dot(e, bm), .0, 1.);\\n dp.VdotH = clamp(dot(dI, bm), .0, 1.);\\n dp.LdotH = clamp(dot(dS, bm), .0, 1.);\\n float dJ = max(dot(dU, dI), .0);\\n vec3 di = dH(e, dI, dJ, j);\\n float ea = max(dot(dU, dS), .0);\\n float eb = .1 + ea * .9;\\n di *= eb;\\n float ec = clamp(dV, .8, 1.);\\n vec3 ed = cP(dp.VdotN, vec3(de[0]), de[1]);\\n vec3 ee = ed * di * ec;\\n vec3 ef = dZ * mix(di, ea * dT * cK, 2. / 3.) * ec;\\n vec3 i = vec3(.0);\\n if(dJ > .0 && ea > .0) {\\n vec3 eg = dq(dp, j, vec3(df[0]), df[1]);\\n vec3 eh = dT * cK * dV;\\n i = dp.NdotL * eh * eg;\\n }\\n vec3 cI = vec3(.0);\\n if(dJ > .0) {\\n cI = dA(dg, dW, dh, eb);\\n }\\n vec3 ei = vec3(.0);\\n#ifdef HAS_SSR\\nfloat ej = smoothstep(dl, dk, -dX.z);\\n mat4 ek = viewMatrix;\\n vec4 el = vec4(dX.xyz, 1.);\\n vec3 em = normalize(el.xyz);\\n vec4 en = ek * vec4(e, .0);\\n vec3 eo = normalize(en.xyz);\\n vec4 ep = ek * vec4(dU, .0);\\n float eq = pow(max(dot(-em, ep.xyz), .0), cN);\\n vec3 er = mix(ep.xyz, eo, eq);\\n vec3 es = ssr(vec3(.0), vec3(1.), j, normalize(er), -normalize(vViewVertex.xyz));\\n if(es.z > .0) {\\n vec2 et = smoothstep(.3, .6, abs(vec2(.5) - es.xy));\\n dY = dm * clamp(1. - 1.3 * et.y, .0, 1.) * ej;\\n vec3 eu = X(.0, es.xy);\\n ei = dd(eu) * dY * ed.y * dj;\\n }\\n#endif\\nfloat ev = mix(dn, dn * .5, dY);\\n return cZ((1. - dY) * ee + ei + ef * ev + i + cI);\\n}\\nvoid main() {\\n vec3 dU = bY;\\n vec4 ew = cF(vUv, timeElapsed);\\n vec3 e = normalize(vTbnMatrix * ew.xyz);\\n vec3 dI = -normalize(vPos - camPos);\\n vec3 dS = normalize(-lightDirection);\\n#if defined(HAS_SHADOWING)\\nfloat dV = shadow_computeShadow();\\n#else\\nfloat dV = 1.;\\n#endif\\nvec4 ex = viewMatrix * vec4(vPos, 1.);\\n vec4 ey = vec4(dR(e, dI, dS, waterBaseColor.rgb, lightColor, dU, dV, ew.w, ex.xyz), waterBaseColor.a);\\n gl_FragColor = dc(ey);\\n if(contrast != 1.) {\\n gl_FragColor = contrastMatrix(contrast) * gl_FragColor;\\n }\\n if(length(hsv) > .0) {\\n gl_FragColor = hsv_apply(gl_FragColor, hsv);\\n }\\n gl_FragColor = highlight_blendColor(gl_FragColor) * layerOpacity;\\n}\", defines: r, uniforms: i, extraCommandProps: h });} }, { key: \"getUniformValues\", value: function getUniformValues(e) {return { projViewMatrix: e.projViewMatrix, minAltitude: this.layer.options.altitude || 0 };} }, { key: \"_getWaterUniform\", value: function _getWaterUniform(e, t) {var _this$getIBLRes3 = this.getIBLRes(),n = _this$getIBLRes3.iblTexes,i = _this$getIBLRes3.dfgLUT,r = mo(e, n, i, t && t.ssr, t && t.jitter),s = e.getLightManager();var o = s && s.getDirectionalLight() || {};var a = s && s.getAmbientLight() || {},l = this.getSymbol(_o),h = this._waterDir = this._waterDir || [],u = this._waveParams = this._waveParams || [];_gl.vec4.set(u, .09, l.uvScale || 3, .03, -.5);Se(r, { ambientColor: a.color || [.2, .2, .2], viewMatrix: e.viewMatrix, lightDirection: o.direction || yo.direction, lightColor: o.color || yo.color, camPos: e.cameraPosition, timeElapsed: l.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (l.waterSpeed || 1) * 1e4) : 0, normalTexture: this._normalTex || this._emptyTex, heightTexture: this._pertTex || this._emptyTex, waveParams: u, waterDir: To(h, l.waterDirection || 0), waterBaseColor: l.waterBaseColor || [.1451, .2588, .4863, 1], contrast: l.contrast || 1, hsv: l.hsv || vo });var f = this.layer.getRenderer();return r.layerOpacity = f._getLayerOpacity(), this.setIncludeUniformValues(r, t), t && t.ssr && t.ssr.renderUniforms && Se(r, t.ssr.renderUniforms), r;} }, { key: \"delete\", value: function _delete() {_superPropGet(Ao, \"delete\", this, 3)([]), this._emptyTex && (this._emptyTex.destroy(), delete this._emptyTex), this._normalTex && this._normalTex.destroy(), this._pertTex && this._pertTex.destroy(), this.shader && (this.shader.dispose(), delete this.shader), this._waterShader && this._waterShader.dispose(), this._water && (this._water.geometry.dispose(), this._water.material && this._water.material.dispose(), this._water.dispose(), delete this._water), this.disposeIBLTextures();} }, { key: \"createGround\", value: function createGround() {var e = new _gl.reshader.Plane();e.data.aTexCoord = new Uint8Array([0, 1, 1, 1, 0, 0, 1, 0]), e.generateBuffers(this.renderer.regl), this._water = new _gl.reshader.Mesh(e, null, { castShadow: !1 }), this._waterScene = new _gl.reshader.Scene([this._water]);} }, { key: \"transformWater\", value: function transformWater() {var e = this.getMap(),t = _gl.GroundPainter.getGroundTransform(this._water.localTransform, e);this._water.setLocalTransform(t);var n = e._get2DExtentAtRes(e.getGLRes()),i = n.getWidth(),r = n.getHeight(),s = e.cameraLookAt,o = s[0] - i,a = s[1] + r,h = o / bo[0],c = a / bo[1],u = h % 1,f = c % 1,d = h * xo % 1,p = c * xo % 1,g = i / bo[0] * 2,m = r / bo[1] * 2;this._water.setUniform(\"uvOffset\", [u, f]), this._water.setUniform(\"noiseUvOffset\", [d, p]), this._water.setUniform(\"uvScale\", [g, -m]);} }]);}(gn);function To(e, t) {var n;return n = t, t = Math.PI * n / 180, e[0] = Math.sin(t), e[1] = Math.cos(t), e;}var wo = \"#define SHADER_NAME BILL_BOARD\\n#include \\n#ifdef HAS_ALTITUDE\\nattribute vec2 aPosition;\\nattribute float aAltitude;\\n#else\\nattribute vec3 aPosition;\\n#endif\\nattribute vec2 aExtrude;\\nattribute vec2 aTexCoord;\\nattribute vec4 aQuat;\\nvarying vec2 vTexCoord;\\nuniform mat4 positionMatrix;\\nuniform mat4 projViewModelMatrix;\\nuniform float extrudeScale;\\n#ifdef PICKING_MODE\\n#include \\n#endif\\n#include \\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\n#include \\n#endif\\nmat4 c(vec4 q) {\\n float x = q.x, y = q.y, z = q.z, w = q.w;\\n float d = x * x, e = y * y, f = z * z;\\n float xy = x * y, xz = x * z, yz = y * z;\\n float wx = w * x, wy = w * y, wz = w * z;\\n return mat4(1. - 2. * (e + f), 2. * (xy + wz), 2. * (xz - wy), .0, 2. * (xy - wz), 1. - 2. * (d + f), 2. * (yz + wx), .0, 2. * (xz + wy), 2. * (yz - wx), 1. - 2. * (d + e), .0, .0, .0, .0, 1.);\\n}\\nvoid main() {\\n vec4 h = vec4(aExtrude.x * extrudeScale, .0, aExtrude.y, 1.);\\n mat4 i = c(aQuat);\\n vec3 j = (i * h).xyz;\\n vec3 k = unpackVTPosition(j);\\n vTexCoord = aTexCoord;\\n gl_Position = projViewModelMatrix * positionMatrix * vec4(k, 1.);\\n#ifdef PICKING_MODE\\nfbo_picking_setData(gl_Position.w, true);\\n#elif defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nshadow_computeShadowPars(vec4(k, 1.));\\n#endif\\n}\";function So(e, t, n) {n = n || {}, this.w = e || 64, this.h = t || 64, this.autoResize = !!n.autoResize, this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;}function Mo(e, t, n) {this.x = 0, this.y = e, this.w = this.free = t, this.h = n;}function Po(e, t, n, i, r, s, o) {this.id = e, this.x = t, this.y = n, this.w = i, this.h = r, this.maxw = s || i, this.maxh = o || r, this.refcount = 0;}function Io(e, _ref122, i, r) {var t = _ref122.width,n = _ref122.height;if (r) {if (r.length !== t * n * i) throw new RangeError(\"mismatched image size\");} else r = new Uint8Array(t * n * i);return e.width = t, e.height = n, e.data = r, e;}function Co(e, t, n, i, r, s) {if (0 === r.width || 0 === r.height) return t;if (r.width > e.width || r.height > e.height || n.x > e.width - r.width || n.y > e.height - r.height) throw new RangeError(\"out of range source coordinates for image copy\");if (r.width > t.width || r.height > t.height || i.x > t.width - r.width || i.y > t.height - r.height) throw new RangeError(\"out of range destination coordinates for image copy\");var o = e.data,a = t.data;if (o === a) return t;for (var _l51 = 0; _l51 < r.height; _l51++) {var _h35 = ((n.y + _l51) * e.width + n.x) * s,_c25 = ((i.y + _l51) * t.width + i.x) * s;for (var _e424 = 0; _e424 < r.width * s; _e424++) a[_c25 + _e424] = o[_h35 + _e424];}return t;}So.prototype.pack = function (e, t) {e = [].concat(e), t = t || {};for (var n, i, r, s, o = [], a = 0; a < e.length; a++) if (n = e[a].w || e[a].width, i = e[a].h || e[a].height, r = e[a].id, n && i) {if (!(s = this.packOne(n, i, r))) continue;t.inPlace && (e[a].x = s.x, e[a].y = s.y, e[a].id = s.id), o.push(s);}return this.shrink(), o;}, So.prototype.packOne = function (e, t, n) {var i,r,s,o,a,l,h,c,u = { freebin: -1, shelf: -1, waste: 1 / 0 },f = 0;if (\"string\" == typeof n || \"number\" == typeof n) {if (i = this.getBin(n)) return this.ref(i), i;\"number\" == typeof n && (this.maxId = Math.max(n, this.maxId));} else n = ++this.maxId;for (o = 0; o < this.freebins.length; o++) {if (t === (i = this.freebins[o]).maxh && e === i.maxw) return this.allocFreebin(o, e, t, n);t > i.maxh || e > i.maxw || t <= i.maxh && e <= i.maxw && (s = i.maxw * i.maxh - e * t) < u.waste && (u.waste = s, u.freebin = o);}for (o = 0; o < this.shelves.length; o++) if (f += (r = this.shelves[o]).h, !(e > r.free)) {if (t === r.h) return this.allocShelf(o, e, t, n);t > r.h || t < r.h && (s = (r.h - t) * e) < u.waste && (u.freebin = -1, u.waste = s, u.shelf = o);}return -1 !== u.freebin ? this.allocFreebin(u.freebin, e, t, n) : -1 !== u.shelf ? this.allocShelf(u.shelf, e, t, n) : t <= this.h - f && e <= this.w ? (r = new Mo(f, this.w, t), this.allocShelf(this.shelves.push(r) - 1, e, t, n)) : this.autoResize ? (a = l = this.h, ((h = c = this.w) <= a || e > h) && (c = 2 * Math.max(e, h)), (a < h || t > a) && (l = 2 * Math.max(t, a)), this.resize(c, l), this.packOne(e, t, n)) : null;}, So.prototype.allocFreebin = function (e, t, n, i) {var r = this.freebins.splice(e, 1)[0];return r.id = i, r.w = t, r.h = n, r.refcount = 0, this.bins[i] = r, this.ref(r), r;}, So.prototype.allocShelf = function (e, t, n, i) {var r = this.shelves[e].alloc(t, n, i);return this.bins[i] = r, this.ref(r), r;}, So.prototype.shrink = function () {if (this.shelves.length > 0) {for (var e = 0, t = 0, n = 0; n < this.shelves.length; n++) {var i = this.shelves[n];t += i.h, e = Math.max(i.w - i.free, e);}this.resize(e, t);}}, So.prototype.getBin = function (e) {return this.bins[e];}, So.prototype.ref = function (e) {if (1 == ++e.refcount) {var t = e.h;this.stats[t] = 1 + (0 | this.stats[t]);}return e.refcount;}, So.prototype.unref = function (e) {return 0 === e.refcount ? 0 : (0 == --e.refcount && (this.stats[e.h]--, delete this.bins[e.id], this.freebins.push(e)), e.refcount);}, So.prototype.clear = function () {this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;}, So.prototype.resize = function (e, t) {this.w = e, this.h = t;for (var n = 0; n < this.shelves.length; n++) this.shelves[n].resize(e);return !0;}, Mo.prototype.alloc = function (e, t, n) {if (e > this.free || t > this.h) return null;var i = this.x;return this.x += e, this.free -= e, new Po(n, i, this.y, e, t, e, this.h);}, Mo.prototype.resize = function (e) {return this.free += e - this.w, this.w = e, !0;};var ko = function () {function ko(e, t) {_classCallCheck(this, ko);Io(this, e, 4, t);}return _createClass(ko, [{ key: \"resize\", value: function resize(e) {!function (e, _ref123, i) {var t = _ref123.width,n = _ref123.height;if (t === e.width && n === e.height) return;var r = Io({}, { width: t, height: n }, i);Co(e, r, { x: 0, y: 0 }, { x: 0, y: 0 }, { width: Math.min(e.width, t), height: Math.min(e.height, n) }, i), e.width = t, e.height = n, e.data = r.data;}(this, e, 4);} }, { key: \"clone\", value: function clone() {return new ko({ width: this.width, height: this.height }, new Uint8Array(this.data));} }], [{ key: \"copy\", value: function copy(e, t, n, i, r) {Co(e, t, n, i, r, 4);} }]);}();var Fo = new e.Point(0, 0),Oo = [],Ro = [],Eo = document.createElement(\"canvas\");var Do = exports.BillBoardPainter = function (_gn8) {function Do() {var _this83;_classCallCheck(this, Do);for (var _len15 = arguments.length, e = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {e[_key15] = arguments[_key15];}_this83 = _callSuper(this, Do, [].concat(e)), _this83._ready = !0;var t = _this83.getSymbolDef({ index: 0 }),n = B(t && t.source);if (_this83._ready = !n, (0, _functionType.isFunctionDefinition)(t.width) ? _this83._widthFn = (0, _functionType.interpolated)(t.width) : _this83._width = t.width, (0, _functionType.isFunctionDefinition)(t.height) ? _this83._heightFn = (0, _functionType.interpolated)(t.height) : _this83._height = t.height, (0, _functionType.isFunctionDefinition)(t.rotationX) ? _this83._rotationXFn = (0, _functionType.interpolated)(t.rotationX) : _this83._rotationX = t.rotationX, (0, _functionType.isFunctionDefinition)(t.rotationY) ? _this83._rotationYFn = (0, _functionType.interpolated)(t.rotationY) : _this83._rotationY = t.rotationY, (0, _functionType.isFunctionDefinition)(t.rotationZ) ? _this83._rotationZFn = (0, _functionType.interpolated)(t.rotationZ) : _this83._rotationZ = t.rotationZ, n) {var _e425 = _this83._image = new Image();_e425.onload = function () {_this83._ready = !0;}, _e425.src = t.source;}return _this83;}_inherits(Do, _gn8);return _createClass(Do, [{ key: \"needToRedraw\", value: function needToRedraw() {var e = this.getSymbolDef({ index: 0 });if (!e || !j(e.source)) return _superPropGet(Do, \"needToRedraw\", this, 3)([]);var t = this.layer.getRenderer().getCurrentTiles();if (!t || bt(t)) return _superPropGet(Do, \"needToRedraw\", this, 3)([]);return this._checkIfSourceUpdated() || _superPropGet(Do, \"needToRedraw\", this, 3)([]);} }, { key: \"_checkIfSourceUpdated\", value: function _checkIfSourceUpdated() {var e = !1;var t = this.layer.getRenderer(),n = t.getCurrentTiles(),i = this.getSymbolDef({ index: 0 }).source,r = t.tileCache,s = [];for (var _t374 in n) {var _n260 = r.get(_t374);if (!(_n260 && _n260.image && _n260.image.cache && _n260.image.cache[0])) continue;var _o88 = _n260.image.cache[0].geometry;if (!_o88 || !_o88[0] || !_o88[0].geometry) continue;_o88 = _o88[0].geometry.properties.billGeometry;var _o88$properties = _o88.properties,_a60 = _o88$properties.oldPickingId,_l52 = _o88$properties.contextCache,_h36 = _o88$properties.textureCache,_c26 = _o88$properties.features,_u21 = _o88$properties.billTexture;if (!_a60 || !_a60.length) continue;var _f18 = !1,_d13 = !1;var _p7 = _a60.length;for (var _t375 = 0; _t375 < _p7; _t375++) {var _n261 = _a60[_t375],_r150 = _l52[_n261] = _l52[_n261] || {},_o89 = _c26[_n261] && _c26[_n261].feature;if (!_o89) continue;var _u22 = _h36[_n261];var _p8 = 0,_g8 = 0;_u22 && (_p8 = _u22.width, _g8 = _u22.height);var _m9 = void 0,_y8 = i(_r150, _o89.properties);_y8.redraw ? (_f18 = e = !0, _m9 = _h36[_n261] = _y8.data, _p8 === _m9.width && _g8 === _m9.height || (_d13 = !0)) : _m9 = _h36[_n261], s.push({ id: _n261, w: _m9.width, h: _m9.height });}if (_f18) {var _e426 = _d13 ? _o88.properties.aTexCoord : null,_t376 = this._fillFnTextureData(_e426, _o88, s);_u21({ width: _t376.width, height: _t376.height, data: _t376.data, format: _t376.format, mag: \"linear\", min: \"linear\", flipY: !1, premultiplyAlpha: !0 }), _d13 && _o88.updateData(\"aTexCoord\", _o88.properties.aTexCoord);}}return e;} }, { key: \"isTerrainSkin\", value: function isTerrainSkin() {return !1;} }, { key: \"isTerrainVector\", value: function isTerrainVector() {return this.layer.options.awareOfTerrain;} }, { key: \"isUniqueStencilRefPerTile\", value: function isUniqueStencilRefPerTile() {return !1;} }, { key: \"createMesh\", value: function createMesh(e, t, _ref124) {var n = _ref124.tilePoint;if (!this._ready) return null;var i = e.geometry;var _i$properties = i.properties,r = _i$properties.features,o = _i$properties.tileResolution,a = _i$properties.tileRatio;if (!i.data.aPosition || 0 === i.data.aPosition.length) return null;var l = this._createBillboard(i, i.desc.positionSize, r);l.generateBuffers(this.regl), i.properties.billGeometry = l;var h = new _gl.reshader.Material({ texture: l.properties.billTexture }),c = new _gl.reshader.Mesh(l, h, { castShadow: !1, picking: !0 }),u = this.getMap();Fo.set(n[0], n[1]);var f = u.altitudeToPoint(1, o) * a;c.setUniform(\"extrudeScale\", f / 100);var d = [];c.setFunctionUniform(\"textureSize\", function () {var e = l.properties.billTexture;return d[0] = e.width, d[1] = e.height, d;});var p = {};return c.geometry.data.aAltitude && (p.HAS_ALTITUDE = 1), c.setDefines(p), c.positionMatrix = this.getAltitudeOffsetMatrix(), c.setLocalTransform(t), c.properties.symbolIndex = { index: 0 }, c;} }, { key: \"_createBillboard\", value: function _createBillboard(e, t, n) {var i = e.properties.z,_e$data7 = e.data,r = _e$data7.aPosition,o = _e$data7.aPickingId,a = e.properties;a.oldPickingId = o;var l = a.contextCache = [],h = a.textureCache = [],c = o.length,u = 6 * c,f = new r.constructor(u * t),d = new Int16Array(2 * u),p = new Float32Array(4 * u),g = new o.constructor(u),m = this.getSymbolDef({ index: 0 }).source,y = [];for (var _e427 = 0; _e427 < c; _e427++) {var _n262 = r.subarray(_e427 * t, (_e427 + 1) * t),_i186 = o[_e427];f.set(_n262, 6 * _e427 * t), f.set(_n262, (6 * _e427 + 1) * t), f.set(_n262, (6 * _e427 + 2) * t), f.set(_n262, (6 * _e427 + 3) * t), f.set(_n262, (6 * _e427 + 4) * t), f.set(_n262, (6 * _e427 + 5) * t), g[6 * _e427] = _i186, g[6 * _e427 + 1] = _i186, g[6 * _e427 + 2] = _i186, g[6 * _e427 + 3] = _i186, g[6 * _e427 + 4] = _i186, g[6 * _e427 + 5] = _i186;}var x = j(m);for (var _e428 = 0; _e428 < c; _e428++) {var _t377 = o[_e428],_r151 = n[_t377];var _s122 = void 0;if (x) {_s122 = m(l[_t377] = l[_t377] || {}, _r151 && _r151.feature && _r151.feature.properties).data, h[_t377] = _s122, y.push({ id: _t377, w: _s122.width, h: _s122.height });} else _s122 = this._image;this._fillExtrude(d, _e428, _r151, i), this._fillQuat(p, _e428, _r151, i);}var _ = new Int16Array(2 * u);if (y.length) {var _t378 = this._fillFnTextureData(_, e, y);a.billTexture = yn(this.regl, _t378, !1, !1);} else {var _e429 = { x: 0, y: 0, w: this._image.width, h: this._image.height };for (var _t379 = 0; _t379 < c; _t379++) this._fillTexCoord(_, _t379, _e429, 1);var _t380 = this._image;a.billTexture = this.regl.texture({ width: _t380.width, height: _t380.height, data: _t380 });}var v = 6 * c < 65536 ? Uint16Array : Uint32Array;var b = [];for (var _e430 = 0; _e430 < c; _e430++) {var _t381 = 6 * _e430;b.push(_t381, _t381 + 1, _t381 + 2), b.push(_t381 + 3, _t381 + 4, _t381 + 5);}var A = { aPosition: f, aPickingId: g, aExtrude: d, aQuat: p, aTexCoord: _ },_e$properties4 = e.properties,T = _e$properties4.feaPickingIdMap,w = _e$properties4.aFeaIds,S = new w.constructor(u);for (var _e431 = 0; _e431 < g.length; _e431++) S[_e431] = T[g[_e431]];a.aFeaIds = S, a.aTexCoord = _;var M = new _gl.reshader.Geometry(A, new v(b), 0, { positionSize: t });return M.properties = e.properties, M;} }, { key: \"_fillQuat\", value: function _fillQuat(e, t, n, i) {var r = this._rotationX || 0,s = this._rotationY || 0,o = this._rotationZ || 0;var a = n && n.feature && n.feature.properties;this._rotationXFn && (r = this._rotationXFn(i, a)), this._rotationYFn && (s = this._rotationYFn(i, a)), this._rotationZFn && (o = this._rotationZFn(i, a)), _gl.quat.fromEuler(Ro, r, s, -o);for (var _n263 = 0; _n263 < 6; _n263++) e.set(Ro, 4 * (t + _n263));} }, { key: \"_fillExtrude\", value: function _fillExtrude(e, t, n, i) {var r = this._width || 0,s = this._height || 0;var o = n && n.feature && n.feature.properties;this._widthFn && (r = this._widthFn(i, o)), this._heightFn && (s = this._heightFn(i, o));var a = r / 2 * 100,l = s / 2 * 100;Oo[0] = -a, Oo[1] = -l, e.set(Oo, 2 * t), Oo[0] = a, Oo[1] = l, e.set(Oo, 2 * t + 2), Oo[0] = -a, Oo[1] = l, e.set(Oo, 2 * t + 4), Oo[0] = -a, Oo[1] = -l, e.set(Oo, 2 * t + 6), Oo[0] = a, Oo[1] = -l, e.set(Oo, 2 * t + 8), Oo[0] = a, Oo[1] = l, e.set(Oo, 2 * t + 10);} }, { key: \"_fillFnTextureData\", value: function _fillFnTextureData(e, t, n) {var i = t.properties,r = i.textureCache,s = i.oldPickingId,o = s.length,a = new So(0, 0, { autoResize: !0 }),l = Eo.getContext(\"2d\");a.pack(n, { inPlace: !0 });var h = this.sceneConfig.textureLimit || 1024;var c = 1;a.w * a.h > h * h && (c = Math.sqrt(h * h / (a.w * a.h)), a.resize(Math.floor(a.w * c), Math.floor(a.h * c)));var u = new ko({ width: a.w, height: a.h });for (var _t382 = 0; _t382 < o; _t382++) {var _i187 = n[_t382];e && this._fillTexCoord(e, _t382, _i187, c);var _s123 = r[_i187.id];if (!_s123) continue;var _o90 = Math.floor(_i187.w * c),_a61 = Math.floor(_i187.h * c);Eo.width = _o90, Eo.height = _a61, l.drawImage(_s123, 0, 0, _o90, _a61);var _h37 = l.getImageData(0, 0, _o90, _a61);ko.copy(_h37, u, { x: 0, y: 0 }, { x: Math.floor(_i187.x * c), y: Math.floor(_i187.y * c) }, { width: _o90, height: _a61 });}return u.format = \"rgba\", u;} }, { key: \"_fillTexCoord\", value: function _fillTexCoord(e, t, n, i) {var r = n.x,s = n.y,o = n.w,a = n.h,l = Math.floor(r * i),h = Math.floor((r + o) * i),c = Math.floor(s * i),u = Math.floor((s + a) * i);Oo[0] = l, Oo[1] = u, e.set(Oo, 2 * t), Oo[0] = h, Oo[1] = c, e.set(Oo, 2 * t + 2), Oo[0] = l, Oo[1] = c, e.set(Oo, 2 * t + 4), Oo[0] = l, Oo[1] = u, e.set(Oo, 2 * t + 6), Oo[0] = h, Oo[1] = u, e.set(Oo, 2 * t + 8), Oo[0] = h, Oo[1] = c, e.set(Oo, 2 * t + 10);} }, { key: \"init\", value: function init() {var _this84 = this;var e = this.regl;this.renderer = new _gl.reshader.Renderer(e);var t = [],n = { vert: wo, frag: \"#define SHADER_NAME BILL_BOARD\\nprecision mediump float;\\nuniform sampler2D texture;\\nuniform vec2 textureSize;\\nvarying vec2 vTexCoord;\\nvoid main() {\\n gl_FragColor = texture2D(texture, vTexCoord / textureSize);\\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\\nfloat c = shadow_computeShadow();\\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, c);\\n#endif\\n}\", uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(e, n) {return _gl.mat4.multiply(t, n.projViewMatrix, n.modelMatrix), t;} }], defines: null, extraCommandProps: { viewport: { x: 0, y: 0, width: function width() {return _this84.canvas ? _this84.canvas.width : 1;}, height: function height() {return _this84.canvas ? _this84.canvas.height : 1;} }, depth: { enable: !0, range: this.sceneConfig.depthRange || [0, 1], func: this.sceneConfig.depthFunc || \"<=\" }, blend: { enable: !0, func: this.getBlendFunc(), equation: \"add\" }, cull: { enable: !1 } } };if (this.shader = new _gl.reshader.MeshShader(n), this.shader.version = 300, this.pickingFBO) {var _e432 = [];this.picking = [new _gl.reshader.FBORayPicking(this.renderer, { vert: \"#define PICKING_MODE 1\\n\" + wo, uniforms: [{ name: \"projViewModelMatrix\", type: \"function\", fn: function fn(t, n) {return _gl.mat4.multiply(_e432, n.projViewMatrix, n.modelMatrix), _e432;} }], extraCommandProps: { viewport: this.pickingViewport, depth: { enable: !0, range: this.sceneConfig.depthRange || [0, 1], func: this.sceneConfig.depthFunc || \"<=\" }, cull: { enable: !1 } } }, this.pickingFBO, this.getMap())];}} }, { key: \"getUniformValues\", value: function getUniformValues(e) {return { projViewMatrix: e.projViewMatrix };} }, { key: \"deleteMesh\", value: function deleteMesh(e, t) {if (Array.isArray(e)) for (var _t383 = 0; _t383 < e.length; _t383++) {var _n264 = e[_t383];if (_n264.geometry) {var _e433 = _n264.geometry.properties;_e433.textureCache && (delete _e433.billTexture, delete _e433.textureCache, delete _e433.contextCache);}} else if (e.geometry) {var _t384 = e.geometry.properties;_t384.textureCache && (delete _t384.billTexture, delete _t384.textureCache, delete _t384.contextCache);}return _superPropGet(Do, \"deleteMesh\", this, 3)([e, t]);} }]);}(gn);var Lo = exports.FillPlugin = vt(\"fill\", Cn);Lo.registerAt(ht);var Ho = exports.LinePlugin = vt(\"line\", Rn);Ho.registerAt(ht);var No = exports.LineGradientPlugin = vt(\"line-gradient\", jn);No.registerAt(ht);var zo = exports.IconPlugin = vt(\"icon\", Pr);zo.registerAt(ht);var Vo = exports.TextPlugin = vt(\"text\", xs);Vo.registerAt(ht);var Uo = exports.NativeLinePlugin = vt(\"native-line\", Ms);Uo.registerAt(ht);vt(\"native-point\", Ts).registerAt(ht);var Bo = exports.PhongPlugin = vt(\"phong\", Vs);Bo.registerAt(ht);var Go = exports.WireframePlugin = vt(\"wireframe\", Bs);Go.registerAt(ht);var jo = exports.LitPlugin = vt(\"lit\", js);jo.registerAt(ht);var Wo = exports.TubePlugin = vt(\"tube\", Zs);Wo.registerAt(ht);var Xo = exports.GLTFPhongPlugin = vt(\"gltf-phong\", po);Xo.registerAt(ht);var Yo = exports.GLTFStandardPlugin = vt(\"gltf-lit\", go);Yo.registerAt(ht);var Zo = exports.HeatmapPlugin = vt(\"heatmap\", function (_gn9) {function _class10() {_classCallCheck(this, _class10);return _callSuper(this, _class10, arguments);}_inherits(_class10, _gn9);return _createClass(_class10, [{ key: \"createFnTypeConfig\", value: function createFnTypeConfig(e, t) {var n = (0, _functionType.interpolated)(t.heatmapWeight),i = new Int16Array(1);return [{ attrName: \"aWeight\", symbolName: \"heatmapWeight\", type: Int16Array, width: 1, define: \"HAS_HEAT_WEIGHT\", evaluate: function evaluate(t) {var r = n(e.getZoom(), t);return i[0] = 255 * r, i[0];} }];} }, { key: \"createMesh\", value: function createMesh(e, t) {var n = e.geometry,i = e.symbolIndex,r = e.ref;if (void 0 === r) {St(n, this.getSymbolDef(i), this.getFnTypeConfig(i), this.layer);}var o = this.getSymbol(i),a = { tileRatio: n.properties.tileRatio, dataResolution: n.properties.tileResolution };ke(a, \"heatmapIntensity\", o, \"heatmapIntensity\", 1), ke(a, \"heatmapRadius\", o, \"heatmapRadius\", 6), ke(a, \"heatmapWeight\", o, \"heatmapWeight\", 1), ke(a, \"heatmapOpacity\", o, \"heatmapOpacity\", 1), n.generateBuffers(this.regl);var l = new _gl.reshader.Material(a),h = new _gl.reshader.Mesh(n, l, { transparent: !0, castShadow: !1, picking: !0 }),c = {};return n.data.aWeight && (c.HAS_HEAT_WEIGHT = 1), h.setDefines(c), h.setLocalTransform(t), h.properties.symbolIndex = i, h;} }, { key: \"callRenderer\", value: function callRenderer(e, t, n) {var i = this.getRenderFBO(n);this._drawCount += this._process.render(this.scene, t, i);} }, { key: \"getUniformValues\", value: function getUniformValues(e) {var t = this.getSymbol({ index: 0 }),n = e.projViewMatrix;return { glScale: 1 / e.getGLScale(), resolution: e.getResolution(), projViewMatrix: n, heatmapOpacity: t.heatmapOpacity };} }, { key: \"getHeatmapMeshes\", value: function getHeatmapMeshes() {return this.scene.getMeshes();} }, { key: \"delete\", value: function _delete() {_superPropGet(_class10, \"delete\", this, 3)(arguments), this._process.dispose(), delete this._process;} }, { key: \"init\", value: function init() {var e = this.regl;this.renderer = new _gl.reshader.Renderer(e);var t = this.getPolygonOffset(),n = this.getSymbols()[0];this._process = new _gl.HeatmapProcess(this.regl, this.sceneConfig, this.layer, n.heatmapColor, null, t);} }]);}(gn));Zo.registerAt(ht);var qo = exports.WaterPlugin = vt(\"water\", Ao);qo.registerAt(ht);var $o = exports.BillBoardPlugin = vt(\"billboard\", Do);$o.registerAt(ht), mt.registerPainter(\"lit\", js), mt.registerPainter(\"icon\", Pr), mt.registerPainter(\"fill\", Cn), mt.registerPainter(\"line\", Rn), mt.registerPainter(\"line-gradient\", jn), mt.registerPainter(\"water\", Ao), mt.registerPainter(\"tube\", Zs), mt.registerPainter(\"billboard\", Do);var Jo = exports.MapboxVectorTileLayer = function (_ht) {function Jo() {_classCallCheck(this, Jo);return _callSuper(this, Jo, arguments);}_inherits(Jo, _ht);return _createClass(Jo, [{ key: \"getTileUrl\", value: function getTileUrl(e, t, n) {var i = this.getMap().getResolution(n);return _superPropGet(Jo, \"getTileUrl\", this, 3)([e, t, function (e) {return 19 - Math.log(e / Ko) / Math.LN2;}(i)]);} }], [{ key: \"fromJSON\", value: function fromJSON(e) {return e && \"MapboxVectorTileLayer\" === e.type ? new Jo(e.id, e.options) : null;} }]);}(ht);Jo.registerJSONType(\"MapboxVectorTileLayer\");var Ko = 12756274 * Math.PI / (256 * Math.pow(2, 20));var Qo = exports.GeoJSONVectorTileLayer = function (_ht2) {function Qo(e, t) {var _this85;_classCallCheck(this, Qo);(t = t || {}).spatialReference = null, _this85 = _callSuper(this, Qo, [e, t]), _this85.setData(t.data);return _this85;}_inherits(Qo, _ht2);return _createClass(Qo, [{ key: \"onAdd\", value: function onAdd() {this._prepareOptions();} }, { key: \"_prepareOptions\", value: function _prepareOptions() {var e = this.getMap(),t = e.getMaxNativeZoom(),n = e.getProjection(),i = \"EPSG:4326\" === n.code || \"EPSG:4490\" === n.code;var r;i && (this.options.tileSystem = [1, -1, -180, 90]), this.options.spatialReference = i ? function (e, t) {return { projection: t, fullExtent: { top: 90, left: -180, bottom: -90, right: 180 }, resolutions: function () {var t = [];for (var _n265 = 0; _n265 <= e + 1; _n265++) t[_n265] = 90 / (128 * Math.pow(2, _n265));return t;}() };}(t, n.code) : (r = t, { projection: \"EPSG:3857\", resolutions: function () {var e = [],t = 6378137 * Math.PI;for (var _n266 = 0; _n266 <= r + 1; _n266++) e[_n266] = t / (256 * Math.pow(2, _n266));return e;}(), fullExtent: { top: 6378137 * Math.PI, left: -6378137 * Math.PI, bottom: -6378137 * Math.PI, right: 6378137 * Math.PI } });} }, { key: \"getWorkerOptions\", value: function getWorkerOptions() {var e = _superPropGet(Qo, \"getWorkerOptions\", this, 3)([]);var t = this.options.data;return B(t) || t && t.url ? (t.url && (t = JSON.parse(JSON.stringify(t))), t = ta(t, this.getURLModifier())) : t = this.features, e.data = t, e.tileBuffer = this.options.tileBuffer, e.extent = this.options.extent, e.hasAltitude = this.options.enableAltitude, e.simplifyTolerance = this.options.simplifyTolerance, e.projection = this.getSpatialReference().getProjection().code, e.generateOMBB = this.options.generateOMBB, e.convertFn = this.options.convertFn ? this.options.convertFn + \"\" : null, e;} }, { key: \"setData\", value: function setData(e) {if (this.options.data = e, e && (B(e) || e.url)) {return !!this.getRenderer() && this._updateWorker(), this;}return this._setData(e), this._updateWorker(), this;} }, { key: \"_setData\", value: function _setData(e) {if (this.options.convertFn) {e = new Function(\"data\", this.options.convertFn + \"\\nreturn convert(data)\")(e);}return this.features = e, this._generateIdMap(), this;} }, { key: \"_updateWorker\", value: function _updateWorker() {var _this86 = this;var e = this.getRenderer();if (e) {var _t385 = e.getWorkerConnection();if (_t385) {var _n267 = this.options.data;B(_n267) || _n267 && _n267.url ? (_n267.url && (_n267 = JSON.parse(JSON.stringify(_n267))), _n267 = ta(_n267, this.getURLModifier())) : _n267 = this.features, _t385.setData(_n267, function (t, n) {e.clear(), _this86.onWorkerReady(null, n), e.setToRedraw(), setTimeout(function () {e.setToRedraw();}, 500);});}}} }, { key: \"getExtent\", value: function getExtent() {return this._dataExtent;} }, { key: \"onWorkerReady\", value: function onWorkerReady(e, t) {e ? this.fire(\"dataerror\", { error: e }) : (t && (t.extent && this._setExtent(t.extent), t.idMap && (this._idMaps = t.idMap)), this.fire(\"dataload\", { extent: t && t.extent }));} }, { key: \"_setExtent\", value: function _setExtent(t) {this._dataExtent = new (Function.prototype.bind.apply(e.Extent, [null].concat(_toConsumableArray(t))))();} }, { key: \"_fetchData\", value: function _fetchData(e, t) {B(e) ? Q.getJSON(e, t) : Q.getJSON(e.url, e, t);} }, { key: \"getData\", value: function getData() {return this.features || null;} }, { key: \"getTileUrl\", value: function getTileUrl(e, t, n) {return this.getId() + \",\" + e + \",\" + t + \",\" + n;} }, { key: \"getFeature\", value: function getFeature(e) {return this._idMaps[e];} }, { key: \"getGeometryById\", value: function getGeometryById(e) {return this._idMaps ? this._idMaps[e] : null;} }, { key: \"_generateIdMap\", value: function _generateIdMap() {var _this87 = this;if (!this.features) return;if (this.features = JSON.parse(JSON.stringify(this.features)), !this.features) return;var e = 0;this._idMaps = {};var t = this.options.featureIdProperty,n = this.features;Array.isArray(n) ? n.forEach(function (n) {if (n) {if (G(n.id) || (n.id = e++), t) {var _e434 = t;W(t) && (_e434 = t[n.layer || \"0\"]), n.id = n.properties[_e434];}_this87._idMaps[n.id] = n;}}) : n.features && n.features.forEach(function (n) {if (n) {if (G(n.id) || (n.id = e++), t) {var _e435 = t;W(t) && (_e435 = t[n.layer || \"0\"]), n.id = n.properties[_e435];}_this87._idMaps[n.id] = n;}});} }], [{ key: \"fromJSON\", value: function fromJSON(e) {return e && \"GeoJSONVectorTileLayer\" === e.type ? new Qo(e.id, e.options) : null;} }]);}(ht);function ea(e) {var t = document.createElement(\"a\");return t.href = e, e = t.href, t = null, e;}function ta(e, t) {return e.url ? e.url = t ? t(e.url) : ea(e.url) : e = t ? t(e) : ea(e), e;}Qo.registerJSONType(\"GeoJSONVectorTileLayer\"), Qo.mergeOptions({ features: \"id\", tileBuffer: 64, extent: 8192, pyramidMode: 1, simplifyTolerance: 3, tileStackDepth: 0, generateOMBB: !0 });var _H14 = H(),na = _H14.SYMBOLS_NEED_REBUILD_IN_VECTOR,ia = _H14.GlyphRequestor,ra = _H14.PointPack,sa = _H14.LinePack,oa = _H14.StyledPoint,aa = _H14.VectorPack,la = _H14.StyledVector;var ha = !1,ca = 1;var ua = \"_symbol_\".trim(),fa = (pe + \"\").trim();var da = new Float32Array(1);var pa = [];var ga = function (_e$renderer$CanvasRen) {function ga() {var _this88;_classCallCheck(this, ga);for (var _len16 = arguments.length, e = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {e[_key16] = arguments[_key16];}_this88 = _callSuper(this, ga, [].concat(e)), _this88.features = {}, _this88._geometries = {}, _this88._counter = 0, _this88._allFeatures = {}, _this88._featureMapping = {}, _this88._markerFeatures = {}, _this88._textFeatures = {}, _this88._lineFeatures = {}, _this88._dirtyAll = !0, _this88._kidGen = { id: 0, pickingId: 0 }, _this88._dirtyTargetsInCurrentFrame = {};return _this88;}_inherits(ga, _e$renderer$CanvasRen);return _createClass(ga, [{ key: \"setURLModifier\", value: function setURLModifier(e) {this._urlModifier = e;} }, { key: \"getURLModifier\", value: function getURLModifier() {return this._urlModifier;} }, { key: \"needToRedraw\", value: function needToRedraw() {var e = _superPropGet(ga, \"needToRedraw\", this, 3)([]);return e || this.painter && this.painter.needToRedraw() || this._markerPainter && this._markerPainter.needToRedraw() || this._linePainter && this._linePainter.needToRedraw();} }, { key: \"getAnalysisMeshes\", value: function getAnalysisMeshes() {return this.painter && this.painter.getAnalysisMeshes() || pa;} }, { key: \"getRayCastData\", value: function getRayCastData() {return null;} }, { key: \"draw\", value: function draw(e, t) {this._frameTime = e;var n = this.layer;this.prepareCanvas(), this._zScale = this._getCentiMeterScale(this.getMap().getGLRes()), this._parentContext = t || {};var i = this._parentContext.renderMode,r = this._preparePaintContext();if (this._startFrame(r, i), this._dirtyAll) this.buildMesh(), this._buildMarkerMesh(), this._buildLineMesh(), this._dirtyTargetsInCurrentFrame = {}, this._dirtyGeo = !1, this._dirtyAll = !1, this._dirtyLine = !1;else if (this._dirtyGeo) {var _e436 = this.atlas,_t386 = this._markerAtlas,_n268 = this._lineAtlas;delete this.atlas, delete this._markerAtlas, delete this._lineAtlas, this.buildMesh(_e436), this._buildMarkerMesh(_t386), this._buildLineMesh(_n268), this._dirtyGeo = !1, this._dirtyLine = !1;} else if (this._dirtyLine) {var _e437 = this._lineAtlas;delete this._lineAtlas, this._buildLineMesh(_e437), this._dirtyLine = !1;}if (!this.meshes && !this._markerMeshes && !this._lineMeshes) return void this.completeRender();this._showHideUpdated && (this._updateMeshVisible(), this._showHideUpdated = !1), this._updateDirtyTargets();var s = !i || \"default\" === i;var o = 0;0 === this.layer.options.meshRenderOrder && this._renderMeshes(r, o, i);var a = 0;if (this._lineMeshes && (s || this._linePainter.supportRenderMode(i))) {this._linePainter.startFrame(r), this._linePainter.addMesh(this._lineMeshes, null, { bloom: this._parentContext.bloom }), this._linePainter.prepareRender(r);var _e438 = r.polygonOffsetIndex || 0;o = this.meshes && this.meshes.length ? o - 1 : o, r.polygonOffsetIndex = (r.polygonOffsetIndex || 0) + o, a = this._linePainter.render(r).drawCount, r.polygonOffsetIndex = _e438;}if (1 === this.layer.options.meshRenderOrder && this._renderMeshes(r, a ? o - 1 : o, i), this._markerMeshes && (s || this._markerPainter.supportRenderMode(i))) {var _t387 = !this._parentContext.timestamp || this._parentContext.isFinalRender,_i188 = !this._collisionTimestamp || this._collisionTimestamp !== e;n.options.collision && _i188 && n.clearCollisionIndex();var _s124 = this.layer.options.sceneConfig;this._markerPainter.sceneConfig.collision = !_s124 || !!X(_s124.collision) || _s124.collision, this._markerPainter.startFrame(r), this._markerPainter.addMesh(this._markerMeshes, null, { bloom: this._parentContext.bloom }), this._markerPainter.prepareRender(r), n.options.collision && _i188 && (this._markerPainter.updateCollision(r), _t387 && (this._collisionTimestamp = e)), this._markerPainter.render(r);}(s || t && t.isFinalRender) && (this.completeRender(), this.layer.fire(\"canvasisdirty\"));} }, { key: \"_startFrame\", value: function _startFrame(e, t) {var n = !t || \"default\" === t;this.painter && (n || this.painter.supportRenderMode(t)) && this.painter.startFrame(e);} }, { key: \"_renderMeshes\", value: function _renderMeshes(e, t, n) {var i = !n || \"default\" === n;if (this.painter && this.meshes && (i || this.painter.supportRenderMode(n))) {this.painter.addMesh(this.meshes, null, { bloom: e && e.bloom }), this.painter.prepareRender(e), e.polygonOffsetIndex = (e.polygonOffsetIndex || 0) + t;return this.painter.render(e);}return { redraw: !1, drawCount: 0 };} }, { key: \"supportRenderMode\", value: function supportRenderMode() {return !0;} }, { key: \"isForeground\", value: function isForeground() {return !0;} }, { key: \"_preparePaintContext\", value: function _preparePaintContext() {var e = { regl: this.regl, layer: this.layer, symbol: this._layerSymbol, gl: this.gl, sceneConfig: this.layer.options.sceneConfig, pluginIndex: 0, cameraPosition: this.getMap().cameraPosition, timestamp: this.getFrameTimestamp() };return this._parentContext && U(e, this._parentContext), e;} }, { key: \"drawOnInteracting\", value: function drawOnInteracting(e, t, n) {this.draw(t, n);} }, { key: \"getFrameTimestamp\", value: function getFrameTimestamp() {return this._frameTime;} }, { key: \"_getFeaturesToRender\", value: function _getFeaturesToRender(e, t) {(e = e || t) === t && (t = null);var n = [],i = [0, 0, 0, 0];this.layer._sortGeometries();var r = this.layer.getGeometries();for (var _s125 = 0; _s125 < r.length; _s125++) {var _o91 = r[_s125][Vn];if (!this.features[_o91]) continue;var _a62 = this.features[_o91];if (Array.isArray(_a62)) for (var _r152 = 0; _r152 < _a62.length; _r152++) {var _s126 = _a62[_r152],_o92 = _s126[fa];(!e || e[_o92] || t && (!t || t[_o92])) && (_s126.visible || (this._showHideUpdated = !0), this._addCoordsToCenter(_s126.geometry, i, _s126.coordinates), n.push(_s126));} else {_a62.visible || (this._showHideUpdated = !0);var _r153 = _a62[fa];if (e && !e[_r153] && (!t || t && !t[_r153])) continue;this._addCoordsToCenter(_a62.geometry, i, _a62.coordinates), n.push(_a62);}}if (n.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes), delete this.meshes), this._markerMeshes && (this._markerPainter.deleteMesh(this._markerMeshes), delete this._markerMeshes), this._lineMeshes && (this._linePainter.deleteMesh(this._lineMeshes), delete this._lineMeshes)), i[3] && (i[0] /= i[3], i[1] /= i[3]), isNaN(i[0]) || isNaN(i[1])) throw new Error(\"invalid geometry coordinates for \".concat(this.layer.getJSONType()));return { features: n, center: i };} }, { key: \"buildMesh\", value: function buildMesh() {} }, { key: \"createVectorPacks\", value: function createVectorPacks(e, t, n, i, r, s) {if (!e || !i || !i.length) return Promise.resolve(null);return new t(i, n, { zoom: this.getMap().getZoom(), EXTENT: 1 / 0, requestor: this.requestor, atlas: r, center: s, positionType: Float32Array }).load();} }, { key: \"createMesh\", value: function createMesh(e, t, n, i, r, s) {var _this89 = this;return this.createVectorPacks(e, t, n, i, r, s).then(function (o) {return _this89._createMesh(o, e, t, n, i, r, s);});} }, { key: \"_createMesh\", value: function _createMesh(e, t, n, i, r, s, l) {if (!e) return null;var h = t.createGeometries([e.data], _e(r, null, 0, i, this.layer));for (var _e439 = 0; _e439 < h.length; _e439++) h[_e439] && this._fillCommonProps(h[_e439].geometry);var c = _gl.mat4.identity([]);_gl.mat4.translate(c, c, _gl.vec3.set([], l[0], l[1], 0)), _gl.mat4.scale(c, c, _gl.vec3.set([], 1, 1, this._zScale));var u = t.createMeshes(h, c, { tilePoint: [l[0], l[1]] });for (var _e440 = 0; _e440 < u.length; _e440++) {var _t388 = u[_e440];_t388.properties.level = 0, _t388.properties.tileTransform = c;var _n269 = _t388.defines;_n269.ENABLE_TILE_STENCIL = 1, _t388.setDefines(_n269), _t388.properties.meshKey = this.layer.getId();}return { meshes: u, atlas: { iconAtlas: e.data.iconAtlas } };} }, { key: \"_addCoordsToCenter\", value: function _addCoordsToCenter(e, t, n) {for (var _i189 = 0; _i189 < e.length; _i189++) if (Array.isArray(e[_i189][0])) {for (var _r154 = 0; _r154 < e[_i189].length; _r154++) if (Array.isArray(e[_i189][_r154][0])) for (var _s127 = 0; _s127 < e[_i189][_r154].length; _s127++) isNaN(+e[_i189][_r154][_s127][0]) || isNaN(+e[_i189][_r154][_s127][1]) || this._addCoord(t, e[_i189][_r154][_s127][0], e[_i189][_r154][_s127][1], e[_i189][_r154][_s127][2], 1, n[_i189][_r154][_s127]);else isNaN(+e[_i189][_r154][0]) || isNaN(+e[_i189][_r154][1]) || this._addCoord(t, e[_i189][_r154][0], e[_i189][_r154][1], e[_i189][_r154][2], 1, n[_i189][_r154]);} else isNaN(+e[_i189][0]) || isNaN(+e[_i189][1]) || this._addCoord(t, e[_i189][0], e[_i189][1], e[_i189][2], 1, n[_i189]);} }, { key: \"_addCoord\", value: function _addCoord(e, t, n, i, r, s) {var o = this.getMap().getProjection().isSphere();var a = !1;(s[0] > 180 || s[0] < -180) && (a = !0, o && !ha && (ha = !0, console.warn(\"Layer(\".concat(this.layer.getId(), \") has invalid longitude value: \").concat(s[0])))), (s[1] > 90 || s[1] < -90) && (a = !0, o && !ha && (ha = !0, console.warn(\"Layer(\".concat(this.layer.getId(), \") has invalid latitude value: \").concat(s[1])))), a || (e[0] += t, e[1] += n, e[2] += i || 0, e[3] += r);} }, { key: \"_fillCommonProps\", value: function _fillCommonProps(e) {var t = this.getMap().getGLRes(),n = e.properties;n.tileResolution = t, n.tileRatio = 1, n.z = 1, n.tileExtent = 1, n.elements = e.elements, n.aPickingId = e.data.aPickingId;} }, { key: \"_isEnableWorkAround\", value: function _isEnableWorkAround(e) {return \"win-intel-gpu-crash\" === e && this.layer.options.workarounds[\"win-intel-gpu-crash\"] && ya(this.gl);} }, { key: \"prepareRequestors\", value: function prepareRequestors() {if (this._iconRequestor) return;var e = this.layer;this._iconRequestor = new te({ iconErrorUrl: e.options.iconErrorUrl, urlModifier: function urlModifier(t) {var n = e.getURLModifier();return n && n(t) || t;} });var t = !this._isEnableWorkAround(\"win-intel-gpu-crash\");this._glyphRequestor = new ia(function (t) {e.getMap().getRenderer().callInNextFrame(t);}, e.options.glyphSdfLimitPerFrame, t), this.requestor = this._fetchPattern.bind(this), this._markerRequestor = this._fetchIconGlyphs.bind(this);} }, { key: \"_fetchPattern\", value: function _fetchPattern(e, t, n) {var i = [];this._iconRequestor.getIcons(e, function (e, t) {if (e) throw e;t.buffers && i.push.apply(i, _toConsumableArray(t.buffers)), n(null, { icons: t.icons }, i);});} }, { key: \"_fetchIconGlyphs\", value: function _fetchIconGlyphs(e, t, n) {var _this90 = this;this._glyphRequestor.getGlyphs(t, function (t, i) {if (t) throw t;var r = i.buffers || [];_this90._iconRequestor.getIcons(e, function (e, t) {if (e) throw e;t.buffers && t.buffers.length && r.push.apply(r, _toConsumableArray(t.buffers)), n(null, { icons: t.icons, glyphs: i.glyphs }, r);});});} }, { key: \"_buildMarkerMesh\", value: function _buildMarkerMesh(e) {var _this91 = this;var t = Object.keys(this._markerFeatures),n = Object.keys(this._textFeatures);if (!t.length && !n.length) return void (this._markerMeshes && (this._markerPainter.deleteMesh(this._markerMeshes), delete this._markerMeshes));var _this$_getFeaturesToR = this._getFeaturesToRender(this._markerFeatures, this._textFeatures),i = _this$_getFeaturesToR.features,r = _this$_getFeaturesToR.center,s = [],l = [];for (var _e441 = 0; _e441 < i.length; _e441++) {var _t389 = i[_e441][fa];this._markerFeatures[_t389] && s.push(i[_e441]), this._textFeatures[_t389] && l.push(i[_e441]);}if (!s.length && !l.length) return void (this._markerMeshes && (this._markerPainter.deleteMesh(this._markerMeshes), delete this._markerMeshes));var h = this._showHideUpdated;this._markerCenter = r;var c = this._createPointPacks(s, l, e, r);this._markerAtlas = {};var u = [],f = [];this._isCreatingMarkerMesh = !0, Promise.all(c).then(function (e) {if (_this91._markerMeshes && (_this91._markerPainter.deleteMesh(_this91._markerMeshes), delete _this91._markerMeshes), !e || !e.length) return void _this91.setToRedraw();var t = _this91._markerPainter.createGeometries(e.map(function (e) {return e && e.data && (e.data.isIdUnique = !0), e && e.data;}), _this91._allFeatures);for (var _n270 = 0; _n270 < t.length; _n270++) _this91._fillCommonProps(t[_n270].geometry, e[_n270] && e[_n270].data);var n = e[0] && e[0].data.iconAtlas,i = e[0] && e[0].data.glyphAtlas || e[1] && e[1].data.glyphAtlas;n && (_this91._markerAtlas.iconAtlas = n), i && (_this91._markerAtlas.glyphAtlas = i);var s = _gl.mat4.identity([]);_gl.mat4.translate(s, s, _gl.vec3.set(f, r[0], r[1], 0)), _gl.mat4.scale(s, s, _gl.vec3.set(u, 1, 1, _this91._zScale));var l = _this91._markerPainter.createMeshes(t, s);for (var _e442 = 0; _e442 < l.length; _e442++) l[_e442].geometry.properties.originElements = l[_e442].geometry.properties.elements.slice(), l[_e442].properties.level = 0, l[_e442].material.set(\"flipY\", 1), l[_e442].properties.meshKey = ca++;_this91._markerMeshes = l, h && (_this91._showHideUpdated = !0), _this91._isCreatingMarkerMesh = !1, _this91.setToRedraw(), _this91.layer.fire(\"buildmarkermesh\");});} }, { key: \"_updateMeshVisible\", value: function _updateMeshVisible() {if (this._markerMeshes && (this._updateVisElements(this._markerMeshes[0], this._markerFeatures), this._updateVisElements(this._markerMeshes[1], this._textFeatures), this._markerMeshes[0] && this._markerPainter.prepareCollideIndex(this._markerMeshes[0].geometry), this._markerMeshes[1] && this._markerPainter.prepareCollideIndex(this._markerMeshes[1].geometry)), this._lineMeshes) for (var _e443 = 0; _e443 < this._lineMeshes.length; _e443++) this._updateVisElements(this._lineMeshes[_e443], this._lineFeatures);if (this.meshes) for (var _e444 = 0; _e444 < this.meshes.length; _e444++) this._updateVisElements(this.meshes[_e444], this._allFeatures);} }, { key: \"_updateVisElements\", value: function _updateVisElements(e, t) {if (!e) return;var _e$geometry$propertie4 = e.geometry.properties,n = _e$geometry$propertie4.aPickingId,i = _e$geometry$propertie4.originElements,r = [];for (var _e445 = 0; _e445 < i.length; _e445++) {var _s128 = n[i[_e445]];t[_s128] && t[_s128].feature.visible && r.push(i[_e445]);}var s = e.geometry.properties.elements = new i.constructor(r);e.geometry.setElements(s);} }, { key: \"_createPointPacks\", value: function _createPointPacks(e, t, n, i) {var r = { zoom: this.getMap().getZoom(), EXTENT: 1 / 0, requestor: this._markerRequestor, atlas: n, center: i, positionType: Float32Array, defaultAltitude: 0, forceAltitudeAttribute: !0, markerWidthType: Uint16Array, markerHeightType: Uint16Array, allowEmptyPack: 1 };return [this._markerSymbol].map(function (n, i) {return new ra(0 === i ? e : t, n, r).load();});} }, { key: \"updateMesh\", value: function updateMesh() {} }, { key: \"_updateMarkerMesh\", value: function _updateMarkerMesh(e) {var _this92 = this;var t = e._getInternalSymbol(),n = { zoom: this.getMap().getZoom(), isVector3D: !0 },i = this._convertGeo(e);if (!this._markerMeshes) return !1;var r = this.features[i];Array.isArray(r) || (r = [r]);var s = [],o = [],a = [],l = this.getMap().getZoom();var h, c;h = Array.isArray(t) ? t.map(function (e) {return e ? (0, _functionType.loadFunctionTypes)(e, function () {return s[0] = l, s;}) : e;}) : (0, _functionType.loadFunctionTypes)(t, function () {return s[0] = l, s;}), c = Array.isArray(t) ? t.map(function (e) {return e ? aa.genFnTypes(e) : e;}) : aa.genFnTypes(t);for (var _e446 = 0; _e446 < r.length; _e446++) {if (!r[_e446]) continue;var _i190 = Array.isArray(t) ? t[_e446] : t,_s129 = Array.isArray(h) ? h[_e446] : h,_o93 = Array.isArray(c) ? c[_e446] : c,_a63 = new oa(r, _i190, _s129, _o93, n).getIconAndGlyph();if (!this._markerAtlas || !ra.isAtlasLoaded(_a63, this._markerAtlas)) return this._markRebuild(), this.setToRedraw(), !1;}for (var _e447 = 0; _e447 < r.length; _e447++) {var _t390 = r[_e447][fa];this._markerFeatures[_t390] && o.push(r[_e447]), this._textFeatures[_t390] && a.push(r[_e447]);}var u = r[0].id,f = this._createPointPacks(o, a, this._markerAtlas, this._markerCenter),d = this._markerMeshes;return Promise.all(f).then(function (e) {for (var _t391 = 0; _t391 < e.length; _t391++) {if (!e[_t391]) continue;e[_t391].data && (e[_t391].data.isIdUnique = !0);var _n271 = d[_t391],_i191 = _n271.geometry.properties.aFeaIds.indexOf(u);if (_i191 < 0) continue;var _r155 = e[_t391].data.featureIds.length,_s130 = e[_t391].data.dynamicAttributes;for (var _o94 in e[_t391].data.data) {if (\"aPickingId\" === _o94) continue;if (_s130[_o94]) continue;var _a64 = e[_t391].data.data[_o94];_a64 && _n271.geometry.updateSubData(_o94, _a64, _i191 * _a64.length / _r155);}}_this92.setToRedraw();}), !0;} }, { key: \"_updateLineMesh\", value: function _updateLineMesh(e) {return this._updateMesh(e, this._lineMeshes, this._lineAtlas, this._lineCenter, this._linePainter, sa, Ln, this._groupLineFeas);} }, { key: \"_updateMesh\", value: function _updateMesh(e, t, n, i, r, s, o, a) {var _this93 = this;if (!t) return !1;if (!n) return this._markRebuild(), this.setToRedraw(), !1;var l = e._getInternalSymbol(),h = { zoom: this.getMap().getZoom() },c = e[Vn];var u = this.features[c];Array.isArray(u) || (u = [u]);var f = [];for (var _e448 = 0; _e448 < u.length; _e448++) {var _t392 = u[_e448];if (!_t392) continue;var _i192 = Array.isArray(l) ? l[_e448] : l,_r156 = aa.genFnTypes(_i192),_o95 = new la(u, _i192, _r156, h),_a65 = s === sa ? _o95.getLineResource() : _o95.getPolygonResource();if (!aa.isAtlasLoaded(_a65, n[_e448])) return this._markRebuild(), this.setToRedraw(), !1;f.push(_t392);}var d = u[0].id,p = a.call(this, f);var _loop6 = function _loop6(_e449) {if (p[_e449].length) {var _n273 = t.filter(function (t) {return t.feaGroupIndex === _e449;});if (!_n273.length) return { v: (_this93._markRebuild(), _this93.setToRedraw(), !1) };if (_n273[0].geometry.properties.aFeaIds.indexOf(d) < 0) return { v: (_this93._markRebuild(), _this93.setToRedraw(), !1) };}},_ret2;for (var _e449 = 0; _e449 < p.length; _e449++) {_ret2 = _loop6(_e449);if (_ret2) return _ret2.v;}var g = U({}, o),m = p.map(function (e) {return _this93.createVectorPacks(r, s, g, e, n[0], i);});return Promise.all(m).then(function (e) {for (var _n272 = 0; _n272 < e.length; _n272++) {var _i193 = void 0;if (Array.isArray(t)) {for (var _e450 = 0; _e450 < t.length; _e450++) if (t[_e450].feaGroupIndex === _n272) {_i193 = t[_e450];break;}} else _i193 = t;_i193 && _this93._updateMeshData(_i193, d, e[_n272]);}}), !0;} }, { key: \"_updateMeshData\", value: function _updateMeshData(e, t, n) {var i = e.geometry.properties.aFeaIds,r = i.indexOf(t);if (!(r < 0)) {if (n) {var _t393 = n.data.dynamicAttributes,_i194 = n.data.featureIds.length,_s131 = n.data.data;for (var _n274 in _s131) if (!_t393[_n274] && q(_s131, _n274) && _s131[_n274]) {var _t394 = _s131[_n274];e.geometry.updateSubData(_n274, _t394, r * _t394.length / _i194);}} else {var _n275 = r + 1;for (; i[_n275] === t;) _n275++;var _s132 = _n275 - r,_o96 = e.geometry.desc.positionSize;da.length !== 3 * _s132 && (da = new Float32Array(_s132 * _o96), da.fill(-1 / 0, 0)), e.geometry.updateSubData(e.geometry.desc.positionAttribute, da, r * _o96);}this.layer.fire(\"updatemesh\"), this.setToRedraw();}} }, { key: \"_buildLineMesh\", value: function _buildLineMesh(e) {var _this94 = this;if (!Object.keys(this._lineFeatures).length) return void (this._lineMeshes && (this._linePainter.deleteMesh(this._lineMeshes), delete this._lineMeshes));var _this$_getFeaturesToR2 = this._getFeaturesToRender(this._lineFeatures),t = _this$_getFeaturesToR2.features,n = _this$_getFeaturesToR2.center;if (!t.length) return;var i = this._showHideUpdated;this._lineCenter = n;var r = this._groupLineFeas(t),s = U({}, Ln),o = r.map(function (t, i) {return _this94.createMesh(_this94._linePainter, sa, s, t, e && e[i], n);});this._isCreatingLineMesh = !0, Promise.all(o).then(function (e) {_this94._lineMeshes && _this94._linePainter.deleteMesh(_this94._lineMeshes);var t = [],n = [];for (var _i195 = 0; _i195 < e.length; _i195++) {var _r157 = e[_i195] && e[_i195].meshes;if (_r157) {for (var _e451 = 0; _e451 < _r157.length; _e451++) {var _n276 = _r157[_e451];_n276.feaGroupIndex = _i195, t.push(_n276), _n276.geometry.properties.originElements = _n276.geometry.properties.elements.slice();}n[_i195] = e[_i195].atlas;}}_this94._lineMeshes = t, _this94._lineAtlas = n, i && (_this94._showHideUpdated = i), _this94._isCreatingLineMesh = !1, _this94.setToRedraw(), _this94.layer.fire(\"buildlinemesh\");});} }, { key: \"_groupLineFeas\", value: function _groupLineFeas(e) {var t = (ua + \"lineDasharray\").trim(),n = (ua + \"linePatternFile\").trim(),i = [],r = [],s = [];for (var _o97 = 0; _o97 < e.length; _o97++) {var _a66 = e[_o97],_l53 = _a66.properties && _a66.properties[t];_l53 && Ta(_l53) ? s.push(_a66) : _a66.properties && _a66.properties[n] ? r.push(_a66) : i.push(_a66);}return [i, r, s];} }, { key: \"_markRebuildGeometry\", value: function _markRebuildGeometry() {this._dirtyGeo = !0, this.setToRedraw();} }, { key: \"_markRebuild\", value: function _markRebuild() {this._dirtyAll = !0, this.setToRedraw();} }, { key: \"_convertGeometries\", value: function _convertGeometries(e) {var t = this.layer.getId();for (var _n277 = 0; _n277 < e.length; _n277++) {var _i196 = e[_n277];var _r158 = !1;for (var _e452 = 0; _e452 < this.GeometryTypes.length; _e452++) if (_i196 instanceof this.GeometryTypes[_e452]) {_r158 = !0;break;}if (!_r158) throw new Error(\"\".concat(_i196.getJSONType(), \" can't be added to \").concat(this.layer.getJSONType(), \"(id:\").concat(t, \").\"));this._convertGeo(_i196);}} }, { key: \"_convertGeo\", value: function _convertGeo(e) {void 0 === e[Vn] && (e[Vn] = this._counter++);var t = e[Vn];this.features[t] && this._removeFeatures(t), this.features[t] = Bn(e, this._kidGen, this.features[t]);var n = this.features[t];return this._refreshFeatures(n, t), this._geometries[t] = e, t;} }, { key: \"_refreshFeatures\", value: function _refreshFeatures(e, t) {if (!e) return;var n = Array.isArray(e) ? e[0].id : e.id;if (this._featureMapping[n] = e, Array.isArray(e)) for (var _n278 = 0; _n278 < e.length; _n278++) {var _i197 = e[_n278][fa];if (e[_n278][Vn] = t, this._allFeatures[_i197] = { feature: e[_n278] }, this._allFeatures[_i197][Vn] = t, !this.needCheckPointLineSymbols()) continue;var _r159 = { feature: e[_n278] };(xa(e[_n278]) || _a(e[_n278])) && (this._markerFeatures[_i197] = _r159), _a(e[_n278]) && (this._textFeatures[_i197] = _r159), Aa(e[_n278]) && (this._lineFeatures[_i197] = _r159);} else {e[Vn] = t;var _n279 = { feature: e },_i198 = e[fa];if (this._allFeatures[_i198] = _n279, !this.needCheckPointLineSymbols()) return;(xa(e) || _a(e)) && (this._markerFeatures[_i198] = _n279), _a(e) && (this._textFeatures[_i198] = _n279), Aa(e) && (this._lineFeatures[_i198] = _n279);}} }, { key: \"needCheckPointLineSymbols\", value: function needCheckPointLineSymbols() {return !0;} }, { key: \"_removeFeatures\", value: function _removeFeatures(e) {var t = this.features[e];if (t) if (Array.isArray(t)) for (var _e453 = 0; _e453 < t.length; _e453++) {var _n280 = t[_e453][fa],_i199 = t[_e453].id;delete this._featureMapping[_i199], delete this._allFeatures[_n280], delete this._markerFeatures[_n280], delete this._textFeatures[_n280], delete this._lineFeatures[_n280];} else {var _e454 = t[fa],_n281 = t.id;delete this._featureMapping[_n281], delete this._allFeatures[_e454], delete this._markerFeatures[_e454], delete this._textFeatures[_e454], delete this._lineFeatures[_e454];}} }, { key: \"pick\", value: function pick(e, t, n) {var _this95 = this;var i = [];if (!this.layer.isVisible()) return i;return [this.painter, this._markerPainter, this._linePainter].forEach(function (r) {if (!r) return;var s = r.pick(e, t, n.tolerance);if (s && s.data && s.data.feature) {var _e455 = s.data.feature,_t395 = _this95._geometries[_e455[Vn]];n && n.includeInternals ? i.push(_t395) : (s.geometry = _t395, delete s.plugin, delete s.data, delete s.point, i.push(s));}}), i;} }, { key: \"_getFeaKeyId\", value: function _getFeaKeyId(e) {var t = e[Vn],n = this.features[t];return Array.isArray(n) ? n[0][fa] : n[fa];} }, { key: \"_updateDirtyTargets\", value: function _updateDirtyTargets() {var e = !1;for (var _t396 in this._dirtyTargetsInCurrentFrame) {var _n282 = this._dirtyTargetsInCurrentFrame[_t396],_i200 = this._getFeaKeyId(_n282);if (!this._isCreatingMarkerMesh && (this._markerFeatures[_i200] || this._textFeatures[_i200])) {var _t397 = this._updateMarkerMesh(_n282);e = e || _t397;}if (!this._isCreatingLineMesh && this._lineFeatures[_i200]) {var _t398 = this._updateLineMesh(_n282);e = e || _t398;}if (!this._isCreatingMesh) {var _t399 = this.updateMesh(_n282);e = e || _t399;}}this._dirtyTargetsInCurrentFrame = {}, e && (ma(this), this.layer.fire(\"partialupdate\"));} }, { key: \"_convertAndRebuild\", value: function _convertAndRebuild(e) {this._convertGeo(e), this._markRebuild(), ma(this);} }, { key: \"onGeometryAdd\", value: function onGeometryAdd(e) {this.setToRedraw(), this.canvas && e && e.length && (this._convertGeometries(e), this._markRebuild(), ma(this));} }, { key: \"onGeometryRemove\", value: function onGeometryRemove(e) {if (e && e.length) {for (var _t400 = 0; _t400 < e.length; _t400++) {var _n283 = e[_t400][Vn];void 0 !== _n283 && (delete this._geometries[_n283], this._removeFeatures(_n283), delete this.features[_n283]);}this._markRebuild(), ma(this);}} }, { key: \"onGeometrySymbolChange\", value: function onGeometrySymbolChange(e) {var t = e.target._getParent() || e.target,n = t[Vn];if (void 0 === n) return;var i = e.properties;if (Array.isArray(i)) {var _e456 = {};for (var _t401 = 0; _t401 < i.length; _t401++) i[_t401] && U(_e456, i[_t401]);i = _e456;} else if (i && void 0 !== i[0]) {var _e457 = {};for (var _t402 in i) i[_t402] && U(_e457, i[_t402]);i = _e457;}for (var _e458 in i) if (q(i, _e458) && na[_e458]) return void this._convertAndRebuild(t);var r = t._getInternalSymbol(),s = this.features[n];if (this._convertGeo(t), s) {if (function (e, t) {return Array.isArray(e) ? !!Array.isArray(t) && e.length === t.length : !Array.isArray(t);}(r, s)) {if (Array.isArray(r)) for (var _e459 = 0; _e459 < r.length; _e459++) {if (!wa(r[_e459], s[_e459])) return void this._convertAndRebuild(t);} else if (!wa(r, s)) return void this._convertAndRebuild(t);this.onGeometryPositionChange(e);} else this._convertAndRebuild(t);} else this._convertAndRebuild(t);} }, { key: \"onGeometryShapeChange\", value: function onGeometryShapeChange(e) {var t = e.target._getParent() || e.target;void 0 !== t[Vn] && (this._convertGeometries([t]), this._markRebuildGeometry(), ma(this));} }, { key: \"onGeometryPositionChange\", value: function onGeometryPositionChange(e) {var t = e.target._getParent() || e.target,n = t[Vn];void 0 !== n && (this._convertGeometries([t]), this._dirtyTargetsInCurrentFrame[n] = t, ma(this));} }, { key: \"onGeometryZIndexChange\", value: function onGeometryZIndexChange(e) {void 0 !== (e.target._getParent() || e.target)[Vn] && this._markRebuild();} }, { key: \"onGeometryShow\", value: function onGeometryShow(e) {void 0 !== (e.target._getParent() || e.target)[Vn] && this._onShowHide(e);} }, { key: \"onGeometryHide\", value: function onGeometryHide(e) {void 0 !== (e.target._getParent() || e.target)[Vn] && this._onShowHide(e);} }, { key: \"_onShowHide\", value: function _onShowHide(e) {var t = e.target._getParent() || e.target,n = t[Vn],i = this.features[n];if (i) {var _e460 = t.isVisible();if (Array.isArray(i)) {if (_e460 === i[0].visible) return;for (var _t403 = 0; _t403 < i.length; _t403++) i[_t403].visible = _e460;} else {if (_e460 === i.visible) return;i.visible = _e460;}this._markShowHide(), ma(this);}} }, { key: \"_markShowHide\", value: function _markShowHide() {this._showHideUpdated = !0;} }, { key: \"onGeometryPropertiesChange\", value: function onGeometryPropertiesChange(e) {var t = e.target._getParent() || e.target,n = t[Vn];void 0 !== n && this.painter && (this.features[n] = Bn(t, this._kidGen), this._refreshFeatures(this.features[n], n), this._markerMeshes && this._markerMeshes.length && this._markerPainter.needRebuildOnGometryPropertiesChanged() || this._lineMeshes && this._lineMeshes.length && this._linePainter.needRebuildOnGometryPropertiesChanged() || this.meshes && this.meshes.length && this.painter.needRebuildOnGometryPropertiesChanged() ? this._markRebuild() : this.painter.onFeatureChange(this.features[n], this.meshes), ma(this));} }, { key: \"createContext\", value: function createContext() {var e = this.canvas.gl && this.canvas.gl.wrap;e ? (this.gl = this.canvas.gl.wrap(), this.regl = this.canvas.gl.regl) : this._createREGLContext(), e && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)), this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height), this.painter = this.createPainter();var t = mt.get3DPainterClass(\"icon\");var n = t.getBloomSymbol();var i = U({}, En, Dn);i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this._defineSymbolBloom(i, n), this._markerSymbol = i;var r = U({}, ae, this.layer.options.sceneConfig || {});this._markerPainter = new t(this.regl, this.layer, i, r, 0), this._markerPainter.setShaderDefines({ REVERSE_MAP_ROTATION_ON_PITCH: 1 });var s = mt.get3DPainterClass(\"line\"),o = U({}, Ln);n = s.getBloomSymbol(), this._defineSymbolBloom(o, n), this._lineSymbol = o;var a = U({}, this.layer.options.sceneConfig || {});void 0 === a.depthMask && (a.depthMask = !0), this._linePainter = new s(this.regl, this.layer, o, a, 0), this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());} }, { key: \"_isInGroupGLLayer\", value: function _isInGroupGLLayer() {return !!(this.canvas && this.canvas.gl && this.canvas.gl.wrap);} }, { key: \"_defineSymbolBloom\", value: function _defineSymbolBloom(e, t) {for (var _n284 = 0; _n284 < t.length; _n284++) e[t[_n284]] = this.layer.options.enableBloom;} }, { key: \"updateBloom\", value: function updateBloom(e) {this._markerPainter && this._updatePainterBloom(this._markerPainter, this._markerSymbol, e), this._linePainter && this._updatePainterBloom(this._linePainter, this._lineSymbol, e), this.painter && this._updatePainterBloom(this.painter, this.painterSymbol, e);} }, { key: \"_updatePainterBloom\", value: function _updatePainterBloom(e, t, n) {var i = e.constructor.getBloomSymbol().reduce(function (e, i) {return e[i] = n, t[i] = n, e;}, {});e.updateSymbol(i, t);} }, { key: \"createPainter\", value: function createPainter() {} }, { key: \"_createREGLContext\", value: function _createREGLContext() {var e = this.layer.options.glOptions || { alpha: !0, depth: !0, stencil: !0, antialias: !1 };e.preserveDrawingBuffer = !0, e.stencil = !0, this.glOptions = e, this.gl = this.gl || this._createGLContext(this.canvas, e), this.regl = (0, _gl.createREGL)({ gl: this.gl, attributes: e, extensions: _gl.reshader.Constants.WEBGL_EXTENSIONS, optionalExtensions: _gl.reshader.Constants.WEBGL_OPTIONAL_EXTENSIONS });} }, { key: \"_createGLContext\", value: function _createGLContext(e, t) {var n = [\"webgl\", \"experimental-webgl\"];var i = null;for (var _r160 = 0; _r160 < n.length; ++_r160) {try {i = e.getContext(n[_r160], t);} catch (e) {}if (i) break;}return i;} }, { key: \"clearCanvas\", value: function clearCanvas() {_superPropGet(ga, \"clearCanvas\", this, 3)([]), this.regl && this.regl.clear({ color: [0, 0, 0, 0], depth: 1, stencil: 255 });} }, { key: \"resizeCanvas\", value: function resizeCanvas(e) {_superPropGet(ga, \"resizeCanvas\", this, 3)([e]);var t = this.canvas;t && (!this.pickingFBO || this.pickingFBO.width === t.width && this.pickingFBO.height === t.height || this.pickingFBO.resize(t.width, t.height), this.painter && this.painter.resize(t.width, t.height));} }, { key: \"onRemove\", value: function onRemove() {_superPropGet(ga, \"onRemove\", this, 3)([]), this.painter && (this.painter.delete(), delete this.painter), this._markerPainter && (this._markerPainter.delete(), delete this._markerPainter), this._linePainter && (this._linePainter.delete(), delete this._linePainter);} }, { key: \"drawOutline\", value: function drawOutline(e) {if (this._outlineAll && (this.painter && this.painter.outlineAll(e), this._markerPainter.outlineAll(e), this._linePainter.outlineAll(e)), this._outlineFeatures) for (var _t404 = 0; _t404 < this._outlineFeatures.length; _t404++) this.painter && this.painter.outline(e, this._outlineFeatures[_t404]), this._markerPainter.outline(e, this._outlineFeatures[_t404]), this._linePainter.outline(e, this._outlineFeatures[_t404]);} }, { key: \"outlineAll\", value: function outlineAll() {this._outlineAll = !0, this.setToRedraw();} }, { key: \"outline\", value: function outline(e) {this._outlineFeatures || (this._outlineFeatures = []);var t = [];for (var _n285 = 0; _n285 < e.length; _n285++) {var _i201 = this.layer.getGeometryById(e[_n285]);if (_i201) {var _e461 = this.features[_i201[Vn]];if (Array.isArray(_e461)) for (var _n286 = 0; _n286 < _e461.length; _n286++) t.push(_e461[_n286].id);else t.push(_e461.id);}}this._outlineFeatures.push(t), this.setToRedraw();} }, { key: \"cancelOutline\", value: function cancelOutline() {delete this._outlineAll, delete this._outlineFeatures, this.setToRedraw();} }, { key: \"isEnableWorkAround\", value: function isEnableWorkAround(e) {return \"win-intel-gpu-crash\" === e && this.layer.options.workarounds[\"win-intel-gpu-crash\"] && ya(this.gl);} }, { key: \"_getCentiMeterScale\", value: function _getCentiMeterScale(e) {return $(e, this.getMap());} }, { key: \"_onSpatialReferenceChange\", value: function _onSpatialReferenceChange() {var e = this.layer.getGeometries();e && this._convertGeometries(e), this._markRebuild();} }, { key: \"_getLayerOpacity\", value: function _getLayerOpacity() {var e = this.layer.options.opacity;return this._isInGroupGLLayer() ? X(e) ? 1 : e : 1;} }]);}(e.renderer.CanvasRenderer);function ma(e) {e.setToRedraw();}function ya(e) {var t = e.getExtension(\"WEBGL_debug_renderer_info\");if (t && \"undefined\" != typeof navigator) {var _n287 = e.getParameter(t.UNMASKED_RENDERER_WEBGL),_i202 = \"Win32\" === navigator.platform || \"Win64\" === navigator.platform;if (_n287 && _n287.toLowerCase().indexOf(\"intel\") >= 0 && _i202) return !0;}return !1;}function xa(_ref125) {var e = _ref125.properties;var t = (ua + \"markerFile\").trim(),n = (ua + \"markerType\").trim();return e[t] || e[n];}function _a(_ref126) {var e = _ref126.properties;return e[(ua + \"textName\").trim()];}var va = (ua + \"lineWidth\").trim(),ba = (Hn + \"\").trim();function Aa(e) {return 2 === e.type && !e.properties[ba] || 3 === e.type && void 0 !== e.properties[va];}function Ta(e) {if (!Array.isArray(e)) return 0;var t = 0;for (var _n288 = 0; _n288 < e.length; _n288++) t += e[_n288];return t;}function wa(e, t) {if (Object.keys(e).sort().join() !== Object.keys(t.properties || {}).filter(function (e) {return 0 === e.indexOf(ua);}).map(function (e) {return e.substring(ua.length);}).sort().join()) return !1;for (var _n289 in e) if (q(e, _n289)) {var _i203 = (ua + _n289).trim();if ((0, _functionType.isFunctionDefinition)(e[_n289]) !== (0, _functionType.isFunctionDefinition)(t.properties[_i203])) return !1;}return !0;}function Sa(t, n, i) {if (!t || t.type !== n) return null;var r = new i(t.id, t.options),s = t.geometries,o = [];for (var _t405 = 0; _t405 < s.length; _t405++) {var _n290 = e.Geometry.fromJSON(s[_t405]);_n290 && o.push(_n290);}return r.addGeometry(o), r;}var Ma = exports.PointLayer = function (_mt) {function Ma() {var _this96;_classCallCheck(this, Ma);for (var _len17 = arguments.length, e = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {e[_key17] = arguments[_key17];}_this96 = _callSuper(this, Ma, [].concat(e)), _this96.options.sceneConfig || (_this96.options.sceneConfig = U({}, ae));return _this96;}_inherits(Ma, _mt);return _createClass(Ma, [{ key: \"getPolygonOffsetCount\", value: function getPolygonOffsetCount() {return 0;} }, { key: \"getPolygonOffset\", value: function getPolygonOffset() {return 0;} }], [{ key: \"fromJSON\", value: function fromJSON(e) {return Sa(e, \"PointLayer\", Ma);} }]);}(mt);Ma.mergeOptions({ glyphSdfLimitPerFrame: 15, iconErrorUrl: null, workarounds: { \"win-intel-gpu-crash\": !0 }, collision: !1, collisionFrameLimit: 1 }), Ma.registerJSONType(\"PointLayer\"), Ma.registerRenderer(\"canvas\", null);Ma.registerRenderer(\"gl\", function (_ga) {function _class11() {var _this97;_classCallCheck(this, _class11);for (var _len18 = arguments.length, t = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {t[_key18] = arguments[_key18];}_this97 = _callSuper(this, _class11, [].concat(t)), _this97.GeometryTypes = [e.Marker, e.MultiPoint];return _this97;}_inherits(_class11, _ga);return _createClass(_class11, [{ key: \"onGeometryAdd\", value: function onGeometryAdd(e) {e && (Array.isArray(e) ? e.forEach(function (e) {e.options.maxMarkerWidth = e.options.maxMarkerHeight = 255;}) : e.options.maxMarkerWidth = e.options.maxMarkerHeight = 255, _superPropGet(_class11, \"onGeometryAdd\", this, 3)([e]));} }]);}(ga));var _H15 = H(),Pa = _H15.LinePack;var Ia = exports.LineStringLayer = function (_mt2) {function Ia() {_classCallCheck(this, Ia);return _callSuper(this, Ia, arguments);}_inherits(Ia, _mt2);return _createClass(Ia, null, [{ key: \"fromJSON\", value: function fromJSON(e) {return Sa(e, \"LineStringLayer\", Ia);} }]);}(mt);Ia.mergeOptions({ meshRenderOrder: 1 }), Ia.registerJSONType(\"LineStringLayer\");var Ca = (Hn + \"\").trim();Ia.registerRenderer(\"gl\", function (_ga2) {function _class12() {var _this98;_classCallCheck(this, _class12);for (var _len19 = arguments.length, t = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {t[_key19] = arguments[_key19];}_this98 = _callSuper(this, _class12, [].concat(t)), _this98.GeometryTypes = [e.LineString, e.MultiLineString];return _this98;}_inherits(_class12, _ga2);return _createClass(_class12, [{ key: \"createPainter\", value: function createPainter() {var e = mt.get3DPainterClass(\"line-gradient\");this.painterSymbol = U({}, { lineGradientProperty: Ca }, Ln), this._defineSymbolBloom(this.painterSymbol, e.getBloomSymbol());var t = U({}, this.layer.options.sceneConfig || {});void 0 === t.depthMask && (t.depthMask = !0);return new e(this.regl, this.layer, this.painterSymbol, t, 0);} }, { key: \"buildMesh\", value: function buildMesh() {var _this99 = this;var _this$_getFeaturesToR3 = this._getFeaturesToRender(),e = _this$_getFeaturesToR3.features,t = _this$_getFeaturesToR3.center;if (e = e.filter(function (e) {return !!e.properties[Ca];}), !e.length) return;var n = this._showHideUpdated;this._meshCenter = t;var i = U({}, this.painterSymbol),r = this.createMesh(this.painter, Pa, i, e, null, t);this._isCreatingMesh = !0, r.then(function (e) {_this99.meshes && _this99.painter.deleteMesh(_this99.meshes);var t = [],i = e && e.meshes;if (i) {t.push.apply(t, _toConsumableArray(i));for (var _e462 = 0; _e462 < i.length; _e462++) i[_e462].feaGroupIndex = 0, i[_e462].geometry.properties.originElements = i[_e462].geometry.properties.elements.slice();}_this99.meshes = t, n && (_this99._showHideUpdated = n), _this99._isCreatingMesh = !1, _this99.setToRedraw();});} }]);}(ga)), Ia.registerRenderer(\"canvas\", null);var _H16 = H(),ka = _H16.PolygonPack;var Fa = exports.PolygonLayer = function (_mt3) {function Fa() {_classCallCheck(this, Fa);return _callSuper(this, Fa, arguments);}_inherits(Fa, _mt3);return _createClass(Fa, null, [{ key: \"fromJSON\", value: function fromJSON(e) {return Sa(e, \"PolygonLayer\", Fa);} }]);}(mt);Fa.registerJSONType(\"PolygonLayer\");var Oa = { polygonFill: { type: \"identity\", default: [1, 1, 1, 1], property: \"_symbol_polygonFill\" }, polygonPatternFile: { type: \"identity\", default: void 0, property: \"_symbol_polygonPatternFile\" }, polygonOpacity: { type: \"identity\", default: 1, property: \"_symbol_polygonOpacity\" }, uvScale: { type: \"identity\", default: [1, 1], property: \"_symbol_uvScale\" }, uvOffset: { type: \"identity\", default: [0, 0], property: \"_symbol_uvOffset\" }, uvOffsetInMeter: { type: \"identity\", default: !1, property: \"_symbol_uvOffsetInMeter\" }, polygonPatternFileWidth: { type: \"identity\", default: void 0, property: \"_symbol_polygonPatternFileWidth\" }, polygonPatternFileHeight: { type: \"identity\", default: void 0, property: \"_symbol_polygonPatternFileHeight\" }, polygonPatternFileOrigin: { type: \"identity\", default: void 0, property: \"_symbol_polygonPatternFileOrigin\" }, polygonPatternUV: { type: \"identity\", default: void 0, property: \"_symbol_polygonPatternUV\" } };var Ra = function (_ga3) {function Ra() {var _this100;_classCallCheck(this, Ra);_this100 = _callSuper(this, Ra, arguments), _this100.GeometryTypes = [e.Polygon, e.MultiPolygon];return _this100;}_inherits(Ra, _ga3);return _createClass(Ra, [{ key: \"getPolygonOffsetCount\", value: function getPolygonOffsetCount() {return this.options.altitude > 0 ? 0 : 2;} }, { key: \"buildMesh\", value: function buildMesh(e) {var _this101 = this;var _this$_getFeaturesToR4 = this._getFeaturesToRender(),t = _this$_getFeaturesToR4.features,n = _this$_getFeaturesToR4.center;if (!t.length) return;var i = this._showHideUpdated;this._meshCenter = n;var r = this._groupPolygonFeatures(t),s = U({}, Oa),o = r.map(function (t, i) {return _this101.createMesh(_this101.painter, ka, s, t, e && e[i], n);});this._isCreatingMesh = !0, Promise.all(o).then(function (e) {_this101.meshes && _this101.painter.deleteMesh(_this101.meshes), e = function (e) {var t = [];for (var _n291 = 0; _n291 < e.length; _n291++) Array.isArray(e[_n291]) ? t.push.apply(t, _toConsumableArray(e[_n291])) : t.push(e[_n291]);return t;}(e);var t = [],n = [];for (var _i204 = 0; _i204 < e.length; _i204++) {var _r161 = e[_i204] && e[_i204].meshes;if (_r161) {t.push.apply(t, _toConsumableArray(_r161));for (var _e463 = 0; _e463 < _r161.length; _e463++) _r161[_e463].feaGroupIndex = _i204, _r161[_e463].geometry.properties.originElements = _r161[_e463].geometry.properties.elements.slice(), 1 === _i204 && (_r161[_e463].transparent = !0);n[_i204] = e[_i204].atlas;}}_this101.meshes = t, _this101.atlas = n, i && (_this101._showHideUpdated = i), _this101._isCreatingMesh = !1, _this101.setToRedraw(), _this101.layer.fire(\"buildmesh\");});} }, { key: \"getRayCastData\", value: function getRayCastData(e, t) {var n = this.painter.getRayCastData(e, t);if (!n || !n.feature) return null;var i = n.feature[Vn];return this._geometries[i];} }, { key: \"_groupPolygonFeatures\", value: function _groupPolygonFeatures(e) {var t = [],n = [];for (var _i205 = 0; _i205 < e.length; _i205++) {var _r162 = e[_i205];_r162.properties && _r162.properties._symbol_polygonOpacity < 1 ? n.push(_r162) : t.push(_r162);}return [t, n];} }, { key: \"createPainter\", value: function createPainter() {var e = mt.get3DPainterClass(\"fill\"),t = this.painterSymbol = U({}, Oa);this._defineSymbolBloom(t, e.getBloomSymbol());return new e(this.regl, this.layer, t, this.layer.options.sceneConfig, 0);} }, { key: \"updateMesh\", value: function updateMesh(e) {return this._updateMesh(e, this.meshes, this.atlas, this._meshCenter, this.painter, ka, Oa, this._groupPolygonFeatures);} }]);}(ga);function Ea(e, t, n, i, r, s, o) {var a = n && Array.isArray(n[0]);for (var _s133 = 0, _l54 = n.length; _s133 < _l54; _s133++) {e[t] = (a ? n[_s133][0] : n[_s133].x) * i, e[t + 1] = (a ? n[_s133][1] : n[_s133].y) * i, o !== Float32Array && (e[t] = Math.round(e[t]), e[t + 1] = Math.round(e[t + 1]));var _l55 = r || 0;Array.isArray(r) && (_l55 = r[_s133]), _l55 = _l55 ? Math.round(i * _l55) : 0, e[t + 2] = _l55, t += 3;}return e.trySetLength && e.trySetLength(t), t;}function Da(e, t, n, i) {var r = e[3 * t],s = e[3 * t + 1],o = e[3 * n],a = e[3 * n + 1];return r === o && (r < 0 || r > i) || s === a && (s < 0 || s > i);}Fa.registerRenderer(\"gl\", Ra), Fa.registerRenderer(\"canvas\", null);var La = Math.PI / 180,Ha = 6378137 * Math.PI / 180,Na = 85.0511287798;function za(e, t, n) {return function (e, t) {var n = Na,i = t[0],r = Math.max(Math.min(n, t[1]), -n);var s;s = 0 === r ? 0 : Math.log(Math.tan((90 + r) * La / 2)) / La;return e[0] = i * Ha, e[1] = s * Ha, e;}(e, t);}function Va(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p) {0 === e ? function (e, t, n, i, r, s, o, a, l, h) {var c = 1 / (100 * s[0]),u = 1 / (100 * s[1]),f = h && h[0] || 0,d = h && h[1] || 0,p = [0, 0];for (var _r163 = e; _r163 < t; _r163 += 3) {var _e464 = _r163 / 3 * 2,_t406 = i[_r163] - f,_s134 = i[_r163 + 1] - d;n[_e464] = p[0] + _t406 / o * c / a, n[_e464 + 1] = p[1] - _s134 / o * u / l;}}(t, n, i, r, 0, o, a, l, h, p) : 1 === e && function (e, t, n, i, r, s, o, a, l, h, c) {if (!e) return;var u, f, d, p;0 === e[4] ? (u = e[0], f = e[1], d = e[2], p = e[3]) : (u = e[1], f = e[2], d = e[3], p = e[0]);var g = _glMatrix.vec2.distance(u, f),m = _glMatrix.vec2.distance(f, d),y = [],x = [],_ = [];for (var _e465 = t; _e465 < n; _e465 += 3) {var _t407 = _e465 / 3 * 2,_n292 = (s.x / l + r[_e465] / o) * a,_d14 = s.y / l * a + (c ? r[_e465 + 1] : -r[_e465 + 1]) / o * a;_glMatrix.vec2.set(y, _n292, _d14), \"EPSG:4326\" !== h && \"EPSG:4490\" !== h || za(y, y), Ua(x, y, u, f), Ua(_, y, p, u), i[_t407] = _glMatrix.vec2.distance(u, x) / g, i[_t407 + 1] = _glMatrix.vec2.distance(u, _) / m;}}(c, t, n, i, r, s, a, u, f, d, !!p);}function Ua(e, t, n, i) {var r = n[0] - i[0],s = n[1] - i[1];var o = (t[0] - n[0]) * (n[0] - i[0]) + (t[1] - n[1]) * (n[1] - i[1]);return o /= r * r + s * s, e[0] = n[0] + o * r, e[1] = n[1] + o * s, e;}function Ba(e, t, n, i, r) {var s = 3 * t[n - 1],o = 3 * t[n - 1] + 1,a = e[s],l = e[o];return h = i, c = r, u = a, f = l, Math.sqrt((u - h) * (u - h) + (f - c) * (f - c));var h, c, u, f;}var _H17 = H(),Ga = _H17.PackUtil,ja = _H17.ArrayPool;function Wa(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g, m) {var y = t.getLength(),x = r / 3;for (var _n293 = 2, _i206 = y; _n293 < _i206; _n293 += 3) e[r + _n293 - 2] = t[_n293 - 2], e[r + _n293 - 1] = t[_n293 - 1], e[r + _n293 - 0] = t[_n293] - o;r += y;for (var _n294 = 2, _i207 = y; _n294 < _i207; _n294 += 3) e[r + _n294 - 2] = t[_n294 - 2], e[r + _n294 - 1] = t[_n294 - 1], e[r + _n294 - 0] = t[_n294] - a;r += y, e.trySetLength(r + y), e.copyWithin(r, r - 2 * y, r - y), r += y, e.trySetLength(r + y), e.copyWithin(r, r - 2 * y, r - y), r += y, (n = n || []).push(y / 3);var _ = n.getLength();for (var _t408 = 0; _t408 < _; _t408++) {Xa(x + (n[_t408 - 1] || 0), x + n[_t408], e, y / 3, l, i, h, c, u, f, s, d, p, g, m);}return r;}function Xa(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p) {var g = s.getLength();var m, y;for (var _o98 = e, _a67 = t; _o98 < _a67 - 1; _o98++) if (m = _o98, y = _o98 + 1, r === 1 / 0 || !Da(n, m, y, r)) if ((_o98 - e) % 2 == 1 && (m += 2 * i, y += 2 * i), p) {var _e466 = s.currentIndex;s[_e466++] = m + i, s[_e466++] = y, s[_e466++] = m, s[_e466++] = y + i, s[_e466++] = y, s[_e466++] = m + i, s.currentIndex = _e466;} else {var _e467 = s.currentIndex;s[_e467++] = m + i, s[_e467++] = m, s[_e467++] = y, s[_e467++] = y, s[_e467++] = y + i, s[_e467++] = m + i, s.currentIndex = _e467;}o && function (e, t, n, i, r, s, o, a, l, h, c, u) {var f,d = 0,p = 0,g = 0,m = 0;var y = u ? [1, 3, 4] : [2, 3, 4];for (var _u23 = s.getLength() - 1; _u23 >= o; _u23--) {var _o99 = s[_u23],_x9 = 3 * _o99 + 1,_10 = 3 * _o99 + 2,_v7 = r[3 * _o99],_b7 = r[_x9],_A7 = r[_10];d || p || (d = Math.max(r[_10], r[3 * s[_u23 - 3] + 2]), p = Math.min(r[_10], r[3 * s[_u23 - 3] + 2]), f = d - p);var _T2 = g;var _w4 = _u23 % 6;0 === e ? (5 === _w4 && (m = Ba(r, s, _u23, _v7, _b7)), _T2 = _w4 === y[0] || _w4 === y[1] || _w4 === y[2] ? g : g + m) : 1 === e && (_w4 === y[0] || _w4 === y[1] || _w4 === y[2] ? _T2 = 0 : 5 === _w4 ? (m = Ba(r, s, _u23, _v7, _b7), _T2 = m) : _T2 = m);var _S2 = _T2 / h * (1 / (100 * c)) / a;var _M2 = void 0;_M2 = 1 === t ? _A7 === d ? 1 : 0 : \"bottom\" === n ? _A7 === d ? f / 100 / l : 0 : _A7 === d ? 0 : -f / 100 / l, i[2 * _o99] = _S2, i[2 * _o99 + 1] = _M2, 0 === _w4 && (g += m);}}(a, l, h, c, n, s, g, u[0], u[1], f, d, p);}function Ya(e) {var t = [e[0]];var n = e[0];for (var _i208 = 1; _i208 < e.length; _i208++) Array.isArray(e[_i208]) ? e[_i208][0] === n[0] && e[_i208][1] === n[1] && e[_i208][2] === n[2] || t.push(e[_i208]) : e[_i208].x === n.x && e[_i208].y === n.y && e[_i208].z === n.z || t.push(e[_i208]), n = e[_i208];return t;}var _H18 = H(),Za = _H18.StyleUtil,qa = _H18.PackUtil,$a = _H18.ArrayPool,Ja = $a.getInstance();function Ka(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {void 0 === t.top && (t.top = !0), void 0 === t.side && (t.side = !0), Ja.reset();var m = t.altitudeScale,y = t.altitudeProperty,x = t.defaultAltitude,A = t.heightProperty,T = t.minHeightProperty,w = t.defaultHeight,S = t.tangent,M = t.uv,R = t.topUVMode,E = t.sideUVMode,D = t.sideVerticalUVMode,L = t.top,H = t.side,N = t.textureYOrigin,z = t.topThickness,V = !!g,U = function (e, t, _ref127, _ref128, M, P) {var n = _ref127.altitudeScale,i = _ref127.altitudeProperty,r = _ref127.defaultAltitude,s = _ref127.heightProperty,o = _ref127.minHeightProperty,a = _ref127.defaultHeight;var l = _ref128.center,h = _ref128.side,c = _ref128.top,u = _ref128.topThickness,f = _ref128.uvOrigin,d = _ref128.uv,p = _ref128.uvSize,g = _ref128.topUVMode,m = _ref128.sideUVMode,y = _ref128.sideVerticalUVMode,x = _ref128.textureYOrigin,_ = _ref128.tileRatio,v = _ref128.centimeterToPoint,b = _ref128.verticalCentimeterToPoint,A = _ref128.positionType,T = _ref128.res,w = _ref128.glScale,S = _ref128.projectionCode;var I = t / e[0].extent;t === 1 / 0 && (I = 1);var k = t === 1 / 0,F = P.get(),O = P.get(),R = P.get(),E = P.getProxy(),D = P.get(),L = P.get(),H = P.get(),N = !!d,z = !!c,V = !!h,U = N ? P.get() : null;function B(e, n, i, r, s, o) {var a = n;if (z) {var _h38 = (0, _earcut.default)(E, i, 3);if (0 === _h38.length) return n;var _c27 = E.getLength(),_d15 = D.currentIndex;for (var _e468 = 0; _e468 < _c27; _e468++) D[_d15++] = E[_e468];if (D.currentIndex = _d15, n += E.getLength(), o) for (var _t409 = 2, _n295 = _h38.length; _t409 < _n295; _t409 += 3) _h38[_t409] += e / 3, _h38[_t409 - 1] += e / 3, _h38[_t409 - 2] += e / 3;else {var _t410;for (var _n296 = 2, _i209 = _h38.length; _n296 < _i209; _n296 += 3) _t410 = _h38[_n296 - 1], _h38[_n296 - 1] = _h38[_n296] + e / 3, _h38[_n296] = _t410 + e / 3, _h38[_n296 - 2] += e / 3;}_c27 = _h38.length, _d15 = L.currentIndex;for (var _e469 = 0; _e469 < _c27; _e469++) L[_d15++] = _h38[_e469];L.currentIndex = _d15, N && Va(g || 0, e, n, U, D, f, v, _, p[0], p[1], s, T, w, S, l), u > 0 && !V && (n = Wa(D, E, i, L, n, U, 0, u, t, N, m || 0, y || 0, x, p, _, b, r < 0 ? !o : o)), H.setLength(n / 3), H.fill(1, a / 3, n / 3);}if (V) {z && (u = 0), a = n, n = Wa(D, E, i, L, n, U, u, r, t, N, m || 0, y || 0, x, p, _, b, r < 0 ? !o : o), H.setLength(n / 3);var _e470 = E.getLength() / 3;H.fill(1, a / 3, a / 3 + _e470), H.fill(0, a / 3 + _e470, a / 3 + 2 * _e470), H.fill(1, a / 3 + 2 * _e470, a / 3 + 3 * _e470), H.fill(0, a / 3 + 3 * _e470, n / 3);}return n;}var j = -1 / 0,W = 1 / 0,X = 0;var Y = [-1, -1, t + 1, t + 1];var Z = 0,q = e.length;G(M) && (Z = M, q = M + 1);var $ = 0,J = !1;var K = P.getProxy();var Q = !1;for (; Z < q; Z++) {var _l56 = e[Z],_h39 = _l56.id;G(_h39) && (Math.abs(_h39) > $ && ($ = Math.abs(_h39)), _h39 < 0 && (J = !0));var _c28 = _l56.geometry,_u24 = _l56.properties[ye];var _f19 = Array.isArray(_u24 && _u24[0] && _u24[0][0]) ? _u24[0] : _u24;var _Ga$getFeaAltitudeAnd = Ga.getFeaAltitudeAndHeight(_l56, n, i, r, s, a, o),_d16 = _Ga$getFeaAltitudeAnd.altitude,_p9 = _Ga$getFeaAltitudeAnd.height;_p9 < 0 ? (Q = !0, W = Math.min(_d16, W), j = Math.max(_d16 - _p9, j)) : (j = Math.max(_d16, j), W = Math.min(_d16 - _p9, W));var _g9 = D.getLength();var _m10 = 0,_y9 = X;K.setLength(0), E.setLength(0);var _x10 = Ga.calculateSignedArea(_c28[0]) < 0;for (var _e471 = 0, _n297 = _c28.length; _e471 < _n297; _e471++) {var _i210 = _c28[_e471];_x10 && (_i210 = _i210.reverse()), _i210 = Ya(_i210);var _r164 = Ga.calculateSignedArea(_i210) < 0;if (!_r164 && _e471 > 0 && (_m10++, _f19 = _u24 && _u24[_m10], X = B(_y9, X, K, _p9 * I, _f19, k), E.setLength(0), K.setLength(0), _y9 = X), t !== 1 / 0 && (_i210 = Ga.clipPolygon(_i210, Y)), !_i210.length) {_e471 === _n297 - 1 && (X = B(_y9, X, K, _p9 * I, _f19, k));continue;}var _s135 = _i210.length;if (Array.isArray(_i210[0]) ? _i210[0][0] === _i210[_s135 - 1][0] && _i210[0][1] === _i210[_s135 - 1][1] || _i210.push([_i210[0][0], _i210[0][1]]) : _i210[0].x === _i210[_s135 - 1].x && _i210[0].y === _i210[_s135 - 1].y || _i210.push(_i210[0]), _r164) {var _e472 = K.currentIndex;K[_e472++] = E.getLength() / 3, K.currentIndex = _e472;}Ea(E, E.getLength(), _i210, I, _d16, 0, A), _e471 === _n297 - 1 && (X = B(_y9, X, K, _p9 * I, _f19, k));}var _11 = D.getLength() - _g9,_v8 = (pe + \"\").trim();for (var _e473 = 0; _e473 < _11 / 3; _e473++) {var _e474 = O.currentIndex;O[_e474++] = void 0 === _l56[_v8] ? Z : _l56[_v8], O.currentIndex = _e474, _e474 = F.currentIndex, F[_e474++] = Z, F.currentIndex = _e474, G(_h39) && (_e474 = R.currentIndex, R[_e474++] = _h39, R.currentIndex = _e474);}}var ee = Ga.getUnsignedArrayType(O.getLength() ? O[O.getLength() - 1] : 0),te = { hasNegativeHeight: Q, maxAltitude: j === -1 / 0 ? 0 : j, minAltitude: W === 1 / 0 ? 0 : W, vertices: D, verticeTypes: H, indices: L, pickingIds: ja.createTypedArray(O, ee), featureIndexes: F };if (R.getLength()) {var _e475 = J ? Ga.getPosArrayType($) : Ga.getUnsignedArrayType($);te.featureIds = ja.createTypedArray(R, _e475);} else te.featureIds = [];return U && (U.setLength(D.getLength() / 3 * 2), te.uvs = U), te;}(e, n, { altitudeScale: m, altitudeProperty: y, defaultAltitude: x || 0, heightProperty: A, minHeightProperty: T, defaultHeight: w || 0 }, { center: g, top: L, side: H, topThickness: 10 * z || 0, uv: M || S, uvSize: [r, r], uvOrigin: i, topUVMode: R, sideUVMode: E, sideVerticalUVMode: D, textureYOrigin: N, tileRatio: a, centimeterToPoint: l, verticalCentimeterToPoint: h, positionType: p, res: s, glScale: o, projectionCode: f }, d, Ja),B = [],j = U.vertices.getLength() / 3,W = qa.getIndexArrayType(j),X = $a.createTypedArray(U.indices, W);delete U.indices, B.push(X.buffer, U.pickingIds.buffer);var Y = Math.max(Math.abs(U.maxAltitude), Math.abs(U.minAltitude)),q = p || qa.getPosArrayType(Math.max(512, Y));U.vertices = $a.createTypedArray(U.vertices, q);var $ = S ? Ja.getProxy() : new Float32Array(3 * j);$.setLength && $.setLength(3 * j);var J = (0, _tbnPacker.buildNormals)(U.vertices, X, $);var K = !0;var Q = J.getLength ? J.getLength() : J.length;for (var _e476 = 0; _e476 < Q; _e476++) {V || (J[_e476] = -J[_e476]);var _t411 = J[_e476] % 1;1 - Math.abs(_t411) > 1e-6 ? K = !1 : 0 !== _t411 && (J[_e476] = Math.round(J[_e476]));}if (U.normals = J, S) {var _e477 = Ja.get();_e477.setLength(4 * j), _e477 = (0, _tbnPacker.buildTangents)(U.vertices, U.normals, U.uvs, X, _e477), _e477 = function (e, t) {var n = t.getLength(),i = new Float32Array(n),r = [],s = [],o = [];for (var _a68 = 0; _a68 < n; _a68 += 4) {var _n298 = _a68 / 4 * 3;_glMatrix.vec3.set(s, e[_n298] || 0, e[_n298 + 1] || 0, e[_n298 + 2] || 0), _glMatrix.vec4.set(r, t[_a68] || 0, t[_a68 + 1] || 0, t[_a68 + 2] || 0, t[_a68 + 3] || 0), (0, _tbnPacker.packTangentFrame)(o, s, r), _glMatrix.vec4.copy(i.subarray(_a68, _a68 + 4), o);}return i;}(U.normals, _e477), U.tangents = _e477, B.push(_e477.buffer), delete U.normals;}if (U.normals && (K && (U.normals = $a.createTypedArray(U.normals, Int8Array)), B.push(U.normals.buffer)), U.uvs) {var _e478 = U.uvs;U.uvs = $a.createTypedArray(_e478, Float32Array), B.push(U.uvs.buffer);}if (g) {var _e479 = U.vertices,_t412 = _e479.length;for (var _n299 = 0; _n299 < _t412; _n299 += 3) _e479[_n299] -= g[0], _e479[_n299 + 1] -= g[1];}var ee = function (e, t, n, i) {var r = {},s = {},o = i.getLength();if (Z(t.polygonFill)) {var _a69 = (0, _functionType.piecewiseConstant)(t.polygonFill);var _l57 = new Uint8Array(4 * o);_l57.fill(255);for (var _t413 = 0; _t413 < o; _t413++) {var _s136 = e[i[_t413]],_o100 = _s136.properties || {};_o100.$layer = _s136.layer, _o100.$type = _s136.type;var _h40 = _a69(n, _o100);(0, _functionType.isFunctionDefinition)(_h40) && (r.aColor = 1, _a69 = (0, _functionType.piecewiseConstant)(_h40), _h40 = _a69(n, _o100)), delete _o100.$layer, delete _o100.$type, Za.normalizeColor(Qa, _h40), _l57[4 * _t413] = Qa[0], _l57[4 * _t413 + 1] = Qa[1], _l57[4 * _t413 + 2] = Qa[2], _l57[4 * _t413 + 3] = Qa[3];}s.aColor = _l57;}if (Z(t.polygonOpacity)) {var _a70 = (0, _functionType.interpolated)(t.polygonOpacity);var _l58 = new Uint8Array(o);_l58.fill(255);for (var _t414 = 0; _t414 < o; _t414++) {var _s137 = e[i[_t414]],_o101 = _s137.properties || {};_o101.$layer = _s137.layer, _o101.$type = _s137.type;var _h41 = _a70(n, _o101);(0, _functionType.isFunctionDefinition)(_h41) && (r.aOpacity = 1, _a70 = (0, _functionType.piecewiseConstant)(_h41), _h41 = _a70(n, _o101)), delete _o101.$layer, delete _o101.$type, _l58[_t414] = 255 * _h41;}s.aOpacity = _l58;}return s.dynamicAttributes = r, s;}(e, c, u, U.featureIndexes),te = function (e, t, n, i, r) {var s = [[], []],o = Z(i.topPolygonFill),a = Z(i.bottomPolygonFill),l = [255, 255, 255, 255],h = t.getLength();if (o || a) {var _c29 = o && (0, _functionType.piecewiseConstant)(i.topPolygonFill),_u25 = a && (0, _functionType.piecewiseConstant)(i.bottomPolygonFill),_f20 = null,_d17 = null,_p10 = null,_g10 = null;for (var _i211 = 0; _i211 < h; _i211++) {if (1 === e[_i211] && !o || 0 === e[_i211] && !a) continue;var _h42 = 1 === e[_i211];if (_h42 && t[_i211] === _f20) {e[_i211] = _p10;continue;}if (!_h42 && t[_i211] === _d17) {e[_i211] = _g10;continue;}var _m11 = n[t[_i211]],_y10 = _m11.properties || {};_y10.$layer = _m11.layer, _y10.$type = _m11.type;var _x11 = _h42 ? _c29 : _u25,_v9 = _x11(r, _y10);(0, _functionType.isFunctionDefinition)(_v9) && (_x11 = (0, _functionType.piecewiseConstant)(_v9), _v9 = _x11(r, _y10)), delete _y10.$layer, delete _y10.$type, Za.normalizeColor(Qa, _v9), _glMatrix.vec4.divide(Qa, Qa, l);var _A8 = el(s, Qa);_A8 < 0 && (_A8 = s.length, s.push(_glMatrix.vec4.copy([], Qa))), e[_i211] = _A8, _h42 ? (_f20 = t[_i211], _p10 = _A8) : (_d17 = t[_i211], _g10 = _A8);}}return s.slice(2);}(U.verticeTypes, U.featureIndexes, e, c, u),ne = { data: { data: { aVertexColorType: te.length <= 252 ? $a.createTypedArray(U.verticeTypes, Uint8Array) : $a.createTypedArray(U.verticeTypes, Uint16Array), aPosition: U.vertices, aNormal: U.normals, aTexCoord0: U.uvs, aTangent: U.tangents, aPickingId: U.pickingIds }, indices: X, properties: { maxAltitude: U.maxAltitude / 100, minAltitude: U.minAltitude / 100, hasNegativeHeight: U.hasNegativeHeight }, dynamicAttributes: ee.dynamicAttributes, vertexColors: te }, buffers: B };return U.featureIds.length ? (ne.data.featureIds = U.featureIds, B.push(ne.data.featureIds.buffer)) : ne.data.featureIds = [], ee.aColor && (ne.data.data.aColor = ee.aColor, ne.buffers.push(ee.aColor.buffer)), ee.aOpacity && (ne.data.data.aOpacity = ee.aOpacity, ne.buffers.push(ee.aOpacity.buffer)), ne.buffers.push(ne.data.data.aPosition.buffer), ne.data.pickingIdIndiceMap = qa.generatePickingIndiceIndex(ne.data.data.aPickingId, ne.data.indices), ne;}var Qa = [];function el(e, t) {for (var _n300 = 0; _n300 < e.length; _n300++) if (_glMatrix.vec4.exactEquals(t, e[_n300])) return _n300;return -1;}H();var tl = function () {function tl() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : nl;_classCallCheck(this, tl);if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0) for (var _e480 = (this.length >> 1) - 1; _e480 >= 0; _e480--) this._down(_e480);}return _createClass(tl, [{ key: \"push\", value: function push(e) {this.data.push(e), this.length++, this._up(this.length - 1);} }, { key: \"pop\", value: function pop() {if (0 === this.length) return;var e = this.data[0],t = this.data.pop();return this.length--, this.length > 0 && (this.data[0] = t, this._down(0)), e;} }, { key: \"peek\", value: function peek() {return this.data[0];} }, { key: \"_up\", value: function _up(e) {var t = this.data,n = this.compare,i = t[e];for (; e > 0;) {var _r165 = e - 1 >> 1,_s138 = t[_r165];if (n(i, _s138) >= 0) break;t[e] = _s138, e = _r165;}t[e] = i;} }, { key: \"_down\", value: function _down(e) {var t = this.data,n = this.compare,i = this.length >> 1,r = t[e];for (; e < i;) {var _i212 = 1 + (e << 1),_s139 = t[_i212];var _o102 = _i212 + 1;if (_o102 < this.length && n(t[_o102], _s139) < 0 && (_i212 = _o102, _s139 = t[_o102]), n(_s139, r) >= 0) break;t[e] = _s139, e = _i212;}t[e] = r;} }]);}();function nl(e, t) {return e < t ? -1 : e > t ? 1 : 0;}var il = { exports: {} },rl = function rl(e, t, n, i) {var r = e[0],s = e[1],o = !1;void 0 === n && (n = 0), void 0 === i && (i = t.length);for (var a = (i - n) / 2, l = 0, h = a - 1; l < a; h = l++) {var c = t[n + 2 * l + 0],u = t[n + 2 * l + 1],f = t[n + 2 * h + 0],d = t[n + 2 * h + 1];u > s != d > s && r < (f - c) * (s - u) / (d - u) + c && (o = !o);}return o;},sl = function sl(e, t, n, i) {var r = e[0],s = e[1],o = !1;void 0 === n && (n = 0), void 0 === i && (i = t.length);for (var a = i - n, l = 0, h = a - 1; l < a; h = l++) {var c = t[l + n][0],u = t[l + n][1],f = t[h + n][0],d = t[h + n][1];u > s != d > s && r < (f - c) * (s - u) / (d - u) + c && (o = !o);}return o;};il.exports = function (e, t, n, i) {return t.length > 0 && Array.isArray(t[0]) ? sl(e, t, n, i) : rl(e, t, n, i);};var ol = il.exports.nested = sl;il.exports.flat = rl;var al = 11102230246251565e-32,ll = 134217729,hl = (3 + 8 * al) * al;function cl(e, t, n, i, r) {var s,o,a,l,h = t[0],c = i[0],u = 0,f = 0;c > h == c > -h ? (s = h, h = t[++u]) : (s = c, c = i[++f]);var d = 0;if (u < e && f < n) for (c > h == c > -h ? (o = h + s, a = s - (o - h), h = t[++u]) : (o = c + s, a = s - (o - c), c = i[++f]), s = o, 0 !== a && (r[d++] = a); u < e && f < n;) c > h == c > -h ? (o = s + h, l = o - s, a = s - (o - l) + (h - l), h = t[++u]) : (o = s + c, l = o - s, a = s - (o - l) + (c - l), c = i[++f]), s = o, 0 !== a && (r[d++] = a);for (; u < e;) o = s + h, l = o - s, a = s - (o - l) + (h - l), h = t[++u], s = o, 0 !== a && (r[d++] = a);for (; f < n;) o = s + c, l = o - s, a = s - (o - l) + (c - l), c = i[++f], s = o, 0 !== a && (r[d++] = a);return 0 === s && 0 !== d || (r[d++] = s), d;}function ul(e) {return new Float64Array(e);}var fl = 33306690738754716e-32,dl = 22204460492503146e-32,pl = 11093356479670487e-47,gl = ul(4),ml = ul(8),yl = ul(12),xl = ul(16),_l = ul(4);function vl(e, t, n, i, r, s) {var o = (t - s) * (n - r),a = (e - r) * (i - s),l = o - a;if (0 === o || 0 === a || o > 0 != a > 0) return l;var h = Math.abs(o + a);return Math.abs(l) >= fl * h ? l : -function (e, t, n, i, r, s, o) {var a, l, h, c, u, f, d, p, g, m, y, x, _, v, b, A, T, w;var S = e - r,M = n - r,P = t - s,I = i - s;v = S * I, f = ll * S, d = f - (f - S), p = S - d, f = ll * I, g = f - (f - I), m = I - g, b = p * m - (v - d * g - p * g - d * m), A = P * M, f = ll * P, d = f - (f - P), p = P - d, f = ll * M, g = f - (f - M), m = M - g, T = p * m - (A - d * g - p * g - d * m), y = b - T, u = b - y, gl[0] = b - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u), y = _ - A, u = _ - y, gl[1] = _ - (y + u) + (u - A), w = x + y, u = w - x, gl[2] = x - (w - u) + (y - u), gl[3] = w;var C = function (e, t) {var n = t[0];for (var _i213 = 1; _i213 < e; _i213++) n += t[_i213];return n;}(4, gl),k = dl * o;if (C >= k || -C >= k) return C;if (u = e - S, a = e - (S + u) + (u - r), u = n - M, h = n - (M + u) + (u - r), u = t - P, l = t - (P + u) + (u - s), u = i - I, c = i - (I + u) + (u - s), 0 === a && 0 === l && 0 === h && 0 === c) return C;if (k = pl * o + hl * Math.abs(C), C += S * c + I * a - (P * h + M * l), C >= k || -C >= k) return C;v = a * I, f = ll * a, d = f - (f - a), p = a - d, f = ll * I, g = f - (f - I), m = I - g, b = p * m - (v - d * g - p * g - d * m), A = l * M, f = ll * l, d = f - (f - l), p = l - d, f = ll * M, g = f - (f - M), m = M - g, T = p * m - (A - d * g - p * g - d * m), y = b - T, u = b - y, _l[0] = b - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u), y = _ - A, u = _ - y, _l[1] = _ - (y + u) + (u - A), w = x + y, u = w - x, _l[2] = x - (w - u) + (y - u), _l[3] = w;var F = cl(4, gl, 4, _l, ml);v = S * c, f = ll * S, d = f - (f - S), p = S - d, f = ll * c, g = f - (f - c), m = c - g, b = p * m - (v - d * g - p * g - d * m), A = P * h, f = ll * P, d = f - (f - P), p = P - d, f = ll * h, g = f - (f - h), m = h - g, T = p * m - (A - d * g - p * g - d * m), y = b - T, u = b - y, _l[0] = b - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u), y = _ - A, u = _ - y, _l[1] = _ - (y + u) + (u - A), w = x + y, u = w - x, _l[2] = x - (w - u) + (y - u), _l[3] = w;var O = cl(F, ml, 4, _l, yl);v = a * c, f = ll * a, d = f - (f - a), p = a - d, f = ll * c, g = f - (f - c), m = c - g, b = p * m - (v - d * g - p * g - d * m), A = l * h, f = ll * l, d = f - (f - l), p = l - d, f = ll * h, g = f - (f - h), m = h - g, T = p * m - (A - d * g - p * g - d * m), y = b - T, u = b - y, _l[0] = b - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u), y = _ - A, u = _ - y, _l[1] = _ - (y + u) + (u - A), w = x + y, u = w - x, _l[2] = x - (w - u) + (y - u), _l[3] = w;var R = cl(O, yl, 4, _l, xl);return xl[R - 1];}(e, t, n, i, r, s, h);}function bl(e, t, n) {t = Math.max(0, void 0 === t ? 2 : t), n = n || 0;var i = function (e) {for (var t = e[0], n = e[0], i = e[0], r = e[0], s = 0; s < e.length; s++) {var o = e[s];o[0] < t[0] && (t = o), o[0] > i[0] && (i = o), o[1] < n[1] && (n = o), o[1] > r[1] && (r = o);}var a = [t, n, i, r],l = a.slice();for (s = 0; s < e.length; s++) ol(e[s], a) || l.push(e[s]);return function (e) {e.sort(Rl);for (var t = [], n = 0; n < e.length; n++) {for (; t.length >= 2 && Pl(t[t.length - 2], t[t.length - 1], e[n]) <= 0;) t.pop();t.push(e[n]);}for (var i = [], r = e.length - 1; r >= 0; r--) {for (; i.length >= 2 && Pl(i[i.length - 2], i[i.length - 1], e[r]) <= 0;) i.pop();i.push(e[r]);}return i.pop(), t.pop(), t.concat(i);}(l);}(e),r = new _rbush.default(16);r.toBBox = function (e) {return { minX: e[0], minY: e[1], maxX: e[0], maxY: e[1] };}, r.compareMinX = function (e, t) {return e[0] - t[0];}, r.compareMinY = function (e, t) {return e[1] - t[1];}, r.load(e);for (var s, o = [], a = 0; a < i.length; a++) {var l = i[a];r.remove(l), s = Cl(l, s), o.push(s);}var h = new _rbush.default(16);for (a = 0; a < o.length; a++) h.insert(Il(o[a]));for (var c = t * t, u = n * n; o.length;) {var f = o.shift(),d = f.p,p = f.next.p,g = kl(d, p);if (!(g < u)) {var m = g / c;(l = Al(r, f.prev.p, d, p, f.next.next.p, m, h)) && Math.min(kl(l, d), kl(l, p)) <= m && (o.push(f), o.push(Cl(l, f)), r.remove(l), h.remove(f), h.insert(Il(f)), h.insert(Il(f.next)));}}f = s;var y = [];do {y.push(f.p), f = f.next;} while (f !== s);return y.push(f.p), y;}function Al(e, t, n, i, r, s, o) {for (var a = new tl([], Tl), l = e.data; l;) {for (var h = 0; h < l.children.length; h++) {var c = l.children[h],u = l.leaf ? Fl(c, n, i) : wl(n, i, c);u > s || a.push({ node: c, dist: u });}for (; a.length && !a.peek().node.children;) {var f = a.pop(),d = f.node,p = Fl(d, t, n),g = Fl(d, i, r);if (f.dist < p && f.dist < g && Ml(n, d, o) && Ml(i, d, o)) return d;}(l = a.pop()) && (l = l.node);}return null;}function Tl(e, t) {return e.dist - t.dist;}function wl(e, t, n) {if (Sl(e, n) || Sl(t, n)) return 0;var i = Ol(e[0], e[1], t[0], t[1], n.minX, n.minY, n.maxX, n.minY);if (0 === i) return 0;var r = Ol(e[0], e[1], t[0], t[1], n.minX, n.minY, n.minX, n.maxY);if (0 === r) return 0;var s = Ol(e[0], e[1], t[0], t[1], n.maxX, n.minY, n.maxX, n.maxY);if (0 === s) return 0;var o = Ol(e[0], e[1], t[0], t[1], n.minX, n.maxY, n.maxX, n.maxY);return 0 === o ? 0 : Math.min(i, r, s, o);}function Sl(e, t) {return e[0] >= t.minX && e[0] <= t.maxX && e[1] >= t.minY && e[1] <= t.maxY;}function Ml(e, t, n) {for (var i, r, s, o, a = Math.min(e[0], t[0]), l = Math.min(e[1], t[1]), h = Math.max(e[0], t[0]), c = Math.max(e[1], t[1]), u = n.search({ minX: a, minY: l, maxX: h, maxY: c }), f = 0; f < u.length; f++) if (i = u[f].p, r = u[f].next.p, s = e, i !== (o = t) && r !== s && Pl(i, r, s) > 0 != Pl(i, r, o) > 0 && Pl(s, o, i) > 0 != Pl(s, o, r) > 0) return !1;return !0;}function Pl(e, t, n) {return vl(e[0], e[1], t[0], t[1], n[0], n[1]);}function Il(e) {var t = e.p,n = e.next.p;return e.minX = Math.min(t[0], n[0]), e.minY = Math.min(t[1], n[1]), e.maxX = Math.max(t[0], n[0]), e.maxY = Math.max(t[1], n[1]), e;}function Cl(e, t) {var n = { p: e, prev: null, next: null, minX: 0, minY: 0, maxX: 0, maxY: 0 };return t ? (n.next = t.next, n.prev = t, t.next.prev = n, t.next = n) : (n.prev = n, n.next = n), n;}function kl(e, t) {var n = e[0] - t[0],i = e[1] - t[1];return n * n + i * i;}function Fl(e, t, n) {var i = t[0],r = t[1],s = n[0] - i,o = n[1] - r;if (0 !== s || 0 !== o) {var a = ((e[0] - i) * s + (e[1] - r) * o) / (s * s + o * o);a > 1 ? (i = n[0], r = n[1]) : a > 0 && (i += s * a, r += o * a);}return (s = e[0] - i) * s + (o = e[1] - r) * o;}function Ol(e, t, n, i, r, s, o, a) {var l,h,c,u,f = n - e,d = i - t,p = o - r,g = a - s,m = e - r,y = t - s,x = f * f + d * d,_ = f * p + d * g,v = p * p + g * g,b = f * m + d * y,A = p * m + g * y,T = x * v - _ * _,w = T,S = T;0 === T ? (h = 0, w = 1, u = A, S = v) : (u = x * A - _ * b, (h = _ * A - v * b) < 0 ? (h = 0, u = A, S = v) : h > w && (h = w, u = A + _, S = v)), u < 0 ? (u = 0, -b < 0 ? h = 0 : -b > x ? h = w : (h = -b, w = x)) : u > S && (u = S, -b + _ < 0 ? h = 0 : -b + _ > x ? h = w : (h = -b + _, w = x));var M = (1 - (c = 0 === u ? 0 : u / S)) * r + c * o - ((1 - (l = 0 === h ? 0 : h / w)) * e + l * n),P = (1 - c) * s + c * a - ((1 - l) * t + l * i);return M * M + P * P;}function Rl(e, t) {return e[0] === t[0] ? e[1] - t[1] : e[0] - t[0];}var _H19 = H(),El = _H19.PackUtil;var Dl = function () {function Dl(e, t) {_classCallCheck(this, Dl);this.x = e, this.y = t;}return _createClass(Dl, [{ key: \"clone\", value: function clone() {return new Dl(this.x, this.y);} }, { key: \"normalize\", value: function normalize() {var e = this.length();this.x /= e, this.y /= e;} }, { key: \"negate\", value: function negate() {this.x = -this.x, this.y = -this.y;} }, { key: \"length\", value: function length() {return Math.sqrt(this.x * this.x + this.y * this.y);} }, { key: \"diff\", value: function diff(e) {return new Dl(this.x - e.x, this.y - e.y);} }, { key: \"distance\", value: function distance(e) {var t = this.x - e.x,n = this.y - e.y;return Math.sqrt(t * t + n * n);} }, { key: \"dot\", value: function dot(e) {return this.x * e.x + this.y * e.y;} }, { key: \"equals\", value: function equals(e) {return this.x === e.x && this.y === e.y;} }, { key: \"orthogonal\", value: function orthogonal() {return new Dl(this.y, -this.x);} }]);}();function Ll(e, t, n, i) {var r = t.x * i.y - t.y * i.x,s = n.x - e.x,o = n.y - e.y,a = (s * i.y - o * i.x) / r;return new Dl(e.x + a * t.x, e.y + a * t.y);}var Hl = [],Nl = [];function zl(e) {if (G(e[0] && e[0].x)) {var _t415 = [];var _n301 = 0;for (var _i214 = 0; _i214 < e.length; _i214++) Nl[_n301] ? (Nl[_n301][0] = e[_i214].x, Nl[_n301][1] = e[_i214].y) : Nl[_n301] = [e[_i214].x, e[_i214].y], _t415.push(Nl[_n301]), _n301++;e = _t415;}try {var _t416 = bl(e, 1 / 0);var _n302 = [1 / 0, 1 / 0],_i215 = [-1 / 0, -1 / 0];for (var _e481 = 0; _e481 < _t416.length; _e481++) _t416[_e481][0] < _n302[0] && (_n302[0] = _t416[_e481][0]), _t416[_e481][0] > _i215[0] && (_i215[0] = _t416[_e481][0]), _t416[_e481][1] < _n302[1] && (_n302[1] = _t416[_e481][1]), _t416[_e481][1] > _i215[1] && (_i215[1] = _t416[_e481][1]);var _r166 = [];var _s140 = [],_o103 = 0;for (var _e482 = 0; _e482 < _t416.length; _e482++) _e482 === _t416.length - 1 && _t416[_e482][0] === _t416[0][0] && _t416[_e482][1] === _t416[0][1] || (za(_r166, _t416[_e482]), Hl[_o103] ? (Hl[_o103].x = _r166[0], Hl[_o103].y = _r166[1]) : Hl[_o103] = new Dl(_r166[0], _r166[1]), _s140.push(Hl[_o103]), _o103++);El.calculateSignedArea(_s140) < 0 && (_s140 = _s140.reverse());var _a71 = function (e) {var t,n = Number.MAX_VALUE;var i = function i(e, _i216, r, s, o, a, l, h) {var c = Ll(e, _i216, o, a),u = Ll(r, s, o, a),f = Ll(l, h, e, _i216),d = Ll(l, h, r, s),p = c.distance(u) * c.distance(f);0 !== p && p < n && (t = [c, f, d, u], n = p);};var r = [];for (var _t417 = 0; _t417 < e.length; _t417++) r.push(e[(_t417 + 1) % e.length].diff(e[_t417])), r[_t417].normalize();var s,o,a,l,h = new Dl(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY),c = new Dl(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);for (var _t418 = 0; _t418 < e.length; _t418++) {var u = e[_t418];u.x < h.x && (h.x = u.x, s = _t418), u.x > c.x && (c.x = u.x, o = _t418), u.y < h.y && (h.y = u.y, l = _t418), u.y > c.y && (c.y = u.y, a = _t418);}var f = new Dl(0, -1),d = new Dl(0, 1),p = new Dl(-1, 0),g = new Dl(1, 0);for (var _t419 = 0; _t419 < e.length; _t419++) {var m = [Math.acos(f.dot(r[s])), Math.acos(d.dot(r[o])), Math.acos(p.dot(r[a])), Math.acos(g.dot(r[l]))];switch (m.indexOf(Math.min.apply(Math, m))) {case 0:(d = (f = r[s].clone()).clone()).negate(), (g = (p = f.orthogonal()).clone()).negate(), s = (s + 1) % e.length;break;case 1:(f = (d = r[o].clone()).clone()).negate(), (g = (p = f.orthogonal()).clone()).negate(), o = (o + 1) % e.length;break;case 2:(g = (p = r[a].clone()).clone()).negate(), (d = (f = g.orthogonal()).clone()).negate(), a = (a + 1) % e.length;break;case 3:(p = (g = r[l].clone()).clone()).negate(), (d = (f = g.orthogonal()).clone()).negate(), l = (l + 1) % e.length;}i(e[s], f, e[o], d, e[a], p, e[l], g);}return t;}(_s140);if (!_a71 || 4 !== _a71.length) return null;var _l59 = _a71[0].distance(_a71[1]),_h43 = _a71[1].distance(_a71[2]),_c30 = _a71.map(function (e) {return [e.x, e.y];});return _c30.push(+(_h43 > _l59)), _c30;} catch (e) {return null;}}var _H20 = H(),Vl = _H20.DEFAULT_TEX_WIDTH;var Ul = exports.ExtrudePolygonLayer = function (_mt4) {function Ul() {_classCallCheck(this, Ul);return _callSuper(this, Ul, arguments);}_inherits(Ul, _mt4);return _createClass(Ul, [{ key: \"getPolygonOffsetCount\", value: function getPolygonOffsetCount() {return 0;} }, { key: \"getPolygonOffset\", value: function getPolygonOffset() {return 0;} }, { key: \"onConfig\", value: function onConfig(e) {var t = this.getRenderer();return t && t.onConfig(e), _superPropGet(Ul, \"onConfig\", this, 3)([e]);} }, { key: \"updateMaterial\", value: function updateMaterial(e) {this.options.material || (this.options.material = {}), e ? U(this.options.material, e) : this.options.material = null;var t = this.getRenderer();return t && t.updateMaterial(e), this;} }, { key: \"updateSideMaterial\", value: function updateSideMaterial(e) {var t = !1;this.options.sideMaterial || (this.options.sideMaterial = {}, t = !0), e ? U(this.options.sideMaterial, e) : this.options.sideMaterial = null;var n = this.getRenderer();return n && (t && n._deleteSideMaterial(), n.updateSideMaterial(e)), this;} }, { key: \"updateDataConfig\", value: function updateDataConfig(e) {if (!e) return this;this.options.dataConfig || (this.options.dataConfig = {});var t = JSON.parse(JSON.stringify(this.options.dataConfig));U(this.options.dataConfig, e);var n = this.getRenderer();return n && n.updateDataConfig(e, t), this;} }], [{ key: \"fromJSON\", value: function fromJSON(e) {return Sa(e, \"ExtrudePolygonLayer\", Ul);} }]);}(mt);Ul.registerJSONType(\"ExtrudePolygonLayer\"), Ul.mergeOptions({ cullFace: !1, castShadow: !0 });var Bl = { polygonFill: { type: \"identity\", default: [1, 1, 1, 1], property: \"_symbol_polygonFill\" }, polygonOpacity: { type: \"identity\", default: 1, property: \"_symbol_polygonOpacity\" }, topPolygonFill: { type: \"identity\", default: [1, 1, 1, 1], property: \"_symbol_topPolygonFill\" }, bottomPolygonFill: { type: \"identity\", default: [1, 1, 1, 1], property: \"_symbol_bottomPolygonFill\" } },Gl = { defaultAltitude: 20 },jl = function jl(e) {return 1 === e.properties.top;};Ul.registerRenderer(\"gl\", function (_Ra) {function _class13() {var _this102;_classCallCheck(this, _class13);for (var _len20 = arguments.length, t = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {t[_key20] = arguments[_key20];}_this102 = _callSuper(this, _class13, [].concat(t)), _this102.GeometryTypes = [e.Polygon, e.MultiPolygon];return _this102;}_inherits(_class13, _Ra);return _createClass(_class13, [{ key: \"_groupPolygonFeatures\", value: function _groupPolygonFeatures(e) {return [e];} }, { key: \"onConfig\", value: function onConfig(e) {this.painter && (X(e.cullFace) || this.painter.updateSceneConfig({ cullFace: e.cullFace }));} }, { key: \"updateMaterial\", value: function updateMaterial(e) {this.painter && (this.painter._updateMaterial(e), this.layer.options.sideMaterial || this.sidePainter._updateMaterial(e), this.setToRedraw());} }, { key: \"_deleteSideMaterial\", value: function _deleteSideMaterial() {this.sidePainter && this.sidePainter.deleteMaterial();} }, { key: \"updateSideMaterial\", value: function updateSideMaterial(e) {this.sidePainter && (e ? this.sidePainter._updateMaterial(e) : (this.sidePainter.deleteMaterial(), this.sidePainter._updateMaterial(this.layer.options.material)), this.setToRedraw());} }, { key: \"updateDataConfig\", value: function updateDataConfig(e, t) {this.painter && (this.painter.updateDataConfig(e, t), this._markRebuild());} }, { key: \"updateBloom\", value: function updateBloom(e) {_superPropGet(_class13, \"updateBloom\", this, 3)([e]), this.sidePainter && this._updatePainterBloom(this.sidePainter, this.sidePainterSymbol, e);} }, { key: \"needCheckPointLineSymbols\", value: function needCheckPointLineSymbols() {return !1;} }, { key: \"draw\", value: function draw(e, t) {return _superPropGet(_class13, \"draw\", this, 3)([e, t]);} }, { key: \"createPainter\", value: function createPainter() {var e = mt.get3DPainterClass(\"lit\");this.painterSymbol = U({}, Bl), this.sidePainterSymbol = U({}, Bl), this._defineSymbolBloom(this.painterSymbol, e.getBloomSymbol());var t = this.layer,n = U({}, Gl, t.options.dataConfig || {});t.options.material && (this.painterSymbol.material = t.options.material), t.options.sideMaterial ? this.sidePainterSymbol.material = t.options.sideMaterial : this.sidePainterSymbol.material = t.options.material;var i = { cullFace: t.options.cullFace };Object.defineProperty(i, \"castShadow\", { enumerable: !0, get: function get() {return t.options.castShadow;} }), Object.defineProperty(i, \"depthMask\", { enumerable: !0, get: function get() {return t.options.depthMask;} });var r = U({}, n);r.upsideUpTexture = !0;var s = new e(this.regl, t, this.painterSymbol, i, 0, r);return this.sidePainter = new e(this.regl, t, this.sidePainterSymbol, i, 0, n), s;} }, { key: \"_startFrame\", value: function _startFrame() {for (var _len21 = arguments.length, e = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {e[_key21] = arguments[_key21];}_superPropGet(_class13, \"_startFrame\", this, 3)(e);var t = this.painter;this.painter = this.sidePainter, _superPropGet(_class13, \"_startFrame\", this, 3)(e), this.painter = t;} }, { key: \"_renderMeshes\", value: function _renderMeshes() {for (var _len22 = arguments.length, e = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {e[_key22] = arguments[_key22];}var t = e[0],n = t.sceneFilter;t.sceneFilter = function (e) {return (!n || n(e)) && jl(e);};var i = _superPropGet(_class13, \"_renderMeshes\", this, 3)(e);t.sceneFilter = function (e) {return (!n || n(e)) && jl(e);};var r = this.painter;this.painter = this.sidePainter;var s = t.sceneFilter = function (e) {return (!n || n(e)) && function (e) {return 1 === e.properties.side;}(e);};return _superPropGet(_class13, \"_renderMeshes\", this, 3)(e), this.painter = r, t.sceneFilter = n, { redraw: i.redraw || s.redraw, drawCount: (i.drawCount || 0) + (s.drawCount || 0) };} }, { key: \"createMesh\", value: function createMesh(e, t, n, i, r, s) {var o = [];this._extrudeCenter = s;var a = this._createPackData(i, n, !0, !1),l = this._createPackData(i, n, !1, !0);if (a) {var _r167 = this._createMesh(a, e, t, n, i, null, s);_r167.meshes[0].properties.top = 1, o.push(_r167);}if (l) {var _r168 = this._createMesh(l, e, t, n, i, null, s);_r168.meshes[0].properties.side = 1, o.push(_r168);}return o;} }, { key: \"_createPackData\", value: function _createPackData(t, n, i, r) {var s = this.getMap();n = Bl;var o = this._extrudeCenter,a = 1 / 0,l = s.getZoom(),h = new e.Point(0, 0),c = new e.Coordinate(0, 0),u = U({}, Gl, this.layer.options.dataConfig);if (u.uv = !0, u.top && (u.top = i), u.side && (u.side = r), !1 === u.top && !1 === u.side) return null;if (!t.length) return null;var f = s.getGLRes(),d = s.getProjection().code,p = i ? this.painterSymbol && this.painterSymbol.material : this.sidePainterSymbol && this.sidePainterSymbol.material,g = p && p.textureWidth || Vl,m = [Ue(s, 1, c, f) / 100, Ue(s, 1, c, f, 1) / 100];return Ka(t, u, a, h, g, s.getGLRes(), 1, 1, m, this._zScale, n, l, d, undefined, Float32Array, o);} }, { key: \"updateMesh\", value: function updateMesh(e) {var t = e[Vn];var n = this.features[t];if (!n || !this.meshes) return;var i = this._createPackData([n], this.painterSymbol, !0, !1);var r = 0;i && i.data && this._updateMeshData(this.meshes[r++], n.id, i);var s = this._createPackData([n], this.painterSymbol, !1, !0);s && s.data && this._updateMeshData(this.meshes[r++], n.id, s);} }, { key: \"_convertGeo\", value: function _convertGeo(t) {if (t.getProperties() || t.setProperties({}), !t.getProperties()[ye]) {var _n303 = t.getCoordinates();if (t instanceof e.MultiPolygon) {var _e483 = [];for (var _t420 = 0; _t420 < _n303.length; _t420++) {var _i217 = _n303[_t420] && _n303[_t420][0];_e483[_t420] = zl(_i217);}t.getProperties()[ye] = _e483;} else {var _e484 = zl(_n303[0]);t.getProperties()[ye] = _e484;}}return _superPropGet(_class13, \"_convertGeo\", this, 3)([t]);} }, { key: \"resizeCanvas\", value: function resizeCanvas(e) {_superPropGet(_class13, \"resizeCanvas\", this, 3)([e]), this.sidePainter && this.sidePainter.resize(this.canvas.width, this.canvas.height);} }, { key: \"onRemove\", value: function onRemove() {_superPropGet(_class13, \"onRemove\", this, 3)([]), this.sidePainter && (this.sidePainter.delete(), delete this.sidePainter);} }, { key: \"drawOutline\", value: function drawOutline(e) {if (_superPropGet(_class13, \"drawOutline\", this, 3)([e]), this._outlineAll && this.sidePainter && this.sidePainter.outlineAll(e), this._outlineFeatures) for (var _t421 = 0; _t421 < this._outlineFeatures.length; _t421++) this.sidePainter && this.sidePainter.outline(e, this._outlineFeatures[_t421]);} }, { key: \"getShadowMeshes\", value: function getShadowMeshes() {return this.painter ? this.painter.getShadowMeshes() : [];} }]);}(Ra)), Ul.registerRenderer(\"canvas\", null);var _H21 = H(),Wl = exports.PackUtil = _H21.PackUtil,Xl = exports.FilterUtil = _H21.FilterUtil,Yl = exports.SYMBOLS_NEED_REBUILD_IN_VT = _H21.SYMBOLS_NEED_REBUILD_IN_VT,Zl = exports.SYMBOLS_NEED_REBUILD_IN_VECTOR = _H21.SYMBOLS_NEED_REBUILD_IN_VECTOR;_gl.reshader.ShaderLib.register(\"vt_position_vert\", \"#ifdef HAS_TERRAIN_ALTITUDE\\n attribute float aTerrainAltitude;\\n#endif\\nuniform float minAltitude;\\nvec3 unpackVTPosition(vec2 aPosition, float aAltitude) {\\n float altitude = aAltitude;\\n #ifdef HAS_TERRAIN_ALTITUDE\\n altitude += aTerrainAltitude * 100.0;\\n #endif\\n altitude += minAltitude * 100.0;\\n return vec3(aPosition, altitude);\\n}\\n#ifdef HAS_ALTITUDE\\n vec3 unpackVTPosition(vec3 offset) {\\n return unpackVTPosition(aPosition + offset.xy, aAltitude + offset.z);\\n }\\n vec3 unpackVTPosition() {\\n return unpackVTPosition(aPosition, aAltitude);\\n }\\n#else\\n float position_modValue = 16384.0;\\n float position_delta = 0.00001;\\n vec3 unpackVTPosition(vec3 offset) {\\n float z = aPosition.z;\\n vec2 pos = sign(aPosition.xy + position_delta) * mod(abs(aPosition.xy), position_modValue);\\n vec2 highs = floor(abs(aPosition.xy) / position_modValue);\\n float altitude = sign(z + position_delta) * (highs.x * 2.0 + highs.y) * pow(2.0, 15.0) + z;\\n return unpackVTPosition(pos + offset.xy, altitude + offset.z);\\n }\\n vec3 unpackVTPosition() {\\n return unpackVTPosition(vec3(0.0));\\n }\\n#endif\");r.mat4.create();var ql = function (e, t) {var n = e.toString(),i = n.indexOf(\"{\") + 1,r = n.substring(0, i);var s = \"\".concat(r, \"\\n (\") + t.toString() + \")({});\\n\";return s += \"\\n\" + n.substring(r.length), s;}(D, L);if (r.transcoders) {var _t422 = e.Map.VERSION;if (_t422.indexOf(\"1.0.0-beta\") >= 0 || _t422.indexOf(\"1.0.0-alpha\") >= 0) {var _t423 = r.transcoders.inject(ql);e.registerWorkerAdapter(\"@maptalks/vt\", _t423);} else e.registerWorkerAdapter(\"@maptalks/vt\", function () {return r.transcoders.inject(ql);});} else e.registerWorkerAdapter(\"@maptalks/vt\", ql);\"undefined\" != typeof console && console.log(\"@maptalks/vt v0.107.2\");\n return module.exports;});", "requires": [], "buildLevel": 0, "fileName": "/dist/maptalks.vt.es.js" } }