mobility-toolbox-js 1.6.0-beta.7 → 1.6.0-beta.8
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/common/mixins/TrackerLayerMixin.js +99 -1
- package/common/mixins/TrajservLayerMixin.js +1 -141
- package/common/mixins/TralisLayerMixin.js +6 -0
- package/common/trackerConfig.js +16 -13
- package/common/trackerConfig.test.js +38 -0
- package/common/utils/createTrackerFilters.js +82 -0
- package/common/utils/createTrackerFilters.test.js +89 -0
- package/common/utils/trackerStyle.js +23 -21
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/mapbox/layers/TralisLayer.js +0 -1
- package/ol/layers/TralisLayer.js +30 -20
- package/package.json +1 -1
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()}(window,(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/Observable")},function(t,e){t.exports=require("ol/extent")},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(2),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 R(t,e,r){return(R="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=D(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 x(t,e){return(x=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=D(t);if(e){var o=D(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _(this,r)}}function _(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 D(t){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var A=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&&x(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){R(D(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(R(D(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),R(D(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&&(R(D(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),I=r(10),L=r.n(I);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}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 U(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){F(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 F(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 H(t,e){return(H=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function K(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 N(this,r)}}function N(t,e){return!e||"object"!==M(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 G=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&&H(t,e)}(i,t);var e,r,n,o=K(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=U({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=U({},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}(L.a);function Z(t){return(Z="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"!==Z(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 G?this.addMobilityControl(t):Q(et(r.prototype),"addControl",this).call(this,t,e)}},{key:"removeControl",value:function(t){t instanceof G?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 Rt=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(G));function xt(t){return(xt="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 _t(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 _t(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 _t(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 _t(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 Dt(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 At(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dt(Object(r),!0).forEach((function(e){It(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function It(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mt(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 Ut(t,e){return(Ut=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ft(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"!==xt(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 Ht=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&&Ut(t,e)}(c,t);var e,r,n,o=Ft(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Lt(this,c),o.call(this,At({controls:[].concat(Et(Object(i.defaults)({attribution:!1}).getArray()),[new Rt])},t))}return e=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(t){t instanceof A?(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 A?(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)}}])&&Mt(e.prototype,r),n&&Mt(e,n),c}(it(o.a)),Kt=r(1),Nt=r(12),zt=r.n(Nt),Gt=r(13),Zt=r.n(Gt),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(/©/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","Subway / Metro / S-Bahn","Train","Bus","Ferry","Cable Car","Gondola","Funicular","Long distance bus","Rail"],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){if("string"==typeof t){var e=oe.find((function(e){return new RegExp(t).test(e)}));return oe.indexOf(e)}return 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"):""};function be(t){return(be="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 ve(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 de(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 de(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 de(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 me(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 ge(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?me(Object(r),!0).forEach((function(e){Oe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Oe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function je(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function we(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 Pe(t,e,r){return(Pe="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=Re(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 ke(t,e){return(ke=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Se(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=Re(t);if(e){var o=Re(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Te(this,r)}}function Te(t,e){return!e||"object"!==be(e)&&"function"!=typeof e?Ce(t):e}function Ce(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Re(t){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xe=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&&ke(t,e)}(i,t);var e,r,n,o=Se(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};je(this,i);var r=new at.a({source:new Zt.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(Kt.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,ge(ge({},e),{},{olLayer:r}))).styleUrl=e.url,t.apiKey=e.apiKey,t.apiKeyName=e.apiKeyName||"key",t.updateAttribution=t.updateAttribution.bind(Ce(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;Pe(Re(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=ve(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(Kt.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(Kt.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,Pe(Re(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(t){return new i(ge(ge({},this.options),t))}}])&&we(e.prototype,r),n&&we(e,n),i}(A);var Ee=r(0),_e=r(14),De=r(8);var Ae=r(9),Ie=r(3),Le=r(5),Me=r.n(Le),Ve=r(16),Ue=r.n(Ve);function Fe(t){return function(t){if(Array.isArray(t))return He(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Be(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 qe(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)||Be(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 Be(t,e){if(t){if("string"==typeof t)return He(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)?He(t,e):void 0}}function He(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 Ke(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 Ne(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ze(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 Ge=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?Ke(Object(r),!0).forEach((function(e){Ne(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ke(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=qe(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(Ae.compose)(Object(Ae.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,R=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var x=null,E=void 0;if(!S.coordinate||!e&&this.interpolate){if(C&&C.length>1){for(var _=n-(R||0),D=void 0,A=void 0,I=void 0,L=void 0,M=void 0,V=0;V<C.length-1;V+=1){var U=qe(C[V],3);D=U[0],I=U[1],E=U[2];var F=qe(C[V+1],2);if(A=F[0],L=F[1],D<=_&&_<=A)break;D=null,A=null}if(T.getType()===Ue.a.POINT)x=T.getCoordinates();else if(T.getType()===Ue.a.LINE_STRING){if(D&&A){M=this.interpolate?Math.min((_-D)/(A-D),1):0;var q=this.interpolate?M*(L-I)+I:0;x=T.getCoordinateAt(q),this.trajectories[k].rotation=E,this.trajectories[k].endFraction=M}else if(_<C[0][0]){var B=qe(C,1),H=qe(B[0],3);E=H[2],M=0,x=T.getFirstCoordinate()}else if(_>C[C.length-1][0]){var K=qe(C[C.length-1],3);E=K[2],M=1,x=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=M||0}}else x=S.coordinate;if(x){this.trajectories[k].coordinate=x;var N=Object(Ae.apply)(P,Fe(x));if(!N)continue;N=N.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 G=z.width,Z=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,N[0]-G/2,N[1]-Z/2,G,Z),this.hoverVehicleId===S.id&&(b=z,v=N,d=G,m=Z),this.selectedVehicleId===S.id&&(g=z,O=N,j=G,w=Z)}}}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()}}])&&ze(e.prototype,r),n&&ze(e,n),t}();function Ze(t){return(Ze="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 We(t){return function(t){if(Array.isArray(t))return $e(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 $e(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 $e(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 $e(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 Je(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 Qe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Je(Object(r),!0).forEach((function(e){Ye(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Je(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ye(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xe(t,e,r){return(Xe="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=or(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 tr(t,e){return(tr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function er(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=or(t);if(e){var o=or(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"!==Ze(e)&&"function"!=typeof e?nr(t):e}function nr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function or(t){return(or=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cr(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 ar(t,e,r){return e&&cr(t.prototype,e),r&&cr(t,r),t}var ur=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&&tr(t,e)}(r,t);var e=er(r);function r(t){var n;return ir(this,r),(n=e.call(this,Qe({hitTolerance:10},t))).onFeatureHover=n.onFeatureHover.bind(nr(n)),n.onFeatureClick=n.onFeatureClick.bind(nr(n)),n}return ar(r,[{key:"defineProperties",value:function(t){var e=this,n=Qe({},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={pixelRatio:c||window.devicePixelRatio||1,interpolate:a,hoverVehicleId:u,selectedVehicleId:s,filter:l,sort:f,style:o};Object.keys(h).forEach((function(t){return void 0===h[t]&&delete h[t]}));var b=i||1,v=p||new Date;Xe(or(r.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:o||this.defaultStyle},speed:{get:function(){return b},set:function(t){b=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 v},set:function(t){v=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:h,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0}})}},{key:"init",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Xe(or(r.prototype),"init",this).call(this,t),this.tracker=new Ge(Qe(Qe({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),Xe(or(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),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(Qe(Qe({},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(Ie.buffer)([].concat(We(t),We(t)),this.hitTolerance*e),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Ie.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 Me.a({geometry:t.geometry});return e.setProperties(Qe({},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,n=Math.max(25,r/this.speed);return console.log("Next render in ".concat(n," ms.")),n}},{key:"defaultStyle",value:function(t){var e=t.id;if(this.styleCache[e])return this.styleCache[e];var r=document.createElement("canvas");r.width=200,r.height=15;var n=r.getContext("2d");return n.arc(8,8,5,0,2*Math.PI,!1),n.fillStyle="#8ED6FF",n.fill(),n.lineWidth=3,n.strokeStyle="black",n.stroke(),n.font="bold 12px arial",n.strokeStyle="white",n.lineWidth=3,n.strokeText(e,20,10),n.fillStyle="black",n.fillText(e,20,10),this.styleCache[e]=r,this.styleCache[e]}}]),r}(t)};function sr(t){return(sr="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 fr(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){pr(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 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 yr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hr(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,r){return(br="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=gr(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 vr(t,e){return(vr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function dr(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=gr(t);if(e){var o=gr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mr(this,r)}}function mr(t,e){return!e||"object"!==sr(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 gr(t){return(gr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Or=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&&vr(t,e)}(i,t);var e,r,n,o=dr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yr(this,i),(t=o.call(this,fr({},e))).renderWhenInteracting=e.renderWhenInteracting||function(){return t.tracker&&t.tracker.renderedTrajectories&&t.tracker.renderedTrajectories.length<=200},t.olLayer=e.olLayer||new De.Group({layers:[new De.Vector({source:new _e.Vector({features:[]})}),new De.Layer({source:new Zt.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(Ae.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;br(gr(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(){br(gr(i.prototype),"terminate",this).call(this),this.container=null}},{key:"renderTrajectories",value:function(t){var e=this.map.getView();br(gr(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())&&br(gr(i.prototype),"renderTrajectoriesInternal",this).call(this,t,e)&&(this.renderedViewState=fr({},t),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return br(gr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=this.map.getView().getResolution();return br(gr(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this.map.getView().getResolution();return br(gr(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,{resolution:e})}},{key:"onMoveEnd",value:function(t){}},{key:"onZoomEnd",value:function(t){br(gr(i.prototype),"onZoomEnd",this).call(this,t)}},{key:"onFeatureHover",value:function(t,e,r){br(gr(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){br(gr(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(fr(fr({},this.options),t))}}])&&hr(e.prototype,r),n&&hr(e,n),i}(ur(A)),jr=r(4),wr=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("")},Pr=function(t){return[t.getUTCHours(),t.getUTCMinutes(),"".concat(t.getUTCSeconds(),".").concat(t.getUTCMilliseconds())].join(":")};function kr(t){return(kr="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 Sr(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){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Sr(Object(r),!0).forEach((function(e){Cr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Cr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xr(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 Er(t,e){return(Er=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _r(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=Ar(t);if(e){var o=Ar(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Dr(this,r)}}function Dr(t,e){return!e||"object"!==kr(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 Ar(t){return(Ar=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ir=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&&Er(t,e)}(i,t);var e,r,n,o=_r(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Rr(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=Tr(Tr({},e),{},{key:this.apiKey}),o=Tr({},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)))}))}])&&xr(e.prototype,r),n&&xr(e,n),i}(L.a);function Lr(t){return(Lr="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 Mr(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?Mr(Object(r),!0).forEach((function(e){Ur(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ur(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fr(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 Hr(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=Nr(t);if(e){var o=Nr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Kr(this,r)}}function Kr(t,e){return!e||"object"!==Lr(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 Nr(t){return(Nr=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=Hr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Fr(this,i),o.call(this,Vr({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}(Ir);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 Zr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Wr=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},$r=function(t){var e=function(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){Zr(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}({},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=Wr(P),R=Wr(k),x=p&&"#".concat(p),E=y&&"#".concat(y),_=[],D=0;D<(T||[]).length;D+=1){var A=T[D],I=A.sid,L=A.n,M=A.p,V=A.at,U=A.dt,F=A.ap,q=A.dp,B=A.ad,H=A.dd,K=A.dot,N=A.put,z=A.c,G=A.wa;_.push({stationId:I,stationName:L,coordinates:M,arrivalTime:-1!==V?1e3*F:null,departureTime:-1!==U?1e3*q:null,arrivalDelay:B,departureDelay:H,noDropOff:!!K,noPickUp:!!N,cancelled:!!z,wheelchairAccessible:!!G})}return{id:r,destination:n,backgroundColor:x,color:E,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:_,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:R},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},Jr=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 jr.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 Qr(t){return(Qr="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 Yr(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 Xr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yr(Object(r),!0).forEach((function(e){tn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function tn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function en(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rn(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 nn(t,e){return(nn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function on(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=an(t);if(e){var o=an(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return cn(this,r)}}function cn(t,e){return!e||"object"!==Qr(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 an(t){return(an=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var un=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&&nn(t,e)}(i,t);var e,r,n,o=on(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return en(this,i),o.call(this,Xr({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 Jr(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 $r(t)}))}}])&&rn(e.prototype,r),n&&rn(e,n),i}(Ir);function sn(t){return function(t){if(Array.isArray(t))return ln(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 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)||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 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 fn(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.connect(e),this.isSUBAllow=!1,this.isDELAllow=!1,setInterval((function(){r.send("PING")}),1e4),this.subscribed={}}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),sn(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)})),this.currentBbox&&this.setBbox(this.currentBbox),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:"setProjection",value:function(t){this.currentProj=t,this.send("PROJECTION ".concat(t))}},{key:"setBbox",value:function(t){this.currentBbox=t,this.send("BBOX ".concat(t.join(" ")))}},{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]||(this.send("GET ".concat(u)),this.isSUBAllow&&this.send("SUB ".concat(u)),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t&&(!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))})),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}))&&(this.isDELAllow&&this.send("DEL ".concat(t)),this.subscribed[t]=!1)}}])&&fn(e.prototype,r),n&&fn(e,n),t}(),yn=function(t,e){return t===e.SCHEMATIC?"_schematic":""},hn=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},bn=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 vn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dn(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 mn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},gn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};vn(this,t);var r=null;r="string"==typeof e?e:e.url,e.apiKey&&(r="".concat(r,"?key=").concat(e.apiKey)),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),this.conn.isSUBAllow=!this.isUpdateBboxOnMoveEnd,this.conn.isDELAllow=!this.isUpdateBboxOnMoveEnd,this.isUpdateBboxOnMoveEnd||(this.conn.setProjection(e.projection||"epsg:3857"),e.bbox&&this.conn.setBbox(e.bbox))}var e,r,n;return e=t,(r=[{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(yn(mn.SCHEMATIC,mn)).concat(e),r),this.conn.unsubscribe("".concat(t).concat(yn(mn.TOPOGRAPHIC,mn)).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 hn(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(yn(e,mn)),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(yn(t,mn))};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(yn(t,mn)),(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(yn(t,mn)),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(yn(t,mn)),e)}},{key:"unsubscribeDeletedVehicles",value:function(t){this.unsubscribe("deleted_vehicles","",t)}},{key:"getFullTrajectory",value:function(t,e){var r=this,n={channel:"full_trajectory".concat(yn(e,mn),"_").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(yn(e,mn),"_").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 bn(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 bn(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")}}])&&dn(e.prototype,r),n&&dn(e,n),t}();function On(t){return(On="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 jn(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?jn(Object(r),!0).forEach((function(e){Pn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jn(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 kn(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 Sn(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 Sn(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 Sn(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 Tn(t,e,r){return(Tn="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=En(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 Cn(t,e){return(Cn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Rn(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 xn(this,r)}}function xn(t,e){return!e||"object"!==On(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)}function _n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dn(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 An(t,e,r){return e&&Dn(t.prototype,e),r&&Dn(t,r),t}var In=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&&Cn(t,e)}(r,t);var e=Rn(r);function r(){return _n(this,r),e.apply(this,arguments)}return An(r,[{key:"defineProperties",value:function(t){var e=this;Tn(En(r.prototype),"defineProperties",this).call(this,t);var n,o=t.regexPublishedLineName,i=t.publishedLineName,c=t.tripNumber,a=t.operator,u=3;if(!t.api){var s={};t.url&&(s.url=t.url),t.apiKey&&(s.apiKey=t.apiKey),n=new un(s)}Object.defineProperties(this,{showVehicleTraj:{value:void 0===t.showVehicleTraj||t.showVehicleTraj,writable:!0},delayDisplay:{value:t.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:t.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:t.useDelayStyle||!1,writable:!0},requestIntervalSeconds:{get:function(){return u},set:function(t){t!==u&&(u=t,e.visible&&e.start())}},publishedLineName:{get:function(){return i},set:function(t){i=t,e.updateFilters()}},tripNumber:{get:function(){return c},set:function(t){c=t,e.updateFilters()}},operator:{get:function(){return a},set:function(t){a=t,e.updateFilters()}},regexPublishedLineName:{get:function(){return o},set:function(t){o=t,e.updateFilters()}},api:{value:t.api||n}})}},{key:"init",value:function(t){Tn(En(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(),Tn(En(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Tn(En(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(t,e,n){var o=kn(t,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Tn(En(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=kn(t,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Tn(En(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:Pr(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:Pr(new Date)}))];Promise.all(n).then((function(e){var r=kn(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:"updateFilters",value:function(){var t=Qt.a.parse(window.location.search.toLowerCase());this.filter=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){return i.some((function(e){return new RegExp(e,"i").test(t.name)}))}))}if(t){var c=("string"==typeof t?t.split(","):t).map((function(t){return t.replace(/\s+/g,"").toUpperCase()}));o.push((function(t){return c.some((function(e){return e===t.name.toUpperCase()}))}))}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.some((function(t){return t===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}(this.publishedLineName||t.publishedlinename,this.tripNumber||t.tripnumber,this.operator||t.operator,this.regexPublishedLineName)}},{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=wn(wn({},t),{},{btime:Pr(n),etime:Pr(this.later),date:wr(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 Ln(t){return(Ln="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 Mn(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 Vn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mn(Object(r),!0).forEach((function(e){Un(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Un(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fn(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 Bn(t,e,r){return(Bn="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=zn(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 Hn(t,e){return(Hn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kn(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=zn(t);if(e){var o=zn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Nn(this,r)}}function Nn(t,e){return!e||"object"!==Ln(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 zn(t){return(zn=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&&Hn(t,e)}(i,t);var e,r,n,o=Kn(i);function i(){return Fn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"start",value:function(){var t=this;this.map&&(Bn(zn(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),Bn(zn(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 jr.MultiPoint(t.map((function(t){return Object(Kt.fromLonLat)(t)}))),i=new Me.a(o);i.setStyle(new Ee.Style({zIndex:1,image:new Ee.Circle({radius:5,fill:new Ee.Fill({color:"#000000"})})}));var c=new Me.a(o);c.setStyle(new Ee.Style({zIndex:4,image:new Ee.Circle({radius:4,fill:new Ee.Fill({color:r})})})),n.addFeatures([i,c])}if(e){var a=new Me.a({geometry:new jr.LineString(e)});a.setStyle([new Ee.Style({zIndex:2,stroke:new Ee.Stroke({color:"#000000",width:6})}),new Ee.Style({zIndex:3,stroke:new Ee.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(Ie.buffer)(e,Object(Ie.getWidth)(e)/10).join(","),n=this.map.getView().getZoom();return Bn(zn(i.prototype),"getParams",this).call(this,Vn(Vn({},t),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(t){return new i(Vn(Vn({},this.options),t))}}])&&qn(e.prototype,r),n&&qn(e,n),i}(In(Or)),Zn=r(24),Wn=r.n(Zn);function $n(t){return($n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jn(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 Qn(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 Qn(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 Qn(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 Yn(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 Xn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yn(Object(r),!0).forEach((function(e){to(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yn(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 eo(t,e,r){return(eo="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=co(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 ro(t,e){return(ro=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function no(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=co(t);if(e){var o=co(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return oo(this,r)}}function oo(t,e){return!e||"object"!==$n(e)&&"function"!=typeof e?io(t):e}function io(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function co(t){return(co=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ao(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uo(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 so(t,e,r){return e&&uo(t.prototype,e),r&&uo(t,r),t}var lo=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&&ro(t,e)}(r,t);var e=no(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ao(this,r),(t=e.call(this,Xn({},n))).debug=n.debug,t.mode=n.mode||mn.TOPOGRAPHIC,t.onMessage=t.onMessage.bind(io(t)),t.onDeleteMessage=t.onDeleteMessage.bind(io(t)),t.api=n.api||new gn(n),t.format=new $t.a,t.isUpdateBboxOnMoveEnd=n.isUpdateBboxOnMoveEnd||!1,t}return so(r,[{key:"start",value:function(){eo(co(r.prototype),"start",this).call(this),this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage)}},{key:"stop",value:function(){eo(co(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteMessage)}},{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:"onFeatureHover",value:function(t,e,n){var o=Jn(t,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),eo(co(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=Jn(t,1)[0];o?(this.selectedVehicleId=o.get("train_id"),this.highlightTrajectory()):this.selectedVehicleId=null,eo(co(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===mn.TOPOGRAPHIC&&e.get("raw_coordinates")){var r=new Wn.a(e.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),e.setGeometry(r)}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,e=[this.api.getStopSequence(this.selectedVehicleId,this.mode),this.api.getFullTrajectory(this.selectedVehicleId,this.mode)];return Promise.all(e).then((function(e){var r=Jn(e,2),n=r[0],o=r[1];return console.log("stopSequence for ".concat(t.selectedVehicleId,":"),n),console.log("fullTrajectory for ".concat(t.selectedVehicleId,":"),o),{stopSequence:n,fullTrajectory:o}}))}},{key:"addTrajectory",value:function(t,e,r){var n=this.trajectories.findIndex((function(e){return e.train_id===t})),o=e.time_intervals,i=Xn(Xn({},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 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 po(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 yo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?po(Object(r),!0).forEach((function(e){ho(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):po(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ho(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bo(t){return function(t){if(Array.isArray(t))return vo(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 vo(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 vo(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 vo(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 mo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function go(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 Oo(t,e,r){return(Oo="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=ko(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 jo(t,e){return(jo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wo(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=ko(t);if(e){var o=ko(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Po(this,r)}}function Po(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 ko(t){return(ko=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var So=new $t.a,To=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&&jo(t,e)}(i,t);var e,r,n,o=wo(i);function i(){return mo(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"onMoveEnd",value:function(t){Oo(ko(i.prototype),"onMoveEnd",this).call(this,t),this.isUpdateBboxOnMoveEnd&&this.api.conn.setBbox([].concat(bo(this.map.getView().calculateExtent()),[Math.floor(this.map.getView().getZoom())])),this.selectedVehicleId&&this.highlightTrajectory()}},{key:"highlightTrajectory",value:function(){var t=this;Oo(ko(i.prototype),"highlightTrajectory",this).call(this).then((function(e){var r=e.stopSequence,n=e.fullTrajectory,o=t.vectorLayer.getSource();o.clear();var i=r&&r[0]&&r[0].color&&"#".concat(r[0].color)||"#000000";if(r&&r.stations&&r.stations.length&&r.stations[0].coordinate){var c=new jr.MultiPoint(r.stations.map((function(t){return t.coordinates}))),a=new Me.a(c);a.setStyle(new Ee.Style({zIndex:1,image:new Ee.Circle({radius:5,fill:new Ee.Fill({color:"#000000"})})}));var u=new Me.a(c);u.setStyle(new Ee.Style({zIndex:4,image:new Ee.Circle({radius:4,fill:new Ee.Fill({color:i})})})),o.addFeatures([a,u])}if(n){var s=So.readFeatures(n),l=[new Ee.Style({zIndex:2,stroke:new Ee.Stroke({color:"#000000",width:6})}),new Ee.Style({zIndex:3,stroke:new Ee.Stroke({color:i,width:4})})];s.forEach((function(t){t.setStyle(l)})),t.vectorLayer.getSource().addFeatures(s)}}))}},{key:"clone",value:function(t){return new i(yo(yo({},this.options),t))}}])&&go(e.prototype,r),n&&go(e,n),i}(lo(Or));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 Ro(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 xo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(r),!0).forEach((function(e){Eo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ro(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Eo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Do(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 Ao(t,e){return(Ao=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 Lo(this,r)}}function Lo(t,e){return!e||"object"!==Co(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 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&&Ao(t,e)}(i,t);var e,r,n,o=Io(i);function i(){return _o(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(xo(xo({},this.options),t))}}])&&Do(e.prototype,r),n&&Do(e,n),i}(A);function Uo(t){return(Uo="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 Fo(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?Fo(Object(r),!0).forEach((function(e){Bo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fo(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 Ho(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ko(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 No(t,e){return(No=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=Zo(t);if(e){var o=Zo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Go(this,r)}}function Go(t,e){return!e||"object"!==Uo(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 Zo(t){return(Zo=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&&No(t,e)}(i,t);var e,r,n,o=zo(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ho(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))}}])&&Ko(e.prototype,r),n&&Ko(e,n),i}(A);r(15),r(25),r(26),r(17);function $o(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 Jo(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 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){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ti(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=ri(t);if(e){var o=ri(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return ei(this,r)}}function ei(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 ri(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ni(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oi(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 ii(t,e,r){return e&&oi(t.prototype,e),r&&oi(t,r),t}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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ui(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 si(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function li(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 fi(this,r)}}function fi(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 pi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}yi=G;var yi;function hi(t){return(hi="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 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(vi="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=ji(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 di(t,e){return(di=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mi(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=ji(t);if(e){var o=ji(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gi(this,r)}}function gi(t,e){return!e||"object"!==hi(e)&&"function"!=typeof e?Oi(t):e}function Oi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ji(t){return(ji=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wi=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&&di(t,e)}(i,t);var e,r,n,o=mi(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(Oi(e)),e}return e=i,(r=[{key:"activate",value:function(){vi(ji(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)),vi(ji(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return re(this.map)}}])&&bi(e.prototype,r),n&&bi(e,n),i}(vt(G));function Pi(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 ki(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 Si(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ki(Object(r),!0).forEach((function(e){Ti(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ki(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ti(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ci(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 Ri(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!==Di(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(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ei(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=Di(t);if(e){var o=Di(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return _i(this,r)}}function _i(t,e){return!e||"object"!==Pi(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 Di(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}it(Nt.Map);var Ai=r(18),Ii=r.n(Ai),Li=r(19);function Mi(t){return(Mi="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 Vi(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 Ui(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Vi(Object(r),!0).forEach((function(e){Fi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Fi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qi(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 Hi(t,e,r){return(Hi="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=Gi(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 Ki(t,e){return(Ki=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ni(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=Gi(t);if(e){var o=Gi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zi(this,r)}}function zi(t,e){return!e||"object"!==Mi(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 Gi(t){return(Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zi(t){return function(t){if(Array.isArray(t))return Wi(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 Wi(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 Wi(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 Wi(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 $i=function(t){var e=t.getBounds().toArray(),r=Object(Kt.fromLonLat)(e[0]),n=Object(Kt.fromLonLat)(e[1]),o=[].concat(Zi(r),Zi(n)),i=t.getCanvas(),c=i.width,a=i.height,u=Object(Ie.getWidth)(o)/c,s=Object(Ie.getHeight)(o)/a;return Math.max(u,s)},Ji=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 Qi(t){return(Qi="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 Yi(t){return function(t){if(Array.isArray(t))return Xi(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 Xi(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 Xi(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 Xi(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 tc(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 ec(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tc(Object(r),!0).forEach((function(e){rc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function rc(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 oc(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 ic(t,e,r){return(ic="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=lc(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 cc(t,e){return(cc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ac(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=lc(t);if(e){var o=lc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return uc(this,r)}}function uc(t,e){return!e||"object"!==Qi(e)&&"function"!=typeof e?sc(t):e}function sc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lc(t){return(lc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var fc=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&&cc(t,e)}(i,t);var e,r,n,o=ac(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nc(this,i),(t=o.call(this,ec({},e))).onMove=t.onMove.bind(sc(t)),t.onMoveEnd=t.onMoveEnd.bind(sc(t)),t.onZoomEnd=t.onZoomEnd.bind(sc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(sc(t)),t}return e=i,(r=[{key:"init",value:function(t,e){if(t){var r=t.getCanvas();ic(lc(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:Ji(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)),ic(lc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){ic(lc(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(){ic(lc(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){ic(lc(i.prototype),"onUserClickCallback",this).call(this,ec({coordinate:Object(Kt.fromLonLat)(t.lngLat.toArray())},t))}},{key:"onUserMoveCallback",value:function(t){ic(lc(i.prototype),"onUserMoveCallback",this).call(this,ec({coordinate:Object(Kt.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=Ii()(Object(Li.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=Ii()(Object(Li.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(Yi(Object(Kt.fromLonLat)(u)),Yi(Object(Kt.fromLonLat)(s))),f=Object(Ie.getWidth)(l)/(r/this.pixelRatio),p=Object(Ie.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Kt.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};ic(lc(i.prototype),"renderTrajectories",this).call(this,h,t)}},{key:"getRefreshTimeInMs",value:function(){return ic(lc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=$i(this.map);return ic(lc(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=$i(this.map);return ic(lc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,{resolution: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=Ji(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){ic(lc(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getCanvasContainer().style.cursor=t.length?"pointer":"auto"}}])&&oc(e.prototype,r),n&&oc(e,n),i}(ur(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&&Ki(t,e)}(i,t);var e,r,n,o=Ni(i);function i(){return qi(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"init",value:function(t){Hi(Gi(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)),Hi(Gi(i.prototype),"terminate",this).call(this,t)}},{key:"onUserClickCallback",value:function(t){Hi(Gi(i.prototype),"onUserClickCallback",this).call(this,Ui({coordinate:t.lngLat.toArray()},t))}},{key:"onUserMoveCallback",value:function(t){Hi(Gi(i.prototype),"onUserMoveCallback",this).call(this,Ui({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:"clone",value:function(t){return new i(Ui(Ui({},this.options),t))}}])&&Bi(e.prototype,r),n&&Bi(e,n),i}(w)));function pc(t){return(pc="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 yc(t){return function(t){if(Array.isArray(t))return hc(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 hc(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 hc(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 hc(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 bc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vc(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 dc(t,e,r){return(dc="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=jc(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 mc(t,e){return(mc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gc(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=jc(t);if(e){var o=jc(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"!==pc(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 jc(t){return(jc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wc=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&&mc(t,e)}(i,t);var e,r,n,o=gc(i);function i(){return bc(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"onMoveEnd",value:function(t){if(dc(jc(i.prototype),"onMoveEnd",this).call(this,t),console.log("onMoveEnd"),this.isUpdateBboxOnMoveEnd){var e=this.map.getBounds().toArray();this.api.conn.setBbox([].concat(yc(Object(Kt.transformExtent)([].concat(yc(e[0]),yc(e[1])),"EPSG:4326","EPSG:3857")),[Math.floor(this.map.getZoom()+1)]))}}}])&&vc(e.prototype,r),n&&vc(e,n),i}(lo(fc));function Pc(t){return(Pc="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 kc(t){return function(t){if(Array.isArray(t))return Sc(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 Sc(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 Sc(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 Sc(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 Tc(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 Cc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Tc(Object(r),!0).forEach((function(e){Rc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Rc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ec(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 _c(t,e,r){return(_c="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=Mc(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 Ac(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=Mc(t);if(e){var o=Mc(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"!==Pc(e)&&"function"!=typeof e?Lc(t):e}function Lc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mc(t){return(Mc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Vc={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&&Dc(t,e)}(i,t);var e,r,n,o=Ac(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xc(this,i),(t=o.call(this,Cc({},e))).onMove=t.onMove.bind(Lc(t)),t.onMoveEnd=t.onMoveEnd.bind(Lc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(Lc(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)),_c(Mc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(_c(Mc(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)),_c(Mc(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(Kt.fromLonLat)(e[0]),n=Object(Kt.fromLonLat)(e[1]),o=[].concat(kc(r),kc(n)),c=Object(Ie.buffer)(o,Object(Ie.getWidth)(o)/10).join(","),a=this.map.getZoom();return _c(Mc(i.prototype),"getParams",this).call(this,Cc(Cc({},t),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(t,e,r){console.log("to be implemented")}}])&&Ec(e.prototype,r),n&&Ec(e,n),i}(In(fc)),TralisLayer:wc},ol:{Map:Ht,Layer:A,WMSLayer:Wo,MapboxLayer:xe,TrajservLayer:Gn,TralisLayer:To,VectorLayer:Vo}};e.default=Vc}])}));
|
|
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()}(window,(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/Observable")},function(t,e){t.exports=require("ol/extent")},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(2),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){C(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 C(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(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 R(t,e,r){return(R="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 E(t,e){return(E=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=_(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 A=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&&E(t,e)}(i,t);var e,r,n,o=x(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){R(_(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(R(_(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),R(_(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&&(R(_(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))}}])&&T(e.prototype,r),n&&T(e,n),i}(w),I=r(10),L=r.n(I);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}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 U(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){F(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 F(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 H(t,e){return(H=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function K(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 N(this,r)}}function N(t,e){return!e||"object"!==M(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 G=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&&H(t,e)}(i,t);var e,r,n,o=K(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=U({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=U({},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}(L.a);function Z(t){return(Z="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"!==Z(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 G?this.addMobilityControl(t):Q(et(r.prototype),"addControl",this).call(this,t,e)}},{key:"removeControl",value:function(t){t instanceof G?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=Tt(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=Tt(t);if(e){var o=Tt(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?Ct(t):e}function Ct(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tt(t){return(Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rt=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(Ct(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(Tt(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(Tt(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(G));function Et(t){return(Et="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 xt(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 At(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){It(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 It(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mt(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 Ut(t,e){return(Ut=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ft(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"!==Et(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 Ht=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&&Ut(t,e)}(c,t);var e,r,n,o=Ft(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Lt(this,c),o.call(this,At({controls:[].concat(xt(Object(i.defaults)({attribution:!1}).getArray()),[new Rt])},t))}return e=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(t){t instanceof A?(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 A?(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)}}])&&Mt(e.prototype,r),n&&Mt(e,n),c}(it(o.a)),Kt=r(1),Nt=r(12),zt=r.n(Nt),Gt=r(13),Zt=r.n(Gt),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(/©/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"):""};function be(t){return(be="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 ve(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 de(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 de(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 de(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 me(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 ge(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?me(Object(r),!0).forEach((function(e){Oe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Oe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function je(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function we(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 Pe(t,e,r){return(Pe="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=Re(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 ke(t,e){return(ke=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Se(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=Re(t);if(e){var o=Re(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ce(this,r)}}function Ce(t,e){return!e||"object"!==be(e)&&"function"!=typeof e?Te(t):e}function Te(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Re(t){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ee=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&&ke(t,e)}(i,t);var e,r,n,o=Se(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};je(this,i);var r=new at.a({source:new Zt.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(Kt.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,ge(ge({},e),{},{olLayer:r}))).styleUrl=e.url,t.apiKey=e.apiKey,t.apiKeyName=e.apiKeyName||"key",t.updateAttribution=t.updateAttribution.bind(Te(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;Pe(Re(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=ve(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(Kt.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(Kt.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,Pe(Re(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(t){return new i(ge(ge({},this.options),t))}}])&&we(e.prototype,r),n&&we(e,n),i}(A);var xe=r(0),De=r(14),_e=r(8);var Ae=r(9),Ie=r(3),Le=r(5),Me=r.n(Le),Ve=r(16),Ue=r.n(Ve);function Fe(t){return function(t){if(Array.isArray(t))return He(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Be(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 qe(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)||Be(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 Be(t,e){if(t){if("string"==typeof t)return He(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)?He(t,e):void 0}}function He(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 Ke(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 Ne(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ze(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 Ge=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?Ke(Object(r),!0).forEach((function(e){Ne(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ke(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=qe(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(Ae.compose)(Object(Ae.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],C=S.geometry,T=S.timeIntervals,R=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var E=null,x=void 0;if(!S.coordinate||!e&&this.interpolate){if(T&&T.length>1){for(var D=n-(R||0),_=void 0,A=void 0,I=void 0,L=void 0,M=void 0,V=0;V<T.length-1;V+=1){var U=qe(T[V],3);_=U[0],I=U[1],x=U[2];var F=qe(T[V+1],2);if(A=F[0],L=F[1],_<=D&&D<=A)break;_=null,A=null}if(C.getType()===Ue.a.POINT)E=C.getCoordinates();else if(C.getType()===Ue.a.LINE_STRING){if(_&&A){M=this.interpolate?Math.min((D-_)/(A-_),1):0;var q=this.interpolate?M*(L-I)+I:0;E=C.getCoordinateAt(q),this.trajectories[k].rotation=x,this.trajectories[k].endFraction=M}else if(D<T[0][0]){var B=qe(T,1),H=qe(B[0],3);x=H[2],M=0,E=C.getFirstCoordinate()}else if(D>T[T.length-1][0]){var K=qe(T[T.length-1],3);x=K[2],M=1,E=C.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",C);this.trajectories[k].rotation=x,this.trajectories[k].endFraction=M||0}}else E=S.coordinate;if(E){this.trajectories[k].coordinate=E;var N=Object(Ae.apply)(P,Fe(E));if(!N)continue;N=N.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 G=z.width,Z=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,N[0]-G/2,N[1]-Z/2,G,Z),this.hoverVehicleId===S.id&&(b=z,v=N,d=G,m=Z),this.selectedVehicleId===S.id&&(g=z,O=N,j=G,w=Z)}}}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()}}])&&ze(e.prototype,r),n&&ze(e,n),t}(),Ze=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 We(t){return(We="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 $e(t){return function(t){if(Array.isArray(t))return Je(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 Je(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 Je(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 Je(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 Qe(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 Ye(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qe(Object(r),!0).forEach((function(e){Xe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Xe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}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=ir(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 er(t,e){return(er=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function rr(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=ir(t);if(e){var o=ir(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return nr(this,r)}}function nr(t,e){return!e||"object"!==We(e)&&"function"!=typeof e?or(t):e}function or(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ir(t){return(ir=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ar(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 ur(t,e,r){return e&&ar(t.prototype,e),r&&ar(t,r),t}var sr=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&&er(t,e)}(r,t);var e=rr(r);function r(t){var n;return cr(this,r),(n=e.call(this,Ye({hitTolerance:10},t))).onFeatureHover=n.onFeatureHover.bind(or(n)),n.onFeatureClick=n.onFeatureClick.bind(or(n)),n}return ur(r,[{key:"defineProperties",value:function(t){var e=this,n=Ye({},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;tr(ir(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]:{};tr(ir(r.prototype),"init",this).call(this,t),this.tracker=new Ge(Ye(Ye({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),tr(ir(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(Ye(Ye({},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(Ie.buffer)([].concat($e(t),$e(t)),this.hitTolerance*e),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Ie.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 Me.a({geometry:t.geometry});return e.setProperties(Ye({},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=Ze(this.publishedLineName||t.publishedlinename,this.tripNumber||t.tripnumber,this.operator||t.operator,this.regexPublishedLineName)}},{key:"defaultStyle",value:function(t){var e=t.id;if(this.styleCache[e])return this.styleCache[e];var r=document.createElement("canvas");r.width=200,r.height=15;var n=r.getContext("2d");return n.arc(8,8,5,0,2*Math.PI,!1),n.fillStyle="#8ED6FF",n.fill(),n.lineWidth=3,n.strokeStyle="black",n.stroke(),n.font="bold 12px arial",n.strokeStyle="white",n.lineWidth=3,n.strokeText(e,20,10),n.fillStyle="black",n.fillText(e,20,10),this.styleCache[e]=r,this.styleCache[e]}}]),r}(t)};function lr(t){return(lr="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 fr(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 pr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fr(Object(r),!0).forEach((function(e){yr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function yr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function br(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 vr(t,e,r){return(vr="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=Or(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 dr(t,e){return(dr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mr(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=Or(t);if(e){var o=Or(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gr(this,r)}}function gr(t,e){return!e||"object"!==lr(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 Or(t){return(Or=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jr=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&&dr(t,e)}(i,t);var e,r,n,o=mr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hr(this,i),(t=o.call(this,pr({},e))).renderWhenInteracting=e.renderWhenInteracting||function(){return t.tracker&&t.tracker.renderedTrajectories&&t.tracker.renderedTrajectories.length<=200},t.olLayer=e.olLayer||new _e.Group({layers:[new _e.Vector({source:new De.Vector({features:[]})}),new _e.Layer({source:new Zt.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(Ae.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;vr(Or(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(){vr(Or(i.prototype),"terminate",this).call(this),this.container=null}},{key:"renderTrajectories",value:function(t){var e=this.map.getView();vr(Or(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())&&vr(Or(i.prototype),"renderTrajectoriesInternal",this).call(this,t,e)&&(this.renderedViewState=pr({},t),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return vr(Or(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=this.map.getView().getResolution();return vr(Or(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this.map.getView().getResolution();return vr(Or(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,{resolution:e})}},{key:"onMoveEnd",value:function(t){}},{key:"onZoomEnd",value:function(t){vr(Or(i.prototype),"onZoomEnd",this).call(this,t)}},{key:"onFeatureHover",value:function(t,e,r){vr(Or(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){vr(Or(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(pr(pr({},this.options),t))}}])&&br(e.prototype,r),n&&br(e,n),i}(sr(A)),wr=r(4),Pr=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("")},kr=function(t){return[t.getUTCHours(),t.getUTCMinutes(),"".concat(t.getUTCSeconds(),".").concat(t.getUTCMilliseconds())].join(":")};function Sr(t){return(Sr="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 Cr(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){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Cr(Object(r),!0).forEach((function(e){Rr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Rr(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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xr(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 Dr(t,e){return(Dr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _r(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=Ir(t);if(e){var o=Ir(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ar(this,r)}}function Ar(t,e){return!e||"object"!==Sr(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 Ir(t){return(Ir=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lr=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&&Dr(t,e)}(i,t);var e,r,n,o=_r(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Er(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=Tr(Tr({},e),{},{key:this.apiKey}),o=Tr({},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)))}))}])&&xr(e.prototype,r),n&&xr(e,n),i}(L.a);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 Vr(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?Vr(Object(r),!0).forEach((function(e){Fr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vr(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 qr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Br(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 Hr(t,e){return(Hr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kr(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=zr(t);if(e){var o=zr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Nr(this,r)}}function Nr(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 zr(t){return(zr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var 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&&Hr(t,e)}(i,t);var e,r,n,o=Kr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return qr(this,i),o.call(this,Ur({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}))}}])&&Br(e.prototype,r),n&&Br(e,n),i}(Lr);function Zr(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,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $r=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},Jr=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zr(Object(r),!0).forEach((function(e){Wr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zr(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,C=e.sts,T=$r(P),R=$r(k),E=p&&"#".concat(p),x=y&&"#".concat(y),D=[],_=0;_<(C||[]).length;_+=1){var A=C[_],I=A.sid,L=A.n,M=A.p,V=A.at,U=A.dt,F=A.ap,q=A.dp,B=A.ad,H=A.dd,K=A.dot,N=A.put,z=A.c,G=A.wa;D.push({stationId:I,stationName:L,coordinates:M,arrivalTime:-1!==V?1e3*F:null,departureTime:-1!==U?1e3*q:null,arrivalDelay:B,departureDelay:H,noDropOff:!!K,noPickUp:!!N,cancelled:!!z,wheelchairAccessible:!!G})}return{id:r,destination:n,backgroundColor:E,color:x,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:D,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:T,additionalOperatingDays:R},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},Qr=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 wr.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,C=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:C})}return e};function Yr(t){return(Yr="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 Xr(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 tn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xr(Object(r),!0).forEach((function(e){en(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function en(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nn(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 on(t,e){return(on=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function cn(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=un(t);if(e){var o=un(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return an(this,r)}}function an(t,e){return!e||"object"!==Yr(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 un(t){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var sn=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&&on(t,e)}(i,t);var e,r,n,o=cn(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rn(this,i),o.call(this,tn({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 Qr(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 Jr(t)}))}}])&&nn(e.prototype,r),n&&nn(e,n),i}(Lr);function ln(t){return function(t){if(Array.isArray(t))return fn(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 fn(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 fn(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 fn(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 pn(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 yn=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.connect(e),this.isSUBAllow=!1,this.isDELAllow=!1,setInterval((function(){r.send("PING")}),1e4),this.subscribed={}}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),ln(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)})),this.currentBbox&&this.setBbox(this.currentBbox),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:"setProjection",value:function(t){this.currentProj=t,this.send("PROJECTION ".concat(t))}},{key:"setBbox",value:function(t){this.currentBbox=t,this.send("BBOX ".concat(t.join(" ")))}},{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]||(this.send("GET ".concat(u)),this.isSUBAllow&&this.send("SUB ".concat(u)),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t&&(!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))})),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}))&&(this.isDELAllow&&this.send("DEL ".concat(t)),this.subscribed[t]=!1)}}])&&pn(e.prototype,r),n&&pn(e,n),t}(),hn=function(t,e){return t===e.SCHEMATIC?"_schematic":""},bn=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},vn=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 dn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mn(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 gn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},On=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};dn(this,t);var r=null;r="string"==typeof e?e:e.url,e.apiKey&&(r="".concat(r,"?key=").concat(e.apiKey)),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=e.prefix||"",this.isUpdateBboxOnMoveEnd=e.isUpdateBboxOnMoveEnd||!1,this.conn=new yn(r),this.conn.isSUBAllow=!this.isUpdateBboxOnMoveEnd,this.conn.isDELAllow=!this.isUpdateBboxOnMoveEnd,this.isUpdateBboxOnMoveEnd||(this.conn.setProjection(e.projection||"epsg:3857"),e.bbox&&this.conn.setBbox(e.bbox))}var e,r,n;return e=t,(r=[{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(hn(gn.SCHEMATIC,gn)).concat(e),r),this.conn.unsubscribe("".concat(t).concat(hn(gn.TOPOGRAPHIC,gn)).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 bn(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(hn(e,gn)),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(hn(t,gn))};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(hn(t,gn)),(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(hn(t,gn)),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(hn(t,gn)),e)}},{key:"unsubscribeDeletedVehicles",value:function(t){this.unsubscribe("deleted_vehicles","",t)}},{key:"getFullTrajectory",value:function(t,e){var r=this,n={channel:"full_trajectory".concat(hn(e,gn),"_").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(hn(e,gn),"_").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 vn(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 vn(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")}}])&&mn(e.prototype,r),n&&mn(e,n),t}();function jn(t){return(jn="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 wn(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 Pn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wn(Object(r),!0).forEach((function(e){kn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function kn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sn(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 Cn(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 Cn(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 Cn(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 Tn(t,e,r){return(Tn="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=Dn(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 Rn(t,e){return(Rn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function En(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=Dn(t);if(e){var o=Dn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return xn(this,r)}}function xn(t,e){return!e||"object"!==jn(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 Dn(t){return(Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function An(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 In(t,e,r){return e&&An(t.prototype,e),r&&An(t,r),t}var Ln=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&&Rn(t,e)}(r,t);var e=En(r);function r(){return _n(this,r),e.apply(this,arguments)}return In(r,[{key:"defineProperties",value:function(t){var e=this;Tn(Dn(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 sn(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){Tn(Dn(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(),Tn(Dn(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Tn(Dn(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(t,e,n){var o=Sn(t,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Tn(Dn(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=Sn(t,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Tn(Dn(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:kr(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:kr(new Date)}))];Promise.all(n).then((function(e){var r=Sn(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=Pn(Pn({},t),{},{btime:kr(n),etime:kr(this.later),date:Pr(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 C=Math.max(b,10*this.pixelRatio),T=pe(P,O,o,C);this.useDelayStyle&&null===u&&"yes"===l&&(P.save(),P.textBaseline="middle",P.textAlign="center",P.font="bold ".concat(T+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(T,"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 Mn(t){return(Mn="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 Vn(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 Un(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Vn(Object(r),!0).forEach((function(e){Fn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Fn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bn(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 Hn(t,e,r){return(Hn="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=Gn(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 Kn(t,e){return(Kn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Nn(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=Gn(t);if(e){var o=Gn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zn(this,r)}}function zn(t,e){return!e||"object"!==Mn(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 Gn(t){return(Gn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Zn=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&&Kn(t,e)}(i,t);var e,r,n,o=Nn(i);function i(){return qn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"start",value:function(){var t=this;this.map&&(Hn(Gn(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),Hn(Gn(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 wr.MultiPoint(t.map((function(t){return Object(Kt.fromLonLat)(t)}))),i=new Me.a(o);i.setStyle(new xe.Style({zIndex:1,image:new xe.Circle({radius:5,fill:new xe.Fill({color:"#000000"})})}));var c=new Me.a(o);c.setStyle(new xe.Style({zIndex:4,image:new xe.Circle({radius:4,fill:new xe.Fill({color:r})})})),n.addFeatures([i,c])}if(e){var a=new Me.a({geometry:new wr.LineString(e)});a.setStyle([new xe.Style({zIndex:2,stroke:new xe.Stroke({color:"#000000",width:6})}),new xe.Style({zIndex:3,stroke:new xe.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(Ie.buffer)(e,Object(Ie.getWidth)(e)/10).join(","),n=this.map.getView().getZoom();return Hn(Gn(i.prototype),"getParams",this).call(this,Un(Un({},t),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(t){return new i(Un(Un({},this.options),t))}}])&&Bn(e.prototype,r),n&&Bn(e,n),i}(Ln(jr)),Wn=r(24),$n=r.n(Wn);function Jn(t){return(Jn="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 Qn(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 Yn(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 Yn(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 Yn(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 Xn(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 to(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xn(Object(r),!0).forEach((function(e){eo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function eo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ro(t,e,r){return(ro="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=ao(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 no(t,e){return(no=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function oo(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=ao(t);if(e){var o=ao(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return io(this,r)}}function io(t,e){return!e||"object"!==Jn(e)&&"function"!=typeof e?co(t):e}function co(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ao(t){return(ao=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function so(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 lo(t,e,r){return e&&so(t.prototype,e),r&&so(t,r),t}var fo=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&&no(t,e)}(r,t);var e=oo(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return uo(this,r),(t=e.call(this,to({},n))).debug=n.debug,t.mode=n.mode||gn.TOPOGRAPHIC,t.onMessage=t.onMessage.bind(co(t)),t.onDeleteMessage=t.onDeleteMessage.bind(co(t)),t.api=n.api||new On(n),t.format=new $t.a,t.isUpdateBboxOnMoveEnd=n.isUpdateBboxOnMoveEnd||!1,t}return lo(r,[{key:"start",value:function(){ro(ao(r.prototype),"start",this).call(this),this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage)}},{key:"stop",value:function(){ro(ao(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteMessage)}},{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:"onFeatureHover",value:function(t,e,n){var o=Qn(t,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),ro(ao(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=Qn(t,1)[0];o?(this.selectedVehicleId=o.get("train_id"),this.highlightTrajectory()):this.selectedVehicleId=null,ro(ao(r.prototype),"onFeatureClick",this).call(this,t,e,n)}},{key:"onMessage",value:function(t){if(t.content&&!t.content.properties.mot){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===gn.TOPOGRAPHIC&&e.get("raw_coordinates")){var r=new $n.a(e.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),e.setGeometry(r)}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,e=[this.api.getStopSequence(this.selectedVehicleId,this.mode),this.api.getFullTrajectory(this.selectedVehicleId,this.mode)];return Promise.all(e).then((function(e){var r=Qn(e,2),n=r[0],o=r[1];return console.log("stopSequence for ".concat(t.selectedVehicleId,":"),n),console.log("fullTrajectory for ".concat(t.selectedVehicleId,":"),o),{stopSequence:n,fullTrajectory:o}}))}},{key:"addTrajectory",value:function(t,e,r){var n=this.trajectories.findIndex((function(e){return e.train_id===t})),o=e.time_intervals,i=to(to({},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 yo(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 ho(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yo(Object(r),!0).forEach((function(e){bo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yo(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 vo(t){return function(t){if(Array.isArray(t))return mo(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 mo(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 mo(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 mo(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 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(jo="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=So(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 wo(t,e){return(wo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Po(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=So(t);if(e){var o=So(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ko(this,r)}}function ko(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 So(t){return(So=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Co=new $t.a,To=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&&wo(t,e)}(i,t);var e,r,n,o=Po(i);function i(){return go(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"onMoveEnd",value:function(t){jo(So(i.prototype),"onMoveEnd",this).call(this,t),this.isUpdateBboxOnMoveEnd&&this.api.conn.setBbox([].concat(vo(this.map.getView().calculateExtent()),[Math.floor(this.map.getView().getZoom())])),this.selectedVehicleId&&this.highlightTrajectory()}},{key:"highlightTrajectory",value:function(){var t=this;jo(So(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 wr.MultiPoint(t.stations.map((function(t){return t.coordinate}))),r=new Me.a(e);r.setStyle(new xe.Style({zIndex:1,image:new xe.Circle({radius:5,fill:new xe.Fill({color:"#000000"})})}));var n=new Me.a(e);n.setStyle(new xe.Style({zIndex:4,image:new xe.Circle({radius:4,fill:new xe.Fill({color:i})})})),o.addFeatures([r,n])}})),n){var s=[new xe.Style({zIndex:2,stroke:new xe.Stroke({color:"#000000",width:6})}),new xe.Style({zIndex:3,stroke:new xe.Stroke({color:i,width:4})})],l=Co.readFeatures(n);l.forEach((function(t){t.setStyle(s)})),t.vectorLayer.getSource().addFeatures(l)}}))}},{key:"clone",value:function(t){return new i(ho(ho({},this.options),t))}}])&&Oo(e.prototype,r),n&&Oo(e,n),i}(fo(jr));function Ro(t){return(Ro="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 Eo(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 xo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Eo(Object(r),!0).forEach((function(e){Do(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Eo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Do(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ao(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 Io(t,e){return(Io=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Lo(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=Vo(t);if(e){var o=Vo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Mo(this,r)}}function Mo(t,e){return!e||"object"!==Ro(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 Vo(t){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uo=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&&Io(t,e)}(i,t);var e,r,n,o=Lo(i);function i(){return _o(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(xo(xo({},this.options),t))}}])&&Ao(e.prototype,r),n&&Ao(e,n),i}(A);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 qo(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 Bo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qo(Object(r),!0).forEach((function(e){Ho(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ho(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ko(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function No(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 zo(t,e){return(zo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Go(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=Wo(t);if(e){var o=Wo(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 Wo(t){return(Wo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $o=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&&zo(t,e)}(i,t);var e,r,n,o=Go(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ko(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(Bo(Bo({},this.options),t))}}])&&No(e.prototype,r),n&&No(e,n),i}(A);r(15),r(25),r(26),r(17);function Jo(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 Qo(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 Yo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qo(Object(r),!0).forEach((function(e){Xo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Xo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ti(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ei(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=ni(t);if(e){var o=ni(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return ri(this,r)}}function ri(t,e){return!e||"object"!==Jo(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 ni(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ii(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 e&&ii(t.prototype,e),r&&ii(t,r),t}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 ui(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function si(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 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"!==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 yi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}hi=G;var hi;function bi(t){return(bi="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 vi(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 di(t,e,r){return(di="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=wi(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 mi(t,e){return(mi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gi(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=wi(t);if(e){var o=wi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Oi(this,r)}}function Oi(t,e){return!e||"object"!==bi(e)&&"function"!=typeof e?ji(t):e}function ji(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wi(t){return(wi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pi=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&&mi(t,e)}(i,t);var e,r,n,o=gi(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(ji(e)),e}return e=i,(r=[{key:"activate",value:function(){di(wi(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)),di(wi(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return re(this.map)}}])&&vi(e.prototype,r),n&&vi(e,n),i}(vt(G));function ki(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 Si(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 Ci(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Si(Object(r),!0).forEach((function(e){Ti(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Si(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ti(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ri(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,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!==Ai(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(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Di(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=Ai(t);if(e){var o=Ai(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return _i(this,r)}}function _i(t,e){return!e||"object"!==ki(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 Ai(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}it(Nt.Map);var Ii=r(18),Li=r.n(Ii),Mi=r(19);function Vi(t){return(Vi="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 Ui(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 Fi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ui(Object(r),!0).forEach((function(e){qi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ui(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function qi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hi(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 Ki(t,e,r){return(Ki="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=Zi(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 Ni(t,e){return(Ni=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zi(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=Zi(t);if(e){var o=Zi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gi(this,r)}}function Gi(t,e){return!e||"object"!==Vi(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 Zi(t){return(Zi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(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}var Ji=function(t){var e=t.getBounds().toArray(),r=Object(Kt.fromLonLat)(e[0]),n=Object(Kt.fromLonLat)(e[1]),o=[].concat(Wi(r),Wi(n)),i=t.getCanvas(),c=i.width,a=i.height,u=Object(Ie.getWidth)(o)/c,s=Object(Ie.getHeight)(o)/a;return Math.max(u,s)},Qi=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 Yi(t){return(Yi="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 Xi(t){return function(t){if(Array.isArray(t))return tc(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 tc(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 tc(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 tc(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 ec(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 rc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ec(Object(r),!0).forEach((function(e){nc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ec(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function nc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ic(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 cc(t,e,r){return(cc="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=fc(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 ac(t,e){return(ac=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function uc(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=fc(t);if(e){var o=fc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sc(this,r)}}function sc(t,e){return!e||"object"!==Yi(e)&&"function"!=typeof e?lc(t):e}function lc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fc(t){return(fc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pc=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&&ac(t,e)}(i,t);var e,r,n,o=uc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return oc(this,i),(t=o.call(this,rc({},e))).onMove=t.onMove.bind(lc(t)),t.onMoveEnd=t.onMoveEnd.bind(lc(t)),t.onZoomEnd=t.onZoomEnd.bind(lc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(lc(t)),t}return e=i,(r=[{key:"init",value:function(t,e){if(t){var r=t.getCanvas();cc(fc(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:Qi(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)),cc(fc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){cc(fc(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(){cc(fc(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){cc(fc(i.prototype),"onUserClickCallback",this).call(this,rc({coordinate:Object(Kt.fromLonLat)(t.lngLat.toArray())},t))}},{key:"onUserMoveCallback",value:function(t){cc(fc(i.prototype),"onUserMoveCallback",this).call(this,rc({coordinate:Object(Kt.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=Li()(Object(Mi.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=Li()(Object(Mi.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(Xi(Object(Kt.fromLonLat)(u)),Xi(Object(Kt.fromLonLat)(s))),f=Object(Ie.getWidth)(l)/(r/this.pixelRatio),p=Object(Ie.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Kt.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};cc(fc(i.prototype),"renderTrajectories",this).call(this,h,t)}},{key:"getRefreshTimeInMs",value:function(){return cc(fc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=Ji(this.map);return cc(fc(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=Ji(this.map);return cc(fc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,{resolution: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=Qi(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){cc(fc(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getCanvasContainer().style.cursor=t.length?"pointer":"auto"}}])&&ic(e.prototype,r),n&&ic(e,n),i}(sr(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&&Ni(t,e)}(i,t);var e,r,n,o=zi(i);function i(){return Bi(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"init",value:function(t){Ki(Zi(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)),Ki(Zi(i.prototype),"terminate",this).call(this,t)}},{key:"onUserClickCallback",value:function(t){Ki(Zi(i.prototype),"onUserClickCallback",this).call(this,Fi({coordinate:t.lngLat.toArray()},t))}},{key:"onUserMoveCallback",value:function(t){Ki(Zi(i.prototype),"onUserMoveCallback",this).call(this,Fi({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:"clone",value:function(t){return new i(Fi(Fi({},this.options),t))}}])&&Hi(e.prototype,r),n&&Hi(e,n),i}(w)));function yc(t){return(yc="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 hc(t){return function(t){if(Array.isArray(t))return bc(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 bc(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 bc(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 bc(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 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=wc(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=wc(t);if(e){var o=wc(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"!==yc(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 wc(t){return(wc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pc=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(){return vc(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"onMoveEnd",value:function(t){if(mc(wc(i.prototype),"onMoveEnd",this).call(this,t),this.isUpdateBboxOnMoveEnd){var e=this.map.getBounds().toArray();this.api.conn.setBbox([].concat(hc(Object(Kt.transformExtent)([].concat(hc(e[0]),hc(e[1])),"EPSG:4326","EPSG:3857")),[Math.floor(this.map.getZoom()+1)]))}}}])&&dc(e.prototype,r),n&&dc(e,n),i}(fo(pc));function kc(t){return(kc="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 Sc(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 Tc(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 Rc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Tc(Object(r),!0).forEach((function(e){Ec(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ec(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xc(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 _c(t,e,r){return(_c="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=Vc(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 Ac(t,e){return(Ac=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ic(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=Vc(t);if(e){var o=Vc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lc(this,r)}}function Lc(t,e){return!e||"object"!==kc(e)&&"function"!=typeof e?Mc(t):e}function Mc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vc(t){return(Vc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uc={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&&Ac(t,e)}(i,t);var e,r,n,o=Ic(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xc(this,i),(t=o.call(this,Rc({},e))).onMove=t.onMove.bind(Mc(t)),t.onMoveEnd=t.onMoveEnd.bind(Mc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(Mc(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)),_c(Vc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(_c(Vc(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)),_c(Vc(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(Kt.fromLonLat)(e[0]),n=Object(Kt.fromLonLat)(e[1]),o=[].concat(Sc(r),Sc(n)),c=Object(Ie.buffer)(o,Object(Ie.getWidth)(o)/10).join(","),a=this.map.getZoom();return _c(Vc(i.prototype),"getParams",this).call(this,Rc(Rc({},t),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(t,e,r){console.log("to be implemented")}}])&&Dc(e.prototype,r),n&&Dc(e,n),i}(Ln(pc)),TralisLayer:Pc},ol:{Map:Ht,Layer:A,WMSLayer:$o,MapboxLayer:Ee,TrajservLayer:Zn,TralisLayer:To,VectorLayer:Uo}};e.default=Uc}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|