mobility-toolbox-js 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],e):"object"==typeof exports?exports["mobility-toolbox-js"]=e():t["mobility-toolbox-js"]=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e){t.exports=require("ol/style")},function(t,e){t.exports=require("ol/proj")},function(t,e){t.exports=require("ol/extent")},function(t,e){t.exports=require("ol/Observable")},function(t,e){t.exports=require("ol/geom")},function(t,e){t.exports=require("ol/Feature")},function(t,e){t.exports=require("ol/format/GeoJSON")},function(t,e){t.exports=require("query-string")},function(t,e){t.exports=require("ol/layer")},function(t,e){t.exports=require("ol/transform")},function(t,e){t.exports=require("ol/Object")},function(t,e){t.exports=require("ol/layer/Layer")},function(t,e){t.exports=require("mapbox-gl")},function(t,e){t.exports=require("ol/source/Source")},function(t,e){t.exports=require("ol/source")},function(t,e){t.exports=require("ol")},function(t,e){t.exports=require("ol/geom/GeometryType")},function(t,e){t.exports=require("ol/format")},function(t,e){t.exports=require("@turf/transform-rotate")},function(t,e){t.exports=require("@turf/helpers")},function(t,e){t.exports=require("ol/Map")},function(t,e){t.exports=require("ol/control")},function(t,e){t.exports=require("ol/layer/Group")},function(t,e){t.exports=require("uuid")},function(t,e){t.exports=require("ol/geom/Point")},function(t,e){t.exports=require("ol/interaction")},function(t,e){t.exports=require("ol/events/condition")},function(t,e,r){t.exports=r(28)},function(t,e,r){"use strict";r.r(e);var n=r(20),o=r.n(n),i=r(21),c=r(3),a=r.n(c),u=r(22),s=r.n(u),l=r(23);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=j(t);if(e){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?O(t):e}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(i,t);var e,r,n,o=m(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(t=o.call(this)).defineProperties(e);var r=e.onClick,n=e.onHover;return n&&t.onHover(n),r&&t.onClick(r),e.copyrights&&(t.copyrights=e.copyrights),t.onUserClickCallback=t.onUserClickCallback.bind(O(t)),t.onUserMoveCallback=t.onUserMoveCallback.bind(O(t)),t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},t),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,s=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(l.v4)(),v=n||b;Object.defineProperties(this,{options:{value:t},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!s},isClickActive:{value:!!s&&!!f},isHoverActive:{value:!!s&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return e.get("copyrights")},set:function(t){var r=Array.isArray(t)?t:[t];return e.set("copyrights",r)}},visible:{value:void 0===c||c,writable:!0},properties:{value:y({},a||{})},map:{writable:!0},clickCallbacks:{value:[]},hoverCallbacks:{value:[]}})}},{key:"init",value:function(t){this.terminate(),this.map=t}},{key:"terminate",value:function(){}},{key:"get",value:function(t){return this.properties[t]}},{key:"set",value:function(t,e){this.properties[t]=e,this.dispatchEvent({type:"change:".concat(t),target:this})}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(this.visible=t,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:e,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(t){return t.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(t){return!!this.children.find((function(e){return e.visible===t}))}},{key:"addChild",value:function(t){this.children.unshift(t),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(t){for(var e=0;e<this.children.length;e+=1)if(this.children[e].name===t){this.children.splice(e,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:t})}},{key:"onClick",value:function(t){if("function"!=typeof t)throw new Error("onClick callback must be of type function:",t);this.clickCallbacks.includes(t)||this.clickCallbacks.push(t)}},{key:"unClick",value:function(t){if("function"==typeof t){var e=this.clickCallbacks.indexOf(t);e>-1&&this.clickCallbacks.splice(e,1)}}},{key:"onUserClickCallback",value:function(t){var e=this,r={features:[],layer:this,coordinate:t.coordinate,event:t};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){var r=t.features,n=t.layer,o=t.coordinate;return e.clickCallbacks.forEach((function(t){return t(r,n,o)})),t})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(t){if("function"!=typeof t)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(t)||this.hoverCallbacks.push(t)}},{key:"unHover",value:function(t){if("function"==typeof t){var e=this.hoverCallbacks.indexOf(t);e>-1&&this.hoverCallbacks.splice(e,1)}}},{key:"onUserMoveCallback",value:function(t){var e=this,r={features:[],layer:this,coordinate:t.coordinate,event:t};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){var r=t.features,n=t.layer,o=t.coordinate;return e.hoverCallbacks.forEach((function(t){return t(r,n,o)})),t})).catch((function(){return r})):Promise.resolve(r)}}])&&v(e.prototype,r),n&&v(e,n),i}(a.a);function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function x(t,e,r){return(x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function R(t,e){return(R=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function E(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_(t);if(e){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(t,e){return!e||"object"!==P(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&R(t,e)}(i,t);var e,r,n,o=E(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).olLayer&&e.olLayer.setVisible(e.visible),e}return e=i,(r=[{key:"defineProperties",value:function(t){x(_(i.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{olLayer:{value:t.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(t){var e=this;if(x(_(i.prototype),"init",this).call(this,t),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(t){t.element===e.olLayer&&e.terminate()}))),(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.olListenersKeys.push(this.on("change:visible",this.toggleVisibleListeners))),this.copyrights&&this.olLayer)){var r=this.copyrights||[];this.olLayer instanceof s.a?this.olLayer.getLayers().getArray().forEach((function(t){t.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),x(_(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(x(_(i.prototype),"setVisible",this).call(this,t,e,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var t=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(e){var r=t.olListenersKeys.indexOf(e);r>-1&&t.olListenersKeys.splice(r,1),Object(c.unByKey)([t.isHoverListenerKey,t.isClickListenerKey])})),this.visible&&(this.isClickActive&&(this.isClickListenerKey=this.map.on("singleclick",this.onUserClickCallback)),this.isHoverActive&&(this.isHoverListenerKey=this.map.on("pointermove",this.onUserMoveCallback)),this.olListenersKeys.push(this.isClickListenerKey,this.isHoverListenerKey))}},{key:"clone",value:function(t){return new i(S(S({},this.options),t))}}])&&C(e.prototype,r),n&&C(e,n),i}(w),A=r(10),M=r.n(A);function L(t){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach((function(e){U(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function N(t,e){return(N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function H(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=z(t);if(e){var o=z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return K(this,r)}}function K(t,e){return!e||"object"!==L(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&N(t,e)}(i,t);var e,r,n,o=H(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(t=o.call(this,e)).defineProperties(e);var r=F({active:!1!==e.active},e),n=r.active;return t.active=n,t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=F({},t),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return e.get("active")},set:function(t){e.set("active",t),t?e.activate():e.deactivate(),e.render()}},map:{get:function(){return e.get("map")},set:function(t){if(e.map&&e.element&&e.element.parentNode&&e.element.parentNode.removeChild(e.element),e.deactivate(),e.set("map",t),e.map){var r=e.target||e.map.getContainer();e.element||e.createDefaultElement(),e.element&&r.appendChild(e.element),e.active&&e.activate()}e.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&B(e.prototype,r),n&&B(e,n),i}(M.a);function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){J(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e,r){return(Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=et(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Y(t,e){return(Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=et(t);if(e){var o=et(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tt(this,r)}}function tt(t,e){return!e||"object"!==G(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function et(t){return(et=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ot(t,e,r){return e&&nt(t.prototype,e),r&&nt(t,r),t}var it=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Y(t,e)}(r,t);var e=X(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rt(this,r),(t=e.call(this,$($({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],t.mobilityControls=[],(n.controls||[]).forEach((function(e){t.addControl(e)})),(n.layers||[]).forEach((function(e){t.addLayer(e)})),t}return ot(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(t){this.mobilityControls.push(t),t.map=this}},{key:"removeMobilityControl",value:function(t){t.map=null,this.mobilityControls=this.mobilityControls.filter((function(e){return e!==t}))}},{key:"addControl",value:function(t,e){t instanceof Z?this.addMobilityControl(t):Q(et(r.prototype),"addControl",this).call(this,t,e)}},{key:"removeControl",value:function(t){t instanceof Z?this.removeMobilityControl(t):Q(et(r.prototype),"removeControl",this).call(this,t)}}]),r}(t)},ct=r(11),at=r.n(ct);function ut(t){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function st(t,e){return(st=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=pt(t);if(e){var o=pt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ft(this,r)}}function ft(t,e){return!e||"object"!==ut(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pt(t){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bt(t,e,r){return e&&ht(t.prototype,e),r&&ht(t,r),t}var vt=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&st(t,e)}(r,t);var e=lt(r);function r(){return yt(this,r),e.apply(this,arguments)}return bt(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(t)};function dt(t){return function(t){if(Array.isArray(t))return mt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gt=function(t){var e=t.filter((function(t){return null!=t&&t.trim&&t.trim()})),r=e.map((function(t){return t.toLowerCase()}));return dt(new Set(r)).map((function(t){return e.find((function(e){return e.toLowerCase()===t}))}))};function Ot(t){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wt(t,e,r){return(wt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ct(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Pt(t,e){return(Pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ct(t);if(e){var o=Ct(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return St(this,r)}}function St(t,e){return!e||"object"!==Ot(e)&&"function"!=typeof e?Tt(t):e}function Tt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ct(t){return(Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pt(t,e)}(i,t);var e,r,n,o=kt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).onPostRender=e.onPostRender.bind(Tt(e)),e}return e=i,(r=[{key:"getCopyrights",value:function(){var t=this;if(!this.frameState)return[];var e=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ct.inView)(r,t.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(e=e.concat(n.getSource().getAttributions()(t.frameState)))})),gt(e)}},{key:"activate",value:function(){wt(Ct(i.prototype),"activate",this).call(this),this.map&&this.map.on("postrender",this.onPostRender)}},{key:"deactivate",value:function(){this.map&&this.map.un("postrender",this.onPostRender),wt(Ct(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(t){this.map&&this.element&&(this.frameState=t.frameState,this.render())}}])&&jt(e.prototype,r),n&&jt(e,n),i}(vt(Z));function Rt(t){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Et(t){return function(t){if(Array.isArray(t))return Dt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(r),!0).forEach((function(e){At(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function At(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vt(t,e,r){return(Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ft(t,e){return(Ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bt(t);if(e){var o=Bt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qt(this,r)}}function qt(t,e){return!e||"object"!==Rt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Bt(t){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Nt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ft(t,e)}(c,t);var e,r,n,o=Ut(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Mt(this,c),o.call(this,It({controls:[].concat(Et(Object(i.defaults)({attribution:!1}).getArray()),[new xt])},t))}return e=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(t){t instanceof I?(t.init(this),this.mobilityLayers.push(t),t.olLayer&&Vt(Bt(c.prototype),"addLayer",this).call(this,t.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Vt(Bt(c.prototype),"addLayer",this).call(this,t)}},{key:"removeLayer",value:function(t){t instanceof I?(t.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(e){return e!==t})),t.olLayer&&Vt(Bt(c.prototype),"removeLayer",this).call(this,t)):Vt(Bt(c.prototype),"removeLayer",this).call(this,t)}},{key:"addControl",value:function(t){Vt(Bt(c.prototype),"addControl",this).call(this,t)}},{key:"removeControl",value:function(t){Vt(Bt(c.prototype),"removeControl",this).call(this,t)}}])&&Lt(e.prototype,r),n&&Lt(e,n),c}(it(o.a)),Ht=r(1),Kt=r(12),zt=r.n(Kt),Zt=r(13),Gt=r.n(Zt),Wt=r(6),$t=r.n(Wt),Jt=r(7),Qt=r.n(Jt);function Yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yt(Object(r),!0).forEach((function(e){te(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function te(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ee=function(t,e,r){if(!1===t)return r;var n=Qt.a.parseUrl(r);return!t&&n.query[e]?r:t?Qt.a.stringifyUrl(Xt(Xt({},n),{},{query:Xt(Xt({},n.query),{},te({},e,t))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},re=function(t){if(!t||!t.style)return[];var e=t.style.sourceCaches,r=[];return Object.values(e).forEach((function(t){if(t.used){var e=t.getSource(),n=e.attribution||e.options&&e.options.attribution;n&&(r=r.concat(n.replace(/&copy;/g,"©").split(/(<a.*?<\/a>)/)))}})),gt(r)},ne={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},oe=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],ie=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],ce=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ae=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],ue=function(t){return"string"==typeof t?oe.findIndex((function(e){return e.test(t)})):t},se=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;try{var r=ue(t);return ne[r][e]}catch(t){return 1}},le=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=ue(t);return ie[e]}catch(t){return 1}},fe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=ue(t);return ce[e]}catch(t){return 1}},pe=function(t,e,r,n){t.font="bold ".concat(n,"px Arial");for(var o=t.measureText(r),i=0;o.width>e-6&&i<25;)n-=.5,t.font="bold ".concat(n,"px arial, sans-serif"),o=t.measureText(r),i+=1;return n},ye=function(t,e,r){return e?r?"#ff0000":"#a0a0a0":t>=36e5?"#ed004c":t>=5e5?"#e80000":t>=3e5?"#ff4a00":t>=18e4?"#f7bf00":null===t?"#a0a0a0":"#00a00c"},he=function(t,e){if(e)return String.fromCodePoint(215);if(t>36e5){var r=Math.round(t/36e5);return"+".concat(r,"h")}if(t>59e3){var n=Math.round(t/6e4);return"+".concat(n,"m")}return t>0?"+".concat(t,"s"):""},be=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r},ve={},de={},me={},ge={},Oe={},je=function(t,e,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=e.zoom,s=e.pixelRatio,l=e.operator_provides_realtime_journey,f=t.line,p=t.type,y=t.id,h=t.delay,b=t.cancelled,v=void 0!==b&&b;p||(p="Rail"),f||(f={});var d=f,m=d.name,g=d.text_color,O=d.color;m||(m="I"),g||(g="#000000"),O&&"#"!==O[0]&&(O="#".concat(O)),"#"!==g[0]&&(g="#".concat(g));var j=Math.min(Math.floor(u||1),16),w=n===y,P=o===y,k=se(p,j)*s,S=k>=7*s;(w||P)&&(k=S?k+5*s:14*s);var T=k>10*s,C="".concat(k).concat(p).concat(O).concat(w).concat(P).concat(v).concat(h);if(i&&(C+="".concat(l)),T&&(C+="".concat(m).concat(g)),!Oe[C]){if(0===k)return Oe[C]=null,null;var x,R=1*s,E=k+2,D=2*k,_=2*E+2*R+100*s,I=_/2,A=be(_,_),M=A.getContext("2d");if(S&&null!==h){var L=function(t,e,r){var n="".concat(t,", ").concat(e,", ").concat(r);if(!ve[n]){var o=be(2*t,2*t),i=o.getContext("2d");i.beginPath(),i.arc(t,t,e,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),ve[n]=o}return ve[n]}(I,E,ye(h,v));M.drawImage(L,0,0)}if(S&&(w||h>=a||v)){var V=Math.max(v?19:14,Math.min(v?19:17,1.2*k)),F=function(t,e,r,n,o,i,c){var a="".concat(t,", ").concat(e,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!de[a]){var u=be(t,r+8),s=u.getContext("2d");s.textAlign="left",s.textBaseline="middle",s.font=n,s.fillStyle=o,s.strokeStyle=i,s.lineWidth=1.5*c;var l=e;s.strokeText(l,0,r),s.fillText(l,0,r),de[a]=u}return de[a]}(100,he(h,v),V,"bold ".concat(V,"px arial, sans-serif"),ye(h,v,!0),c,s);M.drawImage(F,I+E+R,I-V)}var U=function(t,e,r,n,o,i){var c="".concat(t,", ").concat(e,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!me[c]){var a=be(2*t,2*t),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(t,t,e,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),me[c]=a}return me[c]}(I,k,x=i?ye(h,v):O||le(p),S||w||P,S&&i&&null===h&&"yes"===l,s);if(M.drawImage(U,0,0),T){var q=Math.max(k,10),B=function(t,e,r,n,o,i,c){var a="".concat(t,", ").concat(e,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!ge[a]){var u=be(2*e,2*e),s=u.getContext("2d");i&&(s.save(),s.textBaseline="middle",s.textAlign="center",s.font="bold ".concat(r+2,"px Arial"),s.strokeStyle=o,s.strokeText(t,e,e),s.restore()),s.textBaseline="middle",s.textAlign="center",s.fillStyle=n,s.font="bold ".concat(r,"px Arial"),s.strokeStyle=o,s.strokeText(t,e,e),s.fillText(t,e,e),ge[a]=u}return ge[a]}(m,I,pe(M,D,m,q),i?"#000000":g||fe(p),x,i&&null===h&&"yes"===l,s);M.drawImage(B,0,0)}Oe[C]=A}return Oe[C]},we=document.createElement("canvas");we.width=15,we.height=15;var Pe=we.getContext("2d");Pe.arc(8,8,5,0,2*Math.PI,!1),Pe.fillStyle="#8ED6FF",Pe.fill(),Pe.lineWidth=3,Pe.strokeStyle="black",Pe.stroke(),Pe.lineWidth=3;function ke(t){return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Te(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Te(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(r),!0).forEach((function(e){Re(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function De(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _e(t,e,r){return(_e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ve(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ie(t,e){return(Ie=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ae(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ve(t);if(e){var o=Ve(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Me(this,r)}}function Me(t,e){return!e||"object"!==ke(e)&&"function"!=typeof e?Le(t):e}function Le(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ve(t){return(Ve=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ie(t,e)}(i,t);var e,r,n,o=Ae(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ee(this,i);var r=new at.a({source:new Gt.a({}),render:function(e){if(!t.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=t.mbMap.getCanvas(),o=e.viewState,i=t.olLayer.getVisible();t.renderState.visible!==i&&(n.style.display=i?"block":"none",t.renderState.visible=i,n.style.position="absolute");var c=t.olLayer.getOpacity();t.renderState.opacity!==c&&(n.style.opacity=c,t.renderState.opacity=c);var a=o.rotation;t.renderState.rotation!==a&&(t.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,t.renderState.rotation=a),t.renderState.zoom===o.zoom&&t.renderState.center[0]===o.center[0]&&t.renderState.center[1]===o.center[1]||(t.mbMap.jumpTo({center:Object(Ht.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,t.renderState.zoom=o.zoom,t.renderState.center=o.center);var u=t.map.getSize();if(t.renderState.size[0]===u[0]&&t.renderState.size[1]===u[1]||(r=!0,t.renderState.size=u),t.mbMap&&t.mbMap.style&&t.mbMap.isStyleLoaded()&&r)try{t.mbMap._frame&&(t.mbMap._frame.cancel(),t.mbMap._frame=null),t.mbMap._render()}catch(t){console.warn(t)}return n}});return(t=o.call(this,xe(xe({},e),{},{olLayer:r}))).styleUrl=e.url,t.apiKey=e.apiKey,t.apiKeyName=e.apiKeyName||"key",t.updateAttribution=t.updateAttribution.bind(Le(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;_e(Ve(i.prototype),"init",this).call(this,t),this.map&&!this.mbMap&&(this.format=new $t.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{e.mbMap&&e.mbMap.resize()}catch(t){console.warn(t)}}))))}},{key:"createStyleUrl",value:function(){return ee(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var t=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){t.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var e=Se(this.map.getView().getCenter(),2),r=e[0],n=e[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new zt.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ht.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(t){console.warn("Failed creating mapbox map: ",t)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){t.loaded=!0,t.copyrights=t.copyrights||re(t.mbMap)||[],t.olLayer.getSource().setAttributions(t.copyrights),t.dispatchEvent({type:"load",target:t})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){t.loadMbMap()})))}},{key:"updateAttribution",value:function(t){var e=this.copyrights||re(t.target)||[];this.copyrights.toString()!==e.toString()&&this.olLayer.getSource().setAttributions(e)}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){var r=this;if(!(e&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:t,features:[],layer:this});var n=t&&this.mbMap.project(Object(Ht.toLonLat)(t));if(this.hitTolerance){var o=n,i=o.x,c=o.y;n=[{x:i-this.hitTolerance,y:c-this.hitTolerance},{x:i+this.hitTolerance,y:c+this.hitTolerance}]}var a=this.mbMap.queryRenderedFeatures(n,e).map((function(t){var e=r.format.readFeature(t);return e&&e.set("mapboxFeature",t),e}));return Promise.resolve({layer:this,features:a,coordinate:t})}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,_e(Ve(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(t){return new i(xe(xe({},this.options),t))}}])&&De(e.prototype,r),n&&De(e,n),i}(I);var Ue=r(0),qe=r(14),Be=r(8);var Ne=new Ue.Circle({radius:6,fill:new Ue.Fill({color:[255,0,0,1]}),stroke:new Ue.Stroke({color:[0,0,0,1],width:1})}),He=(new Ue.Style({stroke:new Ue.Stroke({color:[0,0,0,1],width:5})}),new Ue.Style({image:Ne,stroke:new Ue.Stroke({color:[255,0,0,1],width:3})}),new Ue.Style({image:Ne,stroke:new Ue.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(9)),Ke=r(2),ze=r(5),Ze=r.n(ze),Ge=r(16),We=r.n(Ge);function $e(t){return function(t){if(Array.isArray(t))return Ye(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Qe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Je(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||Qe(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(t,e){if(t){if("string"==typeof t)return Ye(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ye(t,e):void 0}}function Ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Xe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var rr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xe(Object(r),!0).forEach((function(e){tr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({interpolate:!0},e);this.pixelRatio=e.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var e,r,n;return e=t,(r=[{key:"setVisible",value:function(t){this.canvas&&(this.canvas.style.visibility=t?"visible":"hidden")}},{key:"setTrajectories",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&t.sort(this.sort),this.trajectories=t}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.time,n=void 0===r?Date.now():r,o=t.size,i=void 0===o?[]:o,c=t.center,a=t.resolution,u=t.rotation,s=void 0===u?0:u,l=t.pixelRatio;this.clear();var f=Je(i,2),p=f[0],y=f[1];if(p&&y&&(this.canvas.width!==p||this.canvas.height!==y)){var h=[p*l,y*l];this.canvas.width=h[0],this.canvas.height=h[1]}var b,v,d,m,g,O,j,w,P=Object(He.compose)(Object(He.create)(),i[0]/2,i[1]/2,1/a,-1/a,-s,-c[0],-c[1]);this.canvas.style.width="".concat(this.canvas.width/l,"px"),this.canvas.style.height="".concat(this.canvas.height/l,"px"),this.currResolution=a||this.currResolution,this.renderedTrajectories=[];for(var k=(this.trajectories||[]).length-1;k>=0;k-=1){var S=this.trajectories[k],T=S.geometry,C=S.timeIntervals,x=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var R=null,E=void 0;if(!S.coordinate||!e&&this.interpolate){if(C&&C.length>1){for(var D=n-(x||0),_=void 0,I=void 0,A=void 0,M=void 0,L=void 0,V=0;V<C.length-1;V+=1){var F=Je(C[V],3);_=F[0],A=F[1],E=F[2];var U=Je(C[V+1],2);if(I=U[0],M=U[1],_<=D&&D<=I)break;_=null,I=null}if(T.getType()===We.a.POINT)R=T.getCoordinates();else if(T.getType()===We.a.LINE_STRING){if(_&&I){L=this.interpolate?Math.min((D-_)/(I-_),1):0;var q=this.interpolate?L*(M-A)+A:0;R=T.getCoordinateAt(q),this.trajectories[k].rotation=E,this.trajectories[k].endFraction=L}else if(D<C[0][0]){var B=Je(C,1),N=Je(B[0],3);E=N[2],L=0,R=T.getFirstCoordinate()}else if(D>C[C.length-1][0]){var H=Je(C[C.length-1],3);E=H[2],L=1,R=T.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",T);this.trajectories[k].rotation=E,this.trajectories[k].endFraction=L||0}}else R=S.coordinate;if(R){this.trajectories[k].coordinate=R;var K=Object(He.apply)(P,$e(R));if(!K)continue;K=K.map((function(t){return t*l})),this.trajectories[k].rendered=!0,this.renderedTrajectories.push(this.trajectories[k]);var z=this.style(S,t);if(!z)continue;var Z=z.width,G=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,K[0]-Z/2,K[1]-G/2,Z,G),this.hoverVehicleId===S.id&&(b=z,v=K,d=Z,m=G),this.selectedVehicleId===S.id&&(g=z,O=K,j=Z,w=G)}}}g&&this.canvasContext.drawImage(g,O[0]-j/2,O[1]-w/2,j,w),b&&this.canvasContext.drawImage(b,v[0]-d/2,v[1]-m/2,d,m)}},{key:"destroy",value:function(){this.renderedTrajectories=[],this.clear()}}])&&er(e.prototype,r),n&&er(e,n),t}(),nr=function(t,e,r,n){var o=[];if(!(t||e||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(t){var e=t.name||t.line&&t.line.name||"";return!!e&&i.some((function(t){return new RegExp(t,"i").test(e)}))}))}if(t){var c=("string"==typeof t?t.split(","):t).map((function(t){return t.replace(/\s+/g,"").toUpperCase()}));o.push((function(t){var e=(t.name||t.line&&t.line.name||"").toUpperCase();return!!e&&c.includes(e)}))}if(e){var a=("string"==typeof e?e.split(","):e).map((function(t){return parseInt(t,10)}));o.push((function(t){var e=parseInt(t.routeIdentifier.split(".")[0],10);return a.includes(e)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(t){return u.some((function(e){return new RegExp(e,"i").test(t.operator)}))}))}return o.length?function(t){for(var e=0;e<o.length;e+=1)if(!o[e](t))return!1;return!0}:null};function or(t){return(or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ir(t){return function(t){if(Array.isArray(t))return cr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return cr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ar(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ur(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ar(Object(r),!0).forEach((function(e){sr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ar(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function sr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lr(t,e,r){return(lr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=br(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function fr(t,e){return(fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=br(t);if(e){var o=br(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yr(this,r)}}function yr(t,e){return!e||"object"!==or(e)&&"function"!=typeof e?hr(t):e}function hr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function br(t){return(br=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mr(t,e,r){return e&&dr(t.prototype,e),r&&dr(t,r),t}var gr=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fr(t,e)}(r,t);var e=pr(r);function r(t){var n;return vr(this,r),(n=e.call(this,ur({hitTolerance:10},t))).onFeatureHover=n.onFeatureHover.bind(hr(n)),n.onFeatureClick=n.onFeatureClick.bind(hr(n)),n}return mr(r,[{key:"defineProperties",value:function(t){var e=this,n=ur({},t),o=n.style,i=n.speed,c=t.pixelRatio,a=t.interpolate,u=t.hoverVehicleId,s=t.selectedVehicleId,l=t.filter,f=t.sort,p=t.time,y=t.live,h=t.regexPublishedLineName,b=t.publishedLineName,v=t.tripNumber,d=t.operator,m={pixelRatio:c||window.devicePixelRatio||1,interpolate:a,hoverVehicleId:u,selectedVehicleId:s,filter:l,sort:f,style:o};Object.keys(m).forEach((function(t){return void 0===m[t]&&delete m[t]}));var g=i||1,O=p||new Date;lr(br(r.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:o||this.defaultStyle},speed:{get:function(){return g},set:function(t){g=t,e.start()}},filter:{get:function(){return e.tracker?e.tracker.filter:e.initTrackerOptions.filter},set:function(t){e.tracker?e.tracker.filter=t:e.initTrackerOptions.filter=t}},sort:{get:function(){return e.tracker?e.tracker.sort:e.initTrackerOptions.sort},set:function(t){e.tracker?e.tracker.sort=t:e.initTrackerOptions.sort=t}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==y||y,writable:!0},time:{get:function(){return O},set:function(t){O=t&&t.getTime?t:new Date(t),e.renderTrajectories()}},trajectories:{get:function(){return e.tracker&&e.tracker.trajectories||[]}},renderedTrajectories:{get:function(){return e.tracker&&e.tracker.renderedTrajectories||[]}},hoverVehicleId:{get:function(){return e.tracker?e.tracker.hoverVehicleId:e.initTrackerOptions.hoverVehicleId},set:function(t){e.tracker?e.tracker.hoverVehicleId=t:e.initTrackerOptions.hoverVehicleId=t}},selectedVehicleId:{get:function(){return e.tracker?e.tracker.selectedVehicleId:e.initTrackerOptions.selectedVehicleId},set:function(t){e.tracker?e.tracker.selectedVehicleId=t:e.initTrackerOptions.selectedVehicleId=t}},pixelRatio:{get:function(){return e.tracker?e.tracker.pixelRatio:e.initTrackerOptions.pixelRatio},set:function(t){e.tracker?e.tracker.pixelRatio=t:e.initTrackerOptions.pixelRatio=t}},initTrackerOptions:{value:m,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0},publishedLineName:{get:function(){return b},set:function(t){b=t,e.updateFilters()}},tripNumber:{get:function(){return v},set:function(t){v=t,e.updateFilters()}},operator:{get:function(){return d},set:function(t){d=t,e.updateFilters()}},regexPublishedLineName:{get:function(){return h},set:function(t){h=t,e.updateFilters()}},delayDisplay:{value:t.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:t.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:t.useDelayStyle||!1,writable:!0}})}},{key:"init",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lr(br(r.prototype),"init",this).call(this,t),this.tracker=new rr(ur(ur({style:function(t,r){return e.style(t,r)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(t){t.target.visible?e.start():e.stop()}))}},{key:"terminate",value:function(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),lr(br(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.updateFilters(),this.tracker.setVisible(!0),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var t=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){t.time=t.live?new Date:t.time.getTime()+t.updateTimeDelay*t.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(t,e){if(!this.tracker)return!1;var r=this.live?Date.now():this.time;return this.tracker.renderTrajectories(ur(ur({},t),{},{time:r}),e),!0}},{key:"renderTrajectories",value:function(t,e){var r=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(t,e)})):this.renderTrajectoriesInternal(t,e)}},{key:"getVehicle",value:function(t){return this.tracker.getTrajectories().filter(t)}},{key:"getVehiclesAtCoordinate",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(Ke.buffer)([].concat(ir(t),ir(t)),this.hitTolerance*e),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Ke.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.resolution,n=e.nb,o=this.getVehiclesAtCoordinate(t,r,n);return Promise.resolve({layer:this,features:o.map((function(t){var e=new Ze.a({geometry:t.geometry});return e.setProperties(ur({},t)),e})),coordinate:t})}},{key:"onZoomEnd",value:function(t){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(t){var e=Math.round(t),r=ae[e]||25;return Math.max(25,r/this.speed)}},{key:"updateFilters",value:function(){var t=Qt.a.parse(window.location.search.toLowerCase());this.filter=nr(this.publishedLineName||t.publishedlinename,this.tripNumber||t.tripnumber,this.operator||t.operator,this.regexPublishedLineName)}},{key:"defaultStyle",value:function(t,e){return je(t,e,this)}}]),r}(t)};function Or(t){return(Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function wr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?jr(Object(r),!0).forEach((function(e){Pr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Tr(t,e,r){return(Tr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Er(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Cr(t,e){return(Cr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Er(t);if(e){var o=Er(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rr(this,r)}}function Rr(t,e){return!e||"object"!==Or(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Er(t){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Dr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Cr(t,e)}(i,t);var e,r,n,o=xr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return kr(this,i),(t=o.call(this,wr({},e))).renderWhenInteracting=e.renderWhenInteracting||function(){return t.tracker&&t.tracker.renderedTrajectories&&t.tracker.renderedTrajectories.length<=200},t.olLayer=e.olLayer||new Be.Group({layers:[new Be.Vector({source:new qe.Vector({features:[]})}),new Be.Layer({source:new Gt.a({}),render:function(e){if(!t.tracker||!t.tracker.canvas)return null;if(t.container||(t.container=document.createElement("div"),t.container.style.position="absolute",t.container.style.width="100%",t.container.style.height="100%",t.transformContainer=document.createElement("div"),t.transformContainer.style.position="absolute",t.transformContainer.style.width="100%",t.transformContainer.style.height="100%",t.container.appendChild(t.transformContainer),t.tracker.canvas.style.position="absolute",t.tracker.canvas.style.top="0",t.tracker.canvas.style.left="0",t.tracker.canvas.style.transformOrigin="top left",t.transformContainer.appendChild(t.tracker.canvas)),t.renderedViewState){var r=e.viewState,n=r.center,o=r.resolution,i=r.rotation,c=t.renderedViewState,a=c.center,u=c.resolution,s=c.rotation;if(t.renderWhenInteracting&&t.renderWhenInteracting(e.viewState,t.renderedViewState))t.renderTrajectories(!0);else if(u/o>=3)t.tracker.clear();else{var l=t.map.getPixelFromCoordinate(a),f=t.map.getPixelFromCoordinate(n);t.transformContainer.style.transform=Object(He.composeCssTransform)(l[0]-f[0],l[1]-f[1],u/o,u/o,i-s,0,0)}}return t.container}})]}),t.vectorLayer=t.olLayer.getLayers().item(0),t.renderState={center:[0,0],zoom:null,rotation:0},t}return e=i,(r=[{key:"init",value:function(t){var e=this;Tr(Er(i.prototype),"init",this).call(this,t),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(t){var r=e.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();e.currentZoom!==n&&e.onZoomEnd(t),e.currentZoom=n,e.onMoveEnd(t)}})))}},{key:"terminate",value:function(){Tr(Er(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(t){if(this.map&&this.tracker&&this.tracker.canvas){var e=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(t);return!!e.getImageData(r[0],r[1],1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(t){var e=this.map.getView();Tr(Er(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:e.calculateExtent(),resolution:e.getResolution(),rotation:e.getRotation(),zoom:e.getZoom(),pixelRatio:this.pixelRatio},t)}},{key:"renderTrajectoriesInternal",value:function(t,e){(this.renderWhenInteracting(t,this.renderedViewState)||!this.map.getView().getAnimating()&&!this.map.getView().getInteracting())&&Tr(Er(i.prototype),"renderTrajectoriesInternal",this).call(this,t,e)&&(this.renderedViewState=wr({},t),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Tr(Er(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=this.map.getView().getResolution();return Tr(Er(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(t))return Promise.resolve({features:[],layer:this,coordinate:t});var r=this.map.getView().getResolution();return Tr(Er(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,wr({resolution:r},e))}},{key:"onMoveEnd",value:function(t){}},{key:"onZoomEnd",value:function(t){Tr(Er(i.prototype),"onZoomEnd",this).call(this,t)}},{key:"onFeatureHover",value:function(t,e,r){Tr(Er(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getTargetElement().style.cursor=t.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(t,e,r){Tr(Er(i.prototype),"onFeatureClick",this).call(this,t,e,r),!t.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(t){return new i(wr(wr({},this.options),t))}}])&&Sr(e.prototype,r),n&&Sr(e,n),i}(gr(I)),_r=r(4),Ir=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=(t.getUTCMonth()+1).toString();e=1===e.length?"0".concat(e):e;var r=t.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[t.getUTCFullYear(),e,r].join("")},Ar=function(t){return[t.getUTCHours(),t.getUTCMinutes(),"".concat(t.getUTCSeconds(),".").concat(t.getUTCMilliseconds())].join(":")};function Mr(t){return(Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lr(Object(r),!0).forEach((function(e){Fr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Fr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Br(t,e){return(Br=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Kr(t);if(e){var o=Kr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hr(this,r)}}function Hr(t,e){return!e||"object"!==Mr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Kr(t){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Br(t,e)}(i,t);var e,r,n,o=Nr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ur(this,i),(t=o.call(this)).url=e.url,t.apiKey=e.apiKey,t}return e=i,(r=[{key:"fetch",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=Vr(Vr({},e),{},{key:this.apiKey}),o=Vr({},n);return Object.keys(n).forEach((function(t){return(void 0===o[t]||null===o[t])&&delete o[t]})),this.apiKey?fetch("".concat(this.url).concat(t,"?").concat(Qt.a.stringify(o)),r).then((function(t){try{return t.json().then((function(t){if(t.error)throw new Error(t.error);return t}))}catch(t){return Promise.reject(new Error(t))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&qr(e.prototype,r),n&&qr(e,n),i}(M.a);function Zr(t){return(Zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gr(Object(r),!0).forEach((function(e){$r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yr(t,e){return(Yr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=en(t);if(e){var o=en(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tn(this,r)}}function tn(t,e){return!e||"object"!==Zr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function en(t){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yr(t,e)}(i,t);var e,r,n,o=Xr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Jr(this,i),o.call(this,Wr({url:"https://api.geops.io/stops/v1/"},t))}return e=i,(r=[{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",t,{signal:e.signal}).then((function(t){return t.features}))}}])&&Qr(e.prototype,r),n&&Qr(e,n),i}(zr);function nn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function on(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var cn=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=n.d,i=n.m,c=n.y;e.push({day:o,month:i,year:c})}return e},an=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nn(Object(r),!0).forEach((function(e){on(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);["a","f","tt"].forEach((function(t){e[t]||(e[t]={})}));for(var r=e.id,n=e.hs,o=e.t,i=e.ln,c=e.sn,a=e.wa,u=e.ba,s=e.rt,l=e.fid,f=e.rid,p=e.c,y=e.tc,h=e.a,b=h.n,v=h.u,d=h.tz,m=e.f,g=m.n,O=m.u,j=m.tz,w=e.tt,P=w.n,k=w.p,S=w.t,T=e.sts,C=cn(P),x=cn(k),R=p&&"#".concat(p),E=y&&"#".concat(y),D=[],_=0;_<(T||[]).length;_+=1){var I=T[_],A=I.sid,M=I.n,L=I.p,V=I.at,F=I.dt,U=I.ap,q=I.dp,B=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;D.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==V?1e3*U:null,departureTime:-1!==F?1e3*q:null,arrivalDelay:B,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:R,color:E,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:D,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:x},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},un=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=new _r.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=i.DirectionText,f=i.Operator,p=i.OperatorURL,y=i.Publisher,h=i.PublisherURL,b=i.License,v=i.LicenseUrl,d=i.LicenseNote,m=i.Color,g=i.JourneyIdentifier,O=i.RealtimeAvailable,j=i.OperatorProvidesRealtime,w=i.DayOfOperation,P=i.Delay,k=i.TimeIntervals,S=i.TextColor,T=i.Cancelled;e.push({id:c,type:a,name:u,routeIdentifier:s,directionText:l,operator:f,operatorUrl:p,publisher:y,publisherUrl:h,license:b,licenseUrl:v,licenseNote:d,journeyIdentifier:g,realtimeAvailable:O,operatorProvidesRealtime:j,dayOfOperation:w,delay:P,timeIntervals:k,color:m&&"#".concat(m),textColor:S&&"#".concat(S),geometry:o,cancelled:T})}return e};function sn(t){return(sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ln(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function fn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ln(Object(r),!0).forEach((function(e){pn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bn(t,e){return(bn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mn(t);if(e){var o=mn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dn(this,r)}}function dn(t,e){return!e||"object"!==sn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mn(t){return(mn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bn(t,e)}(i,t);var e,r,n,o=vn(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yn(this,i),o.call(this,fn({url:"https://api.geops.io/tracker/v1"},t))}return e=i,(r=[{key:"fetchTrajectoryById",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",t,{signal:e.signal})}},{key:"fetchTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",t,{signal:e.signal}).then((function(t){return un(t.features)}))}},{key:"fetchTrajectoryStations",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",t,{signal:e.signal}).then((function(t){return an(t)}))}}])&&hn(e.prototype,r),n&&hn(e,n),i}(zr);function On(t){return function(t){if(Array.isArray(t))return jn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return jn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jn(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Pn=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subscriptions=[],this.subscribed={},this.connect(e),setInterval((function(){r.send("PING")}),1e4)}var e,r,n;return e=t,n=[{key:"getRequestString",value:function(t,e){var r="".concat(t," ").concat(e.channel);return r+=e.args?" ".concat(e.args):"",(r+=e.id?" ".concat(e.id):"").trim()}}],(r=[{key:"connect",value:function(t){var e=this;this.websocket&&this.websocket.readyState!==this.websocket.CLOSED&&this.websocket.close(),this.websocket=new WebSocket(t),On(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)})),this.websocket.onclose=function(){window.clearTimeout(e.reconnectTimeout),e.reconnectTimeout=window.setTimeout((function(){return e.connect(t)}),100)}}},{key:"get",value:function(e,r,n){var o=t.getRequestString("GET",e);this.send(o),this.listen(e,r,n)}},{key:"send",value:function(t){var e=this,r=function(){e.websocket.send(t)};this.websocket.readyState===WebSocket.CONNECTING?this.websocket.addEventListener("open",r):r()}},{key:"listen",value:function(t,e,r){this.unlisten(t,e);var n=function(r){var n=JSON.parse(r.data),o=t.channel;o+=t.args?" ".concat(t.args):"",n.source!==o||t.id&&t.id!==n.client_reference||e(n)};return this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r)),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t.channel&&(!e||r.cb===e)})).forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))}))}},{key:"subscribe",value:function(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(e,r,n),c=i.onMessageCb,a=i.onErrorCb,u=t.getRequestString("",e),s=this.subscriptions.findIndex((function(t){return e.channel===t.params.channel&&r===t.cb})),l={params:e,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,quiet:o};s>-1?this.subscriptions[s]=l:this.subscriptions.push(l),this.subscribed[u]||(l.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(t,e){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===t&&(!e||r.cb===e)}));n.forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==t||e&&r.cb!==e})),t&&this.subscribed[t]&&!this.subscriptions.find((function(e){return e.params.channel===t}))&&n.find((function(t){return!t.quiet}))&&(this.send("DEL ".concat(t)),this.subscribed[t]=!1)}}])&&wn(e.prototype,r),n&&wn(e,n),t}(),kn=function(t,e){return t===e.SCHEMATIC?"_schematic":""},Sn=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=t.has_fzo&&n.indexOf(t.state)>-1,i=e.has_fzo&&n.indexOf(e.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(t.state!==e.state)return n.indexOf(t.state)-n.indexOf(e.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(t.min_arrival_time||t.time).getTime()-u,a=new Date(e.min_arrival_time||e.time).getTime()-u):(c=new Date(t.time).getTime()-u,a=new Date(e.time).getTime()-u),c-a},Tn=function(t){if(t)return t.stations.forEach((function(t){t.arrivalTimeWithDelay=t.arrivalTime,t.departureTime&&(t.departureTimeWithDelay=t.departureTime),t.arrivalDelay&&(t.arrivalTime-=t.arrivalDelay,t.departureTime&&(t.departureTime-=t.arrivalDelay))})),t};function Cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Rn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},En=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Cn(this,t);var r=null;r="string"==typeof e?e:e.url,e.apiKey&&(r="".concat(r,"?key=").concat(e.apiKey)),this.bbox=e.bbox,this.projection=e.projection||"EPSG:3857",this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=e.prefix||"",this.isUpdateBboxOnMoveEnd=e.isUpdateBboxOnMoveEnd||!1,this.conn=new Pn(r),e.projection&&this.setProjection(e.projection)}var e,r,n;return e=t,(r=[{key:"setProjection",value:function(t){this.conn.send("PROJECTION ".concat(t))}},{key:"setBbox",value:function(t){this.bbox=t,this.conn.send("BBOX ".concat(t.join(" ")))}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"subscribe",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:t},e,r,n)}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;this.conn.unsubscribe("".concat(t).concat(kn(Rn.SCHEMATIC,Rn)).concat(e),r),this.conn.unsubscribe("".concat(t).concat(kn(Rn.TOPOGRAPHIC,Rn)).concat(e),r)}},{key:"filterDepartures",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(t).map((function(e){return t[e]}));r.sort((function(t,r){return Sn(t,r,e)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],c=[],a=null,u=r.length-1;u>=0;u-=1){var s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=t;var o=t?"timetable_".concat(t):null,i={};this.subscribe(o,(function(t){if(t.source===o){var c=t.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(e.departureUpdateTimeout),e.departureUpdateTimeout=window.setTimeout((function(){var t=e.filterDepartures(i,r);n(t)}),100)}}),(function(){n([])}))}},{key:"unsubscribeDepartures",value:function(t){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",t),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(t){this.subscribe("".concat(this.prefix,"newsticker"),(function(e){t(e.content)}))}},{key:"unsubscribeDisruptions",value:function(t){this.unsubscribe("".concat(this.prefix,"newsticker"),"",t)}},{key:"getStation",value:function(t,e){var r=this,n={channel:"station".concat(kn(e,Rn)),args:t};return new Promise((function(t,e){r.conn.get(n,(function(r){r.content?t(r.content):e()}))}))}},{key:"getStations",value:function(t,e){var r=this,n=[];e&&this.conn.setBbox(e);var o={channel:"station".concat(kn(t,Rn))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(t,e){r.conn.get(o,(function(o){o.content?(n.push(o.content),window.clearTimeout(r.stationUpdateTimeout),r.stationUpdateTimeout=window.setTimeout((function(){t(n)}),50)):e(o.content)}))}))}},{key:"subscribeStations",value:function(t,e,r){this.unsubscribeStations(),e&&this.conn.setBbox(e),this.subscribe("station".concat(kn(t,Rn)),(function(t){t.content&&r(t.content)}))}},{key:"unsubscribeStations",value:function(t){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",t)}},{key:"subscribeExtraGeoms",value:function(t){var e=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?e.extraGeoms[o]=n:delete e.extraGeoms[o],t(Object.keys(e.extraGeoms).map((function(t){return e.extraGeoms[t]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(t){this.unsubscribe("extra_geoms","",t)}},{key:"subscribeTrajectory",value:function(t,e){this.unsubscribeTrajectory(e),this.subscribe("trajectory".concat(kn(t,Rn)),e,null,this.isUpdateBboxOnMoveEnd)}},{key:"unsubscribeTrajectory",value:function(t){this.unsubscribe("trajectory","",t)}},{key:"subscribeDeletedVehicles",value:function(t,e){this.unsubscribeDeletedVehicles(e),this.subscribe("deleted_vehicles".concat(kn(t,Rn)),e,null,this.isUpdateBboxOnMoveEnd)}},{key:"unsubscribeDeletedVehicles",value:function(t){this.unsubscribe("deleted_vehicles","",t)}},{key:"getFullTrajectory",value:function(t,e){var r=this,n={channel:"full_trajectory".concat(kn(e,Rn),"_").concat(t)};return new Promise((function(t){r.conn.get(n,(function(e){e.content&&t(e.content)}))}))}},{key:"getFullTrajectories",value:function(t,e){var r=this,n=t.map((function(t){return r.getFullTrajectory(t,e)}));return Promise.all(n)}},{key:"subscribeFullTrajectory",value:function(t,e){this.unsubscribeFullTrajectory(t),this.subscribe("full_trajectory".concat(kn(e,Rn),"_").concat(t),(function(t){console.log("subscribe full_trajectory",t)}),(function(t){console.log("subscribe full_trajectory error",t)}))}},{key:"unsubscribeFullTrajectory",value:function(t,e){this.unsubscribe("full_trajectory","_".concat(t),e)}},{key:"getStopSequence",value:function(t){var e=this,r={channel:"stopsequence_".concat(t)};return new Promise((function(t,n){e.conn.get(r,(function(e){if(e.content&&e.content.length){var r=e.content.map((function(t){return Tn(t)}));t(r)}t([])}),(function(t){n(t)}))}))}},{key:"getStopSequences",value:function(t){var e=this,r=t.map((function(t){return e.getStopSequence(t)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(t,e){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(t),this.subscribe("stopsequence_".concat(t),(function(t){if(t.content&&t.content.length){var r=t.content.map((function(t){return Tn(t)}));e(r)}}),(function(t){console.log("subscribe stopsequence error",t)}))}},{key:"unsubscribeStopSequence",value:function(t,e){this.unsubscribe("stopsequence","_".concat(t),e)}},{key:"subscribeHealthCheck",value:function(t){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",t)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&xn(e.prototype,r),n&&xn(e,n),t}();function Dn(t){return(Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function In(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(r),!0).forEach((function(e){An(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function An(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ln(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ln(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vn(t,e,r){return(Vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bn(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Fn(t,e){return(Fn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Un(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bn(t);if(e){var o=Bn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qn(this,r)}}function qn(t,e){return!e||"object"!==Dn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Bn(t){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Kn(t,e,r){return e&&Hn(t.prototype,e),r&&Hn(t,r),t}var zn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fn(t,e)}(r,t);var e=Un(r);function r(){return Nn(this,r),e.apply(this,arguments)}return Kn(r,[{key:"defineProperties",value:function(t){var e=this;Vn(Bn(r.prototype),"defineProperties",this).call(this,t);var n,o=3;if(!t.api){var i={};t.url&&(i.url=t.url),t.apiKey&&(i.apiKey=t.apiKey),n=new gn(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(t){t!==o&&(o=t,e.visible&&e.start())}},api:{value:t.api||n}})}},{key:"init",value:function(t){Vn(Bn(r.prototype),"init",this).call(this,t),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(t,e){return null===t.delay||t.delay<e.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),Vn(Bn(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Vn(Bn(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(t,e,n){var o=Mn(t,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Vn(Bn(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=Mn(t,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Vn(Bn(r.prototype),"onFeatureClick",this).call(this,t,e,n)}},{key:"highlightTrajectory",value:function(){var t=this,e=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:e,time:Ar(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:Ar(new Date)}))];Promise.all(n).then((function(e){var r=Mn(e,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(t){i.push(t.coordinates)})),o){var c=o.p,a=o.t,u=o.c,s=[];c.forEach((function(t){t.forEach((function(t){s.push([t.x,t.y])}))}));var l=u?"#".concat(u):le(a),f=/#ffffff/i.test(l)?"#ff0000":l;t.drawFullTrajectory(i,s,t.useDelayStyle?"#a0a0a0":f)}})).catch((function(){t.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=1e3*(this.requestIntervalSeconds+5),r=this.speed*e,n=this.time,o=!0;if(this.later&&n.getTime()>this.later.getTime()-1e3*this.requestIntervalSeconds&&(o=!1),!this.later||!o||this.later.getTime()-n.getTime()>r){var i=new Date(n.getTime()+r);this.later=i}var c=In(In({},t),{},{btime:Ar(n),etime:Ar(this.later),date:Ir(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var t=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){t.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var t=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(t){if("AbortError"!==t.name)throw t})).then((function(e){e&&(t.tracker.setTrajectories(e),t.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(t,e,r){}},{key:"defaultStyle",value:function(t,e){var r=e.zoom,n=t.type,o=t.name,i=t.id,c=t.color,a=t.textColor,u=t.delay,s=t.cancelled,l=t.operatorProvidesRealtime,f=Math.min(Math.floor(r||1),16),p=this.hoverVehicleId===i,y=this.selectedVehicleId===i,h="".concat(f).concat(n).concat(o).concat(l).concat(u).concat(p).concat(y).concat(s),b=se(n,f)*this.pixelRatio,v=b>=7*this.pixelRatio;(p||y)&&(b=v?b+5*this.pixelRatio:14*this.pixelRatio);var d=b>10*this.pixelRatio;if(d||(h="".concat(f).concat(n).concat(c).concat(l).concat(u).concat(p).concat(y).concat(s)),!this.styleCache[h]){if(0===b)return this.styleCache[h]=null,null;var m=1*this.pixelRatio,g=b+2,O=2*b,j=document.createElement("canvas");j.width=2*g+2*m+100*this.pixelRatio,j.height=2*g+2*m+100*this.pixelRatio;var w,P=j.getContext("2d"),k=j.width/2;if(v&&null!==u&&(P.save(),P.beginPath(),P.arc(k,k,g,0,2*Math.PI,!1),P.fillStyle=ye(u,s),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||s)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(s?19:14,Math.min(s?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=ye(u,s,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=he(u,s);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?ye(u,s):c||le(n),P.save(),(v||p||y)&&(P.lineWidth=1*this.pixelRatio,P.strokeStyle="#000000"),P.fillStyle=w,P.beginPath(),P.arc(k,k,b,0,2*Math.PI,!1),P.fill(),v&&this.useDelayStyle&&null===u&&"yes"===l&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=pe(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===l&&(P.save(),P.textBaseline="middle",P.textAlign="center",P.font="bold ".concat(C+2,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.restore()),P.save(),P.textBaseline="middle",P.textAlign="center",P.fillStyle=this.useDelayStyle?"#000000":a||fe(n),P.font="bold ".concat(C,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.fillText(o,k,k),P.restore()}this.styleCache[h]=j}return this.styleCache[h]}}]),r}(t)};function Zn(t){return(Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gn(Object(r),!0).forEach((function(e){$n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yn(t,e,r){return(Yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ro(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Xn(t,e){return(Xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function to(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ro(t);if(e){var o=ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return eo(this,r)}}function eo(t,e){return!e||"object"!==Zn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ro(t){return(ro=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var no=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xn(t,e)}(i,t);var e,r,n,o=to(i);function i(){return Jn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"start",value:function(){var t=this;this.map&&(Yn(ro(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){t.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),Yn(ro(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var t=this.map.getView().getZoom();t!==this.currentZoom&&(this.currentZoom=t,this.requestIntervalSeconds=200/t||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(t,e,r){var n=this.vectorLayer.getSource();if(n.clear(),t){var o=new _r.MultiPoint(t.map((function(t){return Object(Ht.fromLonLat)(t)}))),i=new Ze.a(o);i.setStyle(new Ue.Style({zIndex:1,image:new Ue.Circle({radius:5,fill:new Ue.Fill({color:"#000000"})})}));var c=new Ze.a(o);c.setStyle(new Ue.Style({zIndex:4,image:new Ue.Circle({radius:4,fill:new Ue.Fill({color:r})})})),n.addFeatures([i,c])}if(e){var a=new Ze.a({geometry:new _r.LineString(e)});a.setStyle([new Ue.Style({zIndex:2,stroke:new Ue.Stroke({color:"#000000",width:6})}),new Ue.Style({zIndex:3,stroke:new Ue.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getView().calculateExtent(),r=Object(Ke.buffer)(e,Object(Ke.getWidth)(e)/10).join(","),n=this.map.getView().getZoom();return Yn(ro(i.prototype),"getParams",this).call(this,Wn(Wn({},t),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(t){return new i(Wn(Wn({},this.options),t))}}])&&Qn(e.prototype,r),n&&Qn(e,n),i}(zn(Dr)),oo=r(24),io=r.n(oo);function co(t){return(co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ao(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return uo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uo(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function so(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?so(Object(r),!0).forEach((function(e){fo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):so(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function fo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function po(t,e,r){return(po="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function yo(t,e){return(yo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mo(t);if(e){var o=mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bo(this,r)}}function bo(t,e){return!e||"object"!==co(e)&&"function"!=typeof e?vo(t):e}function vo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mo(t){return(mo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function go(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jo(t,e,r){return e&&Oo(t.prototype,e),r&&Oo(t,r),t}var wo=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yo(t,e)}(r,t);var e=ho(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return go(this,r),(t=e.call(this,lo({},n))).debug=n.debug,t.mode=n.mode||Rn.TOPOGRAPHIC,t.onMessage=t.onMessage.bind(vo(t)),t.onDeleteMessage=t.onDeleteMessage.bind(vo(t)),t.api=n.api||new En(n),t.tenant=n.tenant||"",t.minZoomNonTrain=n.minZoomNonTrain||9,t.format=new $t.a,t.isUpdateBboxOnMoveEnd=n.isUpdateBboxOnMoveEnd||!0,t}return jo(r,[{key:"start",value:function(){po(mo(r.prototype),"start",this).call(this),this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage),this.setBbox()}},{key:"stop",value:function(){po(mo(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteMessage)}},{key:"setBbox",value:function(t){this.isUpdateBboxOnMoveEnd&&this.api.setBbox(t)}},{key:"setMode",value:function(t){this.mode!==t&&(this.mode=t,this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage))}},{key:"mustNotBeDisplayed",value:function(t,e,r){return!Object(Ke.intersects)(e,t.bounds)||"rail"!==t.type&&r<(this.minZoomNonTrain||9)}},{key:"onFeatureHover",value:function(t,e,n){var o=ao(t,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),po(mo(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=ao(t,1)[0];o?(this.selectedVehicleId=o.get("train_id"),this.highlightTrajectory()):this.selectedVehicleId=null,po(mo(r.prototype),"onFeatureClick",this).call(this,t,e,n)}},{key:"onMessage",value:function(t){if(t.content){var e=this.format.readFeature(t.content);if(e.set("timeOffset",Date.now()-t.timestamp),e.get("time_since_update")>=0){if(this.debug&&this.mode===Rn.TOPOGRAPHIC&&e.get("raw_coordinates")){var r=new io.a(e.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),e.setGeometry(r)}this.mustNotBeDisplayed(e.getProperties())||this.addTrajectory(e.get("train_id"),e.getProperties(),!e.get("line"))}}}},{key:"onDeleteMessage",value:function(t){t.content&&this.removeTrajectoryByAttribute("train_id",t.content)}},{key:"highlightTrajectory",value:function(){var t=[this.api.getStopSequence(this.selectedVehicleId,this.mode),this.api.getFullTrajectory(this.selectedVehicleId,this.mode)];return Promise.all(t).then((function(t){var e=ao(t,2);return{stopSequence:e[0],fullTrajectory:e[1]}}))}},{key:"addTrajectory",value:function(t,e,r){var n=this.trajectories.findIndex((function(e){return e.train_id===t})),o=e.time_intervals,i=lo(lo({},e),{},{id:t,timeIntervals:o});r?(this.trajectories.unshift(i),-1!==n&&this.tracker.trajectories.splice(n+1,1)):(this.trajectories.push(i),-1!==n&&this.tracker.trajectories.splice(n,1)),this.tracker.setTrajectories(this.trajectories)}},{key:"removeTrajectory",value:function(t){for(var e=0,r=this.trajectories.length;e<r;e+=1)if(this.trajectories[e].id===t){this.trajectories.splice(e,1);break}}},{key:"removeTrajectoryByAttribute",value:function(t,e){for(var r=0,n=this.trajectories.length;r<n;r+=1)if(this.trajectories[r][t]===e){this.removeTrajectory(this.trajectories[r].id);break}}}]),r}(t)};function Po(t){return(Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ko(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function So(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ko(Object(r),!0).forEach((function(e){To(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ko(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function To(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Co(t){return function(t){if(Array.isArray(t))return xo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return xo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xo(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ro(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Do(t,e,r){return(Do="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function _o(t,e){return(_o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Mo(t);if(e){var o=Mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ao(this,r)}}function Ao(t,e){return!e||"object"!==Po(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Mo(t){return(Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lo=new $t.a,Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_o(t,e)}(i,t);var e,r,n,o=Io(i);function i(){return Ro(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"mustNotBeDisplayed",value:function(t,e,r){return Do(Mo(i.prototype),"mustNotBeDisplayed",this).call(this,t,e||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(){for(var t=this.map.getView().calculateExtent(),e=Math.floor(this.map.getView().getZoom()),r=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,t,e)){var o=Co(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}Do(Mo(i.prototype),"setBbox",this).call(this,[].concat(Co(t),[e,this.tenant]))}},{key:"onMoveEnd",value:function(t){Do(Mo(i.prototype),"onMoveEnd",this).call(this,t),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.selectedVehicleId&&this.highlightTrajectory()}},{key:"highlightTrajectory",value:function(){var t=this;Do(Mo(i.prototype),"highlightTrajectory",this).call(this).then((function(e){var r=e.stopSequence,n=e.fullTrajectory,o=t.vectorLayer.getSource();o.clear();var i="#ffffff";if(t.useDelayStyle)i="#a0a0a0";else{if(n){var c=n.features[0].properties,a=c.type,u=c.stroke;u&&"#"!==u[0]&&(u="#".concat(u)),i=u||le(a)}i=/#ffffff/i.test(i)?"#ff0000":i}if(r.forEach((function(t){if(t.stations){var e=new _r.MultiPoint(t.stations.map((function(t){return t.coordinate}))),r=new Ze.a(e);r.setStyle(new Ue.Style({zIndex:1,image:new Ue.Circle({radius:5,fill:new Ue.Fill({color:"#000000"})})}));var n=new Ze.a(e);n.setStyle(new Ue.Style({zIndex:4,image:new Ue.Circle({radius:4,fill:new Ue.Fill({color:i})})})),o.addFeatures([r,n])}})),n){var s=[new Ue.Style({zIndex:2,stroke:new Ue.Stroke({color:"#000000",width:6})}),new Ue.Style({zIndex:3,stroke:new Ue.Stroke({color:i,width:4})})],l=Lo.readFeatures(n);l.forEach((function(t){t.setStyle(s)})),t.vectorLayer.getSource().addFeatures(l)}}))}},{key:"clone",value:function(t){return new i(So(So({},this.options),t))}}])&&Eo(e.prototype,r),n&&Eo(e,n),i}(wo(Dr));function Fo(t){return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Uo(Object(r),!0).forEach((function(e){Bo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function No(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ho(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ko(t,e){return(Ko=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Go(t);if(e){var o=Go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Zo(this,r)}}function Zo(t,e){return!e||"object"!==Fo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Go(t){return(Go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ko(t,e)}(i,t);var e,r,n,o=zo(i);function i(){return No(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(t);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(t){return t===e.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:t})}},{key:"clone",value:function(t){return new i(qo(qo({},this.options),t))}}])&&Ho(e.prototype,r),n&&Ho(e,n),i}(I);function $o(t){return($o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jo(Object(r),!0).forEach((function(e){Yo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Yo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ti(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ei(t,e){return(ei=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=oi(t);if(e){var o=oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ni(this,r)}}function ni(t,e){return!e||"object"!==$o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function oi(t){return(oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ei(t,e)}(i,t);var e,r,n,o=ri(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xo(this,i),(t=o.call(this,e)).abortController=new AbortController,t.format=new $t.a,t}return e=i,(r=[{key:"getFeatureInfoUrl",value:function(t){var e=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(t,r,e,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(t),{signal:r}).then((function(t){return t.json()})).then((function(t){return t.features})).then((function(r){return{layer:e,coordinate:t,features:r.map((function(t){return e.format.readFeature(t)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:t,layer:e})}))}},{key:"clone",value:function(t){return new i(Qo(Qo({},this.options),t))}}])&&ti(e.prototype,r),n&&ti(e,n),i}(I);r(15),r(25),r(26),r(17);function ci(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ai(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ui(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ai(Object(r),!0).forEach((function(e){si(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ai(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function si(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function li(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yi(t);if(e){var o=yi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return pi(this,r)}}function pi(t,e){return!e||"object"!==ci(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function yi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function vi(t,e,r){return e&&bi(t.prototype,e),r&&bi(t,r),t}function di(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Oi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pi(t);if(e){var o=Pi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return wi(this,r)}}function wi(t,e){return!e||"object"!==di(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Pi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ki=Z;var ki;function Si(t){return(Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ti(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ci(t,e,r){return(Ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_i(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function xi(t,e){return(xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_i(t);if(e){var o=_i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ei(this,r)}}function Ei(t,e){return!e||"object"!==Si(e)&&"function"!=typeof e?Di(t):e}function Di(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _i(t){return(_i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xi(t,e)}(i,t);var e,r,n,o=Ri(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).render=e.render.bind(Di(e)),e}return e=i,(r=[{key:"activate",value:function(){Ci(_i(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),Ci(_i(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return re(this.map)}}])&&Ti(e.prototype,r),n&&Ti(e,n),i}(vt(Z));function Ai(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Li(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mi(Object(r),!0).forEach((function(e){Vi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Vi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ui(t,e,r){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==Hi(t););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function qi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Bi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Hi(t);if(e){var o=Hi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ni(this,r)}}function Ni(t,e){return!e||"object"!==Ai(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Hi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}it(Kt.Map);var Ki=r(18),zi=r.n(Ki),Zi=r(19);function Gi(t){return(Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wi(t){return function(t){if(Array.isArray(t))return $i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return $i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ji(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ji(Object(r),!0).forEach((function(e){Yi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Yi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ec(t,e,r){return(ec="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ic(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function rc(t,e){return(rc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ic(t);if(e){var o=ic(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return oc(this,r)}}function oc(t,e){return!e||"object"!==Gi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ic(t){return(ic=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cc(t){return function(t){if(Array.isArray(t))return ac(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ac(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ac(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var uc=function(t){var e=t.getBounds().toArray(),r=Object(Ht.fromLonLat)(e[0]),n=Object(Ht.fromLonLat)(e[1]),o=[].concat(cc(r),cc(n)),i=t.getCanvas(),c=i.width,a=i.height,u=Object(Ke.getWidth)(o)/c,s=Object(Ke.getHeight)(o)/a;return Math.max(u,s)},sc=function(t,e){var r=t.getCanvas(),n=r.width,o=r.height,i=t.unproject({x:0,y:0}),c=t.unproject({x:0,y:o/e}),a=t.unproject({x:n/e,y:o/e}),u=t.unproject({x:n/e,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function lc(t){return(lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fc(t){return function(t){if(Array.isArray(t))return pc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return pc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function hc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yc(Object(r),!0).forEach((function(e){bc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mc(t,e,r){return(mc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function gc(t,e){return(gc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Oc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pc(t);if(e){var o=Pc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jc(this,r)}}function jc(t,e){return!e||"object"!==lc(e)&&"function"!=typeof e?wc(t):e}function wc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pc(t){return(Pc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var kc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gc(t,e)}(i,t);var e,r,n,o=Oc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vc(this,i),(t=o.call(this,hc({},e))).onMove=t.onMove.bind(wc(t)),t.onMoveEnd=t.onMoveEnd.bind(wc(t)),t.onZoomEnd=t.onZoomEnd.bind(wc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(wc(t)),t}return e=i,(r=[{key:"init",value:function(t,e){if(t){var r=t.getCanvas();mc(Pc(i.prototype),"init",this).call(this,t,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:sc(t,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=e,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},t.addSource(this.key,n),t.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),mc(Pc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){mc(Pc(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomend",this.onZoomEnd)}},{key:"stop",value:function(){mc(Pc(i.prototype),"stop",this).call(this),this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd),this.map.off("zoomend",this.onZoomEnd))}},{key:"onUserClickCallback",value:function(t){mc(Pc(i.prototype),"onUserClickCallback",this).call(this,hc({coordinate:Object(Ht.fromLonLat)(t.lngLat.toArray())},t))}},{key:"onUserMoveCallback",value:function(t){mc(Pc(i.prototype),"onUserMoveCallback",this).call(this,hc({coordinate:Object(Ht.fromLonLat)(t.lngLat.toArray())},t))}},{key:"renderTrajectories",value:function(t){var e=this.map.getCanvas(),r=e.width,n=e.height,o=this.map.getCenter(),c=this.map.unproject({x:0,y:n/this.pixelRatio}),a=this.map.unproject({x:r/this.pixelRatio,y:0}),u=zi()(Object(Zi.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=zi()(Object(Zi.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(fc(Object(Ht.fromLonLat)(u)),fc(Object(Ht.fromLonLat)(s))),f=Object(Ke.getWidth)(l)/(r/this.pixelRatio),p=Object(Ke.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ht.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};mc(Pc(i.prototype),"renderTrajectories",this).call(this,h,t)}},{key:"getRefreshTimeInMs",value:function(){return mc(Pc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=uc(this.map);return mc(Pc(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=uc(this.map);return mc(Pc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,hc({resolution:r},e))}},{key:"onVisibilityChange",value:function(){this.visible&&!this.map.getLayer(this.key)?this.map.addLayer(this.layer,this.beforeId):this.map.getLayer(this.key)&&this.map.removeLayer(this.key)}},{key:"onMove",value:function(){var t=sc(this.map,this.pixelRatio),e=this.map.getSource(this.key);e&&e.setCoordinates(t),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){}},{key:"onFeatureHover",value:function(t,e,r){mc(Pc(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getCanvasContainer().style.cursor=t.length?"pointer":"auto"}}])&&dc(e.prototype,r),n&&dc(e,n),i}(gr(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rc(t,e)}(i,t);var e,r,n,o=nc(i);function i(){return Xi(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"init",value:function(t){ec(ic(i.prototype),"init",this).call(this,t),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(t){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),ec(ic(i.prototype),"terminate",this).call(this,t)}},{key:"onUserClickCallback",value:function(t){ec(ic(i.prototype),"onUserClickCallback",this).call(this,Qi({coordinate:t.lngLat.toArray()},t))}},{key:"onUserMoveCallback",value:function(t){ec(ic(i.prototype),"onUserMoveCallback",this).call(this,Qi({coordinate:t.lngLat.toArray()},t))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var t=this.map.getBounds().toArray();return Object(Ht.transformExtent)([].concat(Wi(t[0]),Wi(t[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(t){return new i(Qi(Qi({},this.options),t))}}])&&tc(e.prototype,r),n&&tc(e,n),i}(w)));function Sc(t){return(Sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tc(t){return function(t){if(Array.isArray(t))return Cc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Cc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ec(t,e,r){return(Ec="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ac(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Dc(t,e){return(Dc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ac(t);if(e){var o=Ac(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ic(this,r)}}function Ic(t,e){return!e||"object"!==Sc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ac(t){return(Ac=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Mc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Dc(t,e)}(i,t);var e,r,n,o=_c(i);function i(){return xc(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"mustNotBeDisplayed",value:function(t,e,r){return Ec(Ac(i.prototype),"mustNotBeDisplayed",this).call(this,t,e||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(){for(var t=this.getMercatorExtent(),e=Math.floor(this.getOlZoom()),r=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,t,e)){var o=Tc(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}Ec(Ac(i.prototype),"setBbox",this).call(this,[].concat(Tc(t),[e,this.tenant]))}},{key:"onMoveEnd",value:function(t){Ec(Ac(i.prototype),"onMoveEnd",this).call(this,t),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Rc(e.prototype,r),n&&Rc(e,n),i}(wo(kc));function Lc(t){return(Lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vc(t){return function(t){if(Array.isArray(t))return Fc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Fc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Uc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Uc(Object(r),!0).forEach((function(e){Bc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Kc(t,e,r){return(Kc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$c(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function zc(t,e){return(zc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=$c(t);if(e){var o=$c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gc(this,r)}}function Gc(t,e){return!e||"object"!==Lc(e)&&"function"!=typeof e?Wc(t):e}function Wc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $c(t){return($c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Jc={mapbox:{TrajservLayer:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zc(t,e)}(i,t);var e,r,n,o=Zc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Nc(this,i),(t=o.call(this,qc({},e))).onMove=t.onMove.bind(Wc(t)),t.onMoveEnd=t.onMoveEnd.bind(Wc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(Wc(t)),t}return e=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),Kc($c(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(Kc($c(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd))}},{key:"stop",value:function(){this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),Kc($c(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getBounds().toArray(),r=Object(Ht.fromLonLat)(e[0]),n=Object(Ht.fromLonLat)(e[1]),o=[].concat(Vc(r),Vc(n)),c=Object(Ke.buffer)(o,Object(Ke.getWidth)(o)/10).join(","),a=this.map.getZoom();return Kc($c(i.prototype),"getParams",this).call(this,qc(qc({},t),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(t,e,r){console.log("to be implemented")}}])&&Hc(e.prototype,r),n&&Hc(e,n),i}(zn(kc)),TralisLayer:Mc},ol:{Map:Nt,Layer:I,WMSLayer:ii,MapboxLayer:Fe,TrajservLayer:no,TralisLayer:Vo,VectorLayer:Wo}};e.default=Jc}])}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],e):"object"==typeof exports?exports["mobility-toolbox-js"]=e():t["mobility-toolbox-js"]=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e){t.exports=require("ol/style")},function(t,e){t.exports=require("ol/proj")},function(t,e){t.exports=require("ol/extent")},function(t,e){t.exports=require("ol/Observable")},function(t,e){t.exports=require("ol/geom")},function(t,e){t.exports=require("ol/Feature")},function(t,e){t.exports=require("ol/format/GeoJSON")},function(t,e){t.exports=require("query-string")},function(t,e){t.exports=require("ol/layer")},function(t,e){t.exports=require("ol/transform")},function(t,e){t.exports=require("ol/Object")},function(t,e){t.exports=require("ol/layer/Layer")},function(t,e){t.exports=require("mapbox-gl")},function(t,e){t.exports=require("ol/source/Source")},function(t,e){t.exports=require("ol/source")},function(t,e){t.exports=require("ol")},function(t,e){t.exports=require("ol/geom/GeometryType")},function(t,e){t.exports=require("ol/format")},function(t,e){t.exports=require("@turf/transform-rotate")},function(t,e){t.exports=require("@turf/helpers")},function(t,e){t.exports=require("ol/Map")},function(t,e){t.exports=require("ol/control")},function(t,e){t.exports=require("ol/layer/Group")},function(t,e){t.exports=require("uuid")},function(t,e){t.exports=require("ol/geom/Point")},function(t,e){t.exports=require("ol/interaction")},function(t,e){t.exports=require("ol/events/condition")},function(t,e,r){t.exports=r(28)},function(t,e,r){"use strict";r.r(e);var n=r(20),o=r.n(n),i=r(21),c=r(3),a=r.n(c),u=r(22),s=r.n(u),l=r(23);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=j(t);if(e){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?O(t):e}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(i,t);var e,r,n,o=m(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(t=o.call(this)).defineProperties(e);var r=e.onClick,n=e.onHover;return n&&t.onHover(n),r&&t.onClick(r),e.copyrights&&(t.copyrights=e.copyrights),t.onUserClickCallback=t.onUserClickCallback.bind(O(t)),t.onUserMoveCallback=t.onUserMoveCallback.bind(O(t)),t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},t),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,s=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(l.v4)(),v=n||b;Object.defineProperties(this,{options:{value:t},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!s},isClickActive:{value:!!s&&!!f},isHoverActive:{value:!!s&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return e.get("copyrights")},set:function(t){var r=Array.isArray(t)?t:[t];return e.set("copyrights",r)}},visible:{value:void 0===c||c,writable:!0},properties:{value:y({},a||{})},map:{writable:!0},clickCallbacks:{value:[]},hoverCallbacks:{value:[]}})}},{key:"init",value:function(t){this.terminate(),this.map=t}},{key:"terminate",value:function(){}},{key:"get",value:function(t){return this.properties[t]}},{key:"set",value:function(t,e){this.properties[t]=e,this.dispatchEvent({type:"change:".concat(t),target:this})}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(this.visible=t,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:e,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(t){return t.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(t){return!!this.children.find((function(e){return e.visible===t}))}},{key:"addChild",value:function(t){this.children.unshift(t),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(t){for(var e=0;e<this.children.length;e+=1)if(this.children[e].name===t){this.children.splice(e,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:t})}},{key:"onClick",value:function(t){if("function"!=typeof t)throw new Error("onClick callback must be of type function:",t);this.clickCallbacks.includes(t)||this.clickCallbacks.push(t)}},{key:"unClick",value:function(t){if("function"==typeof t){var e=this.clickCallbacks.indexOf(t);e>-1&&this.clickCallbacks.splice(e,1)}}},{key:"onUserClickCallback",value:function(t){var e=this,r={features:[],layer:this,coordinate:t.coordinate,event:t};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){var r=t.features,n=t.layer,o=t.coordinate;return e.clickCallbacks.forEach((function(t){return t(r,n,o)})),t})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(t){if("function"!=typeof t)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(t)||this.hoverCallbacks.push(t)}},{key:"unHover",value:function(t){if("function"==typeof t){var e=this.hoverCallbacks.indexOf(t);e>-1&&this.hoverCallbacks.splice(e,1)}}},{key:"onUserMoveCallback",value:function(t){var e=this,r={features:[],layer:this,coordinate:t.coordinate,event:t};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){var r=t.features,n=t.layer,o=t.coordinate;return e.hoverCallbacks.forEach((function(t){return t(r,n,o)})),t})).catch((function(){return r})):Promise.resolve(r)}}])&&v(e.prototype,r),n&&v(e,n),i}(a.a);function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function x(t,e,r){return(x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function R(t,e){return(R=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function E(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_(t);if(e){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(t,e){return!e||"object"!==P(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&R(t,e)}(i,t);var e,r,n,o=E(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).olLayer&&e.olLayer.setVisible(e.visible),e}return e=i,(r=[{key:"defineProperties",value:function(t){x(_(i.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{olLayer:{value:t.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(t){var e=this;if(x(_(i.prototype),"init",this).call(this,t),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(t){t.element===e.olLayer&&e.terminate()}))),(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.olListenersKeys.push(this.on("change:visible",this.toggleVisibleListeners))),this.copyrights&&this.olLayer)){var r=this.copyrights||[];this.olLayer instanceof s.a?this.olLayer.getLayers().getArray().forEach((function(t){t.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),x(_(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(x(_(i.prototype),"setVisible",this).call(this,t,e,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var t=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(e){var r=t.olListenersKeys.indexOf(e);r>-1&&t.olListenersKeys.splice(r,1),Object(c.unByKey)([t.isHoverListenerKey,t.isClickListenerKey])})),this.visible&&(this.isClickActive&&(this.isClickListenerKey=this.map.on("singleclick",this.onUserClickCallback)),this.isHoverActive&&(this.isHoverListenerKey=this.map.on("pointermove",this.onUserMoveCallback)),this.olListenersKeys.push(this.isClickListenerKey,this.isHoverListenerKey))}},{key:"clone",value:function(t){return new i(S(S({},this.options),t))}}])&&C(e.prototype,r),n&&C(e,n),i}(w),A=r(10),M=r.n(A);function L(t){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach((function(e){U(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function N(t,e){return(N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function H(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=z(t);if(e){var o=z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return K(this,r)}}function K(t,e){return!e||"object"!==L(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&N(t,e)}(i,t);var e,r,n,o=H(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(t=o.call(this,e)).defineProperties(e);var r=F({active:!1!==e.active},e),n=r.active;return t.active=n,t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=F({},t),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return e.get("active")},set:function(t){e.set("active",t),t?e.activate():e.deactivate(),e.render()}},map:{get:function(){return e.get("map")},set:function(t){if(e.map&&e.element&&e.element.parentNode&&e.element.parentNode.removeChild(e.element),e.deactivate(),e.set("map",t),e.map){var r=e.target||e.map.getContainer();e.element||e.createDefaultElement(),e.element&&r.appendChild(e.element),e.active&&e.activate()}e.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&B(e.prototype,r),n&&B(e,n),i}(M.a);function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){J(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e,r){return(Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=et(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Y(t,e){return(Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function X(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=et(t);if(e){var o=et(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tt(this,r)}}function tt(t,e){return!e||"object"!==G(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function et(t){return(et=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ot(t,e,r){return e&&nt(t.prototype,e),r&&nt(t,r),t}var it=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Y(t,e)}(r,t);var e=X(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rt(this,r),(t=e.call(this,$($({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],t.mobilityControls=[],(n.controls||[]).forEach((function(e){t.addControl(e)})),(n.layers||[]).forEach((function(e){t.addLayer(e)})),t}return ot(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(t){this.mobilityControls.push(t),t.map=this}},{key:"removeMobilityControl",value:function(t){t.map=null,this.mobilityControls=this.mobilityControls.filter((function(e){return e!==t}))}},{key:"addControl",value:function(t,e){t instanceof Z?this.addMobilityControl(t):Q(et(r.prototype),"addControl",this).call(this,t,e)}},{key:"removeControl",value:function(t){t instanceof Z?this.removeMobilityControl(t):Q(et(r.prototype),"removeControl",this).call(this,t)}}]),r}(t)},ct=r(11),at=r.n(ct);function ut(t){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function st(t,e){return(st=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=pt(t);if(e){var o=pt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ft(this,r)}}function ft(t,e){return!e||"object"!==ut(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pt(t){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bt(t,e,r){return e&&ht(t.prototype,e),r&&ht(t,r),t}var vt=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&st(t,e)}(r,t);var e=lt(r);function r(){return yt(this,r),e.apply(this,arguments)}return bt(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(t)};function dt(t){return function(t){if(Array.isArray(t))return mt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gt=function(t){var e=t.filter((function(t){return null!=t&&t.trim&&t.trim()})),r=e.map((function(t){return t.toLowerCase()}));return dt(new Set(r)).map((function(t){return e.find((function(e){return e.toLowerCase()===t}))}))};function Ot(t){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wt(t,e,r){return(wt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ct(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Pt(t,e){return(Pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ct(t);if(e){var o=Ct(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return St(this,r)}}function St(t,e){return!e||"object"!==Ot(e)&&"function"!=typeof e?Tt(t):e}function Tt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ct(t){return(Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pt(t,e)}(i,t);var e,r,n,o=kt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).onPostRender=e.onPostRender.bind(Tt(e)),e}return e=i,(r=[{key:"getCopyrights",value:function(){var t=this;if(!this.frameState)return[];var e=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ct.inView)(r,t.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(e=e.concat(n.getSource().getAttributions()(t.frameState)))})),gt(e)}},{key:"activate",value:function(){wt(Ct(i.prototype),"activate",this).call(this),this.map&&this.map.on("postrender",this.onPostRender)}},{key:"deactivate",value:function(){this.map&&this.map.un("postrender",this.onPostRender),wt(Ct(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(t){this.map&&this.element&&(this.frameState=t.frameState,this.render())}}])&&jt(e.prototype,r),n&&jt(e,n),i}(vt(Z));function Rt(t){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Et(t){return function(t){if(Array.isArray(t))return Dt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(r),!0).forEach((function(e){At(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function At(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vt(t,e,r){return(Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ft(t,e){return(Ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bt(t);if(e){var o=Bt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qt(this,r)}}function qt(t,e){return!e||"object"!==Rt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Bt(t){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Nt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ft(t,e)}(c,t);var e,r,n,o=Ut(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Mt(this,c),o.call(this,It({controls:[].concat(Et(Object(i.defaults)({attribution:!1}).getArray()),[new xt])},t))}return e=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(t){t instanceof I?(t.init(this),this.mobilityLayers.push(t),t.olLayer&&Vt(Bt(c.prototype),"addLayer",this).call(this,t.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Vt(Bt(c.prototype),"addLayer",this).call(this,t)}},{key:"removeLayer",value:function(t){t instanceof I?(t.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(e){return e!==t})),t.olLayer&&Vt(Bt(c.prototype),"removeLayer",this).call(this,t)):Vt(Bt(c.prototype),"removeLayer",this).call(this,t)}},{key:"addControl",value:function(t){Vt(Bt(c.prototype),"addControl",this).call(this,t)}},{key:"removeControl",value:function(t){Vt(Bt(c.prototype),"removeControl",this).call(this,t)}}])&&Lt(e.prototype,r),n&&Lt(e,n),c}(it(o.a)),Ht=r(1),Kt=r(12),zt=r.n(Kt),Zt=r(13),Gt=r.n(Zt),Wt=r(6),$t=r.n(Wt),Jt=r(7),Qt=r.n(Jt);function Yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yt(Object(r),!0).forEach((function(e){te(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function te(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ee=function(t,e,r){if(!1===t)return r;var n=Qt.a.parseUrl(r);return!t&&n.query[e]?r:t?Qt.a.stringifyUrl(Xt(Xt({},n),{},{query:Xt(Xt({},n.query),{},te({},e,t))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},re=function(t){if(!t||!t.style)return[];var e=t.style.sourceCaches,r=[];return Object.values(e).forEach((function(t){if(t.used){var e=t.getSource(),n=e.attribution||e.options&&e.options.attribution;n&&(r=r.concat(n.replace(/&copy;/g,"©").split(/(<a.*?<\/a>)/)))}})),gt(r)},ne={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},oe=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],ie=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],ce=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ae=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],ue=function(t){return"string"==typeof t?oe.findIndex((function(e){return e.test(t)})):t},se=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;try{var r=ue(t);return ne[r][e]}catch(t){return 1}},le=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=ue(t);return ie[e]}catch(t){return 1}},fe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=ue(t);return ce[e]}catch(t){return 1}},pe=function(t,e,r,n){t.font="bold ".concat(n,"px Arial");for(var o=t.measureText(r),i=0;o.width>e-6&&i<25;)n-=.5,t.font="bold ".concat(n,"px arial, sans-serif"),o=t.measureText(r),i+=1;return n},ye=function(t,e,r){return e?r?"#ff0000":"#a0a0a0":t>=36e5?"#ed004c":t>=5e5?"#e80000":t>=3e5?"#ff4a00":t>=18e4?"#f7bf00":null===t?"#a0a0a0":"#00a00c"},he=function(t,e){if(e)return String.fromCodePoint(215);if(t>36e5){var r=Math.round(t/36e5);return"+".concat(r,"h")}if(t>59e3){var n=Math.round(t/6e4);return"+".concat(n,"m")}return t>0?"+".concat(t,"s"):""},be=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r},ve={},de={},me={},ge={},Oe={},je=function(t,e,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=e.zoom,s=e.pixelRatio,l=e.operator_provides_realtime_journey,f=t.line,p=t.type,y=t.id,h=t.delay,b=t.cancelled,v=void 0!==b&&b;p||(p="Rail"),f||(f={});var d=f,m=d.name,g=d.text_color,O=d.color;m||(m="I"),g||(g="#000000"),O&&"#"!==O[0]&&(O="#".concat(O)),"#"!==g[0]&&(g="#".concat(g));var j=Math.min(Math.floor(u||1),16),w=n===y,P=o===y,k=se(p,j)*s,S=k>=7*s;(w||P)&&(k=S?k+5*s:14*s);var T=k>10*s,C="".concat(k).concat(p).concat(O).concat(w).concat(P).concat(v).concat(h);if(i&&(C+="".concat(l)),T&&(C+="".concat(m).concat(g)),!Oe[C]){if(0===k)return Oe[C]=null,null;var x,R=1*s,E=k+2,D=2*k,_=2*E+2*R+100*s,I=_/2,A=be(_,_),M=A.getContext("2d");if(S&&null!==h){var L=function(t,e,r){var n="".concat(t,", ").concat(e,", ").concat(r);if(!ve[n]){var o=be(2*t,2*t),i=o.getContext("2d");i.beginPath(),i.arc(t,t,e,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),ve[n]=o}return ve[n]}(I,E,ye(h,v));M.drawImage(L,0,0)}if(S&&(w||h>=a||v)){var V=Math.max(v?19:14,Math.min(v?19:17,1.2*k)),F=function(t,e,r,n,o,i,c){var a="".concat(t,", ").concat(e,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!de[a]){var u=be(t,r+8),s=u.getContext("2d");s.textAlign="left",s.textBaseline="middle",s.font=n,s.fillStyle=o,s.strokeStyle=i,s.lineWidth=1.5*c;var l=e;s.strokeText(l,0,r),s.fillText(l,0,r),de[a]=u}return de[a]}(100,he(h,v),V,"bold ".concat(V,"px arial, sans-serif"),ye(h,v,!0),c,s);M.drawImage(F,I+E+R,I-V)}var U=function(t,e,r,n,o,i){var c="".concat(t,", ").concat(e,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!me[c]){var a=be(2*t,2*t),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(t,t,e,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),me[c]=a}return me[c]}(I,k,x=i?ye(h,v):O||le(p),S||w||P,S&&i&&null===h&&"yes"===l,s);if(M.drawImage(U,0,0),T){var q=Math.max(k,10),B=function(t,e,r,n,o,i,c){var a="".concat(t,", ").concat(e,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!ge[a]){var u=be(2*e,2*e),s=u.getContext("2d");i&&(s.save(),s.textBaseline="middle",s.textAlign="center",s.font="bold ".concat(r+2,"px Arial"),s.strokeStyle=o,s.strokeText(t,e,e),s.restore()),s.textBaseline="middle",s.textAlign="center",s.fillStyle=n,s.font="bold ".concat(r,"px Arial"),s.strokeStyle=o,s.strokeText(t,e,e),s.fillText(t,e,e),ge[a]=u}return ge[a]}(m,I,pe(M,D,m,q),i?"#000000":g||fe(p),x,i&&null===h&&"yes"===l,s);M.drawImage(B,0,0)}Oe[C]=A}return Oe[C]},we=document.createElement("canvas");we.width=15,we.height=15;var Pe=we.getContext("2d");Pe.arc(8,8,5,0,2*Math.PI,!1),Pe.fillStyle="#8ED6FF",Pe.fill(),Pe.lineWidth=3,Pe.strokeStyle="black",Pe.stroke(),Pe.lineWidth=3;function ke(t){return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Te(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Te(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(r),!0).forEach((function(e){Re(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function De(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _e(t,e,r){return(_e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ve(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ie(t,e){return(Ie=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ae(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ve(t);if(e){var o=Ve(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Me(this,r)}}function Me(t,e){return!e||"object"!==ke(e)&&"function"!=typeof e?Le(t):e}function Le(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ve(t){return(Ve=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ie(t,e)}(i,t);var e,r,n,o=Ae(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ee(this,i);var r=new at.a({source:new Gt.a({}),render:function(e){if(!t.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=t.mbMap.getCanvas(),o=e.viewState,i=t.olLayer.getVisible();t.renderState.visible!==i&&(n.style.display=i?"block":"none",t.renderState.visible=i,n.style.position="absolute");var c=t.olLayer.getOpacity();t.renderState.opacity!==c&&(n.style.opacity=c,t.renderState.opacity=c);var a=o.rotation;t.renderState.rotation!==a&&(t.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,t.renderState.rotation=a),t.renderState.zoom===o.zoom&&t.renderState.center[0]===o.center[0]&&t.renderState.center[1]===o.center[1]||(t.mbMap.jumpTo({center:Object(Ht.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,t.renderState.zoom=o.zoom,t.renderState.center=o.center);var u=t.map.getSize();if(t.renderState.size[0]===u[0]&&t.renderState.size[1]===u[1]||(r=!0,t.renderState.size=u),t.mbMap&&t.mbMap.style&&t.mbMap.isStyleLoaded()&&r)try{t.mbMap._frame&&(t.mbMap._frame.cancel(),t.mbMap._frame=null),t.mbMap._render()}catch(t){console.warn(t)}return n}});return(t=o.call(this,xe(xe({},e),{},{olLayer:r}))).styleUrl=e.url,t.apiKey=e.apiKey,t.apiKeyName=e.apiKeyName||"key",t.updateAttribution=t.updateAttribution.bind(Le(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;_e(Ve(i.prototype),"init",this).call(this,t),this.map&&!this.mbMap&&(this.format=new $t.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{e.mbMap&&e.mbMap.resize()}catch(t){console.warn(t)}}))))}},{key:"createStyleUrl",value:function(){return ee(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var t=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){t.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var e=Se(this.map.getView().getCenter(),2),r=e[0],n=e[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new zt.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ht.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(t){console.warn("Failed creating mapbox map: ",t)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){t.loaded=!0,t.copyrights=t.copyrights||re(t.mbMap)||[],t.olLayer.getSource().setAttributions(t.copyrights),t.dispatchEvent({type:"load",target:t})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){t.loadMbMap()})))}},{key:"updateAttribution",value:function(t){var e=this.copyrights||re(t.target)||[];this.copyrights.toString()!==e.toString()&&this.olLayer.getSource().setAttributions(e)}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){var r=this;if(!(e&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:t,features:[],layer:this});var n=t&&this.mbMap.project(Object(Ht.toLonLat)(t));if(this.hitTolerance){var o=n,i=o.x,c=o.y;n=[{x:i-this.hitTolerance,y:c-this.hitTolerance},{x:i+this.hitTolerance,y:c+this.hitTolerance}]}var a=this.mbMap.queryRenderedFeatures(n,e).map((function(t){var e=r.format.readFeature(t);return e&&e.set("mapboxFeature",t),e}));return Promise.resolve({layer:this,features:a,coordinate:t})}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,_e(Ve(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(t){return new i(xe(xe({},this.options),t))}}])&&De(e.prototype,r),n&&De(e,n),i}(I);var Ue=r(0),qe=r(14),Be=r(8);var Ne=new Ue.Circle({radius:6,fill:new Ue.Fill({color:[255,0,0,1]}),stroke:new Ue.Stroke({color:[0,0,0,1],width:1})}),He=(new Ue.Style({stroke:new Ue.Stroke({color:[0,0,0,1],width:5})}),new Ue.Style({image:Ne,stroke:new Ue.Stroke({color:[255,0,0,1],width:3})}),new Ue.Style({image:Ne,stroke:new Ue.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(9)),Ke=r(2),ze=r(5),Ze=r.n(ze),Ge=r(16),We=r.n(Ge);function $e(t){return function(t){if(Array.isArray(t))return Ye(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Qe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Je(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||Qe(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(t,e){if(t){if("string"==typeof t)return Ye(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ye(t,e):void 0}}function Ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Xe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var rr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xe(Object(r),!0).forEach((function(e){tr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({interpolate:!0},e);this.pixelRatio=e.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var e,r,n;return e=t,(r=[{key:"setVisible",value:function(t){this.canvas&&(this.canvas.style.visibility=t?"visible":"hidden")}},{key:"setTrajectories",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&t.sort(this.sort),this.trajectories=t}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.time,n=void 0===r?Date.now():r,o=t.size,i=void 0===o?[]:o,c=t.center,a=t.resolution,u=t.rotation,s=void 0===u?0:u,l=t.pixelRatio;this.clear();var f=Je(i,2),p=f[0],y=f[1];if(p&&y&&(this.canvas.width!==p||this.canvas.height!==y)){var h=[p*l,y*l];this.canvas.width=h[0],this.canvas.height=h[1]}var b,v,d,m,g,O,j,w,P=Object(He.compose)(Object(He.create)(),i[0]/2,i[1]/2,1/a,-1/a,-s,-c[0],-c[1]);this.canvas.style.width="".concat(this.canvas.width/l,"px"),this.canvas.style.height="".concat(this.canvas.height/l,"px"),this.currResolution=a||this.currResolution,this.renderedTrajectories=[];for(var k=(this.trajectories||[]).length-1;k>=0;k-=1){var S=this.trajectories[k],T=S.geometry,C=S.timeIntervals,x=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var R=null,E=void 0;if(!S.coordinate||!e&&this.interpolate){if(C&&C.length>1){for(var D=n-(x||0),_=void 0,I=void 0,A=void 0,M=void 0,L=void 0,V=0;V<C.length-1;V+=1){var F=Je(C[V],3);_=F[0],A=F[1],E=F[2];var U=Je(C[V+1],2);if(I=U[0],M=U[1],_<=D&&D<=I)break;_=null,I=null}if(T.getType()===We.a.POINT)R=T.getCoordinates();else if(T.getType()===We.a.LINE_STRING){if(_&&I){L=this.interpolate?Math.min((D-_)/(I-_),1):0;var q=this.interpolate?L*(M-A)+A:0;R=T.getCoordinateAt(q),this.trajectories[k].rotation=E,this.trajectories[k].endFraction=L}else if(D<C[0][0]){var B=Je(C,1),N=Je(B[0],3);E=N[2],L=0,R=T.getFirstCoordinate()}else if(D>C[C.length-1][0]){var H=Je(C[C.length-1],3);E=H[2],L=1,R=T.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",T);this.trajectories[k].rotation=E,this.trajectories[k].endFraction=L||0}}else R=S.coordinate;if(R){this.trajectories[k].coordinate=R;var K=Object(He.apply)(P,$e(R));if(!K)continue;K=K.map((function(t){return t*l})),this.trajectories[k].rendered=!0,this.renderedTrajectories.push(this.trajectories[k]);var z=this.style(S,t);if(!z)continue;var Z=z.width,G=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,K[0]-Z/2,K[1]-G/2,Z,G),this.hoverVehicleId===S.id&&(b=z,v=K,d=Z,m=G),this.selectedVehicleId===S.id&&(g=z,O=K,j=Z,w=G)}}}g&&this.canvasContext.drawImage(g,O[0]-j/2,O[1]-w/2,j,w),b&&this.canvasContext.drawImage(b,v[0]-d/2,v[1]-m/2,d,m)}},{key:"destroy",value:function(){this.renderedTrajectories=[],this.clear()}}])&&er(e.prototype,r),n&&er(e,n),t}(),nr=function(t,e,r,n){var o=[];if(!(t||e||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(t){var e=t.name||t.line&&t.line.name||"";return!!e&&i.some((function(t){return new RegExp(t,"i").test(e)}))}))}if(t){var c=("string"==typeof t?t.split(","):t).map((function(t){return t.replace(/\s+/g,"").toUpperCase()}));o.push((function(t){var e=(t.name||t.line&&t.line.name||"").toUpperCase();return!!e&&c.includes(e)}))}if(e){var a=("string"==typeof e?e.split(","):e).map((function(t){return parseInt(t,10)}));o.push((function(t){var e=parseInt(t.routeIdentifier.split(".")[0],10);return a.includes(e)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(t){return u.some((function(e){return new RegExp(e,"i").test(t.operator)}))}))}return o.length?function(t){for(var e=0;e<o.length;e+=1)if(!o[e](t))return!1;return!0}:null};function or(t){return(or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ir(t){return function(t){if(Array.isArray(t))return cr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return cr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ar(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ur(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ar(Object(r),!0).forEach((function(e){sr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ar(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function sr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lr(t,e,r){return(lr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=br(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function fr(t,e){return(fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=br(t);if(e){var o=br(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yr(this,r)}}function yr(t,e){return!e||"object"!==or(e)&&"function"!=typeof e?hr(t):e}function hr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function br(t){return(br=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mr(t,e,r){return e&&dr(t.prototype,e),r&&dr(t,r),t}var gr=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fr(t,e)}(r,t);var e=pr(r);function r(t){var n;return vr(this,r),(n=e.call(this,ur({hitTolerance:10},t))).onFeatureHover=n.onFeatureHover.bind(hr(n)),n.onFeatureClick=n.onFeatureClick.bind(hr(n)),n}return mr(r,[{key:"defineProperties",value:function(t){var e=this,n=ur({},t),o=n.style,i=n.speed,c=t.pixelRatio,a=t.interpolate,u=t.hoverVehicleId,s=t.selectedVehicleId,l=t.filter,f=t.sort,p=t.time,y=t.live,h=t.regexPublishedLineName,b=t.publishedLineName,v=t.tripNumber,d=t.operator,m={pixelRatio:c||window.devicePixelRatio||1,interpolate:a,hoverVehicleId:u,selectedVehicleId:s,filter:l,sort:f,style:o};Object.keys(m).forEach((function(t){return void 0===m[t]&&delete m[t]}));var g=i||1,O=p||new Date;lr(br(r.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:o||this.defaultStyle},speed:{get:function(){return g},set:function(t){g=t,e.start()}},filter:{get:function(){return e.tracker?e.tracker.filter:e.initTrackerOptions.filter},set:function(t){e.tracker?e.tracker.filter=t:e.initTrackerOptions.filter=t}},sort:{get:function(){return e.tracker?e.tracker.sort:e.initTrackerOptions.sort},set:function(t){e.tracker?e.tracker.sort=t:e.initTrackerOptions.sort=t}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==y||y,writable:!0},time:{get:function(){return O},set:function(t){O=t&&t.getTime?t:new Date(t),e.renderTrajectories()}},trajectories:{get:function(){return e.tracker&&e.tracker.trajectories||[]}},renderedTrajectories:{get:function(){return e.tracker&&e.tracker.renderedTrajectories||[]}},hoverVehicleId:{get:function(){return e.tracker?e.tracker.hoverVehicleId:e.initTrackerOptions.hoverVehicleId},set:function(t){e.tracker?e.tracker.hoverVehicleId=t:e.initTrackerOptions.hoverVehicleId=t}},selectedVehicleId:{get:function(){return e.tracker?e.tracker.selectedVehicleId:e.initTrackerOptions.selectedVehicleId},set:function(t){e.tracker?e.tracker.selectedVehicleId=t:e.initTrackerOptions.selectedVehicleId=t}},pixelRatio:{get:function(){return e.tracker?e.tracker.pixelRatio:e.initTrackerOptions.pixelRatio},set:function(t){e.tracker?e.tracker.pixelRatio=t:e.initTrackerOptions.pixelRatio=t}},initTrackerOptions:{value:m,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0},publishedLineName:{get:function(){return b},set:function(t){b=t,e.updateFilters()}},tripNumber:{get:function(){return v},set:function(t){v=t,e.updateFilters()}},operator:{get:function(){return d},set:function(t){d=t,e.updateFilters()}},regexPublishedLineName:{get:function(){return h},set:function(t){h=t,e.updateFilters()}},delayDisplay:{value:t.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:t.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:t.useDelayStyle||!1,writable:!0}})}},{key:"init",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lr(br(r.prototype),"init",this).call(this,t),this.tracker=new rr(ur(ur({style:function(t,r){return e.style(t,r)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(t){t.target.visible?e.start():e.stop()}))}},{key:"terminate",value:function(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),lr(br(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.updateFilters(),this.tracker.setVisible(!0),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var t=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){t.time=t.live?new Date:t.time.getTime()+t.updateTimeDelay*t.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(t,e){if(!this.tracker)return!1;var r=this.live?Date.now():this.time;return this.tracker.renderTrajectories(ur(ur({},t),{},{time:r}),e),!0}},{key:"renderTrajectories",value:function(t,e){var r=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(t,e)})):this.renderTrajectoriesInternal(t,e)}},{key:"getVehicle",value:function(t){return this.tracker.getTrajectories().filter(t)}},{key:"getVehiclesAtCoordinate",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(Ke.buffer)([].concat(ir(t),ir(t)),this.hitTolerance*e),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Ke.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.resolution,n=e.nb,o=this.getVehiclesAtCoordinate(t,r,n);return Promise.resolve({layer:this,features:o.map((function(t){var e=new Ze.a({geometry:t.geometry});return e.setProperties(ur({},t)),e})),coordinate:t})}},{key:"onZoomEnd",value:function(t){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(t){var e=Math.round(t),r=ae[e]||25;return Math.max(25,r/this.speed)}},{key:"updateFilters",value:function(){var t=Qt.a.parse(window.location.search.toLowerCase());this.filter=nr(this.publishedLineName||t.publishedlinename,this.tripNumber||t.tripnumber,this.operator||t.operator,this.regexPublishedLineName)}},{key:"defaultStyle",value:function(t,e){return je(t,e,this)}}]),r}(t)};function Or(t){return(Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function wr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?jr(Object(r),!0).forEach((function(e){Pr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Tr(t,e,r){return(Tr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Er(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Cr(t,e){return(Cr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Er(t);if(e){var o=Er(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rr(this,r)}}function Rr(t,e){return!e||"object"!==Or(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Er(t){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Dr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Cr(t,e)}(i,t);var e,r,n,o=xr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return kr(this,i),(t=o.call(this,wr({},e))).renderWhenInteracting=e.renderWhenInteracting||function(){return t.tracker&&t.tracker.renderedTrajectories&&t.tracker.renderedTrajectories.length<=200},t.olLayer=e.olLayer||new Be.Group({layers:[new Be.Vector({source:new qe.Vector({features:[]})}),new Be.Layer({source:new Gt.a({}),render:function(e){if(!t.tracker||!t.tracker.canvas)return null;if(t.container||(t.container=document.createElement("div"),t.container.style.position="absolute",t.container.style.width="100%",t.container.style.height="100%",t.transformContainer=document.createElement("div"),t.transformContainer.style.position="absolute",t.transformContainer.style.width="100%",t.transformContainer.style.height="100%",t.container.appendChild(t.transformContainer),t.tracker.canvas.style.position="absolute",t.tracker.canvas.style.top="0",t.tracker.canvas.style.left="0",t.tracker.canvas.style.transformOrigin="top left",t.transformContainer.appendChild(t.tracker.canvas)),t.renderedViewState){var r=e.viewState,n=r.center,o=r.resolution,i=r.rotation,c=t.renderedViewState,a=c.center,u=c.resolution,s=c.rotation;if(t.renderWhenInteracting&&t.renderWhenInteracting(e.viewState,t.renderedViewState))t.renderTrajectories(!0);else if(u/o>=3)t.tracker.clear();else{var l=t.map.getPixelFromCoordinate(a),f=t.map.getPixelFromCoordinate(n);t.transformContainer.style.transform=Object(He.composeCssTransform)(l[0]-f[0],l[1]-f[1],u/o,u/o,i-s,0,0)}}return t.container}})]}),t.vectorLayer=t.olLayer.getLayers().item(0),t.renderState={center:[0,0],zoom:null,rotation:0},t}return e=i,(r=[{key:"init",value:function(t){var e=this;Tr(Er(i.prototype),"init",this).call(this,t),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(t){var r=e.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();e.currentZoom!==n&&e.onZoomEnd(t),e.currentZoom=n,e.onMoveEnd(t)}})))}},{key:"terminate",value:function(){Tr(Er(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(t){if(this.map&&this.tracker&&this.tracker.canvas){var e=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(t);return!!e.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(t){var e=this.map.getView();Tr(Er(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:e.calculateExtent(),resolution:e.getResolution(),rotation:e.getRotation(),zoom:e.getZoom(),pixelRatio:this.pixelRatio},t)}},{key:"renderTrajectoriesInternal",value:function(t,e){(this.renderWhenInteracting(t,this.renderedViewState)||!this.map.getView().getAnimating()&&!this.map.getView().getInteracting())&&Tr(Er(i.prototype),"renderTrajectoriesInternal",this).call(this,t,e)&&(this.renderedViewState=wr({},t),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Tr(Er(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=this.map.getView().getResolution();return Tr(Er(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(t))return Promise.resolve({features:[],layer:this,coordinate:t});var r=this.map.getView().getResolution();return Tr(Er(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,wr({resolution:r},e))}},{key:"onMoveEnd",value:function(t){}},{key:"onZoomEnd",value:function(t){Tr(Er(i.prototype),"onZoomEnd",this).call(this,t)}},{key:"onFeatureHover",value:function(t,e,r){Tr(Er(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getTargetElement().style.cursor=t.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(t,e,r){Tr(Er(i.prototype),"onFeatureClick",this).call(this,t,e,r),!t.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(t){return new i(wr(wr({},this.options),t))}}])&&Sr(e.prototype,r),n&&Sr(e,n),i}(gr(I)),_r=r(4),Ir=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=(t.getUTCMonth()+1).toString();e=1===e.length?"0".concat(e):e;var r=t.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[t.getUTCFullYear(),e,r].join("")},Ar=function(t){return[t.getUTCHours(),t.getUTCMinutes(),"".concat(t.getUTCSeconds(),".").concat(t.getUTCMilliseconds())].join(":")};function Mr(t){return(Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lr(Object(r),!0).forEach((function(e){Fr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Fr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Br(t,e){return(Br=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Kr(t);if(e){var o=Kr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hr(this,r)}}function Hr(t,e){return!e||"object"!==Mr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Kr(t){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Br(t,e)}(i,t);var e,r,n,o=Nr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ur(this,i),(t=o.call(this)).url=e.url,t.apiKey=e.apiKey,t}return e=i,(r=[{key:"fetch",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=Vr(Vr({},e),{},{key:this.apiKey}),o=Vr({},n);return Object.keys(n).forEach((function(t){return(void 0===o[t]||null===o[t])&&delete o[t]})),this.apiKey?fetch("".concat(this.url).concat(t,"?").concat(Qt.a.stringify(o)),r).then((function(t){try{return t.json().then((function(t){if(t.error)throw new Error(t.error);return t}))}catch(t){return Promise.reject(new Error(t))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&qr(e.prototype,r),n&&qr(e,n),i}(M.a);function Zr(t){return(Zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gr(Object(r),!0).forEach((function(e){$r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yr(t,e){return(Yr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=en(t);if(e){var o=en(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tn(this,r)}}function tn(t,e){return!e||"object"!==Zr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function en(t){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yr(t,e)}(i,t);var e,r,n,o=Xr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Jr(this,i),o.call(this,Wr({url:"https://api.geops.io/stops/v1/"},t))}return e=i,(r=[{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",t,{signal:e.signal}).then((function(t){return t.features}))}}])&&Qr(e.prototype,r),n&&Qr(e,n),i}(zr);function nn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function on(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var cn=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=n.d,i=n.m,c=n.y;e.push({day:o,month:i,year:c})}return e},an=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nn(Object(r),!0).forEach((function(e){on(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);["a","f","tt"].forEach((function(t){e[t]||(e[t]={})}));for(var r=e.id,n=e.hs,o=e.t,i=e.ln,c=e.sn,a=e.wa,u=e.ba,s=e.rt,l=e.fid,f=e.rid,p=e.c,y=e.tc,h=e.a,b=h.n,v=h.u,d=h.tz,m=e.f,g=m.n,O=m.u,j=m.tz,w=e.tt,P=w.n,k=w.p,S=w.t,T=e.sts,C=cn(P),x=cn(k),R=p&&"#".concat(p),E=y&&"#".concat(y),D=[],_=0;_<(T||[]).length;_+=1){var I=T[_],A=I.sid,M=I.n,L=I.p,V=I.at,F=I.dt,U=I.ap,q=I.dp,B=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;D.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==V?1e3*U:null,departureTime:-1!==F?1e3*q:null,arrivalDelay:B,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:R,color:E,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:D,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:x},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},un=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=new _r.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=i.DirectionText,f=i.Operator,p=i.OperatorURL,y=i.Publisher,h=i.PublisherURL,b=i.License,v=i.LicenseUrl,d=i.LicenseNote,m=i.Color,g=i.JourneyIdentifier,O=i.RealtimeAvailable,j=i.OperatorProvidesRealtime,w=i.DayOfOperation,P=i.Delay,k=i.TimeIntervals,S=i.TextColor,T=i.Cancelled;e.push({id:c,type:a,name:u,routeIdentifier:s,directionText:l,operator:f,operatorUrl:p,publisher:y,publisherUrl:h,license:b,licenseUrl:v,licenseNote:d,journeyIdentifier:g,realtimeAvailable:O,operatorProvidesRealtime:j,dayOfOperation:w,delay:P,timeIntervals:k,color:m&&"#".concat(m),textColor:S&&"#".concat(S),geometry:o,cancelled:T})}return e};function sn(t){return(sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ln(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function fn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ln(Object(r),!0).forEach((function(e){pn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bn(t,e){return(bn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mn(t);if(e){var o=mn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dn(this,r)}}function dn(t,e){return!e||"object"!==sn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mn(t){return(mn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bn(t,e)}(i,t);var e,r,n,o=vn(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yn(this,i),o.call(this,fn({url:"https://api.geops.io/tracker/v1"},t))}return e=i,(r=[{key:"fetchTrajectoryById",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",t,{signal:e.signal})}},{key:"fetchTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",t,{signal:e.signal}).then((function(t){return un(t.features)}))}},{key:"fetchTrajectoryStations",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",t,{signal:e.signal}).then((function(t){return an(t)}))}}])&&hn(e.prototype,r),n&&hn(e,n),i}(zr);function On(t){return function(t){if(Array.isArray(t))return jn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return jn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jn(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Pn=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subscriptions=[],this.subscribed={},this.connect(e),setInterval((function(){r.send("PING")}),1e4)}var e,r,n;return e=t,n=[{key:"getRequestString",value:function(t,e){var r="".concat(t," ").concat(e.channel);return r+=e.args?" ".concat(e.args):"",(r+=e.id?" ".concat(e.id):"").trim()}}],(r=[{key:"connect",value:function(t){var e=this;this.websocket&&this.websocket.readyState!==this.websocket.CLOSED&&this.websocket.close(),this.websocket=new WebSocket(t),On(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)})),this.websocket.onclose=function(){window.clearTimeout(e.reconnectTimeout),e.reconnectTimeout=window.setTimeout((function(){return e.connect(t)}),100)}}},{key:"get",value:function(e,r,n){var o=t.getRequestString("GET",e);this.send(o),this.listen(e,r,n)}},{key:"send",value:function(t){var e=this,r=function(){e.websocket.send(t)};this.websocket.readyState===WebSocket.CONNECTING?this.websocket.addEventListener("open",r):r()}},{key:"listen",value:function(t,e,r){this.unlisten(t,e);var n=function(r){var n=JSON.parse(r.data),o=t.channel;o+=t.args?" ".concat(t.args):"",n.source!==o||t.id&&t.id!==n.client_reference||e(n)};return this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r)),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t.channel&&(!e||r.cb===e)})).forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))}))}},{key:"subscribe",value:function(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(e,r,n),c=i.onMessageCb,a=i.onErrorCb,u=t.getRequestString("",e),s=this.subscriptions.findIndex((function(t){return e.channel===t.params.channel&&r===t.cb})),l={params:e,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,quiet:o};s>-1?this.subscriptions[s]=l:this.subscriptions.push(l),this.subscribed[u]||(l.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(t,e){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===t&&(!e||r.cb===e)}));n.forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==t||e&&r.cb!==e})),t&&this.subscribed[t]&&!this.subscriptions.find((function(e){return e.params.channel===t}))&&n.find((function(t){return!t.quiet}))&&(this.send("DEL ".concat(t)),this.subscribed[t]=!1)}}])&&wn(e.prototype,r),n&&wn(e,n),t}(),kn=function(t,e){return t===e.SCHEMATIC?"_schematic":""},Sn=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=t.has_fzo&&n.indexOf(t.state)>-1,i=e.has_fzo&&n.indexOf(e.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(t.state!==e.state)return n.indexOf(t.state)-n.indexOf(e.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(t.min_arrival_time||t.time).getTime()-u,a=new Date(e.min_arrival_time||e.time).getTime()-u):(c=new Date(t.time).getTime()-u,a=new Date(e.time).getTime()-u),c-a},Tn=function(t){if(t)return t.stations.forEach((function(t){t.arrivalTimeWithDelay=t.arrivalTime,t.departureTime&&(t.departureTimeWithDelay=t.departureTime),t.arrivalDelay&&(t.arrivalTime-=t.arrivalDelay,t.departureTime&&(t.departureTime-=t.arrivalDelay))})),t};function Cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Rn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},En=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Cn(this,t);var r=null;r="string"==typeof e?e:e.url,e.apiKey&&(r="".concat(r,"?key=").concat(e.apiKey)),this.bbox=e.bbox,this.projection=e.projection||"EPSG:3857",this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=e.prefix||"",this.isUpdateBboxOnMoveEnd=e.isUpdateBboxOnMoveEnd||!1,this.conn=new Pn(r),e.projection&&this.setProjection(e.projection)}var e,r,n;return e=t,(r=[{key:"setProjection",value:function(t){this.conn.send("PROJECTION ".concat(t))}},{key:"setBbox",value:function(t){this.bbox=t,this.conn.send("BBOX ".concat(t.join(" ")))}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"subscribe",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:t},e,r,n)}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;this.conn.unsubscribe("".concat(t).concat(kn(Rn.SCHEMATIC,Rn)).concat(e),r),this.conn.unsubscribe("".concat(t).concat(kn(Rn.TOPOGRAPHIC,Rn)).concat(e),r)}},{key:"filterDepartures",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(t).map((function(e){return t[e]}));r.sort((function(t,r){return Sn(t,r,e)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],c=[],a=null,u=r.length-1;u>=0;u-=1){var s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=t;var o=t?"timetable_".concat(t):null,i={};this.subscribe(o,(function(t){if(t.source===o){var c=t.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(e.departureUpdateTimeout),e.departureUpdateTimeout=window.setTimeout((function(){var t=e.filterDepartures(i,r);n(t)}),100)}}),(function(){n([])}))}},{key:"unsubscribeDepartures",value:function(t){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",t),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(t){this.subscribe("".concat(this.prefix,"newsticker"),(function(e){t(e.content)}))}},{key:"unsubscribeDisruptions",value:function(t){this.unsubscribe("".concat(this.prefix,"newsticker"),"",t)}},{key:"getStation",value:function(t,e){var r=this,n={channel:"station".concat(kn(e,Rn)),args:t};return new Promise((function(t,e){r.conn.get(n,(function(r){r.content?t(r.content):e()}))}))}},{key:"getStations",value:function(t,e){var r=this,n=[];e&&this.conn.setBbox(e);var o={channel:"station".concat(kn(t,Rn))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(t,e){r.conn.get(o,(function(o){o.content?(n.push(o.content),window.clearTimeout(r.stationUpdateTimeout),r.stationUpdateTimeout=window.setTimeout((function(){t(n)}),50)):e(o.content)}))}))}},{key:"subscribeStations",value:function(t,e,r){this.unsubscribeStations(),e&&this.conn.setBbox(e),this.subscribe("station".concat(kn(t,Rn)),(function(t){t.content&&r(t.content)}))}},{key:"unsubscribeStations",value:function(t){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",t)}},{key:"subscribeExtraGeoms",value:function(t){var e=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?e.extraGeoms[o]=n:delete e.extraGeoms[o],t(Object.keys(e.extraGeoms).map((function(t){return e.extraGeoms[t]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(t){this.unsubscribe("extra_geoms","",t)}},{key:"subscribeTrajectory",value:function(t,e){this.unsubscribeTrajectory(e),this.subscribe("trajectory".concat(kn(t,Rn)),e,null,this.isUpdateBboxOnMoveEnd)}},{key:"unsubscribeTrajectory",value:function(t){this.unsubscribe("trajectory","",t)}},{key:"subscribeDeletedVehicles",value:function(t,e){this.unsubscribeDeletedVehicles(e),this.subscribe("deleted_vehicles".concat(kn(t,Rn)),e,null,this.isUpdateBboxOnMoveEnd)}},{key:"unsubscribeDeletedVehicles",value:function(t){this.unsubscribe("deleted_vehicles","",t)}},{key:"getFullTrajectory",value:function(t,e){var r=this,n={channel:"full_trajectory".concat(kn(e,Rn),"_").concat(t)};return new Promise((function(t){r.conn.get(n,(function(e){e.content&&t(e.content)}))}))}},{key:"getFullTrajectories",value:function(t,e){var r=this,n=t.map((function(t){return r.getFullTrajectory(t,e)}));return Promise.all(n)}},{key:"subscribeFullTrajectory",value:function(t,e){this.unsubscribeFullTrajectory(t),this.subscribe("full_trajectory".concat(kn(e,Rn),"_").concat(t),(function(t){console.log("subscribe full_trajectory",t)}),(function(t){console.log("subscribe full_trajectory error",t)}))}},{key:"unsubscribeFullTrajectory",value:function(t,e){this.unsubscribe("full_trajectory","_".concat(t),e)}},{key:"getStopSequence",value:function(t){var e=this,r={channel:"stopsequence_".concat(t)};return new Promise((function(t,n){e.conn.get(r,(function(e){if(e.content&&e.content.length){var r=e.content.map((function(t){return Tn(t)}));t(r)}t([])}),(function(t){n(t)}))}))}},{key:"getStopSequences",value:function(t){var e=this,r=t.map((function(t){return e.getStopSequence(t)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(t,e){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(t),this.subscribe("stopsequence_".concat(t),(function(t){if(t.content&&t.content.length){var r=t.content.map((function(t){return Tn(t)}));e(r)}}),(function(t){console.log("subscribe stopsequence error",t)}))}},{key:"unsubscribeStopSequence",value:function(t,e){this.unsubscribe("stopsequence","_".concat(t),e)}},{key:"subscribeHealthCheck",value:function(t){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",t)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&xn(e.prototype,r),n&&xn(e,n),t}();function Dn(t){return(Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function In(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(r),!0).forEach((function(e){An(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function An(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ln(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ln(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vn(t,e,r){return(Vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bn(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Fn(t,e){return(Fn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Un(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bn(t);if(e){var o=Bn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qn(this,r)}}function qn(t,e){return!e||"object"!==Dn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Bn(t){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Kn(t,e,r){return e&&Hn(t.prototype,e),r&&Hn(t,r),t}var zn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fn(t,e)}(r,t);var e=Un(r);function r(){return Nn(this,r),e.apply(this,arguments)}return Kn(r,[{key:"defineProperties",value:function(t){var e=this;Vn(Bn(r.prototype),"defineProperties",this).call(this,t);var n,o=3;if(!t.api){var i={};t.url&&(i.url=t.url),t.apiKey&&(i.apiKey=t.apiKey),n=new gn(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(t){t!==o&&(o=t,e.visible&&e.start())}},api:{value:t.api||n}})}},{key:"init",value:function(t){Vn(Bn(r.prototype),"init",this).call(this,t),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(t,e){return null===t.delay||t.delay<e.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),Vn(Bn(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Vn(Bn(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(t,e,n){var o=Mn(t,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Vn(Bn(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=Mn(t,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Vn(Bn(r.prototype),"onFeatureClick",this).call(this,t,e,n)}},{key:"highlightTrajectory",value:function(){var t=this,e=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:e,time:Ar(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:Ar(new Date)}))];Promise.all(n).then((function(e){var r=Mn(e,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(t){i.push(t.coordinates)})),o){var c=o.p,a=o.t,u=o.c,s=[];c.forEach((function(t){t.forEach((function(t){s.push([t.x,t.y])}))}));var l=u?"#".concat(u):le(a),f=/#ffffff/i.test(l)?"#ff0000":l;t.drawFullTrajectory(i,s,t.useDelayStyle?"#a0a0a0":f)}})).catch((function(){t.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=1e3*(this.requestIntervalSeconds+5),r=this.speed*e,n=this.time,o=!0;if(this.later&&n.getTime()>this.later.getTime()-1e3*this.requestIntervalSeconds&&(o=!1),!this.later||!o||this.later.getTime()-n.getTime()>r){var i=new Date(n.getTime()+r);this.later=i}var c=In(In({},t),{},{btime:Ar(n),etime:Ar(this.later),date:Ir(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var t=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){t.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var t=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(t){if("AbortError"!==t.name)throw t})).then((function(e){e&&(t.tracker.setTrajectories(e),t.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(t,e,r){}},{key:"defaultStyle",value:function(t,e){var r=e.zoom,n=t.type,o=t.name,i=t.id,c=t.color,a=t.textColor,u=t.delay,s=t.cancelled,l=t.operatorProvidesRealtime,f=Math.min(Math.floor(r||1),16),p=this.hoverVehicleId===i,y=this.selectedVehicleId===i,h="".concat(f).concat(n).concat(o).concat(l).concat(u).concat(p).concat(y).concat(s),b=se(n,f)*this.pixelRatio,v=b>=7*this.pixelRatio;(p||y)&&(b=v?b+5*this.pixelRatio:14*this.pixelRatio);var d=b>10*this.pixelRatio;if(d||(h="".concat(f).concat(n).concat(c).concat(l).concat(u).concat(p).concat(y).concat(s)),!this.styleCache[h]){if(0===b)return this.styleCache[h]=null,null;var m=1*this.pixelRatio,g=b+2,O=2*b,j=document.createElement("canvas");j.width=2*g+2*m+100*this.pixelRatio,j.height=2*g+2*m+100*this.pixelRatio;var w,P=j.getContext("2d"),k=j.width/2;if(v&&null!==u&&(P.save(),P.beginPath(),P.arc(k,k,g,0,2*Math.PI,!1),P.fillStyle=ye(u,s),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||s)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(s?19:14,Math.min(s?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=ye(u,s,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=he(u,s);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?ye(u,s):c||le(n),P.save(),(v||p||y)&&(P.lineWidth=1*this.pixelRatio,P.strokeStyle="#000000"),P.fillStyle=w,P.beginPath(),P.arc(k,k,b,0,2*Math.PI,!1),P.fill(),v&&this.useDelayStyle&&null===u&&"yes"===l&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=pe(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===l&&(P.save(),P.textBaseline="middle",P.textAlign="center",P.font="bold ".concat(C+2,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.restore()),P.save(),P.textBaseline="middle",P.textAlign="center",P.fillStyle=this.useDelayStyle?"#000000":a||fe(n),P.font="bold ".concat(C,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.fillText(o,k,k),P.restore()}this.styleCache[h]=j}return this.styleCache[h]}}]),r}(t)};function Zn(t){return(Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gn(Object(r),!0).forEach((function(e){$n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yn(t,e,r){return(Yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ro(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Xn(t,e){return(Xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function to(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ro(t);if(e){var o=ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return eo(this,r)}}function eo(t,e){return!e||"object"!==Zn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ro(t){return(ro=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var no=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xn(t,e)}(i,t);var e,r,n,o=to(i);function i(){return Jn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"start",value:function(){var t=this;this.map&&(Yn(ro(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){t.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),Yn(ro(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var t=this.map.getView().getZoom();t!==this.currentZoom&&(this.currentZoom=t,this.requestIntervalSeconds=200/t||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(t,e,r){var n=this.vectorLayer.getSource();if(n.clear(),t){var o=new _r.MultiPoint(t.map((function(t){return Object(Ht.fromLonLat)(t)}))),i=new Ze.a(o);i.setStyle(new Ue.Style({zIndex:1,image:new Ue.Circle({radius:5,fill:new Ue.Fill({color:"#000000"})})}));var c=new Ze.a(o);c.setStyle(new Ue.Style({zIndex:4,image:new Ue.Circle({radius:4,fill:new Ue.Fill({color:r})})})),n.addFeatures([i,c])}if(e){var a=new Ze.a({geometry:new _r.LineString(e)});a.setStyle([new Ue.Style({zIndex:2,stroke:new Ue.Stroke({color:"#000000",width:6})}),new Ue.Style({zIndex:3,stroke:new Ue.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getView().calculateExtent(),r=Object(Ke.buffer)(e,Object(Ke.getWidth)(e)/10).join(","),n=this.map.getView().getZoom();return Yn(ro(i.prototype),"getParams",this).call(this,Wn(Wn({},t),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(t){return new i(Wn(Wn({},this.options),t))}}])&&Qn(e.prototype,r),n&&Qn(e,n),i}(zn(Dr)),oo=r(24),io=r.n(oo);function co(t){return(co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ao(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return uo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uo(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function so(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?so(Object(r),!0).forEach((function(e){fo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):so(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function fo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function po(t,e,r){return(po="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function yo(t,e){return(yo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mo(t);if(e){var o=mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bo(this,r)}}function bo(t,e){return!e||"object"!==co(e)&&"function"!=typeof e?vo(t):e}function vo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mo(t){return(mo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function go(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jo(t,e,r){return e&&Oo(t.prototype,e),r&&Oo(t,r),t}var wo=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yo(t,e)}(r,t);var e=ho(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return go(this,r),(t=e.call(this,lo({},n))).debug=n.debug,t.mode=n.mode||Rn.TOPOGRAPHIC,t.onMessage=t.onMessage.bind(vo(t)),t.onDeleteMessage=t.onDeleteMessage.bind(vo(t)),t.api=n.api||new En(n),t.tenant=n.tenant||"",t.minZoomNonTrain=n.minZoomNonTrain||9,t.format=new $t.a,t.isUpdateBboxOnMoveEnd=n.isUpdateBboxOnMoveEnd||!0,t}return jo(r,[{key:"start",value:function(){po(mo(r.prototype),"start",this).call(this),this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage),this.setBbox()}},{key:"stop",value:function(){po(mo(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteMessage)}},{key:"setBbox",value:function(t){this.isUpdateBboxOnMoveEnd&&this.api.setBbox(t)}},{key:"setMode",value:function(t){this.mode!==t&&(this.mode=t,this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage))}},{key:"mustNotBeDisplayed",value:function(t,e,r){return!Object(Ke.intersects)(e,t.bounds)||"rail"!==t.type&&r<(this.minZoomNonTrain||9)}},{key:"onFeatureHover",value:function(t,e,n){var o=ao(t,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),po(mo(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=ao(t,1)[0];o?(this.selectedVehicleId=o.get("train_id"),this.highlightTrajectory()):this.selectedVehicleId=null,po(mo(r.prototype),"onFeatureClick",this).call(this,t,e,n)}},{key:"onMessage",value:function(t){if(t.content){var e=this.format.readFeature(t.content);if(e.set("timeOffset",Date.now()-t.timestamp),e.get("time_since_update")>=0){if(this.debug&&this.mode===Rn.TOPOGRAPHIC&&e.get("raw_coordinates")){var r=new io.a(e.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),e.setGeometry(r)}this.mustNotBeDisplayed(e.getProperties())||this.addTrajectory(e.get("train_id"),e.getProperties(),!e.get("line"))}}}},{key:"onDeleteMessage",value:function(t){t.content&&this.removeTrajectoryByAttribute("train_id",t.content)}},{key:"highlightTrajectory",value:function(){var t=[this.api.getStopSequence(this.selectedVehicleId,this.mode),this.api.getFullTrajectory(this.selectedVehicleId,this.mode)];return Promise.all(t).then((function(t){var e=ao(t,2);return{stopSequence:e[0],fullTrajectory:e[1]}}))}},{key:"addTrajectory",value:function(t,e,r){var n=this.trajectories.findIndex((function(e){return e.train_id===t})),o=e.time_intervals,i=lo(lo({},e),{},{id:t,timeIntervals:o});r?(this.trajectories.unshift(i),-1!==n&&this.tracker.trajectories.splice(n+1,1)):(this.trajectories.push(i),-1!==n&&this.tracker.trajectories.splice(n,1)),this.tracker.setTrajectories(this.trajectories)}},{key:"removeTrajectory",value:function(t){for(var e=0,r=this.trajectories.length;e<r;e+=1)if(this.trajectories[e].id===t){this.trajectories.splice(e,1);break}}},{key:"removeTrajectoryByAttribute",value:function(t,e){for(var r=0,n=this.trajectories.length;r<n;r+=1)if(this.trajectories[r][t]===e){this.removeTrajectory(this.trajectories[r].id);break}}}]),r}(t)};function Po(t){return(Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ko(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function So(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ko(Object(r),!0).forEach((function(e){To(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ko(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function To(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Co(t){return function(t){if(Array.isArray(t))return xo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return xo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xo(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ro(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Do(t,e,r){return(Do="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function _o(t,e){return(_o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Mo(t);if(e){var o=Mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ao(this,r)}}function Ao(t,e){return!e||"object"!==Po(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Mo(t){return(Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lo=new $t.a,Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_o(t,e)}(i,t);var e,r,n,o=Io(i);function i(){return Ro(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"mustNotBeDisplayed",value:function(t,e,r){return Do(Mo(i.prototype),"mustNotBeDisplayed",this).call(this,t,e||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(){for(var t=this.map.getView().calculateExtent(),e=Math.floor(this.map.getView().getZoom()),r=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,t,e)){var o=Co(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}Do(Mo(i.prototype),"setBbox",this).call(this,[].concat(Co(t),[e,this.tenant]))}},{key:"onMoveEnd",value:function(t){Do(Mo(i.prototype),"onMoveEnd",this).call(this,t),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.selectedVehicleId&&this.highlightTrajectory()}},{key:"highlightTrajectory",value:function(){var t=this;Do(Mo(i.prototype),"highlightTrajectory",this).call(this).then((function(e){var r=e.stopSequence,n=e.fullTrajectory,o=t.vectorLayer.getSource();o.clear();var i="#ffffff";if(t.useDelayStyle)i="#a0a0a0";else{if(n){var c=n.features[0].properties,a=c.type,u=c.stroke;u&&"#"!==u[0]&&(u="#".concat(u)),i=u||le(a)}i=/#ffffff/i.test(i)?"#ff0000":i}if(r.forEach((function(t){if(t.stations){var e=new _r.MultiPoint(t.stations.map((function(t){return t.coordinate}))),r=new Ze.a(e);r.setStyle(new Ue.Style({zIndex:1,image:new Ue.Circle({radius:5,fill:new Ue.Fill({color:"#000000"})})}));var n=new Ze.a(e);n.setStyle(new Ue.Style({zIndex:4,image:new Ue.Circle({radius:4,fill:new Ue.Fill({color:i})})})),o.addFeatures([r,n])}})),n){var s=[new Ue.Style({zIndex:2,stroke:new Ue.Stroke({color:"#000000",width:6})}),new Ue.Style({zIndex:3,stroke:new Ue.Stroke({color:i,width:4})})],l=Lo.readFeatures(n);l.forEach((function(t){t.setStyle(s)})),t.vectorLayer.getSource().addFeatures(l)}}))}},{key:"clone",value:function(t){return new i(So(So({},this.options),t))}}])&&Eo(e.prototype,r),n&&Eo(e,n),i}(wo(Dr));function Fo(t){return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Uo(Object(r),!0).forEach((function(e){Bo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function No(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ho(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ko(t,e){return(Ko=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Go(t);if(e){var o=Go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Zo(this,r)}}function Zo(t,e){return!e||"object"!==Fo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Go(t){return(Go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ko(t,e)}(i,t);var e,r,n,o=zo(i);function i(){return No(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(t);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(t){return t===e.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:t})}},{key:"clone",value:function(t){return new i(qo(qo({},this.options),t))}}])&&Ho(e.prototype,r),n&&Ho(e,n),i}(I);function $o(t){return($o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jo(Object(r),!0).forEach((function(e){Yo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Yo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ti(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ei(t,e){return(ei=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=oi(t);if(e){var o=oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ni(this,r)}}function ni(t,e){return!e||"object"!==$o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function oi(t){return(oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ei(t,e)}(i,t);var e,r,n,o=ri(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xo(this,i),(t=o.call(this,e)).abortController=new AbortController,t.format=new $t.a,t}return e=i,(r=[{key:"getFeatureInfoUrl",value:function(t){var e=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(t,r,e,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(t),{signal:r}).then((function(t){return t.json()})).then((function(t){return t.features})).then((function(r){return{layer:e,coordinate:t,features:r.map((function(t){return e.format.readFeature(t)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:t,layer:e})}))}},{key:"clone",value:function(t){return new i(Qo(Qo({},this.options),t))}}])&&ti(e.prototype,r),n&&ti(e,n),i}(I);r(15),r(25),r(26),r(17);function ci(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ai(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ui(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ai(Object(r),!0).forEach((function(e){si(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ai(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function si(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function li(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yi(t);if(e){var o=yi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return pi(this,r)}}function pi(t,e){return!e||"object"!==ci(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function yi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function vi(t,e,r){return e&&bi(t.prototype,e),r&&bi(t,r),t}function di(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Oi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pi(t);if(e){var o=Pi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return wi(this,r)}}function wi(t,e){return!e||"object"!==di(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Pi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ki=Z;var ki;function Si(t){return(Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ti(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ci(t,e,r){return(Ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_i(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function xi(t,e){return(xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_i(t);if(e){var o=_i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ei(this,r)}}function Ei(t,e){return!e||"object"!==Si(e)&&"function"!=typeof e?Di(t):e}function Di(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _i(t){return(_i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xi(t,e)}(i,t);var e,r,n,o=Ri(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).render=e.render.bind(Di(e)),e}return e=i,(r=[{key:"activate",value:function(){Ci(_i(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),Ci(_i(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return re(this.map)}}])&&Ti(e.prototype,r),n&&Ti(e,n),i}(vt(Z));function Ai(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Li(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mi(Object(r),!0).forEach((function(e){Vi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Vi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ui(t,e,r){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==Hi(t););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function qi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Bi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Hi(t);if(e){var o=Hi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ni(this,r)}}function Ni(t,e){return!e||"object"!==Ai(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Hi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}it(Kt.Map);var Ki=r(18),zi=r.n(Ki),Zi=r(19);function Gi(t){return(Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wi(t){return function(t){if(Array.isArray(t))return $i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return $i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ji(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ji(Object(r),!0).forEach((function(e){Yi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Yi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ec(t,e,r){return(ec="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ic(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function rc(t,e){return(rc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ic(t);if(e){var o=ic(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return oc(this,r)}}function oc(t,e){return!e||"object"!==Gi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ic(t){return(ic=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cc(t){return function(t){if(Array.isArray(t))return ac(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ac(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ac(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var uc=function(t){var e=t.getBounds().toArray(),r=Object(Ht.fromLonLat)(e[0]),n=Object(Ht.fromLonLat)(e[1]),o=[].concat(cc(r),cc(n)),i=t.getCanvas(),c=i.width,a=i.height,u=Object(Ke.getWidth)(o)/c,s=Object(Ke.getHeight)(o)/a;return Math.max(u,s)},sc=function(t,e){var r=t.getCanvas(),n=r.width,o=r.height,i=t.unproject({x:0,y:0}),c=t.unproject({x:0,y:o/e}),a=t.unproject({x:n/e,y:o/e}),u=t.unproject({x:n/e,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function lc(t){return(lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fc(t){return function(t){if(Array.isArray(t))return pc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return pc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function hc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yc(Object(r),!0).forEach((function(e){bc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mc(t,e,r){return(mc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function gc(t,e){return(gc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Oc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pc(t);if(e){var o=Pc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jc(this,r)}}function jc(t,e){return!e||"object"!==lc(e)&&"function"!=typeof e?wc(t):e}function wc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pc(t){return(Pc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var kc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gc(t,e)}(i,t);var e,r,n,o=Oc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vc(this,i),(t=o.call(this,hc({},e))).onMove=t.onMove.bind(wc(t)),t.onMoveEnd=t.onMoveEnd.bind(wc(t)),t.onZoomEnd=t.onZoomEnd.bind(wc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(wc(t)),t}return e=i,(r=[{key:"init",value:function(t,e){if(t){var r=t.getCanvas();mc(Pc(i.prototype),"init",this).call(this,t,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:sc(t,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=e,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},t.addSource(this.key,n),t.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),mc(Pc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){mc(Pc(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomend",this.onZoomEnd)}},{key:"stop",value:function(){mc(Pc(i.prototype),"stop",this).call(this),this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd),this.map.off("zoomend",this.onZoomEnd))}},{key:"onUserClickCallback",value:function(t){mc(Pc(i.prototype),"onUserClickCallback",this).call(this,hc({coordinate:Object(Ht.fromLonLat)(t.lngLat.toArray())},t))}},{key:"onUserMoveCallback",value:function(t){mc(Pc(i.prototype),"onUserMoveCallback",this).call(this,hc({coordinate:Object(Ht.fromLonLat)(t.lngLat.toArray())},t))}},{key:"renderTrajectories",value:function(t){var e=this.map.getCanvas(),r=e.width,n=e.height,o=this.map.getCenter(),c=this.map.unproject({x:0,y:n/this.pixelRatio}),a=this.map.unproject({x:r/this.pixelRatio,y:0}),u=zi()(Object(Zi.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=zi()(Object(Zi.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(fc(Object(Ht.fromLonLat)(u)),fc(Object(Ht.fromLonLat)(s))),f=Object(Ke.getWidth)(l)/(r/this.pixelRatio),p=Object(Ke.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ht.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};mc(Pc(i.prototype),"renderTrajectories",this).call(this,h,t)}},{key:"getRefreshTimeInMs",value:function(){return mc(Pc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=uc(this.map);return mc(Pc(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=uc(this.map);return mc(Pc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,hc({resolution:r},e))}},{key:"onVisibilityChange",value:function(){this.visible&&!this.map.getLayer(this.key)?this.map.addLayer(this.layer,this.beforeId):this.map.getLayer(this.key)&&this.map.removeLayer(this.key)}},{key:"onMove",value:function(){var t=sc(this.map,this.pixelRatio),e=this.map.getSource(this.key);e&&e.setCoordinates(t),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){}},{key:"onFeatureHover",value:function(t,e,r){mc(Pc(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getCanvasContainer().style.cursor=t.length?"pointer":"auto"}}])&&dc(e.prototype,r),n&&dc(e,n),i}(gr(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rc(t,e)}(i,t);var e,r,n,o=nc(i);function i(){return Xi(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"init",value:function(t){ec(ic(i.prototype),"init",this).call(this,t),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(t){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),ec(ic(i.prototype),"terminate",this).call(this,t)}},{key:"onUserClickCallback",value:function(t){ec(ic(i.prototype),"onUserClickCallback",this).call(this,Qi({coordinate:t.lngLat.toArray()},t))}},{key:"onUserMoveCallback",value:function(t){ec(ic(i.prototype),"onUserMoveCallback",this).call(this,Qi({coordinate:t.lngLat.toArray()},t))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var t=this.map.getBounds().toArray();return Object(Ht.transformExtent)([].concat(Wi(t[0]),Wi(t[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(t){return new i(Qi(Qi({},this.options),t))}}])&&tc(e.prototype,r),n&&tc(e,n),i}(w)));function Sc(t){return(Sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tc(t){return function(t){if(Array.isArray(t))return Cc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Cc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ec(t,e,r){return(Ec="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ac(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Dc(t,e){return(Dc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ac(t);if(e){var o=Ac(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ic(this,r)}}function Ic(t,e){return!e||"object"!==Sc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ac(t){return(Ac=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Mc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Dc(t,e)}(i,t);var e,r,n,o=_c(i);function i(){return xc(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"mustNotBeDisplayed",value:function(t,e,r){return Ec(Ac(i.prototype),"mustNotBeDisplayed",this).call(this,t,e||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(){for(var t=this.getMercatorExtent(),e=Math.floor(this.getOlZoom()),r=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,t,e)){var o=Tc(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}Ec(Ac(i.prototype),"setBbox",this).call(this,[].concat(Tc(t),[e,this.tenant]))}},{key:"onMoveEnd",value:function(t){Ec(Ac(i.prototype),"onMoveEnd",this).call(this,t),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Rc(e.prototype,r),n&&Rc(e,n),i}(wo(kc));function Lc(t){return(Lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vc(t){return function(t){if(Array.isArray(t))return Fc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Fc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Uc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Uc(Object(r),!0).forEach((function(e){Bc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Kc(t,e,r){return(Kc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$c(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function zc(t,e){return(zc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=$c(t);if(e){var o=$c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gc(this,r)}}function Gc(t,e){return!e||"object"!==Lc(e)&&"function"!=typeof e?Wc(t):e}function Wc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $c(t){return($c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Jc={mapbox:{TrajservLayer:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zc(t,e)}(i,t);var e,r,n,o=Zc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Nc(this,i),(t=o.call(this,qc({},e))).onMove=t.onMove.bind(Wc(t)),t.onMoveEnd=t.onMoveEnd.bind(Wc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(Wc(t)),t}return e=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),Kc($c(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(Kc($c(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd))}},{key:"stop",value:function(){this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),Kc($c(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getBounds().toArray(),r=Object(Ht.fromLonLat)(e[0]),n=Object(Ht.fromLonLat)(e[1]),o=[].concat(Vc(r),Vc(n)),c=Object(Ke.buffer)(o,Object(Ke.getWidth)(o)/10).join(","),a=this.map.getZoom();return Kc($c(i.prototype),"getParams",this).call(this,qc(qc({},t),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(t,e,r){console.log("to be implemented")}}])&&Hc(e.prototype,r),n&&Hc(e,n),i}(zn(kc)),TralisLayer:Mc},ol:{Map:Nt,Layer:I,WMSLayer:ii,MapboxLayer:Fe,TrajservLayer:no,TralisLayer:Vo,VectorLayer:Wo}};e.default=Jc}])}));
2
2
  //# sourceMappingURL=index.js.map