MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / Y

Function Y

public/iframe/lib/js/L7-min.js:35–35  ·  view source on GitHub ↗
(e,t,n,r,i,o,a)

Source from the content-addressed store, hash-verified

33 MERCHANTABLITY OR NON-INFRINGEMENT.
34
35 See the Apache Version 2.0 License for specific language governing permissions
36 and limitations under the License.
37 ***************************************************************************** */function U_(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function V_(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function G_(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function H_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Z_(e,t){return e(t={exports:{}},t.exports),t.exports}var W_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0},e.exports=t.default}));H_(W_);var q_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=t.pop();return e.call(this,t,r)}},e.exports=t.default}));H_(q_);var X_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=o,t.wrap=a;var n,r=t.hasSetImmediate="function"==typeof setImmediate&&setImmediate,i=t.hasNextTick="object"==typeof process&&"function"==typeof process.nextTick;function o(e){setTimeout(e,0)}function a(e){return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return e((function(){return t.apply(void 0,n)}))}}n=r?setImmediate:i?process.nextTick:o,t.default=a(n)}));H_(X_);X_.fallback,X_.wrap,X_.hasSetImmediate,X_.hasNextTick;var Y_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,K_.isAsync)(e))return function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=t.pop(),i=e.apply(this,t);return o(i,r)};return(0,n.default)((function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&"function"==typeof r.then)return o(r,n);n(null,r)}))};var n=i(q_),r=i(X_);function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return e.then((function(e){a(t,null,e)}),(function(e){a(t,e&&e.message?e:new Error(e))}))}function a(e,t,n){try{e(t,n)}catch(e){(0,r.default)((function(e){throw e}),e)}}e.exports=t.default}));H_(Y_);var K_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var n,r=(n=Y_)&&n.__esModule?n:{default:n};function i(e){return"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return i(e)?(0,r.default)(e):e},t.isAsync=i,t.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},t.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}}));H_(K_);K_.isAsyncIterable,K_.isAsyncGenerator,K_.isAsync;var Q_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===t&&(t=e.length);if(!t)throw new Error("arity is undefined");function n(){for(var n=this,r=[],i=arguments.length;i--;)r[i]=arguments[i];return"function"==typeof r[t-1]?e.apply(this,r):new Promise((function(i,o){r[t-1]=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(e)return o(e);i(t.length>1?t:t[0])},e.apply(n,r)}))}return Object.defineProperty(n,"name",{configurable:!0,value:"awaitable("+e.name+")"}),n},e.exports=t.default}));H_(Q_);var J_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=o(W_),r=o(K_),i=o(Q_);function o(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.default)((function(e,t,i){var o=(0,n.default)(t)?[]:{};e(t,(function(e,t,n){(0,r.default)(e)((function(e){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];r.length<2&&(r=r[0]),o[t]=r,n(e)}))}),(function(e){return i(e,o)}))}),3),e.exports=t.default}));H_(J_);var $_=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t},e.exports=t.default}));H_($_);var ex=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()},e.exports=t.default}));H_(ex);var tx=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,n.default)(e))return function(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}(e);var t=(0,r.default)(e);return t?function(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}(t):function(e){var t=e?Object.keys(e):[],n=-1,r=t.length;return function(){var i=t[++n];return n<r?{value:e[i],key:i}:null}}(e)};var n=i(W_),r=i(ex);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}));H_(tx);var nx=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}},e.exports=t.default}));H_(nx);var rx=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.default={},e.exports=t.default}));H_(rx);var ix=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){var o=!1,a=!1,s=!1,u=0,c=0;function l(){u>=t||s||o||(s=!0,e.next().then((function(e){var t=e.value,r=e.done;if(!a&&!o){if(s=!1,r)return o=!0,void(u<=0&&i(null));u++,n(t,c,f),c++,l()}})).catch(h))}function f(e,t){if(u-=1,!a)return e?h(e):!1===e?(o=!0,void(a=!0)):t===r.default||o&&u<=0?(o=!0,i(null)):void l()}function h(e){a||(s=!1,o=!0,i(e))}l()};var n,r=(n=rx)&&n.__esModule?n:{default:n};e.exports=t.default}));H_(ix);var ox=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=s($_),r=s(tx),i=s(nx),o=s(ix),a=s(rx);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return function(t,s,u){if(u=(0,n.default)(u),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return u(null);if((0,K_.isAsyncGenerator)(t))return(0,o.default)(t,e,s,u);if((0,K_.isAsyncIterable)(t))return(0,o.default)(t[Symbol.asyncIterator](),e,s,u);var c=(0,r.default)(t),l=!1,f=!1,h=0,d=!1;function p(e,t){if(!f)if(h-=1,e)l=!0,u(e);else if(!1===e)l=!0,f=!0;else{if(t===a.default||l&&h<=0)return l=!0,u(null);d||v()}}function v(){for(d=!0;h<e&&!l;){var t=c();if(null===t)return l=!0,void(h<=0&&u(null));h+=1,s(t.value,t.key,(0,i.default)(p))}d=!1}v()}},e.exports=t.default}));H_(ox);var ax=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=o(ox),r=o(K_),i=o(Q_);function o(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.default)((function(e,t,i,o){return(0,n.default)(t)(e,(0,r.default)(i),o)}),4),e.exports=t.default}));H_(ax);var sx=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=i(ax),r=i(Q_);function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,r.default)((function(e,t,r){return(0,n.default)(e,1,t,r)}),3),e.exports=t.default}));H_(sx);var ux=H_(Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(r.default,e,t)};var n=i(J_),r=i(sx);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}))),cx=function(){function e(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this.args=[],this.tasks=[]}return e.prototype.call=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];return this.args=t,ux(this.tasks)},e.prototype.tap=function(e,t){var n=this;this.tasks.push((function(r){t.apply(void 0,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(G_(arguments[t]));return e}(n.args)),r(null,e)}))},e}(),lx=Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=c(W_),r=c(rx),i=c(ax),o=c($_),a=c(nx),s=c(K_),u=c(Q_);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){n=(0,o.default)(n);var i=0,s=0,u=e.length,c=!1;function l(e,t){!1===e&&(c=!0),!0!==c&&(e?n(e):++s!==u&&t!==r.default||n(null))}for(0===u&&n(null);i<u;i++)t(e[i],i,(0,a.default)(l))}function f(e,t,n){return(0,i.default)(e,1/0,t,n)}t.default=(0,u.default)((function(e,t,r){return((0,n.default)(e)?l:f)(e,(0,s.default)(t),r)}),3),e.exports=t.default}));H_(lx);var fx=H_(Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,r.default)(n.default,e,t)};var n=i(lx),r=i(J_);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}))),hx=function(){function e(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this.tasks=[]}return e.prototype.promise=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];return fx(this.tasks)},e.prototype.tapPromise=function(e,t){var n=this;this.tasks.push((function(r){return U_(n,void 0,void 0,(function(){return V_(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return n.sent(),r(null,e),[2]}}))}))}))},e}(),dx=H_(Z_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=a($_),r=a(nx),i=a(K_),o=a(Q_);function a(e){return e&&e.__esModule?e:{default:e}}t.default=(0,o.default)((function(e,t){if(t=(0,n.default)(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var o=0;function a(t){(0,i.default)(e[o++]).apply(void 0,t.concat([(0,r.default)(s)]))}function s(n){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];if(!1!==n)return n||o===e.length?t.apply(void 0,[n].concat(r)):void a(r)}a([])})),e.exports=t.default}))),px=function(){function e(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this.tasks=[]}return e.prototype.call=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];return dx(this.tasks)},e.prototype.tap=function(e,t){0===this.tasks.length?this.tasks.push((function(e){var n=t();e(!!n&&null,n)})):this.tasks.push((function(n,r){r(!!t()&&null,e)}))},e}(),vx=function(){function e(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this.tasks=[]}return e.prototype.call=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];return ux(this.tasks)},e.prototype.tap=function(e,t){this.tasks.push((function(n){n(t(),e)}))},e}();function gx(e){var t=e.target||e.srcElement;t.__resizeRAF__&&cancelAnimationFrame(t.__resizeRAF__),t.__resizeRAF__=requestAnimationFrame((function(){var n=t.__resizeTrigger__,r=n&&n.__resizeListeners__;r&&r.forEach((function(t){t.call(n,e)}))}))}var mx=function(e,t){var n,r=this.document,i=r.attachEvent;if("undefined"!=typeof navigator&&(n=navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/)),!e.__resizeListeners__)if(e.__resizeListeners__=[],i)e.__resizeTrigger__=e,e.attachEvent("onresize",gx);else{"static"===getComputedStyle(e).position&&(e.style.position="relative");var o=e.__resizeTrigger__=r.createElement("object");o.setAttribute("style","position: absolute; top: 0; left: 0; height: 100%; width: 100%; pointer-events: none; z-index: -1; opacity: 0;"),o.setAttribute("class","resize-sensor"),o.setAttribute("tabindex","-1"),o.__resizeElement__=e,o.onload=function(){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__,this.contentDocument.defaultView.addEventListener("resize",gx)},o.type="text/html",n&&e.appendChild(o),o.data="about:blank",n||e.appendChild(o)}e.__resizeListeners__.push(t)},yx="undefined"==typeof window?mx:mx.bind(window),bx=function(e,t){var n=document.attachEvent,r=e.__resizeListeners__||[];if(t){var i=r.indexOf(t);-1!==i&&r.splice(i,1)}else r=e.__resizeListeners__=[];if(!r.length){if(n)e.detachEvent("onresize",gx);else if(e.__resizeTrigger__){var o=e.__resizeTrigger__.contentDocument,a=o&&o.defaultView;a&&(a.removeEventListener("resize",gx),delete a.__resizeTrigger__),e.__resizeTrigger__=!e.removeChild(e.__resizeTrigger__)}delete e.__resizeListeners__}};yx.unbind=bx;window.document.documentElement.style;var _x,xx,wx,Sx,Ex,Ax,Tx,kx,Mx,Cx,Ix,Px,Ox,Rx,Lx,Nx,Dx,jx,zx,Fx,Bx,Ux,Vx,Gx,Hx,Zx,Wx,qx,Xx,Yx,Kx,Qx,Jx,$x,ew,tw=0;function nw(e){var t=e;if("string"==typeof e&&(t=document.getElementById(e)),t){var n=document.createElement("div");return n.style.cssText+="\n position: absolute;\n z-index:2;\n height: 100%;\n width: 100%;\n pointer-events: none;\n ",n.id="l7-scene-".concat(tw++),n.classList.add("l7-scene"),t.appendChild(n),n}return null}var rw=(_x=Q(),xx=J(nr.SceneID),wx=J(nr.IIconService),Sx=J(nr.IFontService),Ex=J(nr.IControlService),Ax=J(nr.ILogService),Tx=J(nr.IGlobalConfigService),kx=J(nr.IMapService),Mx=J(nr.ICoordinateSystemService),Cx=J(nr.IRendererService),Ix=J(nr.ILayerService),Px=J(nr.ICameraService),Ox=J(nr.IInteractionService),Rx=J(nr.IPickingService),Lx=J(nr.IShaderModuleService),Nx=J(nr.IMarkerService),Dx=J(nr.IPopupService),_x((Fx=go((zx=function(t){Ji(i,t);var n,r=so(i);function i(){var e;return Wi(this,i),(e=r.call(this)).destroyed=!1,e.loaded=!1,vo(e,"id",Fx,oo(e)),vo(e,"iconService",Bx,oo(e)),vo(e,"fontService",Ux,oo(e)),vo(e,"controlService",Vx,oo(e)),vo(e,"logger",Gx,oo(e)),vo(e,"configService",Hx,oo(e)),vo(e,"map",Zx,oo(e)),vo(e,"coordinateSystemService",Wx,oo(e)),vo(e,"rendererService",qx,oo(e)),vo(e,"layerService",Xx,oo(e)),vo(e,"cameraService",Yx,oo(e)),vo(e,"interactionService",Kx,oo(e)),vo(e,"pickingService",Qx,oo(e)),vo(e,"shaderModuleService",Jx,oo(e)),vo(e,"markerService",$x,oo(e)),vo(e,"popupService",ew,oo(e)),e.inited=!1,e.initPromise=void 0,e.rendering=!1,e.$container=void 0,e.canvas=void 0,e.markerContainer=void 0,e.hooks=void 0,e.handleWindowResized=function(){e.emit("resize"),e.$container&&(e.initContainer(),ja(),e.coordinateSystemService.needRefresh=!0,e.render())},e.handleMapCameraChanged=function(t){e.cameraService.update(t),e.render()},e.hooks={init:new hx},e}return Xi(i,[{key:"init",value:function(t){var n=this;this.configService.setSceneConfig(this.id,t),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.fontService.init(),this.hooks.init.tapPromise("initMap",Zi(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(e){n.map.onCameraChanged((function(t){n.cameraService.init(),n.cameraService.update(t),e()})),n.map.init()}));case 2:n.map.onCameraChanged(n.handleMapCameraChanged),n.map.addMarkerContainer(),n.markerService.addMarkers(),n.markerService.addMarkerLayers(),n.popupService.initPopup(),n.interactionService.init(),n.interactionService.on(e.InteractionEvent.Drag,n.addSceneEvent.bind(n)),n.logger.debug("map ".concat(n.id," loaded"));case 10:case"end":return t.stop()}}),t)})))),this.hooks.init.tapPromise("initRenderer",Zi(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=nw(n.configService.getSceneConfig(n.id).id||""),n.$container=t,!t){e.next=11;break}return n.canvas=ka("canvas","",t),n.setCanvas(),e.next=7,n.rendererService.init(n.canvas,n.configService.getSceneConfig(n.id));case 7:yx(n.$container,n.handleWindowResized),window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)").addListener(n.handleWindowResized),e.next=12;break;case 11:n.logger.error("容器 id 不存在");case 12:n.pickingService.init(n.id),n.logger.debug("scene ".concat(n.id," renderer loaded"));case 14:case"end":return e.stop()}}),e)})))),this.initPromise=this.hooks.init.promise(),this.render()}},{key:"addLayer",value:function(e){this.logger.debug("add layer ".concat(e.name," to scene ").concat(this.id)),this.layerService.add(e),this.render()}},{key:"render",value:(n=Zi(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.rendering&&!this.destroyed){e.next=2;break}return e.abrupt("return");case 2:if(this.rendering=!0,this.inited){e.next=13;break}return e.next=6,this.initPromise;case 6:this.destroyed&&this.destroy(),this.logger.info(" render inited"),this.layerService.initLayers(),this.controlService.addControls(),this.loaded=!0,this.emit("loaded"),this.inited=!0;case 13:this.layerService.renderLayers(),this.logger.debug("scene ".concat(this.id," render")),this.rendering=!1;case 16:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getSceneContainer",value:function(){return this.$container}},{key:"exportPng",value:function(e){var t,n=null===(t=this.$container)||void 0===t?void 0:t.getElementsByTagName("canvas")[0];return this.render(),"jpg"===e?null==n?void 0:n.toDataURL("image/jpeg"):null==n?void 0:n.toDataURL("image/png")}},{key:"getSceneConfig",value:function(){return this.configService.getSceneConfig(this.id)}},{key:"addMarkerContainer",value:function(){var e=this.$container.parentElement;null!==e&&(this.markerContainer=ka("div","l7-marker-container",e))}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"destroy",value:function(){this.inited?(this.emit("destroy"),this.layerService.destroy(),this.rendererService.destroy(),this.map.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.removeAllListeners(),this.inited=!1,bx(this.$container,this.handleWindowResized),window.matchMedia("screen and (min-resolution: 2dppx)").removeListener(this.handleWindowResized)):this.destroyed=!0}},{key:"initContainer",value:function(){var e,t,n=window.devicePixelRatio,r=(null===(e=this.$container)||void 0===e?void 0:e.clientWidth)||400,i=(null===(t=this.$container)||void 0===t?void 0:t.clientHeight)||300,o=this.canvas;o&&(o.width=r*n,o.height=i*n,o.style.width="".concat(r,"px"),o.style.height="".concat(i,"px")),this.rendererService.viewport({x:0,y:0,width:n*r,height:n*i})}},{key:"setCanvas",value:function(){var e,t,n=window.devicePixelRatio,r=(null===(e=this.$container)||void 0===e?void 0:e.clientWidth)||400,i=(null===(t=this.$container)||void 0===t?void 0:t.clientHeight)||300,o=this.canvas;o.width=r*n,o.height=i*n,o.style.width="".concat(r,"px"),o.style.height="".concat(i,"px")}},{key:"addSceneEvent",value:function(e){this.emit(e.type,e)}}]),i}(s)).prototype,"id",[xx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bx=go(zx.prototype,"iconService",[wx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ux=go(zx.prototype,"fontService",[Sx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vx=go(zx.prototype,"controlService",[Ex],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gx=go(zx.prototype,"logger",[Ax],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hx=go(zx.prototype,"configService",[Tx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zx=go(zx.prototype,"map",[kx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wx=go(zx.prototype,"coordinateSystemService",[Mx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qx=go(zx.prototype,"rendererService",[Cx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xx=go(zx.prototype,"layerService",[Ix],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yx=go(zx.prototype,"cameraService",[Px],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kx=go(zx.prototype,"interactionService",[Ox],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qx=go(zx.prototype,"pickingService",[Rx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jx=go(zx.prototype,"shaderModuleService",[Lx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$x=go(zx.prototype,"markerService",[Nx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ew=go(zx.prototype,"popupService",[Dx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jx=zx))||jx);var iw=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var ow=function(e){return this.__data__.has(e)};function aw(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new bm;++t<n;)this.add(e[t])}aw.prototype.add=aw.prototype.push=iw,aw.prototype.has=ow;var sw=aw;var uw=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1};var cw=function(e){return e!=e};var lw=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1};var fw=function(e,t,n){return t==t?lw(e,t,n):uw(e,cw,n)};var hw=function(e,t){return!!(null==e?0:e.length)&&fw(e,t,0)>-1};var dw=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1};var pw=function(e,t){return e.has(t)},vw=$g(kg,"Set");var gw=function(){};var mw=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},yw=vw&&1/mw(new vw([,-0]))[1]==1/0?function(e){return new vw(e)}:gw;var bw=function(e,t,n){var r=-1,i=hw,o=e.length,a=!0,s=[],u=s;if(n)a=!1,i=dw;else if(o>=200){var c=t?null:yw(e);if(c)return mw(c);a=!1,i=pw,u=new sw}else u=t?[]:s;e:for(;++r<o;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue e;t&&u.push(f),s.push(l)}else i(u,f,n)||(u!==s&&u.push(f),s.push(l))}return s};var _w=function(e){return e&&e.length?bw(e):[]};Pt({target:"Array",proto:!0},{fill:vs}),Cr("fill");var xw=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function ww(e){var t={};return{content:e=e.replace(xw,(function(e,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(e,t){return e.push(Number(t.trim())),e}),[]):new Array(function(e){var t=0;switch(e){case"vec2":case"ivec2":t=2;break;case"vec3":case"ivec3":t=3;break;case"vec4":case"ivec4":case"mat2":t=4;break;case"mat3":t=9;break;case"mat4":t=16}return t}(n)).fill(0)}return t[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:t}}var Sw,Ew,Aw,Tw,kw,Mw,Cw,Iw="#define PI 3.14159265359",Pw=/precision\s+(high|low|medium)p\s+float/,Ow=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,Rw=Q()(Sw=function(){function e(){Wi(this,e),this.moduleCache={},this.rawContentCache={}}return Xi(e,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("common",{vs:Iw,fs:Iw}),this.registerModule("decode",{vs:"#define SHIFT_RIGHT17 1.0 / 131072.0\n#define SHIFT_RIGHT18 1.0 / 262144.0\n#define SHIFT_RIGHT19 1.0 / 524288.0\n#define SHIFT_RIGHT20 1.0 / 1048576.0\n#define SHIFT_RIGHT21 1.0 / 2097152.0\n#define SHIFT_RIGHT22 1.0 / 4194304.0\n#define SHIFT_RIGHT23 1.0 / 8388608.0\n#define SHIFT_RIGHT24 1.0 / 16777216.0\n#define SHIFT_LEFT17 131072.0\n#define SHIFT_LEFT18 262144.0\n#define SHIFT_LEFT19 524288.0\n#define SHIFT_LEFT20 1048576.0\n#define SHIFT_LEFT21 2097152.0\n#define SHIFT_LEFT22 4194304.0\n#define SHIFT_LEFT23 8388608.0\n#define SHIFT_LEFT24 16777216.0\nvec2 unpack_float(float packedValue) {\nint packedIntValue = int(packedValue);\nint v0 = packedIntValue / 256;\nreturn vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(vec2 encodedColor) {\nreturn vec4(\nunpack_float(encodedColor[0]) / 255.0,\nunpack_float(encodedColor[1]) / 255.0\n);\n}",fs:""}),this.registerModule("projection",{vs:"#define TILE_SIZE 512.0\n#define PI 3.1415926536\n#define WORLD_SCALE TILE_SIZE / (PI * 2.0)\n#define COORDINATE_SYSTEM_LNGLAT 1.0\n#define COORDINATE_SYSTEM_LNGLAT_OFFSET 2.0\n#define COORDINATE_SYSTEM_VECTOR_TILE 3.0\n#define COORDINATE_SYSTEM_IDENTITY 4.0\n#define COORDINATE_SYSTEM_P20 5.0\n#define COORDINATE_SYSTEM_P20_OFFSET 6.0\n#define COORDINATE_SYSTEM_METER_OFFSET 7.0\nuniform mat4 u_ViewMatrix;\nuniform mat4 u_ProjectionMatrix;\nuniform mat4 u_ViewProjectionMatrix;\nuniform float u_Zoom : 1;\nuniform float u_ZoomScale : 1;\nuniform float u_CoordinateSystem;\nuniform vec2 u_ViewportCenter;\nuniform vec4 u_ViewportCenterProjection;\nuniform vec3 u_PixelsPerDegree;\nuniform vec3 u_PixelsPerDegree2;\nuniform vec3 u_PixelsPerMeter;\nuniform vec2 u_ViewportSize;\nuniform float u_DevicePixelRatio;\nuniform float u_FocalDistance;\nuniform vec3 u_CameraPosition;\nvec2 project_mercator(vec2 lnglat) {\nfloat x = lnglat.x;\nreturn vec2(\nradians(x) + PI,\nPI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5))\n);\n}\nfloat project_scale(float meters) {\nreturn meters * u_PixelsPerMeter.z;\n}\nvec4 project_offset(vec4 offset) {\nfloat dy = offset.y;\ndy = clamp(dy, -1., 1.);\nvec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy;\nreturn vec4(offset.xyz * pixels_per_unit, offset.w);\n}\nvec3 project_normal(vec3 normal) {\nvec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0);\nreturn normalize(normal_modelspace.xyz * u_PixelsPerMeter);\n}\nvec3 project_offset_normal(vec3 vector) {\nif (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01\n|| u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\nreturn normalize(vector * u_PixelsPerDegree);\n}\nreturn project_normal(vector);\n}\nvec3 reverse_offset_normal(vec3 vector) {\nif (u_CoordinateSystem == COORDINATE_SYSTEM_P20 ||u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET ) {\nreturn vector * vec3(1.0, -1.0, 1.0);\n}\nreturn vector;\n}\nvec4 project_position(vec4 position) {\nfloat a = COORDINATE_SYSTEM_LNGLAT_OFFSET;\nfloat b = COORDINATE_SYSTEM_P20_OFFSET;\nfloat c = COORDINATE_SYSTEM_LNGLAT;\nif (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n|| u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\nfloat X = position.x - u_ViewportCenter.x;\nfloat Y = position.y - u_ViewportCenter.y;\nreturn project_offset(vec4(X, Y, position.z, position.w));\n}\nif (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {\nreturn vec4(\nproject_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,\nproject_scale(position.z),\nposition.w\n);\n}\nif (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {\nreturn vec4(\n(project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale - vec2(215440491., 106744817.)) * vec2(1., -1.),\nproject_scale(position.z),\nposition.w\n);\n}\nreturn position;\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\nvec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0;\nreturn offset * u_FocalDistance;\n}\nfloat project_pixel(float pixel) {\nif (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\nreturn pixel * pow(2.0, (19.0 - u_Zoom));\n}\nreturn pixel;\n}\nvec2 project_pixel(vec2 pixel) {\nif (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\nreturn pixel * pow(2.0, (19.0 - u_Zoom));\n}\nreturn pixel * -1.;\n}\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\nif (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\nu_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\nposition.w *= u_PixelsPerMeter.z;\n}\nreturn viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\nreturn project_common_position_to_clipspace(\nposition,\nu_ViewProjectionMatrix,\nu_ViewportCenterProjection\n);\n}\nvec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) {\nvec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection);\nif (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\nu_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\npos.w = pos.w / u_PixelsPerMeter.z;\n}\nreturn pos;\n}\nbool isEqual( float a, float b) {\nreturn a< b + 0.001 && a > b - 0.001;\n}",fs:""}),this.registerModule("project",{vs:"#define E 2.718281828459045\nvec2 ProjectFlat(vec2 lnglat){\nfloat maxs=85.0511287798;\nfloat lat=max(min(maxs,lnglat.y),-maxs);\nfloat scale= 268435456.;\nfloat d=PI/180.;\nfloat x=lnglat.x*d;\nfloat y=lat*d;\ny=log(tan((PI/4.)+(y/2.)));\nfloat a=.5/PI,\nb=.5,\nc=-.5/PI;\nd=.5;\nx=scale*(a*x+b);\ny=scale*(c*y+d);\nreturn vec2(x,y);\n}\nvec2 unProjectFlat(vec2 px){\nfloat a=.5/PI;\nfloat b=.5;\nfloat c=-.5/PI;\nfloat d=.5;\nfloat scale = 268435456.;\nfloat x=(px.x/scale-b)/a;\nfloat y=(px.y/scale-d)/c;\ny=(atan(pow(E,y))-(PI/4.))*2.;\nd=PI/180.;\nfloat lat=y/d;\nfloat lng=x/d;\nreturn vec2(lng,lat);\n}\nfloat pixelDistance(vec2 from, vec2 to) {\nvec2 a1 = ProjectFlat(from);\nvec2 b1 = ProjectFlat(to);\nreturn distance(a1, b1);\n}",fs:""}),this.registerModule("sdf_2d",{vs:"",fs:"\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\nfloat sdCircle(vec2 p, float r) {\nreturn length(p) - r;\n}\nfloat sdEquilateralTriangle(vec2 p) {\nfloat k = sqrt(3.0);\np.x = abs(p.x) - 1.0;\np.y = p.y + 1.0/k;\nif( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\np.x -= clamp( p.x, -2.0, 0.0 );\nreturn -length(p)*sign(p.y);\n}\nfloat sdBox(vec2 p, vec2 b) {\nvec2 d = abs(p)-b;\nreturn length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\nfloat sdPentagon(vec2 p, float r) {\nvec3 k = vec3(0.809016994,0.587785252,0.726542528);\np.x = abs(p.x);\np -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\np -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\np -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\nreturn length(p)*sign(p.y);\n}\nfloat sdHexagon(vec2 p, float r) {\nvec3 k = vec3(-0.866025404,0.5,0.577350269);\np = abs(p);\np -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\np -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\nreturn length(p)*sign(p.y);\n}\nfloat sdOctogon(vec2 p, float r) {\nvec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\np = abs(p);\np -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\np -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\np -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\nreturn length(p)*sign(p.y);\n}\nfloat sdHexagram(vec2 p, float r) {\nvec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\np = abs(p);\np -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\np -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\np -= vec2(clamp(p.x,r*k.z,r*k.w),r);\nreturn length(p)*sign(p.y);\n}\nfloat sdRhombus(vec2 p, vec2 b) {\nvec2 q = abs(p);\nfloat h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\nfloat d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\nreturn d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\nfloat sdVesica(vec2 p, float r, float d) {\np = abs(p);\nfloat b = sqrt(r*r-d*d);\nreturn ((p.y-b)*d>p.x*b)\n? length(p-vec2(0.0,b))\n: length(p-vec2(-d,0.0))-r;\n}"}),this.registerModule("lighting",{vs:"\nuniform float u_Ambient : 1.0;\nuniform float u_Diffuse : 1.0;\nuniform float u_Specular : 1.0;\nuniform int u_NumOfDirectionalLights : 1;\nuniform int u_NumOfSpotLights : 0;\n#define SHININESS 32.0\n#define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3\n#define MAX_NUM_OF_SPOT_LIGHTS 3\nstruct DirectionalLight {\nvec3 direction;\nvec3 ambient;\nvec3 diffuse;\nvec3 specular;\n};\nstruct SpotLight {\nvec3 position;\nvec3 direction;\nvec3 ambient;\nvec3 diffuse;\nvec3 specular;\nfloat constant;\nfloat linear;\nfloat quadratic;\nfloat angle;\nfloat blur;\nfloat exponent;\n};\nuniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS];\nuniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS];\nvec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {\nvec3 lightDir = normalize(light.direction);\nfloat diff = max(dot(normal, lightDir), 0.0);\nvec3 halfwayDir = normalize(lightDir + viewDir);\nfloat spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS);\nvec3 ambient = light.ambient * u_Ambient;\nvec3 diffuse = light.diffuse * diff * u_Diffuse;\nvec3 specular = light.specular * spec * u_Specular;\nreturn ambient + diffuse + specular;\n}\nvec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {\nvec3 weight = vec3(0.0);\nfor (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) {\nif (i >= u_NumOfDirectionalLights) {\nbreak;\n}\nweight += calc_directional_light(u_DirectionalLights[i], normal, viewDir);\n}\nreturn weight;\n}",fs:""}),this.registerModule("light",{vs:"#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\nfloat calc_lighting(vec4 pos) {\nvec3 worldPos = vec3(pos * u_ModelMatrix);\nvec3 worldNormal = a_Normal;\nvec3 viewDir = normalize(u_CameraPosition - worldPos);\nvec3 lightDir = normalize(vec3(1, -10.5, 12));\nvec3 halfDir = normalize(viewDir+lightDir);\nfloat lambert = dot(worldNormal, lightDir);\nfloat specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\nfloat lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular;\nreturn lightWeight;\n}",fs:""}),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\nbool isVertexPicked(vec3 vertexColor) {\nreturn\nabs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\nabs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\nabs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\nvoid setPickingColor(vec3 pickingColor) {\nv_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\nv_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\nfloat setPickingSize(float x) {\nreturn u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\nvec4 filterHighlightColor(vec4 color) {\nbool selected = bool(v_PickingResult.a);\nif (selected) {\nvec4 highLightColor = u_HighlightColor * COLOR_SCALE;\nfloat highLightAlpha = highLightColor.a;\nfloat highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\nvec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\nreturn vec4(resultRGB, color.a);\n} else {\nreturn color;\n}\n}\nvec4 filterPickingColor(vec4 color) {\nvec3 pickingColor = v_PickingResult.rgb;\nif (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\ndiscard;\n}\nreturn u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\nvec4 filterColor(vec4 color) {\nreturn filterPickingColor(filterHighlightColor(color));\n}"})}},{key:"registerModule",value:function(e,t){if(!this.rawContentCache[e]){var n=t.vs,r=t.fs,i=t.uniforms,o=ww(n),a=o.content,s=o.uniforms,u=ww(r),c=u.content,l=u.uniforms;this.rawContentCache[e]={fs:c,uniforms:Qi(Qi(Qi({},s),l),i),vs:a}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(e){var t=this;if(this.moduleCache[e])return this.moduleCache[e];var n=this.rawContentCache[e].vs,r=this.rawContentCache[e].fs,i=this.processModule(n,[],"vs"),o=i.content,a=i.includeList,s=this.processModule(r,[],"fs"),u=s.content,c=s.includeList,l=u,f=_w(a.concat(c).concat(e)).reduce((function(e,n){return Qi(Qi({},e),t.rawContentCache[n].uniforms)}),{});return Pw.test(u)||(l="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+u),this.moduleCache[e]={fs:l.trim(),uniforms:f,vs:o.trim()},this.moduleCache[e]}},{key:"processModule",value:function(e,t,n){var r=this;return{content:e.replace(Ow,(function(e,i){var o=i.split(" ")[0].replace(/"/g,"");if(t.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return t.push(o),r.processModule(a,t,n).content})),includeList:t}}}]),e}())||Sw;(Ew=e.PassType||(e.PassType={})).Normal="normal",Ew.PostProcessing="post-processing";var Lw,Nw,Dw,jw,zw,Fw,Bw,Uw,Vw,Gw,Hw,Zw=(Aw=Q(),Tw=J(nr.IShaderModuleService),Aw((Cw=go((Mw=function(){function t(){Wi(this,t),vo(this,"shaderModuleService",Cw,this),this.rendererService=void 0,this.cameraService=void 0,this.mapService=void 0,this.interactionService=void 0,this.layerService=void 0,this.config=void 0}return Xi(t,[{key:"getName",value:function(){return""}},{key:"getType",value:function(){return e.PassType.Normal}},{key:"init",value:function(e,t){this.config=t,this.rendererService=e.getContainer().get(nr.IRendererService),this.cameraService=e.getContainer().get(nr.ICameraService),this.mapService=e.getContainer().get(nr.IMapService),this.interactionService=e.getContainer().get(nr.IInteractionService),this.layerService=e.getContainer().get(nr.ILayerService)}},{key:"render",value:function(e){}}]),t}()).prototype,"shaderModuleService",[Tw],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kw=Mw))||kw),Ww=Q()(Lw=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"getName",value:function(){return"clear"}},{key:"init",value:function(e,t){uo($i(n.prototype),"init",this).call(this,e,t)}},{key:"render",value:function(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}]),n}(Zw))||Lw,qw=(Nw=Q(),Dw=J(nr.IPostProcessor),Nw((Fw=go((zw=function(){function t(){Wi(this,t),this.passes=[],vo(this,"postProcessor",Fw,this),this.layer=void 0,this.renderFlag=void 0,this.width=0,this.height=0}var n;return Xi(t,[{key:"setLayer",value:function(e){this.layer=e}},{key:"setRenderFlag",value:function(e){this.renderFlag=e}},{key:"getRenderFlag",value:function(){return this.renderFlag}},{key:"getPostProcessor",value:function(){return this.postProcessor}},{key:"render",value:(n=Zi(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=po(this.passes),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=n.value,e.next=7,r.render(this.layer);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:this.layer.renderModels();case 18:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))),function(){return n.apply(this,arguments)})},{key:"resize",value:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t)}},{key:"add",value:function(t,n){t.getType()===e.PassType.PostProcessing?this.postProcessor.add(t,this.layer,n):(t.init(this.layer,n),this.passes.push(t))}},{key:"insert",value:function(e,t,n){e.init(this.layer,t),this.passes.splice(n,0,e)}},{key:"destroy",value:function(){this.passes.length=0}}]),t}()).prototype,"postProcessor",[Dw],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jw=zw))||jw),Xw=(Bw=Q(),Uw=J(nr.ILogService),Bw((Hw=go((Gw=function(t){Ji(r,t);var n=so(r);function r(){var e;Wi(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return vo(e=n.call.apply(n,[this].concat(i)),"logger",Hw,oo(e)),e.pickingFBO=void 0,e.layer=void 0,e.width=0,e.height=0,e.alreadyInRendering=!1,e.pickFromPickingFBO=function(t){var n=t.x,r=t.y,i=t.lngLat,o=t.type;if(e.layer.isVisible()&&e.layer.needPick(o)){var a,s=e.rendererService,u=s.getViewportSize,c=s.readPixels,l=s.useFramebuffer,f=u(),h=f.width,d=f.height,p=e.layer.getLayerConfig(),v=p.enableHighlight,g=p.enableSelect,m=n*window.devicePixelRatio,y=r*window.devicePixelRatio;if(!(m>h||m<0||y>d||y<0))l(e.pickingFBO,(function(){var t;if(0!==(a=c({x:Math.round(m),y:Math.round(d-(r+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]||0!==a[1]||0!==a[2]){e.logger.debug("picked");var s=qh(a),u=e.layer.getSource().getFeatureById(s),l={x:n,y:r,type:o,lngLat:i,featureId:s,feature:u};u&&(e.layer.setCurrentPickId(s),e.triggerHoverOnLayer(l))}else{var f={x:n,y:r,lngLat:i,type:null===e.layer.getCurrentPickId()?"un"+o:"mouseout",featureId:null,feature:null};e.triggerHoverOnLayer(Qi(Qi({},f),{},{type:"unpick"})),e.triggerHoverOnLayer(f),e.layer.setCurrentPickId(null)}v&&e.highlightPickedFeature(a),g&&"click"===o&&(null===(t=a)||void 0===t?void 0:t.toString())!==[0,0,0,0].toString()&&e.selectFeature(a)}))}},e}return Xi(r,[{key:"getType",value:function(){return e.PassType.Normal}},{key:"getName",value:function(){return"pixelPicking"}},{key:"init",value:function(t,n){uo($i(r.prototype),"init",this).call(this,t,n),this.layer=t;var i=this.rendererService,o=i.createTexture2D,a=i.createFramebuffer,s=(0,i.getViewportSize)(),u=s.width,c=s.height;this.pickingFBO=a({color:o({width:u,height:c,wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE})}),this.interactionService.on(e.InteractionEvent.Hover,this.pickFromPickingFBO),this.interactionService.on(e.InteractionEvent.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(e.InteractionEvent.Active,this.highlightFeatureHandle.bind(this))}},{key:"render",value:function(e){var t=this;if(!this.alreadyInRendering){var n=this.rendererService,r=n.getViewportSize,i=n.useFramebuffer,o=n.clear,a=r(),s=a.width,u=a.height;this.alreadyInRendering=!0,this.width===s&&this.height===u||(this.pickingFBO.resize({width:s,height:u}),this.width=s,this.height=u),i(this.pickingFBO,(function(){o({framebuffer:t.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n=t.layer.multiPassRenderer.getRenderFlag();t.layer.multiPassRenderer.setRenderFlag(!1),e.hooks.beforePickingEncode.call(),e.render(),e.hooks.afterPickingEncode.call(),t.layer.multiPassRenderer.setRenderFlag(n),t.alreadyInRendering=!1}))}}},{key:"triggerHoverOnLayer",value:function(e){this.layer.emit(e.type,e)}},{key:"highlightPickedFeature",value:function(e){var t=co(e,3),n=t[0],r=t[1],i=t[2];this.layer.hooks.beforeHighlight.call([n,r,i]),this.layerService.renderLayers()}},{key:"selectFeature",value:function(e){var t=co(e,3),n=t[0],r=t[1],i=t[2];this.layer.hooks.beforeSelect.call([n,r,i]),this.layerService.renderLayers()}},{key:"selectFeatureHandle",value:function(e){var t=Xh(e.featureId);this.selectFeature(new Uint8Array(t))}},{key:"highlightFeatureHandle",value:function(e){var t=Xh(e.featureId);this.highlightPickedFeature(new Uint8Array(t))}}]),r}(Zw)).prototype,"logger",[Uw],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vw=Gw))||Vw),Yw="varying vec2 v_UV;\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_BlurDir: [1.0, 0.0];\nvec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\nvec4 color = vec4(0.0);\nvec2 off1 = vec2(1.3846153846) * direction;\nvec2 off2 = vec2(3.2307692308) * direction;\ncolor += texture2D(image, uv) * 0.2270270270;\ncolor += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\ncolor += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\ncolor += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\ncolor += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\nreturn color;\n}\nvoid main() {\ngl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);\n}",Kw="attribute vec2 a_Position;\nvarying vec2 v_UV;\nvoid main() {\nv_UV = 0.5 * (a_Position + 1.0);\ngl_Position = vec4(a_Position, 0., 1.);\n}";var Qw=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o};var Jw=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Qw(e,t,n)},$w=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var eS=function(e){return $w.test(e)};var tS=function(e){return e.split("")},nS="[\\ud800-\\udfff]",rS="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",iS="\\ud83c[\\udffb-\\udfff]",oS="[^\\ud800-\\udfff]",aS="(?:\\ud83c[\\udde6-\\uddff]){2}",sS="[\\ud800-\\udbff][\\udc00-\\udfff]",uS="(?:"+rS+"|"+iS+")"+"?",cS="[\\ufe0e\\ufe0f]?"+uS+("(?:\\u200d(?:"+[oS,aS,sS].join("|")+")[\\ufe0e\\ufe0f]?"+uS+")*"),lS="(?:"+[oS+rS+"?",rS,aS,sS,nS].join("|")+")",fS=RegExp(iS+"(?="+iS+")|"+lS+cS,"g");var hS=function(e){return e.match(fS)||[]};var dS=function(e){return eS(e)?hS(e):tS(e)};var pS=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var vS=function(e){return"symbol"==typeof e||Fm(e)&&"[object Symbol]"==jg(e)},gS=Mg?Mg.prototype:void 0,mS=gS?gS.toString:void 0;var yS=function e(t){if("string"==typeof t)return t;if(Zm(t))return pS(t,e)+"";if(vS(t))return mS?mS.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var bS=function(e){return null==e?"":yS(e)};var _S=function(e){return function(t){t=bS(t);var n=eS(t)?dS(t):void 0,r=n?n[0]:t.charAt(0),i=n?Jw(n,1).join(""):t.slice(1);return r[e]()+i}}("toUpperCase");var xS=function(e){return _S(bS(e).toLowerCase())};var wS=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n};var SS=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ES=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,AS=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var TS=function(e){return(e=bS(e))&&e.replace(ES,SS).replace(AS,"")},kS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var MS=function(e){return e.match(kS)||[]},CS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var IS=function(e){return CS.test(e)},PS="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",OS="["+PS+"]",RS="\\d+",LS="[\\u2700-\\u27bf]",NS="[a-z\\xdf-\\xf6\\xf8-\\xff]",DS="[^\\ud800-\\udfff"+PS+RS+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",jS="(?:\\ud83c[\\udde6-\\uddff]){2}",zS="[\\ud800-\\udbff][\\udc00-\\udfff]",FS="[A-Z\\xc0-\\xd6\\xd8-\\xde]",BS="(?:"+NS+"|"+DS+")",US="(?:"+FS+"|"+DS+")",VS="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",GS="[\\ufe0e\\ufe0f]?"+VS+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",jS,zS].join("|")+")[\\ufe0e\\ufe0f]?"+VS+")*"),HS="(?:"+[LS,jS,zS].join("|")+")"+GS,ZS=RegExp([FS+"?"+NS+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[OS,FS,"$"].join("|")+")",US+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[OS,FS+BS,"$"].join("|")+")",FS+"?"+BS+"+(?:['’](?:d|ll|m|re|s|t|ve))?",FS+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",RS,HS].join("|"),"g");var WS=function(e){return e.match(ZS)||[]};var qS=function(e,t,n){return e=bS(e),void 0===(t=n?void 0:t)?IS(e)?WS(e):MS(e):e.match(t)||[]},XS=RegExp("['’]","g");var YS,KS,QS,JS,$S,eE,tE,nE,rE,iE,oE,aE,sE,uE,cE,lE,fE,hE,dE,pE=function(e){return function(t){return wS(qS(TS(t).replace(XS,"")),e,"")}}((function(e,t,n){return t=t.toLowerCase(),e+(n?xS(t):t)})),vE=(YS=Q(),KS=J(nr.IShaderModuleService),YS(($S=go((JS=function(){function t(){Wi(this,t),vo(this,"shaderModuleService",$S,this),this.rendererService=void 0,this.config=void 0,this.quad=Kw,this.enabled=!0,this.renderToScreen=!1,this.model=void 0,this.name=void 0,this.optionsToUpdate={}}return Xi(t,[{key:"getName",value:function(){return this.name}},{key:"setName",value:function(e){this.name=e}},{key:"getType",value:function(){return e.PassType.PostProcessing}},{key:"init",value:function(t,n){this.config=n,this.rendererService=t.getContainer().get(nr.IRendererService);var r=this.rendererService,i=r.createAttribute,o=r.createBuffer,a=r.createModel,s=this.setupShaders(),u=s.vs,c=s.fs,l=s.uniforms;this.model=a({vs:u,fs:c,attributes:{a_Position:i({buffer:o({data:[-4,-4,4,-4,0,4],type:e.gl.FLOAT}),size:2})},uniforms:Qi(Qi({u_Texture:null},l),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:"copy"===this.getName()}})}},{key:"render",value:function(e){var t=this,n=e.multiPassRenderer.getPostProcessor(),r=this.rendererService,i=r.useFramebuffer,o=r.getViewportSize,a=r.clear,s=o(),u=s.width,c=s.height;i(this.renderToScreen?null:n.getWriteFBO(),(function(){a({framebuffer:n.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0}),t.model.draw({uniforms:Qi({u_Texture:n.getReadFBO(),u_ViewportSize:[u,c]},t.convertOptionsToUniforms(t.optionsToUpdate))})}))}},{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(e){this.enabled=e}},{key:"setRenderToScreen",value:function(e){this.renderToScreen=e}},{key:"updateOptions",value:function(e){this.optionsToUpdate=Qi(Qi({},this.optionsToUpdate),e)}},{key:"setupShaders",value:function(){throw new Error("Method not implemented.")}},{key:"convertOptionsToUniforms",value:function(e){var t={};return Object.keys(e).forEach((function(n){n_(e[n])||(t["u_".concat(_S(pE(n)))]=e[n])})),t}}]),t}()).prototype,"shaderModuleService",[KS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),QS=JS))||QS),gE=Q()(eE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:Kw,fs:Yw});var e=this.shaderModuleService.getModule("blur-pass"),t=e.vs,n=e.fs,r=e.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:t,fs:n,uniforms:Qi(Qi({},r),{},{u_ViewportSize:[o,a]})}}},{key:"convertOptionsToUniforms",value:function(e){var t={};return n_(e.blurRadius)||(t.u_BlurDir=[e.blurRadius,0]),t}}]),n}(vE))||eE,mE=Q()(tE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:Kw,fs:Yw});var e=this.shaderModuleService.getModule("blur-pass"),t=e.vs,n=e.fs,r=e.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:t,fs:n,uniforms:Qi(Qi({},r),{},{u_ViewportSize:[o,a]})}}},{key:"convertOptionsToUniforms",value:function(e){var t={};return n_(e.blurRadius)||(t.u_BlurDir=[0,e.blurRadius]),t}}]),n}(vE))||tE,yE=Q()(nE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:Kw,fs:'varying vec2 v_UV;\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_Center : [0.5, 0.5];\nuniform float u_Angle : 0;\nuniform float u_Size : 8;\n#pragma include "common"\nfloat scale = PI / u_Size;\nfloat pattern(float u_Angle, vec2 texSize, vec2 texCoord) {\nfloat s = sin(u_Angle), c = cos(u_Angle);\nvec2 tex = texCoord * texSize - u_Center * texSize;\nvec2 point = vec2(\nc * tex.x - s * tex.y,\ns * tex.x + c * tex.y\n) * scale;\nreturn (sin(point.x) * sin(point.y)) * 4.0;\n}\nvec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\nvec3 cmy = 1.0 - color.rgb;\nfloat k = min(cmy.x, min(cmy.y, cmy.z));\ncmy = (cmy - k) / (1.0 - k);\ncmy = clamp(\ncmy * 10.0 - 3.0 + vec3(\npattern(u_Angle + 0.26179, texSize, texCoord),\npattern(u_Angle + 1.30899, texSize, texCoord),\npattern(u_Angle, texSize, texCoord)\n),\n0.0,\n1.0\n);\nk = clamp(k * 10.0 - 5.0 + pattern(u_Angle + 0.78539, texSize, texCoord), 0.0, 1.0);\nreturn vec4(1.0 - cmy - k, color.a);\n}\nvoid main() {\ngl_FragColor = vec4(texture2D(u_Texture, v_UV));\ngl_FragColor = colorHalftone_filterColor(gl_FragColor, u_ViewportSize, v_UV);\n}'});var e=this.shaderModuleService.getModule("colorhalftone-pass"),t=e.vs,n=e.fs,r=e.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:t,fs:n,uniforms:Qi(Qi({},r),{},{u_ViewportSize:[o,a]})}}}]),n}(vE))||nE,bE="varying vec2 v_UV;\nuniform sampler2D u_Texture;\nvoid main() {\ngl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}",_E=Q()(rE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("copy-pass",{vs:Kw,fs:bE}),this.shaderModuleService.getModule("copy-pass")}}]),n}(vE))||rE,xE=Q()(iE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:Kw,fs:"varying vec2 v_UV;\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform vec2 u_Center : [0.5, 0.5];\nuniform float u_Scale : 10;\nvec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\nvec2 tex = (texCoord * texSize - u_Center * texSize) / u_Scale;\ntex.y /= 0.866025404;\ntex.x -= tex.y * 0.5;\nvec2 a;\nif (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {\na = vec2(floor(tex.x), floor(tex.y));\n}\nelse a = vec2(ceil(tex.x), ceil(tex.y));\nvec2 b = vec2(ceil(tex.x), floor(tex.y));\nvec2 c = vec2(floor(tex.x), ceil(tex.y));\nvec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);\nvec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);\nvec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);\nvec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);\nfloat alen = length(TEX - A);\nfloat blen = length(TEX - B);\nfloat clen = length(TEX - C);\nvec2 choice;\nif (alen < blen) {\nif (alen < clen) choice = a;\nelse choice = c;\n} else {\nif (blen < clen) choice = b;\nelse choice = c;\n}\nchoice.x += choice.y * 0.5;\nchoice.y *= 0.866025404;\nchoice *= u_Scale / texSize;\nreturn texture2D(texture, choice + u_Center);\n}\nvoid main() {\ngl_FragColor = vec4(texture2D(u_Texture, v_UV));\ngl_FragColor = hexagonalPixelate_sampleColor(u_Texture, u_ViewportSize, v_UV);\n}"});var e=this.shaderModuleService.getModule("hexagonalpixelate-pass"),t=e.vs,n=e.fs,r=e.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:t,fs:n,uniforms:Qi(Qi({},r),{},{u_ViewportSize:[o,a]})}}}]),n}(vE))||iE,wE=Q()(oE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("ink-pass",{vs:Kw,fs:"varying vec2 v_UV;\nuniform sampler2D u_Texture;\nuniform vec2 u_ViewportSize: [1.0, 1.0];\nuniform float u_Strength : 0.6;\nvec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\nvec2 dx = vec2(1.0 / texSize.x, 0.0);\nvec2 dy = vec2(0.0, 1.0 / texSize.y);\nvec4 color = texture2D(texture, texCoord);\nfloat bigTotal = 0.0;\nfloat smallTotal = 0.0;\nvec3 bigAverage = vec3(0.0);\nvec3 smallAverage = vec3(0.0);\nfor (float x = -2.0; x <= 2.0; x += 1.0) {\nfor (float y = -2.0; y <= 2.0; y += 1.0) {\nvec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;\nbigAverage += sample;\nbigTotal += 1.0;\nif (abs(x) + abs(y) < 2.0) {\nsmallAverage += sample;\nsmallTotal += 1.0;\n}\n}\n}\nvec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);\nfloat power = u_Strength * u_Strength * u_Strength * u_Strength * u_Strength;\nreturn vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);\n}\nvoid main() {\ngl_FragColor = vec4(texture2D(u_Texture, v_UV));\ngl_FragColor = ink_sampleColor(u_Texture, u_ViewportSize, v_UV);\n}"});var e=this.shaderModuleService.getModule("ink-pass"),t=e.vs,n=e.fs,r=e.uniforms,i=this.rendererService.getViewportSize(),o=i.width,a=i.height;return{vs:t,fs:n,uniforms:Qi(Qi({},r),{},{u_ViewportSize:[o,a]})}}}]),n}(vE))||oE,SE=Q()(aE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("noise-pass",{vs:Kw,fs:"varying vec2 v_UV;\nuniform sampler2D u_Texture;\nuniform float u_Amount : 0.5;\nfloat rand(vec2 co) {\nreturn fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvec4 noise_filterColor(vec4 color, vec2 texCoord) {\nfloat diff = (rand(texCoord) - 0.5) * u_Amount;\ncolor.r += diff;\ncolor.g += diff;\ncolor.b += diff;\nreturn color;\n}\nvoid main() {\ngl_FragColor = vec4(texture2D(u_Texture, v_UV));\ngl_FragColor = noise_filterColor(gl_FragColor, v_UV);\n}"}),this.shaderModuleService.getModule("noise-pass")}}]),n}(vE))||aE,EE=Q()(sE=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("sepia-pass",{vs:Kw,fs:"varying vec2 v_UV;\nuniform sampler2D u_Texture;\nuniform float u_Amount : 0.5;\nvec4 sepia_filterColor(vec4 color) {\nfloat r = color.r;\nfloat g = color.g;\nfloat b = color.b;\ncolor.r =\nmin(1.0, (r * (1.0 - (0.607 * u_Amount))) + (g * (0.769 * u_Amount)) + (b * (0.189 * u_Amount)));\ncolor.g = min(1.0, (r * 0.349 * u_Amount) + (g * (1.0 - (0.314 * u_Amount))) + (b * 0.168 * u_Amount));\ncolor.b = min(1.0, (r * 0.272 * u_Amount) + (g * 0.534 * u_Amount) + (b * (1.0 - (0.869 * u_Amount))));\nreturn color;\n}\nvoid main() {\ngl_FragColor = vec4(texture2D(u_Texture, v_UV));\ngl_FragColor = sepia_filterColor(gl_FragColor);\n}"}),this.shaderModuleService.getModule("sepia-pass")}}]),n}(vE))||sE,AE=Te.f,TE=oe((function(){AE(1)}));Pt({target:"Object",stat:!0,forced:!ae||TE,sham:!ae},{getOwnPropertyDescriptor:function(e,t){return AE(ge(e),t)}});var kE,ME,CE,IE,PE,OE,RE,LE,NE=(uE=Q(),cE=J(nr.IRendererService),lE=$(),uE((dE=go((hE=function(){function e(){Wi(this,e),vo(this,"rendererService",dE,this),this.passes=[],this.readFBO=void 0,this.writeFBO=void 0}var t;return Xi(e,[{key:"getReadFBO",value:function(){return this.readFBO}},{key:"getWriteFBO",value:function(){return this.writeFBO}},{key:"render",value:(t=Zi(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(n<this.passes.length)){e.next=10;break}return(r=this.passes[n]).setRenderToScreen(this.isLastEnabledPass(n)),e.next=6,r.render(t);case 6:n!==this.passes.length-1&&this.swap();case 7:n++,e.next=1;break;case 10:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"resize",value:function(e,t){this.readFBO.resize({width:e,height:t}),this.writeFBO.resize({width:e,height:t})}},{key:"add",value:function(e,t,n){e.init(t,n),this.passes.push(e)}},{key:"insert",value:function(e,t,n,r){e.init(n,r),this.passes.splice(t,0,e)}},{key:"getPostProcessingPassByName",value:function(e){return this.passes.find((function(t){return t.getName()===e}))}},{key:"init",value:function(){}},{key:"isLastEnabledPass",value:function(e){for(var t=e+1;t<this.passes.length;t++)if(this.passes[t].isEnabled())return!1;return!0}},{key:"swap",value:function(){var e=this.readFBO;this.readFBO=this.writeFBO,this.writeFBO=e}}]),e}()).prototype,"rendererService",[cE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),go(hE.prototype,"init",[lE],Object.getOwnPropertyDescriptor(hE.prototype,"init"),hE.prototype),fE=hE))||fE),DE=Q()(kE=function(t){Ji(r,t);var n=so(r);function r(){return Wi(this,r),n.apply(this,arguments)}return Xi(r,[{key:"getType",value:function(){return e.PassType.Normal}},{key:"getName",value:function(){return"render"}},{key:"init",value:function(e,t){uo($i(r.prototype),"init",this).call(this,e,t)}},{key:"render",value:function(e){var t=this.rendererService,n=t.useFramebuffer,r=t.clear;n(null,(function(){r({color:[0,0,0,0],depth:1,stencil:0}),e.multiPassRenderer.setRenderFlag(!1),e.render(),e.multiPassRenderer.setRenderFlag(!0)}))}}]),r}(Zw))||kE;function jE(e,t){for(var n=0,r=1/t,i=e;i>0;)n+=r*(i%t),i=Math.floor(i/t),r/=t;return n}var zE=1,FE=(ME=Q(),CE=J(nr.IShaderModuleService),IE=J(nr.ILogService),ME((RE=go((OE=function(t){Ji(r,t);var n=so(r);function r(){var e;Wi(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return vo(e=n.call.apply(n,[this].concat(i)),"shaderModuleService",RE,oo(e)),vo(e,"logger",LE,oo(e)),e.haltonSequence=[],e.accumulatingId=0,e.frame=0,e.timer=void 0,e.sampleRenderTarget=void 0,e.prevRenderTarget=void 0,e.outputRenderTarget=void 0,e.copyRenderTarget=void 0,e.blendModel=void 0,e.outputModel=void 0,e.copyModel=void 0,e}return Xi(r,[{key:"getType",value:function(){return e.PassType.Normal}},{key:"getName",value:function(){return"taa"}},{key:"init",value:function(t,n){uo($i(r.prototype),"init",this).call(this,t,n);var i=this.rendererService,o=i.createFramebuffer,a=i.createTexture2D;this.sampleRenderTarget=o({color:a({width:1,height:1,wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE})}),this.prevRenderTarget=o({color:a({width:1,height:1,wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE})}),this.outputRenderTarget=o({color:a({width:1,height:1,wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE})}),this.copyRenderTarget=o({color:a({width:1,height:1,wrapS:e.gl.CLAMP_TO_EDGE,wrapT:e.gl.CLAMP_TO_EDGE})});for(var s=0;s<30;s++)this.haltonSequence.push([jE(s,2),jE(s,3)]);this.blendModel=this.createTriangleModel("blend-pass","uniform float u_opacity : 1.0;\nuniform float u_MixRatio : 0.5;\nuniform sampler2D u_Diffuse1;\nuniform sampler2D u_Diffuse2;\nvarying vec2 v_UV;\nvoid main() {\nvec4 texel1 = texture2D(u_Diffuse1, v_UV);\nvec4 texel2 = texture2D(u_Diffuse2, v_UV);\ngl_FragColor = u_opacity * mix(texel1, texel2, u_MixRatio);\n}"),this.outputModel=this.createTriangleModel("copy-pass",bE,{blend:{enable:!0,func:{srcRGB:e.gl.ONE,dstRGB:e.gl.ONE_MINUS_SRC_ALPHA,srcAlpha:e.gl.ONE,dstAlpha:e.gl.ONE_MINUS_SRC_ALPHA},equation:{rgb:e.gl.FUNC_ADD,alpha:e.gl.FUNC_ADD}}}),this.copyModel=this.createTriangleModel("copy-pass",bE)}},{key:"render",value:function(e){var t=this,n=this.rendererService,r=n.clear,i=n.getViewportSize,o=n.useFramebuffer,a=i(),s=a.width,u=a.height;this.sampleRenderTarget.resize({width:s,height:u}),this.prevRenderTarget.resize({width:s,height:u}),this.outputRenderTarget.resize({width:s,height:u}),this.copyRenderTarget.resize({width:s,height:u}),this.resetFrame(),this.stopAccumulating();var c=e.multiPassRenderer.getPostProcessor().getReadFBO();o(c,(function(){r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:c}),e.multiPassRenderer.setRenderFlag(!1),e.render(),e.multiPassRenderer.setRenderFlag(!0)}));this.accumulatingId=zE++,this.timer=window.setTimeout((function(){!function n(r){t.accumulatingId&&r===t.accumulatingId&&(t.isFinished()||(t.doRender(e),requestAnimationFrame((function(){n(r)}))))}(t.accumulatingId)}),50)}},{key:"doRender",value:function(e){var t=this;this.logger.debug("accumulatingId: ".concat(this.accumulatingId));var n=this.rendererService,r=n.clear,i=n.getViewportSize,o=n.useFramebuffer,a=i(),s=a.width,u=a.height,c=e.getLayerConfig().jitterScale,l=void 0===c?1:c,f=this.haltonSequence[this.frame%this.haltonSequence.length];this.cameraService.jitterProjectionMatrix((2*f[0]-1)/s*l,(2*f[1]-1)/u*l),e.multiPassRenderer.setRenderFlag(!1),e.hooks.beforeRender.call(),o(this.sampleRenderTarget,(function(){r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:t.sampleRenderTarget}),e.render()})),e.hooks.afterRender.call(),e.multiPassRenderer.setRenderFlag(!0);var h=e.getLayerConfig();o(this.outputRenderTarget,(function(){t.blendModel.draw({uniforms:{u_opacity:h.opacity||1,u_MixRatio:0===t.frame?1:.9,u_Diffuse1:t.sampleRenderTarget,u_Diffuse2:0===t.frame?e.multiPassRenderer.getPostProcessor().getReadFBO():t.prevRenderTarget}})})),0===this.frame&&r({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.copyRenderTarget}),this.frame>=1&&(o(this.copyRenderTarget,(function(){t.outputModel.draw({uniforms:{u_Texture:t.outputRenderTarget}})})),o(e.multiPassRenderer.getPostProcessor().getReadFBO(),(function(){t.copyModel.draw({uniforms:{u_Texture:t.copyRenderTarget}})})),e.multiPassRenderer.getPostProcessor().render(e));var d=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=d,this.frame++,this.cameraService.clearJitterProjectionMatrix()}},{key:"isFinished",value:function(){return this.frame>=this.haltonSequence.length}},{key:"resetFrame",value:function(){this.frame=0}},{key:"stopAccumulating",value:function(){this.accumulatingId=0,window.clearTimeout(this.timer)}},{key:"createTriangleModel",value:function(t,n,r){this.shaderModuleService.registerModule(t,{vs:Kw,fs:n});var i=this.shaderModuleService.getModule(t),o=i.vs,a=i.fs,s=i.uniforms,u=this.rendererService,c=u.createAttribute,l=u.createBuffer;return(0,u.createModel)(Qi({vs:o,fs:a,attributes:{a_Position:c({buffer:l({data:[-4,-4,4,-4,0,4],type:e.gl.FLOAT}),size:2})},uniforms:Qi({},s),depth:{enable:!1},count:3},r))}}]),r}(Zw)).prototype,"shaderModuleService",[CE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),LE=go(OE.prototype,"logger",[IE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),PE=OE))||PE),BE=new K;BE.bind(nr.IGlobalConfigService).to(By).inSingletonScope(),BE.bind(nr.IShaderModuleService).to(Rw).inSingletonScope(),BE.bind(nr.ILogService).to(B_).inSingletonScope(),ee(Q(),s),BE.bind(nr.IEventEmitter).to(s);var UE=ne(BE,!1),VE=function(e){var t=UE.lazyInject(e);return function(e,n,r){t.call(this,e,n),r&&(r.initializer=function(){return e[n]})}},GE=0;function HE(){var e=new K;return e.parent=BE,e.bind(nr.SceneID).toConstantValue("".concat(GE++)),e.bind(nr.ILayerService).to(Ub).inSingletonScope(),e.bind(nr.ISceneService).to(rw).inSingletonScope(),e.bind(nr.ICameraService).to(sg).inSingletonScope(),e.bind(nr.ICoordinateSystemService).to(db).inSingletonScope(),e.bind(nr.IInteractionService).to(gb).inSingletonScope(),e.bind(nr.IPickingService).to(Fb).inSingletonScope(),e.bind(nr.IControlService).to(ug).inSingletonScope(),e.bind(nr.IMarkerService).to(cg).inSingletonScope(),e.bind(nr.IIconService).to(Qp).inSingletonScope(),e.bind(nr.IFontService).to(kd).inSingletonScope(),e.bind(nr.IPopupService).to(lg).inSingletonScope(),e.bind(nr.INormalPass).to(Ww).whenTargetNamed("clear"),e.bind(nr.INormalPass).to(Xw).whenTargetNamed("pixelPicking"),e.bind(nr.INormalPass).to(DE).whenTargetNamed("render"),e.bind(nr.INormalPass).to(FE).whenTargetNamed("taa"),e.bind(nr.IFactoryNormalPass).toFactory((function(e){return function(t){return e.container.getNamed(nr.INormalPass,t)}})),e.bind(nr.IPostProcessingPass).to(_E).whenTargetNamed("copy"),e.bind(nr.IPostProcessingPass).to(gE).whenTargetNamed("blurH"),e.bind(nr.IPostProcessingPass).to(mE).whenTargetNamed("blurV"),e.bind(nr.IPostProcessingPass).to(SE).whenTargetNamed("noise"),e.bind(nr.IPostProcessingPass).to(EE).whenTargetNamed("sepia"),e.bind(nr.IPostProcessingPass).to(yE).whenTargetNamed("colorHalftone"),e.bind(nr.IPostProcessingPass).to(xE).whenTargetNamed("hexagonalPixelate"),e.bind(nr.IPostProcessingPass).to(wE).whenTargetNamed("ink"),e.bind(nr.IFactoryPostProcessingPass).toFactory((function(e){return function(t){var n=e.container.getNamed(nr.IPostProcessingPass,t);return n.setName(t),n}})),e}function ZE(e){var t=new K;return t.parent=e,t.bind(nr.IStyleAttributeService).to(o_).inSingletonScope(),t.bind(nr.IMultiPassRenderer).to(qw).inSingletonScope(),t.bind(nr.IPostProcessor).to(NE).inSingletonScope(),t}var WE=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e},qE=/^\s+|\s+$/g,XE=/^[-+]0x[0-9a-f]+$/i,YE=/^0b[01]+$/i,KE=/^0o[0-7]+$/i,QE=parseInt;var JE=function(e){if("number"==typeof e)return e;if(vS(e))return NaN;if(zg(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=zg(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(qE,"");var n=YE.test(e);return n||KE.test(e)?QE(e.slice(2),n?2:8):XE.test(e)?NaN:+e};var $E=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=JE(n))==n?n:0),void 0!==t&&(t=(t=JE(t))==t?t:0),WE(JE(e),t,n)},eA=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"];function tA(e){return eA.indexOf(e)}var nA,rA,iA,oA;function aA(e,t){return 256*(e=$E(Math.floor(e),0,255))+(t=$E(Math.floor(t),0,255))}(nA=e.BlendType||(e.BlendType={})).normal="normal",nA.additive="additive",nA.subtractive="subtractive",nA.min="min",nA.max="max",nA.none="none",(rA=e.ScaleTypes||(e.ScaleTypes={})).LINEAR="linear",rA.POWER="power",rA.LOG="log",rA.IDENTITY="identity",rA.TIME="time",rA.QUANTILE="quantile",rA.QUANTIZE="quantize",rA.THRESHOLD="threshold",rA.CAT="cat",(iA=e.StyleScaleType||(e.StyleScaleType={})).CONSTANT="constant",iA.VARIABLE="variable",(oA=e.AttributeType||(e.AttributeType={}))[oA.Attribute=0]="Attribute",oA[oA.InstancedAttribute=1]="InstancedAttribute",oA[oA.Uniform=2]="Uniform";var sA,uA=["mapload"],cA={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"},lA=["loaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"];!function(e){e.TOPRIGHT="topright",e.TOPLEFT="topleft",e.BOTTOMRIGHT="bottomright",e.BOTTOMLEFT="bottomleft"}(e.PositionType||(e.PositionType={})),function(e){e.TOPRIGHT="topright",e.TOPLEFT="topleft",e.BOTTOMRIGHT="bottomright",e.BOTTOMLEFT="bottomleft"}(sA||(sA={}));var fA=0,hA=function(e){Ji(n,e);var t=so(n);function n(e){var r;return Wi(this,n),(r=t.call(this)).controlOption=void 0,r.container=void 0,r.sceneContainer=void 0,r.mapsService=void 0,r.renderService=void 0,r.layerService=void 0,r.controlService=void 0,r.isShow=void 0,r.controlOption=Qi(Qi({},r.getDefault()),e||{}),r}return Xi(n,[{key:"getDefault",value:function(){return{position:sA.TOPRIGHT,name:"".concat(fA++)}}},{key:"setPosition",value:function(e){var t=this.controlService;return t&&t.removeControl(this),this.controlOption.position=e,t&&t.addControl(this,this.sceneContainer),this}},{key:"addTo",value:function(e){this.mapsService=e.get(nr.IMapService),this.renderService=e.get(nr.IRendererService),this.layerService=e.get(nr.ILayerService),this.controlService=e.get(nr.IControlService),this.sceneContainer=e,this.isShow=!0,this.container=this.onAdd();var t=this.container,n=this.controlOption.position,r=this.controlService.controlCorners[n];return Ca(t,"l7-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this}},{key:"onAdd",value:function(){throw new Error("Method not implemented.")}},{key:"onRemove",value:function(){throw new Error("Method not implemented.")}},{key:"hide",value:function(){Ca(this.container,"l7-control-hide"),this.isShow=!1}},{key:"show",value:function(){Ia(this.container,"l7-control-hide"),this.isShow=!0}},{key:"remove",value:function(){if(!this.mapsService)return this;Ma(this.container),this.onRemove()}},{key:"_refocusOnMap",value:function(e){if(this.mapsService&&e&&e.screenX>0&&e.screenY>0){var t=this.mapsService.getContainer();null!==t&&t.focus()}}}]),n}(s),dA=function(t){Ji(r,t);var n=so(r);function r(e){var t;return Wi(this,r),(t=n.call(this,e)).layerControlInputs=void 0,t.layers=void 0,t.lastZIndex=void 0,t.handlingClick=void 0,t.layersLink=void 0,t.baseLayersList=void 0,t.separator=void 0,t.overlaysList=void 0,t.form=void 0,t.layerControlInputs=[],t.layers=[],t.lastZIndex=0,t.handlingClick=!1,t.initLayers(),vh(["checkDisabledLayers","onLayerChange","collapse","extend","expand","onInputClick"],oo(t)),t}return Xi(r,[{key:"getDefault",value:function(){return{collapsed:!0,position:e.PositionType.TOPRIGHT,autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,name:"layers"}}},{key:"onAdd",value:function(){var e=this;return this.initLayout(),this.update(),this.mapsService.on("zoomend",this.checkDisabledLayers),this.layers.forEach((function(t){t.layer.on("remove",e.onLayerChange),t.layer.on("add",e.onLayerChange)})),this.container}},{key:"addVisualLayer",value:function(e,t){return this.addLayer(e,t,!0),this.mapsService?this.update():this}},{key:"expand",value:function(){var e=this.renderService.getViewportSize().height;Ca(this.container,"l7-control-layers-expanded"),this.form.style.height="null";var t=e-(this.container.offsetTop+50);return t<this.form.clientHeight?(Ca(this.form,"l7-control-layers-scrollbar"),this.form.style.height=t+"px"):Ia(this.form,"l7-control-layers-scrollbar"),this.checkDisabledLayers(),this}},{key:"collapse",value:function(){return Ia(this.container,"l7-control-layers-expanded"),this}},{key:"onRemove",value:function(){var e=this;this.mapsService&&(this.mapsService.off("click",this.collapse),this.layers.forEach((function(t){t.layer.off("remove",e.onLayerChange),t.layer.off("add",e.onLayerChange)})))}},{key:"initLayout",value:function(){var e="l7-control-layers",t=this.container=ka("div",e),n=this.controlOption.collapsed;t.setAttribute("aria-haspopup","true");var r=this.form=ka("form",e+"-list");n&&(this.mapsService.on("click",this.collapse),t.addEventListener("mouseenter",this.expand),t.addEventListener("mouseleave",this.collapse)),this.layersLink=ka("a",e+"-toggle",t),this.layersLink.title="Layers",n||this.expand(),this.baseLayersList=ka("div",e+"-base",r),this.separator=ka("div",e+"-separator",r),this.overlaysList=ka("div",e+"-overlays",r),t.appendChild(r)}},{key:"initLayers",value:function(){var e=this,t=this.controlOption,n=t.baseLayers,r=void 0===n?{}:n,i=t.overlayers,o=void 0===i?{}:i;Object.keys(r).forEach((function(t,n){e.addLayer(r[t],t,!1)})),Object.keys(o).forEach((function(t,n){e.addLayer(o[t],t,!0)}))}},{key:"update",value:function(){if(!this.container)return this;var e,t,n,r;La(this.baseLayersList),La(this.overlaysList),this.layerControlInputs=[];var i=0;for(n=0;n<this.layers.length;n++)r=this.layers[n],this.addItem(r),t=t||r.overlay,e=e||!r.overlay,i+=r.overlay?0:1;return this.controlOption.hideSingleBase&&(e=e&&i>1,this.baseLayersList.style.display=e?"":"none"),this.separator.style.display=t&&e?"":"none",this}},{key:"checkDisabledLayers",value:function(){for(var e,t,n=this.layerControlInputs,r=this.mapsService.getZoom(),i=n.length-1;i>=0;i--)if(e=n[i],(t=this.layerService.getLayer(e.layerId))&&t.inited){var o=t.getMinZoom(),a=t.getMaxZoom();e.disabled=r<o||r>a}}},{key:"addLayer",value:function(e,t,n){this.mapsService&&(e.on("add",this.onLayerChange),e.on("remove",this.onLayerChange)),this.layers.push({layer:e,name:t,overlay:n});var r=this.controlOption,i=r.sortLayers,o=r.sortFunction,a=r.autoZIndex;i&&this.layers.sort((function(e,t){return o(e.layer,t.layer,e.name,t.name)})),a&&e.setZIndex&&(this.lastZIndex++,e.setZIndex(this.lastZIndex)),this.expandIfNotCollapsed()}},{key:"expandIfNotCollapsed",value:function(){return this.mapsService&&!this.controlOption.collapsed&&this.expand(),this}},{key:"onLayerChange",value:function(e){this.handlingClick||this.update();var t=this.layerService.getLayer(e.target.layerId),n=(null==t?void 0:t.overlay)?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this.emit(n,t)}},{key:"createRadioElement",value:function(e,t){var n='<input type="radio" class="l7-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",r=document.createElement("div");return r.innerHTML=n,r.firstChild}},{key:"addItem",value:function(e){var t,n=document.createElement("label"),r=this.layerService.getLayer(e.layer.id),i=r&&r.inited&&e.layer.isVisible();e.overlay?((t=document.createElement("input")).type="checkbox",t.className="l7-control-layers-selector",t.defaultChecked=i):t=this.createRadioElement("l7-base-layers",i),this.layerControlInputs.push(t),t.layerId=e.layer.id,t.addEventListener("click",this.onInputClick);var o=document.createElement("span");o.innerHTML=" "+e.name;var a=document.createElement("div");return n.appendChild(a),a.appendChild(t),a.appendChild(o),(e.overlay?this.overlaysList:this.baseLayersList).appendChild(n),this.checkDisabledLayers(),n}},{key:"onInputClick",value:function(){var e,t,n=this.layerControlInputs,r=[],i=[];this.handlingClick=!0;for(var o=n.length-1;o>=0;o--)e=n[o],t=this.layerService.getLayer(e.layerId),e.checked?r.push(t):e.checked||i.push(t);i.forEach((function(e){e.hide()})),r.forEach((function(e){e.show()})),this.handlingClick=!1}}]),r}(hA),pA=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"getDefault",value:function(){return{position:sA.BOTTOMLEFT,name:"logo"}}},{key:"onAdd",value:function(){var e=ka("div","l7-control-logo"),t=ka("a","l7-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://antv.alipay.com/l7",t.setAttribute("aria-label","AntV logo"),t.setAttribute("rel","noopener nofollow"),e.appendChild(t),e}},{key:"onRemove",value:function(){return null}}]),n}(hA),vA=function(e){Ji(n,e);var t=so(n);function n(e){var r;return Wi(this,n),(r=t.call(this,e)).mScale=void 0,r.iScale=void 0,vh(["update"],oo(r)),r}return Xi(n,[{key:"getDefault",value:function(){return{position:sA.BOTTOMLEFT,maxWidth:100,metric:!0,updateWhenIdle:!1,imperial:!1,name:"scale"}}},{key:"onAdd",value:function(){var e=ka("div","l7-control-scale");this.addScales("l7-control-scale-line",e);var t=this.controlOption.updateWhenIdle;return this.mapsService.on(t?"moveend":"mapmove",this.update),this.mapsService.on(t?"zoomend":"zoomchange",this.update),this.update(),e}},{key:"onRemove",value:function(){var e=this.controlOption.updateWhenIdle;this.mapsService.off(e?"zoomend":"zoomchange",this.update),this.mapsService.off(e?"moveend":"mapmove",this.update)}},{key:"update",value:function(){var e=this.mapsService,t=this.controlOption.maxWidth,n=e.getSize()[1]/2,r=e.containerToLngLat([0,n]),i=e.containerToLngLat([t,n]),o=rh([r.lng,r.lat],[i.lng,i.lat]);this.updateScales(o)}},{key:"updateScales",value:function(e){var t=this.controlOption,n=t.metric,r=t.imperial;n&&e&&this.updateMetric(e),r&&e&&this.updateImperial(e)}},{key:"updateMetric",value:function(e){var t=this.getRoundNum(e),n=t<1e3?t+" m":t/1e3+" km";this.updateScale(this.mScale,n,t/e)}},{key:"updateImperial",value:function(e){var t,n,r,i=3.2808399*e;i>5280?(t=i/5280,n=this.getRoundNum(t),this.updateScale(this.iScale,n+" mi",n/t)):(r=this.getRoundNum(i),this.updateScale(this.iScale,r+" ft",r/i))}},{key:"updateScale",value:function(e,t,n){var r=this.controlOption.maxWidth;e.style.width=Math.round(r*n)+"px",e.innerHTML=t}},{key:"getRoundNum",value:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}},{key:"addScales",value:function(e,t){var n=this.controlOption,r=n.metric,i=n.imperial;r&&(this.mScale=ka("div",e,t)),i&&(this.iScale=ka("div",e,t))}}]),n}(hA),gA=function(e){Ji(n,e);var t=so(n);function n(e){var r;return Wi(this,n),(r=t.call(this,e)).disabled=void 0,r.zoomInButton=void 0,r.zoomOutButton=void 0,vh(["updateDisabled","zoomIn","zoomOut"],oo(r)),r}return Xi(n,[{key:"getDefault",value:function(){return{position:sA.TOPLEFT,zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out",name:"zoom"}}},{key:"onAdd",value:function(){var e=ka("div","l7-control-zoom l7-bar");return this.zoomInButton=this.createButton(this.controlOption.zoomInText,this.controlOption.zoomInTitle,"l7-control-zoom-in",e,this.zoomIn),this.zoomOutButton=this.createButton(this.controlOption.zoomOutText,this.controlOption.zoomOutTitle,"l7-control-zoom-out",e,this.zoomOut),this.mapsService.on("zoomend",this.updateDisabled),this.mapsService.on("zoomchange",this.updateDisabled),this.updateDisabled(),e}},{key:"onRemove",value:function(){this.mapsService.off("zoomend",this.updateDisabled),this.mapsService.off("zoomchange",this.updateDisabled)}},{key:"disable",value:function(){return this.disabled=!0,this.updateDisabled(),this}},{key:"enable",value:function(){return this.disabled=!1,this.updateDisabled(),this}},{key:"zoomIn",value:function(){!this.disabled&&this.mapsService.getZoom()<this.mapsService.getMaxZoom()&&this.mapsService.zoomIn()}},{key:"zoomOut",value:function(){!this.disabled&&this.mapsService.getZoom()>this.mapsService.getMinZoom()&&this.mapsService.zoomOut()}},{key:"createButton",value:function(e,t,n,r,i){var o=ka("a",n,r);return o.innerHTML=e,o.title=t,o.href="javascript:void(0)",o.addEventListener("click",i),o}},{key:"updateDisabled",value:function(){var e=this.mapsService;Ia(this.zoomInButton,"l7-disabled"),Ia(this.zoomOutButton,"l7-disabled"),(this.disabled||e.getZoom()<=e.getMinZoom())&&Ca(this.zoomOutButton,"l7-disabled"),(this.disabled||e.getZoom()>=e.getMaxZoom())&&Ca(this.zoomInButton,"l7-disabled")}}]),n}(hA),mA=/"/g,yA=function(e,t,n,r){var i=String(ve(e)),o="<"+t;return""!==n&&(o+=" "+n+'="'+String(r).replace(mA,"&quot;")+'"'),o+">"+i+"</"+t+">"},bA=function(e){return oe((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))};Pt({target:"String",proto:!0,forced:bA("anchor")},{anchor:function(e){return yA(this,"a","name",e)}});var _A=function(t){Ji(r,t);var n=so(r);function r(e){var t;return Wi(this,r),(t=n.call(this)).markerOption=void 0,t.defaultMarker=void 0,t.popup=void 0,t.mapsService=void 0,t.sceneSerive=void 0,t.lngLat=void 0,t.scene=void 0,t.added=!1,t.eventHandle=function(e){t.emit(e.type,{target:e,data:t.markerOption.extData,lngLat:t.lngLat})},t.markerOption=Qi(Qi({},t.getDefault()),e),vh(["update","onMove","onUp","addDragHandler","onMapClick"],oo(t)),t.init(),t}return Xi(r,[{key:"getDefault",value:function(){return{element:void 0,anchor:e.anchorType.BOTTOM,offsets:[0,0],color:"#5B8FF9",draggable:!1}}},{key:"addTo",value:function(e){this.scene=e,this.mapsService=e.get(nr.IMapService),this.sceneSerive=e.get(nr.ISceneService);var t=this.markerOption,n=t.element;t.draggable;return this.mapsService.getMarkerContainer().appendChild(n),this.registerMarkerEvent(n),this.mapsService.on("camerachange",this.update),this.update(),this.added=!0,this.emit("added"),this}},{key:"remove",value:function(){this.mapsService&&(this.mapsService.off("click",this.onMapClick),this.mapsService.off("move",this.update),this.mapsService.off("moveend",this.update),this.mapsService.off("mousedown",this.addDragHandler),this.mapsService.off("touchstart",this.addDragHandler),this.mapsService.off("mouseup",this.onUp),this.mapsService.off("touchend",this.onUp)),this.unRegisterMarkerEvent(),this.removeAllListeners();var e=this.markerOption.element;return e&&Ma(e),this.popup&&this.popup.remove(),this}},{key:"setLnglat",value:function(e){return this.lngLat=e,Array.isArray(e)&&(this.lngLat={lng:e[0],lat:e[1]}),this.popup&&this.popup.setLnglat(this.lngLat),this.update(),this}},{key:"getLnglat",value:function(){return this.lngLat}},{key:"getElement",value:function(){return this.markerOption.element}},{key:"setElement",value:function(e){var t=this;if(!this.added)return this.once("added",(function(){t.setElement(e)})),this;var n=this.markerOption.element;return n&&Ma(n),this.markerOption.element=e,this.init(),this.mapsService.getMarkerContainer().appendChild(e),this.registerMarkerEvent(e),this.update(),this}},{key:"openPopup",value:function(){var e=this;if(!this.added)return this.once("added",(function(){e.openPopup()})),this;var t=this.popup;return t?(t.isOpen()||t.addTo(this.scene),this):this}},{key:"closePopup",value:function(){var e=this;this.added||this.once("added",(function(){e.closePopup()}));var t=this.popup;return t&&t.remove(),this}},{key:"setPopup",value:function(e){return this.popup=e,this.lngLat&&this.popup.setLnglat(this.lngLat),this}},{key:"togglePopup",value:function(){var e=this.popup;return e?(e.isOpen()?e.remove():e.addTo(this.scene),this):this}},{key:"getPopup",value:function(){return this.popup}},{key:"getOffset",value:function(){return this.markerOption.offsets}},{key:"setDraggable",value:function(e){throw new Error("Method not implemented.")}},{key:"isDraggable",value:function(){return this.markerOption.draggable}},{key:"getExtData",value:function(){return this.markerOption.extData}},{key:"setExtData",value:function(e){this.markerOption.extData=e}},{key:"update",value:function(){if(this.mapsService){var e=this.markerOption,t=e.element,n=e.anchor;this.updatePosition(),Da(t,"".concat(Kh[n]))}}},{key:"onMapClick",value:function(e){var t=this.markerOption.element;this.popup&&t&&this.togglePopup()}},{key:"updatePosition",value:function(){if(this.mapsService){var e=this.markerOption,t=e.element,n=e.offsets,r=this.lngLat,i=r.lng,o=r.lat,a=this.mapsService.getBounds(),s=this.mapsService.getZoom();if((i<a[0][0]||i>a[1][0]||o<a[0][1]||o>a[1][1])&&s>3)t&&(t.style.display="none");else{var u=this.mapsService.lngLatToContainer([i,o]);t&&(t.style.display="block",t.style.left=u.x+n[0]+"px",t.style.top=u.y-n[1]+"px")}}}},{key:"init",value:function(){var e=this,t=this.markerOption.element,n=this.markerOption,r=n.color,i=n.anchor;if(!t){this.defaultMarker=!0,t=ka("div"),this.markerOption.element=t;var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","48px"),o.setAttributeNS(null,"width","48px"),o.setAttributeNS(null,"viewBox","0 0 1024 1024");var a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttributeNS(null,"d","M512 490.666667C453.12 490.666667 405.333333 442.88 405.333333 384 405.333333 325.12 453.12 277.333333 512 277.333333 570.88 277.333333 618.666667 325.12 618.666667 384 618.666667 442.88 570.88 490.666667 512 490.666667M512 85.333333C346.88 85.333333 213.333333 218.88 213.333333 384 213.333333 608 512 938.666667 512 938.666667 512 938.666667 810.666667 608 810.666667 384 810.666667 218.88 677.12 85.333333 512 85.333333Z"),a.setAttributeNS(null,"fill",r),o.appendChild(a),t.appendChild(o)}Ca(t,"l7-marker"),t.addEventListener("click",(function(t){e.onMapClick(t)})),t.addEventListener("click",this.eventHandle),Qh(t,i,"marker")}},{key:"registerMarkerEvent",value:function(e){e.addEventListener("mousemove",this.eventHandle),e.addEventListener("click",this.eventHandle),e.addEventListener("mousedown",this.eventHandle),e.addEventListener("mouseup",this.eventHandle),e.addEventListener("dblclick",this.eventHandle),e.addEventListener("contextmenu",this.eventHandle),e.addEventListener("mouseover",this.eventHandle),e.addEventListener("mouseout",this.eventHandle)}},{key:"unRegisterMarkerEvent",value:function(){var e=this.getElement();e.removeEventListener("mousemove",this.eventHandle),e.removeEventListener("click",this.eventHandle),e.removeEventListener("mousedown",this.eventHandle),e.removeEventListener("mouseup",this.eventHandle),e.removeEventListener("dblclick",this.eventHandle),e.removeEventListener("contextmenu",this.eventHandle),e.removeEventListener("mouseover",this.eventHandle),e.removeEventListener("mouseout",this.eventHandle)}},{key:"addDragHandler",value:function(e){throw new Error("Method not implemented.")}},{key:"onUp",value:function(e){throw new Error("Method not implemented.")}}]),r}(s),xA=o((function(e,t){e.exports=function(){function e(n,r,i,o,a,s){if(!(a-o<=i)){var u=o+a>>1;!function e(n,r,i,o,a,s){for(;a>o;){if(a-o>600){var u=a-o+1,c=i-o+1,l=Math.log(u),f=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*f*(u-f)/u)*(c-u/2<0?-1:1),d=Math.max(o,Math.floor(i-c*f/u+h)),p=Math.min(a,Math.floor(i+(u-c)*f/u+h));e(n,r,i,d,p,s)}var v=r[2*i+s],g=o,m=a;for(t(n,r,o,i),r[2*a+s]>v&&t(n,r,o,a);g<m;){for(t(n,r,g,m),g++,m--;r[2*g+s]<v;)g++;for(;r[2*m+s]>v;)m--}r[2*o+s]===v?t(n,r,o,m):(m++,t(n,r,m,a)),m<=i&&(o=m+1),i<=m&&(a=m-1)}}(n,r,u,o,a,s%2),e(n,r,i,o,u-1,s+1),e(n,r,i,u+1,a,s+1)}}function t(e,t,r,i){n(e,r,i),n(t,2*r,2*i),n(t,2*r+1,2*i+1)}function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,n,r){var i=e-n,o=t-r;return i*i+o*o}var i=function(e){return e[0]},o=function(e){return e[1]},a=function(t,n,r,a,s){void 0===n&&(n=i),void 0===r&&(r=o),void 0===a&&(a=64),void 0===s&&(s=Float64Array),this.nodeSize=a,this.points=t;for(var u=t.length<65536?Uint16Array:Uint32Array,c=this.ids=new u(t.length),l=this.coords=new s(2*t.length),f=0;f<t.length;f++)c[f]=f,l[2*f]=n(t[f]),l[2*f+1]=r(t[f]);e(c,l,a,0,c.length-1,0)};a.prototype.range=function(e,t,n,r){return function(e,t,n,r,i,o,a){for(var s,u,c=[0,e.length-1,0],l=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=a)for(var p=d;p<=h;p++)s=t[2*p],u=t[2*p+1],s>=n&&s<=i&&u>=r&&u<=o&&l.push(e[p]);else{var v=Math.floor((d+h)/2);s=t[2*v],u=t[2*v+1],s>=n&&s<=i&&u>=r&&u<=o&&l.push(e[v]);var g=(f+1)%2;(0===f?n<=s:r<=u)&&(c.push(d),c.push(v-1),c.push(g)),(0===f?i>=s:o>=u)&&(c.push(v+1),c.push(h),c.push(g))}}return l}(this.ids,this.coords,e,t,n,r,this.nodeSize)},a.prototype.within=function(e,t,n){return function(e,t,n,i,o,a){for(var s=[0,e.length-1,0],u=[],c=o*o;s.length;){var l=s.pop(),f=s.pop(),h=s.pop();if(f-h<=a)for(var d=h;d<=f;d++)r(t[2*d],t[2*d+1],n,i)<=c&&u.push(e[d]);else{var p=Math.floor((h+f)/2),v=t[2*p],g=t[2*p+1];r(v,g,n,i)<=c&&u.push(e[p]);var m=(l+1)%2;(0===l?n-o<=v:i-o<=g)&&(s.push(h),s.push(p-1),s.push(m)),(0===l?n+o>=v:i+o>=g)&&(s.push(p+1),s.push(f),s.push(m))}}return u}(this.ids,this.coords,e,t,n,this.nodeSize)};var s={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},u=function(e){this.options=v(Object.create(s),e),this.trees=new Array(this.options.maxZoom+1)};function c(e,t,n,r,i){return{x:e,y:t,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function l(e,t){var n=e.geometry.coordinates,r=n[0],i=n[1];return{x:d(r),y:p(i),zoom:1/0,index:t,parentId:-1}}function f(e){return{type:"Feature",id:e.id,properties:h(e),geometry:{type:"Point",coordinates:[(r=e.x,360*(r-.5)),(t=e.y,n=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var t,n,r}function h(e){var t=e.numPoints,n=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return v(v({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function d(e){return e/360+.5}function p(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function v(e,t){for(var n in t)e[n]=t[n];return e}function g(e){return e.x}function m(e){return e.y}return u.prototype.load=function(e){var t=this.options,n=t.log,r=t.minZoom,i=t.maxZoom,o=t.nodeSize;n&&console.time("total time");var s="prepare "+e.length+" points";n&&console.time(s),this.points=e;for(var u=[],c=0;c<e.length;c++)e[c].geometry&&u.push(l(e[c],c));this.trees[i+1]=new a(u,g,m,o,Float32Array),n&&console.timeEnd(s);for(var f=i;f>=r;f--){var h=+Date.now();u=this._cluster(u,f),this.trees[f]=new a(u,g,m,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",f,u.length,+Date.now()-h)}return n&&console.timeEnd("total time"),this},u.prototype.getClusters=function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],t),s=this.getClusters([-180,r,i,o],t);return a.concat(s)}for(var u=this.trees[this._limitZoom(t)],c=[],l=0,h=u.range(d(n),p(o),d(i),p(r));l<h.length;l+=1){var v=h[l],g=u.points[v];c.push(g.numPoints?f(g):this.points[g.index])}return c},u.prototype.getChildren=function(e){var t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var o=i.points[t];if(!o)throw new Error(r);for(var a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=[],u=0,c=i.within(o.x,o.y,a);u<c.length;u+=1){var l=c[u],h=i.points[l];h.parentId===e&&s.push(h.numPoints?f(h):this.points[h.index])}if(0===s.length)throw new Error(r);return s},u.prototype.getLeaves=function(e,t,n){t=t||10,n=n||0;var r=[];return this._appendLeaves(r,e,t,n,0),r},u.prototype.getTile=function(e,t,n){var r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),o=this.options,a=o.extent,s=o.radius/a,u=(n-s)/i,c=(n+1+s)/i,l={features:[]};return this._addTileFeatures(r.range((t-s)/i,u,(t+1+s)/i,c),r.points,t,n,i,l),0===t&&this._addTileFeatures(r.range(1-s/i,u,1,c),r.points,i,n,i,l),t===i-1&&this._addTileFeatures(r.range(0,u,s/i,c),r.points,-1,n,i,l),l.features.length?l:null},u.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t},u.prototype._appendLeaves=function(e,t,n,r,i){for(var o=0,a=this.getChildren(t);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=r?i+=u.point_count:i=this._appendLeaves(e,u.cluster_id,n,r,i):i<r?i++:e.push(s),e.length===n)break}return i},u.prototype._addTileFeatures=function(e,t,n,r,i,o){for(var a=0,s=e;a<s.length;a+=1){var u=t[s[a]],c=u.numPoints,l={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-n)),Math.round(this.options.extent*(u.y*i-r))]],tags:c?h(u):this.points[u.index].properties},f=void 0;c?f=u.id:this.options.generateId?f=u.index:this.points[u.index].id&&(f=this.points[u.index].id),void 0!==f&&(l.id=f),o.features.push(l)}},u.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(+e,this.options.maxZoom+1))},u.prototype._cluster=function(e,t){for(var n=[],r=this.options,i=r.radius,o=r.extent,a=r.reduce,s=r.minPoints,u=i/(o*Math.pow(2,t)),l=0;l<e.length;l++){var f=e[l];if(!(f.zoom<=t)){f.zoom=t;for(var h=this.trees[t+1],d=h.within(f.x,f.y,u),p=f.numPoints||1,v=p,g=0,m=d;g<m.length;g+=1){var y=m[g],b=h.points[y];b.zoom>t&&(v+=b.numPoints||1)}if(v>=s){for(var _=f.x*p,x=f.y*p,w=a&&p>1?this._map(f,!0):null,S=(l<<5)+(t+1)+this.points.length,E=0,A=d;E<A.length;E+=1){var T=A[E],k=h.points[T];if(!(k.zoom<=t)){k.zoom=t;var M=k.numPoints||1;_+=k.x*M,x+=k.y*M,k.parentId=S,a&&(w||(w=this._map(f,!0)),a(w,this._map(k)))}}f.parentId=S,n.push(c(_/v,x/v,S,v,w))}else if(n.push(f),v>1)for(var C=0,I=d;C<I.length;C+=1){var P=I[C],O=h.points[P];O.zoom<=t||(O.zoom=t,n.push(O))}}}return n},u.prototype._getOriginId=function(e){return e-this.points.length>>5},u.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},u.prototype._map=function(e,t){if(e.numPoints)return t?v({},e.properties):e.properties;var n=this.points[e.index].properties,r=this.options.map(n);return t&&r===n?v({},r):r},u}()})),wA=function(e){Ji(n,e);var t=so(n);function n(e){var r,i;return Wi(this,n),(i=t.call(this)).markers=[],i.markerLayerOption=void 0,i.clusterIndex=void 0,i.points=[],i.clusterMarkers=[],i.mapsService=void 0,i.scene=void 0,i.zoom=void 0,i.bbox=void 0,i.markerLayerOption=Dy(i.getDefault(),e),vh(["update"],oo(i)),i.zoom=(null===(r=i.markerLayerOption.clusterOption)||void 0===r?void 0:r.zoom)||-99,i}return Xi(n,[{key:"getDefault",value:function(){return{cluster:!1,clusterOption:{radius:80,maxZoom:20,minZoom:0,zoom:-99,style:{},className:""}}}},{key:"addTo",value:function(e){return this.scene=e,this.mapsService=e.get(nr.IMapService),this.markerLayerOption.cluster&&(this.initCluster(),this.update(),this.mapsService.on("camerachange",this.update)),this.addMarkers(),this}},{key:"addMarker",value:function(e){this.markerLayerOption.cluster&&this.addPoint(e,this.markers.length),this.markers.push(e)}},{key:"removeMarker",value:function(e){this.markers.indexOf(e);var t=this.markers.indexOf(e);t>-1&&this.markers.splice(t,1)}},{key:"getMarkers",value:function(){return this.markerLayerOption.cluster?this.clusterMarkers:this.markers}},{key:"addMarkers",value:function(){var e=this;this.getMarkers().forEach((function(t){t.addTo(e.scene)}))}},{key:"clear",value:function(){this.markers.forEach((function(e){e.remove()})),this.clusterMarkers.forEach((function(e){e.remove()})),this.mapsService.off("camerachange",this.update),this.markers=[],this.clusterMarkers=[]}},{key:"destroy",value:function(){this.clear(),this.removeAllListeners()}},{key:"addPoint",value:function(e,t){var n=e.getLnglat(),r={geometry:{type:"Point",coordinates:[n.lng,n.lat]},properties:Qi(Qi({},e.getExtData()),{},{marker_id:t})};this.points.push(r)}},{key:"initCluster",value:function(){if(this.markerLayerOption.cluster){var e=this.markerLayerOption.clusterOption,t=e.radius,n=e.minZoom,r=void 0===n?0:n,i=e.maxZoom;this.clusterIndex=new xA({radius:t,minZoom:r,maxZoom:i}),this.clusterIndex.load(this.points)}}},{key:"getClusterMarker",value:function(e,t){var n=this,r=e[0].concat(e[1]),i=this.clusterIndex.getClusters(r,t);this.clusterMarkers.forEach((function(e){e.remove()})),this.clusterMarkers=[],i.forEach((function(e){var t,r=n.markerLayerOption.clusterOption,i=r.field,o=r.method;if(e.properties&&(null===(t=e.properties)||void 0===t?void 0:t.cluster_id)){var a,s=n.getLeaves(null===(a=e.properties)||void 0===a?void 0:a.cluster_id);if(e.properties.clusterData=s,i&&o){var u=ld(o,cd(null==s?void 0:s.map((function(e){return Yi({},i,e.properties[i])})),i)),c="point_"+o;e.properties[c]=u.toFixed(2)}}var l=n.clusterMarker(e);n.clusterMarkers.push(l),l.addTo(n.scene)}))}},{key:"getLeaves",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e?this.clusterIndex.getLeaves(e,t,n):null}},{key:"clusterMarker",value:function(e){var t=this.markerLayerOption.clusterOption.element,n=void 0===t?this.generateElement.bind(this):t;return new _A({element:n(e)}).setLnglat({lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]})}},{key:"normalMarker",value:function(e){var t=e.properties.marker_id;return this.markers[t]}},{key:"update",value:function(){var e=this.mapsService.getZoom(),t=this.mapsService.getBounds();(!this.bbox||Math.abs(e-this.zoom)>=1||!oh(this.bbox,t))&&(this.bbox=ih(t,.5),this.zoom=Math.floor(e),this.getClusterMarker(this.bbox,this.zoom))}},{key:"generateElement",value:function(e){var t=ka("div","l7-marker-cluster"),n=ka("div","",t),r=ka("span","",n),i=this.markerLayerOption.clusterOption,o=i.field,a=i.method;e.properties.point_count=e.properties.point_count||1;var s=o&&a?e.properties["point_"+a]||e.properties[o]:e.properties.point_count;return r.textContent=s,t}}]),n}(s),SA=function(t){Ji(r,t);var n=so(r);function r(e){var t;return Wi(this,r),(t=n.call(this)).popupOption=void 0,t.mapsService=void 0,t.sceneSerive=void 0,t.lngLat=void 0,t.content=void 0,t.closeButton=void 0,t.timeoutInstance=void 0,t.container=void 0,t.tip=void 0,t.scene=void 0,t.popupOption=Qi(Qi({},t.getdefault()),e),vh(["update","onClickClose","remove"],oo(t)),t}return Xi(r,[{key:"addTo",value:function(e){var t=this;return this.mapsService=e.get(nr.IMapService),this.sceneSerive=e.get(nr.ISceneService),this.mapsService.on("camerachange",this.update),this.scene=e,this.update(),this.popupOption.closeOnClick&&(this.timeoutInstance=setTimeout((function(){t.mapsService.on("click",t.onClickClose)}),30)),this.emit("open"),this}},{key:"close",value:function(){this.remove()}},{key:"open",value:function(){this.addTo(this.scene)}},{key:"setHTML",value:function(e){var t,n=window.document.createDocumentFragment(),r=window.document.createElement("body");for(r.innerHTML=e;t=r.firstChild;)n.appendChild(t);return this.setDOMContent(n)}},{key:"setLnglat",value:function(e){return this.lngLat=e,Array.isArray(e)&&(this.lngLat={lng:e[0],lat:e[1]}),this.mapsService&&this.mapsService.on("camerachange",this.update),this.update(),this}},{key:"getLnglat",value:function(){return this.lngLat}},{key:"setText",value:function(e){return this.setDOMContent(window.document.createTextNode(e))}},{key:"setMaxWidth",value:function(e){return this.popupOption.maxWidth=e,this.update(),this}},{key:"setDOMContent",value:function(e){return this.createContent(),this.content.appendChild(e),this.update(),this}},{key:"remove",value:function(){return this.content&&this.removeDom(this.content),this.container&&(this.removeDom(this.container),delete this.container),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("click",this.onClickClose),delete this.mapsService),clearTimeout(this.timeoutInstance),this.emit("close"),this}},{key:"isOpen",value:function(){return!!this.mapsService}},{key:"createContent",value:function(){this.content&&Ma(this.content),this.content=ka("div","l7-popup-content",this.container),this.popupOption.closeButton&&(this.closeButton=ka("button","l7-popup-close-button",this.content),this.closeButton.setAttribute("aria-label","Close popup"),this.closeButton.innerHTML="&#215;",this.closeButton.addEventListener("click",this.onClickClose))}},{key:"creatDom",value:function(e,t,n){var r=window.document.createElement(e);return void 0!==t&&(r.className=t),n&&n.appendChild(r),r}},{key:"removeDom",value:function(e){e.parentNode&&e.parentNode.removeChild(e)}},{key:"getdefault",value:function(){return{closeButton:!0,closeOnClick:!0,maxWidth:"240px",offsets:[0,0],anchor:e.anchorType.BOTTOM,className:"",stopPropagation:!0}}},{key:"onClickClose",value:function(e){e.stopPropagation&&e.stopPropagation(),this.remove()}},{key:"update",value:function(){var e=this,t=this.lngLat,n=this.popupOption,r=n.className,i=n.maxWidth,o=n.anchor;if(this.mapsService&&t&&this.content){var a=this.mapsService.getMarkerContainer();if(!this.container&&a)this.container=this.creatDom("div","l7-popup",a),this.tip=this.creatDom("div","l7-popup-tip",this.container),this.container.appendChild(this.content),r&&r.split(" ").forEach((function(t){return e.container.classList.add(t)})),this.popupOption.stopPropagation&&["mousemove","mousedown","mouseup","click","dblclick"].forEach((function(t){e.container.addEventListener(t,(function(e){e.stopPropagation()}))}));i&&this.container.style.maxWidth!==i&&(this.container.style.maxWidth=i),this.updatePosition(),Da(this.container,"".concat(Kh[o])),Qh(this.container,o,"popup")}}},{key:"updatePosition",value:function(){if(this.mapsService){var e=this.lngLat,t=e.lng,n=e.lat,r=this.popupOption.offsets,i=this.mapsService.lngLatToContainer([t,n]);this.container.style.left=i.x+r[0]+"px",this.container.style.top=i.y-r[1]+"px"}}}]),r}(s);function EA(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}EA('.l7-marker-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: absolute;\n }\n\n.l7-marker {\n\tposition: absolute !important;\n\ttop: 0;\n\tleft: 0;\n z-index: 5;\n cursor: pointer;\n}\n\n.l7-marker-cluster {\n background-clip: padding-box;\n border-radius: 20px;\n background-color: rgba(181, 226, 140, 0.6);\n width: 40px;\n height: 40px;\n}\n.l7-marker-cluster div {\n width: 30px;\n height: 30px;\n margin-left: 5px;\n margin-top: 5px;\n text-align: center;\n border-radius: 15px;\n font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;\n background-color: rgba(110, 204, 57, 0.6);\n}\n.l7-marker-cluster span {\n line-height: 30px;\n}\n\n.l7-popup-anchor-bottom,\n.l7-popup-anchor-bottom-left,\n.l7-popup-anchor-bottom-right {\n -webkit-flex-direction: column-reverse;\n flex-direction: column-reverse;\n}\n\n.l7-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.l7-popup-close-button:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.l7-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n padding: 10px 10px 15px;\n pointer-events: auto;\n}\n\n\t/* layers control */\n\n.l7-control-layers {\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\n\tbackground: #fff;\n\tborder-radius: 5px;\n\t}\n.l7-popup-anchor-top,\n.l7-popup-anchor-top-left,\n.l7-popup-anchor-top-right {\n -webkit-flex-direction: column;\n flex-direction: column;\n}\n\n\n.l7-popup-anchor-left {\n -webkit-flex-direction: row;\n flex-direction: row;\n}\n\n.l7-popup-anchor-right {\n -webkit-flex-direction: row-reverse;\n flex-direction: row-reverse;\n}\n.l7-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: -webkit-flex;\n display: flex;\n will-change: transform;\n pointer-events: none;\n z-index: 5;\n}\n.l7-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n.l7-popup-anchor-top .l7-popup-tip {\n\t-webkit-align-self: center;\n\talign-self: center;\n\tborder-top: none;\n\tborder-bottom-color: #fff;\n}\n\n.l7-popup-anchor-top-left .l7-popup-tip {\n\t-webkit-align-self: flex-start;\n\talign-self: flex-start;\n\tborder-top: none;\n\tborder-left: none;\n\tborder-bottom-color: #fff;\n}\n\n.l7-popup-anchor-top-right .l7-popup-tip {\n\t-webkit-align-self: flex-end;\n\talign-self: flex-end;\n\tborder-top: none;\n\tborder-right: none;\n\tborder-bottom-color: #fff;\n}\n\n.l7-popup-anchor-bottom .l7-popup-tip {\n\t-webkit-align-self: center;\n\talign-self: center;\n\tborder-bottom: none;\n\tborder-top-color: #fff;\n}\n\n.l7-popup-anchor-bottom-left .l7-popup-tip {\n\t-webkit-align-self: flex-start;\n\talign-self: flex-start;\n\tborder-bottom: none;\n\tborder-left: none;\n\tborder-top-color: #fff;\n}\n\n.l7-popup-anchor-bottom-right .l7-popup-tip {\n\t-webkit-align-self: flex-end;\n\talign-self: flex-end;\n\tborder-bottom: none;\n\tborder-right: none;\n\tborder-top-color: #fff;\n}\n\n.l7-popup-anchor-left .l7-popup-tip {\n\t-webkit-align-self: center;\n\talign-self: center;\n\tborder-left: none;\n\tborder-right-color: #fff;\n}\n\n.l7-popup-anchor-right .l7-popup-tip {\n\t-webkit-align-self: center;\n\talign-self: center;\n\tborder-right: none;\n\tborder-left-color: #fff;\n}\n\n.l7-popup-close-button {\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\tborder: 0;\n\tpadding: 0;\n\tfont-size: 25px;\n\tline-height: 20px;\n\tborder-radius: 0 3px 0 0;\n\tcursor: pointer;\n\tbackground-color: transparent;\n}\n\n.l7-popup-close-button:hover {\n\tbackground-color: rgba(0, 0, 0, 0.05);\n}\n\n.l7-popup-content {\n\tposition: relative;\n\tbackground: #fff;\n\tborder-radius: 3px;\n\tbox-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n\tpadding: 10px 10px 15px;\n\tpointer-events: auto;\n}\n\n.l7-popup-anchor-top-left .l7-popup-content {\n\tborder-top-left-radius: 0;\n}\n\n.l7-popup-anchor-top-right .l7-popup-content {\n\tborder-top-right-radius: 0;\n}\n\n.l7-popup-anchor-bottom-left .l7-popup-content {\n\tborder-bottom-left-radius: 0;\n}\n\n.l7-popup-anchor-bottom-right .l7-popup-content {\n\tborder-bottom-right-radius: 0;\n}\n\n.l7-popup-track-pointer {\n\tdisplay: none;\n}\n\n.l7-popup-track-pointer * {\n\tpointer-events: none;\n\tuser-select: none;\n}\n\n.l7-map:hover .l7-popup-track-pointer {\n\tdisplay: flex;\n}\n\n.l7-map:active .l7-popup-track-pointer {\n\tdisplay: none;\n}\n\n\n.l7-popup-close-button:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.l7-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n padding: 10px 10px 15px;\n pointer-events: auto;\n}\n\n/* general toolbar styles */\n\n.l7-bar {\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\n\tborder-radius: 4px;\n\t}\n.l7-bar a,\n.l7-bar a:hover {\n\tbackground-color: #fff;\n\twidth: 30px;\n\theight: 30px;\n font-size: 20px;\n\tdisplay: block;\n\ttext-align: center;\n\ttext-decoration: none;\n\tcolor: #8E9DAB;\n\t}\n.l7-bar a,\n.l7-control-layers-toggle {\n\tbackground-position: 50% 50%;\n\tbackground-repeat: no-repeat;\n\tdisplay: block;\n\t}\n.l7-bar a:hover {\n\tbackground-color: #f4f4f4;\n\t}\n.l7-bar a:first-child {\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n\t}\n.l7-bar a:last-child {\n\tborder-bottom-left-radius: 2px;\n\tborder-bottom-right-radius: 2px;\n\tborder-bottom: none;\n\t}\n.l7-bar a.l7-disabled {\n\tcursor: default;\n\tbackground-color: #f4f4f4;\n\tcolor: #bbb;\n\t}\n\n\n/* control positioning */\n\n.l7-control-container {\n\tfont: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;\n}\n.l7-control-hide {\n\tdisplay: none;\n}\n.l7-control {\n\tposition: relative;\n\tz-index: 800;\n\tpointer-events: visiblePainted; /* IE 9-10 doesn\'t have auto */\n\tpointer-events: auto;\n\t}\n.l7-control {\n\tfloat: left;\n\tclear: both;\n\t}.l7-top,\n .l7-bottom {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n }\n .l7-top {\n top: 0;\n }\n .l7-right {\n right: 0;\n }\n .l7-bottom {\n bottom: 0;\n }\n .l7-left {\n left: 0;\n }\n\n .l7-control {\n float: left;\n clear: both;\n }\n .l7-right .l7-control {\n float: right;\n }\n .l7-top .l7-control {\n margin-top: 10px;\n }\n .l7-bottom .l7-control {\n margin-bottom: 10px;\n }\n .l7-left .l7-control {\n margin-left: 10px;\n }\n .l7-right .l7-control {\n margin-right: 10px;\n }\n\n /* attribution and scale controls */\n\n.l7-control-container .l7-control-attribution {\n\tbackground: #fff;\n\tbackground: rgba(255, 255, 255, 0.7);\n\tmargin: 0;\n\t}\n.l7-control-attribution,\n.l7-control-scale-line {\n\tpadding: 0 5px;\n color: #333;\n\t}\n.l7-control-attribution a {\n\ttext-decoration: none;\n\t}\n.l7-control-attribution a:hover {\n\ttext-decoration: underline;\n\t}\n.l7-container .l7-control-attribution,\n.l7-container .l7-control-scale {\n font-size: 11px;\n padding: 5px 5px 2px 5px;\n background: rgba(255, 255, 255, 0.7);\n\t}\n.l7-left .l7-control-scale {\n\tmargin-left: 5px;\n\t}\n.l7-bottom .l7-control-scale {\n\tmargin-bottom: 5px;\n\t}\n.l7-control-scale-line {\n\tborder: 2px solid #000;\n border-top: none;\n color: #000;\n\tline-height: 1.1;\n\tpadding: 2px 5px 1px;\n\tfont-size: 11px;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\t-moz-box-sizing: border-box;\n\t box-sizing: border-box;\n\n\tbackground: #fff;\n\t}\n.l7-control-scale-line:not(:first-child) {\n\tborder-top: 2px solid #777;\n\tborder-bottom: none;\n\tmargin-top: -2px;\n\t}\n.l7-control-scale-line:not(:first-child):not(:last-child) {\n\tborder-bottom: 2px solid #777;\n\t}\n\n.l7-touch .l7-control-attribution,\n.l7-touch .l7-control-layers,\n.l7-touch .l7-bar {\n\tbox-shadow: none;\n\t}\n.l7-touch .l7-control-layers,\n.l7-touch .l7-bar {\n\tborder: 2px solid rgba(0,0,0,0.2);\n\tbackground-clip: padding-box;\n }\n /*logo */\n\n .l7-ctrl-logo {\n background-size: 100% 100%;\n width: 89px;\n height: 16px;\n margin: 0 0 -3px -3px;\n display: flex;\n background-repeat: no-repeat;\n cursor: pointer;\n background-image: url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALIAAAAgCAYAAAHBIxK2AAAABGdBTUEAALGPC/xhBQAAIJZJREFUeAHtfAl8Tkf3/9z7PNmDRFbZSawhQcRSaqva1xCqpataqrT2UkuUUiqlaKtafe1VS1pUiypB0dIgIkpKRPZIELI/2/zO98akN48nltL3838//84nNzNzzpkzc+eee+bMOXMfxijNaMJ7LOrGO/HdYfZ8fb12gD2JJINJdR8WNHVQnRtSn7hilpz0u2DMKaEcFhZmhdzLNbiPyNVlwPxcm4Qh93Fr0gO4Ol5hfqiz6Q14G+QzGpYzQ9nXrUl7X/fgbrXdG3skX7m26+bNW2fQqJ5XmCs6RQKd6EQwB0zgtKgsvCidGF+N8wV/SBLqSKnXzx2WKIHw1xNxq2xtrKsBXqgrbePt1rivJFmloa5OoD129NcVQwa9Phxwaflw3ifvHCus1YIVjW7fwEF66dIhdYO/XV7Qk+9HY/5F7RA+w0G5TdRxq7gw10FBPWwA+3r9jpkYGcoJ5/7YiFxMiYCjLspsekOeCiJ1AhJJNER+8rfTX/j4BNcUMNCLMmhF+wC3cE9RZmMd/0IQjeTtGdwJjURD5EajsRQN1EwEHjAkUVce2LLhnKf8xGId3ZhkX4uxmj7MMKqJz0ZmMr3MJNZBmphV8WDBOCCgo+2QiE7DF3005wvU75e8vMLs4+P3HwwN7do5MzOu2NcjpPHRX/csCqjt2wvtxEAy8xJ3o+7j3jjkcurpn2xtrT0EPiS0oQPKSOfi/ygqL9H/qNbls8EXuer4+65xUa149QnBvGYFgapAN21EZ+pnuH3rrrnKdNA/zCRmjoqGzu36RoL21q38BLAAjRgo6iir63g1QAOcOoU27DAgwKtpPzVMKU+qBWIuve3Jx0zw4j/eQ0CASeNnjUi5mrYH72ZxUfFV0emJ479/BvrM9KxDAgZZEjziTp1d8+pL415sEdJloIAhF7QCZmnQoCkuLkkXNPfkozU8b4wVb30P4i4ADNQ41P08mtSBogHc27Vx70CPEHeUgRNwgUOuTqBR8wwODraGSIkrKipKxqVuI300mntri1jz9OOs0IHeHUdvms2t0iG+vn5nxmnan5QeUff6GGWttpidSjvGbCSZJdAAGTMwtjWSH2G5XrOp3oEv9wuWxqdeUPchZkW8OGqcedmcdujgUcMOH/zltmgL2YW2Fu22fbMz6q2xM+IEvmvHiCGyRq7AK3QLe959+T6v46co0uVBisLk0/9SqIIhcnQiVBPqULJ4dPVd2ypLg6Dx8wxuhAGDHrCOHTtqUfZ2b6KsYYIOuUiXL1/dKW4SMJRxkbbpG9nv5ecVutlt+PSoNvw7VPg8V4X5wqf4YQVp9g+NDQZDITr2cm/8lNIGlbvp+edGD/946eqJqOKmoBJRhjyjrclk0qlZAqeumw8YOEwE6ILdgh0raN9pcHeWx9n3mViPh9IKnlmBVBWI4bfoePDAEcOGPz9WWUDBzMe1cUdft5CnUfb2DvFR8rsz2avrkOdmT18wJisz5zDaqthVWjwAtzRgtBF9VbSdVofXIPWmB2CCouYqUBUFH59QbwwEqg0XykAi96/VuCEetRrm59msEfA+nqEtAUeqNEt324JGJEsDxpMi26gnaCpUxqJk6bahkGFp3akrZO8IBurcVGponpGW+VOdQP++uIAznzE1/cBBvRRZTc+OP0miUBJ78OiyxNxE6uX+KSP3vDIZuEE/z9BgWZZtHHj1oxZbkS6uJFNqIn+SWSy1AubjFtLd171xoHrQooyFQJRB7+0eHBrk2cxNtBW5mgYwoYNFXg5r7CvoFXWxajQ3mjiTc84wVkB2kTWt5NYk3lZ02SCvzphDDVrNZOY2p3mdA0wrhQoGSm5ig6SRyTsqwSxUaMKk+t4tXJIy4/IsoP82yNu7pYusKwk2WdslZmScvGHOyNs1tJ5GNrjVaeT2W2xsLCnuv5J6woQq/QtbXoLCMJqYtbWj208pKbGK4aamgWJR19XlCvpFEdxn6SDOl0byAjXB/cp8rlM/PteZ83k1T92PTuAw0Ly8GychmosWLB/v7xFSW+AeJQ/0auyLiYFEBgQ0dYKdDRsJfFOvpe0V76fgCVrgkNQTao63hAONr2vjFtAFltoTTFLzB415Al7RFdNipHRviWlLbzCHhZ05HxfEy9e7T/zX8FV+XLk+96e8Tl0xOJZfOpjdKp4kzboZXgGrouDj1rTunHnTQl1caoZ/unLNlKnTx32sNxobR0ZGakQTDCY8tEtEkG+LfihDg+NC2ccjpBXoyMTqVaLjTaFLduxe219XqH+67HYGKU5D0pbN30X5+vl0a9m6mZOPTxvFUIayPRAbM1RpS1uztp0a/SD6e9hcYlKVqgi7QEg/DAyRsAUsKSlNLyvT56Bs8e2Ias4LZzfnfEowJyOOVocZDs9jt8YnMDvUZzblZ+jis1rwtqg/KMHgwEThCUOCUS64U/An6iiL9oIGcFjwqMOQQB0JdTyEXd/tfR/1rMzsWCrPBxwPCxJMfJMELVYq0KO+fNkXk6CHRV/qXPSLXA0XZejpqiRZ0IgcY7hzu+AS2TB3quInaNnU2vzSlNqcT/fhHSqAVJgawAunEXxCPU4W9MMlcRN0ryZMAl2XcOHm6YlnYgMAToIOuxks+YBBErGrAa0YtKDDDkeYAaBFErjSUl2uKOfm5v1GE9y1nOLe/4IO+b3YchfKw0wy3lZ6m2arxyr4KV4RURH54qtS/fGufEMZZ7Hja/Ko0ptsgYML0+kKGM+4wbTbmGQUtPfLMfBrWWc3gIZenX4aJmUp9OQdqunk4nv2QmzMus0rO730wtj0qu2DqnuQjCYbrOjYrINq5JuRe/CKQp3QtRMweivm0yur+FBQf9xk6WFQX99Tvw2GDO0390jssWXW1vKf6n4q7Dc1EOXledJwQxF7RV/EomQbptMXssJlNyT5YSe4dq1m/s907eik1WprNKjdur9sW/1AWt7535Ur6/zvN2/lpcds/37eM892mEgTXGHuHD1y4qLRYK0YvrJsMly5knKu0tg0csmObbvfC2/ZbETK9bOnW4TU7xtGEw0a2geZbKysz/Xu9txQvV6fX6VOrMTw/hVsdF8b/tbGgX1feqF1m7Bq5hda+/o+pVgXm9Ztmzk0ctTBlMyEi/fnaoZ9g3HH1xmv5GgwI/m3+oAZUOzkj4fx7rQBt7qdxnhJDiuj/YlBe9dG1pLNbF9D8c2dem2xVMA3NQhjBk6WMyVaelmZVaL0+vmcB/Tz/zVa+8lIPlWW2SLMQh559ZSNCE2sbCq/FBuLyrrbLJVHsYZMr/sdfpiKJOv1pOxtyISp0tQRtHXqhNWQZffSy5d/LBOwJ5H71mrcAnzSSA2Z84ObJPlCbiujSZubkRefZI5X61hL5pavbzMvY4kuTCuzm6nXE4+Ztwf/lBRmcW1zcSkwxsXF6bWmEnbQSPJsoqWMZumwUqYC7QCVi3Y6tMmnCZdYDItiJezj0v3MaLJmRmXX58w0zKJ3w3ww2IwE+fk7JSUll9b2Crl4NfPcJXOav1OH7fyfdSs6cS7zl18Y65GRd36Pmk/S+dwex0/tHTN54pxNJ0/I2tTsM5WccqDFQgn9rW4nyphg4J95ut9gZis7p6Ym3BI4L9eQ+sS/ntrbLXDIE8/fLKaHVP7goyN5whKyKKMHcsWboSasqsznORfSRYEaz3v29uZt4JiDxMC8QVJLjzntg+ow+dBe7BhRJ1MwQ/AVkRbwQbBj7OtTXgVu49qt79LDrW/OX4yrqjEJ/OIPVrwlfM2CB/rW6XQ3wd9SgjsM41SsC9pLt+H0AptK2fdRjFdYHHwdhY0QOsL1VZDimkIHfLLD8xThcmCF+p3SjOxc0WlV+Zervm2x68dN/QQ+MLC2DVSHqOOVw6ZFXDRgCXjUBQ1y7Py+3bO+HyQLO0bArGV2auRrkxRv1orPPgjXF6XVARxJz0vCPvz4vbkoT50899yTenvAD0ljLx0L8Gr2Et4C9XXnTkEiecNKv/xiU/q1nHNXlQmN2iYVlpWwL0qLmSR3ZNFgQCpCogXuLDMa45WrTH8AcCVpTL8Q7ChbVDhAgO6XmwwGj7AWoa9lZ+UcBt3ufZvn6Ar0bUSbP/+42cJQ7NhbNjj3ybpW2p0G3LtP966DUIYk0TbZDr4Kk9Ho7lXLw1+0g6qo6Wtz8+f9sfmARQzqPZNWiCCBJ/NLtrOz9SkoKPxDlmT1SiJIHiuH6oAeF5e1o9XRGjWqa6pXrxbcqlm3YY7Wtifu6WDeU1xHF59an1cDki9wm8nnU7h3AV0fergDNrsln0+BtKUoP0yizYJr/57DhuJ1wnY5/mziepTVr6e3R0hrsbPLyck7BrxIZO/eAi2uuwE4I3Aok5rIAtzPPbjtxQuXtgCOOtQTwkqrPvlqMmBd2vcfDGeSpfGCXrS7H96SujCnBy+oj6LComSoEoGvUA0A6EvZ8DLaO9nYsUOoSzNy57Oi4mJyBu2SpuRcj2rGvZievUsRgleBf5gk6cpabd62egFoaYtr6NFl8DaUoz96LzTAq0kDlNWppLhE2UTg9Tuf8MdG2sw4DRjQU9H7e3b/FE2vomLoU3nJjm92rYSEwoXZuX3EJvDZsWtdz/+sjGlqMJqCXx/90jzALlz4syQl5awi7aj/EwnxPfC1srJy7ti232Sb6jZHRT+VJvm909I3pjKWayxjYdODeLkO1hnC2OLC/mhQWsJO6UvInCtjHQWDB+XKK2tvF3Dq5JkvVR4t/tzwiHk6namuefunwruvEq9ft86RW4Ef9sqQcK2WXRkzYtKBgtsFGYCNHjHpt3enzd+cnpvwo8pHbKQd2Wg9M3qDhjz9tqd+O7tao2XZqP+TKf8Ga3vyzP630EdGRpY+OTnutuiv0iQDqDOxVgaaSDLpjqMuResukoXHpwTw7jT5XnQlfHBBOgPcgxIiEqu+jG4NuoYN63a4mHzio0vJvy7Blhcwa2srWW0NAFZVgh0uaTSKj0LQYFERZVmy+WP1Z2uno25vZyd/tX5FO5T79x72faoF+xm4J5m4geLOPl7PHPvl1CeyLF1T875nkpdckq7qdOwIqY4aEz35i+XEXCYJ30MXs7dnSghSzaSqMunN2n36dZsBfG7uzYt3r0vpaVm/AHbkxJ4xJYWpD80PbapK6bmnL8+dvURRJXsPbXu5W49OU6n/ItA/zEapKr4PA8fC7OVVS1EXgwe8sq9Nh4aJ6nYWdyrFmayLvQsrIwleF8n4Jk9ntlCvo00gZ6ujE6UHBujQAZw2ZY52Cv8fvj/wwahXJu6VGFdu2sh4rdTs+M6+fl7dSAI+kTS0yfkbCWEndbhJIzPdjRu3TgcGBijqbcHc6Km21iz+b7C22KTEaGxFi1slHDyLsrGgKHr5kvYCsW3btkpeynskGYSrmaQnvTufLubhyL6WDGwK0zH9ypvSKMHoQXmuoaztz0diJoHu9VfePp6el3BYeOGstVYJ0Ys/VSR81OjhPmQqKAvbg3hqZNOd9PTsZNAt/3Rhi+5dW/cmy6SzaGfv7HS817NDlUUWsFWfrU9LzkxMFfjHyadMe3MZ7HPzCwJjMnK/8JbNI6rib1GSQfxpoTT7TRs+mYzLSJJoWkTYsKqYWIIbTNzWuaZTA0iWOT4l+2zKxx99fpXCUKxXv+5hn6/akP7n5eRztbw9O5rToi7cnx5+0rWIvi/uSU4/M2BgZJ/ZAwb2KiO9HynaXLp0rIAkTZeff/tc7MFju2Qm0T7r8RPcnJa43MjL1+PtocUif8SrE2ZkpWWX0Tmbex4q5q/KNFLLO8mcHSTXRc7nRsmzSkILCOzWsJkAypLjBXE4U+mdtmSCGclC+AEbC8US0Wh+u5Jz7jraIWREYfRGuJG064n7AAvxCHHIMxorpLcac4q9lHesYjLRb06qrgtZMoVpuecqzCi0tZRg2wq4pXEiKCDwlnIRMMD9WFvrjGqrwhK9RRj5kp+bwLgS37NI8C/wgTOgSPLyV7ibxoa9Rp7kV8nrVo1E3qSjJSr/CuNlBUxHTswSZmLFkhWTtLSGUqSEjO7yXEN1DZW1FBuQrQllxzK5FVuTc5HtnnOIwlRf1X6Waa1GM24KoNGQT69SkpiGFtIyYwwrMK1jb1+9/U9bApV6/7fyxGYAwewzZ1IdiosNBvF2PzHmD8FIWfcoKPIV7ZZ7Q8rImmJGPWPpR0jqdMxEAs5IgEkWCUm6mf6YRITIOXIFUC6heCvIyguhPIR5s1PE9TYrMixlWkM9ZqRwC2jLkywKSm4tPc005KKeOxe+qb+oKhE9fAUOvLLi0ubYH6AVNpoaLU++lnWezs8/OLbw8D09GUp8HkB7wHCEEwVHjBkOxqvX7x906kgOzMvn89qZWLm7SbSXmXwnqLHLMdVmWKAq5eolSY2wtDyp8aIcFNSqekl+Uftjhy5IbduGV0tKulrCdMEGrcRupeYm/iLoLOXkMpJqe4fUN+hZHRM3keQ9Wip3IGiSEIupmLjooXwByeoUA2daCrSw4nx2Kucye86qhJUq7MUKSznt+SqSHcq0KAqY1okZxqySrlcQUIEvJ7e+RDocW2JdmR3T8K0UT2lOwk1viKQnh2oUuaIqrFt120ct4ySGwaALHDPuVb8ZM9+OxjlFOh95oGXzrsvpxk2e/jb7ERB6VL6PQw9hS79427lUqzOOGBGZj5i64IcPYUp1paHDXxzs+UH07NUCvnrVumlzZ334h0ajuZqWc+68gKtz+Bq//CSmq4kbrRL/PDbPyalGKPDJySm7n27V+wtJywozshMPqduYl4Ugw/oHDm455A8ryDjEhp3CkV+/HxEYGKC0/XDRyreXLVmVbKeyE8HTPOE0DNmONhS3Gu0f4NPTHP+gOj7JGRwx4icYzRU7kUlfSzMW9+PJJMTLS03MztqahXs1YuuK8tmAqFgp70FM74eXxpeHTvhkR3eKY2wic6K5YmRoWBE51UdI825tuV/7h8Uh1qQzFAf26vusy8zZE1eKdt6+Xl1ooovbt+795fVUXRuC03rzzyecisZBYwoCsvETRgbcupFfunrl1mwSHtIW7EpqduKF5My4VBIG9w3rt7L+g3qtggsRI3t91IvzNq7d/sKVK1drk8bOtaSZ16zc3pw0sdV332/sLYSYzofd7tdj+H/Aw1O2/S0DhX8wlWvFv7eI0jpJqs1gs33brv09ej6TT7wqFKulIbt7utalw5RKxJwO4+yCEGMDFdjILbFCkNFw6k7py0XP8qu0Fm8nl4UTcW1nY81ORHXjPaL2SZcFcxq2xNbUXsSstB0oiCbA5TkWCCMvYQbda9KotCuVkCbTQGYyNCFb3ESh72wmayOlRbePV6L5m5UAOh+sK8wNh4tzxaeLF99lY6KjunGuri7h0BZf/GfZBfhQfDyaNEnPSUgw70o5bm8yuZrDUcdSTXftYL4EaiT5tobZJqXknsq+p52e+wB28vT+cfQyPYtyxOA+nw/oPXwPyiKl5ibE+Xs06UJb9x/OJB4OdXd3aUMmkPX2XWsnNAvu8EGZJDWhZfi62izyouPDRh2v9cabr/iGt2o6UvCa9c7CqfQFo0Gy0ZyJyyg/uiZw/0SuNocelX9qbvwv8F5+suxzv6VLPo211J6EvRZWnCXL5jUb+sKAoaDBh5SYKzyT1JxzRzAvlQQZRNN+kn6Oepq3JXn8gar+JKZBRPQbffnSJ+qEpAgdCTjnt/UbGCt7jkq+lbZwVmQqGPlcaVJWhRBHPcXd6ciG29xDbOecNtIGCm3VkKJLnqiy0JfcbIvxxx7fOc7Gxkpx6G3ZEDNn1rsLEy5cOb6GIkIuPXt3eef5FwaO3LxpByNteTM9Pb7yGO7az7+fPTBR+Km2bIyZPWPa/Pi1m1b0b0FONnt7Oz/0g0Su6oLLSVd+GP/G9G9154uLtZL2lsnGPo6XFjyDB0wx33JCC/8NBoavKQKBogB8noskH89jxs5dOw78MC7h5/VkUjiSQD+1fvPKDi8+/+ZhX0/lawzl5bv70jZ1dHTQTJ0xfr5gv+/HQ4vXr/smC/GC9Ixz6QL+T+aPo5ExrvT0E/BwX7I0RoR9TSajFebgmWc7TgINjk6OG/POKVnLctKzE06SECtNK2+67nKLOipdIEEOp7jI73QKg+lKWE3aDB56N5wPuUvCpInpCazEEM7yS86wQloh7tBVXFLEbpa8REL8fjkdl2Y158NItDOp/XnZimXM/ZW3lJY+WSH2dwttRt5o+6+3r+6C4A/6Tkq6EjNp4uz44pIS05wZi94V4164ZNYSN1cXKyz54hyowFnK+0X0GJGccXpneKuwQRcvJB3YvXPfAgSX6CPVeBK2avUb1huy79COLecuHp1Dx5fgU+wCId70zapnhNdZaGPwb9mq2SgBRx45uK87p1Xgjh3NjrV0FmHm92YtnirGggfYp09XV5PRFIBNIeDGohstke/9edtrCNmifC0l/YdXXxz3Cxy76dfPVz4DC4L/sYQvkhFh+HT1h62EEP+45+dFEGJ8xp6enXhSfUsWBRkEM45KubIDe5qE+DsE9XSlNM2lbMv0YP4OxaJIzsm+ePd6DivMb8vu6GKYviyJFRq7Se/d+hq4KMa104PZLBLgDXRiRkPhbU5h7s03PNgx4J9UCvBsGqDnBh/YoO07PDUefEtLyzK7tI9Yh80dQtTr1m7JPHL4+HLg6GxB9f2Hy0M1CNtg5wx4VUnWaO1bNn12YJBfizf69hr+5Zujpqx5PnLUp43rtZvVtFHHCBFAdHFxDlu28v1w8JEljf6FIaN/FseJ8DGe4I9wvYAj37Z113XZVnsaZxUyM8+nkYJJw5Gjn386/JFos3Tl+3NQ1nMpDB/aGbmpxkfL329Wu46fcqiD7je7U9u+n0M72jr5nhDt/ldzH7fgIJOJ+0+aNjaw34AeihI6ezph7YiX3zpGk3sjI/fsWfN7q1KQQUibvNIF51kECfMysmuNlFPUjy2sHchWvhzAyXNM9aWshDTsQOmD0vrShwWKkI704vZFddkXRDuXhJgsELKYS9n7CxKkF1b8KNFr8WQS3Gw6g74JztRNeefNDwXXyeNnzSIBI88gl40GpkRyhg4aeeD69RvKQ8aSHbNrfS+Exvy8yn9OQ7Q1z2kCd+D8BDZnGdcTTqTmJCTjRKgky3nQntezc0+JNl7etRT7WqM1XcOuX9ZoKnlvBB1yrdb6CmhwqU2cjNzEs/A2vPj82Nj0tMz9oLWzt/Pfd3DbYNjntJmr06x5Ywf6ZEIRbuBHvz5lWplOp7jrnvRxZPD/byZ8IE0u3IZ16wbaTpw8Zgn6pjBiQq9uQ2Po6/SyjJwEiy/qfQW5/AYkvviyNIEEcgIFqstweou07GgXA4sZ6cxrlNP89X9MDe7sILM9JK4v60CrYyUlejZy0Z/SrL+oHr8EB7w4q7hr78ZZcLMJritXL16jXr5FGZsoQdOqTfNRM2ZNrGvU81pVfXUGWnoZlN2seqOl8PgH/dFWtm4noF07te33KX0GmIv+GjdpOIzs4SCUN2xZ9Q5lyrPbuuW7uT/tPXjLykq6bMmzAfr/pVQs3WmG8W785rMRlCkr//w50eWrKWPx9zyHuzenvZs/MItOl1a85cGvajjbpJNYdYpd97C3YkfH2fGeK0qkdDCg3x4JoI3fXknH6hMNRnFLx9igZTnSwQd28IgExw9fpO9PTVbQVOR6CkFzslvP0pI/+36scLwRp+9A88a4Vxbt2bV3WHz8hUb0uzm3yn9i4H6tVbgHmCQqykcuptBX2/6uYXFk37d4+413pn62Jvo/YPLm+Nfmt+/QZouzs5PiL066dHnrhHEz4xB8QLDnkTv6hxuQtyWAPESKXV9VV5JReyM193QWBNTXlT4Y4boaeGF9fL26og3cbF9vjsmRtdqcq9nxVX6R9NCCDKYf50jfv+3EO5gYHYbjzItATZg1OzVG5t3IFrWmjeGPpL9cCQ8HXYpGw3rQB38XUX2SCd8ilOmMrouXzAmBpgJvsnUNg/u/shBlnMC2dD7Wzy24HTaAzVuFxtSrFxhBk6fd+u1X8+rXaT2Jlcmt6ZzVHQMYPKEk0SecYEVnd/WCpZNzjZoKjII28FrgvK9tDftjly//dkfQIL+WF5dF9nDyrl37WLeYZ+b3j+g5kzaX9s2aN3kV+OLC4iud2vXfiMMqdYJdfk2NBfT/jfTc0P49unXrVKXQiVEWFhUXvT12xgHaK+jpxf3doNH7IUjWf0DPZwXNvh8OHkFZMsiKshRw8/yRBBmNl+VLZ0fb8ZayzH4krdyEnpQnudbiKRxMAbry9Y5gJwnfOzpfUpZF804fp46dOwlxvY5dnnZ64aVIRbOC39ovN8/GAW9ZsrpoSYhBU82dnczPkbpiI5iUcrK1ra2Nl2M1x7oHf/lueOd2/TeYmEnxAID2iSSDdQbZVp6ff7J214IPZ3YnnnLdunUiyNSJuMvfSC/fi8eOnepAp6EOnss5Rydc/kp0EDORfuXOZeyoqSeDmzSIQVtg8Q3K4IGvzkSZW9vd87sdgP+3Ejw05n3hFxroMgffU6f7KBs4uM8fy5euTjFKRkf6ks4FRJ61PJojL7hTePH99z5Kwsuael3R2gBbTPcMwiKVBeBkxh0KtGw7mQ/dhbeUynihvrU2sKEr2JPb1Km7h238a+ylp4zc6IRNXsdObV3JTswqKCw0kUeCNmLxiWp68zLOBpTeLm5LGydt377dXJycnazhewUd/K/YLZPmk8aOf80/LSW96Ntvf8jFRGodXA5iyRf88Es5xQZda0GbkZZVtGP77ntocaKXlRW3wQOv5ugot+vUyqluUGB18CGT5hZ+jwuOfRx0FbzVOcLQaz7Z0Q6eCsDRHzayiodCI58URwXVbR6l/Lghavw6hYGZsDr/rYSNLSKQcfS7AwiOSGWF4eJewRAmRVAD59MPOjPytwUZncAN5yyzhVacDSFlbDJIbO1qkzQXuP9Gql+/bTXj7WLbUq1t4V3H+kN3q5zWOnq5Jn05Jdm6GvMTExPJnC9PCDgYC2/X1Mp6o38j1xv3m0Q1LT5wu985DghlzGcxdqUaKzvSRpLJXtaFhdUpND8mLsZhKQcPuhSTxRL+UWFCkM3bPexZC/N2/9b/nYF/Z+AxZuD/AA8zEhkTLyOGAAAAAElFTkSuQmCC\');\n}\n\n\n\t/* layers control */\n\n.l7-control-layers {\n\tbox-shadow: 0 1px 8px rgba(0,0,0,0.4);\n\tbackground: #fff;\n\tborder-radius: 2px;\n\t}\n.l7-control-layers-toggle {\n\tbackground-image: url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAkCAYAAAGf7Ah0AAAABGdBTUEAALGPC/xhBQAABzdJREFUWAnVV3lslEUUn/l2F0tpwdAih1HEqCReDcphNCo1EkgFkXa5PNpuC0Fo2e7Wgko8KiaKWrvbK5672xYFpNtiRRuNiY0aURA14BGviBcVlaKltVa6+42/N9v5Mrtt05rwj/PHzjt+8743b+a9N8vYwKgMNlUQyemnMtAkaJajvb3dToQSGp8e6boopkr4VYgEMYwO0vhCTfMVzBcMf8bx086YyODcuM80zTqp9IWat+7evW8sMdIxIqqCLa6oiAaJpuEtcBqcc2HEWMZ0JclgZR/Nchf++ubrzKjJSguXS4tVjXvPjfb3/UAAacGTn/MOMb7QnjNpNqP/bKZ50Ai0tqYmCi0n4zbM+W+lBc7JBOa+QPhDwcTsxJXE2+32edKCL9h8hRDmRzpIOWydAylhrcMfDN+ugBRKSdP3KwPhsFJIPth02FISIYQwYsDYcVfWhy/Bon4JgumffMGmiGTwQ0B/sHml4q2ZFAD3WQIQVhx0IdFw8B189lolN+w8w5PnjPmlhJgtA8/vfn3iye7u3yGzDljDxZEG4097Cp3rSSjBtMHunp6vFR+HHoIxmbgTe1xHKssDHecLNFUjMzbqMs5ZlHF7ute17M84+TMHDzr+OvR9JwKdCms9yRkzJq6bPTsWXh05QOPUN+PUHyPWMPhm6UHd7vaUohWZPSRE8OqxpTyibQa/qcTlbEP0vwF7AWUAT3JM9dy69FfSNza+MU4awNE8iQtXSkJuGLleV852ov2h5jkwVof0mUs8aO4LhTuYYFOAjExId0wcFIPahpaLTkWiX9ECfHG/sLNi1i8+HODfgLFFRI96+INNi0cNTgTS1obKQh03aAuk9DeELzcj4pACYivvwvXrFK/PcQZiQWo+hmidpYMUjQC7EOB6xdNsGfAHwk/RDdOVw9Dm+NTUSWtWLDohDVQ37JkbiUT2DwMeVswZP+gtdM4x3HnLDhjcGM2XLWOISaenIGee9MCSgqgMht/H/q/SZYk0qviV3oKcj5XcioESyOoqIseFYDYloxnAGm/hcrcuk3JV2XBMl+pKqn6mENux11+w12m6jpqMMFn7rPPTHdwfCm8yTfG4tMaNu+GepPUFiqbM7T105ARSPQU+dY/LOC/N2gI65WEkyWUEtjmSppfkLvlRLaQ5VnZFDtGGzbheNRROKZmbu/AvUvh3tE4Wff2/0IUC+y2q+4VVoXBW1BSvkR7Rb8BW84lWJQBdlGozcs7GLy3Nd35OSqTxBqtfgkc1+sPjcqbDgEl6xK0dH5lv545LOCVL1/F+3CoY4eyY1+WcBiC2KYEHQBd5XDkyndE17xCm2Ug6BLcSwb3LigE1AlOYu6TS4HUwVEw0Df1osfBnLDwnpiFDCQPuvQ73Fkqxg8/hEVYLXt66MXbbzOK8bKre1hhkgDT0RDja3fEHytwZxCMLH0YWPkD0fxqjqUZDejDSV3z1LbexqPkEPJxKWLqtKOGbvPnZL460NlE/KgfkIZiRrfjShsQcG2QQDUwwXjcuZcID61Ys6ErUJ/LDOiCfLUzUjVQdEg0O4jn/ABEq0iuIjrEcwE0x/KGWNbjPj4BO00Gni0ZOoIPzLR5X9vMqqaQDqDzzENra4V5zp8sBZQcROYjsLvYUOPdbEVBKeiZ193QjCmwtZCM+ldS6EWYTH3wuNSV1i+pFCj/IAaWgGUfBq0N78qPM3DZcp9TxcTQeyzZm3ON2LatXpSlOP8BIB6qDLddHmHnFrBlpNZmZmdZbNXEB9XsRlZXFennqGHzoXW5DaId4iSoc/Q365EjnRjszPnYXZL9NDWUtGsqzCjAw7xprTypbn7fkaILcYqkInzzeX06C8emO8sKlS7stZQLxVMPes/+O9FVAvEpXob+utY6gZmfrtMjf/RUI+2odhF7wJbq+Gzf3zTj5CAwyaoEwozVoCzN1KKK00z7WUbZx9dIOklsO6CAZpu87i5gpHoJ8gtLh9vZixSO2KckV7qysf5Sc5uq2tjOix3rL0FW3IJuSNV0XM/iDs85LqxvqeKUD8n3LxUobt5WVuLJlS9IM4O9i09VRwWtxLWfpcix+hXjs8mZdjn19YuOiuKRgufzXqOuqQi2r8O+yAk/tl2Q/RMW7ETe8UdX1GJhHDM5qjDHJ5e7bs07qBp7ZsTe9t6/vUXykkLKEdLFbLgLJSUn3rrt1yXEdX/1C23jzVG+5Keg/B5r2wJD9g/NcaUAJq4MvXxxl/TWoATcoGc0Av4eUKnIXZlsvXpLHO0CS2KgOtGQgdeuwqWuUjGbUgrdszLHRXXDLF0oe54AS0kyPnc5Iz/2CmV7EeIzSwcjvsHQPXkUhld/kCP6Xu+DRNjg/SWHh+SnODF+aPeVh9XCydAPEsA4kAqsCzcuiTPiw7+maTj6SwGsVk/9gY9xbUpizR8MNS47aAd0C7s35CG8VdrxYyjl/FcdUgo73nY77X9D/Au9RDMh+aBoVAAAAAElFTkSuQmCC\');\n\twidth: 30px;\n height: 30px;\n background-size: 20px 20px;\n\t}\n\n.l7-touch .l7-control-layers-toggle {\n\twidth: 44px;\n\theight: 44px;\n\t}\n.l7-control-layers .l7-control-layers-list,\n.l7-control-layers-expanded .l7-control-layers-toggle {\n\tdisplay: none;\n\t}\n.l7-control-layers-expanded .l7-control-layers-list {\n\tdisplay: block;\n\tposition: relative;\n\t}\n.l7-control-layers-expanded {\n\tpadding: 6px 10px 6px 6px;\n\tcolor: #59626B;\n\tbackground: #fff;\n\t}\n.l7-control-layers-scrollbar {\n\toverflow-y: scroll;\n\toverflow-x: hidden;\n\tpadding-right: 5px;\n\t}\n.l7-control-layers-selector {\n\tmargin-top: 2px;\n\tposition: relative;\n\ttop: 1px;\n\t}\n.l7-control-layers label {\n display: block;\n padding: 8px;\n }\n .l7-control-layers label input[type="radio"],\n .l7-control-layers label input[type="checkbox"] {\n width: 14px;\n height: 14px;\n margin: 0;\n}\n.l7-control-layers-separator {\n\theight: 0;\n\tborder-top: 1px solid #D8D8D8;\n\tmargin: 5px -10px 5px -6px;\n}\n.mapboxgl-ctrl-logo {\n display: none !important;\n }\n .amap-logo{\n display: none !important;\n }\n\n\n');var AA,TA,kA,MA,CA,IA,PA,OA,RA,LA,NA,DA,jA,zA,FA=o((function(e,t){e.exports=function(){var e=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},t=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e};function n(e){return"undefined"!=typeof atob?atob(e):"base64:"+e}function r(e){var t=new Error("(regl) "+e);throw console.error(t),t}function i(e,t){e||r(t)}function o(e){return e?": "+e:""}function a(e,t){switch(t){case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"function":return"function"==typeof e;case"undefined":return void 0===e;case"symbol":return"symbol"==typeof e}}function s(e,t,n){t.indexOf(e)<0&&r("invalid value"+o(n)+". must be one of: "+t)}var u=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(e,t){for(e+="";e.length<t;)e=" "+e;return e}function l(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function f(e,t){this.number=e,this.line=t,this.errors=[]}function h(e,t,n){this.file=e,this.line=t,this.message=n}function d(){var e=new Error,t=(e.stack||e).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(t);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(t);return r?r[1]:"unknown"}function p(){var e=new Error,t=(e.stack||e).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(t);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(t);return r?r[1]:"unknown"}function v(e,t){var r=e.split("\n"),i=1,o=0,a={unknown:new l,0:new l};a.unknown.name=a[0].name=t||d(),a.unknown.lines.push(new f(0,""));for(var s=0;s<r.length;++s){var u=r[s],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(u);if(c)switch(c[1]){case"line":var h=/(\d+)(\s+\d+)?/.exec(c[2]);h&&(i=0|h[1],h[2]&&((o=0|h[2])in a||(a[o]=new l)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?n(p[2]):p[2])}a[o].lines.push(new f(i++,u))}return Object.keys(a).forEach((function(e){var t=a[e];t.lines.forEach((function(e){t.index[e.number]=e}))})),a}function g(e){e._commandRef=d()}function m(e,t){var n=p();r(e+" in command "+(t||d())+("unknown"===n?"":" called from "+n))}function y(e,t,n,r){a(e,t)||m("invalid parameter type"+o(n)+". expected "+t+", got "+typeof e,r||d())}var b={};function _(e,t){return 32820===e||32819===e||33635===e?2:34042===e?4:b[e]*t}function x(e){return!(e&e-1||!e)}b[5120]=b[5121]=1,b[5122]=b[5123]=b[36193]=b[33635]=b[32819]=b[32820]=2,b[5124]=b[5125]=b[5126]=b[34042]=4;var w=t(i,{optional:function(e){e()},raise:r,commandRaise:m,command:function(e,t,n){e||m(t,n||d())},parameter:function(e,t,n){e in t||r("unknown parameter ("+e+")"+o(n)+". possible values: "+Object.keys(t).join())},commandParameter:function(e,t,n,r){e in t||m("unknown parameter ("+e+")"+o(n)+". possible values: "+Object.keys(t).join(),r||d())},constructor:function(e){Object.keys(e).forEach((function(e){u.indexOf(e)<0&&r('invalid regl constructor argument "'+e+'". must be one of '+u)}))},type:function(e,t,n){a(e,t)||r("invalid parameter type"+o(n)+". expected "+t+", got "+typeof e)},commandType:y,isTypedArray:function(t,n){e(t)||r("invalid parameter type"+o(n)+". must be a typed array")},nni:function(e,t){e>=0&&(0|e)===e||r("invalid parameter type, ("+e+")"+o(t)+". must be a nonnegative integer")},oneOf:s,shaderError:function(e,t,n,r,o){if(!e.getShaderParameter(t,e.COMPILE_STATUS)){var a=e.getShaderInfoLog(t),s=r===e.FRAGMENT_SHADER?"fragment":"vertex";y(n,"string",s+" shader source must be a string",o);var u=v(n,o),l=function(e){var t=[];return e.split("\n").forEach((function(e){if(!(e.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(e);n?t.push(new h(0|n[1],0|n[2],n[3].trim())):e.length>0&&t.push(new h("unknown",0,e))}})),t}(a);!function(e,t){t.forEach((function(t){var n=e[t.file];if(n){var r=n.index[t.line];if(r)return r.errors.push(t),void(n.hasErrors=!0)}e.unknown.hasErrors=!0,e.unknown.lines[0].errors.push(t)}))}(u,l),Object.keys(u).forEach((function(e){var t=u[e];if(t.hasErrors){var n=[""],r=[""];i("file number "+e+": "+t.name+"\n","color:red;text-decoration:underline;font-weight:bold"),t.lines.forEach((function(e){if(e.errors.length>0){i(c(e.number,4)+"| ","background-color:yellow; font-weight:bold"),i(e.line+"\n","color:red; background-color:yellow; font-weight:bold");var t=0;e.errors.forEach((function(n){var r=n.message,o=/^\s*'(.*)'\s*:\s*(.*)$/.exec(r);if(o){var a=o[1];switch(r=o[2],a){case"assign":a="="}t=Math.max(e.line.indexOf(a,t),0)}else t=0;i(c("| ",6)),i(c("^^^",t+3)+"\n","font-weight:bold"),i(c("| ",6)),i(r+"\n","font-weight:bold")})),i(c("| ",6)+"\n")}else i(c(e.number,4)+"| "),i(e.line+"\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(e,t){n.push(e),r.push(t||"")}})),i.raise("Error compiling "+s+" shader, "+u[0].name)}},linkError:function(e,t,n,r,o){if(!e.getProgramParameter(t,e.LINK_STATUS)){var a=e.getProgramInfoLog(t),s=v(n,o),u='Error linking program with vertex shader, "'+v(r,o)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+a),i.raise(u)}},callSite:p,saveCommandRef:g,saveDrawInfo:function(e,t,n,r){function i(e){return e?r.id(e):0}function o(e,t){Object.keys(t).forEach((function(t){e[r.id(t)]=!0}))}g(e),e._fragId=i(e.static.frag),e._vertId=i(e.static.vert);var a=e._uniformSet={};o(a,t.static),o(a,t.dynamic);var s=e._attributeSet={};o(s,n.static),o(s,n.dynamic),e._hasCount="count"in e.static||"count"in e.dynamic||"elements"in e.static||"elements"in e.dynamic},framebufferFormat:function(e,t,n){e.texture?s(e.texture._texture.internalformat,t,"unsupported texture format for attachment"):s(e.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(e,t,n){var r,o=t.width,a=t.height,s=t.channels;i(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),33071===e.wrapS&&33071===e.wrapT||i(x(o)&&x(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===t.mipmask?1!==o&&1!==a&&i(9984!==e.minFilter&&9986!==e.minFilter&&9985!==e.minFilter&&9987!==e.minFilter,"min filter requires mipmap"):(i(x(o)&&x(a),"texture must be a square power of 2 to support mipmapping"),i(t.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===t.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&i(9728===e.minFilter&&9728===e.magFilter,"filter not supported, must enable oes_texture_float_linear"),i(!e.genMipmaps,"mipmap generation not supported with float textures"));var u=t.images;for(r=0;r<16;++r)if(u[r]){var c=o>>r,l=a>>r;i(t.mipmask&1<<r,"missing mipmap data");var f=u[r];if(i(f.width===c&&f.height===l,"invalid shape for mip images"),i(f.format===t.format&&f.internalformat===t.internalformat&&f.type===t.type,"incompatible type for mip image"),f.compressed);else if(f.data){var h=Math.ceil(_(f.type,s)*c/f.unpackAlignment)*f.unpackAlignment;i(f.data.byteLength===h*l,"invalid data for image, buffer size is inconsistent with image format")}else f.element||f.copy}else e.genMipmaps||i(0==(t.mipmask&1<<r),"extra mipmap data");t.compressed&&i(!e.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(e,t,n,r){var o=e.width,a=e.height,s=e.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(33071===t.wrapS&&33071===t.wrapT,"wrap mode not supported by cube map");for(var u=0;u<n.length;++u){var c=n[u];i(c.width===o&&c.height===a,"inconsistent cube map face shape"),t.genMipmaps&&(i(!c.compressed,"can not generate mipmap for compressed textures"),i(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var l=c.images,f=0;f<16;++f){var h=l[f];if(h){var d=o>>f,p=a>>f;i(c.mipmask&1<<f,"missing mipmap data"),i(h.width===d&&h.height===p,"invalid shape for mip images"),i(h.format===e.format&&h.internalformat===e.internalformat&&h.type===e.type,"incompatible type for mip image"),h.compressed||(h.data?i(h.data.byteLength===d*p*Math.max(_(h.type,s),h.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):h.element||h.copy)}}}}}),S=0;function E(e,t){this.id=S++,this.type=e,this.data=t}function A(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function T(e){return"["+function e(t){if(0===t.length)return[];var n=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&n===r&&('"'===n||"'"===n))return['"'+A(t.substr(1,t.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(i)return e(t.substr(0,i.index)).concat(e(i[1])).concat(e(t.substr(i.index+i[0].length)));var o=t.split(".");if(1===o.length)return['"'+A(t)+'"'];for(var a=[],s=0;s<o.length;++s)a=a.concat(e(o[s]));return a}(e).join("][")+"]"}var k={DynamicVariable:E,define:function(e,t){return new E(e,T(t+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof E},unbox:function e(t,n){return"function"==typeof t?new E(0,t):"number"==typeof t||"boolean"==typeof t?new E(5,t):Array.isArray(t)?new E(6,t.map((t,r)=>e(t,n+"["+r+"]"))):t instanceof E?t:void w(!1,"invalid option type in uniform "+n)},accessor:T},M={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},C="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function I(e){return"string"==typeof e?e.split():(w(Array.isArray(e),"invalid extension array"),e)}function P(e){return"string"==typeof e?(w("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(e)):e}function O(e){var n,r,i,o,a,s=e||{},u={},c=[],l=[],f="undefined"==typeof window?1:window.devicePixelRatio,h=!1,d=function(e){e&&w.raise(e)},p=function(){};if("string"==typeof s?(w("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(s),w(n,"invalid query string for element")):"object"==typeof s?"string"==typeof(a=s).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=s:function(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}(s)?i=(o=s).canvas:(w.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=P(s.canvas):"container"in s&&(r=P(s.container)),"attributes"in s&&(u=s.attributes,w.type(u,"object","invalid context attributes")),"extensions"in s&&(c=I(s.extensions)),"optionalExtensions"in s&&(l=I(s.optionalExtensions)),"onDone"in s&&(w.type(s.onDone,"function","invalid or missing onDone callback"),d=s.onDone),"profile"in s&&(h=!!s.profile),"pixelRatio"in s&&(f=+s.pixelRatio,w(f>0,"invalid pixel ratio"))):w.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){w("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(e,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(e!==document.body){var a=e.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,t(o.style,{width:n+"px",height:i+"px"})}return t(o.style,{border:0,margin:0,padding:0,top:0,left:0}),e.appendChild(o),e===document.body&&(o.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(e):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),e.removeChild(o)}}}(r||document.body,0,f);if(!v)return null;i=v.canvas,p=v.onDestroy}void 0===u.premultipliedAlpha&&(u.premultipliedAlpha=!0),o=function(e,t){function n(n){try{return e.getContext(n,t)}catch(e){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,u)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:l,pixelRatio:f,profile:h,onDone:d,onDestroy:p}:(p(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function R(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}function L(e){var t,n;return t=(e>65535)<<4,t|=n=((e>>>=t)>255)<<3,t|=n=((e>>>=n)>15)<<2,(t|=n=((e>>>=n)>3)<<1)|(e>>>=n)>>1}function N(){var e=R(8,(function(){return[]}));function t(t){var n=function(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}(t),r=e[L(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(t){e[L(t.byteLength)>>2].push(t)}return{alloc:t,free:n,allocType:function(e,n){var r=null;switch(e){case 5120:r=new Int8Array(t(n),0,n);break;case 5121:r=new Uint8Array(t(n),0,n);break;case 5122:r=new Int16Array(t(2*n),0,n);break;case 5123:r=new Uint16Array(t(2*n),0,n);break;case 5124:r=new Int32Array(t(4*n),0,n);break;case 5125:r=new Uint32Array(t(4*n),0,n);break;case 5126:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(e){n(e.buffer)}}}var D=N();function j(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||e(t.data))}D.zero=N();var z=function(e){return Object.keys(e).map((function(t){return e[t]}))},F={shape:function(e){for(var t=[],n=e;n.length;n=n[0])t.push(n.length);return t},flatten:function(e,t,n,r){var i=1;if(t.length)for(var o=0;o<t.length;++o)i*=t[o];else i=0;var a=r||D.allocType(n,i);switch(t.length){case 0:break;case 1:!function(e,t,n){for(var r=0;r<t;++r)n[r]=e[r]}(e,t[0],a);break;case 2:!function(e,t,n,r){for(var i=0,o=0;o<t;++o)for(var a=e[o],s=0;s<n;++s)r[i++]=a[s]}(e,t[0],t[1],a);break;case 3:B(e,t[0],t[1],t[2],a,0);break;default:!function e(t,n,r,i,o){for(var a=1,s=r+1;s<n.length;++s)a*=n[s];var u=n[r];if(n.length-r==4){var c=n[r+1],l=n[r+2],f=n[r+3];for(s=0;s<u;++s)B(t[s],c,l,f,i,o),o+=a}else for(s=0;s<u;++s)e(t[s],n,r+1,i,o),o+=a}(e,t,0,a,0)}return a}};function B(e,t,n,r,i,o){for(var a=o,s=0;s<t;++s)for(var u=e[s],c=0;c<n;++c)for(var l=u[c],f=0;f<r;++f)i[a++]=l[f]}var U={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},V={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},G={dynamic:35048,stream:35040,static:35044},H=F.flatten,Z=F.shape,W=[];function q(e){return 0|U[Object.prototype.toString.call(e)]}function X(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function Y(e,t,n,r,i,o,a){for(var s=0,u=0;u<n;++u)for(var c=0;c<r;++c)e[s++]=t[i*u+o*c+a]}W[5120]=1,W[5122]=2,W[5124]=4,W[5121]=1,W[5123]=2,W[5125]=4,W[5126]=4;var K={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Q=new Float32Array(1),J=new Uint32Array(Q.buffer);function $(e){for(var t=D.allocType(5123,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(e[n]===1/0)t[n]=31744;else if(e[n]===-1/0)t[n]=64512;else{Q[0]=e[n];var r=J[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)t[n]=i;else if(o<-14){var s=-14-o;t[n]=i+(a+1024>>s)}else t[n]=o>15?i+31744:i+(o+15<<10)+a}return t}function ee(t){return Array.isArray(t)||e(t)}var te=function(e){return!(e&e-1||!e)},ne=[9984,9986,9985,9987],re=[0,6409,6410,6407,6408],ie={};function oe(e){return"[object "+e+"]"}ie[6409]=ie[6406]=ie[6402]=1,ie[34041]=ie[6410]=2,ie[6407]=ie[35904]=3,ie[6408]=ie[35906]=4;var ae=oe("HTMLCanvasElement"),se=oe("OffscreenCanvas"),ue=oe("CanvasRenderingContext2D"),ce=oe("ImageBitmap"),le=oe("HTMLImageElement"),fe=oe("HTMLVideoElement"),he=Object.keys(U).concat([ae,se,ue,ce,le,fe]),de=[];de[5121]=1,de[5126]=4,de[36193]=2,de[5123]=2,de[5125]=4;var pe=[];function ve(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function ge(e){return!!Array.isArray(e)&&!(0===e.length||!ee(e[0]))}function me(e){return Object.prototype.toString.call(e)}function ye(e){return me(e)===ae}function be(e){return me(e)===se}function _e(e){if(!e)return!1;var t=me(e);return he.indexOf(t)>=0||ve(e)||ge(e)||j(e)}function xe(e){return 0|U[Object.prototype.toString.call(e)]}function we(e,t){return D.allocType(36193===e.type?5126:e.type,t)}function Se(e,t){36193===e.type?(e.data=$(t),D.freeType(t)):e.data=t}function Ee(e,t,n,r,i,o){var a;if(a=void 0!==pe[e]?pe[e]:ie[e]*de[t],o&&(a*=6),i){for(var s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function Ae(n,r,i,o,a,s,u){var c={"don't care":4352,"dont care":4352,nice:4354,fast:4353},l={repeat:10497,clamp:33071,mirror:33648},f={nearest:9728,linear:9729},h=t({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},f),d={none:0,browser:37444},p={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},g={};r.ext_srgb&&(v.srgb=35904,v.srgba=35906),r.oes_texture_float&&(p.float32=p.float=5126),r.oes_texture_half_float&&(p.float16=p["half float"]=36193),r.webgl_depth_texture&&(t(v,{depth:6402,"depth stencil":34041}),t(p,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(g,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&t(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var m=Array.prototype.slice.call(n.getParameter(34467));Object.keys(g).forEach((function(e){var t=g[e];m.indexOf(t)>=0&&(v[e]=t)}));var y=Object.keys(v);i.textureFormats=y;var b=[];Object.keys(v).forEach((function(e){var t=v[e];b[t]=e}));var _=[];Object.keys(p).forEach((function(e){var t=p[e];_[t]=e}));var x=[];Object.keys(f).forEach((function(e){x[f[e]]=e}));var S=[];Object.keys(h).forEach((function(e){var t=h[e];S[t]=e}));var E=[];Object.keys(l).forEach((function(e){E[l[e]]=e}));var A=y.reduce((function(e,t){var n=v[t];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?e[n]=n:32855===n||t.indexOf("rgba")>=0?e[n]=6408:e[n]=6407,e}),{});function T(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function k(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function M(e,t){if("object"==typeof t&&t){if("premultiplyAlpha"in t&&(w.type(t.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(w.type(t.flipY,"boolean","invalid texture flip"),e.flipY=t.flipY),"alignment"in t&&(w.oneOf(t.alignment,[1,2,4,8],"invalid texture unpack alignment"),e.unpackAlignment=t.alignment),"colorSpace"in t&&(w.parameter(t.colorSpace,d,"invalid colorSpace"),e.colorSpace=d[t.colorSpace]),"type"in t){var n=t.type;w(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),w(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),w(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(n,p,"invalid texture type"),e.type=p[n]}var o=e.width,a=e.height,s=e.channels,u=!1;"shape"in t?(w(Array.isArray(t.shape)&&t.shape.length>=2,"shape must be an array"),o=t.shape[0],a=t.shape[1],3===t.shape.length&&(s=t.shape[2],w(s>0&&s<=4,"invalid number of channels"),u=!0),w(o>=0&&o<=i.maxTextureSize,"invalid width"),w(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in t&&(o=a=t.radius,w(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in t&&(o=t.width,w(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in t&&(a=t.height,w(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in t&&(s=t.channels,w(s>0&&s<=4,"invalid number of channels"),u=!0)),e.width=0|o,e.height=0|a,e.channels=0|s;var c=!1;if("format"in t){var l=t.format;w(r.webgl_depth_texture||!("depth"===l||"depth stencil"===l),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(l,v,"invalid texture format");var f=e.internalformat=v[l];e.format=A[f],l in p&&("type"in t||(e.type=p[l])),l in g&&(e.compressed=!0),c=!0}!u&&c?e.channels=ie[e.format]:u&&!c?e.channels!==re[e.format]&&(e.format=e.internalformat=re[e.channels]):c&&u&&w(e.channels===ie[e.format],"number of channels inconsistent with specified format")}}function C(e){n.pixelStorei(37440,e.flipY),n.pixelStorei(37441,e.premultiplyAlpha),n.pixelStorei(37443,e.colorSpace),n.pixelStorei(3317,e.unpackAlignment)}function I(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function P(t,n){var r=null;if(_e(n)?r=n:n&&(w.type(n,"object","invalid pixel data type"),M(t,n),"x"in n&&(t.xOffset=0|n.x),"y"in n&&(t.yOffset=0|n.y),_e(n.data)&&(r=n.data)),w(!t.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){w(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,s=a.viewportHeight;t.width=t.width||o-t.xOffset,t.height=t.height||s-t.yOffset,t.needsCopy=!0,w(t.xOffset>=0&&t.xOffset<o&&t.yOffset>=0&&t.yOffset<s&&t.width>0&&t.width<=o&&t.height>0&&t.height<=s,"copy texture read out of bounds")}else if(r){if(e(r))t.channels=t.channels||4,t.data=r,"type"in n||5121!==t.type||(t.type=xe(r));else if(ve(r))t.channels=t.channels||4,function(e,t){var n=t.length;switch(e.type){case 5121:case 5123:case 5125:case 5126:var r=D.allocType(e.type,n);r.set(t),e.data=r;break;case 36193:e.data=$(t);break;default:w.raise("unsupported texture type, must specify a typed array")}}(t,r),t.alignment=1,t.needsFree=!0;else if(j(r)){var u=r.data;Array.isArray(u)||5121!==t.type||(t.type=xe(u));var c,l,f,h,d,p,v=r.shape,g=r.stride;3===v.length?(f=v[2],p=g[2]):(w(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),f=1,p=1),c=v[0],l=v[1],h=g[0],d=g[1],t.alignment=1,t.width=c,t.height=l,t.channels=f,t.format=t.internalformat=re[f],t.needsFree=!0,function(e,t,n,r,i,o){for(var a=e.width,s=e.height,u=e.channels,c=we(e,a*s*u),l=0,f=0;f<s;++f)for(var h=0;h<a;++h)for(var d=0;d<u;++d)c[l++]=t[n*h+r*f+i*d+o];Se(e,c)}(t,u,h,d,p,r.offset)}else if(ye(r)||be(r)||function(e){return me(e)===ue}(r))ye(r)||be(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(function(e){return me(e)===ce}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(e){return me(e)===le}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(e){return me(e)===fe}(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(ge(r)){var m=t.width||r[0].length,y=t.height||r.length,b=t.channels;b=ee(r[0][0])?b||r[0][0].length:b||1;for(var _=F.shape(r),x=1,S=0;S<_.length;++S)x*=_[S];var E=we(t,x);F.flatten(r,_,"",E),Se(t,E),t.alignment=1,t.width=m,t.height=y,t.channels=b,t.format=t.internalformat=re[b],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;5126===t.type?w(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):36193===t.type&&w(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function O(e,t,r){var i=e.element,a=e.data,s=e.internalformat,u=e.format,c=e.type,l=e.width,f=e.height;C(e),i?n.texImage2D(t,r,u,u,c,i):e.compressed?n.compressedTexImage2D(t,r,s,l,f,0,a):e.needsCopy?(o(),n.copyTexImage2D(t,r,u,e.xOffset,e.yOffset,l,f,0)):n.texImage2D(t,r,u,l,f,0,u,c,a||null)}function R(e,t,r,i,a){var s=e.element,u=e.data,c=e.internalformat,l=e.format,f=e.type,h=e.width,d=e.height;C(e),s?n.texSubImage2D(t,a,r,i,l,f,s):e.compressed?n.compressedTexSubImage2D(t,a,r,i,c,h,d,u):e.needsCopy?(o(),n.copyTexSubImage2D(t,a,r,i,e.xOffset,e.yOffset,h,d)):n.texSubImage2D(t,a,r,i,h,d,l,f,u)}var L=[];function N(){return L.pop()||new I}function B(e){e.needsFree&&D.freeType(e.data),I.call(e),L.push(e)}function U(){T.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function V(e,t,n){var r=e.images[0]=N();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function G(e,t){var n=null;if(_e(t))k(n=e.images[0]=N(),e),P(n,t),e.mipmask=1;else if(M(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)k(n=e.images[i]=N(),e),n.width>>=i,n.height>>=i,P(n,r[i]),e.mipmask|=1<<i;else k(n=e.images[0]=N(),e),P(n,t),e.mipmask=1;k(e,e.images[0]),!e.compressed||33776!==e.internalformat&&33777!==e.internalformat&&33778!==e.internalformat&&33779!==e.internalformat||w(e.width%4==0&&e.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function H(e,t){for(var n=e.images,r=0;r<n.length;++r){if(!n[r])return;O(n[r],t,r)}}var Z=[];function W(){var e=Z.pop()||new U;T.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function q(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&B(t[n]),t[n]=null;Z.push(e)}function X(){this.minFilter=9728,this.magFilter=9728,this.wrapS=33071,this.wrapT=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function Y(e,t){if("min"in t){var n=t.min;w.parameter(n,h),e.minFilter=h[n],ne.indexOf(e.minFilter)>=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var r=t.mag;w.parameter(r,f),e.magFilter=f[r]}var o=e.wrapS,a=e.wrapT;if("wrap"in t){var s=t.wrap;"string"==typeof s?(w.parameter(s,l),o=a=l[s]):Array.isArray(s)&&(w.parameter(s[0],l),w.parameter(s[1],l),o=l[s[0]],a=l[s[1]])}else{if("wrapS"in t){var u=t.wrapS;w.parameter(u,l),o=l[u]}if("wrapT"in t){var d=t.wrapT;w.parameter(d,l),a=l[d]}}if(e.wrapS=o,e.wrapT=a,"anisotropic"in t){var p=t.anisotropic;w("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),e.anisotropic=t.anisotropic}if("mipmap"in t){var v=!1;switch(typeof t.mipmap){case"string":w.parameter(t.mipmap,c,"invalid mipmap hint"),e.mipmapHint=c[t.mipmap],e.genMipmaps=!0,v=!0;break;case"boolean":v=e.genMipmaps=t.mipmap;break;case"object":w(Array.isArray(t.mipmap),"invalid mipmap type"),e.genMipmaps=!1,v=!0;break;default:w.raise("invalid mipmap type")}v&&!("min"in t)&&(e.minFilter=9984)}}function K(e,t){n.texParameteri(t,10241,e.minFilter),n.texParameteri(t,10240,e.magFilter),n.texParameteri(t,10242,e.wrapS),n.texParameteri(t,10243,e.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(t,34046,e.anisotropic),e.genMipmaps&&(n.hint(33170,e.mipmapHint),n.generateMipmap(t))}var Q=0,J={},oe=i.maxTextureUnits,ae=Array(oe).map((function(){return null}));function se(e){T.call(this),this.mipmask=0,this.internalformat=6408,this.id=Q++,this.refCount=1,this.target=e,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new X,u.profile&&(this.stats={size:0})}function he(e){n.activeTexture(33984),n.bindTexture(e.target,e.texture)}function de(){var e=ae[0];e?n.bindTexture(e.target,e.texture):n.bindTexture(3553,null)}function pe(e){var t=e.texture;w(t,"must not double destroy texture");var r=e.unit,i=e.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),ae[r]=null),n.deleteTexture(t),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete J[e.id],s.textureCount--}return t(se.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(e<0){for(var t=0;t<oe;++t){var r=ae[t];if(r){if(r.bindCount>0)continue;r.unit=-1}ae[t]=this,e=t;break}e>=oe&&w.raise("insufficient number of texture units"),u.profile&&s.maxTextureUnits<e+1&&(s.maxTextureUnits=e+1),this.unit=e,n.activeTexture(33984+e),n.bindTexture(this.target,this.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&pe(this)}}),u.profile&&(s.getTotalTextureSize=function(){var e=0;return Object.keys(J).forEach((function(t){e+=J[t].stats.size})),e}),{create2D:function(e,t){var r=new se(3553);function o(e,t){var n=r.texInfo;X.call(n);var a=W();return"number"==typeof e?V(a,0|e,"number"==typeof t?0|t:0|e):e?(w.type(e,"object","invalid arguments to regl.texture"),Y(n,e),G(a,e)):V(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,k(r,a),w.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,he(r),H(a,3553),K(n,3553),de(),q(a),u.profile&&(r.stats.size=Ee(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=b[r.internalformat],o.type=_[r.type],o.mag=x[n.magFilter],o.min=S[n.minFilter],o.wrapS=E[n.wrapS],o.wrapT=E[n.wrapT],o}return J[r.id]=r,s.textureCount++,o(e,t),o.subimage=function(e,t,n,i){w(!!e,"must specify image data");var a=0|t,s=0|n,u=0|i,c=N();return k(c,r),c.width=0,c.height=0,P(c,e),c.width=c.width||(r.width>>u)-a,c.height=c.height||(r.height>>u)-s,w(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),w(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),w(r.mipmask&1<<u,"missing mipmap data"),w(c.data||c.element||c.needsCopy,"missing image data"),he(r),R(c,3553,a,s,u),de(),B(c),o},o.resize=function(e,t){var i=0|e,a=0|t||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,he(r);for(var s=0;r.mipmask>>s;++s){var c=i>>s,l=a>>s;if(!c||!l)break;n.texImage2D(3553,s,r.format,c,l,0,r.format,r.type,null)}return de(),u.profile&&(r.stats.size=Ee(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,u.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(e,t,r,o,a,c){var l=new se(34067);J[l.id]=l,s.cubeCount++;var f=new Array(6);function h(e,t,n,r,o,a){var s,c=l.texInfo;for(X.call(c),s=0;s<6;++s)f[s]=W();if("number"!=typeof e&&e)if("object"==typeof e)if(t)G(f[0],e),G(f[1],t),G(f[2],n),G(f[3],r),G(f[4],o),G(f[5],a);else if(Y(c,e),M(l,e),"faces"in e){var d=e.faces;for(w(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),s=0;s<6;++s)w("object"==typeof d[s]&&!!d[s],"invalid input for cube map face"),k(f[s],l),G(f[s],d[s])}else for(s=0;s<6;++s)G(f[s],e);else w.raise("invalid arguments to cube map");else{var p=0|e||1;for(s=0;s<6;++s)V(f[s],p,p)}for(k(l,f[0]),i.npotTextureCube||w(te(l.width)&&te(l.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?l.mipmask=(f[0].width<<1)-1:l.mipmask=f[0].mipmask,w.textureCube(l,c,f,i),l.internalformat=f[0].internalformat,h.width=f[0].width,h.height=f[0].height,he(l),s=0;s<6;++s)H(f[s],34069+s);for(K(c,34067),de(),u.profile&&(l.stats.size=Ee(l.internalformat,l.type,h.width,h.height,c.genMipmaps,!0)),h.format=b[l.internalformat],h.type=_[l.type],h.mag=x[c.magFilter],h.min=S[c.minFilter],h.wrapS=E[c.wrapS],h.wrapT=E[c.wrapT],s=0;s<6;++s)q(f[s]);return h}return h(e,t,r,o,a,c),h.subimage=function(e,t,n,r,i){w(!!t,"must specify image data"),w("number"==typeof e&&e===(0|e)&&e>=0&&e<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=N();return k(u,l),u.width=0,u.height=0,P(u,t),u.width=u.width||(l.width>>s)-o,u.height=u.height||(l.height>>s)-a,w(l.type===u.type&&l.format===u.format&&l.internalformat===u.internalformat,"incompatible format for texture.subimage"),w(o>=0&&a>=0&&o+u.width<=l.width&&a+u.height<=l.height,"texture.subimage write out of bounds"),w(l.mipmask&1<<s,"missing mipmap data"),w(u.data||u.element||u.needsCopy,"missing image data"),he(l),R(u,34069+e,o,a,s),de(),B(u),h},h.resize=function(e){var t=0|e;if(t!==l.width){h.width=l.width=t,h.height=l.height=t,he(l);for(var r=0;r<6;++r)for(var i=0;l.mipmask>>i;++i)n.texImage2D(34069+r,i,l.format,t>>i,t>>i,0,l.format,l.type,null);return de(),u.profile&&(l.stats.size=Ee(l.internalformat,l.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=l,u.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){for(var e=0;e<oe;++e)n.activeTexture(33984+e),n.bindTexture(3553,null),ae[e]=null;z(J).forEach(pe),s.cubeCount=0,s.textureCount=0},getTexture:function(e){return null},restore:function(){for(var e=0;e<oe;++e){var t=ae[e];t&&(t.bindCount=0,t.unit=-1,ae[e]=null)}z(J).forEach((function(e){e.texture=n.createTexture(),n.bindTexture(e.target,e.texture);for(var t=0;t<32;++t)if(0!=(e.mipmask&1<<t))if(3553===e.target)n.texImage2D(3553,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);else for(var r=0;r<6;++r)n.texImage2D(34069+r,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);K(e.texInfo,e.target)}))},refresh:function(){for(var e=0;e<oe;++e){var t=ae[e];t&&(t.bindCount=0,t.unit=-1,ae[e]=null),n.activeTexture(33984+e),n.bindTexture(3553,null),n.bindTexture(34067,null)}}}}pe[32854]=2,pe[32855]=2,pe[36194]=2,pe[34041]=4,pe[33776]=.5,pe[33777]=.5,pe[33778]=1,pe[33779]=1,pe[35986]=.5,pe[35987]=1,pe[34798]=1,pe[35840]=.5,pe[35841]=.25,pe[35842]=.5,pe[35843]=.25,pe[36196]=.5;var Te=[];function ke(e,t,n){return Te[e]*t*n}Te[32854]=2,Te[32855]=2,Te[36194]=2,Te[33189]=2,Te[36168]=1,Te[34041]=4,Te[35907]=4,Te[34836]=16,Te[34842]=8,Te[34843]=6;var Me=[6407,6408],Ce=[];Ce[6408]=4,Ce[6407]=3;var Ie=[];Ie[5121]=1,Ie[5126]=4,Ie[36193]=2;var Pe=[32854,32855,36194,35907,34842,34843,34836],Oe={};function Re(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function Le(t,n,r,i,o,a,s){function u(u){var c;null===n.next?(w(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=5121):(w(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(w(5121===c||5126===c,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),5126===c&&w(s.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):w(5121===c,"Reading from a framebuffer is only allowed for the type 'uint8'"));var l=0,f=0,h=i.framebufferWidth,d=i.framebufferHeight,p=null;e(u)?p=u:u&&(w.type(u,"object","invalid arguments to regl.read()"),l=0|u.x,f=0|u.y,w(l>=0&&l<i.framebufferWidth,"invalid x offset for regl.read"),w(f>=0&&f<i.framebufferHeight,"invalid y offset for regl.read"),h=0|(u.width||i.framebufferWidth-l),d=0|(u.height||i.framebufferHeight-f),p=u.data||null),p&&(5121===c?w(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):5126===c&&w(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),w(h>0&&h+l<=i.framebufferWidth,"invalid width for read pixels"),w(d>0&&d+f<=i.framebufferHeight,"invalid height for read pixels"),r();var v=h*d*4;return p||(5121===c?p=new Uint8Array(v):5126===c&&(p=p||new Float32Array(v))),w.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),w(p.byteLength>=v,"data buffer for regl.read() too small"),t.pixelStorei(3333,4),t.readPixels(l,f,h,d,6408,c,p),p}return function(e){return e&&"framebuffer"in e?function(e){var t;return n.setFBO({framebuffer:e.framebuffer},(function(){t=u(e)})),t}(e):u(e)}}function Ne(e){return Array.prototype.slice.call(e)}function De(e){return Ne(e).join("")}Oe[36053]="complete",Oe[36054]="incomplete attachment",Oe[36057]="incomplete dimensions",Oe[36055]="incomplete, missing attachment",Oe[36061]="unsupported";var je="xyzw".split(""),ze="profile",Fe="framebuffer",Be="vert",Ue="frag",Ve="elements",Ge="primitive",He="count",Ze="offset",We="instances",qe="vao",Xe=Fe+"Width",Ye=Fe+"Height",Ke=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Qe={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Je=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],$e={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},et={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},tt={frag:35632,vert:35633},nt={cw:2304,ccw:2305};function rt(t){return Array.isArray(t)||e(t)||j(t)}function it(e){return e.sort((function(e,t){return"viewport"===e?-1:"viewport"===t?1:e<t?-1:1}))}function ot(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function at(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function st(e){return new ot(!1,!1,!1,e)}function ut(e,t){var n=e.type;if(0===n){var r=e.data.length;return new ot(!0,r>=1,r>=2,t)}if(4===n){var i=e.data;return new ot(i.thisDep,i.contextDep,i.propDep,t)}if(5===n)return new ot(!1,!1,!1,t);if(6===n){for(var o=!1,a=!1,s=!1,u=0;u<e.data.length;++u){var c=e.data[u];if(1===c.type)s=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var l=c.data;l>=1&&(a=!0),l>=2&&(s=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,s=s||c.data.propDep)}return new ot(o,a,s,t)}return new ot(3===n,2===n,1===n,t)}var ct=new ot(!1,!1,!1,(function(){}));function lt(e,n,r,i,o,a,s,u,c,l,f,h,d,p,v){var g=l.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=32775,m.max=32776);var y=r.angle_instanced_arrays,b=r.webgl_draw_buffers,_={dirty:!0,profile:v.profile},x={},S=[],E={},A={};function T(e){return e.replace(".","_")}function M(e,t,n){var r=T(e);S.push(e),x[r]=_[r]=!!n,E[r]=t}function C(e,t,n){var r=T(e);S.push(e),Array.isArray(n)?(_[r]=n.slice(),x[r]=n.slice()):_[r]=x[r]=n,A[r]=t}M("dither",3024),M("blend.enable",3042),C("blend.color","blendColor",[0,0,0,0]),C("blend.equation","blendEquationSeparate",[32774,32774]),C("blend.func","blendFuncSeparate",[1,0,1,0]),M("depth.enable",2929,!0),C("depth.func","depthFunc",513),C("depth.range","depthRange",[0,1]),C("depth.mask","depthMask",!0),C("colorMask","colorMask",[!0,!0,!0,!0]),M("cull.enable",2884),C("cull.face","cullFace",1029),C("frontFace","frontFace",2305),C("lineWidth","lineWidth",1),M("polygonOffset.enable",32823),C("polygonOffset.offset","polygonOffset",[0,0]),M("sample.alpha",32926),M("sample.enable",32928),C("sample.coverage","sampleCoverage",[1,!1]),M("stencil.enable",2960),C("stencil.mask","stencilMask",-1),C("stencil.func","stencilFunc",[519,0,-1]),C("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),C("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),M("scissor.enable",3089),C("scissor.box","scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),C("viewport","viewport",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var I={gl:e,context:d,strings:n,next:x,current:_,draw:h,elements:a,buffer:o,shader:f,attributes:l.state,vao:l,uniforms:c,framebuffer:u,extensions:r,timer:p,isBufferArgs:rt},P={primTypes:K,compareFuncs:$e,blendFuncs:Qe,blendEquations:m,stencilOps:et,glTypes:V,orientationType:nt};w.optional((function(){I.isArrayLike=ee})),b&&(P.backBuffer=[1029],P.drawBuffer=R(i.maxDrawbuffers,(function(e){return 0===e?[0]:R(e,(function(e){return 36064+e}))})));var O=0;function L(){var e=function(){var e=0,n=[],r=[];function i(){var n=[],r=[];return t((function(){n.push.apply(n,Ne(arguments))}),{def:function(){var t="v"+e++;return r.push(t),arguments.length>0&&(n.push(t,"="),n.push.apply(n,Ne(arguments)),n.push(";")),t},toString:function(){return De([r.length>0?"var "+r.join(",")+";":"",De(n)])}})}function o(){var e=i(),n=i(),r=e.toString,o=n.toString;function a(t,r){n(t,r,"=",e.def(t,r),";")}return t((function(){e.apply(e,Ne(arguments))}),{def:e.def,entry:e,exit:n,save:a,set:function(t,n,r){a(t,n),e(t,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),s={};return{global:a,link:function(t){for(var i=0;i<r.length;++i)if(r[i]===t)return n[i];var o="g"+e++;return n.push(o),r.push(t),o},block:i,proc:function(e,n){var r=[];function i(){var e="a"+r.length;return r.push(e),e}n=n||0;for(var a=0;a<n;++a)i();var u=o(),c=u.toString;return s[e]=t(u,{arg:i,toString:function(){return De(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var e=De(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return t(n,{then:function(){return n.apply(n,Ne(arguments)),this},else:function(){return r.apply(r,Ne(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),De(["if(",e,"){",i(),"}",t])}})},compile:function(){var e=['"use strict";',a,"return {"];Object.keys(s).forEach((function(t){e.push('"',t,'":',s[t].toString(),",")})),e.push("}");var t=De(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(t)).apply(null,r)}}}(),r=e.link,i=e.global;e.id=O++,e.batchId="0";var o=r(I),a=e.shared={props:"a0"};Object.keys(I).forEach((function(e){a[e]=i.def(o,".",e)})),w.optional((function(){e.CHECK=r(w),e.commandStr=w.guessCommand(),e.command=r(e.commandStr),e.assert=function(e,t,n){e("if(!(",t,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},P.invalidBlendCombinations=Je}));var s=e.next={},u=e.current={};Object.keys(A).forEach((function(e){Array.isArray(_[e])&&(s[e]=i.def(a.next,".",e),u[e]=i.def(a.current,".",e))}));var c=e.constants={};Object.keys(P).forEach((function(e){c[e]=i.def(JSON.stringify(P[e]))})),e.invoke=function(t,n){switch(n.type){case 0:var i=["this",a.context,a.props,e.batchId];return t.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return t.def(a.props,n.data);case 2:return t.def(a.context,n.data);case 3:return t.def("this",n.data);case 4:return n.data.append(e,t),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return e.invoke(t,n)}))}},e.attribCache={};var f={};return e.scopeAttrib=function(e){var t=n.id(e);if(t in f)return f[t];var i=l.scope[t];return i||(i=l.scope[t]=new g),f[t]=r(i)},e}function N(e,t,s,c,h){var d=e.static,p=e.dynamic;w.optional((function(){var e=[Fe,Be,Ue,Ve,Ge,Ze,He,We,ze,qe].concat(S);function t(t){Object.keys(t).forEach((function(t){w.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',h.commandStr)}))}t(d),t(p)}));var v=function(e,t){var n=e.static;if("string"==typeof n[Ue]&&"string"==typeof n[Be]){if(Object.keys(t.dynamic).length>0)return null;var r=t.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)w("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(e,t),b=function(e,t){var n=e.static,r=e.dynamic;if(Fe in n){var i=n[Fe];return i?(i=u.getFramebuffer(i),w.command(i,"invalid framebuffer object"),st((function(e,t){var n=e.link(i),r=e.shared;t.set(r.framebuffer,".next",n);var o=r.context;return t.set(o,"."+Xe,n+".width"),t.set(o,"."+Ye,n+".height"),n}))):st((function(e,t){var n=e.shared;t.set(n.framebuffer,".next","null");var r=n.context;return t.set(r,"."+Xe,r+".drawingBufferWidth"),t.set(r,"."+Ye,r+".drawingBufferHeight"),"null"}))}if(Fe in r){var o=r[Fe];return ut(o,(function(e,t){var n=e.invoke(t,o),r=e.shared,i=r.framebuffer,a=t.def(i,".getFramebuffer(",n,")");w.optional((function(){e.assert(t,"!"+n+"||"+a,"invalid framebuffer object")})),t.set(i,".next",a);var s=r.context;return t.set(s,"."+Xe,a+"?"+a+".width:"+s+".drawingBufferWidth"),t.set(s,"."+Ye,a+"?"+a+".height:"+s+".drawingBufferHeight"),a}))}return null}(e),_=function(e,t,n){var r=e.static,i=e.dynamic;function o(e){if(e in r){var o=r[e];w.commandType(o,"object","invalid "+e,n.commandStr);var a,s,u=!0,c=0|o.x,l=0|o.y;return"width"in o?(a=0|o.width,w.command(a>=0,"invalid "+e,n.commandStr)):u=!1,"height"in o?(s=0|o.height,w.command(s>=0,"invalid "+e,n.commandStr)):u=!1,new ot(!u&&t&&t.thisDep,!u&&t&&t.contextDep,!u&&t&&t.propDep,(function(e,t){var n=e.shared.context,r=a;"width"in o||(r=t.def(n,".",Xe,"-",c));var i=s;return"height"in o||(i=t.def(n,".",Ye,"-",l)),[c,l,r,i]}))}if(e in i){var f=i[e],h=ut(f,(function(t,n){var r=t.invoke(n,f);w.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)}));var i=t.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",Xe,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",Ye,"-",a,")");return w.optional((function(){t.assert(n,s+">=0&&"+u+">=0","invalid "+e)})),[o,a,s,u]}));return t&&(h.thisDep=h.thisDep||t.thisDep,h.contextDep=h.contextDep||t.contextDep,h.propDep=h.propDep||t.propDep),h}return t?new ot(t.thisDep,t.contextDep,t.propDep,(function(e,t){var n=e.shared.context;return[0,0,t.def(n,".",Xe),t.def(n,".",Ye)]})):null}var a=o("viewport");if(a){var s=a;a=new ot(a.thisDep,a.contextDep,a.propDep,(function(e,t){var n=s.append(e,t),r=e.shared.context;return t.set(r,".viewportWidth",n[2]),t.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o("scissor.box")}}(e,b,h),x=function(e,t){var n=e.static,r=e.dynamic,i=function(){if(Ve in n){var e=n[Ve];rt(e)?e=a.getElements(a.create(e,!0)):e&&(e=a.getElements(e),w.command(e,"invalid elements",t.commandStr));var i=st((function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r,r}return t.ELEMENTS=null,null}));return i.value=e,i}if(Ve in r){var o=r[Ve];return ut(o,(function(e,t){var n=e.shared,r=n.isBufferArgs,i=n.elements,a=e.invoke(t,o),s=t.def("null"),u=t.def(r,"(",a,")"),c=e.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return w.optional((function(){e.assert(c.else,"!"+a+"||"+s,"invalid elements")})),t.entry(c),t.exit(e.cond(u).then(i,".destroyStream(",s,");")),e.ELEMENTS=s,s}))}return null}();function o(e,o){if(e in n){var a=0|n[e];return w.command(!o||a>=0,"invalid "+e,t.commandStr),st((function(e,t){return o&&(e.OFFSET=a),a}))}if(e in r){var s=r[e];return ut(s,(function(t,n){var r=t.invoke(n,s);return o&&(t.OFFSET=r,w.optional((function(){t.assert(n,r+">=0","invalid "+e)}))),r}))}return o&&i?st((function(e,t){return e.OFFSET="0",0})):null}var s=o(Ze,!0);return{elements:i,primitive:function(){if(Ge in n){var e=n[Ge];return w.commandParameter(e,K,"invalid primitve",t.commandStr),st((function(t,n){return K[e]}))}if(Ge in r){var o=r[Ge];return ut(o,(function(e,t){var n=e.constants.primTypes,r=e.invoke(t,o);return w.optional((function(){e.assert(t,r+" in "+n,"invalid primitive, must be one of "+Object.keys(K))})),t.def(n,"[",r,"]")}))}return i?at(i)?i.value?st((function(e,t){return t.def(e.ELEMENTS,".primType")})):st((function(){return 4})):new ot(i.thisDep,i.contextDep,i.propDep,(function(e,t){var n=e.ELEMENTS;return t.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(He in n){var e=0|n[He];return w.command("number"==typeof e&&e>=0,"invalid vertex count",t.commandStr),st((function(){return e}))}if(He in r){var o=r[He];return ut(o,(function(e,t){var n=e.invoke(t,o);return w.optional((function(){e.assert(t,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(at(i)){if(i)return s?new ot(s.thisDep,s.contextDep,s.propDep,(function(e,t){var n=t.def(e.ELEMENTS,".vertCount-",e.OFFSET);return w.optional((function(){e.assert(t,n+">=0","invalid vertex offset/element buffer too small")})),n})):st((function(e,t){return t.def(e.ELEMENTS,".vertCount")}));var a=st((function(){return-1}));return w.optional((function(){a.MISSING=!0})),a}var u=new ot(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.propDep||s.propDep,(function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,"?",n,".vertCount-",e.OFFSET,":-1"):t.def(n,"?",n,".vertCount:-1")}));return w.optional((function(){u.DYNAMIC=!0})),u}return null}(),instances:o(We,!1),offset:s}}(e,h),E=function(e,t){var n=e.static,r=e.dynamic,o={};return S.forEach((function(e){var a=T(e);function s(t,i){if(e in n){var s=t(n[e]);o[a]=st((function(){return s}))}else if(e in r){var u=r[e];o[a]=ut(u,(function(e,t){return i(e,t,e.invoke(t,u))}))}}switch(e){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return s((function(n){return w.commandType(n,"boolean",e,t.commandStr),n}),(function(t,n,r){return w.optional((function(){t.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+e,t.commandStr)})),r}));case"depth.func":return s((function(n){return w.commandParameter(n,$e,"invalid "+e,t.commandStr),$e[n]}),(function(t,n,r){var i=t.constants.compareFuncs;return w.optional((function(){t.assert(n,r+" in "+i,"invalid "+e+", must be one of "+Object.keys($e))})),n.def(i,"[",r,"]")}));case"depth.range":return s((function(e){return w.command(ee(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&e[0]<=e[1],"depth range is 2d array",t.commandStr),e}),(function(e,t,n){return w.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[t.def("+",n,"[0]"),t.def("+",n,"[1]")]}));case"blend.func":return s((function(e){w.commandType(e,"object","blend.func",t.commandStr);var n="srcRGB"in e?e.srcRGB:e.src,r="srcAlpha"in e?e.srcAlpha:e.src,i="dstRGB"in e?e.dstRGB:e.dst,o="dstAlpha"in e?e.dstAlpha:e.dst;return w.commandParameter(n,Qe,a+".srcRGB",t.commandStr),w.commandParameter(r,Qe,a+".srcAlpha",t.commandStr),w.commandParameter(i,Qe,a+".dstRGB",t.commandStr),w.commandParameter(o,Qe,a+".dstAlpha",t.commandStr),w.command(-1===Je.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",t.commandStr),[Qe[n],Qe[i],Qe[r],Qe[o]]}),(function(t,n,r){var i=t.constants.blendFuncs;function o(o,a){var s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return w.optional((function(){t.assert(n,s+" in "+i,"invalid "+e+"."+o+a+", must be one of "+Object.keys(Qe))})),s}w.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");w.optional((function(){var e=t.constants.invalidBlendCombinations;t.assert(n,e+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case"blend.equation":return s((function(n){return"string"==typeof n?(w.commandParameter(n,m,"invalid "+e,t.commandStr),[m[n],m[n]]):"object"==typeof n?(w.commandParameter(n.rgb,m,e+".rgb",t.commandStr),w.commandParameter(n.alpha,m,e+".alpha",t.commandStr),[m[n.rgb],m[n.alpha]]):void w.commandRaise("invalid blend.equation",t.commandStr)}),(function(t,n,r){var i=t.constants.blendEquations,o=n.def(),a=n.def(),s=t.cond("typeof ",r,'==="string"');return w.optional((function(){function n(e,n,r){t.assert(e,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(m))}n(s.then,e,r),t.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+e),n(s.else,e+".rgb",r+".rgb"),n(s.else,e+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case"blend.color":return s((function(e){return w.command(ee(e)&&4===e.length,"blend.color must be a 4d array",t.commandStr),R(4,(function(t){return+e[t]}))}),(function(e,t,n){return w.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),R(4,(function(e){return t.def("+",n,"[",e,"]")}))}));case"stencil.mask":return s((function(e){return w.commandType(e,"number",a,t.commandStr),0|e}),(function(e,t,n){return w.optional((function(){e.assert(t,"typeof "+n+'==="number"',"invalid stencil.mask")})),t.def(n,"|0")}));case"stencil.func":return s((function(n){w.commandType(n,"object",a,t.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return w.commandParameter(r,$e,e+".cmp",t.commandStr),w.commandType(i,"number",e+".ref",t.commandStr),w.commandType(o,"number",e+".mask",t.commandStr),[$e[r],i,o]}),(function(e,t,n){var r=e.constants.compareFuncs;return w.optional((function(){function i(){e.assert(t,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[t.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",7680),t.def(n,".ref|0"),t.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return s((function(n){w.commandType(n,"object",a,t.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return w.commandParameter(r,et,e+".fail",t.commandStr),w.commandParameter(i,et,e+".zfail",t.commandStr),w.commandParameter(o,et,e+".zpass",t.commandStr),["stencil.opBack"===e?1029:1028,et[r],et[i],et[o]]}),(function(t,n,r){var i=t.constants.stencilOps;function o(o){return w.optional((function(){t.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+e+"."+o+", must be one of "+Object.keys(et))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",7680)}return w.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)})),["stencil.opBack"===e?1029:1028,o("fail"),o("zfail"),o("zpass")]}));case"polygonOffset.offset":return s((function(e){w.commandType(e,"object",a,t.commandStr);var n=0|e.factor,r=0|e.units;return w.commandType(n,"number",a+".factor",t.commandStr),w.commandType(r,"number",a+".units",t.commandStr),[n,r]}),(function(t,n,r){return w.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return s((function(e){var n=0;return"front"===e?n=1028:"back"===e&&(n=1029),w.command(!!n,a,t.commandStr),n}),(function(e,t,n){return w.optional((function(){e.assert(t,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),t.def(n,'==="front"?',1028,":",1029)}));case"lineWidth":return s((function(e){return w.command("number"==typeof e&&e>=i.lineWidthDims[0]&&e<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],t.commandStr),e}),(function(e,t,n){return w.optional((function(){e.assert(t,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return s((function(e){return w.commandParameter(e,nt,a,t.commandStr),nt[e]}),(function(e,t,n){return w.optional((function(){e.assert(t,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),t.def(n+'==="cw"?2304:2305')}));case"colorMask":return s((function(e){return w.command(ee(e)&&4===e.length,"color.mask must be length 4 array",t.commandStr),e.map((function(e){return!!e}))}),(function(e,t,n){return w.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),R(4,(function(e){return"!!"+n+"["+e+"]"}))}));case"sample.coverage":return s((function(e){w.command("object"==typeof e&&e,a,t.commandStr);var n="value"in e?e.value:1,r=!!e.invert;return w.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",t.commandStr),[n,r]}),(function(e,t,n){return w.optional((function(){e.assert(t,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[t.def('"value" in ',n,"?+",n,".value:1"),t.def("!!",n,".invert")]}))}})),o}(e,h),A=function(e,t,r){var i=e.static,o=e.dynamic;function a(e){if(e in i){var t=n.id(i[e]);w.optional((function(){f.shader(tt[e],t,w.guessCommand())}));var r=st((function(){return t}));return r.id=t,r}if(e in o){var a=o[e];return ut(a,(function(t,n){var r=t.invoke(n,a),i=n.def(t.shared.strings,".id(",r,")");return w.optional((function(){n(t.shared.shader,".shader(",tt[e],",",i,",",t.command,");")})),i}))}return null}var s,u=a(Ue),c=a(Be),l=null;return at(u)&&at(c)?(l=f.program(c.id,u.id,null,r),s=st((function(e,t){return e.link(l)}))):s=new ot(u&&u.thisDep||c&&c.thisDep,u&&u.contextDep||c&&c.contextDep,u&&u.propDep||c&&c.propDep,(function(e,t){var n,r=e.shared.shader;n=u?u.append(e,t):t.def(r,".",Ue);var i=r+".program("+(c?c.append(e,t):t.def(r,".",Be))+","+n;return w.optional((function(){i+=","+e.command})),t.def(i+")")})),{frag:u,vert:c,progVar:s,program:l}}(e,0,v);function k(e){var t=_[e];t&&(E[e]=t)}k("viewport"),k(T("scissor.box"));var M=Object.keys(E).length>0,C={framebuffer:b,draw:x,shader:A,state:E,dirty:M,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=function(e){var t,n=e.static,r=e.dynamic;if(ze in n){var i=!!n[ze];(t=st((function(e,t){return i}))).enable=i}else if(ze in r){var o=r[ze];t=ut(o,(function(e,t){return e.invoke(t,o)}))}return t}(e),C.uniforms=function(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach((function(e){var r,o=n[e];if("number"==typeof o||"boolean"==typeof o)r=st((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=st((function(e){return e.link(o)})):"framebuffer"===a||"framebufferCube"===a?(w.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+e+'"',t.commandStr),r=st((function(e){return e.link(o.color[0])}))):w.commandRaise('invalid data for uniform "'+e+'"',t.commandStr)}else ee(o)?r=st((function(t){return t.global.def("[",R(o.length,(function(n){return w.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+e,t.commandStr),o[n]})),"]")})):w.commandRaise('invalid or missing data for uniform "'+e+'"',t.commandStr);r.value=o,i[e]=r})),Object.keys(r).forEach((function(e){var t=r[e];i[e]=ut(t,(function(e,n){return e.invoke(n,t)}))})),i}(s,h),C.drawVAO=C.scopeVAO=function(e,t){var n=e.static,r=e.dynamic;if(qe in n){var i=n[qe];return null!==i&&null===l.getVAO(i)&&(i=l.createVAO(i)),st((function(e){return e.link(l.getVAO(i))}))}if(qe in r){var o=r[qe];return ut(o,(function(e,t){var n=e.invoke(t,o);return t.def(e.shared.vao+".getVAO("+n+")")}))}return null}(e),!C.drawVAO&&A.program&&!v&&r.angle_instanced_arrays){var I=!0,P=A.program.attributes.map((function(e){var n=t.static[e];return I=I&&!!n,n}));if(I&&P.length>0){var O=l.getVAO(l.createVAO(P));C.drawVAO=new ot(null,null,null,(function(e,t){return e.link(O)})),C.useVAO=!0}}return v?C.useVAO=!0:C.attributes=function(e,t){var r=e.static,i=e.dynamic,a={};return Object.keys(r).forEach((function(e){var i=r[e],s=n.id(e),u=new g;if(rt(i))u.state=1,u.buffer=o.getBuffer(o.create(i,34962,!1,!0)),u.type=0;else{var c=o.getBuffer(i);if(c)u.state=1,u.buffer=c,u.type=0;else if(w.command("object"==typeof i&&i,"invalid data for attribute "+e,t.commandStr),"constant"in i){var l=i.constant;u.buffer="null",u.state=2,"number"==typeof l?u.x=l:(w.command(ee(l)&&l.length>0&&l.length<=4,"invalid constant for attribute "+e,t.commandStr),je.forEach((function(e,t){t<l.length&&(u[e]=l[t])})))}else{c=rt(i.buffer)?o.getBuffer(o.create(i.buffer,34962,!1,!0)):o.getBuffer(i.buffer),w.command(!!c,'missing buffer for attribute "'+e+'"',t.commandStr);var f=0|i.offset;w.command(f>=0,'invalid offset for attribute "'+e+'"',t.commandStr);var h=0|i.stride;w.command(h>=0&&h<256,'invalid stride for attribute "'+e+'", must be integer betweeen [0, 255]',t.commandStr);var d=0|i.size;w.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+e+'", must be 1,2,3,4',t.commandStr);var p=!!i.normalized,v=0;"type"in i&&(w.commandParameter(i.type,V,"invalid type for attribute "+e,t.commandStr),v=V[i.type]);var m=0|i.divisor;"divisor"in i&&(w.command(0===m||y,'cannot specify divisor for attribute "'+e+'", instancing not supported',t.commandStr),w.command(m>=0,'invalid divisor for attribute "'+e+'"',t.commandStr)),w.optional((function(){var n=t.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(t){w.command(r.indexOf(t)>=0,'unknown parameter "'+t+'" for attribute pointer "'+e+'" (valid parameters are '+r+")",n)}))})),u.buffer=c,u.state=1,u.size=d,u.normalized=p,u.type=v||c.dtype,u.offset=f,u.stride=h,u.divisor=m}}a[e]=st((function(e,t){var n=e.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(u).forEach((function(e){r[e]=u[e]})),u.buffer&&(r.buffer=e.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r}))})),Object.keys(i).forEach((function(e){var t=i[e];a[e]=ut(t,(function(n,r){var i=n.invoke(r,t),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;w.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+e+'"')}));var c={isStream:r.def(!1)},l=new g;l.state=1,Object.keys(l).forEach((function(e){c[e]=r.def(""+l[e])}));var f=c.buffer,h=c.type;function d(e){r(c[e],"=",i,".",e,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",f,"=",u,".createStream(",34962,",",i,");",h,"=",f,".dtype;","}else{",f,"=",u,".getBuffer(",i,");","if(",f,"){",h,"=",f,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[je[0]],"=",i,".constant;",je.slice(1).map((function(e){return c[e]})).join("="),"=0;","}else{",je.map((function(e,t){return c[e]+"="+i+".constant.length>"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",f,"=",u,".createStream(",34962,",",i,".buffer);","}else{",f,"=",u,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",f,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",u,".destroyStream(",f,");","}"),c}))})),a}(t,h),C.context=function(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach((function(e){var n=t[e];r[e]=st((function(e,t){return"number"==typeof n||"boolean"==typeof n?""+n:e.link(n)}))})),Object.keys(n).forEach((function(e){var t=n[e];r[e]=ut(t,(function(e,n){return e.invoke(n,t)}))})),r}(c),C}function D(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach((function(o){t.save(r,"."+o);var a=n[o].append(e,t);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),t(i)}function j(e,t,n,r){var i,o=e.shared,a=o.gl,s=o.framebuffer;b&&(i=t.def(o.extensions,".webgl_draw_buffers"));var u,c=e.constants,l=c.drawBuffer,f=c.backBuffer;u=n?n.append(e,t):t.def(s,".next"),r||t("if(",u,"!==",s,".cur){"),t("if(",u,"){",a,".bindFramebuffer(",36160,",",u,".framebuffer);"),b&&t(i,".drawBuffersWEBGL(",l,"[",u,".colorAttachments.length]);"),t("}else{",a,".bindFramebuffer(",36160,",null);"),b&&t(i,".drawBuffersWEBGL(",f,");"),t("}",s,".cur=",u,";"),r||t("}")}function z(e,t,n){var r=e.shared,i=r.gl,o=e.current,a=e.next,s=r.current,u=r.next,c=e.cond(s,".dirty");S.forEach((function(t){var r,l,f=T(t);if(!(f in n.state))if(f in a){r=a[f],l=o[f];var h=R(_[f].length,(function(e){return c.def(r,"[",e,"]")}));c(e.cond(h.map((function(e,t){return e+"!=="+l+"["+t+"]"})).join("||")).then(i,".",A[f],"(",h,");",h.map((function(e,t){return l+"["+t+"]="+e})).join(";"),";"))}else{r=c.def(u,".",f);var d=e.cond(r,"!==",s,".",f);c(d),f in E?d(e.cond(r).then(i,".enable(",E[f],");").else(i,".disable(",E[f],");"),s,".",f,"=",r,";"):d(i,".",A[f],"(",r,");",s,".",f,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),t(c)}function F(e,t,n,r){var i=e.shared,o=e.current,a=i.current,s=i.gl;it(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(e,t);if(E[i]){var l=E[i];at(u)?t(s,c?".enable(":".disable(",l,");"):t(e.cond(c).then(s,".enable(",l,");").else(s,".disable(",l,");")),t(a,".",i,"=",c,";")}else if(ee(c)){var f=o[i];t(s,".",A[i],"(",c,");",c.map((function(e,t){return f+"["+t+"]="+e})).join(";"),";")}else t(s,".",A[i],"(",c,");",a,".",i,"=",c,";")}}))}function B(e,t){y&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function U(e,t,n,r,i){var o,a,s,u=e.shared,c=e.stats,l=u.current,f=u.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function v(e){e(o=t.def(),"=",d(),";"),"string"==typeof i?e(c,".count+=",i,";"):e(c,".count++;"),p&&(r?e(a=t.def(),"=",f,".getNumPendingQueries();"):e(f,".beginQuery(",c,");"))}function g(e){e(c,".cpuTime+=",d(),"-",o,";"),p&&(r?e(f,".pushScopeStats(",a,",",f,".getNumPendingQueries(),",c,");"):e(f,".endQuery();"))}function m(e){var n=t.def(l,".profile");t(l,".profile=",e,";"),t.exit(l,".profile=",n,";")}if(h){if(at(h))return void(h.enable?(v(t),g(t.exit),m("true")):m("false"));m(s=h.append(e,t))}else s=t.def(l,".profile");var y=e.block();v(y),t("if(",s,"){",y,"}");var b=e.block();g(b),t.exit("if(",s,"){",b,"}")}function G(e,t,n,r,i){var o=e.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(e,t)}else{if(!i(ct))return;var c=e.scopeAttrib(s);w.optional((function(){e.assert(t,c+".state","missing attribute "+s)})),a={},Object.keys(new g).forEach((function(e){a[e]=t.def(c,".",e)}))}!function(n,r,i){var a=o.gl,s=t.def(n,".location"),u=t.def(o.attributes,"[",s,"]"),c=i.state,l=i.buffer,f=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){t("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?t.def(i.size,"||",r):r,t("if(",u,".type!==",o,"||",u,".size!==",n,"||",h.map((function(e){return u+"."+e+"!=="+i[e]})).join("||"),"){",a,".bindBuffer(",34962,",",l,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",h.map((function(e){return u+"."+e+"="+i[e]+";"})).join(""),"}"),y){var c=i.divisor;t("if(",u,".divisor!==",c,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,c],");",u,".divisor=",c,";}")}}function p(){t("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",je.map((function(e,t){return u+"."+e+"!=="+f[t]})).join("||"),"){",a,".vertexAttrib4f(",s,",",f,");",je.map((function(e,t){return u+"."+e+"="+f[t]+";"})).join(""),"}")}1===c?d():2===c?p():(t("if(",c,"===",1,"){"),d(),t("}else{"),p(),t("}"))}(e.link(r),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function H(e,t,r,i,o){for(var a,s=e.shared,u=s.gl,c=0;c<i.length;++c){var l,f=i[c],h=f.name,d=f.info.type,p=r.uniforms[h],v=e.link(f)+".location";if(p){if(!o(p))continue;if(at(p)){var g=p.value;if(w.command(null!=g,'missing uniform "'+h+'"',e.commandStr),35678===d||35680===d){w.command("function"==typeof g&&(35678===d&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||35680===d&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+h,e.commandStr);var m=e.link(g._texture||g.color[0]._texture);t(u,".uniform1i(",v,",",m+".bind());"),t.exit(m,".unbind();")}else if(35674===d||35675===d||35676===d){w.optional((function(){w.command(ee(g),"invalid matrix for uniform "+h,e.commandStr),w.command(35674===d&&4===g.length||35675===d&&9===g.length||35676===d&&16===g.length,"invalid length for matrix uniform "+h,e.commandStr)}));var y=e.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),b=2;35675===d?b=3:35676===d&&(b=4),t(u,".uniformMatrix",b,"fv(",v,",false,",y,");")}else{switch(d){case 5126:w.commandType(g,"number","uniform "+h,e.commandStr),a="1f";break;case 35664:w.command(ee(g)&&2===g.length,"uniform "+h,e.commandStr),a="2f";break;case 35665:w.command(ee(g)&&3===g.length,"uniform "+h,e.commandStr),a="3f";break;case 35666:w.command(ee(g)&&4===g.length,"uniform "+h,e.commandStr),a="4f";break;case 35670:w.commandType(g,"boolean","uniform "+h,e.commandStr),a="1i";break;case 5124:w.commandType(g,"number","uniform "+h,e.commandStr),a="1i";break;case 35671:case 35667:w.command(ee(g)&&2===g.length,"uniform "+h,e.commandStr),a="2i";break;case 35672:case 35668:w.command(ee(g)&&3===g.length,"uniform "+h,e.commandStr),a="3i";break;case 35673:case 35669:w.command(ee(g)&&4===g.length,"uniform "+h,e.commandStr),a="4i"}t(u,".uniform",a,"(",v,",",ee(g)?Array.prototype.slice.call(g):g,");")}continue}l=p.append(e,t)}else{if(!o(ct))continue;l=t.def(s.uniforms,"[",n.id(h),"]")}35678===d?(w(!Array.isArray(l),"must specify a scalar prop for textures"),t("if(",l,"&&",l,'._reglType==="framebuffer"){',l,"=",l,".color[0];","}")):35680===d&&(w(!Array.isArray(l),"must specify a scalar prop for cube maps"),t("if(",l,"&&",l,'._reglType==="framebufferCube"){',l,"=",l,".color[0];","}")),w.optional((function(){function n(n,r){e.assert(t,n,'bad data or missing for uniform "'+h+'". '+r)}function r(e){w(!Array.isArray(l),"must not specify an array type for uniform"),n("typeof "+l+'==="'+e+'"',"invalid type, expected "+e)}function i(t,r){Array.isArray(l)?w(l.length===t,"must have length "+t):n(s.isArrayLike+"("+l+")&&"+l+".length==="+t,"invalid vector, should have length "+t,e.commandStr)}function o(t){w(!Array.isArray(l),"must not specify a value type"),n("typeof "+l+'==="function"&&'+l+'._reglType==="texture'+(3553===t?"2d":"Cube")+'"',"invalid texture type",e.commandStr)}switch(d){case 5124:r("number");break;case 35667:i(2);break;case 35668:i(3);break;case 35669:i(4);break;case 5126:r("number");break;case 35664:i(2);break;case 35665:i(3);break;case 35666:i(4);break;case 35670:r("boolean");break;case 35671:i(2);break;case 35672:i(3);break;case 35673:case 35674:i(4);break;case 35675:i(9);break;case 35676:i(16);break;case 35678:o(3553);break;case 35680:o(34067)}}));var _=1;switch(d){case 35678:case 35680:var x=t.def(l,"._texture");t(u,".uniform1i(",v,",",x,".bind());"),t.exit(x,".unbind();");continue;case 5124:case 35670:a="1i";break;case 35667:case 35671:a="2i",_=2;break;case 35668:case 35672:a="3i",_=3;break;case 35669:case 35673:a="4i",_=4;break;case 5126:a="1f";break;case 35664:a="2f",_=2;break;case 35665:a="3f",_=3;break;case 35666:a="4f",_=4;break;case 35674:a="Matrix2fv";break;case 35675:a="Matrix3fv";break;case 35676:a="Matrix4fv"}if(t(u,".uniform",a,"(",v,","),"M"===a.charAt(0)){var S=Math.pow(d-35674+2,2),E=e.global.def("new Float32Array(",S,")");Array.isArray(l)?t("false,(",R(S,(function(e){return E+"["+e+"]="+l[e]})),",",E,")"):t("false,(Array.isArray(",l,")||",l," instanceof Float32Array)?",l,":(",R(S,(function(e){return E+"["+e+"]="+l+"["+e+"]"})),",",E,")")}else _>1?t(R(_,(function(e){return Array.isArray(l)?l[e]:l+"["+e+"]"}))):(w(!Array.isArray(l),"uniform value must not be an array"),t(l));t(");")}}function Z(e,t,n,r){var i=e.shared,o=i.gl,a=i.draw,s=r.draw,u=function(){var i,u=s.elements,c=t;return u?((u.contextDep&&r.contextDynamic||u.propDep)&&(c=n),i=u.append(e,c)):i=c.def(a,".",Ve),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(e,n):o.append(e,t):t.def(a,".",i)}var l,f,h=c(Ge),d=c(Ze),p=function(){var i,o=s.count,u=t;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(e,u),w.optional((function(){o.MISSING&&e.assert(t,"false","missing vertex count"),o.DYNAMIC&&e.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",He),w.optional((function(){e.assert(u,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");y&&(l=c(We),f=e.instancing);var v=u+".type",g=s.elements&&at(s.elements);function m(){function e(){n(f,".drawElementsInstancedANGLE(",[h,p,v,d+"<<(("+v+"-5121)>>1)",l],");")}function t(){n(f,".drawArraysInstancedANGLE(",[h,d,p,l],");")}u?g?e():(n("if(",u,"){"),e(),n("}else{"),t(),n("}")):t()}function b(){function e(){n(o+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function t(){n(o+".drawArrays("+[h,d,p]+");")}u?g?e():(n("if(",u,"){"),e(),n("}else{"),t(),n("}")):t()}y&&("number"!=typeof l||l>=0)?"string"==typeof l?(n("if(",l,">0){"),m(),n("}else if(",l,"<0){"),b(),n("}")):m():b()}function W(e,t,n,r,i){var o=L(),a=o.proc("body",i);return w.optional((function(){o.commandStr=t.commandStr,o.command=o.link(t.commandStr)})),y&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),e(o,a,n,r),o.compile().body}function q(e,t,n,r){B(e,t),n.useVAO?n.drawVAO?t(e.shared.vao,".setVAO(",n.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),G(e,t,n,r.attributes,(function(){return!0}))),H(e,t,n,r.uniforms,(function(){return!0})),Z(e,t,t,n)}function X(e,t,n,r){function i(){return!0}e.batchId="a1",B(e,t),G(e,t,n,r.attributes,i),H(e,t,n,r.uniforms,i),Z(e,t,t,n)}function Y(e,t,n,r){B(e,t);var i=n.contextDep,o=t.def(),a=t.def();e.shared.props=a,e.batchId=o;var s=e.scope(),u=e.scope();function c(e){return e.contextDep&&i||e.propDep}function l(e){return!c(e)}if(t(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&D(e,u,n.context),n.needsFramebuffer&&j(e,u,n.framebuffer),F(e,u,n.state,c),n.profile&&c(n.profile)&&U(e,u,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?u(e.shared.vao,".setVAO(",n.drawVAO.append(e,u),");"):s(e.shared.vao,".setVAO(",n.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),G(e,s,n,r.attributes,l),G(e,u,n,r.attributes,c)),H(e,s,n,r.uniforms,l),H(e,u,n,r.uniforms,c),Z(e,s,u,n);else{var f=e.global.def("{}"),h=n.shader.progVar.append(e,u),d=u.def(h,".id"),p=u.def(f,"[",d,"]");u(e.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",f,"[",d,"]=",e.link((function(t){return W(X,e,n,t,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function Q(e,t,n){var r=t.static[n];if(r&&function(e){if("object"==typeof e&&!ee(e)){for(var t=Object.keys(e),n=0;n<t.length;++n)if(k.isDynamic(e[t[n]]))return!0;return!1}}(r)){var i=e.global,o=Object.keys(r),a=!1,s=!1,u=!1,c=e.global.def("{}");o.forEach((function(t){var n=r[t];if(k.isDynamic(n)){"function"==typeof n&&(n=r[t]=k.unbox(n));var o=ut(n,null);a=a||o.thisDep,u=u||o.propDep,s=s||o.contextDep}else{switch(i(c,".",t,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(e.link(n))}i(";")}})),t.dynamic[n]=new k.DynamicVariable(4,{thisDep:a,contextDep:s,propDep:u,ref:c,append:function(e,t){o.forEach((function(n){var i=r[n];if(k.isDynamic(i)){var o=e.invoke(t,i);t(c,".",n,"=",o,";")}}))}}),delete t.static[n]}}return{next:x,current:_,procs:function(){var e=L(),t=e.proc("poll"),n=e.proc("refresh"),o=e.block();t(o),n(o);var a,s=e.shared,u=s.gl,c=s.next,l=s.current;o(l,".dirty=false;"),j(e,t),j(e,n,null,!0),y&&(a=e.link(y)),r.oes_vertex_array_object&&n(e.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var f=0;f<i.maxAttributes;++f){var h=n.def(s.attributes,"[",f,"]"),d=e.cond(h,".buffer");d.then(u,".enableVertexAttribArray(",f,");",u,".bindBuffer(",34962,",",h,".buffer.buffer);",u,".vertexAttribPointer(",f,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(u,".disableVertexAttribArray(",f,");",u,".vertexAttrib4f(",f,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(d),y&&n(a,".vertexAttribDivisorANGLE(",f,",",h,".divisor);")}return n(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(E).forEach((function(r){var i=E[r],a=o.def(c,".",r),s=e.block();s("if(",a,"){",u,".enable(",i,")}else{",u,".disable(",i,")}",l,".",r,"=",a,";"),n(s),t("if(",a,"!==",l,".",r,"){",s,"}")})),Object.keys(A).forEach((function(r){var i,a,s=A[r],f=_[r],h=e.block();if(h(u,".",s,"("),ee(f)){var d=f.length;i=e.global.def(c,".",r),a=e.global.def(l,".",r),h(R(d,(function(e){return i+"["+e+"]"})),");",R(d,(function(e){return a+"["+e+"]="+i+"["+e+"];"})).join("")),t("if(",R(d,(function(e){return i+"["+e+"]!=="+a+"["+e+"]"})).join("||"),"){",h,"}")}else i=o.def(c,".",r),a=o.def(l,".",r),h(i,");",l,".",r,"=",i,";"),t("if(",i,"!==",a,"){",h,"}");n(h)})),e.compile()}(),compile:function(e,r,i,o,a){var s=L();s.stats=s.link(a),Object.keys(r.static).forEach((function(e){Q(s,r,e)})),Ke.forEach((function(t){Q(s,e,t)}));var u=N(e,r,i,o,s);return function(e,t){var n=e.proc("draw",1);B(e,n),D(e,n,t.context),j(e,n,t.framebuffer),z(e,n,t),F(e,n,t.state),U(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,".useProgram(",r,".program);"),t.shader.program)q(e,n,t,t.shader.program);else{n(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(e.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",e.link((function(n){return W(q,e,t,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(t.state).length>0&&n(e.shared.current,".dirty=true;")}(s,u),function(e,t){var r=e.proc("scope",3);e.batchId="a2";var i=e.shared,o=i.current;function a(n){var o=t.shader[n];o&&r.set(i.shader,"."+n,o.append(e,r))}D(e,r,t.context),t.framebuffer&&t.framebuffer.append(e,r),it(Object.keys(t.state)).forEach((function(n){var o=t.state[n].append(e,r);ee(o)?o.forEach((function(t,i){r.set(e.next[n],"["+i+"]",t)})):r.set(i.next,"."+n,o)})),U(e,r,t,!0,!0),[Ve,Ze,He,We,Ge].forEach((function(n){var o=t.draw[n];o&&r.set(i.draw,"."+n,""+o.append(e,r))})),Object.keys(t.uniforms).forEach((function(o){var a=t.uniforms[o].append(e,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(t.attributes).forEach((function(n){var i=t.attributes[n].append(e,r),o=e.scopeAttrib(n);Object.keys(new g).forEach((function(e){r.set(o,"."+e,i[e])}))})),t.scopeVAO&&r.set(i.vao,".targetVAO",t.scopeVAO.append(e,r)),a(Be),a(Ue),Object.keys(t.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",e.shared.context,",a0,",e.batchId,");")}(s,u),function(e,t){var n=e.proc("batch",2);e.batchId="0",B(e,n);var r=!1,i=!0;Object.keys(t.context).forEach((function(e){r=r||t.context[e].propDep})),r||(D(e,n,t.context),i=!1);var o=t.framebuffer,a=!1;function s(e){return e.contextDep&&r||e.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||j(e,n,o)):j(e,n,null),t.state.viewport&&t.state.viewport.propDep&&(r=!0),z(e,n,t),F(e,n,t.state,(function(e){return!s(e)})),t.profile&&s(t.profile)||U(e,n,t,!1,"a1"),t.contextDep=r,t.needsContext=i,t.needsFramebuffer=a;var u=t.shader.progVar;if(u.contextDep&&r||u.propDep)Y(e,n,t,null);else{var c=u.append(e,n);if(n(e.shared.gl,".useProgram(",c,".program);"),t.shader.program)Y(e,n,t,t.shader.program);else{n(e.shared.vao,".setVAO(null);");var l=e.global.def("{}"),f=n.def(c,".id"),h=n.def(l,"[",f,"]");n(e.cond(h).then(h,".call(this,a0,a1);").else(h,"=",l,"[",f,"]=",e.link((function(n){return W(Y,e,t,n,2)})),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&n(e.shared.current,".dirty=true;")}(s,u),t(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var ft=function(e,t){if(!t.ext_disjoint_timer_query)return null;var n=[];function r(e){n.push(e)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(e){a.push(e)}var u=[];function c(e,t,n){var r=a.pop()||new o;r.startQueryIndex=e,r.endQueryIndex=t,r.sum=0,r.stats=n,u.push(r)}var l=[],f=[];return{beginQuery:function(e){var r=n.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var e,n,o=i.length;if(0!==o){f.length=Math.max(f.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,f[0]=0;var a=0;for(e=0,n=0;n<i.length;++n){var c=i[n];t.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=t.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[e++]=c,l[n+1]=a,f[n+1]=e}for(i.length=e,e=0,n=0;n<u.length;++n){var h=u[n],d=h.startQueryIndex,p=h.endQueryIndex;h.sum+=l[p]-l[d];var v=f[d],g=f[p];g===v?(h.stats.gpuTime+=h.sum/1e6,s(h)):(h.startQueryIndex=v,h.endQueryIndex=g,u[e++]=h)}u.length=e}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var e=0;e<n.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(n[e]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}};function ht(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}return function(n){var r=O(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),s=function(e,t){var n={};function r(t){w.type(t,"string","extension name must be string");var r,i=t.toLowerCase();try{r=n[i]=e.getExtension(i)}catch(e){}return!!r}for(var i=0;i<t.extensions.length;++i){var o=t.extensions[i];if(!r(o))return t.onDestroy(),t.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(e){if(n[e]&&!r(e))throw new Error("(regl): error restoring extension "+e)}))}}}(i,r);if(!s)return null;var u,c,l=(u={"":0},c=[""],{id:function(e){var t=u[e];return t||(t=u[e]=c.length,c.push(e),t)},str:function(e){return c[e]}}),f={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},h=s.extensions,d=ft(0,h),p=C(),v=i.drawingBufferWidth,g=i.drawingBufferHeight,m={tick:0,time:0,viewportWidth:v,viewportHeight:g,framebufferWidth:v,framebufferHeight:g,drawingBufferWidth:v,drawingBufferHeight:g,pixelRatio:r.pixelRatio},y=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(34047));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(34852),i=e.getParameter(36063));var o=!!t.oes_texture_float;if(o){var a=e.createTexture();e.bindTexture(3553,a),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var s=e.createFramebuffer();if(e.bindFramebuffer(36160,s),e.framebufferTexture2D(36160,36064,3553,a,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))o=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var u=D.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,u),e.getError()?o=!1:(e.deleteFramebuffer(s),e.deleteTexture(a),o=1===u[0]),D.freeType(u)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var l=e.createTexture(),f=D.allocType(5121,36);e.activeTexture(33984),e.bindTexture(34067,l),e.texImage2D(34069,0,6408,3,3,0,6408,5121,f),D.freeType(f),e.bindTexture(34067,null),e.deleteTexture(l),c=!e.getError()}return{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,h),b=function(t,n,r,i){var o=0,a={};function s(e){this.id=o++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}s.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},s.prototype.destroy=function(){f(this)};var u=[];function c(e,n,r){e.byteLength=n.byteLength,t.bufferData(e.type,n,r)}function l(t,n,r,i,o,a){var s,u;if(t.usage=r,Array.isArray(n)){if(t.dtype=i||5126,n.length>0)if(Array.isArray(n[0])){s=Z(n);for(var l=1,f=1;f<s.length;++f)l*=s[f];t.dimension=l,c(t,u=H(n,s,t.dtype),r),a?t.persistentData=u:D.freeType(u)}else if("number"==typeof n[0]){t.dimension=o;var h=D.allocType(t.dtype,n.length);X(h,n),c(t,h,r),a?t.persistentData=h:D.freeType(h)}else e(n[0])?(t.dimension=n[0].length,t.dtype=i||q(n[0])||5126,c(t,u=H(n,[n.length,n[0].length],t.dtype),r),a?t.persistentData=u:D.freeType(u)):w.raise("invalid buffer data")}else if(e(n))t.dtype=i||q(n),t.dimension=o,c(t,n,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(j(n)){s=n.shape;var d=n.stride,p=n.offset,v=0,g=0,m=0,y=0;1===s.length?(v=s[0],g=1,m=d[0],y=0):2===s.length?(v=s[0],g=s[1],m=d[0],y=d[1]):w.raise("invalid shape"),t.dtype=i||q(n.data)||5126,t.dimension=g;var b=D.allocType(t.dtype,v*g);Y(b,n.data,v,g,m,y,p),c(t,b,r),a?t.persistentData=b:D.freeType(b)}else n instanceof ArrayBuffer?(t.dtype=5121,t.dimension=o,c(t,n,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(n)))):w.raise("invalid buffer data")}function f(e){n.bufferCount--,i(e);var r=e.buffer;w(r,"buffer must not be deleted already"),t.deleteBuffer(r),e.buffer=null,delete a[e.id]}return r.profile&&(n.getTotalBufferSize=function(){var e=0;return Object.keys(a).forEach((function(t){e+=a[t].stats.size})),e}),{create:function(i,o,u,c){n.bufferCount++;var h=new s(o);function d(n){var i=35044,o=null,a=0,s=0,u=1;return Array.isArray(n)||e(n)||j(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(w.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(w(null===o||Array.isArray(o)||e(o)||j(o),"invalid data for buffer"),o=n.data),"usage"in n&&(w.parameter(n.usage,G,"invalid buffer usage"),i=G[n.usage]),"type"in n&&(w.parameter(n.type,V,"invalid buffer type"),s=V[n.type]),"dimension"in n&&(w.type(n.dimension,"number","invalid dimension"),u=0|n.dimension),"length"in n&&(w.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),h.bind(),o?l(h,o,i,s,u,c):(a&&t.bufferData(h.type,a,i),h.dtype=s||5121,h.usage=i,h.dimension=u,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*W[h.dtype]),d}function p(e,n){w(n+e.byteLength<=h.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+e.byteLength+" starting from offset "+n+" to a buffer of size "+h.byteLength),t.bufferSubData(h.type,n,e)}return a[h.id]=h,u||d(i),d._reglType="buffer",d._buffer=h,d.subdata=function(t,n){var r,i=0|(n||0);if(h.bind(),e(t)||t instanceof ArrayBuffer)p(t,i);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var o=D.allocType(h.dtype,t.length);X(o,t),p(o,i),D.freeType(o)}else if(Array.isArray(t[0])||e(t[0])){r=Z(t);var a=H(t,r,h.dtype);p(a,i),D.freeType(a)}else w.raise("invalid buffer data")}else if(j(t)){r=t.shape;var s=t.stride,u=0,c=0,l=0,f=0;1===r.length?(u=r[0],c=1,l=s[0],f=0):2===r.length?(u=r[0],c=r[1],l=s[0],f=s[1]):w.raise("invalid shape");var v=Array.isArray(t.data)?h.dtype:q(t.data),g=D.allocType(v,u*c);Y(g,t.data,u,c,l,f,t.offset),p(g,i),D.freeType(g)}else w.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){f(h)},d},createStream:function(e,t){var n=u.pop();return n||(n=new s(e)),n.bind(),l(n,t,35040,0,1,!1),n},destroyStream:function(e){u.push(e)},clear:function(){z(a).forEach(f),u.forEach(f)},getBuffer:function(e){return e&&e._buffer instanceof s?e._buffer:null},restore:function(){z(a).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:l}}(i,f,r,(function(e){return _.destroyBuffer(e)})),_=function(t,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),u=0;u<a;++u)s[u]=new Re;var c=0,l={},f={Record:Re,scope:{},state:s,currentVAO:null,targetVAO:null,restore:h()?function(){h()&&z(l).forEach((function(e){e.refresh()}))}:function(){},createVAO:function(t){var r=new p;function s(t){w(Array.isArray(t),"arguments to vertex array constructor must be an array"),w(t.length<a,"too many attributes"),w(t.length>0,"must specify at least one attribute");var i={},u=r.attributes;u.length=t.length;for(var c=0;c<t.length;++c){var l,f=t[c],h=u[c]=new Re,d=f.data||f;Array.isArray(d)||e(d)||j(d)?(r.buffers[c]&&(l=r.buffers[c],e(d)&&l._buffer.byteLength>=d.byteLength?l.subdata(d):(l.destroy(),r.buffers[c]=null)),r.buffers[c]||(l=r.buffers[c]=o.create(f,34962,!1,!0)),h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(f)?(h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(f.buffer)?(h.buffer=o.getBuffer(f.buffer),h.size=0|(+f.size||h.buffer.dimension),h.normalized=!!f.normalized||!1,"type"in f?(w.parameter(f.type,V,"invalid buffer type"),h.type=V[f.type]):h.type=h.buffer.dtype,h.offset=0|(f.offset||0),h.stride=0|(f.stride||0),h.divisor=0|(f.divisor||0),h.state=1,w(h.size>=1&&h.size<=4,"size must be between 1 and 4"),w(h.offset>=0,"invalid offset"),w(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),w(h.divisor>=0,"divisor must be positive"),w(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in f?(w(c>0,"first attribute must not be a constant"),h.x=+f.x||0,h.y=+f.y||0,h.z=+f.z||0,h.w=+f.w||0,h.state=2):w(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),s}return i.vaoCount+=1,s.destroy=function(){for(var e=0;e<r.buffers.length;++e)r.buffers[e]&&r.buffers[e].destroy();r.buffers.length=0,r.destroy()},s._vao=r,s._reglType="vao",s(t)},getVAO:function(e){return"function"==typeof e&&e._vao?e._vao:null},destroyBuffer:function(e){for(var n=0;n<s.length;++n){var r=s[n];r.buffer===e&&(t.disableVertexAttribArray(n),r.buffer=null)}},setVAO:h()?function(e){if(e!==f.currentVAO){var t=h();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),f.currentVAO=e}}:function(e){if(e!==f.currentVAO){if(e)e.bindAttrs();else for(var n=d(),r=0;r<s.length;++r){var i=s[r];i.buffer?(t.enableVertexAttribArray(r),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}f.currentVAO=e}},clear:h()?function(){z(l).forEach((function(e){e.destroy()}))}:function(){}};function h(){return n.oes_vertex_array_object}function d(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var e=h();this.vao=e?e.createVertexArrayOES():null,l[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var e=d(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(t.enableVertexAttribArray(r),t.bindBuffer(34962,i.buffer.buffer),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),e&&i.divisor&&e.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)t.disableVertexAttribArray(o)},p.prototype.refresh=function(){var e=h();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var e=h();this===f.currentVAO&&(f.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}l[this.id]&&(delete l[this.id],i.vaoCount-=1)},f}(i,h,y,f,b),x=function(t,n,r,i){var o={},a=0,s={uint8:5121,uint16:5123};function u(e){this.id=a++,o[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(s.uint32=5125),u.prototype.bind=function(){this.buffer.bind()};var c=[];function l(i,o,a,s,u,c,l){var f;if(i.buffer.bind(),o){var h=l;l||e(o)&&(!j(o)||e(o.data))||(h=n.oes_element_index_uint?5125:5123),r._initBuffer(i.buffer,o,a,h,3)}else t.bufferData(34963,c,a),i.buffer.dtype=f||5121,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(f=l,!l){switch(i.buffer.dtype){case 5121:case 5120:f=5121;break;case 5123:case 5122:f=5123;break;case 5125:case 5124:f=5125;break;default:w.raise("unsupported type for element array")}i.buffer.dtype=f}i.type=f,w(5125!==f||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=u;d<0&&(d=i.buffer.byteLength,5123===f?d>>=1:5125===f&&(d>>=2)),i.vertCount=d;var p=s;if(s<0){p=4;var v=i.buffer.dimension;1===v&&(p=0),2===v&&(p=1),3===v&&(p=4)}i.primType=p}function f(e){i.elementsCount--,w(null!==e.buffer,"must not double destroy elements"),delete o[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(t,n){var o=r.create(null,34963,!0),a=new u(o._buffer);function c(t){if(t)if("number"==typeof t)o(t),a.primType=4,a.vertCount=0|t,a.type=5121;else{var n=null,r=35044,i=-1,u=-1,f=0,h=0;Array.isArray(t)||e(t)||j(t)?n=t:(w.type(t,"object","invalid arguments for elements"),"data"in t&&(n=t.data,w(Array.isArray(n)||e(n)||j(n),"invalid data for element buffer")),"usage"in t&&(w.parameter(t.usage,G,"invalid element buffer usage"),r=G[t.usage]),"primitive"in t&&(w.parameter(t.primitive,K,"invalid element buffer primitive"),i=K[t.primitive]),"count"in t&&(w("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),u=0|t.count),"type"in t&&(w.parameter(t.type,s,"invalid buffer type"),h=s[t.type]),"length"in t?f=0|t.length:(f=u,5123===h||5122===h?f*=2:5125!==h&&5124!==h||(f*=4))),l(a,n,r,i,u,f,h)}else o(),a.primType=4,a.vertCount=0,a.type=5121;return c}return i.elementsCount++,c(t),c._reglType="elements",c._elements=a,c.subdata=function(e,t){return o.subdata(e,t),c},c.destroy=function(){f(a)},c},createStream:function(e){var t=c.pop();return t||(t=new u(r.create(null,34963,!0,!1)._buffer)),l(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){c.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof u?e._elements:null},clear:function(){z(o).forEach(f)}}}(i,h,b,f),S=function(e,n,r,i){var o={},a={};function s(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function u(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id)return void(e[n].location=t.location);e.push(t)}function c(t,r,i){var s=35632===t?o:a,u=s[r];if(!u){var c=n.str(r);u=e.createShader(t),e.shaderSource(u,c),e.compileShader(u),w.shaderError(e,u,c,t,i),s[r]=u}return u}var l={},f=[],h=0;function d(e,t){this.id=h++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(t,r,o){var a,l,f=c(35632,t.fragId),h=c(35633,t.vertId),d=t.program=e.createProgram();if(e.attachShader(d,f),e.attachShader(d,h),o)for(a=0;a<o.length;++a){var p=o[a];e.bindAttribLocation(d,p[0],p[1])}e.linkProgram(d),w.linkError(e,d,n.str(t.fragId),n.str(t.vertId),r);var v=e.getProgramParameter(d,35718);i.profile&&(t.stats.uniformsCount=v);var g=t.uniforms;for(a=0;a<v;++a)if(l=e.getActiveUniform(d,a))if(l.size>1)for(var m=0;m<l.size;++m){var y=l.name.replace("[0]","["+m+"]");u(g,new s(y,n.id(y),e.getUniformLocation(d,y),l))}else u(g,new s(l.name,n.id(l.name),e.getUniformLocation(d,l.name),l));var b=e.getProgramParameter(d,35721);i.profile&&(t.stats.attributesCount=b);var _=t.attributes;for(a=0;a<b;++a)(l=e.getActiveAttrib(d,a))&&u(_,new s(l.name,n.id(l.name),e.getAttribLocation(d,l.name),l))}return i.profile&&(r.getMaxUniformsCount=function(){var e=0;return f.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},r.getMaxAttributesCount=function(){var e=0;return f.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);z(o).forEach(t),o={},z(a).forEach(t),a={},f.forEach((function(t){e.deleteProgram(t.program)})),f.length=0,l={},r.shaderCount=0},program:function(n,i,s,u){w.command(n>=0,"missing vertex shader",s),w.command(i>=0,"missing fragment shader",s);var c=l[i];c||(c=l[i]={});var h=c[n];if(h&&(h.refCount++,!u))return h;var v=new d(i,n);return r.shaderCount++,p(v,s,u),h||(c[n]=v),f.push(v),t(v,{destroy:function(){if(v.refCount--,v.refCount<=0){e.deleteProgram(v.program);var t=f.indexOf(v);f.splice(t,1),r.shaderCount--}c[v.vertId].refCount<=0&&(e.deleteShader(a[v.vertId]),delete a[v.vertId],delete l[v.fragId][v.vertId]),Object.keys(l[v.fragId]).length||(e.deleteShader(o[v.fragId]),delete o[v.fragId],delete l[v.fragId])}})},restore:function(){o={},a={};for(var e=0;e<f.length;++e)p(f[e],null,f[e].attributes.map((function(e){return[e.location,e.name]})))},shader:c,frag:-1,vert:-1}}(i,l,f,r),E=Ae(i,h,y,(function(){I.procs.poll()}),m,f,r),A=function(e,t,n,r,i){var o={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(o.srgba=35907),t.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),t.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(e){var t=o[e];a[t]=e}));var s=0,u={};function c(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function l(t){var n=t.renderbuffer;w(n,"must not double destroy renderbuffer"),e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete u[t.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&l(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(u).forEach((function(t){e+=u[t].stats.size})),e}),{create:function(t,s){var l=new c(e.createRenderbuffer());function f(t,r){var s=0,u=0,c=32854;if("object"==typeof t&&t){var h=t;if("shape"in h){var d=h.shape;w(Array.isArray(d)&&d.length>=2,"invalid renderbuffer shape"),s=0|d[0],u=0|d[1]}else"radius"in h&&(s=u=0|h.radius),"width"in h&&(s=0|h.width),"height"in h&&(u=0|h.height);"format"in h&&(w.parameter(h.format,o,"invalid renderbuffer format"),c=o[h.format])}else"number"==typeof t?(s=0|t,u="number"==typeof r?0|r:s):t?w.raise("invalid arguments to renderbuffer constructor"):s=u=1;if(w(s>0&&u>0&&s<=n.maxRenderbufferSize&&u<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==l.width||u!==l.height||c!==l.format)return f.width=l.width=s,f.height=l.height=u,l.format=c,e.bindRenderbuffer(36161,l.renderbuffer),e.renderbufferStorage(36161,c,s,u),w(0===e.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=ke(l.format,l.width,l.height)),f.format=a[l.format],f}return u[l.id]=l,r.renderbufferCount++,f(t,s),f.resize=function(t,r){var o=0|t,a=0|r||o;return o===l.width&&a===l.height||(w(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),f.width=l.width=o,f.height=l.height=a,e.bindRenderbuffer(36161,l.renderbuffer),e.renderbufferStorage(36161,l.format,o,a),w(0===e.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=ke(l.format,l.width,l.height))),f},f._reglType="renderbuffer",f._renderbuffer=l,i.profile&&(f.stats=l.stats),f.destroy=function(){l.decRef()},f},clear:function(){z(u).forEach(l)},restore:function(){z(u).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}}(i,h,y,f,r),T=function(e,n,r,i,o,a){var s={cur:null,next:null,dirty:!1,setFBO:null},u=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var l=["uint8"];function f(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=0,i=0;t?(r=t.width,i=t.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function h(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function d(e,t,n){if(e)if(e.texture){var r=e.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);w(i===t&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=e.renderbuffer._renderbuffer;w(a.width===t&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(t,n){n&&(n.texture?e.framebufferTexture2D(36160,t,n.target,n.texture._texture.texture,0):e.framebufferRenderbuffer(36160,t,36161,n.renderbuffer._renderbuffer.renderbuffer))}function v(e){var t=3553,n=null,r=null,i=e;"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target)),w.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,w(3553===t)):"textureCube"===o?(n=i,w(t>=34069&&t<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,t=36161):w.raise("invalid regl object for attachment"),new f(t,n,r)}function g(e,t,n,r,a){if(n){var s=i.create2D({width:e,height:t,format:r,type:a});return s._texture.refCount=0,new f(3553,s,null)}var u=o.create({width:e,height:t,format:r});return u._renderbuffer.refCount=0,new f(36161,null,u)}function m(e){return e&&(e.texture||e.renderbuffer)}function y(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n),e.width=t,e.height=n)}n.oes_texture_half_float&&l.push("half float","float16"),n.oes_texture_float&&l.push("float","float32");var b=0,_={};function x(){this.id=b++,_[this.id]=this,this.framebuffer=e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function S(e){e.colorAttachments.forEach(h),h(e.depthAttachment),h(e.stencilAttachment),h(e.depthStencilAttachment)}function E(t){var n=t.framebuffer;w(n,"must not double destroy framebuffer"),e.deleteFramebuffer(n),t.framebuffer=null,a.framebufferCount--,delete _[t.id]}function A(t){var n;e.bindFramebuffer(36160,t.framebuffer);var i=t.colorAttachments;for(n=0;n<i.length;++n)p(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)e.framebufferTexture2D(36160,36064+n,3553,null,0);e.framebufferTexture2D(36160,33306,3553,null,0),e.framebufferTexture2D(36160,36096,3553,null,0),e.framebufferTexture2D(36160,36128,3553,null,0),p(36096,t.depthAttachment),p(36128,t.stencilAttachment),p(33306,t.depthStencilAttachment);var o=e.checkFramebufferStatus(36160);e.isContextLost()||36053===o||w.raise("framebuffer configuration not supported, status = "+Oe[o]),e.bindFramebuffer(36160,s.next?s.next.framebuffer:null),s.cur=s.next,e.getError()}function T(e,i){var o=new x;function f(e,t){var i;w(s.next!==o,"can not update framebuffer which is currently in use");var a=0,h=0,p=!0,y=!0,b=null,_=!0,x="rgba",E="uint8",T=1,k=null,M=null,C=null,I=!1;if("number"==typeof e)a=0|e,h=0|t||a;else if(e){w.type(e,"object","invalid arguments for framebuffer");var P=e;if("shape"in P){var O=P.shape;w(Array.isArray(O)&&O.length>=2,"invalid shape for framebuffer"),a=O[0],h=O[1]}else"radius"in P&&(a=h=P.radius),"width"in P&&(a=P.width),"height"in P&&(h=P.height);("color"in P||"colors"in P)&&(b=P.color||P.colors,Array.isArray(b)&&w(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in P&&(T=0|P.colorCount,w(T>0,"invalid color buffer count")),"colorTexture"in P&&(_=!!P.colorTexture,x="rgba4"),"colorType"in P&&(E=P.colorType,_?(w(n.oes_texture_float||!("float"===E||"float32"===E),"you must enable OES_texture_float in order to use floating point framebuffer objects"),w(n.oes_texture_half_float||!("half float"===E||"float16"===E),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===E||"float16"===E?(w(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==E&&"float32"!==E||(w(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),w.oneOf(E,l,"invalid color type")),"colorFormat"in P&&(x=P.colorFormat,u.indexOf(x)>=0?_=!0:c.indexOf(x)>=0?_=!1:_?w.oneOf(P.colorFormat,u,"invalid color format for texture"):w.oneOf(P.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in P||"depthStencilTexture"in P)&&(I=!(!P.depthTexture&&!P.depthStencilTexture),w(!I||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in P&&("boolean"==typeof P.depth?p=P.depth:(k=P.depth,y=!1)),"stencil"in P&&("boolean"==typeof P.stencil?y=P.stencil:(M=P.stencil,p=!1)),"depthStencil"in P&&("boolean"==typeof P.depthStencil?p=y=P.depthStencil:(C=P.depthStencil,p=!1,y=!1))}else a=h=1;var R=null,L=null,N=null,D=null;if(Array.isArray(b))R=b.map(v);else if(b)R=[v(b)];else for(R=new Array(T),i=0;i<T;++i)R[i]=g(a,h,_,x,E);w(n.webgl_draw_buffers||R.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),w(R.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||R[0].width,h=h||R[0].height,k?L=v(k):p&&!y&&(L=g(a,h,I,"depth","uint32")),M?N=v(M):y&&!p&&(N=g(a,h,!1,"stencil","uint8")),C?D=v(C):!k&&!M&&y&&p&&(D=g(a,h,I,"depth stencil","depth stencil")),w(!!k+!!M+!!C<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var j=null;for(i=0;i<R.length;++i)if(d(R[i],a,h),w(!R[i]||R[i].texture&&Me.indexOf(R[i].texture._texture.format)>=0||R[i].renderbuffer&&Pe.indexOf(R[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),R[i]&&R[i].texture){var z=Ce[R[i].texture._texture.format]*Ie[R[i].texture._texture.type];null===j?j=z:w(j===z,"all color attachments much have the same number of bits per pixel.")}return d(L,a,h),w(!L||L.texture&&6402===L.texture._texture.format||L.renderbuffer&&33189===L.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(N,a,h),w(!N||N.renderbuffer&&36168===N.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),d(D,a,h),w(!D||D.texture&&34041===D.texture._texture.format||D.renderbuffer&&34041===D.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=a,o.height=h,o.colorAttachments=R,o.depthAttachment=L,o.stencilAttachment=N,o.depthStencilAttachment=D,f.color=R.map(m),f.depth=m(L),f.stencil=m(N),f.depthStencil=m(D),f.width=o.width,f.height=o.height,A(o),f}return a.framebufferCount++,f(e,i),t(f,{resize:function(e,t){w(s.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|e,1),r=Math.max(0|t||n,1);if(n===o.width&&r===o.height)return f;for(var i=o.colorAttachments,a=0;a<i.length;++a)y(i[a],n,r);return y(o.depthAttachment,n,r),y(o.stencilAttachment,n,r),y(o.depthStencilAttachment,n,r),o.width=f.width=n,o.height=f.height=r,A(o),f},_reglType:"framebuffer",_framebuffer:o,destroy:function(){E(o),S(o)},use:function(e){s.setFBO({framebuffer:f},e)}})}return t(s,{getFramebuffer:function(e){if("function"==typeof e&&"framebuffer"===e._reglType){var t=e._framebuffer;if(t instanceof x)return t}return null},create:T,createCube:function(e){var o=Array(6);function a(e){var r;w(o.indexOf(s.next)<0,"can not update framebuffer which is currently in use");var c,f={color:null},h=0,d=null,p="rgba",v="uint8",g=1;if("number"==typeof e)h=0|e;else if(e){w.type(e,"object","invalid arguments for framebuffer");var m=e;if("shape"in m){var y=m.shape;w(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),w(y[0]===y[1],"cube framebuffer must be square"),h=y[0]}else"radius"in m&&(h=0|m.radius),"width"in m?(h=0|m.width,"height"in m&&w(m.height===h,"must be square")):"height"in m&&(h=0|m.height);("color"in m||"colors"in m)&&(d=m.color||m.colors,Array.isArray(d)&&w(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in m&&(g=0|m.colorCount,w(g>0,"invalid color buffer count")),"colorType"in m&&(w.oneOf(m.colorType,l,"invalid color type"),v=m.colorType),"colorFormat"in m&&(p=m.colorFormat,w.oneOf(m.colorFormat,u,"invalid color format for texture"))),"depth"in m&&(f.depth=m.depth),"stencil"in m&&(f.stencil=m.stencil),"depthStencil"in m&&(f.depthStencil=m.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(c=[],r=0;r<d.length;++r)c[r]=d[r];else c=[d];else{c=Array(g);var b={radius:h,format:p,type:v};for(r=0;r<g;++r)c[r]=i.createCube(b)}for(f.color=Array(c.length),r=0;r<c.length;++r){var _=c[r];w("function"==typeof _&&"textureCube"===_._reglType,"invalid cube map"),h=h||_.width,w(_.width===h&&_.height===h,"invalid cube map shape"),f.color[r]={target:34069,data:c[r]}}for(r=0;r<6;++r){for(var x=0;x<c.length;++x)f.color[x].target=34069+r;r>0&&(f.depth=o[0].depth,f.stencil=o[0].stencil,f.depthStencil=o[0].depthStencil),o[r]?o[r](f):o[r]=T(f)}return t(a,{width:h,height:h,color:c})}return a(e),t(a,{faces:o,resize:function(e){var t,n=0|e;if(w(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(t=0;t<i.length;++t)i[t].resize(n);for(t=0;t<6;++t)o[t].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(e){e.destroy()}))}})},clear:function(){z(_).forEach(E)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,z(_).forEach((function(t){t.framebuffer=e.createFramebuffer(),A(t)}))}})}(i,h,y,E,A,f),I=lt(i,l,h,y,b,x,0,T,{},_,S,{elements:null,primitive:4,count:-1,offset:0,instances:-1},m,d,r),P=Le(i,T,I.procs.poll,m,o,h,y),R=I.next,L=i.canvas,N=[],F=[],B=[],U=[r.onDestroy],Q=null;function J(){if(0===N.length)return d&&d.update(),void(Q=null);Q=M.next(J),ue();for(var e=N.length-1;e>=0;--e){var t=N[e];t&&t(m,null,0)}i.flush(),d&&d.update()}function $(){!Q&&N.length>0&&(Q=M.next(J))}function ee(){Q&&(M.cancel(J),Q=null)}function te(e){e.preventDefault(),a=!0,ee(),F.forEach((function(e){e()}))}function ne(e){i.getError(),a=!1,s.restore(),S.restore(),b.restore(),E.restore(),A.restore(),T.restore(),_.restore(),d&&d.restore(),I.procs.refresh(),$(),B.forEach((function(e){e()}))}function re(e){function n(e,t){var n={},r={};return Object.keys(e).forEach((function(i){var o=e[i];if(k.isDynamic(o))r[i]=k.unbox(o,i);else{if(t&&Array.isArray(o))for(var a=0;a<o.length;++a)if(k.isDynamic(o[a]))return void(r[i]=k.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}w(!!e,"invalid args to regl({...})"),w.type(e,"object","invalid args to regl({...})");var r=n(e.context||{},!0),i=n(e.uniforms||{},!0),o=n(e.attributes||{},!1),s=n(function(e){var n=t({},e);function r(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach((function(r){n[e+"."+r]=t[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in e&&(n.vao=e.vao),n}(e),!1),u={gpuTime:0,cpuTime:0,count:0},c=I.compile(s,o,i,r,u),l=c.draw,f=c.batch,h=c.scope,d=[];return t((function(e,t){var n;if(a&&w.raise("context lost"),"function"==typeof e)return h.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(n=0;n<e;++n)h.call(this,null,t,n);else{if(!Array.isArray(e))return h.call(this,e,t,0);for(n=0;n<e.length;++n)h.call(this,e[n],t,n)}else if("number"==typeof e){if(e>0)return f.call(this,function(e){for(;d.length<e;)d.push(null);return d}(0|e),0|e)}else{if(!Array.isArray(e))return l.call(this,e);if(e.length)return f.call(this,e,e.length)}}),{stats:u,destroy:function(){c.destroy()}})}L&&(L.addEventListener("webglcontextlost",te,!1),L.addEventListener("webglcontextrestored",ne,!1));var ie=T.setFBO=re({framebuffer:k.define.call(null,1,"framebuffer")});function oe(e,t){var n=0;I.procs.poll();var r=t.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in t&&(i.clearDepth(+t.depth),n|=256),"stencil"in t&&(i.clearStencil(0|t.stencil),n|=1024),w(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function ae(e){return w.type(e,"function","regl.frame() callback must be a function"),N.push(e),$(),{cancel:function(){var t=ht(N,e);w(t>=0,"cannot cancel a frame twice"),N[t]=function e(){var t=ht(N,e);N[t]=N[N.length-1],N.length-=1,N.length<=0&&ee()}}}}function se(){var e=R.viewport,t=R.scissor_box;e[0]=e[1]=t[0]=t[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=e[2]=t[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=e[3]=t[3]=i.drawingBufferHeight}function ue(){m.tick+=1,m.time=le(),se(),I.procs.poll()}function ce(){E.refresh(),se(),I.procs.refresh(),d&&d.update()}function le(){return(C()-p)/1e3}ce();var fe=t(re,{clear:function(e){if(w("object"==typeof e&&e,"regl.clear() takes an object as input"),"framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var n=0;n<6;++n)ie(t({framebuffer:e.framebuffer.faces[n]},e),oe);else ie(e,oe);else oe(0,e)},prop:k.define.bind(null,1),context:k.define.bind(null,2),this:k.define.bind(null,3),draw:re({}),buffer:function(e){return b.create(e,34962,!1,!1)},elements:function(e){return x.create(e,!1)},texture:E.create2D,cube:E.createCube,renderbuffer:A.create,framebuffer:T.create,framebufferCube:T.createCube,vao:_.createVAO,attributes:o,frame:ae,on:function(e,t){var n;switch(w.type(t,"function","listener callback must be a function"),e){case"frame":return ae(t);case"lost":n=F;break;case"restore":n=B;break;case"destroy":n=U;break;default:w.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t)return n[e]=n[n.length-1],void n.pop()}}},limits:y,hasExtension:function(e){return y.extensions.indexOf(e.toLowerCase())>=0},read:P,destroy:function(){N.length=0,ee(),L&&(L.removeEventListener("webglcontextlost",te),L.removeEventListener("webglcontextrestored",ne)),S.clear(),T.clear(),A.clear(),E.clear(),x.clear(),b.clear(),_.clear(),d&&d.clear(),U.forEach((function(e){e()}))},_gl:i,_refresh:ce,poll:function(){ue(),d&&d.update()},now:le,stats:f});return r.onDone(null,fe),fe}}()})),BA=function(){function e(t,n){Wi(this,e),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,s=n.size,u=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:u||0},s&&(this.attribute.size=s)}return Xi(e,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(e){this.buffer.subData(e)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),e}(),UA=(Yi(AA={},e.gl.POINTS,"points"),Yi(AA,e.gl.LINES,"lines"),Yi(AA,e.gl.LINE_LOOP,"line loop"),Yi(AA,e.gl.LINE_STRIP,"line strip"),Yi(AA,e.gl.TRIANGLES,"triangles"),Yi(AA,e.gl.TRIANGLE_FAN,"triangle fan"),Yi(AA,e.gl.TRIANGLE_STRIP,"triangle strip"),AA),VA=(Yi(TA={},e.gl.STATIC_DRAW,"static"),Yi(TA,e.gl.DYNAMIC_DRAW,"dynamic"),Yi(TA,e.gl.STREAM_DRAW,"stream"),TA),GA=(Yi(kA={},e.gl.BYTE,"int8"),Yi(kA,e.gl.UNSIGNED_INT,"int16"),Yi(kA,e.gl.INT,"int32"),Yi(kA,e.gl.UNSIGNED_BYTE,"uint8"),Yi(kA,e.gl.UNSIGNED_SHORT,"uint16"),Yi(kA,e.gl.UNSIGNED_INT,"uint32"),Yi(kA,e.gl.FLOAT,"float"),kA),HA=(Yi(MA={},e.gl.ALPHA,"alpha"),Yi(MA,e.gl.LUMINANCE,"luminance"),Yi(MA,e.gl.LUMINANCE_ALPHA,"luminance alpha"),Yi(MA,e.gl.RGB,"rgb"),Yi(MA,e.gl.RGBA,"rgba"),Yi(MA,e.gl.RGBA4,"rgba4"),Yi(MA,e.gl.RGB5_A1,"rgb5 a1"),Yi(MA,e.gl.RGB565,"rgb565"),Yi(MA,e.gl.DEPTH_COMPONENT,"depth"),Yi(MA,e.gl.DEPTH_STENCIL,"depth stencil"),MA),ZA=(Yi(CA={},e.gl.DONT_CARE,"dont care"),Yi(CA,e.gl.NICEST,"nice"),Yi(CA,e.gl.FASTEST,"fast"),CA),WA=(Yi(IA={},e.gl.NEAREST,"nearest"),Yi(IA,e.gl.LINEAR,"linear"),Yi(IA,e.gl.LINEAR_MIPMAP_LINEAR,"mipmap"),Yi(IA,e.gl.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Yi(IA,e.gl.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Yi(IA,e.gl.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),IA),qA=(Yi(PA={},e.gl.REPEAT,"repeat"),Yi(PA,e.gl.CLAMP_TO_EDGE,"clamp"),Yi(PA,e.gl.MIRRORED_REPEAT,"mirror"),PA),XA=(Yi(OA={},e.gl.NONE,"none"),Yi(OA,e.gl.BROWSER_DEFAULT_WEBGL,"browser"),OA),YA=(Yi(RA={},e.gl.NEVER,"never"),Yi(RA,e.gl.ALWAYS,"always"),Yi(RA,e.gl.LESS,"less"),Yi(RA,e.gl.LEQUAL,"lequal"),Yi(RA,e.gl.GREATER,"greater"),Yi(RA,e.gl.GEQUAL,"gequal"),Yi(RA,e.gl.EQUAL,"equal"),Yi(RA,e.gl.NOTEQUAL,"notequal"),RA),KA=(Yi(LA={},e.gl.FUNC_ADD,"add"),Yi(LA,e.gl.MIN_EXT,"min"),Yi(LA,e.gl.MAX_EXT,"max"),Yi(LA,e.gl.FUNC_SUBTRACT,"subtract"),Yi(LA,e.gl.FUNC_REVERSE_SUBTRACT,"reverse subtract"),LA),QA=(Yi(NA={},e.gl.ZERO,"zero"),Yi(NA,e.gl.ONE,"one"),Yi(NA,e.gl.SRC_COLOR,"src color"),Yi(NA,e.gl.ONE_MINUS_SRC_COLOR,"one minus src color"),Yi(NA,e.gl.SRC_ALPHA,"src alpha"),Yi(NA,e.gl.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Yi(NA,e.gl.DST_COLOR,"dst color"),Yi(NA,e.gl.ONE_MINUS_DST_COLOR,"one minus dst color"),Yi(NA,e.gl.DST_ALPHA,"dst alpha"),Yi(NA,e.gl.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Yi(NA,e.gl.CONSTANT_COLOR,"constant color"),Yi(NA,e.gl.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Yi(NA,e.gl.CONSTANT_ALPHA,"constant alpha"),Yi(NA,e.gl.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Yi(NA,e.gl.SRC_ALPHA_SATURATE,"src alpha saturate"),NA),JA=(Yi(DA={},e.gl.NEVER,"never"),Yi(DA,e.gl.ALWAYS,"always"),Yi(DA,e.gl.LESS,"less"),Yi(DA,e.gl.LEQUAL,"lequal"),Yi(DA,e.gl.GREATER,"greater"),Yi(DA,e.gl.GEQUAL,"gequal"),Yi(DA,e.gl.EQUAL,"equal"),Yi(DA,e.gl.NOTEQUAL,"notequal"),DA),$A=(Yi(jA={},e.gl.ZERO,"zero"),Yi(jA,e.gl.KEEP,"keep"),Yi(jA,e.gl.REPLACE,"replace"),Yi(jA,e.gl.INVERT,"invert"),Yi(jA,e.gl.INCR,"increment"),Yi(jA,e.gl.DECR,"decrement"),Yi(jA,e.gl.INCR_WRAP,"increment wrap"),Yi(jA,e.gl.DECR_WRAP,"decrement wrap"),jA),eT=(Yi(zA={},e.gl.FRONT,"front"),Yi(zA,e.gl.BACK,"back"),zA),tT=function(){function t(n,r){Wi(this,t),this.buffer=void 0;var i=r.data,o=r.usage,a=r.type;this.buffer=n.buffer({data:i,usage:VA[o||e.gl.STATIC_DRAW],type:GA[a||e.gl.UNSIGNED_BYTE]})}return Xi(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(e){var t=e.data,n=e.offset;this.buffer.subdata(t,n)}}]),t}(),nT=function(){function t(n,r){Wi(this,t),this.elements=void 0;var i=r.data,o=r.usage,a=r.type,s=r.count;this.elements=n.elements({data:i,usage:VA[o||e.gl.STATIC_DRAW],type:GA[a||e.gl.UNSIGNED_BYTE],count:s})}return Xi(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(e){var t=e.data;this.elements.subdata(t)}},{key:"destroy",value:function(){}}]),t}(),rT=function(){function e(t,n){Wi(this,e),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,s=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(s.colors=a.map((function(e){return e.get()}))),o&&"boolean"!=typeof o&&(s.color=o.get()),this.framebuffer=t.framebuffer(s)}return Xi(e,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(e){var t=e.width,n=e.height;this.framebuffer.resize(t,n)}}]),e}(),iT=ce.f,oT=function(e){return function(t){for(var n,r=ge(t),i=Dt(r),o=i.length,a=0,s=[];o>a;)n=i[a++],ae&&!iT.call(r,n)||s.push(e?[n,r[n]]:r[n]);return s}},aT={entries:oT(!0),values:oT(!1)}.values;Pt({target:"Object",stat:!0},{values:function(e){return aT(e)}});var sT,uT,cT,lT,fT,hT,dT,pT,vT,gT,mT,yT,bT,_T,xT,wT,ST,ET,AT,TT=function(){function t(n,r){Wi(this,t),this.reGl=void 0,this.destroyed=!1,this.drawCommand=void 0,this.drawParams=void 0,this.options=void 0,this.uniforms={},this.reGl=n;var i=r.vs,o=r.fs,a=r.attributes,s=r.uniforms,u=r.primitive,c=r.count,l=r.elements,f=r.depth,h=r.blend,d=r.stencil,p=r.cull,v=r.instances,g={};this.options=r,s&&(this.uniforms=this.extractUniforms(s),Object.keys(s).forEach((function(e){g[e]=n.prop(e)})));var m={};Object.keys(a).forEach((function(e){m[e]=a[e].get()}));var y={attributes:m,frag:o,uniforms:g,vert:i,primitive:UA[void 0===u?e.gl.TRIANGLES:u]};v&&(y.instances=v),c&&(y.count=c),l&&(y.elements=l.get()),this.initDepthDrawParams({depth:f},y),this.initBlendDrawParams({blend:h},y),this.initStencilDrawParams({stencil:d},y),this.initCullDrawParams({cull:p},y),this.drawCommand=n(y),this.drawParams=y}return Xi(t,[{key:"addUniforms",value:function(e){this.uniforms=Qi(Qi({},this.uniforms),this.extractUniforms(e))}},{key:"draw",value:function(e){if(!this.drawParams.attributes||0!==Object.keys(this.drawParams.attributes).length){var t=Qi(Qi({},this.uniforms),this.extractUniforms(e.uniforms||{})),n={};Object.keys(t).forEach((function(e){var r=Gi(t[e]);"boolean"===r||"number"===r||Array.isArray(t[e])||t[e].BYTES_PER_ELEMENT?n[e]=t[e]:n[e]=t[e].get()})),this.drawCommand(n)}}},{key:"destroy",value:function(){this.drawParams.elements.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach((function(e){e.destroy()})),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(t,n){var r=t.depth;r&&(n.depth={enable:void 0===r.enable||!!r.enable,mask:void 0===r.mask||!!r.mask,func:YA[r.func||e.gl.LESS],range:r.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,n){var r=t.blend;if(r){var i=r.enable,o=r.func,a=r.equation,s=r.color,u=void 0===s?[0,0,0,0]:s;n.blend={enable:!!i,func:{srcRGB:QA[o&&o.srcRGB||e.gl.SRC_ALPHA],srcAlpha:QA[o&&o.srcAlpha||e.gl.SRC_ALPHA],dstRGB:QA[o&&o.dstRGB||e.gl.ONE_MINUS_SRC_ALPHA],dstAlpha:QA[o&&o.dstAlpha||e.gl.ONE_MINUS_SRC_ALPHA]},equation:{rgb:KA[a&&a.rgb||e.gl.FUNC_ADD],alpha:KA[a&&a.alpha||e.gl.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,n){var r=t.stencil;if(r){var i=r.enable,o=r.mask,a=void 0===o?-1:o,s=r.func,u=void 0===s?{cmp:e.gl.ALWAYS,ref:0,mask:-1}:s,c=r.opFront,l=void 0===c?{fail:e.gl.KEEP,zfail:e.gl.KEEP,zpass:e.gl.KEEP}:c,f=r.opBack,h=void 0===f?{fail:e.gl.KEEP,zfail:e.gl.KEEP,zpass:e.gl.KEEP}:f;n.stencil={enable:!!i,mask:a,func:Qi(Qi({},u),{},{cmp:JA[u.cmp]}),opFront:{fail:$A[l.fail],zfail:$A[l.zfail],zpass:$A[l.zpass]},opBack:{fail:$A[h.fail],zfail:$A[h.zfail],zpass:$A[h.zpass]}}}}},{key:"initCullDrawParams",value:function(t,n){var r=t.cull;if(r){var i=r.enable,o=r.face,a=void 0===o?e.gl.BACK:o;n.cull={enable:!!i,face:eT[a]}}}},{key:"extractUniforms",value:function(e){var t=this,n={};return Object.keys(e).forEach((function(r){t.extractUniformsRecursively(r,e[r],n,"")})),n}},{key:"extractUniformsRecursively",value:function(e,t,n,r){var i=this;null===t||"number"==typeof t||"boolean"==typeof t||Array.isArray(t)&&"number"==typeof t[0]||uy(t)||""===t||"resize"in t?n["".concat(r&&r+".").concat(e)]=t:(ny(t)&&Object.keys(t).forEach((function(o){i.extractUniformsRecursively(o,t[o],n,"".concat(r&&r+".").concat(e))})),Array.isArray(t)&&t.forEach((function(t,o){Object.keys(t).forEach((function(a){i.extractUniformsRecursively(a,t[a],n,"".concat(r&&r+".").concat(e,"[").concat(o,"]"))}))})))}}]),t}(),kT=function(){function t(n,r){Wi(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var i=r.data,o=r.type,a=void 0===o?e.gl.UNSIGNED_BYTE:o,s=r.width,u=r.height,c=r.flipY,l=void 0!==c&&c,f=r.format,h=void 0===f?e.gl.RGBA:f,d=r.mipmap,p=void 0!==d&&d,v=r.wrapS,g=void 0===v?e.gl.CLAMP_TO_EDGE:v,m=r.wrapT,y=void 0===m?e.gl.CLAMP_TO_EDGE:m,b=r.aniso,_=void 0===b?0:b,x=r.alignment,w=void 0===x?1:x,S=r.premultiplyAlpha,E=void 0!==S&&S,A=r.mag,T=void 0===A?e.gl.NEAREST:A,k=r.min,M=void 0===k?e.gl.NEAREST:k,C=r.colorSpace,I=void 0===C?e.gl.BROWSER_DEFAULT_WEBGL:C;this.width=s,this.height=u;var P={width:s,height:u,type:GA[a],format:HA[h],wrapS:qA[g],wrapT:qA[y],mag:WA[T],min:WA[M],alignment:w,flipY:l,colorSpace:XA[I],premultiplyAlpha:E,aniso:_};i&&(P.data=i),"number"==typeof p?P.mipmap=ZA[p]:"boolean"==typeof p&&(P.mipmap=p),this.texture=n.texture(P)}return Xi(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.texture(e)}},{key:"bind",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(e){var t=e.width,n=e.height;this.texture.resize(t,n),this.width=t,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),MT=Q()(sT=function(){function e(){var t=this;Wi(this,e),this.gl=void 0,this.$container=void 0,this.canvas=void 0,this.width=void 0,this.height=void 0,this.isDirty=void 0,this.createModel=function(e){return new TT(t.gl,e)},this.createAttribute=function(e){return new BA(t.gl,e)},this.createBuffer=function(e){return new tT(t.gl,e)},this.createElements=function(e){return new nT(t.gl,e)},this.createTexture2D=function(e){return new kT(t.gl,e)},this.createFramebuffer=function(e){return new rT(t.gl,e)},this.useFramebuffer=function(e,n){t.gl({framebuffer:e?e.get():null})(n)},this.clear=function(e){var n=e.color,r=e.depth,i=e.stencil,o=e.framebuffer,a=void 0===o?null:o,s={color:n,depth:r,stencil:i};s.framebuffer=null===a?a:a.get(),t.gl.clear(s)},this.viewport=function(e){var n=e.x,r=e.y,i=e.width,o=e.height;t.gl._gl.viewport(n,r,i,o),t.width=i,t.height=o,t.gl._refresh()},this.readPixels=function(e){var n=e.framebuffer,r={x:e.x,y:e.y,width:e.width,height:e.height};return n&&(r.framebuffer=n.get()),t.gl.read(r)},this.getViewportSize=function(){return{width:t.gl._gl.drawingBufferWidth,height:t.gl._gl.drawingBufferHeight}},this.getContainer=function(){var e;return null===(e=t.canvas)||void 0===e?void 0:e.parentElement},this.getCanvas=function(){return t.canvas},this.getGLContext=function(){return t.gl._gl},this.destroy=function(){t.gl.destroy()}}var t;return Xi(e,[{key:"init",value:(t=Zi(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.canvas=t,e.next=3,new Promise((function(e,t){FA({canvas:r.canvas,attributes:{alpha:!0,antialias:n.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:n.preserveDrawingBuffer},extensions:["OES_element_index_uint","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(n,r){!n&&r||t(n),e(r)}})}));case 3:this.gl=e.sent;case 4:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"setBaseState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setCustomLayerDefaults",value:function(){var e=this.getGLContext();e.disable(e.CULL_FACE)}},{key:"setDirty",value:function(e){this.isDirty=e}},{key:"getDirty",value:function(){return this.isDirty}}]),e}())||sT,CT=function(){function e(t){Wi(this,e),this.sceneService=void 0,this.mapService=void 0,this.controlService=void 0,this.layerService=void 0,this.iconService=void 0,this.markerService=void 0,this.popupService=void 0,this.fontService=void 0,this.interactionService=void 0,this.container=void 0;var n=t.id,r=t.map,i=HE();this.container=i,r.setContainer(i,n),i.bind(nr.IRendererService).to(MT).inSingletonScope(),this.sceneService=i.get(nr.ISceneService),this.mapService=i.get(nr.IMapService),this.iconService=i.get(nr.IIconService),this.fontService=i.get(nr.IFontService),this.controlService=i.get(nr.IControlService),this.layerService=i.get(nr.ILayerService),this.markerService=i.get(nr.IMarkerService),this.interactionService=i.get(nr.IInteractionService),this.popupService=i.get(nr.IPopupService),this.initComponent(n),this.sceneService.init(t),this.initControl()}return Xi(e,[{key:"getServiceContainer",value:function(){return this.container}},{key:"getSize",value:function(){return this.mapService.getSize()}},{key:"getMinZoom",value:function(){return this.mapService.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.mapService.getMaxZoom()}},{key:"getType",value:function(){return this.mapService.getType()}},{key:"getMapContainer",value:function(){return this.mapService.getMapContainer()}},{key:"getMapCanvasContainer",value:function(){return this.mapService.getMapCanvasContainer()}},{key:"getMapService",value:function(){return this.mapService}},{key:"exportPng",value:function(e){return this.sceneService.exportPng(e)}},{key:"exportMap",value:function(e){return this.sceneService.exportPng(e)}},{key:"registerRenderService",value:function(e){var t=this;this.sceneService.loaded?new e(this).init():this.on("loaded",(function(){new e(t).init()}))}},{key:"addLayer",value:function(e){var t=ZE(this.container);e.setContainer(t),this.sceneService.addLayer(e)}},{key:"getLayers",value:function(){return this.layerService.getLayers()}},{key:"getLayer",value:function(e){return this.layerService.getLayer(e)}},{key:"getLayerByName",value:function(e){return this.layerService.getLayerByName(e)}},{key:"removeLayer",value:function(e){this.layerService.remove(e)}},{key:"removeAllLayer",value:function(){this.layerService.removeAllLayers()}},{key:"render",value:function(){this.sceneService.render()}},{key:"addImage",value:function(e,t){this.iconService.addImage(e,t)}},{key:"hasImage",value:function(e){return this.iconService.hasImage(e)}},{key:"removeImage",value:function(e){this.iconService.removeImage(e)}},{key:"addIconFontGlyphs",value:function(e,t){this.fontService.addIconGlyphs(t)}},{key:"addControl",value:function(e){this.controlService.addControl(e,this.container)}},{key:"removeControl",value:function(e){this.controlService.removeControl(e)}},{key:"getControlByName",value:function(e){return this.controlService.getControlByName(e)}},{key:"addMarker",value:function(e){this.markerService.addMarker(e)}},{key:"addMarkerLayer",value:function(e){this.markerService.addMarkerLayer(e)}},{key:"removeMarkerLayer",value:function(e){this.markerService.removeMarkerLayer(e)}},{key:"removeAllMakers",value:function(){this.markerService.removeAllMarkers()}},{key:"addPopup",value:function(e){this.popupService.addPopup(e)}},{key:"on",value:function(e,t){-1===lA.indexOf(e)?this.mapService.on(e,t):this.sceneService.on(e,t)}},{key:"off",value:function(e,t){-1===lA.indexOf(e)?this.mapService.off(e,t):this.sceneService.off(e,t)}},{key:"getZoom",value:function(){return this.mapService.getZoom()}},{key:"getCenter",value:function(){return this.mapService.getCenter()}},{key:"setCenter",value:function(e){return this.mapService.setCenter(e)}},{key:"getPitch",value:function(){return this.mapService.getPitch()}},{key:"setPitch",value:function(e){return this.mapService.setPitch(e)}},{key:"getRotation",value:function(){return this.mapService.getRotation()}},{key:"getBounds",value:function(){return this.mapService.getBounds()}},{key:"setRotation",value:function(e){this.mapService.setRotation(e)}},{key:"zoomIn",value:function(){this.mapService.zoomIn()}},{key:"zoomOut",value:function(){this.mapService.zoomOut()}},{key:"panTo",value:function(e){this.mapService.panTo(e)}},{key:"panBy",value:function(e){this.mapService.panBy(e)}},{key:"getContainer",value:function(){return this.mapService.getContainer()}},{key:"setZoom",value:function(e){this.mapService.setZoom(e)}},{key:"fitBounds",value:function(e,t){var n=this.sceneService.getSceneConfig(),r=n.fitBoundsOptions,i=n.animate;this.mapService.fitBounds(e,t||Qi(Qi({},r),{},{animate:i}))}},{key:"setZoomAndCenter",value:function(e,t){this.mapService.setZoomAndCenter(e,t)}},{key:"setMapStyle",value:function(e){this.mapService.setMapStyle(e)}},{key:"setMapStatus",value:function(e){this.mapService.setMapStatus(e)}},{key:"pixelToLngLat",value:function(e){return this.mapService.pixelToLngLat(e)}},{key:"lngLatToPixel",value:function(e){return this.mapService.lngLatToPixel(e)}},{key:"containerToLngLat",value:function(e){return this.mapService.containerToLngLat(e)}},{key:"lngLatToContainer",value:function(e){return this.mapService.lngLatToContainer(e)}},{key:"destroy",value:function(){this.sceneService.destroy()}},{key:"registerPostProcessingPass",value:function(e,t){this.container.bind(nr.IPostProcessingPass).to(e).whenTargetNamed(t)}},{key:"initComponent",value:function(e){this.controlService.init({container:Ea(e)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}},{key:"initControl",value:function(){var e=this.sceneService.getSceneConfig(),t=e.logoVisible,n=e.logoPosition;t&&this.addControl(new pA({position:n}))}},{key:"map",get:function(){return this.mapService.map}}]),e}(),IT=(uT=VE(nr.ILogService),cT=VE(nr.IGlobalConfigService),fT=go((lT=function(){function e(t){Wi(this,e),vo(this,"logger",fT,this),vo(this,"configService",hT,this),this.config=void 0,this.config=t}return Xi(e,[{key:"setContainer",value:function(e,t){e.bind(nr.MapConfig).toConstantValue(Qi(Qi({},this.config),{},{id:t})),e.bind(nr.IMapService).to(this.getServiceConstructor()).inSingletonScope()}},{key:"getServiceConstructor",value:function(){throw new Error("Method not implemented.")}}]),e}()).prototype,"logger",[uT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hT=go(lT.prototype,"configService",[cT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lT),PT=o((function(e,t){e.exports=function(){function e(e){var r=[];return e.AMapUI&&r.push(t(e.AMapUI)),e.Loca&&r.push(n(e.Loca)),Promise.all(r)}function t(e){return new Promise((function(t,n){var i=[];if(e.plugins)for(var u=0;u<e.plugins.length;u+=1)-1==o.AMapUI.plugins.indexOf(e.plugins[u])&&i.push(e.plugins[u]);if(a.AMapUI===r.failed)n("前次请求 AMapUI 失败");else if(a.AMapUI===r.notload){a.AMapUI=r.loading,o.AMapUI.version=e.version||o.AMapUI.version,u=o.AMapUI.version;var c=document.body||document.head,l=document.createElement("script");l.type="text/javascript",l.src="https://webapi.amap.com/ui/"+u+"/main.js",l.onerror=function(e){a.AMapUI=r.failed,n("请求 AMapUI 失败")},l.onload=function(){if(a.AMapUI=r.loaded,i.length)window.AMapUI.loadUI(i,(function(){for(var e=0,n=i.length;e<n;e++){var r=i[e].split("/").slice(-1)[0];window.AMapUI[r]=arguments[e]}for(t();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()}));else for(t();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()},c.appendChild(l)}else a.AMapUI===r.loaded?e.version&&e.version!==o.AMapUI.version?n("不允许多个版本 AMapUI 混用"):i.length?window.AMapUI.loadUI(i,(function(){for(var e=0,n=i.length;e<n;e++){var r=i[e].split("/").slice(-1)[0];window.AMapUI[r]=arguments[e]}t()})):t():e.version&&e.version!==o.AMapUI.version?n("不允许多个版本 AMapUI 混用"):s.AMapUI.push((function(e){e?n(e):i.length?window.AMapUI.loadUI(i,(function(){for(var e=0,n=i.length;e<n;e++){var r=i[e].split("/").slice(-1)[0];window.AMapUI[r]=arguments[e]}t()})):t()}))}))}function n(e){return new Promise((function(t,n){if(o.AMap.version.startsWith("2.0"))n("Loca 暂不适配 JSAPI 2.0,请使用 1.4.15");else if(a.Loca===r.failed)n("前次请求 Loca 失败");else if(a.Loca===r.notload){a.Loca=r.loading,o.Loca.version=e.version||o.Loca.version;var i=o.Loca.version,u=o.key,c=document.body||document.head,l=document.createElement("script");l.type="text/javascript",l.src="https://webapi.amap.com/loca?v="+i+"&key="+u,l.onerror=function(e){a.Loca=r.failed,n("请求 AMapUI 失败")},l.onload=function(){for(a.Loca=r.loaded,t();s.Loca.length;)s.Loca.splice(0,1)[0]()},c.appendChild(l)}else a.Loca===r.loaded?e.version&&e.version!==o.Loca.version?n("不允许多个版本 Loca 混用"):t():e.version&&e.version!==o.Loca.version?n("不允许多个版本 Loca 混用"):s.Loca.push((function(e){e?n(e):n()}))}))}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var r,i;(i=r||(r={})).notload="notload",i.loading="loading",i.loaded="loaded",i.failed="failed";var o={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},a={AMap:r.notload,AMapUI:r.notload,Loca:r.notload},s={AMap:[],AMapUI:[],Loca:[]},u=[];return{load:function(t){return new Promise((function(n,i){if(a.AMap==r.failed)i("");else if(a.AMap==r.notload){var s=t.key,c=t.version,l=t.plugins;s?(window.AMap&&"lbs.amap.com"!==location.host&&i("禁止多种API加载方式混用"),o.key=s,o.AMap.version=c||o.AMap.version,o.AMap.plugins=l||o.AMap.plugins,a.AMap=r.loading,c=document.body||document.head,window.___onAPILoaded=function(o){if(delete window.___onAPILoaded,o)a.AMap=r.failed,i(o);else for(a.AMap=r.loaded,e(t).then((function(){n(window.AMap)})).catch(i);u.length;)u.splice(0,1)[0]()},(l=document.createElement("script")).type="text/javascript",l.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+o.AMap.version+"&key="+s+"&plugin="+o.AMap.plugins.join(","),l.onerror=function(e){a.AMap=r.failed,i(e)},c.appendChild(l)):i("请填写key")}else if(a.AMap==r.loaded)if(t.key&&t.key!==o.key)i("多个不一致的 key");else if(t.version&&t.version!==o.AMap.version)i("不允许多个版本 JSAPI 混用");else{if(s=[],t.plugins)for(c=0;c<t.plugins.length;c+=1)-1==o.AMap.plugins.indexOf(t.plugins[c])&&s.push(t.plugins[c]);s.length?window.AMap.plugin(s,(function(){e(t).then((function(){n(window.AMap)})).catch(i)})):e(t).then((function(){n(window.AMap)})).catch(i)}else if(t.key&&t.key!==o.key)i("多个不一致的 key");else if(t.version&&t.version!==o.AMap.version)i("不允许多个版本 JSAPI 混用");else{var f=[];if(t.plugins)for(c=0;c<t.plugins.length;c+=1)-1==o.AMap.plugins.indexOf(t.plugins[c])&&f.push(t.plugins[c]);!function(e){"function"==typeof e&&(a.AMap===r.loaded?e(window.AMap):u.push(e))}((function(){f.length?window.AMap.plugin(f,(function(){e(t).then((function(){n(window.AMap)})).catch(i)})):e(t).then((function(){n(window.AMap)})).catch(i)}))}}))},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,o={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},a={AMap:r.notload,AMapUI:r.notload,Loca:r.notload},s={AMap:[],AMapUI:[],Loca:[]}}}}()})),OT={dark:"amap://styles/2a09079c3daac9420ee53b67307a8006?isPublic=true",light:"amap://styles/1fd9f8ef9751298f11f5c56968312c70?isPublic=true",normal:"amap://styles/normal",blank:"amap://styles/07c17002b38775b32a7a76c66cf90e99?isPublic=true"},RT=Math.PI/180,LT=function(){function e(){Wi(this,e),this.projectionMatrix=tv(),this.viewMatrix=tv(),this.viewProjectionMatrix=tv(),this.ViewProjectionMatrixUncentered=tv(),this.viewUncenteredMatrix=tv(),this.zoom=void 0,this.center=void 0}return Xi(e,[{key:"syncWithMapCamera",value:function(e){var t=e.zoom,n=void 0===t?1:t,r=e.pitch,i=void 0===r?0:r,o=e.bearing,a=void 0===o?0:o,s=e.center,u=void 0===s?[0,0]:s,c=e.offsetOrigin,l=void 0===c?[0,0]:c,f=e.cameraHeight,h=void 0===f?1:f,d=e.aspect,p=void 0===d?1:d,v=e.near,g=void 0===v?.1:v,m=e.far,y=void 0===m?1e3:m,b=e.fov,_=void 0===b?0:b;this.zoom=n,this.center=u;var x=i*RT,w=(360-a)*RT;vv(this.projectionMatrix,_,p,g,y);var S=Ev(h*Math.sin(x)*Math.sin(w),-h*Math.sin(x)*Math.cos(w),h*Math.cos(x)),E=Ev(-Math.cos(x)*Math.sin(w),Math.cos(x)*Math.cos(w),Math.sin(x));gv(this.viewMatrix,S,Ev(0,0,0),E),this.viewUncenteredMatrix=nv(this.viewMatrix),sv(this.viewMatrix,this.viewMatrix,Ev(-l[0],l[1],0)),av(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),av(this.ViewProjectionMatrixUncentered,this.projectionMatrix,this.viewMatrix)}},{key:"getZoom",value:function(){return this.zoom}},{key:"getZoomScale",value:function(){return 524288}},{key:"getCenter",value:function(){var e=co(this.center,2);return[e[0],e[1]]}},{key:"getProjectionMatrix",value:function(){return this.projectionMatrix}},{key:"getViewMatrix",value:function(){return this.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewUncenteredMatrix}},{key:"getViewProjectionMatrix",value:function(){return this.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.ViewProjectionMatrixUncentered}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(e,t){var n=Math.max(Math.min(85.0511287798,e[1]),-85.0511287798),r=Math.PI/180,i=e[0]*r,o=n*r;o=Math.log(Math.tan(Math.PI/4+o/2));return[i=(256<<20)*(.5/Math.PI*i+.5)-215440491,o=-((256<<20)*(-.5/Math.PI*o+(r=.5))-106744817)]}}]),e}(),NT=0;window.forceWebGL=!0;var DT=!1,jT=[],zT=(dT=Q(),pT=J(nr.IGlobalConfigService),vT=J(nr.ILogService),gT=J(nr.MapConfig),mT=J(nr.ICoordinateSystemService),yT=J(nr.IEventEmitter),dT((xT=go((_T=function(){function t(){var n=this;Wi(this,t),this.map=void 0,vo(this,"configService",xT,this),vo(this,"logger",wT,this),vo(this,"config",ST,this),vo(this,"coordinateSystemService",ET,this),vo(this,"eventEmitter",AT,this),this.markerContainer=void 0,this.$mapContainer=void 0,this.viewport=void 0,this.cameraChangedCallback=void 0,this.handleCameraChanged=function(t){var r=t.camera,i=r.fov,o=r.near,a=r.far,s=r.height,u=r.pitch,c=r.rotation,l=r.aspect,f=r.position,h=n.getCenter(),d=h.lng,p=h.lat;n.cameraChangedCallback&&(n.viewport.syncWithMapCamera({aspect:l,bearing:360-c,far:a,fov:i,cameraHeight:s,near:o,pitch:u,zoom:n.map.getZoom()-1,center:[d,p],offsetOrigin:[f.x,f.y]}),n.viewport.getZoom()>12?n.coordinateSystemService.setCoordinateSystem(e.CoordinateSystem.P20_OFFSET):n.coordinateSystemService.setCoordinateSystem(e.CoordinateSystem.P20),n.cameraChangedCallback(n.viewport))}}var n;return Xi(t,[{key:"addMarkerContainer",value:function(){var e=this.map.getContainer();if(null!==e){var t=e.getElementsByClassName("amap-maps")[0];this.markerContainer=ka("div","l7-marker-container",t)}}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"on",value:function(e,t){-1!==uA.indexOf(e)?this.eventEmitter.on(e,t):this.map.on(e,t)}},{key:"off",value:function(e,t){-1!==uA.indexOf(e)?this.eventEmitter.off(e,t):this.map.off(e,t)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"getMapCanvasContainer",value:function(){var e;return null===(e=this.map.getContainer())||void 0===e?void 0:e.getElementsByClassName("amap-maps")[0]}},{key:"getSize",value:function(){var e=this.map.getSize();return[e.getWidth(),e.getHeight()]}},{key:"getType",value:function(){return"amap"}},{key:"getZoom",value:function(){return this.map.getZoom()-1}},{key:"setZoom",value:function(e){return this.map.setZoom(e)}},{key:"getCenter",value:function(){var e=this.map.getCenter();return{lng:e.getLng(),lat:e.getLat()}}},{key:"setCenter",value:function(e){this.map.setCenter(e)}},{key:"getPitch",value:function(){return this.map.getPitch()}},{key:"getRotation",value:function(){return 360-this.map.getRotation()}},{key:"getBounds",value:function(){var e=this.map.getBounds().toBounds(),t=e.getNorthEast(),n=e.getSouthWest(),r=this.getCenter(),i=r.lng>t.getLng()||r.lng<n.getLng()?180-t.getLng():t.getLng();return[[r.lng<n.getLng()?n.getLng()-180:n.getLng(),n.getLat()],[i,t.getLat()]]}},{key:"getMinZoom",value:function(){return this.map.get("zooms")[0]-1}},{key:"getMaxZoom",value:function(){return this.map.get("zooms")[1]-1}},{key:"setRotation",value:function(e){return this.map.setRotation(e)}},{key:"setPitch",value:function(e){return this.map.setPitch(e)}},{key:"zoomIn",value:function(){this.map.zoomIn()}},{key:"zoomOut",value:function(){this.map.zoomOut()}},{key:"panTo",value:function(e){this.map.panTo(e)}},{key:"panBy",value:function(e){this.map.panTo(e)}},{key:"fitBounds",value:function(e){this.map.setBounds(new AMap.Bounds([e[0][0],e[0][1],e[1][0],e[1][1]]))}},{key:"setZoomAndCenter",value:function(e,t){this.map.setZoomAndCenter(e,t)}},{key:"setMapStyle",value:function(e){this.map.setMapStyle(this.getMapStyle(e))}},{key:"setMapStatus",value:function(e){this.map.setStatus(e)}},{key:"pixelToLngLat",value:function(e){var t=this.map.pixelToLngLat(new AMap.Pixel(e[0],e[1]));return{lng:t.getLng(),lat:t.getLat()}}},{key:"lngLatToPixel",value:function(e){var t=this.map.lnglatToPixel(new AMap.LngLat(e[0],e[1]));return{x:t.getX(),y:t.getY()}}},{key:"containerToLngLat",value:function(e){var t=new AMap.Pixel(e[0],e[1]),n=this.map.containerToLngLat(t);return{lng:null==n?void 0:n.getLng(),lat:null==n?void 0:n.getLat()}}},{key:"lngLatToContainer",value:function(e){var t=new AMap.LngLat(e[0],e[1]),n=this.map.lngLatToContainer(t);return{x:n.getX(),y:n.getY()}}},{key:"lngLatToMercator",value:function(e,t){return{x:0,y:0,z:0}}},{key:"getModelMatrix",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=this.viewport.projectFlat(e),o=tv();return sv(o,o,Ev(i[0],i[1],t)),uv(o,o,Ev(r[0],r[1],r[2])),cv(o,o,n[0]),lv(o,o,n[1]),fv(o,o,n[2]),o}},{key:"init",value:(n=Zi(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c,l,f,h,d,p,v=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.config,n=t.id,r=t.style,i=void 0===r?"light":r,o=t.minZoom,a=void 0===o?0:o,s=t.maxZoom,u=void 0===s?18:s,c=t.token,l=void 0===c?"15cd8a57710d40c9b7c0e3cc120f1200":c,f=t.mapInstance,h=t.plugin,d=void 0===h?[]:h,p=io(t,["id","style","minZoom","maxZoom","token","mapInstance","plugin"]),e.next=3,new Promise((function(e){var t=function(){if(f)v.map=f,v.$mapContainer=v.map.getContainer(),setTimeout((function(){v.map.on("camerachange",v.handleCameraChanged),e()}),30);else{v.$mapContainer=v.creatAmapContainer(n);var t=new AMap.Map(v.$mapContainer,Qi({mapStyle:v.getMapStyle(i),zooms:[a,u],viewMode:"3D"},p));t.on("camerachange",v.handleCameraChanged),v.map=t,setTimeout((function(){e()}),10)}};DT||f?DT&&window.AMap||f?t():jT.push(t):("15cd8a57710d40c9b7c0e3cc120f1200"===l&&v.logger.warn(v.configService.getSceneWarninfo("MapToken")),DT=!0,d.push("Map3D"),PT.load({key:l,version:"1.4.15",plugins:d}).then((function(e){t(),jT.length&&(jT.forEach((function(e){return e()})),jT=[])})).catch((function(e){throw new Error(e)})))}));case 3:this.viewport=new LT;case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"exportMap",value:function(e){var t,n=null===(t=this.getContainer())||void 0===t?void 0:t.getElementsByClassName("amap-layer")[0];return"jpg"===e?null==n?void 0:n.toDataURL("image/jpeg"):null==n?void 0:n.toDataURL("image/png")}},{key:"emit",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=this.eventEmitter).emit.apply(t,[e].concat(r))}},{key:"once",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=this.eventEmitter).once.apply(t,[e].concat(r))}},{key:"destroy",value:function(){this.map.destroy(),delete window.initAMap;var e=document.getElementById("amap-script");e&&document.head.removeChild(e)}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"onCameraChanged",value:function(e){this.cameraChangedCallback=e}},{key:"getMapStyle",value:function(e){return OT[e]?OT[e]:e}},{key:"creatAmapContainer",value:function(e){var t=e;"string"==typeof e&&(t=document.getElementById(e));var n=document.createElement("div");return n.style.cssText+="\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n ",n.id="l7_amap_div"+NT++,t.appendChild(n),n}}]),t}()).prototype,"configService",[pT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wT=go(_T.prototype,"logger",[vT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ST=go(_T.prototype,"config",[gT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ET=go(_T.prototype,"coordinateSystemService",[mT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),AT=go(_T.prototype,"eventEmitter",[yT],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bT=_T))||bT),FT=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"getServiceConstructor",value:function(){return zT}}]),n}(IT);Pt({target:"String",proto:!0,forced:bA("sub")},{sub:function(){return yA(this,"sub","","")}});var BT,UT=VT;function VT(e,t,n,r){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*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=r}function GT(e,t,n){var r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function HT(e,t,n){return Math.min(n,Math.max(t,e))}function ZT(e,t,n){return e*(1-n)+t*n}function WT(e,t,n,r){var i=new UT(e,t,n,r);return function(e){return i.solve(e)}}VT.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},VT.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},VT.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},VT.prototype.solveCurveX=function(e,t){var n,r,i,o,a;for(void 0===t&&(t=1e-6),i=e,a=0;a<8;a++){if(o=this.sampleCurveX(i)-e,Math.abs(o)<t)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=e)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=this.sampleCurveX(i),Math.abs(o-e)<t)return i;e>o?n=i:r=i,i=.5*(r-n)+n}return i},VT.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var qT=WT(.25,.1,.25,1);function XT(){return!!window.matchMedia&&(null==BT&&(BT=window.matchMedia("(prefers-reduced-motion: reduce)")),BT.matches)}function YT(e,t){var n,r={},i=po(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o in e&&(r[o]=e[o])}}catch(e){i.e(e)}finally{i.f()}return r}var KT=window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date),QT=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,JT=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;function $T(e){var t=QT(e);return{cancel:function(){return JT(t)}}}var ek=ln.every,tk=vr("every"),nk=br("every");Pt({target:"Array",proto:!0,forced:!tk||!nk},{every:function(e){return ek(this,e,arguments.length>1?arguments[1]:void 0)}});var rk=function(){function e(t,n){Wi(this,e),this.ne=void 0,this.sw=void 0,t&&(n?this.setSouthWest(t).setNorthEast(n):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}return Xi(e,null,[{key:"convert",value:function(t){return t instanceof e?t:new e(t)}}]),Xi(e,[{key:"setNorthEast",value:function(e){return this.ne=e instanceof ik?new ik(e.lng,e.lat):ik.convert(e),this}},{key:"setSouthWest",value:function(e){return this.sw=e instanceof ik?new ik(e.lng,e.lat):ik.convert(e),this}},{key:"extend",value:function(t){var n,r,i=this.sw,o=this.ne;if(t instanceof ik)n=t,r=t;else{if(!(t instanceof e)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(e.convert(a))}var s=t;return this.extend(ik.convert(s))}return this}if(n=t.sw,r=t.ne,!n||!r)return this}return i||o?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this.sw=new ik(n.lng,n.lat),this.ne=new ik(r.lng,r.lat)),this}},{key:"getCenter",value:function(){return new ik((this.sw.lng+this.ne.lng)/2,(this.sw.lat+this.ne.lat)/2)}},{key:"getSouthWest",value:function(){return this.sw}},{key:"getNorthEast",value:function(){return this.ne}},{key:"getNorthWest",value:function(){return new ik(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new ik(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this.sw.lng}},{key:"getSouth",value:function(){return this.sw.lat}},{key:"getEast",value:function(){return this.ne.lng}},{key:"getNorth",value:function(){return this.ne.lat}},{key:"toArray",value:function(){return[this.sw.toArray(),this.ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this.sw.toString(),", ").concat(this.ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this.sw&&this.ne)}},{key:"contains",value:function(e){var t=ik.convert(e),n=t.lng,r=t.lat,i=this.sw.lat<=r&&r<=this.ne.lat,o=this.sw.lng<=n&&n<=this.ne.lng;return this.sw.lng>this.ne.lng&&(o=this.sw.lng>=n&&n>=this.ne.lng),i&&o}}]),e}(),ik=function(){function e(t,n){if(Wi(this,e),this.lng=void 0,this.lat=void 0,isNaN(t)||isNaN(n))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(n,")"));if(this.lng=+t,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return Xi(e,null,[{key:"convert",value:function(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"===Gi(t)&&null!==t){var n="lng"in t?t.lng:t.lon;return new e(Number(n),Number(t.lat))}throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}]),Xi(e,[{key:"wrap",value:function(){return new e(GT(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=40075017,r=360*t/n,i=r/Math.cos(Math.PI/180*this.lat);return new rk(new e(this.lng-i,this.lat-r),new e(this.lng+i,this.lat+r))}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"distanceTo",value:function(e){var t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return 6371008.8*Math.acos(Math.min(i,1))}}]),e}(),ok=function(){function e(t,n){Wi(this,e),this.x=void 0,this.y=void 0,this.x=t,this.y=n}return Xi(e,null,[{key:"convert",value:function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}}]),Xi(e,[{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"_add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"add",value:function(e){return this.clone()._add(e)}},{key:"_sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"sub",value:function(e){return this.clone()._sub(e)}},{key:"_multByPoint",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multByPoint",value:function(e){return this.clone()._multByPoint(e)}},{key:"_divByPoint",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divByPoint",value:function(e){return this.clone()._divByPoint(e)}},{key:"_mult",value:function(e){return this.x*=e,this.y*=e,this}},{key:"mult",value:function(e){return this.clone()._mult(e)}},{key:"_div",value:function(e){return this.x/=e,this.y/=e,this}},{key:"div",value:function(e){return this.clone()._div(e)}},{key:"_rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this}},{key:"rotate",value:function(e){return this.clone()._rotate(e)}},{key:"_rotateAround",value:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),o=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=o,this}},{key:"roateAround",value:function(e,t){return this.clone()._rotateAround(e,t)}},{key:"_matMult",value:function(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}},{key:"matMult",value:function(e){return this.clone()._matMult(e)}},{key:"_unit",value:function(){return this.div(this.mag()),this}},{key:"unit",value:function(){return this.clone()._unit()}},{key:"_perp",value:function(){var e=this.y;return this.y=this.x,this.x=-e,this}},{key:"perp",value:function(){return this.clone()._perp()}},{key:"_round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"round",value:function(){return this.clone()._round()}},{key:"mag",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"dist",value:function(e){return Math.sqrt(this.distSqr(e))}},{key:"distSqr",value:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n}},{key:"angle",value:function(){return Math.atan2(this.y,this.x)}},{key:"angleTo",value:function(e){return Math.atan2(this.y-e.y,this.x-e.x)}},{key:"angleWith",value:function(e){return this.angleWithSep(e.x,e.y)}},{key:"angleWithSep",value:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)}}]),e}();qs("Float32",(function(e){return function(t,n,r){return e(this,t,n,r)}})),Pt({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var ak=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(Wi(this,e),this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=r,this.right=i}return Xi(e,[{key:"interpolate",value:function(e,t,n){return null!=t.top&&null!=e.top&&(this.top=ZT(e.top,t.top,n)),null!=t.bottom&&null!=e.bottom&&(this.bottom=ZT(e.bottom,t.bottom,n)),null!=t.left&&null!=e.left&&(this.left=ZT(e.left,t.left,n)),null!=t.right&&null!=e.right&&(this.right=ZT(e.right,t.right,n)),this}},{key:"getCenter",value:function(e,t){var n=HT((this.left+e-this.right)/2,0,e),r=HT((this.top+t-this.bottom)/2,0,t);return new ok(n,r)}},{key:"equals",value:function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}},{key:"clone",value:function(){return new e(this.top,this.bottom,this.left,this.right)}},{key:"toJSON",value:function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}]),e}(),sk=2*Math.PI*6371008.8;function uk(e){return sk*Math.cos(e*Math.PI/180)}function ck(e){return(180+e)/360}function lk(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function fk(e,t){return e/uk(t)}function hk(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}var dk=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Wi(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.x=+t,this.y=+n,this.z=+r}return Xi(e,null,[{key:"fromLngLat",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=ik.convert(t);return new e(ck(r.lng),lk(r.lat),fk(n,r.lat))}}]),Xi(e,[{key:"toLngLat",value:function(){return new ik(360*this.x-180,hk(this.y))}},{key:"toAltitude",value:function(){return e=this.z,t=this.y,e*uk(hk(t));var e,t}},{key:"meterInMercatorCoordinateUnits",value:function(){return 1/sk*(e=hk(this.y),1/Math.cos(e*Math.PI/180));var e}}]),e}(),pk=function(){function e(t,n,r,i,o){Wi(this,e),this.tileSize=void 0,this.tileZoom=void 0,this.lngRange=void 0,this.latRange=void 0,this.maxValidLatitude=void 0,this.scale=void 0,this.width=void 0,this.height=void 0,this.angle=void 0,this.rotationMatrix=void 0,this.pixelsToGLUnits=void 0,this.cameraToCenterDistance=void 0,this.mercatorMatrix=void 0,this.projMatrix=void 0,this.invProjMatrix=void 0,this.alignedProjMatrix=void 0,this.pixelMatrix=void 0,this.pixelMatrixInverse=void 0,this.glCoordMatrix=void 0,this.labelPlaneMatrix=void 0,this._fov=void 0,this._pitch=void 0,this._zoom=void 0,this._renderWorldCopies=void 0,this._minZoom=void 0,this._maxZoom=void 0,this._minPitch=void 0,this._maxPitch=void 0,this._center=void 0,this.zoomFraction=void 0,this.unmodified=void 0,this.edgeInsets=void 0,this.constraining=void 0,this.posMatrixCache=void 0,this.alignedPosMatrixCache=void 0,this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=null==r?0:r,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new ik(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this.unmodified=!0,this.edgeInsets=new ak,this.posMatrixCache={},this.alignedPosMatrixCache={}}return Xi(e,[{key:"minZoom",get:function(){return this._minZoom},set:function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}},{key:"minPitch",get:function(){return this._minPitch},set:function(e){this._minPitch!==e&&(this._minPitch=e,this._pitch=Math.max(this._pitch,e))}},{key:"maxPitch",get:function(){return this._maxPitch},set:function(e){this._maxPitch!==e&&(this._maxPitch=e,this._pitch=Math.min(this._pitch,e))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies},set:function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerOffset",get:function(){return this.centerPoint._sub(this.size._div(2))}},{key:"size",get:function(){return new ok(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(e){var t,n=-GT(e,-180,180)*Math.PI/180;this.angle!==n&&(this.unmodified=!1,this.angle=n,this.calcMatrices(),this.rotationMatrix=(t=new $p(4),$p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t),function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=r*u+o*s,e[1]=i*u+a*s,e[2]=r*-s+o*u,e[3]=i*-s+a*u}(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(e){var t=HT(e,this._minPitch,this._maxPitch)/180*Math.PI;this._pitch!==t&&(this.unmodified=!1,this._pitch=t,this.calcMatrices())}},{key:"fov",get:function(){return this._fov/Math.PI*180},set:function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this.unmodified=!1,this._fov=e/180*Math.PI,this.calcMatrices())}},{key:"zoom",get:function(){return this._zoom},set:function(e){var t=Math.min(Math.max(e,this._minZoom),this._maxZoom);this._zoom!==t&&(this.unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this.constrain(),this.calcMatrices())}},{key:"center",get:function(){return this._center},set:function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this.unmodified=!1,this._center=e,this.constrain(),this.calcMatrices())}},{key:"padding",get:function(){return this.edgeInsets.toJSON()},set:function(e){this.edgeInsets.equals(e)||(this.unmodified=!1,this.edgeInsets.interpolate(this.edgeInsets,e,1),this.calcMatrices())}},{key:"centerPoint",get:function(){return this.edgeInsets.getCenter(this.width,this.height)}},{key:"point",get:function(){return this.project(this.center)}}]),Xi(e,[{key:"clone",value:function(){var t=new e(this._minZoom,this._maxZoom,this._minPitch,this._maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t.center=this._center,t.zoom=this.zoom,t.angle=this.angle,t.fov=this._fov,t.pitch=this._pitch,t.unmodified=this.unmodified,t.edgeInsets=this.edgeInsets.clone(),t.calcMatrices(),t}},{key:"isPaddingEqual",value:function(e){return this.edgeInsets.equals(e)}},{key:"interpolatePadding",value:function(e,t,n){this.unmodified=!1,this.edgeInsets.interpolate(e,t,n),this.constrain(),this.calcMatrices()}},{key:"coveringZoomLevel",value:function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this.constrain(),this.calcMatrices()}},{key:"zoomScale",value:function(e){return Math.pow(2,e)}},{key:"scaleZoom",value:function(e){return Math.log(e)/Math.LN2}},{key:"project",value:function(e){var t=HT(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new ok(ck(e.lng)*this.worldSize,lk(t)*this.worldSize)}},{key:"unproject",value:function(e){return new dk(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}},{key:"setLocationAtPoint",value:function(e,t){var n=this.pointCoordinate(t),r=this.pointCoordinate(this.centerPoint),i=this.locationCoordinate(e),o=new dk(i.x-(n.x-r.x),i.y-(n.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"pointCoordinate",value:function(e){var t=new Float32Array([e.x,e.y,0,1]),n=new Float32Array([e.x,e.y,1,1]);qv(t,t,this.pixelMatrixInverse),qv(n,n,this.pixelMatrixInverse);var r=t[3],i=n[3],o=t[0]/r,a=n[0]/i,s=t[1]/r,u=n[1]/i,c=t[2]/r,l=n[2]/i,f=c===l?0:(0-c)/(l-c);return new dk(ZT(o,a,f)/this.worldSize,ZT(s,u,f)/this.worldSize)}},{key:"getBounds",value:function(){return(new rk).extend(this.pointLocation(new ok(0,0))).extend(this.pointLocation(new ok(this.width,0))).extend(this.pointLocation(new ok(this.width,this.height))).extend(this.pointLocation(new ok(0,this.height)))}},{key:"getMaxBounds",value:function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new rk([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}},{key:"setMaxBounds",value:function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this.constrain()):(this.lngRange=void 0,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}},{key:"customLayerMatrix",value:function(){return this.mercatorMatrix.slice()}},{key:"maxPitchScaleFactor",value:function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new ok(0,0)),t=new Float32Array([e.x*this.worldSize,e.y*this.worldSize,0,1]);return qv(t,t,this.pixelMatrix)[3]/this.cameraToCenterDistance}},{key:"getCameraPoint",value:function(){var e=this._pitch,t=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new ok(0,t))}},{key:"getCameraQueryGeometry",value:function(e){var t=this.getCameraPoint();if(1===e.length)return[e[0],t];var n,r=t.x,i=t.y,o=t.x,a=t.y,s=po(e);try{for(s.s();!(n=s.n()).done;){var u=n.value;r=Math.min(r,u.x),i=Math.min(i,u.y),o=Math.max(o,u.x),a=Math.max(a,u.y)}}catch(e){s.e(e)}finally{s.f()}return[new ok(r,i),new ok(o,i),new ok(o,a),new ok(r,a),new ok(r,i)]}},{key:"coordinatePoint",value:function(e){var t=Wv(e.x*this.worldSize,e.y*this.worldSize,0,1);return qv(t,t,this.pixelMatrix),new ok(t[0]/t[3],t[1]/t[3])}},{key:"locationPoint",value:function(e){return this.coordinatePoint(this.locationCoordinate(e))}},{key:"pointLocation",value:function(e){return this.coordinateLocation(this.pointCoordinate(e))}},{key:"locationCoordinate",value:function(e){return dk.fromLngLat(e)}},{key:"coordinateLocation",value:function(e){return e.toLngLat()}},{key:"getProjectionMatrix",value:function(){return this.projMatrix}},{key:"constrain",value:function(){if(this.center&&this.width&&this.height&&!this.constraining){this.constraining=!0;var e,t,n,r,i=-90,o=90,a=-180,s=180,u=this.size,c=this.unmodified;if(this.latRange){var l=this.latRange;i=lk(l[1])*this.worldSize,e=(o=lk(l[0])*this.worldSize)-i<u.y?u.y/(o-i):0}if(this.lngRange){var f=this.lngRange;a=ck(f[0])*this.worldSize,t=(s=ck(f[1])*this.worldSize)-a<u.x?u.x/(s-a):0}var h=this.point,d=Math.max(t||0,e||0);if(d)return this.center=this.unproject(new ok(t?(s+a)/2:h.x,e?(o+i)/2:h.y)),this.zoom+=this.scaleZoom(d),this.unmodified=c,void(this.constraining=!1);if(this.latRange){var p=h.y,v=u.y/2;p-v<i&&(r=i+v),p+v>o&&(r=o-v)}if(this.lngRange){var g=h.x,m=u.x/2;g-m<a&&(n=a+m),g+m>s&&(n=s-m)}void 0===n&&void 0===r||(this.center=this.unproject(new ok(void 0!==n?n:h.x,void 0!==r?r:h.y))),this.unmodified=c,this.constraining=!1}}},{key:"calcMatrices",value:function(){if(this.height){var e=this._fov/2,t=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,r=this._fov*(.5+t.y/this.height),i=Math.sin(r)*this.cameraToCenterDistance/Math.sin(HT(Math.PI-n-r,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),c=this.height/50,l=tv();vv(l,this._fov,this.width/this.height,c,u),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,uv(l,l,[1,-1,1]),sv(l,l,[0,0,-this.cameraToCenterDistance]),cv(l,l,this._pitch),fv(l,l,this.angle),sv(l,l,[-a,-s,0]),this.mercatorMatrix=uv(tv(),l,[this.worldSize,this.worldSize,this.worldSize]),uv(l,l,Ev(1,1,fk(1,this.center.lat)*this.worldSize)),this.projMatrix=l,this.invProjMatrix=ov(tv(),this.projMatrix);var f=this.width%2/2,h=this.height%2/2,d=Math.cos(this.angle),p=Math.sin(this.angle),v=a-Math.round(a)+d*f+p*h,g=s-Math.round(s)+d*h+p*f,m=nv(l);if(sv(m,m,[v>.5?v-1:v,g>.5?g-1:g,0]),this.alignedProjMatrix=m,uv(l=tv(),l,[this.width/2,-this.height/2,1]),sv(l,l,[1,-1,0]),this.labelPlaneMatrix=l,uv(l=tv(),l,[1,-1,1]),sv(l,l,[-1,-1,0]),uv(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=av(tv(),this.labelPlaneMatrix,this.projMatrix),!(l=ov(tv(),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this.posMatrixCache={},this.alignedPosMatrixCache={}}}}]),e}(),vk=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Wi(this,e),this.type=void 0,Dy(this,n),this.type=t},gk=function(e){Ji(n,e);var t=so(n);function n(e){var r;Wi(this,n),(r=t.call(this)).transform=void 0,r.options=void 0,r.moving=void 0,r.zooming=void 0,r.rotating=void 0,r.pitching=void 0,r.padding=void 0,r.bearingSnap=void 0,r.easeEndTimeoutID=void 0,r.easeStart=void 0,r.easeOptions=void 0,r.easeId=void 0,r.onEaseFrame=void 0,r.onEaseEnd=void 0,r.easeFrameId=void 0,r.renderFrameCallback=function(){var e=Math.min((KT()-r.easeStart)/r.easeOptions.duration,1);r.onEaseFrame(r.easeOptions.easing(e)),e<1?r.easeFrameId=r.requestRenderFrame(r.renderFrameCallback):r.stop()},r.options=e;var i=e.minZoom,o=e.maxZoom,a=e.minPitch,s=e.maxPitch,u=e.renderWorldCopies;return r.moving=!1,r.zooming=!1,r.bearingSnap=e.bearingSnap,r.transform=new pk(i,o,a,s,u),r}return Xi(n,[{key:"requestRenderFrame",value:function(e){return 0}},{key:"cancelRenderFrame",value:function(e){}},{key:"getCenter",value:function(){var e=this.transform.center,t=e.lng,n=e.lat;return new ik(t,n)}},{key:"getZoom",value:function(){return this.transform.zoom}},{key:"getPitch",value:function(){return this.transform.pitch}},{key:"setCenter",value:function(e,t){return this.jumpTo({center:e},t)}},{key:"setPitch",value:function(e,t){return this.jumpTo({pitch:e},t),this}},{key:"getBearing",value:function(){return this.transform.bearing}},{key:"panTo",value:function(e,t,n){return this.easeTo(Dy({center:e},t),n)}},{key:"zoomOut",value:function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}},{key:"setBearing",value:function(e,t){return this.jumpTo({bearing:e},t),this}},{key:"setZoom",value:function(e,t){return this.jumpTo({zoom:e},t),this}},{key:"zoomIn",value:function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}},{key:"zoomTo",value:function(e,t,n){return this.easeTo(Dy({zoom:e},t),n)}},{key:"getPadding",value:function(){return this.transform.padding}},{key:"setPadding",value:function(e,t){return this.jumpTo({padding:e},t),this}},{key:"rotateTo",value:function(e,t,n){return this.easeTo(Dy({bearing:e},t),n)}},{key:"resetNorth",value:function(e,t){return this.rotateTo(0,Dy({duration:1e3},e),t),this}},{key:"resetNorthPitch",value:function(e,t){return this.easeTo(Dy({bearing:0,pitch:0,duration:1e3},e),t),this}},{key:"fitBounds",value:function(e,t,n){return this.fitInternal(this.cameraForBounds(e,t),t,n)}},{key:"cameraForBounds",value:function(e,t){return e=rk.convert(e),this.cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,t)}},{key:"snapToNorth",value:function(e,t){return Math.abs(this.getBearing())<this.bearingSnap?this.resetNorth(e,t):this}},{key:"jumpTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;this.stop();var n=this.transform,r=!1,i=!1,o=!1;return e.zoom&&n.zoom!==+e.zoom&&(r=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=ik.convert(e.center)),e.bearing&&n.bearing!==+e.bearing&&(i=!0,n.bearing=+e.bearing),e.pitch&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this.emit("movestart",new vk("movestart",t)),this.emit("move",new vk("move",t)),r&&(this.emit("zoomstart",new vk("zoomstart",t)),this.emit("zoom",new vk("zoom",t)),this.emit("zoomend",new vk("zoomend",t))),i&&(this.emit("rotatestart",new vk("rotatestart",t)),this.emit("rotate",new vk("rotate",t)),this.emit("rotateend",new vk("rotateend",t))),o&&(this.emit("pitchstart",new vk("pitchstart",t)),this.emit("pitch",new vk("pitch",t)),this.emit("pitchend",new vk("pitchend",t))),this.emit("moveend",new vk("moveend",t))}},{key:"easeTo",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;(!1===(t=Dy({offset:[0,0],duration:500,easing:qT},t)).animate||!t.essential&&XT())&&(t.duration=0);var r=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),u=t.zoom?+t.zoom:i,c=t.bearing?this.normalizeBearing(t.bearing,o):o,l=t.pitch?+t.pitch:a,f=t.padding?t.padding:r.padding,h=ok.convert(t.offset),d=r.centerPoint.add(h),p=r.pointLocation(d),v=ik.convert(t.center||p);this.normalizeCenter(v);var g,m,y=r.project(p),b=r.project(v).sub(y),_=r.zoomScale(u-i);t.around&&(g=ik.convert(t.around),m=r.locationPoint(g));var x={moving:this.moving,zooming:this.zooming,rotating:this.rotating,pitching:this.pitching};return this.zooming=this.zooming||u!==i,this.rotating=this.rotating||o!==c,this.pitching=this.pitching||l!==a,this.padding=!r.isPaddingEqual(f),this.easeId=t.easeId,this.prepareEase(n,t.noMoveStart,x),clearTimeout(this.easeEndTimeoutID),this.ease((function(t){if(e.zooming&&(r.zoom=ZT(i,u,t)),e.rotating&&(r.bearing=ZT(o,c,t)),e.pitching&&(r.pitch=ZT(a,l,t)),e.padding&&(r.interpolatePadding(s,f,t),d=r.centerPoint.add(h)),g)r.setLocationAtPoint(g,m);else{var p=r.zoomScale(r.zoom-i),v=u>i?Math.min(2,_):Math.max(.5,_),x=Math.pow(v,1-t),w=r.unproject(y.add(b.mult(t*x)).mult(p));r.setLocationAtPoint(r.renderWorldCopies?w.wrap():w,d)}e.fireMoveEvents(n)}),(function(t){e.afterEase(n,t)}),t),this}},{key:"flyTo",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(!t.essential&&XT()){var r=YT(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,n)}this.stop(),t=Dy({offset:[0,0],speed:1.2,curve:1.42,easing:qT},t);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),c=t.zoom?HT(+t.zoom,i.minZoom,i.maxZoom):o,l=t.bearing?this.normalizeBearing(t.bearing,a):a,f=t.pitch?+t.pitch:s,h="padding"in t?t.padding:i.padding,d=i.zoomScale(c-o),p=ok.convert(t.offset),v=i.centerPoint.add(p),g=i.pointLocation(v),m=ik.convert(t.center||g);this.normalizeCenter(m);var y=i.project(g),b=i.project(m).sub(y),_=t.curve,x=Math.max(i.width,i.height),w=x/d,S=b.mag();if("minZoom"in t){var E=HT(Math.min(t.minZoom,o,c),i.minZoom,i.maxZoom),A=x/i.zoomScale(E-o);_=Math.sqrt(A/S*2)}var T=_*_;function k(e){var t=(w*w-x*x+(e?-1:1)*T*T*S*S)/(2*(e?w:x)*T*S);return Math.log(Math.sqrt(t*t+1)-t)}function M(e){return(Math.exp(e)-Math.exp(-e))/2}function C(e){return(Math.exp(e)+Math.exp(-e))/2}function I(e){return M(e)/C(e)}var P=k(0),O=function(e){return C(P)/C(P+_*e)},R=function(e){return x*((C(P)*I(P+_*e)-M(P))/T)/S},L=(k(1)-P)/_;if(Math.abs(S)<1e-6||!isFinite(L)){if(Math.abs(x-w)<1e-6)return this.easeTo(t,n);var N=w<x?-1:1;L=Math.abs(Math.log(w/x))/_,R=function(){return 0},O=function(e){return Math.exp(N*_*e)}}if("duration"in t)t.duration=+t.duration;else{var D="screenSpeed"in t?+t.screenSpeed/_:+t.speed;t.duration=1e3*L/D}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this.zooming=!0,this.rotating=a!==l,this.pitching=f!==s,this.padding=!i.isPaddingEqual(h),this.prepareEase(n,!1),this.ease((function(t){var r=t*L,d=1/O(r);i.zoom=1===t?c:o+i.scaleZoom(d),e.rotating&&(i.bearing=ZT(a,l,t)),e.pitching&&(i.pitch=ZT(s,f,t)),e.padding&&(i.interpolatePadding(u,h,t),v=i.centerPoint.add(p));var g=1===t?m:i.unproject(y.add(b.mult(R(r))).mult(d));i.setLocationAtPoint(i.renderWorldCopies?g.wrap():g,v),e.fireMoveEvents(n)}),(function(){return e.afterEase(n)}),t),this}},{key:"fitScreenCoordinates",value:function(e,t,n,r,i){return this.fitInternal(this.cameraForBoxAndBearing(this.transform.pointLocation(ok.convert(e)),this.transform.pointLocation(ok.convert(t)),n,r),r,i)}},{key:"stop",value:function(e,t){if(this.easeFrameId&&(this.cancelRenderFrame(this.easeFrameId),delete this.easeFrameId,delete this.onEaseFrame),this.onEaseEnd){var n=this.onEaseEnd;delete this.onEaseEnd,n.call(this,t)}return this}},{key:"normalizeBearing",value:function(e,t){e=GT(e,-180,180);var n=Math.abs(e-t);return Math.abs(e-360-t)<n&&(e-=360),Math.abs(e+360-t)<n&&(e+=360),e}},{key:"normalizeCenter",value:function(e){var t=this.transform;if(t.renderWorldCopies&&!t.lngRange){var n=e.lng-t.center.lng;e.lng+=n>180?-360:n<-180?360:0}}},{key:"fireMoveEvents",value:function(e){this.emit("move",new vk("move",e)),this.zooming&&this.emit("zoom",new vk("zoom",e)),this.rotating&&this.emit("rotate",new vk("rotate",e)),this.pitching&&this.emit("rotate",new vk("pitch",e))}},{key:"prepareEase",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.moving=!0,t||n.moving||this.emit("movestart",new vk("movestart",e)),this.zooming&&!n.zooming&&this.emit("zoomstart",new vk("zoomstart",e)),this.rotating&&!n.rotating&&this.emit("rotatestart",new vk("rotatestart",e)),this.pitching&&!n.pitching&&this.emit("pitchstart",new vk("pitchstart",e))}},{key:"afterEase",value:function(e,t){if(!this.easeId||!t||this.easeId!==t){delete this.easeId;var n=this.zooming,r=this.rotating,i=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,this.padding=!1,n&&this.emit("zoomend",new vk("zoomend",e)),r&&this.emit("rotateend",new vk("rotateend",e)),i&&this.emit("pitchend",new vk("pitchend",e)),this.emit("moveend",new vk("moveend",e))}}},{key:"ease",value:function(e,t,n){!1===n.animate||0===n.duration?(e(1),t()):(this.easeStart=KT(),this.easeOptions=n,this.onEaseFrame=e,this.onEaseEnd=t,this.easeFrameId=this.requestRenderFrame(this.renderFrameCallback))}},{key:"cameraForBoxAndBearing",value:function(e,t,n,r){var i={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=Dy({padding:i,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){var o=r.padding;r.padding={top:o,bottom:o,right:o,left:o}}r.padding=Dy(i,r.padding);var a=this.transform,s=a.padding,u=a.project(ik.convert(e)),c=a.project(ik.convert(t)),l=u.rotate(-n*Math.PI/180),f=c.rotate(-n*Math.PI/180),h=new ok(Math.max(l.x,f.x),Math.max(l.y,f.y)),d=new ok(Math.min(l.x,f.x),Math.min(l.y,f.y)),p=h.sub(d),v=(a.width-(s.left+s.right+r.padding.left+r.padding.right))/p.x,g=(a.height-(s.top+s.bottom+r.padding.top+r.padding.bottom))/p.y;if(!(g<0||v<0)){var m=Math.min(a.scaleZoom(a.scale*Math.min(v,g)),r.maxZoom),y=ok.convert(r.offset),b=(r.padding.left-r.padding.right)/2,_=(r.padding.top-r.padding.bottom)/2,x=new ok(y.x+b,y.y+_).mult(a.scale/a.zoomScale(m));return{center:a.unproject(u.add(c).div(2).sub(x)),zoom:m,bearing:n}}}},{key:"fitInternal",value:function(e,t,n){return e?(delete(t=Dy(e,t)).padding,t.linear?this.easeTo(t,n):this.flyTo(t,n)):this}}]),n}(s);EA(".l7-map {\n font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.l7-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.l7-map:-webkit-full-screen {\n width: 100%;\n height: 100%;\n}\n\n.l7-canary {\n background-color: salmon;\n}\n\n.l7-canvas-container.l7-interactive,\n.l7-ctrl-group button.l7-ctrl-compass {\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.l7-canvas-container.l7-interactive.l7-track-pointer {\n cursor: pointer;\n}\n\n.l7-canvas-container.l7-interactive:active,\n.l7-ctrl-group button.l7-ctrl-compass:active {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate,\n.l7-canvas-container.l7-touch-zoom-rotate .l7-canvas {\n touch-action: pan-x pan-y;\n}\n\n.l7-canvas-container.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-drag-pan .l7-canvas {\n touch-action: pinch-zoom;\n}\n\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan,\n.l7-canvas-container.l7-touch-zoom-rotate.l7-touch-drag-pan .l7-canvas {\n touch-action: none;\n}\n\n.l7-ctrl-top-left,\n.l7-ctrl-top-right,\n.l7-ctrl-bottom-left,\n.l7-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n.l7-ctrl-top-left { top: 0; left: 0; }\n.l7-ctrl-top-right { top: 0; right: 0; }\n.l7-ctrl-bottom-left { bottom: 0; left: 0; }\n.l7-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.l7-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n.l7-ctrl-top-left .l7-ctrl { margin: 10px 0 0 10px; float: left; }\n.l7-ctrl-top-right .l7-ctrl { margin: 10px 10px 0 0; float: right; }\n.l7-ctrl-bottom-left .l7-ctrl { margin: 0 0 10px 10px; float: left; }\n.l7-ctrl-bottom-right .l7-ctrl { margin: 0 10px 10px 0; float: right; }\n\n\n.l7-crosshair,\n.l7-crosshair .l7-interactive,\n.l7-crosshair .l7-interactive:active {\n cursor: crosshair;\n}\n\n.l7-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n z-index: 10;\n}\n");var mk={create:function(e,t,n){var r=window.document.createElement(e);return void 0!==t&&(r.className=t),n&&n.appendChild(r),r},createNS:function(e,t){return window.document.createElementNS(e,t)}},yk=window.document&&window.document.documentElement.style;function bk(e){if(!yk)return e[0];var t,n=po(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r in yk)return r}}catch(e){n.e(e)}finally{n.f()}return e[0]}var _k,xk=bk(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);mk.disableDrag=function(){yk&&xk&&(_k=yk[xk],yk[xk]="none")},mk.enableDrag=function(){yk&&xk&&(yk[xk]=_k)};var wk=bk(["transform","WebkitTransform"]);mk.setTransform=function(e,t){e.style[wk]=t};var Sk=!1;try{var Ek=Object.defineProperty({},"passive",{get:function(){Sk=!0}});window.addEventListener("test",Ek,Ek),window.removeEventListener("test",Ek,Ek)}catch(e){Sk=!1}mk.addEventListener=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};"passive"in r&&Sk?e.addEventListener(t,n,r):e.addEventListener(t,n,r.capture)},mk.removeEventListener=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};"passive"in r&&Sk?e.removeEventListener(t,n,r):e.removeEventListener(t,n,r.capture)};var Ak=function e(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",e,!0)};mk.suppressClick=function(){window.addEventListener("click",Ak,!0),window.setTimeout((function(){window.removeEventListener("click",Ak,!0)}),0)},mk.mousePos=function(e,t){var n=e.getBoundingClientRect();return new ok(t.clientX-n.left-e.clientLeft,t.clientY-n.top-e.clientTop)},mk.touchPos=function(e,t){var n,r=e.getBoundingClientRect(),i=[],o=po(t);try{for(o.s();!(n=o.n()).done;){var a=n.value;i.push(new ok(a.clientX-r.left-e.clientLeft,a.clientY-r.top-e.clientTop))}}catch(e){o.e(e)}finally{o.f()}return i},mk.mouseButton=function(e){return void 0!==window.InstallTrigger&&2===e.button&&e.ctrlKey&&window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},mk.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var Tk=function(e){Ji(n,e);var t=so(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Wi(this,n);var s=mk.mousePos(r.getCanvasContainer(),i),u=r.unproject(s);return(o=t.call(this,e,Dy({point:s,lngLat:u,originalEvent:i},a))).type=void 0,o.target=void 0,o.originalEvent=void 0,o.point=void 0,o.lngLat=void 0,o.defaultPrevented=void 0,o.defaultPrevented=!1,o.target=r,o}return Xi(n,[{key:"preventDefault",value:function(){this.defaultPrevented=!0}}]),n}(vk),kk=function(e){Ji(n,e);var t=so(n);function n(e,r,i){var o;Wi(this,n);var a="touchend"===e?i.changedTouches:i.touches,s=mk.touchPos(r.getCanvasContainer(),a),u=s.map((function(e){return r.unproject(e)})),c=s.reduce((function(e,t,n,r){return e.add(t.div(r.length))}),new ok(0,0)),l=r.unproject(c);return(o=t.call(this,e,{points:s,point:c,lngLats:u,lngLat:l,originalEvent:i})).type=void 0,o.target=void 0,o.originalEvent=void 0,o.lngLat=void 0,o.point=void 0,o.points=void 0,o.lngLats=void 0,o.defaultPrevented=void 0,o.defaultPrevented=!1,o}return Xi(n,[{key:"preventDefault",value:function(){this.defaultPrevented=!0}}]),n}(vk),Mk=function(e){Ji(n,e);var t=so(n);function n(e,r,i){var o;return Wi(this,n),(o=t.call(this,e,{originalEvent:i})).type=void 0,o.originalEvent=void 0,o.defaultPrevented=void 0,o.target=void 0,o.defaultPrevented=!1,o}return Xi(n,[{key:"preventDefault",value:function(){this.defaultPrevented=!0}}]),n}(vk),Ck=function(){function e(t){Wi(this,e),this.map=void 0,this.delayContextMenu=void 0,this.contextMenuEvent=void 0,this.map=t}return Xi(e,[{key:"reset",value:function(){this.delayContextMenu=!1,delete this.contextMenuEvent}},{key:"mousemove",value:function(e){this.map.emit(e.type,new Tk(e.type,this.map,e))}},{key:"mousedown",value:function(){this.delayContextMenu=!0}},{key:"mouseup",value:function(){this.delayContextMenu=!1,this.contextMenuEvent&&(this.map.emit("contextmenu",new Tk("contextmenu",this.map,this.contextMenuEvent)),delete this.contextMenuEvent)}},{key:"contextmenu",value:function(e){this.delayContextMenu?this.contextMenuEvent=e:this.map.emit(e.type,new Tk(e.type,this.map,e)),this.map.listeners("contextmenu")&&e.preventDefault()}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){return!0}},{key:"disable",value:function(){return!1}}]),e}(),Ik=function(){function e(t,n){Wi(this,e),this.map=void 0,this.el=void 0,this.container=void 0,this.enabled=void 0,this.active=void 0,this.startPos=void 0,this.lastPos=void 0,this.box=void 0,this.clickTolerance=void 0,this.map=t,this.el=t.getCanvasContainer(),this.container=t.getContainer(),this.clickTolerance=n.clickTolerance||1}return Xi(e,[{key:"isEnabled",value:function(){return!!this.enabled}},{key:"isActive",value:function(){return!!this.active}},{key:"enable",value:function(){this.isEnabled()||(this.enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this.enabled=!1)}},{key:"mousedown",value:function(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(mk.disableDrag(),this.startPos=this.lastPos=t,this.active=!0)}},{key:"mousemoveWindow",value:function(e,t){if(this.active){var n=t;if(!(this.lastPos.equals(n)||!this.box&&n.dist(this.startPos)<this.clickTolerance)){var r=this.startPos;this.lastPos=n,this.box||(this.box=mk.create("div","l7-boxzoom",this.container),this.container.classList.add("l7-crosshair"),this.fireEvent("boxzoomstart",e));var i=Math.min(r.x,n.x),o=Math.max(r.x,n.x),a=Math.min(r.y,n.y),s=Math.max(r.y,n.y);mk.setTransform(this.box,"translate(".concat(i,"px,").concat(a,"px)")),this.box&&(this.box.style.width="".concat(o-i,"px"),this.box.style.height="".concat(s-a,"px"))}}}},{key:"mouseupWindow",value:function(e,t){var n=this;if(this.active&&0===e.button){var r=this.startPos,i=t;if(this.reset(),mk.suppressClick(),r.x!==i.x||r.y!==i.y)return this.map.emit("boxzoomend",new vk("boxzoomend",{originalEvent:e})),{cameraAnimation:function(e){return e.fitScreenCoordinates(r,i,n.map.getBearing(),{linear:!0})}};this.fireEvent("boxzoomcancel",e)}}},{key:"keydown",value:function(e){this.active&&27===e.keyCode&&(this.reset(),this.fireEvent("boxzoomcancel",e))}},{key:"reset",value:function(){this.active=!1,this.container.classList.remove("l7-crosshair"),this.box&&(mk.remove(this.box),this.box=null),mk.enableDrag(),delete this.startPos,delete this.lastPos}},{key:"fireEvent",value:function(e,t){return this.map.emit(e,new vk(e,{originalEvent:t}))}}]),e}(),Pk=function(){function e(){Wi(this,e),this.enabled=void 0,this.active=void 0,this.reset()}return Xi(e,[{key:"reset",value:function(){this.active=!1}},{key:"dblclick",value:function(e,t){return e.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(t)},{originalEvent:e})}}}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),e}(),Ok=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).type="renderFrame",e.timeStamp=void 0,e}return n}(vk),Rk={linearity:.3,easing:WT(0,0,.3,1)},Lk=Dy({deceleration:2500,maxSpeed:1400},Rk),Nk=Dy({deceleration:20,maxSpeed:1400},Rk),Dk=Dy({deceleration:1e3,maxSpeed:360},Rk),jk=Dy({deceleration:1e3,maxSpeed:90},Rk),zk=function(){function e(t){Wi(this,e),this.map=void 0,this.inertiaBuffer=void 0,this.map=t,this.clear()}return Xi(e,[{key:"clear",value:function(){this.inertiaBuffer=[]}},{key:"record",value:function(e){this.drainInertiaBuffer(),this.inertiaBuffer.push({time:KT(),settings:e})}},{key:"drainInertiaBuffer",value:function(){for(var e=this.inertiaBuffer,t=KT();e.length>0&&t-e[0].time>160;)e.shift()}},{key:"onMoveEnd",value:function(e){if(this.drainInertiaBuffer(),!(this.inertiaBuffer.length<2)){var t,n={zoom:0,bearing:0,pitch:0,pan:new ok(0,0),pinchAround:void 0,around:void 0},r=po(this.inertiaBuffer);try{for(r.s();!(t=r.n()).done;){var i=t.value.settings;n.zoom+=i.zoomDelta||0,n.bearing+=i.bearingDelta||0,n.pitch+=i.pitchDelta||0,i.panDelta&&n.pan._add(i.panDelta),i.around&&(n.around=i.around),i.pinchAround&&(n.pinchAround=i.pinchAround)}}catch(e){r.e(e)}finally{r.f()}var o=this.inertiaBuffer[this.inertiaBuffer.length-1].time-this.inertiaBuffer[0].time,a={};if(n.pan.mag()){var s=Bk(n.pan.mag(),o,Dy({},Lk,e||{}));a.offset=n.pan.mult(s.amount/n.pan.mag()),a.center=this.map.transform.center,Fk(a,s)}if(n.zoom){var u=Bk(n.zoom,o,Nk);a.zoom=this.map.transform.zoom+u.amount,Fk(a,u)}if(n.bearing){var c=Bk(n.bearing,o,Dk);a.bearing=this.map.transform.bearing+HT(c.amount,-179,179),Fk(a,c)}if(n.pitch){var l=Bk(n.pitch,o,jk);a.pitch=this.map.transform.pitch+l.amount,Fk(a,l)}if(a.zoom||a.bearing){var f=void 0===n.pinchAround?n.around:n.pinchAround;a.around=f?this.map.unproject(f):this.map.getCenter()}return this.clear(),Dy(a,{noMoveStart:!0})}}}]),e}();function Fk(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Bk(e,t,n){var r=n.maxSpeed,i=n.linearity,o=n.deceleration,a=HT(e*i/(t/1e3),-r,r),s=Math.abs(a)/(o*i);return{easing:n.easing,duration:1e3*s,amount:a*(s/2)}}var Uk={panStep:100,bearingStep:15,pitchStep:10},Vk=function(){function e(){Wi(this,e),this.enabled=void 0,this.active=void 0,this.panStep=void 0,this.bearingStep=void 0,this.pitchStep=void 0;var t=Uk;this.panStep=t.panStep,this.bearingStep=t.bearingStep,this.pitchStep=t.pitchStep}return Xi(e,[{key:"reset",value:function(){this.active=!1}},{key:"keydown",value:function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var n=0,r=0,i=0,o=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),o=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),o=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),a=1);break;default:return}return{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:Gk,zoom:n?Math.round(u)+n*(e.shiftKey?2:1):u,bearing:s.getBearing()+r*t.bearingStep,pitch:s.getPitch()+i*t.pitchStep,offset:[-o*t.panStep,-a*t.panStep],center:s.getCenter()},{originalEvent:e})}}}}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),e}();function Gk(e){return e*(2-e)}var Hk,Zk=function(){function e(t,n){Wi(this,e),this.mousedownPos=void 0,this.clickTolerance=void 0,this.map=void 0,this.map=t,this.clickTolerance=n.clickTolerance}return Xi(e,[{key:"reset",value:function(){delete this.mousedownPos}},{key:"wheel",value:function(e){return this.firePreventable(new Mk(e.type,this.map,e))}},{key:"mousedown",value:function(e,t){return this.mousedownPos=t,this.firePreventable(new Tk(e.type,this.map,e))}},{key:"mouseup",value:function(e){this.map.emit(e.type,new Tk(e.type,this.map,e))}},{key:"click",value:function(e,t){this.mousedownPos&&this.mousedownPos.dist(t)>=this.clickTolerance||this.map.emit(e.type,new Tk(e.type,this.map,e))}},{key:"dblclick",value:function(e){return this.firePreventable(new Tk(e.type,this.map,e))}},{key:"mouseover",value:function(e){this.map.emit(e.type,new Tk(e.type,this.map,e))}},{key:"mouseout",value:function(e){this.map.emit(e.type,new Tk(e.type,this.map,e))}},{key:"touchstart",value:function(e){return this.firePreventable(new kk(e.type,this.map,e))}},{key:"touchmove",value:function(e){this.map.emit(e.type,new kk(e.type,this.map,e))}},{key:"touchend",value:function(e){this.map.emit(e.type,new kk(e.type,this.map,e))}},{key:"touchcancel",value:function(e){this.map.emit(e.type,new kk(e.type,this.map,e))}},{key:"firePreventable",value:function(e){if(this.map.emit(e.type,e),e.defaultPrevented)return{}}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){return!1}},{key:"disable",value:function(){return!1}}]),e}(),Wk=(Yi(Hk={},0,1),Yi(Hk,2,2),Hk);var qk=function(){function e(t){Wi(this,e),this.enabled=void 0,this.active=void 0,this.lastPoint=void 0,this.eventButton=void 0,this.moved=void 0,this.clickTolerance=void 0,this.reset(),this.clickTolerance=t.clickTolerance||1}return Xi(e,[{key:"reset",value:function(){this.active=!1,this.moved=!1,delete this.lastPoint,delete this.eventButton}},{key:"mousedown",value:function(e,t){if(!this.lastPoint){var n=mk.mouseButton(e);this.correctButton(e,n)&&(this.lastPoint=t,this.eventButton=n)}}},{key:"mousemoveWindow",value:function(e,t){var n=this.lastPoint;if(n)if(e.preventDefault(),function(e,t){var n=Wk[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this.eventButton))this.reset();else if(this.moved||!(t.dist(n)<this.clickTolerance))return this.moved=!0,this.lastPoint=t,this.move(n,t)}},{key:"mouseupWindow",value:function(e){this.lastPoint&&(mk.mouseButton(e)===this.eventButton&&(this.moved&&mk.suppressClick(),this.reset()))}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}},{key:"correctButton",value:function(e,t){return!1}},{key:"move",value:function(e,t){}}]),e}(),Xk=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"mousedown",value:function(e,t){uo($i(n.prototype),"mousedown",this).call(this,e,t),this.lastPoint&&(this.active=!0)}},{key:"move",value:function(e,t){return{around:t,panDelta:t.sub(e)}}},{key:"correctButton",value:function(e,t){return 0===t&&!e.ctrlKey}}]),n}(qk),Yk=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"correctButton",value:function(e,t){return 0===t&&e.ctrlKey||2===t}},{key:"move",value:function(e,t){var n=-.5*(t.y-e.y);if(n)return this.active=!0,{pitchDelta:n}}},{key:"contextmenu",value:function(e){e.preventDefault()}}]),n}(qk),Kk=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"contextmenu",value:function(e){e.preventDefault()}},{key:"correctButton",value:function(e,t){return 0===t&&e.ctrlKey||2===t}},{key:"move",value:function(e,t){var n=.8*(t.x-e.x);if(n)return this.active=!0,{bearingDelta:n}}}]),n}(qk),Qk=function(){function e(t,n){var r=this;Wi(this,e),this.map=void 0,this.el=void 0,this.enabled=void 0,this.active=void 0,this.zooming=void 0,this.aroundCenter=void 0,this.around=void 0,this.aroundPoint=void 0,this.type=void 0,this.lastValue=void 0,this.timeout=void 0,this.finishTimeout=void 0,this.lastWheelEvent=void 0,this.lastWheelEventTime=void 0,this.startZoom=void 0,this.targetZoom=void 0,this.delta=void 0,this.easing=void 0,this.prevEase=void 0,this.frameId=void 0,this.handler=void 0,this.defaultZoomRate=void 0,this.wheelZoomRate=void 0,this.onScrollFrame=function(){if(r.frameId&&(r.frameId=null,r.isActive())){var e=r.map.transform;if(0!==r.delta){var t="wheel"===r.type&&Math.abs(r.delta)>4.000244140625?r.wheelZoomRate:r.defaultZoomRate,n=2/(1+Math.exp(-Math.abs(r.delta*t)));r.delta<0&&0!==n&&(n=1/n);var i="number"==typeof r.targetZoom?e.zoomScale(r.targetZoom):e.scale;r.targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(i*n))),"wheel"===r.type&&(r.startZoom=e.zoom,r.easing=r.smoothOutEasing(200)),r.delta=0}var o,a="number"==typeof r.targetZoom?r.targetZoom:e.zoom,s=r.startZoom,u=r.easing,c=!1;if("wheel"===r.type&&s&&u){var l=Math.min((KT()-r.lastWheelEventTime)/200,1);o=ZT(s,a,u(l)),l<1?r.frameId||(r.frameId=!0):c=!0}else o=a,c=!0;return r.active=!0,c&&(r.active=!1,r.finishTimeout=setTimeout((function(){r.zooming=!1,r.handler.triggerRenderFrame(),delete r.targetZoom,delete r.finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-e.zoom,around:r.aroundPoint,originalEvent:r.lastWheelEvent}}},this.map=t,this.el=t.getCanvasContainer(),this.handler=n,this.delta=0,this.defaultZoomRate=.01,this.wheelZoomRate=1/450}return Xi(e,[{key:"setZoomRate",value:function(e){this.defaultZoomRate=e}},{key:"setWheelZoomRate",value:function(e){this.wheelZoomRate=e}},{key:"isEnabled",value:function(){return!!this.enabled}},{key:"isActive",value:function(){return!!this.active||void 0!==this.finishTimeout}},{key:"isZooming",value:function(){return!!this.zooming}},{key:"enable",value:function(e){this.isEnabled()||(this.enabled=!0,this.aroundCenter=e&&"center"===e.around)}},{key:"disable",value:function(){this.isEnabled()&&(this.enabled=!1)}},{key:"wheel",value:function(e){if(this.isEnabled()){var t=e.deltaMode===window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=KT(),r=n-(this.lastWheelEventTime||0);this.lastWheelEventTime=n,0!==t&&t%4.000244140625==0?this.type="wheel":0!==t&&Math.abs(t)<4?this.type="trackpad":r>400?(this.type=null,this.lastValue=t,this.timeout=setTimeout(this.onTimeout,40,e)):this.type||(this.type=Math.abs(r*t)<200?"trackpad":"wheel",this.timeout&&(clearTimeout(this.timeout),this.timeout=null,t+=this.lastValue)),e.shiftKey&&t&&(t/=4),this.type&&(this.lastWheelEvent=e,this.delta-=t,this.active||this.start(e)),e.preventDefault()}}},{key:"renderFrame",value:function(){return this.onScrollFrame()}},{key:"reset",value:function(){this.active=!1}},{key:"onTimeout",value:function(e){this.type="wheel",this.delta-=this.lastValue,this.active||this.start(e)}},{key:"start",value:function(e){if(this.delta){this.frameId&&(this.frameId=null),this.active=!0,this.isZooming()||(this.zooming=!0),this.finishTimeout&&(clearTimeout(this.finishTimeout),delete this.finishTimeout);var t=mk.mousePos(this.el,e);this.around=ik.convert(this.aroundCenter?this.map.getCenter():this.map.unproject(t)),this.aroundPoint=this.map.transform.locationPoint(this.around),this.frameId||(this.frameId=!0,this.handler.triggerRenderFrame())}}},{key:"smoothOutEasing",value:function(e){var t=qT;if(this.prevEase){var n=this.prevEase,r=(KT()-n.start)/n.duration,i=n.easing(r+.01)-n.easing(r),o=.27/Math.sqrt(i*i+1e-4)*.01;t=WT(o,Math.sqrt(.0729-o*o),.25,1)}return this.prevEase={start:KT(),duration:e,easing:t},t}}]),e}(),Jk=function(){function e(t,n){Wi(this,e),this.clickZoom=void 0,this.tapZoom=void 0,this.clickZoom=t,this.tapZoom=n}return Xi(e,[{key:"enable",value:function(){this.clickZoom.enable(),this.tapZoom.enable()}},{key:"disable",value:function(){this.clickZoom.disable(),this.tapZoom.disable()}},{key:"isEnabled",value:function(){return this.clickZoom.isEnabled()&&this.tapZoom.isEnabled()}},{key:"isActive",value:function(){return this.clickZoom.isActive()||this.tapZoom.isActive()}}]),e}(),$k=function(){function e(t,n,r){Wi(this,e),this.inertiaOptions=void 0,this.el=void 0,this.mousePan=void 0,this.touchPan=void 0,this.el=t,this.mousePan=n,this.touchPan=r}return Xi(e,[{key:"enable",value:function(e){this.inertiaOptions=e||{},this.mousePan.enable(),this.touchPan.enable(),this.el.classList.add("l7-touch-drag-pan")}},{key:"disable",value:function(){this.mousePan.disable(),this.touchPan.disable(),this.el.classList.remove("l7-touch-drag-pan")}},{key:"isEnabled",value:function(){return this.mousePan.isEnabled()&&this.touchPan.isEnabled()}},{key:"isActive",value:function(){return this.mousePan.isActive()||this.touchPan.isActive()}}]),e}(),eM=function(){function e(t,n,r){Wi(this,e),this.mouseRotate=void 0,this.mousePitch=void 0,this.pitchWithRotate=void 0,this.pitchWithRotate=t.pitchWithRotate,this.mouseRotate=n,this.mousePitch=r}return Xi(e,[{key:"enable",value:function(){this.mouseRotate.enable(),this.pitchWithRotate&&this.mousePitch.enable()}},{key:"disable",value:function(){this.mouseRotate.disable(),this.mousePitch.disable()}},{key:"isEnabled",value:function(){return this.mouseRotate.isEnabled()&&(!this.pitchWithRotate||this.mousePitch.isEnabled())}},{key:"isActive",value:function(){return this.mouseRotate.isActive()||this.mousePitch.isActive()}}]),e}(),tM=function(){function e(t,n,r,i){Wi(this,e),this.el=void 0,this.touchZoom=void 0,this.touchRotate=void 0,this.tapDragZoom=void 0,this.rotationDisabled=void 0,this.enabled=void 0,this.el=t,this.touchZoom=n,this.touchRotate=r,this.tapDragZoom=i,this.rotationDisabled=!1,this.enabled=!0}return Xi(e,[{key:"enable",value:function(e){this.touchZoom.enable(e),this.rotationDisabled||this.touchRotate.enable(e),this.tapDragZoom.enable(),this.el.classList.add("l7-touch-zoom-rotate")}},{key:"disable",value:function(){this.touchZoom.disable(),this.touchRotate.disable(),this.tapDragZoom.disable(),this.el.classList.remove("l7-touch-zoom-rotate")}},{key:"isEnabled",value:function(){return this.touchZoom.isEnabled()&&(this.rotationDisabled||this.touchRotate.isEnabled())&&this.tapDragZoom.isEnabled()}},{key:"isActive",value:function(){return this.touchZoom.isActive()||this.touchRotate.isActive()||this.tapDragZoom.isActive()}},{key:"disableRotation",value:function(){this.rotationDisabled=!0,this.touchRotate.disable()}},{key:"enableRotation",value:function(){this.rotationDisabled=!1,this.touchZoom.isEnabled()&&this.touchRotate.enable()}}]),e}();function nM(e,t){for(var n={},r=0;r<e.length;r++)n[e[r].identifier]=t[r];return n}var rM=function(){function e(t){Wi(this,e),this.numTouches=void 0,this.centroid=void 0,this.startTime=void 0,this.aborted=void 0,this.touches=void 0,this.reset(),this.numTouches=t.numTouches}return Xi(e,[{key:"reset",value:function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}},{key:"touchstart",value:function(e,t,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){var t,n=new ok(0,0),r=po(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;n._add(i)}}catch(e){r.e(e)}finally{r.f()}return n.div(e.length)}(t),this.touches=nM(n,t)))}},{key:"touchmove",value:function(e,t,n){if(!this.aborted&&this.centroid){var r=nM(n,t);for(var i in this.touches)if(this.touches[i]){var o=this.touches[i],a=r[i];(!a||a.dist(o)>30)&&(this.aborted=!0)}}}},{key:"touchend",value:function(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}}}]),e}(),iM=function(){function e(t){Wi(this,e),this.singleTap=void 0,this.numTaps=void 0,this.lastTime=void 0,this.lastTap=void 0,this.count=void 0,this.singleTap=new rM(t),this.numTaps=t.numTaps,this.reset()}return Xi(e,[{key:"reset",value:function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}},{key:"touchstart",value:function(e,t,n){this.singleTap.touchstart(e,t,n)}},{key:"touchmove",value:function(e,t,n){this.singleTap.touchmove(e,t,n)}},{key:"touchend",value:function(e,t,n){var r=this.singleTap.touchend(e,t,n);if(r){var i=e.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(r)<30;if(i&&o||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}]),e}(),oM=function(){function e(){Wi(this,e),this.enabled=void 0,this.active=void 0,this.swipePoint=void 0,this.swipeTouch=void 0,this.tapTime=void 0,this.tap=void 0,this.tap=new iM({numTouches:1,numTaps:1}),this.reset()}return Xi(e,[{key:"reset",value:function(){this.active=!1,delete this.swipePoint,delete this.swipeTouch,delete this.tapTime,this.tap.reset()}},{key:"touchstart",value:function(e,t,n){this.swipePoint||(this.tapTime&&e.timeStamp-this.tapTime>500&&this.reset(),this.tapTime?n.length>0&&(this.swipePoint=t[0],this.swipeTouch=n[0].identifier):this.tap.touchstart(e,t,n))}},{key:"touchmove",value:function(e,t,n){if(this.tapTime){if(this.swipePoint){if(n[0].identifier!==this.swipeTouch)return;var r=t[0],i=r.y-this.swipePoint.y;return this.swipePoint=r,e.preventDefault(),this.active=!0,{zoomDelta:i/128}}}else this.tap.touchmove(e,t,n)}},{key:"touchend",value:function(e,t,n){this.tapTime?this.swipePoint&&0===n.length&&this.reset():this.tap.touchend(e,t,n)&&(this.tapTime=e.timeStamp)}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),e}(),aM=function(){function e(){Wi(this,e),this.enabled=void 0,this.active=void 0,this.zoomIn=void 0,this.zoomOut=void 0,this.zoomIn=new iM({numTouches:1,numTaps:2}),this.zoomOut=new iM({numTouches:2,numTaps:1}),this.reset()}return Xi(e,[{key:"reset",value:function(){this.active=!1,this.zoomIn.reset(),this.zoomOut.reset()}},{key:"touchstart",value:function(e,t,n){this.zoomIn.touchstart(e,t,n),this.zoomOut.touchstart(e,t,n)}},{key:"touchmove",value:function(e,t,n){this.zoomIn.touchmove(e,t,n),this.zoomOut.touchmove(e,t,n)}},{key:"touchend",value:function(e,t,n){var r=this,i=this.zoomIn.touchend(e,t,n),o=this.zoomOut.touchend(e,t,n);return i?(this.active=!0,e.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}}):o?(this.active=!0,e.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(o)},{originalEvent:e})}}):void 0}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),e}(),sM=function(){function e(t){Wi(this,e),this.enabled=void 0,this.active=void 0,this.touches=void 0,this.minTouches=void 0,this.clickTolerance=void 0,this.sum=void 0,this.minTouches=1,this.clickTolerance=t.clickTolerance||1,this.reset()}return Xi(e,[{key:"reset",value:function(){this.active=!1,this.touches={},this.sum=new ok(0,0)}},{key:"touchstart",value:function(e,t,n){return this.calculateTransform(e,t,n)}},{key:"touchmove",value:function(e,t,n){if(this.active)return e.preventDefault(),this.calculateTransform(e,t,n)}},{key:"touchend",value:function(e,t,n){this.calculateTransform(e,t,n),this.active&&n.length<this.minTouches&&this.reset()}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}},{key:"calculateTransform",value:function(e,t,n){n.length>0&&(this.active=!0);var r=nM(n,t),i=new ok(0,0),o=new ok(0,0),a=0;for(var s in r)if(r[s]){var u=r[s],c=this.touches[s];c&&(i._add(u),o._add(u.sub(c)),a++,r[s]=u)}if(this.touches=r,!(a<this.minTouches)&&o.mag()){var l=o.div(a);if(this.sum._add(l),!(this.sum.mag()<this.clickTolerance))return{around:i.div(a),panDelta:l}}}}]),e}(),uM=function(){function e(){Wi(this,e),this.enabled=void 0,this.active=void 0,this.firstTwoTouches=void 0,this.vector=void 0,this.startVector=void 0,this.aroundCenter=void 0,this.reset()}return Xi(e,[{key:"reset",value:function(){this.active=!1,delete this.firstTwoTouches}},{key:"start",value:function(e){}},{key:"move",value:function(e,t,n){}},{key:"touchstart",value:function(e,t,n){this.firstTwoTouches||n.length<2||(this.firstTwoTouches=[n[0].identifier,n[1].identifier],this.start([t[0],t[1]]))}},{key:"touchmove",value:function(e,t,n){if(this.firstTwoTouches){e.preventDefault();var r=co(this.firstTwoTouches,2),i=r[0],o=r[1],a=cM(n,t,i),s=cM(n,t,o);if(a&&s){var u=this.aroundCenter?null:a.add(s).div(2);return this.move([a,s],u,e)}}}},{key:"touchend",value:function(e,t,n){if(this.firstTwoTouches){var r=co(this.firstTwoTouches,2),i=r[0],o=r[1],a=cM(n,t,i),s=cM(n,t,o);a&&s||(this.active&&mk.suppressClick(),this.reset())}}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(e){this.enabled=!0,this.aroundCenter=!!e&&"center"===e.around}},{key:"disable",value:function(){this.enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"isActive",value:function(){return this.active}}]),e}();function cM(e,t,n){for(var r=0;r<e.length;r++)if(e[r].identifier===n)return t[r]}function lM(e){return Math.abs(e.y)>Math.abs(e.x)}var fM=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).valid=void 0,e.firstMove=void 0,e.lastPoints=void 0,e}return Xi(n,[{key:"reset",value:function(){uo($i(n.prototype),"reset",this).call(this),this.valid=void 0,delete this.firstMove,delete this.lastPoints}},{key:"start",value:function(e){this.lastPoints=e,lM(e[0].sub(e[1]))&&(this.valid=!1)}},{key:"move",value:function(e,t,n){var r=e[0].sub(this.lastPoints[0]),i=e[1].sub(this.lastPoints[1]);if(this.valid=this.gestureBeginsVertically(r,i,n.timeStamp),this.valid){this.lastPoints=e,this.active=!0;return{pitchDelta:-.5*((r.y+i.y)/2)}}}},{key:"gestureBeginsVertically",value:function(e,t,n){if(void 0!==this.valid)return this.valid;var r=e.mag()>=2,i=t.mag()>=2;if(r||i){if(!r||!i)return void 0===this.firstMove&&(this.firstMove=n),n-this.firstMove<100&&void 0;var o=e.y>0==t.y>0;return lM(e)&&lM(t)&&o}}}]),n}(uM);function hM(e,t){return 180*e.angleWith(t)/Math.PI}var dM=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).minDiameter=void 0,e}return Xi(n,[{key:"reset",value:function(){uo($i(n.prototype),"reset",this).call(this),delete this.minDiameter,delete this.startVector,delete this.vector}},{key:"start",value:function(e){this.startVector=this.vector=e[0].sub(e[1]),this.minDiameter=e[0].dist(e[1])}},{key:"move",value:function(e,t){var n=this.vector;if(this.vector=e[0].sub(e[1]),this.active||!this.isBelowThreshold(this.vector))return this.active=!0,{bearingDelta:hM(this.vector,n),pinchAround:t}}},{key:"isBelowThreshold",value:function(e){this.minDiameter=Math.min(this.minDiameter,e.mag());var t=25/(Math.PI*this.minDiameter)*360,n=hM(e,this.startVector);return Math.abs(n)<t}}]),n}(uM);function pM(e,t){return Math.log(e/t)/Math.LN2}var vM=function(e){Ji(n,e);var t=so(n);function n(){var e;Wi(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).distance=void 0,e.startDistance=void 0,e}return Xi(n,[{key:"reset",value:function(){uo($i(n.prototype),"reset",this).call(this),delete this.distance,delete this.startDistance}},{key:"start",value:function(e){this.startDistance=this.distance=e[0].dist(e[1])}},{key:"move",value:function(e,t){var n=this.distance;if(this.distance=e[0].dist(e[1]),this.active||!(Math.abs(pM(this.distance,this.startDistance))<.1))return this.active=!0,{zoomDelta:pM(this.distance,n),pinchAround:t}}}]),n}(uM),gM=function(e){return e.zoom||e.drag||e.pitch||e.rotate};function mM(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var yM=function(){function e(t,n){var r=this;Wi(this,e),this.map=void 0,this.el=void 0,this.handlers=void 0,this.eventsInProgress=void 0,this.frameId=void 0,this.inertia=void 0,this.bearingSnap=void 0,this.handlersById=void 0,this.updatingCamera=void 0,this.changes=void 0,this.previousActiveHandlers=void 0,this.bearingChanged=void 0,this.listeners=void 0,this.handleWindowEvent=function(e){r.handleEvent(e,"".concat(e.type,"Window"))},this.handleEvent=function(e,t){if("blur"!==e.type){r.updatingCamera=!0;var n,i="renderFrame"===e.type?void 0:e,o={needsRenderFrame:!1},a={},s={},u=e.touches?r.getMapTouches(e.touches):void 0,c=u?mk.touchPos(r.el,u):mk.mousePos(r.el,e),l=po(r.handlers);try{for(l.s();!(n=l.n()).done;){var f=n.value,h=f.handlerName,d=f.handler,p=f.allowed;if(d.isEnabled()){var v=void 0;if(r.blockedByActive(s,p,h))d.reset();else{var g=t||e.type;d&&d[g]&&(v=d[g](e,c,u),r.mergeIHandlerResult(o,a,v,h,i),v&&v.needsRenderFrame&&r.triggerRenderFrame())}(v||d.isActive())&&(s[h]=d)}}}catch(e){l.e(e)}finally{l.f()}var m={};for(var y in r.previousActiveHandlers)s[y]||(m[y]=i);r.previousActiveHandlers=s,(Object.keys(m).length||mM(o))&&(r.changes.push([o,a,m]),r.triggerRenderFrame()),(Object.keys(s).length||mM(o))&&r.map.stop(!0),r.updatingCamera=!1;var b=o.cameraAnimation;b&&(r.inertia.clear(),r.fireEvents({},{}),r.changes=[],b(r.map))}else r.stop()},this.map=t,this.el=this.map.getCanvasContainer(),this.handlers=[],this.handlersById={},this.changes=[],this.inertia=new zk(t),this.bearingSnap=n.bearingSnap,this.previousActiveHandlers={},this.eventsInProgress={},this.addDefaultHandlers(n);var i=this.el;this.listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[window.document,"mousemove",{capture:!0}],[window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]];var o,a=po(this.listeners);try{for(a.s();!(o=a.n()).done;){var s=co(o.value,3),u=s[0],c=s[1],l=s[2];mk.addEventListener(u,c,u===window.document?this.handleWindowEvent:this.handleEvent,l)}}catch(e){a.e(e)}finally{a.f()}}return Xi(e,[{key:"destroy",value:function(){var e,t=po(this.listeners);try{for(t.s();!(e=t.n()).done;){var n=co(e.value,3),r=n[0],i=n[1],o=n[2];mk.removeEventListener(r,i,r===window.document?this.handleWindowEvent:this.handleEvent,o)}}catch(e){t.e(e)}finally{t.f()}}},{key:"stop",value:function(){if(!this.updatingCamera){var e,t=po(this.handlers);try{for(t.s();!(e=t.n()).done;){e.value.handler.reset()}}catch(e){t.e(e)}finally{t.f()}this.inertia.clear(),this.fireEvents({},{}),this.changes=[]}}},{key:"isActive",value:function(){var e,t=po(this.handlers);try{for(t.s();!(e=t.n()).done;){if(e.value.handler.isActive())return!0}}catch(e){t.e(e)}finally{t.f()}return!1}},{key:"isZooming",value:function(){return!!this.eventsInProgress.zoom||this.map.scrollZoom.isZooming()}},{key:"isRotating",value:function(){return!!this.eventsInProgress.rotate}},{key:"isMoving",value:function(){return Boolean(gM(this.eventsInProgress))||this.isZooming()}},{key:"mergeIHandlerResult",value:function(e,t,n,r,i){if(n){Dy(e,n);var o={handlerName:r,originalEvent:n.originalEvent||i};void 0!==n.zoomDelta&&(t.zoom=o),void 0!==n.panDelta&&(t.drag=o),void 0!==n.pitchDelta&&(t.pitch=o),void 0!==n.bearingDelta&&(t.rotate=o)}}},{key:"triggerRenderFrame",value:function(){var e=this;void 0===this.frameId&&(this.frameId=this.map.requestRenderFrame((function(t){delete e.frameId,e.handleEvent(new Ok("renderFrame",{timeStamp:t})),e.applyChanges()})))}},{key:"addDefaultHandlers",value:function(e){var t=this.map,n=t.getCanvasContainer();this.add("mapEvent",new Zk(t,e));var r=t.boxZoom=new Ik(t,e);this.add("boxZoom",r);var i=new aM,o=new Pk;t.doubleClickZoom=new Jk(o,i),this.add("tapZoom",i),this.add("clickZoom",o);var a=new oM;this.add("tapDragZoom",a);var s=t.touchPitch=new fM;this.add("touchPitch",s);var u=new Yk(e),c=new Kk(e);t.dragRotate=new eM(e,u,c),this.add("mouseRotate",u,["mousePitch"]),this.add("mousePitch",c,["mouseRotate"]);var l=new Xk(e),f=new sM(e);t.dragPan=new $k(n,l,f),this.add("mousePan",l),this.add("touchPan",f,["touchZoom","touchRotate"]);var h=new dM,d=new vM;t.touchZoomRotate=new tM(n,d,h,a),this.add("touchRotate",h,["touchPan","touchZoom"]),this.add("touchZoom",d,["touchPan","touchRotate"]);var p=t.scrollZoom=new Qk(t,this);this.add("scrollZoom",p,["mousePan"]);var v=t.keyboard=new Vk;this.add("keyboard",v),this.add("blockableMapEvent",new Ck(t));for(var g=0,m=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<m.length;g++){var y=m[g];e.interactive&&e[y]&&t[y].enable(e[y])}}},{key:"add",value:function(e,t,n){this.handlers.push({handlerName:e,handler:t,allowed:n}),this.handlersById[e]=t}},{key:"blockedByActive",value:function(e,t,n){for(var r in e)if(r!==n&&(!t||t.indexOf(r)<0))return!0;return!1}},{key:"getMapTouches",value:function(e){var t,n=[],r=po(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.target;this.el.contains(o)&&n.push(i)}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"applyChanges",value:function(){var e,t={},n={},r={},i=po(this.changes);try{for(i.s();!(e=i.n()).done;){var o=co(e.value,3),a=o[0],s=o[1],u=o[2];a.panDelta&&(t.panDelta=(t.panDelta||new ok(0,0))._add(a.panDelta)),a.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+a.pitchDelta),void 0!==a.around&&(t.around=a.around),void 0!==a.pinchAround&&(t.pinchAround=a.pinchAround),a.noInertia&&(t.noInertia=a.noInertia),Dy(n,s),Dy(r,u)}}catch(e){i.e(e)}finally{i.f()}this.updateMapTransform(t,n,r),this.changes=[]}},{key:"updateMapTransform",value:function(e,t,n){var r=this.map,i=r.transform;if(!mM(e))return this.fireEvents(t,n);var o=e.panDelta,a=e.zoomDelta,s=e.bearingDelta,u=e.pitchDelta,c=e.pinchAround,l=e.around;void 0!==c&&(l=c),r.stop(!0),l=l||r.transform.centerPoint;var f=i.pointLocation(o?l.sub(o):l);s&&(i.bearing+=s),u&&(i.pitch+=u),a&&(i.zoom+=a),i.setLocationAtPoint(f,l),this.map.update(),e.noInertia||this.inertia.record(e),this.fireEvents(t,n)}},{key:"fireEvents",value:function(e,t){var n=this,r=gM(this.eventsInProgress),i=gM(e),o={};for(var a in e)if(e[a]){var s=e[a].originalEvent;this.eventsInProgress[a]||(o["".concat(a,"start")]=s),this.eventsInProgress[a]=e[a]}for(var u in!r&&i&&this.fireEvent("movestart",i.originalEvent),o)o[u]&&this.fireEvent(u,o[u]);for(var c in e.rotate&&(this.bearingChanged=!0),i&&this.fireEvent("move",i.originalEvent),e)if(e[c]){var l=e[c].originalEvent;this.fireEvent(c,l)}var f,h={};for(var d in this.eventsInProgress)if(this.eventsInProgress[d]){var p=this.eventsInProgress[d],v=p.handlerName,g=p.originalEvent;this.handlersById[v].isActive()||(delete this.eventsInProgress[d],f=t[v]||g,h["".concat(d,"end")]=f)}for(var m in h)h[m]&&this.fireEvent(m,h[m]);var y=gM(this.eventsInProgress);if((r||i)&&!y){this.updatingCamera=!0;var b=this.inertia.onMoveEnd(this.map.dragPan.inertiaOptions),_=function(e){return 0!==e&&-n.bearingSnap<e&&e<n.bearingSnap};b?(_(b.bearing||this.map.getBearing())&&(b.bearing=0),this.map.easeTo(b,{originalEvent:f})):(this.map.emit("moveend",new vk("moveend",{originalEvent:f})),_(this.map.getBearing())&&this.map.resetNorth()),this.bearingChanged=!1,this.updatingCamera=!1}}},{key:"fireEvent",value:function(e,t){this.map.emit(e,new vk(e,t?{originalEvent:t}:{}))}}]),e}(),bM=function(){return kg.Date.now()},_M=Math.max,xM=Math.min;var wM=function(e,t,n){var r,i,o,a,s,u,c=0,l=!1,f=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function p(e){return c=e,s=setTimeout(g,t),l?d(e):a}function v(e){var n=e-u;return void 0===u||n>=t||n<0||f&&e-c>=o}function g(){var e=bM();if(v(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-u);return f?xM(n,o-(e-c)):n}(e))}function m(e){return s=void 0,h&&r?d(e):(r=i=void 0,a)}function y(){var e=bM(),n=v(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(f)return clearTimeout(s),s=setTimeout(g,t),d(u)}return void 0===s&&(s=setTimeout(g,t)),a}return t=JE(t)||0,zg(n)&&(l=!!n.leading,o=(f="maxWait"in n)?_M(JE(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0},y.flush=function(){return void 0===s?a:m(bM())},y};var SM=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return zg(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),wM(e,t,{leading:r,maxWait:t,trailing:i})},EM=function(){function e(t){var n=this;Wi(this,e),this.map=void 0,this.updateHash=void 0,this.hashName=void 0,this.onHashChange=function(){var e=n.getCurrentHash();if(e.length>=3&&!e.some((function(e){return isNaN(+e)}))){var t=n.map.dragRotate.isEnabled()&&n.map.touchZoomRotate.isEnabled()?+(e[3]||0):n.map.getBearing();return n.map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},this.getCurrentHash=function(){var e,t=window.location.hash.replace("#","");return n.hashName?(t.split("&").map((function(e){return e.split("=")})).forEach((function(t){t[0]===n.hashName&&(e=t)})),(e&&e[1]||"").split("/")):t.split("/")},this.updateHashUnthrottled=function(){var e=n.getHashString();try{window.history.replaceState(window.history.state,"",e)}catch(e){}},this.hashName=t&&encodeURIComponent(t),this.updateHash=SM(this.updateHashUnthrottled,300)}return Xi(e,[{key:"addTo",value:function(e){return this.map=e,window.addEventListener("hashchange",this.onHashChange,!1),this.map.on("moveend",this.updateHash),this}},{key:"remove",value:function(){return window.removeEventListener("hashchange",this.onHashChange,!1),this.map.off("moveend",this.updateHash),delete this.map,this}},{key:"getHashString",value:function(e){var t=this.map.getCenter(),n=Math.round(100*this.map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,r),o=Math.round(t.lng*i)/i,a=Math.round(t.lat*i)/i,s=this.map.getBearing(),u=this.map.getPitch(),c="";if(c+=e?"/".concat(o,"/").concat(a,"/").concat(n):"".concat(n,"/").concat(a,"/").concat(o),(s||u)&&(c+="/".concat(Math.round(10*s)/10)),u&&(c+="/".concat(Math.round(u))),this.hashName){var l=this.hashName,f=!1,h=window.location.hash.slice(1).split("&").map((function(e){var t=e.split("=")[0];return t===l?(f=!0,"".concat(t,"=").concat(c)):e})).filter((function(e){return e}));return f||h.push("".concat(l,"=").concat(c)),"#".concat(h.join("&"))}return"#".concat(c)}}]),e}(),AM=null,TM=[],kM=(window.performance,function(e){var t=e;if(null!=AM){var n=t-AM;TM.push(n)}AM=t}),MM=function(){function e(){Wi(this,e),this.queue=void 0,this.id=void 0,this.cleared=void 0,this.currentlyRunning=void 0,this.queue=[],this.id=0,this.cleared=!1,this.currentlyRunning=!1}return Xi(e,[{key:"add",value:function(e){var t=++this.id;return this.queue.push({callback:e,id:t,cancelled:!1}),t}},{key:"remove",value:function(e){var t,n=this.currentlyRunning,r=po(n?this.queue.concat(n):this.queue);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.id===e)return void(i.cancelled=!0)}}catch(e){r.e(e)}finally{r.f()}}},{key:"run",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.currentlyRunning=this.queue;this.queue=[];var n,r=po(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!i.cancelled&&(i.callback(e),this.cleared))break}}catch(e){r.e(e)}finally{r.f()}this.cleared=!1,this.currentlyRunning=!1}},{key:"clear",value:function(){this.currentlyRunning&&(this.cleared=!0),this.queue=[]}}]),e}(),CM={hash:!1,zoom:-1,center:[112,32],pitch:0,bearing:0,interactive:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,trackResize:!0,renderWorldCopies:!0},IM=function(e){Ji(n,e);var t=so(n);function n(e){var r;Wi(this,n),(r=t.call(this,Dy({},CM,e))).doubleClickZoom=void 0,r.dragRotate=void 0,r.dragPan=void 0,r.touchZoomRotate=void 0,r.scrollZoom=void 0,r.keyboard=void 0,r.touchPitch=void 0,r.boxZoom=void 0,r.handlers=void 0,r.container=void 0,r.canvas=void 0,r.canvasContainer=void 0,r.renderTaskQueue=new MM,r.frame=void 0,r.trackResize=!0,r.hash=void 0,r.onWindowOnline=function(){r.update()},r.onWindowResize=function(e){r.trackResize&&r.resize({originalEvent:e}).update()},r.initContainer(),r.resize(),r.handlers=new yM(oo(r),r.options),"undefined"!=typeof window&&(window.addEventListener("online",r.onWindowOnline,!1),window.addEventListener("resize",r.onWindowResize,!1),window.addEventListener("orientationchange",r.onWindowResize,!1));var i="string"==typeof e.hash&&e.hash||void 0;return e.hash&&(r.hash=new EM(i).addTo(oo(r))),r.hash&&r.hash.onHashChange()||(r.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(r.resize(),r.fitBounds(e.bounds,Dy({},e.fitBoundsOptions,{duration:0})))),r}return Xi(n,[{key:"resize",value:function(e){var t=this.containerDimensions(),n=t[0],r=t[1];this.transform.resize(n,r);var i=!this.moving;return i&&(this.stop(),this.emit("movestart",new Event("movestart",e)),this.emit("move",new Event("move",e))),this.emit("resize",new Event("resize",e)),i&&this.emit("moveend",new Event("moveend",e)),this}},{key:"getContainer",value:function(){return this.container}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getCanvasContainer",value:function(){return this.canvasContainer}},{key:"project",value:function(e){return this.transform.locationPoint(ik.convert(e))}},{key:"unproject",value:function(e){return this.transform.pointLocation(ok.convert(e))}},{key:"getBounds",value:function(){return this.transform.getBounds()}},{key:"getMaxBounds",value:function(){return this.transform.getMaxBounds()}},{key:"setMaxBounds",value:function(e){this.transform.setMaxBounds(rk.convert(e))}},{key:"setStyle",value:function(e){}},{key:"setMinZoom",value:function(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between ".concat(-2," and the current maxZoom, inclusive"))}},{key:"getMinZoom",value:function(){return this.transform.minZoom}},{key:"setMaxZoom",value:function(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}},{key:"getMaxZoom",value:function(){return this.transform.maxZoom}},{key:"setMinPitch",value:function(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to ".concat(0));if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between ".concat(0," and the current maxPitch, inclusive"))}},{key:"getMinPitch",value:function(){return this.transform.minPitch}},{key:"setMaxPitch",value:function(e){if((e=null==e?60:e)>60)throw new Error("maxPitch must be less than or equal to ".concat(60));if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}},{key:"getMaxPitch",value:function(){return this.transform.maxPitch}},{key:"getRenderWorldCopies",value:function(){return this.transform.renderWorldCopies}},{key:"setRenderWorldCopies",value:function(e){this.transform.renderWorldCopies=!!e}},{key:"remove",value:function(){this.frame&&(this.frame.cancel(),this.frame=null),this.renderTaskQueue.clear()}},{key:"requestRenderFrame",value:function(e){return this.update(),this.renderTaskQueue.add(e)}},{key:"cancelRenderFrame",value:function(e){return this.renderTaskQueue.remove(e)}},{key:"triggerRepaint",value:function(){var e=this;this.frame||(this.frame=$T((function(t){kM(t),e.frame=null,e.update(t)})))}},{key:"update",value:function(e){var t=this;this.frame||(this.frame=$T((function(n){kM(n),t.frame=null,t.renderTaskQueue.run(e)})))}},{key:"initContainer",value:function(){if("string"==typeof this.options.container){if(this.container=window.document.getElementById(this.options.container),!this.container)throw new Error("Container '".concat(this.options.container,"' not found."))}else{if(!(this.options.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this.container=this.options.container}var e=this.container;e.classList.add("l7-map");var t=this.canvasContainer=ka("div","l7-canvas-container",e);this.options.interactive&&t.classList.add("l7-interactive")}},{key:"containerDimensions",value:function(){var e=0,t=0;return this.container&&(e=this.container.clientWidth||400,t=this.container.clientHeight||300),[e,t]}},{key:"resizeCanvas",value:function(e,t){var n=window.devicePixelRatio||1;this.canvas.width=n*e,this.canvas.height=n*t,this.canvas.style.width="".concat(e,"px"),this.canvas.style.height="".concat(t,"px")}}]),n}(gk);function PM(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OM(e,t){return!t||"object"!==a_(t)&&"function"!=typeof t?PM(e):t}function RM(e){return(RM=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function LM(e,t){return(LM=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function NM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||d_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DM(e,t){var n,r,i,o=qv([],t,e);return n=o,r=o,i=1/o[3],n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=r[3]*i,o}function jM(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}var zM=Math.PI,FM=zM/4,BM=zM/180,UM=180/zM;function VM(e){return Math.pow(2,e)}function GM(e,t){var n=NM(e,2),r=n[0],i=n[1];jM(Number.isFinite(r)&&Number.isFinite(t)),jM(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");var o=i*BM;return[(t*=512)*(r*BM+zM)/(2*zM),t*(zM-Math.log(Math.tan(FM+.5*o)))/(2*zM)]}function HM(e,t){var n=NM(e,2),r=n[0],i=n[1],o=r/(t*=512)*(2*zM)-zM,a=2*(Math.atan(Math.exp(zM-i/t*(2*zM)))-FM);return[o*UM,a*UM]}function ZM(e){var t=e.latitude,n=e.longitude,r=e.zoom,i=e.scale,o=e.highPrecision,a=void 0!==o&&o;i=void 0!==i?i:VM(r),jM(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(i));var s={},u=512*i,c=Math.cos(t*BM),l=u/360,f=l/c,h=u/4003e4/c;if(s.pixelsPerMeter=[h,-h,h],s.metersPerPixel=[1/h,-1/h,1/h],s.pixelsPerDegree=[l,-f,h],s.degreesPerPixel=[1/l,-1/f,1/h],a){var d=BM*Math.tan(t*BM)/c,p=l*d/2,v=u/4003e4*d,g=v/f*h;s.pixelsPerDegree2=[0,-p,v],s.pixelsPerMeter2=[g,0,g]}return s}function WM(e){var t=e.height,n=e.pitch,r=e.bearing,i=e.altitude,o=e.center,a=void 0===o?null:o,s=e.flipY,u=void 0!==s&&s,c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return sv(c,c,[0,0,-i]),uv(c,c,[1,1,1/t]),cv(c,c,-n*BM),fv(c,c,r*BM),u&&uv(c,c,[1,-1,1]),a&&sv(c,c,Pv([],a)),c}function qM(e){var t=e.width,n=e.height,r=e.pitch,i=function(e){var t=e.width,n=e.height,r=e.altitude,i=void 0===r?1.5:r,o=e.pitch,a=void 0===o?0:o,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,f=a*BM,h=Math.atan(.5/i),d=Math.sin(h)*i/Math.sin(Math.PI/2-f-h),p=Math.cos(Math.PI/2-f)*d+i;return{fov:2*Math.atan(n/2/i),aspect:t/n,focalDistance:i,near:u,far:p*l}}({width:t,height:n,altitude:e.altitude,pitch:r,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier});return vv([],i.fov,i.aspect,i.near,i.far)}function XM(e,t){var n=NM(e,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o;return jM(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)),DM(t,[r,i,a,1])}function YM(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=NM(e,3),i=r[0],o=r[1],a=r[2];if(jM(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a)){var s=DM(t,[i,o,a,1]);return s}var u=DM(t,[i,o,0,1]),c=DM(t,[i,o,1,1]),l=u[2],f=c[2],h=l===f?0:((n||0)-l)/(f-l);return tg([],u,c,h)}var KM=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function QM(e){var t=e.width,n=e.height,r=e.bounds,i=e.minExtent,o=void 0===i?0:i,a=e.maxZoom,s=void 0===a?24:a,u=e.padding,c=void 0===u?0:u,l=e.offset,f=void 0===l?[0,0]:l,h=NM(r,2),d=NM(h[0],2),p=d[0],v=d[1],g=NM(h[1],2),m=g[0],y=g[1];if(Number.isFinite(c)){c={top:c,bottom:c,left:c,right:c}}else jM(Number.isFinite(c.top)&&Number.isFinite(c.bottom)&&Number.isFinite(c.left)&&Number.isFinite(c.right));var b=new fC({width:t,height:n,longitude:0,latitude:0,zoom:0}),_=b.project([p,y]),x=b.project([m,v]),w=[Math.max(Math.abs(x[0]-_[0]),o),Math.max(Math.abs(x[1]-_[1]),o)],S=[t-c.left-c.right-2*Math.abs(f[0]),n-c.top-c.bottom-2*Math.abs(f[1])];jM(S[0]>0&&S[1]>0);var E=S[0]/w[0],A=S[1]/w[1],T=(c.right-c.left)/2/E,k=(c.bottom-c.top)/2/A,M=[(x[0]+_[0])/2+T,(x[1]+_[1])/2+k],C=b.unproject(M),I=b.zoom+Math.log2(Math.abs(Math.min(E,A)));return{longitude:C[0],latitude:C[1],zoom:Math.min(I,s)}}var JM,$M,eC,tC,nC,rC,iC,oC,aC,sC,uC,cC,lC,fC=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,i=n.height,o=n.latitude,a=void 0===o?0:o,s=n.longitude,u=void 0===s?0:s,c=n.zoom,l=void 0===c?0:c,f=n.pitch,h=void 0===f?0:f,d=n.bearing,p=void 0===d?0:d,v=n.altitude,g=void 0===v?1.5:v,m=n.nearZMultiplier,y=n.farZMultiplier;v_(this,t),r=r||1,i=i||1;var b=VM(l);g=Math.max(.75,g);var _=GM([u,a],b);_[2]=0;var x=qM({width:r,height:i,pitch:h,bearing:p,altitude:g,nearZMultiplier:m||1/i,farZMultiplier:y||1.01}),w=WM({height:i,center:_,pitch:h,bearing:p,altitude:g,flipY:!0});return(e=OM(this,RM(t).call(this,{width:r,height:i,viewMatrix:w,projectionMatrix:x}))).latitude=a,e.longitude=u,e.zoom=l,e.pitch=h,e.bearing=p,e.altitude=g,e.scale=b,e.center=_,e.pixelsPerMeter=ZM(PM(PM(e))).pixelsPerMeter[2],Object.freeze(PM(PM(e))),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&LM(e,t)}(t,e),m_(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return GM(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return HM(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t,n,r=e.lngLat,i=YM(e.pos,this.pixelUnprojectionMatrix),o=Qv([],GM(r,this.scale),((t=[])[0]=-(n=i)[0],t[1]=-n[1],t));return HM(Qv([],this.center,o),this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=QM(Object.assign({width:r,height:i,bounds:e},n)),a=o.longitude,s=o.latitude,u=o.zoom;return new t({width:r,height:i,longitude:a,latitude:s,zoom:u})}}]),t}(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,i=t.viewMatrix,o=void 0===i?KM:i,a=t.projectionMatrix,s=void 0===a?KM:a;v_(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=s;var u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];av(u,u,this.projectionMatrix),av(u,u,this.viewMatrix),this.viewProjectionMatrix=u;var c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];uv(c,c,[this.width/2,-this.height/2,1]),sv(c,c,[1,-1,0]),av(c,c,this.viewProjectionMatrix);var l=ov([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c);if(!l)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=c,this.pixelUnprojectionMatrix=l,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return m_(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&yv(t.projectionMatrix,this.projectionMatrix)&&yv(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,r=void 0===n||n,i=this.projectPosition(e),o=XM(i,this.pixelProjectionMatrix),a=NM(o,2),s=a[0],u=a[1],c=r?u:this.height-u;return 2===e.length?[s,c]:[s,c,o[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,r=void 0===n||n,i=t.targetZ,o=NM(e,3),a=o[0],s=o[1],u=o[2],c=r?s:this.height-s,l=i&&i*this.pixelsPerMeter,f=YM([a,c,u],this.pixelUnprojectionMatrix,l),h=this.unprojectPosition(f),d=NM(h,3),p=d[0],v=d[1],g=d[2];return Number.isFinite(u)?[p,v,g]:Number.isFinite(i)?[p,v,i]:[p,v]}},{key:"projectPosition",value:function(e){var t=NM(this.projectFlat(e),2);return[t[0],t[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=NM(this.unprojectFlat(e),2);return[t[0],t[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]||this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]||this.scale;return e}}]),e}()),hC=function(){function e(){Wi(this,e),this.viewport=void 0}return Xi(e,[{key:"syncWithMapCamera",value:function(e){var t=e.center,n=e.zoom,r=e.pitch,i=e.bearing,o=e.viewportHeight,a=e.viewportWidth;this.viewport=new fC({width:a,height:o,longitude:t&&t[0],latitude:t&&t[1],zoom:n,pitch:r,bearing:i})}},{key:"getZoom",value:function(){return this.viewport.zoom}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[this.viewport.longitude,this.viewport.latitude]}},{key:"getProjectionMatrix",value:function(){return this.viewport.projectionMatrix}},{key:"getViewMatrix",value:function(){return this.viewport.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.viewMatrixUncentered}},{key:"getViewProjectionMatrix",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(e,t){return this.viewport.projectFlat(e,t)}}]),e}(),dC={light:"mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29",dark:"mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7",normal:"mapbox://styles/mapbox/streets-v11",blank:{version:8,sources:{},layers:[{id:"background",type:"background",layout:{visibility:"none"}}]}},pC={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},vC=(JM=Q(),$M=J(nr.MapConfig),eC=J(nr.IGlobalConfigService),tC=J(nr.ILogService),nC=J(nr.ICoordinateSystemService),rC=J(nr.IEventEmitter),JM((aC=go((oC=function(){function t(){var n=this;Wi(this,t),this.map=void 0,vo(this,"config",aC,this),vo(this,"configService",sC,this),vo(this,"logger",uC,this),vo(this,"coordinateSystemService",cC,this),vo(this,"eventEmitter",lC,this),this.viewport=void 0,this.markerContainer=void 0,this.cameraChangedCallback=void 0,this.$mapContainer=void 0,this.handleCameraChanged=function(){var t=n.map.getCenter(),r=t.lat,i=t.lng;n.viewport.syncWithMapCamera({bearing:n.map.getBearing(),center:[i,r],viewportHeight:n.map.transform.height,pitch:n.map.getPitch(),viewportWidth:n.map.transform.width,zoom:n.map.getZoom(),cameraHeight:0}),n.viewport.getZoom()>12?n.coordinateSystemService.setCoordinateSystem(e.CoordinateSystem.LNGLAT_OFFSET):n.coordinateSystemService.setCoordinateSystem(e.CoordinateSystem.LNGLAT),n.cameraChangedCallback(n.viewport)}}var n;return Xi(t,[{key:"addMarkerContainer",value:function(){var e=this.map.getCanvasContainer();this.markerContainer=ka("div","l7-marker-container",e),this.markerContainer.setAttribute("tabindex","-1")}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"on",value:function(e,t){-1!==uA.indexOf(e)?this.eventEmitter.on(e,t):this.map.on(pC[e]||e,t)}},{key:"off",value:function(e,t){this.map.off(pC[e]||e,t)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"getMapCanvasContainer",value:function(){return this.map.getCanvasContainer()}},{key:"getSize",value:function(){var e=this.map.transform;return[e.width,e.height]}},{key:"getType",value:function(){return"default"}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"setZoom",value:function(e){return this.map.setZoom(e)}},{key:"getCenter",value:function(){return this.map.getCenter()}},{key:"setCenter",value:function(e){this.map.setCenter(e)}},{key:"getPitch",value:function(){return this.map.getPitch()}},{key:"getRotation",value:function(){return this.map.getBearing()}},{key:"getBounds",value:function(){return this.map.getBounds().toArray()}},{key:"getMinZoom",value:function(){return this.map.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.map.getMaxZoom()}},{key:"setRotation",value:function(e){this.map.setBearing(e)}},{key:"zoomIn",value:function(e,t){this.map.zoomIn(e,t)}},{key:"zoomOut",value:function(e,t){this.map.zoomOut(e,t)}},{key:"setPitch",value:function(e){return this.map.setPitch(e)}},{key:"panTo",value:function(e){this.map.panTo(e)}},{key:"panBy",value:function(e){this.panTo(e)}},{key:"fitBounds",value:function(e,t){this.map.fitBounds(e,t)}},{key:"setMaxZoom",value:function(e){this.map.setMaxZoom(e)}},{key:"setMinZoom",value:function(e){this.map.setMinZoom(e)}},{key:"setMapStatus",value:function(e){!0===e.doubleClickZoom&&this.map.doubleClickZoom.enable(),!1===e.doubleClickZoom&&this.map.doubleClickZoom.disable(),!1===e.dragEnable&&this.map.dragPan.disable(),!0===e.dragEnable&&this.map.dragPan.enable(),!1===e.rotateEnable&&this.map.dragRotate.disable(),!0===e.dragEnable&&this.map.dragRotate.enable(),!1===e.keyboardEnable&&this.map.keyboard.disable(),!0===e.keyboardEnable&&this.map.keyboard.enable(),!1===e.zoomEnable&&this.map.scrollZoom.disable(),!0===e.zoomEnable&&this.map.scrollZoom.enable()}},{key:"setZoomAndCenter",value:function(e,t){this.map.flyTo({zoom:e,center:t})}},{key:"setMapStyle",value:function(e){this.map.setStyle(this.getMapStyle(e))}},{key:"pixelToLngLat",value:function(e){return this.map.unproject(e)}},{key:"lngLatToPixel",value:function(e){return this.map.project(e)}},{key:"containerToLngLat",value:function(e){return this.map.unproject(e)}},{key:"lngLatToContainer",value:function(e){return this.map.project(e)}},{key:"lngLatToMercator",value:function(e,t){throw new Error("not implement")}},{key:"getModelMatrix",value:function(e,t,n){throw new Error("not implement")}},{key:"init",value:(n=Zi(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.config,n=t.id,r=void 0===n?"map":n,t.attributionControl,i=t.style,o=void 0===i?"light":i,a=t.rotation,s=void 0===a?0:a,u=t.mapInstance,c=io(t,["id","attributionControl","style","rotation","mapInstance"]),this.viewport=new hC,u?(this.map=u,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatAmapContainer(r),this.map=new IM(Qi({container:this.$mapContainer,style:this.getMapStyle(o),bearing:s},c))),this.map.on("load",this.handleCameraChanged),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged();case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"destroy",value:function(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=this.eventEmitter).emit.apply(t,[e].concat(r))}},{key:"once",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=this.eventEmitter).once.apply(t,[e].concat(r))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"exportMap",value:function(e){var t=this.map.getCanvas();return"jpg"===e?null==t?void 0:t.toDataURL("image/jpeg"):null==t?void 0:t.toDataURL("image/png")}},{key:"onCameraChanged",value:function(e){this.cameraChangedCallback=e}},{key:"creatAmapContainer",value:function(e){var t=e;return"string"==typeof e&&(t=document.getElementById(e)),t}},{key:"getMapStyle",value:function(e){return"string"!=typeof e?e:dC[e]?dC[e]:e}}]),t}()).prototype,"config",[$M],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sC=go(oC.prototype,"configService",[eC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uC=go(oC.prototype,"logger",[tC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cC=go(oC.prototype,"coordinateSystemService",[nC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lC=go(oC.prototype,"eventEmitter",[rC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),iC=oC))||iC),gC=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"getServiceConstructor",value:function(){return vC}}]),n}(IT);EA(".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:0;margin:10px;position:relative;background-color:#fff;border-radius:3px 12px 12px 3px}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 24px 2px 4px;visibility:visible;margin-top:6px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 4px 2px 24px;border-radius:12px 3px 3px 12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact:after{content:\"\";cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}");var mC,yC,bC,_C,xC,wC,SC,EC,AC,TC,kC,MC,CC,IC=function(){function e(){Wi(this,e),this.viewport=void 0}return Xi(e,[{key:"syncWithMapCamera",value:function(e){var t=e.center,n=e.zoom,r=e.pitch,i=e.bearing,o=e.viewportHeight,a=e.viewportWidth;this.viewport=new fC({width:a,height:o,longitude:t&&t[0],latitude:t&&t[1],zoom:n,pitch:r,bearing:i})}},{key:"getZoom",value:function(){return this.viewport.zoom}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[this.viewport.longitude,this.viewport.latitude]}},{key:"getProjectionMatrix",value:function(){return this.viewport.projectionMatrix}},{key:"getViewMatrix",value:function(){return this.viewport.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.viewMatrixUncentered}},{key:"getViewProjectionMatrix",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(e,t){return this.viewport.projectFlat(e,t)}}]),e}(),PC={light:"mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29",dark:"mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7",normal:"mapbox://styles/mapbox/streets-v11",blank:{version:8,sources:{},layers:[{id:"background",type:"background",layout:{visibility:"none"}}]}};window.mapboxgl=t;var OC={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},RC=0,LC="pk.eyJ1IjoibHp4dWUiLCJhIjoiYnhfTURyRSJ9.Ugm314vAKPHBzcPmY1p4KQ",NC=(mC=Q(),yC=J(nr.MapConfig),bC=J(nr.IGlobalConfigService),_C=J(nr.ILogService),xC=J(nr.ICoordinateSystemService),wC=J(nr.IEventEmitter),mC((AC=go((EC=function(){function t(){var n=this;Wi(this,t),this.map=void 0,vo(this,"config",AC,this),vo(this,"configService",TC,this),vo(this,"logger",kC,this),vo(this,"coordinateSystemService",MC,this),vo(this,"eventEmitter",CC,this),this.viewport=void 0,this.markerContainer=void 0,this.cameraChangedCallback=void 0,this.$mapContainer=void 0,this.handleCameraChanged=function(){var t=n.map.getCenter().wrap(),r=t.lat,i=t.lng;n.viewport.syncWithMapCamera({bearing:n.map.getBearing(),center:[i,r],viewportHeight:n.map.transform.height,pitch:n.map.getPitch(),viewportWidth:n.map.transform.width,zoom:n.map.getZoom(),cameraHeight:0}),n.viewport.getZoom()>12?n.coordinateSystemService.setCoordinateSystem(e.CoordinateSystem.LNGLAT_OFFSET):n.coordinateSystemService.setCoordinateSystem(e.CoordinateSystem.LNGLAT),n.cameraChangedCallback(n.viewport)}}var n;return Xi(t,[{key:"addMarkerContainer",value:function(){var e=this.map.getCanvasContainer();this.markerContainer=ka("div","l7-marker-container",e),this.markerContainer.setAttribute("tabindex","-1")}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"on",value:function(e,t){-1!==uA.indexOf(e)?this.eventEmitter.on(e,t):this.map.on(OC[e]||e,t)}},{key:"off",value:function(e,t){this.map.off(OC[e]||e,t)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"getMapCanvasContainer",value:function(){return this.map.getCanvasContainer()}},{key:"getSize",value:function(){var e=this.map.transform;return[e.width,e.height]}},{key:"getType",value:function(){return"mapbox"}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"setZoom",value:function(e){return this.map.setZoom(e)}},{key:"getCenter",value:function(){return this.map.getCenter()}},{key:"setCenter",value:function(e){this.map.setCenter(e)}},{key:"getPitch",value:function(){return this.map.getPitch()}},{key:"getRotation",value:function(){return this.map.getBearing()}},{key:"getBounds",value:function(){return this.map.getBounds().toArray()}},{key:"getMinZoom",value:function(){return this.map.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.map.getMaxZoom()}},{key:"setRotation",value:function(e){this.map.setBearing(e)}},{key:"zoomIn",value:function(e,t){this.map.zoomIn(e,t)}},{key:"zoomOut",value:function(e,t){this.map.zoomOut(e,t)}},{key:"setPitch",value:function(e){return this.map.setPitch(e)}},{key:"panTo",value:function(e){this.map.panTo(e)}},{key:"panBy",value:function(e){this.panTo(e)}},{key:"fitBounds",value:function(e,t){this.map.fitBounds(e,t)}},{key:"setMaxZoom",value:function(e){this.map.setMaxZoom(e)}},{key:"setMinZoom",value:function(e){this.map.setMinZoom(e)}},{key:"setMapStatus",value:function(e){!0===e.doubleClickZoom&&this.map.doubleClickZoom.enable(),!1===e.doubleClickZoom&&this.map.doubleClickZoom.disable(),!1===e.dragEnable&&this.map.dragPan.disable(),!0===e.dragEnable&&this.map.dragPan.enable(),!1===e.rotateEnable&&this.map.dragRotate.disable(),!0===e.rotateEnable&&this.map.dragRotate.enable(),!1===e.keyboardEnable&&this.map.keyboard.disable(),!0===e.keyboardEnable&&this.map.keyboard.enable(),!1===e.zoomEnable&&this.map.scrollZoom.disable(),!0===e.zoomEnable&&this.map.scrollZoom.enable()}},{key:"setZoomAndCenter",value:function(e,t){this.map.flyTo({zoom:e,center:t})}},{key:"setMapStyle",value:function(e){this.map.setStyle(this.getMapStyle(e))}},{key:"pixelToLngLat",value:function(e){return this.map.unproject(e)}},{key:"lngLatToPixel",value:function(e){return this.map.project(e)}},{key:"containerToLngLat",value:function(e){return this.map.unproject(e)}},{key:"lngLatToContainer",value:function(e){return this.map.project(e)}},{key:"lngLatToMercator",value:function(e,t){var n=window.mapboxgl.MercatorCoordinate.fromLngLat(e,t),r=n.x,i=void 0===r?0:r,o=n.y,a=void 0===o?0:o,s=n.z;return{x:i,y:a,z:void 0===s?0:s}}},{key:"getModelMatrix",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{x:0,y:0,z:0},o=window.mapboxgl.MercatorCoordinate.fromLngLat(e,t),a=o.meterInMercatorCoordinateUnits(),s=tv();return sv(s,s,Ev(o.x-i.x,o.y-i.y,o.z||0-i.z)),uv(s,s,Ev(a*r[0],-a*r[1],a*r[2])),cv(s,s,n[0]),lv(s,s,n[1]),fv(s,s,n[2]),s}},{key:"init",value:(n=Zi(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c,l,f,h,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.config,n=t.id,r=void 0===n?"map":n,i=t.attributionControl,o=void 0!==i&&i,a=t.style,s=void 0===a?"light":a,u=t.token,c=void 0===u?LC:u,l=t.rotation,f=void 0===l?0:l,h=t.mapInstance,d=io(t,["id","attributionControl","style","token","rotation","mapInstance"]),this.viewport=new IC,h||window.mapboxgl||this.logger.error(this.configService.getSceneWarninfo("SDK")),c!==LC||"blank"===s||window.mapboxgl.accessToken||h||this.logger.warn(this.configService.getSceneWarninfo("MapToken")),h||window.mapboxgl.accessToken||(window.mapboxgl.accessToken=c),h?(this.map=h,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatAmapContainer(r),this.map=new window.mapboxgl.Map(Qi({container:this.$mapContainer,style:this.getMapStyle(s),attributionControl:o,bearing:f},d))),this.map.on("load",this.handleCameraChanged),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged();case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"destroy",value:function(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=this.eventEmitter).emit.apply(t,[e].concat(r))}},{key:"once",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=this.eventEmitter).once.apply(t,[e].concat(r))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"exportMap",value:function(e){var t=this.map.getCanvas();return"jpg"===e?null==t?void 0:t.toDataURL("image/jpeg"):null==t?void 0:t.toDataURL("image/png")}},{key:"onCameraChanged",value:function(e){this.cameraChangedCallback=e}},{key:"creatAmapContainer",value:function(e){var t=e;"string"==typeof e&&(t=document.getElementById(e));var n=document.createElement("div");return n.style.cssText+="\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n ",n.id="l7_mapbox_div"+RC++,t.appendChild(n),n}},{key:"getMapStyle",value:function(e){return"string"!=typeof e?e:PC[e]?PC[e]:e}}]),t}()).prototype,"config",[yC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),TC=go(EC.prototype,"configService",[bC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kC=go(EC.prototype,"logger",[_C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),MC=go(EC.prototype,"coordinateSystemService",[xC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),CC=go(EC.prototype,"eventEmitter",[wC],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),SC=EC))||SC),DC=function(e){Ji(n,e);var t=so(n);function n(){return Wi(this,n),t.apply(this,arguments)}return Xi(n,[{key:"getServiceConstructor",value:function(){return NC}}]),n}(IT),jC=Object.getOwnPropertySymbols,zC=Object.prototype.hasOwnProperty,FC=Object.prototype.propertyIsEnumerable;function BC(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var UC=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=BC(e),o=1;o<arguments.length;o++){for(var a in n=Object(arguments[o]))zC.call(n,a)&&(i[a]=n[a]);if(jC){r=jC(n);for(var s=0;s<r.length;s++)FC.call(n,r[s])&&(i[r[s]]=n[r[s]])}}return i},VC=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8},GC=o((function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}})),HC=o((function(e,t){var n=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var i=arguments,o=i.length,s=String(e).replace(n,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}})),u=i[r];r<o;u=i[++r])p(u)||!b(u)?s+=" "+u:s+=" "+a(u);return s},t.deprecate=function(e,n){if(m(r.process))return function(){return t.deprecate(e,n).apply(this,arguments)};if(!0===process.noDeprecation)return e;var i=!1;return function(){if(!i){if(process.throwDeprecation)throw new Error(n);process.traceDeprecation?console.trace(n):console.error(n),i=!0}return e.apply(this,arguments)}};var i,o={};function a(e,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),c(r,e,r.depth)}function s(e,t){var n=a.styles[t];return n?"["+a.colors[n][0]+"m"+e+"["+a.colors[n][1]+"m":e}function u(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&w(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return g(i)||(i=c(e,i,r)),i}var o=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(v(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(p(t))return e.stylize("null","null")}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),x(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(n);if(0===a.length){if(w(n)){var u=n.name?": "+n.name:"";return e.stylize("[Function"+u+"]","special")}if(y(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(x(n))return l(n)}var b,S="",E=!1,A=["{","}"];(h(n)&&(E=!0,A=["[","]"]),w(n))&&(S=" [Function"+(n.name?": "+n.name:"")+"]");return y(n)&&(S=" "+RegExp.prototype.toString.call(n)),_(n)&&(S=" "+Date.prototype.toUTCString.call(n)),x(n)&&(S=" "+l(n)),0!==a.length||E&&0!=n.length?r<0?y(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),b=E?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)k(t,String(a))?o.push(f(e,t,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(f(e,t,n,r,i,!0))})),o}(e,n,r,s,a):a.map((function(t){return f(e,n,r,s,t,E)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(b,S,A)):A[0]+S+A[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),k(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=p(n)?c(e,u.value,null):c(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function p(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function m(e){return void 0===e}function y(e){return b(e)&&"[object RegExp]"===S(e)}function b(e){return"object"==typeof e&&null!==e}function _(e){return b(e)&&"[object Date]"===S(e)}function x(e){return b(e)&&("[object Error]"===S(e)||e instanceof Error)}function w(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(m(i)&&(i=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var n=process.pid;o[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else o[e]=function(){};return o[e]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=d,t.isNull=p,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=y,t.isObject=b,t.isDate=_,t.isError=x,t.isFunction=w,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=VC;var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=GC,t._extend=function(e,t){if(!t||!b(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}})),ZC=(HC.format,HC.deprecate,HC.debuglog,HC.inspect,HC.isArray,HC.isBoolean,HC.isNull,HC.isNullOrUndefined,HC.isNumber,HC.isString,HC.isSymbol,HC.isUndefined,HC.isRegExp,HC.isObject,HC.isDate,HC.isError,HC.isFunction,HC.isPrimitive,HC.isBuffer,HC.log,HC.inherits,HC._extend,o((function(e){
38/*!

Callers 5

oFunction · 0.70
hFunction · 0.70
ltFunction · 0.70
lFunction · 0.70
L7-min.jsFile · 0.70

Calls 15

wFunction · 0.70
BFunction · 0.70
tFunction · 0.70
DFunction · 0.70
jFunction · 0.70
FFunction · 0.70
cFunction · 0.70
UFunction · 0.70
uFunction · 0.70
sFunction · 0.70
GFunction · 0.70
HFunction · 0.70

Tested by

no test coverage detected