mobility-toolbox-js 1.7.10-beta.1 → 2.0.0-beta.1
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/README.md +2 -0
- package/common/utils/simpleTrackerStyle.js +13 -17
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/mapbox/Map.js +1 -1
- package/mapbox/layers/Layer.test.js +2 -2
- package/mapbox/layers/TrackerLayer.test.js +2 -2
- package/mapbox/layers/TrajservLayer.test.js +2 -2
- package/ol/layers/MapboxLayer.js +1 -1
- package/ol/layers/MapboxLayer.test.js +2 -2
- package/ol/layers/MapboxStyleLayer.test.js +2 -2
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],t):"object"==typeof exports?exports["mobility-toolbox-js"]=t():e["mobility-toolbox-js"]=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=28)}([function(e,t){e.exports=require("ol/proj")},function(e,t){e.exports=require("ol/style")},function(e,t){e.exports=require("ol/extent")},function(e,t){e.exports=require("ol/Observable")},function(e,t){e.exports=require("ol/geom")},function(e,t){e.exports=require("ol/format/GeoJSON")},function(e,t){e.exports=require("query-string")},function(e,t){e.exports=require("ol/layer")},function(e,t){e.exports=require("ol/transform")},function(e,t){e.exports=require("ol/Object")},function(e,t){e.exports=require("ol/layer/Layer")},function(e,t){e.exports=require("mapbox-gl")},function(e,t){e.exports=require("ol/source/Source")},function(e,t){e.exports=require("ol/source")},function(e,t){e.exports=require("ol/Feature")},function(e,t){e.exports=require("ol")},function(e,t){e.exports=require("lodash.debounce")},function(e,t){e.exports=require("lodash.throttle")},function(e,t){e.exports=require("ol/geom/GeometryType")},function(e,t){e.exports=require("ol/format")},function(e,t){e.exports=require("@turf/transform-rotate")},function(e,t){e.exports=require("@turf/helpers")},function(e,t){e.exports=require("ol/Map")},function(e,t){e.exports=require("ol/control")},function(e,t){e.exports=require("ol/layer/Group")},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("ol/interaction")},function(e,t){e.exports=require("ol/events/condition")},function(e,t,r){e.exports=r(30)},function(e,t){e.exports=require("ol/geom/Point")},function(e,t,r){"use strict";r.r(t);var n=r(22),o=r.n(n),i=r(23),c=r(3),a=r.n(c),u=r(24),l=r.n(u),s=r(25);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(i,e);var t,r,n,o=m(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(e=o.call(this)).defineProperties(t);var r=t.onClick,n=t.onHover;return n&&e.onHover(n),r&&e.onClick(r),t.copyrights&&(e.copyrights=t.copyrights),e.onUserClickCallback=e.onUserClickCallback.bind(O(e)),e.onUserMoveCallback=e.onUserMoveCallback.bind(O(e)),e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},e),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,l=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(s.v4)(),v=n||b;Object.defineProperties(this,{options:{value:e},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!l},isClickActive:{value:!!l&&!!f},isHoverActive:{value:!!l&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return t.get("copyrights")},set:function(e){var r=Array.isArray(e)?e:[e];t.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(e){this.terminate(),this.map=e}},{key:"terminate",value:function(){}},{key:"get",value:function(e){return this.properties[e]}},{key:"set",value:function(e,t){this.properties[e]=t,this.dispatchEvent({type:"change:".concat(e),target:this})}},{key:"setVisible",value:function(e){var t=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];e!==this.visible&&(this.visible=e,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:t,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(e){return e.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(e){return!!this.children.find((function(t){return t.visible===e}))}},{key:"addChild",value:function(e){this.children.unshift(e),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(e){for(var t=0;t<this.children.length;t+=1)if(this.children[t].name===e){this.children.splice(t,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:e})}},{key:"onClick",value:function(e){if("function"!=typeof e)throw new Error("onClick callback must be of type function:",e);this.clickCallbacks.includes(e)||this.clickCallbacks.push(e)}},{key:"unClick",value:function(e){if("function"==typeof e){var t=this.clickCallbacks.indexOf(e);t>-1&&this.clickCallbacks.splice(t,1)}}},{key:"onUserClickCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.clickCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(e){if("function"!=typeof e)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(e)||this.hoverCallbacks.push(e)}},{key:"unHover",value:function(e){if("function"==typeof e){var t=this.hoverCallbacks.indexOf(e);t>-1&&this.hoverCallbacks.splice(t,1)}}},{key:"onUserMoveCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.hoverCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}}])&&v(t.prototype,r),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(a.a);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){T(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(){return(E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=R(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function R(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=I(e);if(t){var o=I(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(i,e);var t,r,n,o=_(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).olLayer&&t.olLayer.setVisible(t.visible),t}return t=i,(r=[{key:"defineProperties",value:function(e){E(I(i.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{olLayer:{value:e.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(e){var t=this;if(E(I(i.prototype),"init",this).call(this,e),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(e){e.element===t.olLayer&&t.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 l.a?this.olLayer.getLayers().getArray().forEach((function(e){e.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),E(I(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(e){var t=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];e!==this.visible&&(E(I(i.prototype),"setVisible",this).call(this,e,t,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var e=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(t){var r=e.olListenersKeys.indexOf(t);r>-1&&e.olListenersKeys.splice(r,1),Object(c.unByKey)([e.isHoverListenerKey,e.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(e){return new i(S(S({},this.options),e))}}])&&C(t.prototype,r),n&&C(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w),M=r(9),L=r.n(M);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var o=Z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return z(this,r)}}function z(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(i,e);var t,r,n,o=K(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(e=o.call(this,t)).defineProperties(t);var r=F({active:!1!==t.active},t),n=r.active;return e.active=n,e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=F({},e),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return t.get("active")},set:function(e){t.set("active",e),e?t.activate():t.deactivate(),t.render()}},map:{get:function(){return t.get("map")},set:function(e){if(t.map&&t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.deactivate(),t.set("map",e),t.map){var r=t.target||t.map.getContainer();t.element||t.createDefaultElement(),t.element&&r.appendChild(t.element),t.active&&t.activate()}t.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(){}}])&&N(t.prototype,r),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(){return(X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Y(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ne(e);if(t){var o=ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return re(this,r)}}function re(e,t){if(t&&("object"===W(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ce(e,t,r){return t&&ie(e.prototype,t),r&&ie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ae=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(r,e);var t=te(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return oe(this,r),(e=t.call(this,J(J({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],e.mobilityControls=[],(n.controls||[]).forEach((function(t){e.addControl(t)})),(n.layers||[]).forEach((function(t){e.addLayer(t)})),e}return ce(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(e){this.mobilityControls.push(e),e.map=this}},{key:"removeMobilityControl",value:function(e){e.map=null,this.mobilityControls=this.mobilityControls.filter((function(t){return t!==e}))}},{key:"addControl",value:function(e,t){e instanceof G?this.addMobilityControl(e):X(ne(r.prototype),"addControl",this).call(this,e,t)}},{key:"removeControl",value:function(e){e instanceof G?this.removeMobilityControl(e):X(ne(r.prototype),"removeControl",this).call(this,e)}}]),r}(e)},ue=r(10),le=r.n(ue);function se(e){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=he(e);if(t){var o=he(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ye(this,r)}}function ye(e,t){if(t&&("object"===se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function de(e,t,r){return t&&ve(e.prototype,t),r&&ve(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var me=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fe(e,t)}(r,e);var t=pe(r);function r(){return be(this,r),t.apply(this,arguments)}return de(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}(e)};function ge(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oe(e,t)}(e)||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 Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var je=function(e){var t=e.filter((function(e){return null!=e&&e.trim&&e.trim()})),r=t.map((function(e){return e.toLowerCase()}));return ge(new Set(r)).map((function(e){return t.find((function(t){return t.toLowerCase()===e}))}))};function we(e){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ke(){return(ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Se(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Se(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=xe(e)););return e}function Te(e,t){return(Te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=xe(e);if(t){var o=xe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ee(this,r)}}function Ee(e,t){if(t&&("object"===we(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Re(e)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}(i,e);var t,r,n,o=Ce(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).onPostRender=t.onPostRender.bind(Re(t)),t}return t=i,(r=[{key:"getCopyrights",value:function(){var e=this;if(!this.frameState)return[];var t=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ue.inView)(r,e.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(t=t.concat(n.getSource().getAttributions()(e.frameState)))})),je(t)}},{key:"activate",value:function(){ke(xe(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),ke(xe(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(e){this.map&&this.element&&(this.frameState=e.frameState,this.render())}}])&&Pe(t.prototype,r),n&&Pe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ie(e){return function(e){if(Array.isArray(e))return Ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ae(e,t)}(e)||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 Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){Be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ve(){return(Ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=qe(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function qe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ze(e)););return e}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ze(e);if(t){var o=ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ke(this,r)}}function Ke(e,t){if(t&&("object"===De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ze(e){return(ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ze=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}(c,e);var t,r,n,o=He(c);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ue(this,c),o.call(this,Le({controls:[].concat(Ie(Object(i.defaults)({attribution:!1}).getArray()),[new _e])},e))}return t=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(e){e instanceof A?(e.init(this),this.mobilityLayers.push(e),e.olLayer&&Ve(ze(c.prototype),"addLayer",this).call(this,e.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Ve(ze(c.prototype),"addLayer",this).call(this,e)}},{key:"removeLayer",value:function(e){e instanceof A?(e.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(t){return t!==e})),e.olLayer&&Ve(ze(c.prototype),"removeLayer",this).call(this,e)):Ve(ze(c.prototype),"removeLayer",this).call(this,e)}},{key:"addControl",value:function(e){Ve(ze(c.prototype),"addControl",this).call(this,e)}},{key:"removeControl",value:function(e){Ve(ze(c.prototype),"removeControl",this).call(this,e)}}])&&Fe(t.prototype,r),n&&Fe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(ae(o.a)),Ge=r(0),We=r(11),$e=r.n(We),Je=r(12),Qe=r.n(Je),Xe=r(5),Ye=r.n(Xe),et=r(6),tt=r.n(et);function rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(r),!0).forEach((function(t){ot(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var it=function(e,t,r){if(!1===e)return r;var n=tt.a.parseUrl(r);return!e&&n.query[t]?r:e?tt.a.stringifyUrl(nt(nt({},n),{},{query:nt(nt({},n.query),{},ot({},t,e))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},ct=function(e){if(!e||!e.style)return[];var t=e.style.sourceCaches,r=[];return Object.values(t).forEach((function(e){if(e.used){var t=e.getSource(),n=t.attribution||t.options&&t.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),je(r)},at={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]},ut=[/^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],lt=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],st=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ft=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],pt=function(e){return"string"==typeof e?ut.findIndex((function(t){return t.test(e)})):e},yt=function(e,t){try{var r=pt(e||0);return at[r][t]}catch(e){return 1}},ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return lt[t]}catch(e){return 1}},bt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return st[t]}catch(e){return 1}},vt=function(e,t,r,n){e.font="bold ".concat(n,"px Arial");for(var o=e.measureText(r),i=0;o.width>t-6&&i<25;)n-=.5,e.font="bold ".concat(n,"px arial, sans-serif"),o=e.measureText(r),i+=1;return n},dt=function(e,t,r){return t?r?"#ff0000":"#a0a0a0":e>=36e5?"#ed004c":e>=5e5?"#e80000":e>=3e5?"#ff4a00":e>=18e4?"#f7bf00":null===e?"#a0a0a0":"#00a00c"},mt=function(e,t){if(t)return String.fromCodePoint(215);if(e>36e5){var r=Math.round(e/36e5);return"+".concat(r,"h")}if(e>59e3){var n=Math.round(e/6e4);return"+".concat(n,"m")}return e>0?"+".concat(e,"s"):""},gt=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},Ot={},jt={},wt={},Pt={},kt={},St=function(e,t,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=t.zoom,l=t.pixelRatio,s=e.properties,f=s.line,p=s.type,y=e.properties,h=y.train_id,b=y.delay,v=y.cancelled,d=void 0!==v&&v,m=y.operator_provides_realtime_journey;p||(p="Rail"),f||(f={});var g=f,O=g.name,j=g.text_color,w=g.color;O||(O="I"),j||(j="#000000"),w&&"#"!==w[0]&&(w="#".concat(w)),"#"!==j[0]&&(j="#".concat(j));var P=Math.min(Math.floor(u||1),16),k=n&&n===h,S=o&&o===h,T=yt(p,P)*l,C=T>=7*l;(k||S)&&(T=C?T+5*l:14*l);var E=T>10*l,R="".concat(T).concat(p).concat(w).concat(k).concat(S).concat(d).concat(b);if(i&&(R+="".concat(m)),E&&(R+="".concat(O).concat(j)),!kt[R]){if(0===T)return kt[R]=null,null;var x,_=1*l,D=T+2,I=2*T,A=2*D+2*_+100*l,M=A/2,L=gt(A,A),B=L.getContext("2d");if(C&&null!==b){var U=function(e,t,r){var n="".concat(e,", ").concat(t,", ").concat(r);if(!Ot[n]){var o=gt(2*e,2*e),i=o.getContext("2d");i.beginPath(),i.arc(e,e,t,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),Ot[n]=o}return Ot[n]}(M,D,dt(b,d));B.drawImage(U,0,0)}if(C&&(k||b>=a||d)){var F=Math.max(d?19:14,Math.min(d?19:17,1.2*T))*l,V=mt(b,d);if(V){var q=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!jt[a]){var u=gt(e,r+8*c),l=u.getContext("2d");l.textAlign="left",l.textBaseline="middle",l.font=n,l.fillStyle=o,l.strokeStyle=i,l.lineWidth=1.5*c;var s=t;l.strokeText(s,0,r),l.fillText(s,0,r),jt[a]=u}return jt[a]}(V.length*F,V,F,"bold ".concat(F,"px arial, sans-serif"),dt(b,d,!0),c,l);B.drawImage(q,M+D+_,M-F)}}var N=function(e,t,r,n,o,i){var c="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!wt[c]){var a=gt(2*e,2*e),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(e,e,t,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),wt[c]=a}return wt[c]}(M,T,x=i?dt(b,d):w||ht(p),C||k||S,C&&i&&null===b&&"yes"===m,l);if(B.drawImage(N,0,0),E){var H=Math.max(T,10),K=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!Pt[a]){var u=gt(2*t,2*t),l=u.getContext("2d");i&&(l.save(),l.textBaseline="middle",l.textAlign="center",l.font="bold ".concat(r+2,"px Arial"),l.strokeStyle=o,l.strokeText(e,t,t),l.restore()),l.textBaseline="middle",l.textAlign="center",l.fillStyle=n,l.font="bold ".concat(r,"px Arial"),l.strokeStyle=o,l.strokeText(e,t,t),l.fillText(e,t,t),Pt[a]=u}return Pt[a]}(O,M,vt(B,I,O,H),i?"#000000":j||bt(p),x,i&&null===b&&"yes"===m,l);B.drawImage(K,0,0)}kt[R]=L}return kt[R]},Tt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=(e.getUTCMonth()+1).toString();t=1===t.length?"0".concat(t):t;var r=e.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[e.getUTCFullYear(),t,r].join("")},Ct=function(e){return[e.getUTCHours(),e.getUTCMinutes(),"".concat(e.getUTCSeconds(),".").concat(e.getUTCMilliseconds())].join(":")};function Et(e){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(r),!0).forEach((function(t){It(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function It(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function At(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Lt(){return(Lt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Bt(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Bt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Nt(e)););return e}function Ut(e,t){return(Ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Nt(e);if(t){var o=Nt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vt(this,r)}}function Vt(e,t){if(t&&("object"===Et(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return qt(e)}function qt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nt(e){return(Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ht=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ut(e,t)}(i,e);var t,r,n,o=Ft(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};At(this,i);var r=new le.a({source:new Qe.a({}),render:function(t){if(!e.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=e.mbMap.getCanvas(),o=t.viewState,i=e.olLayer.getVisible();e.renderState.visible!==i&&(n.style.display=i?"block":"none",e.renderState.visible=i,n.style.position="absolute");var c=e.olLayer.getOpacity();e.renderState.opacity!==c&&(n.style.opacity=c,e.renderState.opacity=c);var a=o.rotation;e.renderState.rotation!==a&&(e.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,e.renderState.rotation=a),e.renderState.zoom===o.zoom&&e.renderState.center[0]===o.center[0]&&e.renderState.center[1]===o.center[1]||(e.mbMap.jumpTo({center:Object(Ge.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,e.renderState.zoom=o.zoom,e.renderState.center=o.center);var u=e.map.getSize();if(e.renderState.size[0]===u[0]&&e.renderState.size[1]===u[1]||(r=!0,e.renderState.size=u),e.mbMap&&e.mbMap.style&&e.mbMap.isStyleLoaded()&&r)try{e.mbMap._frame&&(e.mbMap._frame.cancel(),e.mbMap._frame=null),e.mbMap._render()}catch(e){console.warn(e)}return n}});return(e=o.call(this,Dt(Dt({},t),{},{olLayer:r}))).styleUrl=t.url,e.apiKey=t.apiKey,e.apiKeyName=t.apiKeyName||"key",e.updateAttribution=e.updateAttribution.bind(qt(e)),e}return t=i,(r=[{key:"init",value:function(e){var t=this;Lt(Nt(i.prototype),"init",this).call(this,e),this.map&&!this.mbMap&&(this.format=new Ye.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{t.mbMap&&t.mbMap.resize()}catch(e){console.warn(e)}}))))}},{key:"createStyleUrl",value:function(){return it(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var e=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){e.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var t=Rt(this.map.getView().getCenter(),2),r=t[0],n=t[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new $e.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ge.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(e){console.warn("Failed creating mapbox map: ",e)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){e.loaded=!0,e.copyrights=e.copyrights||ct(e.mbMap)||[],e.olLayer.getSource().setAttributions(e.copyrights),e.dispatchEvent({type:"load",target:e})}));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(){e.loadMbMap()})))}},{key:"updateAttribution",value:function(e){var t=this.copyrights||ct(e.target)||[];this.copyrights.toString()!==t.toString()&&this.olLayer.getSource().setAttributions(t)}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){var r=this;if(!(t&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:e,features:[],layer:this});var n=e&&this.mbMap.project(Object(Ge.toLonLat)(e));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,t).map((function(e){var t=r.format.readFeature(e);return t&&t.set("mapboxFeature",e),t}));return Promise.resolve({layer:this,features:a,coordinate:e})}},{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,Lt(Nt(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(e){return new i(Dt(Dt({},this.options),e))}}])&&Mt(t.prototype,r),n&&Mt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);var Kt=r(1),zt=r(13),Zt=r(7);var Gt=new Kt.Circle({radius:6,fill:new Kt.Fill({color:[255,0,0,1]}),stroke:new Kt.Stroke({color:[0,0,0,1],width:1})}),Wt=(new Kt.Style({stroke:new Kt.Stroke({color:[0,0,0,1],width:5})}),new Kt.Style({image:Gt,stroke:new Kt.Stroke({color:[255,0,0,1],width:3})}),new Kt.Style({image:Gt,stroke:new Kt.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(8)),$t=r(2),Jt=r(16),Qt=r.n(Jt),Xt=r(17),Yt=r.n(Xt),er=r(18),tr=r.n(er);function rr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var or=function(e,t,r){var n,o,i=t.properties,c=i.time_intervals,a=i.olGeometry,u=i.coordinate;if(r&&u)n=u;else if(a.getType()===tr.a.POINT)n=a.getCoordinates();else if(a.getType()===tr.a.LINE_STRING){var l=c||[[]],s=l[0],f=l[l.length-1];if(e<s[0])o=rr(s,3)[2],n=a.getFirstCoordinate();else if(e>f[0]){o=rr(f,3)[2],n=a.getLastCoordinate()}else for(var p=0;p<l.length-1;p+=1){var y=rr(l[p],2),h=y[0],b=y[1],v=rr(l[p+1],2),d=v[0],m=v[1];if(h<=e&&e<=d){var g=Math.min((e-h)/(d-h),1)*(m-b)+b;n=a.getCoordinateAt(g),o=rr(l[p],3)[2];break}}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",a);return{coord:n,rotation:o}};function ir(e){return function(e){if(Array.isArray(e))return ur(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ar(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||ar(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ar(e,t){if(e){if("string"==typeof e)return ur(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ur(e,t):void 0}}function ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var sr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.style=t.style,this.canvas=t.canvas||document.createElement("canvas")}var t,r,n;return t=e,(r=[{key:"renderTrajectories",value:function(e,t,r){var n=t.time,o=void 0===n?Date.now():n,i=t.size,c=void 0===i?[]:i,a=t.center,u=t.resolution,l=t.rotation,s=void 0===l?0:l,f=t.pixelRatio,p=r.noInterpolate,y=void 0!==p&&p,h=r.hoverVehicleId,b=r.selectedVehicleId,v=this.canvas,d=v.getContext("2d");d.clearRect(0,0,v.width,v.height);var m=cr(c,2),g=m[0],O=m[1];if(g&&O&&(v.width!==g||v.height!==O)){var j=[g*f,O*f];v.width=j[0],v.height=j[1]}var w,P,k,S,T,C,E,R,x=Object(Wt.compose)(Object(Wt.create)(),c[0]/2,c[1]/2,1/u,-1/u,-s,-a[0],-a[1]);v.style&&(v.style.width="".concat(v.width/f,"px"),v.style.height="".concat(v.height/f,"px"));for(var _=0,D=e.length-1;D>=0;D-=1){var I=e[D],A=I.properties,M=A.train_id,L=A.timeOffset,B=or(o-(L||0),I,y),U=B.coord,F=B.rotation;if(e[D].properties.coordinate=U,e[D].properties.rotation=F,U){var V=Object(Wt.apply)(x,ir(U));if(V&&!((V=V.map((function(e){return e*f})))[0]<0||V[0]>v.width||V[1]<0||V[1]>v.height)){var q=this.style(I,t,r);if(q){_+=1;var N=q.width,H=q.height;h!==M&&b!==M&&d.drawImage(q,V[0]-N/2,V[1]-H/2,N,H),h&&h===M&&(w=q,P=V,k=N,S=H),b&&b===M&&(T=q,C=V,E=N,R=H)}}}}return T&&d.drawImage(T,C[0]-E/2,C[1]-R/2,E,R),w&&d.drawImage(w,P[0]-k/2,P[1]-S/2,k,S),{nbTrajectoriesRendered:_}}}])&&lr(t.prototype,r),n&&lr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),fr=function(e,t,r,n){var o=[];if(!(e||t||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(e){var t=e.properties.name||e.properties.line&&e.properties.line.name||"";return!!t&&i.some((function(e){return new RegExp(e,"i").test(t)}))}))}if(e){var c=("string"==typeof e?e.split(","):e).map((function(e){return e.replace(/\s+/g,"").toUpperCase()}));o.push((function(e){var t=e.properties,r=t.line,n=(t.name||r&&r.name||"").toUpperCase();return!!n&&c.includes(n)}))}if(t){var a=("string"==typeof t?t.split(","):t).map((function(e){return parseInt(e,10)}));o.push((function(e){var t=parseInt(e.properties.routeIdentifier.split(".")[0],10);return a.includes(t)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(e){return u.some((function(t){return new RegExp(t,"i").test(e.properties.operator)}))}))}return o.length?function(e){for(var t=0;t<o.length;t+=1)if(!o[t](e))return!1;return!0}:null};function pr(e){return(pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||br(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hr(e){return function(e){if(Array.isArray(e))return vr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||br(e)||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 br(e,t){if(e){if("string"==typeof e)return vr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vr(e,t):void 0}}function vr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(r),!0).forEach((function(t){gr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Or(){return(Or="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=jr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function jr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Tr(e)););return e}function wr(e,t){return(wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Tr(e);if(t){var o=Tr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return kr(this,r)}}function kr(e,t){if(t&&("object"===pr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Sr(e)}function Sr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tr(e){return(Tr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Cr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Er(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Rr(e,t,r){return t&&Er(e.prototype,t),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var xr=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wr(e,t)}(r,e);var t=Pr(r);function r(e){var n;return Cr(this,r),(n=t.call(this,mr({hitTolerance:10},e))).onFeatureHover=n.onFeatureHover.bind(Sr(n)),n.onFeatureClick=n.onFeatureClick.bind(Sr(n)),n.renderTrajectoriesInternal=n.renderTrajectoriesInternal.bind(Sr(n)),n.throttleRenderTrajectories=Yt()(n.renderTrajectoriesInternal,50,{leading:!1,trailing:!0}),n.debounceRenderTrajectories=Qt()(n.renderTrajectoriesInternal,50,{leading:!0,trailing:!0,maxWait:5e3}),n}return Rr(r,[{key:"defineProperties",value:function(e){var t=this,n=e.regexPublishedLineName,o=e.publishedLineName,i=e.tripNumber,c=e.operator,a=e.style,u=e.speed,l=e.pixelRatio,s=e.hoverVehicleId,f=e.selectedVehicleId,p=e.filter,y=e.sort,h=e.time,b=e.live,v={style:a};Object.keys(v).forEach((function(e){return void 0===v[e]&&delete v[e]}));var d=u||1,m=h||new Date;Or(Tr(r.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:a||this.defaultStyle},speed:{get:function(){return d},set:function(e){d=e,t.start()}},filter:{value:p,writable:!0},sort:{value:y,writable:!0},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==b||b,writable:!0},time:{get:function(){return m},set:function(e){m=e&&e.getTime?e:new Date(e),t.renderTrajectories()}},trajectories:{value:{},writable:!0},renderedTrajectories:{get:function(){return t.tracker&&t.tracker.renderedTrajectories||[]}},hoverVehicleId:{value:s,writable:!0},selectedVehicleId:{value:f,writable:!0},pixelRatio:{value:l||window.devicePixelRatio||1,writable:!0},initTrackerOptions:{value:v,writable:!1},useRequestAnimationFrame:{value:e.useRequestAnimationFrame||!1,writable:!0},useThrottle:{value:e.useThrottle||!0,writable:!0},useDebounce:{value:e.useDebounce||!1,writable:!0},publishedLineName:{get:function(){return o},set:function(e){o=e,t.updateFilters()}},tripNumber:{get:function(){return i},set:function(e){i=e,t.updateFilters()}},operator:{get:function(){return c},set:function(e){c=e,t.updateFilters()}},regexPublishedLineName:{get:function(){return n},set:function(e){n=e,t.updateFilters()}},delayDisplay:{value:e.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:e.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:e.useDelayStyle||!1,writable:!0}}),this.useDelayStyle&&!this.sort&&(this.sort=function(e,t){var r=e.properties,n=t.properties;return null===r.delay&&null!==n.delay?1:null===n.delay&&null!==r.delay?-1:r.cancelled&&!n.cancelled?n.delay<18e4?-1:1:n.cancelled&&!r.cancelled?r.delay<18e4?1:-1:n.delay-r.delay}),this.updateFilters()}},{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Or(Tr(r.prototype),"init",this).call(this,e),this.tracker=new sr(mr(mr({style:function(){return t.style.apply(t,arguments)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(e){e.target.visible?t.start():t.stop()}))}},{key:"terminate",value:function(){if(this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker){var e=this.tracker.canvas;e.getContext("2d").clearRect(0,0,e.width,e.height),this.tracker=null}Or(Tr(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var e=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){e.time=e.live?new Date:e.time.getTime()+e.updateTimeDelay*e.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){if(this.stopUpdateTime(),this.tracker){var e=this.tracker.canvas;e.getContext("2d").clearRect(0,0,e.width,e.height)}}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(e,t){if(!this.tracker)return!1;var r=this.live?Date.now():this.time,n=Object.values(this.trajectories);return this.sort&&n.sort(this.sort),this.renderState=this.tracker.renderTrajectories(n,mr(mr({},e),{},{pixelRatio:this.pixelRatio,time:r}),{noInterpolate:e.zoom<this.minZoomInterpolation||t,hoverVehicleId:this.hoverVehicleId,selectedVehicleId:this.selectedVehicleId,iconScale:this.iconScale,delayDisplay:this.delayDisplay,delayOutlineColor:this.delayOutlineColor,useDelayStyle:this.useDelayStyle}),!0}},{key:"renderTrajectories",value:function(e,t){var r=this;this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null),!t&&this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(e,t)})):!t&&this.useDebounce?this.debounceRenderTrajectories(e,t):!t&&this.useThrottle?this.throttleRenderTrajectories(e,t):this.renderTrajectoriesInternal(e,t)}},{key:"getVehicle",value:function(e){return Object.values(this.trajectories).filter(e)}},{key:"getVehiclesAtCoordinate",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object($t.buffer)([].concat(hr(e),hr(e)),this.hitTolerance*t),o=Object.values(this.trajectories),i=[],c=0;c<o.length&&(o[c].properties.coordinate&&Object($t.containsCoordinate)(n,o[c].properties.coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.resolution,o=r.nb,i=this.getVehiclesAtCoordinate(e,n,o);return Promise.resolve({layer:this,features:i.map((function(e){return t.format.readFeature(e)})),coordinate:e})}},{key:"onZoomEnd",value:function(e){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(e){var t,r=Math.round(e),n=ft[r]||25,o=Math.max(25,n/this.speed),i=Math.min(o,500);if(this.useThrottle?this.throttleRenderTrajectories=Yt()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0}):this.useDebounce&&(this.debounceRenderTrajectories=Qt()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0,maxWait:5e3})),null!==(t=this.api)&&void 0!==t&&t.buffer){var c=yr(this.api.buffer,2)[1];this.api.buffer=[i,c]}return o}},{key:"updateFilters",value:function(){var e=tt.a.parse(window.location.search.toLowerCase()),t=this.publishedLineName||e.publishedlinename,r=this.tripNumber||e.tripnumber,n=this.operator||e.operator,o=this.regexPublishedLineName;(t||r||n||o)&&(this.filter=fr(t,r,n,o))}},{key:"defaultStyle",value:function(e,t){return St(e,t,this)}}]),r}(e)};function _r(e){return(_r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ir(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dr(Object(r),!0).forEach((function(t){Ar(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ar(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Br(){return(Br="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ur(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ur(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Nr(e)););return e}function Fr(e,t){return(Fr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Nr(e);if(t){var o=Nr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qr(this,r)}}function qr(e,t){if(t&&("object"===_r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Nr(e){return(Nr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fr(e,t)}(i,e);var t,r,n,o=Vr(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Mr(this,i),(e=o.call(this,Ir({},t))).olLayer=t.olLayer||new Zt.Group({layers:[new Zt.Vector({source:new zt.Vector({features:[]})}),new Zt.Layer({source:new Qe.a({}),render:function(t){if(!e.tracker||!e.tracker.canvas)return null;if(e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style.width="100%",e.container.style.height="100%",e.transformContainer=document.createElement("div"),e.transformContainer.style.position="absolute",e.transformContainer.style.width="100%",e.transformContainer.style.height="100%",e.container.appendChild(e.transformContainer),e.tracker.canvas.style.position="absolute",e.tracker.canvas.style.top="0",e.tracker.canvas.style.left="0",e.tracker.canvas.style.transformOrigin="top left",e.transformContainer.appendChild(e.tracker.canvas)),e.renderedViewState){var r=t.viewState,n=r.center,o=r.resolution,i=r.rotation,c=e.renderedViewState,a=c.center,u=c.resolution,l=c.rotation;if(u/o>=3){var s=e.tracker.canvas;s.getContext("2d").clearRect(0,0,s.width,s.height)}else{var f=e.map.getPixelFromCoordinate(a),p=e.map.getPixelFromCoordinate(n);e.transformContainer.style.transform=Object(Wt.composeCssTransform)(f[0]-p[0],f[1]-p[1],u/o,u/o,i-l,0,0)}}return e.container}})]}),e.vectorLayer=e.olLayer.getLayers().item(0),e.renderState={center:[0,0],zoom:null,rotation:0},e}return t=i,(r=[{key:"init",value:function(e){var t=this;Br(Nr(i.prototype),"init",this).call(this,e),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(e){var r=t.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();t.currentZoom!==n&&t.onZoomEnd(e),t.currentZoom=n,t.onMoveEnd(e)}})))}},{key:"terminate",value:function(){Br(Nr(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(e){if(this.map&&this.tracker&&this.tracker.canvas){var t=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(e);return!!t.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(e){var t=this.map.getView();Br(Nr(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:t.calculateExtent(),resolution:t.getResolution(),rotation:t.getRotation(),zoom:t.getZoom(),pixelRatio:this.pixelRatio},e)}},{key:"renderTrajectoriesInternal",value:function(e,t){!this.map.getView().getAnimating()&&!this.map.getView().getInteracting()&&Br(Nr(i.prototype),"renderTrajectoriesInternal",this).call(this,e,t)&&(this.renderedViewState=Ir({},e),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Br(Nr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=this.map.getView().getResolution();return Br(Nr(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(e))return Promise.resolve({features:[],layer:this,coordinate:e});var r=this.map.getView().getResolution();return Br(Nr(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Ir({resolution:r},t))}},{key:"onMoveEnd",value:function(e){}},{key:"onZoomEnd",value:function(e){Br(Nr(i.prototype),"onZoomEnd",this).call(this,e)}},{key:"onFeatureHover",value:function(e,t,r){Br(Nr(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getTargetElement().style.cursor=e.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(e,t,r){Br(Nr(i.prototype),"onFeatureClick",this).call(this,e,t,r),!e.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(e){return new i(Ir(Ir({},this.options),e))}}])&&Lr(t.prototype,r),n&&Lr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(xr(A)),Kr=r(14),zr=r.n(Kr),Zr=r(4);function Gr(e){return(Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wr(Object(r),!0).forEach((function(t){Jr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Yr(e,t){return(Yr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function en(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rn(e);if(t){var o=rn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tn(this,r)}}function tn(e,t){if(t&&("object"===Gr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rn(e){return(rn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yr(e,t)}(i,e);var t,r,n,o=en(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Qr(this,i),(e=o.call(this)).url=t.url,e.apiKey=t.apiKey,e}return t=i,(r=[{key:"fetch",value:function(e){function t(t,r,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r){var n=$r($r({},t||{}),{},{key:this.apiKey}),o=$r({},n);return Object.keys(n).forEach((function(e){return(void 0===o[e]||null===o[e])&&delete o[e]})),this.apiKey?fetch("".concat(this.url).concat(e||"","?").concat(tt.a.stringify(o)),r).then((function(e){try{return e.json().then((function(e){if(e.error)throw new Error(e.error);return e}))}catch(e){return Promise.reject(new Error(e))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&Xr(t.prototype,r),n&&Xr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function on(e){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(r),!0).forEach((function(t){un(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function un(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fn(e,t){return(fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hn(e);if(t){var o=hn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yn(this,r)}}function yn(e,t){if(t&&("object"===on(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function hn(e){return(hn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fn(e,t)}(i,e);var t,r,n,o=pn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ln(this,i),o.call(this,an({url:"https://api.geops.io/stops/v1/"},e))}return t=i,(r=[{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",e,{signal:t.signal}).then((function(e){return e.features}))}}])&&sn(t.prototype,r),n&&sn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(nn);function vn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var mn=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=n.d,i=n.m,c=n.y;t.push({day:o,month:i,year:c})}return t},gn=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(r),!0).forEach((function(t){dn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);["a","f","tt"].forEach((function(e){t[e]||(t[e]={})}));for(var r=t.id,n=t.hs,o=t.t,i=t.ln,c=t.sn,a=t.wa,u=t.ba,l=t.rt,s=t.fid,f=t.rid,p=t.c,y=t.tc,h=t.a,b=h.n,v=h.u,d=h.tz,m=t.f,g=m.n,O=m.u,j=m.tz,w=t.tt,P=w.n,k=w.p,S=w.t,T=t.sts,C=mn(P),E=mn(k),R=p&&"#".concat(p),x=y&&"#".concat(y),_=[],D=0;D<(T||[]).length;D+=1){var I=T[D],A=I.sid,M=I.n,L=I.p,B=I.at,U=I.dt,F=I.ap,V=I.dp,q=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;_.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==B?1e3*F:null,departureTime:-1!==U?1e3*V:null,arrivalDelay:q,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:R,color:x,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:_,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:l,feedsId:s,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:E},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},On=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=new Zr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,l=i.RouteIdentifier,s=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;t.push({id:c,type:a,name:u,routeIdentifier:l,directionText:s,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 t};function jn(e){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wn(Object(r),!0).forEach((function(t){kn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Cn(e,t){return(Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function En(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=xn(e);if(t){var o=xn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rn(this,r)}}function Rn(e,t){if(t&&("object"===jn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function xn(e){return(xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _n=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}(i,e);var t,r,n,o=En(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Sn(this,i),o.call(this,Pn({url:"https://api.geops.io/tracker/v1"},e))}return t=i,(r=[{key:"fetchTrajectoryById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",e,{signal:t.signal})}},{key:"fetchTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",e,{signal:t.signal}).then((function(e){return On(e.features)}))}},{key:"fetchTrajectoryStations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",e,{signal:t.signal}).then((function(e){return gn(e)}))}}])&&Tn(t.prototype,r),n&&Tn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(nn);function Dn(e){return function(e){if(Array.isArray(e))return In(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return In(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return In(e,t)}(e)||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 In(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function An(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Mn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defineProperties()}var t,r,n;return t=e,n=[{key:"getRequestString",value:function(e,t){var r="".concat(e," ").concat(t.channel);return r+=t.args?" ".concat(t.args):"",(r+=t.id?" ".concat(t.id):"").trim()}}],(r=[{key:"defineProperties",value:function(){var e=this;Object.defineProperties(this,{closed:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSED)}},closing:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSING)}},connecting:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CONNECTING)}},open:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.OPEN)}},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}},{key:"connect",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(e),this.open?(r(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(function(){r(),t.subscribePreviousSubscriptions()}))}},{key:"close",value:function(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}},{key:"send",value:function(e){var t=this;if(this.websocket){var r=function(){t.websocket.send(e)};this.open?this.messagesOnOpen.includes(e)||r():this.messagesOnOpen.includes(e)||(this.messagesOnOpen.push(e),this.websocket.addEventListener("open",(function(){t.messagesOnOpen=[],r()})),this.websocket.addEventListener("close",(function(){t.messagesOnOpen=[]})))}}},{key:"listen",value:function(e,t,r){this.unlisten(e,t);var n=function(r){var n={};try{n=JSON.parse(r.data)}catch(e){console.error("WebSocket: unable to parse JSON data",e,r.data)}var o=e.channel;o+=e.args?" ".concat(e.args):"",("buffer"===n.source?n.content:[n]).forEach((function(r){(null==r?void 0:r.source)!==o||e.id&&e.id!==n.client_reference||t(r)}))};return this.websocket&&(this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r))),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(e,t){var r=this;this.websocket&&this.subscriptions.filter((function(r){return r.params.channel===e.channel&&(!t||r.cb===t)})).forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))}))}},{key:"get",value:function(t,r,n){var o=e.getRequestString("GET",t);this.send(o),this.listen(t,r,n)}},{key:"subscribe",value:function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(t,r,n),c=i.onMessageCb,a=i.onErrorCb,u=e.getRequestString("",t),l=this.subscriptions.findIndex((function(e){return t.channel===e.params.channel&&r===e.cb})),s={params:t,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,quiet:o};l>-1?this.subscriptions[l]=s:this.subscriptions.push(s),this.subscribed[u]||(s.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(e,t){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===e&&(!t||r.cb===t)}));n.forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==e||t&&r.cb!==t})),e&&this.subscribed[e]&&!this.subscriptions.find((function(t){return t.params.channel===e}))&&n.find((function(e){return!e.quiet}))&&(this.send("DEL ".concat(e)),this.subscribed[e]=!1)}},{key:"subscribePreviousSubscriptions",value:function(){var e=this;Object.keys(this.subscribed).forEach((function(t){e.subscribed[t]=!1})),Dn(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)}))}}])&&An(t.prototype,r),n&&An(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Ln=function(e,t){return e===t.SCHEMATIC?"_schematic":""},Bn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=e.has_fzo&&n.indexOf(e.state)>-1,i=t.has_fzo&&n.indexOf(t.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(e.state!==t.state)return n.indexOf(e.state)-n.indexOf(t.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(e.min_arrival_time||e.time).getTime()-u,a=new Date(t.min_arrival_time||t.time).getTime()-u):(c=new Date(e.time).getTime()-u,a=new Date(t.time).getTime()-u),c-a},Un=function(e){if(e)return e.stations.forEach((function(e){e.arrivalTimeWithDelay=e.arrivalTime,e.departureTime&&(e.departureTimeWithDelay=e.departureTime),e.arrivalDelay&&(e.arrivalTime-=e.arrivalDelay,e.departureTime&&(e.departureTime-=e.arrivalDelay))})),e};function Fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var qn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},Nn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Fn(this,e),this.defineProperties(t),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=t.prefix||"",this.onOpen=this.onOpen.bind(this)}var t,r,n;return t=e,(r=[{key:"defineProperties",value:function(e){var t=this,r=e;"string"==typeof e&&(r={url:e});var n=r.apiKey,o=r,i=o.url,c=o.projection,a=o.bbox,u=o.buffer,l=void 0===u?[100,100]:u,s=new Mn;n&&(i="".concat(i||"wss://tralis-tracker-api.geops.io/ws","?key=").concat(n)),Object.defineProperties(this,{url:{get:function(){return i},set:function(e){i=e,t.open()}},projection:{get:function(){return c},set:function(e){e!==c&&(c=e,t.conn&&t.conn.send("PROJECTION ".concat(c)))}},bbox:{get:function(){return a},set:function(e){JSON.stringify(e)!==JSON.stringify(a)&&(a=e,t.conn&&t.conn.send("BBOX ".concat(a.join(" "))))}},buffer:{get:function(){return l},set:function(e){JSON.stringify(e)!==JSON.stringify(l)&&(l=e,t.conn&&t.conn.send("BUFFER ".concat(l.join(" "))))}},conn:{value:s,writable:!0},pingIntervalMs:{value:e.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:e.pingIntervalMs||100,writable:!0}})}},{key:"open",value:function(){var e=this;this.close(),this.conn.connect(this.url,this.onOpen),this.conn.websocket.onclose=function(){e.onClose()}}},{key:"close",value:function(){this.conn.close()}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"onOpen",value:function(){var e=this;this.projection&&this.conn.send("PROJECTION ".concat(this.projection)),this.bbox&&this.conn.send("BBOX ".concat(this.bbox.join(" "))),this.buffer&&this.conn.send("BUFFER ".concat(this.buffer.join(" "))),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval((function(){e.conn.send("PING")}),this.pingIntervalMs))}},{key:"onClose",value:function(){var e=this;window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((function(){return e.open()}),this.reconnectTimeoutMs))}},{key:"subscribe",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:e},t,r,n)}},{key:"unsubscribe",value:function(e,t,r){this.conn.unsubscribe("".concat(e).concat(Ln(qn.SCHEMATIC,qn)).concat(t),r),this.conn.unsubscribe("".concat(e).concat(Ln(qn.TOPOGRAPHIC,qn)).concat(t||""),r)}},{key:"filterDepartures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(e).map((function(t){return e[t]}));r.sort((function(e,r){return Bn(e,r,t)}));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 l=r[u],s=new Date(l.time).getTime();s>o&&s<n&&("BOARDING"===l.state&&(-1===c.indexOf(l.platform)?c.push(l.platform):l.state="HIDDEN"),a&&l.to[0]===a.to[0]&&Math.abs(s-a.time)<1e3&&l.line.name===a.line.name&&(l.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(l.state)&&(l.cancelled=!0),(a=l).time=s,i.unshift(l))}return i}},{key:"subscribeDepartures",value:function(e,t,r){var n=this;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=e;var o=e?"timetable_".concat(e):null,i={};this.subscribe(o,(function(e){if(e.source===o){var c=e.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(n.departureUpdateTimeout),n.departureUpdateTimeout=window.setTimeout((function(){var e=n.filterDepartures(i,t||!1);r(e)}),100)}}),(function(){r([])}))}},{key:"unsubscribeDepartures",value:function(e){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",e),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(e){this.subscribe("".concat(this.prefix,"newsticker"),(function(t){e(t.content)}))}},{key:"unsubscribeDisruptions",value:function(e){this.unsubscribe("".concat(this.prefix,"newsticker"),"",e)}},{key:"getStation",value:function(e,t){var r=this,n={channel:"station".concat(Ln(t,qn)),args:e};return new Promise((function(e,t){r.conn.get(n,(function(r){r.content?e(r.content):t()}))}))}},{key:"getStations",value:function(e){var t=this,r=[],n={channel:"station".concat(Ln(e,qn))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(e,o){t.conn.get(n,(function(n){n.content?(r.push(n.content),window.clearTimeout(t.stationUpdateTimeout),t.stationUpdateTimeout=window.setTimeout((function(){e(r)}),50)):o(n.content)}))}))}},{key:"subscribeStations",value:function(e,t){this.unsubscribeStations(),this.subscribe("station".concat(Ln(e,qn)),(function(e){e.content&&t(e.content)}))}},{key:"unsubscribeStations",value:function(e){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",e)}},{key:"subscribeExtraGeoms",value:function(e){var t=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?t.extraGeoms[o]=n:delete t.extraGeoms[o],e(Object.keys(t.extraGeoms).map((function(e){return t.extraGeoms[e]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(e){this.unsubscribe("extra_geoms","",e)}},{key:"subscribeTrajectory",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeTrajectory(t),this.subscribe("trajectory".concat(Ln(e,qn)),t,null,r)}},{key:"unsubscribeTrajectory",value:function(e){this.unsubscribe("trajectory","",e)}},{key:"subscribeDeletedVehicles",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeDeletedVehicles(t),this.subscribe("deleted_vehicles".concat(Ln(e,qn)),t,null,r)}},{key:"unsubscribeDeletedVehicles",value:function(e){this.unsubscribe("deleted_vehicles","",e)}},{key:"getFullTrajectory",value:function(e,t,r){var n=this,o=["full_trajectory".concat(Ln(t,qn))];e&&o.push(e),t&&t!==qn.TOPOGRAPHIC||!r||o.push("gen".concat(r));var i={channel:o.join("_")};return new Promise((function(e){n.conn.get(i,(function(t){t.content&&e(t.content)}))}))}},{key:"getFullTrajectories",value:function(e,t,r){var n=this,o=e.map((function(e){return n.getFullTrajectory(e,t,r)}));return Promise.all(o)}},{key:"subscribeFullTrajectory",value:function(e,t){this.unsubscribeFullTrajectory(e),this.subscribe("full_trajectory".concat(Ln(t,qn),"_").concat(e),(function(e){console.log("subscribe full_trajectory",e)}),(function(e){console.log("subscribe full_trajectory error",e)}))}},{key:"unsubscribeFullTrajectory",value:function(e,t){this.unsubscribe("full_trajectory","_".concat(e),t)}},{key:"getStopSequence",value:function(e){var t=this,r={channel:"stopsequence_".concat(e)};return new Promise((function(e,n){t.conn.get(r,(function(t){if(t.content&&t.content.length){var r=t.content.map((function(e){return Un(e)}));e(r)}e([])}),(function(e){n(e)}))}))}},{key:"getStopSequences",value:function(e){var t=this,r=e.map((function(e){return t.getStopSequence(e)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(e,t){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(e),this.subscribe("stopsequence_".concat(e),(function(e){if(e.content&&e.content.length){var r=e.content.map((function(e){return Un(e)}));t(r)}}),(function(e){console.log("subscribe stopsequence error",e)}))}},{key:"unsubscribeStopSequence",value:function(e,t){this.unsubscribe("stopsequence","_".concat(e),t)}},{key:"subscribeHealthCheck",value:function(e){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",e)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&Vn(t.prototype,r),n&&Vn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Hn(e){return(Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(r),!0).forEach((function(t){Zn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $n(){return($n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Jn(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Jn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eo(e)););return e}function Qn(e,t){return(Qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=eo(e);if(t){var o=eo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Yn(this,r)}}function Yn(e,t){if(t&&("object"===Hn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function eo(e){return(eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function to(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ro(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function no(e,t,r){return t&&ro(e.prototype,t),r&&ro(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var oo=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qn(e,t)}(r,e);var t=Xn(r);function r(){return to(this,r),t.apply(this,arguments)}return no(r,[{key:"defineProperties",value:function(e){var t=this;$n(eo(r.prototype),"defineProperties",this).call(this,e);var n,o=3;if(!e.api){var i={};e.url&&(i.url=e.url),e.apiKey&&(i.apiKey=e.apiKey),n=new _n(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(e){e!==o&&(o=e,t.visible&&t.start())}},api:{value:e.api||n}})}},{key:"init",value:function(e){$n(eo(r.prototype),"init",this).call(this,e),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(e,t){return null===e.delay||e.delay<t.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),$n(eo(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),$n(eo(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(e,t,n){var o=Gn(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),$n(eo(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=Gn(e,1)[0];o?(this.selectedVehicleId=o.get("train_id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),$n(eo(r.prototype),"onFeatureClick",this).call(this,e,t,n)}},{key:"highlightTrajectory",value:function(){var e=this,t=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:t,time:Ct(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:Ct(new Date)}))];Promise.all(n).then((function(t){var r=Gn(t,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(e){i.push(e.coordinates)})),o){var c=o.p,a=o.t,u=o.c,l=[];c.forEach((function(e){e.forEach((function(e){l.push([e.x,e.y])}))}));var s=u?"#".concat(u):ht(a),f=/#ffffff/i.test(s)?"#ff0000":s;e.drawFullTrajectory(i,l,e.useDelayStyle?"#a0a0a0":f)}})).catch((function(){e.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=1e3*(this.requestIntervalSeconds+5),r=this.speed*t,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=zn(zn({},e),{},{btime:Ct(n),etime:Ct(this.later),date:Tt(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var e=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){e.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var e=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(e){if("AbortError"!==e.name)throw e})).then((function(t){t&&(e.trajectories=t,e.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(e,t,r){}},{key:"defaultStyle",value:function(e,t){var r=t.zoom,n=e.type,o=e.name,i=e.id,c=e.color,a=e.textColor,u=e.delay,l=e.cancelled,s=e.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(s).concat(u).concat(p).concat(y).concat(l),b=yt(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(s).concat(u).concat(p).concat(y).concat(l)),!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=dt(u,l),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||l)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(l?19:14,Math.min(l?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=dt(u,l,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=mt(u,l);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?dt(u,l):c||ht(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"===s&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=vt(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===s&&(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||bt(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}(e)};function io(e){return(io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function co(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ao(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?co(Object(r),!0).forEach((function(t){uo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):co(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function so(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fo(){return(fo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=po(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function po(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=vo(e)););return e}function yo(e,t){return(yo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ho(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=vo(e);if(t){var o=vo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bo(this,r)}}function bo(e,t){if(t&&("object"===io(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function vo(e){return(vo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yo(e,t)}(i,e);var t,r,n,o=ho(i);function i(){return lo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"start",value:function(){var e=this;this.map&&(fo(vo(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){e.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),fo(vo(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var e=this.map.getView().getZoom();e!==this.currentZoom&&(this.currentZoom=e,this.requestIntervalSeconds=200/e||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(e,t,r){var n=this.vectorLayer.getSource();if(n.clear(),e){var o=new Zr.MultiPoint(e.map((function(e){return Object(Ge.fromLonLat)(e)}))),i=new zr.a(o);i.setStyle(new Kt.Style({zIndex:1,image:new Kt.Circle({radius:5,fill:new Kt.Fill({color:"#000000"})})}));var c=new zr.a(o);c.setStyle(new Kt.Style({zIndex:4,image:new Kt.Circle({radius:4,fill:new Kt.Fill({color:r})})})),n.addFeatures([i,c])}if(t){var a=new zr.a({geometry:new Zr.LineString(t)});a.setStyle([new Kt.Style({zIndex:2,stroke:new Kt.Stroke({color:"#000000",width:6})}),new Kt.Style({zIndex:3,stroke:new Kt.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getView().calculateExtent(),r=Object($t.buffer)(t,Object($t.getWidth)(t)/10).join(","),n=this.map.getView().getZoom();return fo(vo(i.prototype),"getParams",this).call(this,ao(ao({},e),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(e){return new i(ao(ao({},this.options),e))}}])&&so(t.prototype,r),n&&so(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(oo(Hr));r(29);function go(e){return(go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||wo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jo(e){return function(e){if(Array.isArray(e))return Po(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wo(e)||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 wo(e,t){if(e){if("string"==typeof e)return Po(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Po(e,t):void 0}}function Po(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function So(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ko(Object(r),!0).forEach((function(t){To(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ko(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function To(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Co(){return(Co="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Eo(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Eo(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Io(e)););return e}function Ro(e,t){return(Ro=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Io(e);if(t){var o=Io(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _o(this,r)}}function _o(e,t){if(t&&("object"===go(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Do(e)}function Do(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Io(e){return(Io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ao(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Lo(e,t,r){return t&&Mo(e.prototype,t),r&&Mo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Bo=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ro(e,t)}(r,e);var t=xo(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ao(this,r),(e=t.call(this,So({},n))).debug=n.debug,e.mode=n.mode||qn.TOPOGRAPHIC,e.api=n.api||new Nn(n),e.tenant=n.tenant||"",e.minZoomNonTrain=n.minZoomNonTrain||9,e.minZoomInterpolation=n.minZoomInterpolation||8,e.format=new Ye.a,e.generalizationLevelByZoom=n.generalizationLevelByZoom||{0:5,1:5,2:5,3:5,4:5,5:5,6:5,7:5,8:10,9:30,10:30,11:100,12:100,13:100},e.isUpdateBboxOnMoveEnd=!1!==n.isUpdateBboxOnMoveEnd,e.onTrajectoryMessage=e.onTrajectoryMessage.bind(Do(e)),e.onDeleteTrajectoryMessage=e.onDeleteTrajectoryMessage.bind(Do(e)),e.onDocumentVisibilityChange=e.onDocumentVisibilityChange.bind(Do(e)),e}return Lo(r,[{key:"init",value:function(e){Co(Io(r.prototype),"init",this).call(this,e),document.addEventListener("visibilitychange",this.onDocumentVisibilityChange)}},{key:"terminate",value:function(){document.removeEventListener("visibilitychange",this.onDocumentVisibilityChange),Co(Io(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Co(Io(r.prototype),"start",this).call(this),this.api.open(),this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.isUpdateBboxOnMoveEnd&&this.setBbox()}},{key:"stop",value:function(){Co(Io(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close()}},{key:"setBbox",value:function(e,t){for(var r=Object.keys(this.trajectories),n=r.length-1;n>=0;n-=1)this.purgeTrajectory(this.trajectories[r[n]],e,t);var o=jo(e);this.isUpdateBboxOnMoveEnd&&(o.push(t),this.tenant&&o.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[t],this.generalizationLevel&&o.push("gen=".concat(this.generalizationLevel))),this.api.bbox=o}},{key:"setMode",value:function(e){this.mode!==e&&(this.mode=e,this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd))}},{key:"getTrajectoryInfos",value:function(e){var t=[this.api.getStopSequence(e,this.mode),this.api.getFullTrajectory(e,this.mode,this.generalizationLevel)];return Promise.all(t).then((function(e){var t=Oo(e,2);return{stopSequence:t[0],fullTrajectory:t[1]}}))}},{key:"purgeTrajectory",value:function(e,t,r){var n=e.properties,o=n.type,i=n.bounds,c=n.train_id;return(!Object($t.intersects)(t,i)||"rail"!==o&&r<(this.minZoomNonTrain||9))&&(this.removeTrajectory(c),!0)}},{key:"addTrajectory",value:function(e){this.filter&&!this.filter(e)||(this.trajectories[e.properties.train_id]=e,this.renderTrajectories())}},{key:"removeTrajectory",value:function(e){delete this.trajectories[e]}},{key:"onDocumentVisibilityChange",value:function(){this.visible&&(document.hidden?this.stop():this.start())}},{key:"onTrajectoryMessage",value:function(e){if(e.content){var t=e.content,r=t.geometry,n=t.properties,o=(n.train_id,n.time_since_update),i=n.raw_coordinates;o<0||this.purgeTrajectory(t)||(this.debug&&this.mode===qn.TOPOGRAPHIC&&i?t.properties.olGeometry={type:"Point",coordinates:Object(Ge.fromLonLat)(i,this.map.getView().getProjection())}:t.properties.olGeometry=this.format.readGeometry(r),t.properties.timeOffset=Date.now()-e.timestamp,this.addTrajectory(t))}}},{key:"onDeleteTrajectoryMessage",value:function(e){e.content&&this.removeTrajectory(e.content)}},{key:"onFeatureHover",value:function(e,t,n){var o=Oo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories(!0)),Co(Io(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=Oo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.selectedVehicleId!==i&&(this.selectedVehicleId=i,this.selectedVehicle=o,this.renderTrajectories(!0)),Co(Io(r.prototype),"onFeatureClick",this).call(this,e,t,n)}}]),r}(e)};function Uo(e){return(Uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fo(Object(r),!0).forEach((function(t){qo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function No(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ho(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ko(){return(Ko="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zo(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function zo(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$o(e)););return e}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Go(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$o(e);if(t){var o=$o(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Wo(this,r)}}function Wo(e,t){if(t&&("object"===Uo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function $o(e){return($o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Jo=new Ye.a,Qo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zo(e,t)}(i,e);var t,r,n,o=Go(i);function i(){return No(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"purgeTrajectory",value:function(e,t,r){return Ko($o(i.prototype),"purgeTrajectory",this).call(this,e,t||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.map.getView().calculateExtent(),n=Math.floor(this.map.getView().getZoom())),Ko($o(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Ko($o(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.isClickActive&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"onFeatureClick",value:function(e,t,r){Ko($o(i.prototype),"onFeatureClick",this).call(this,e,t,r),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"highlightTrajectory",value:function(e){var t=this;this.api.getFullTrajectory(e,this.mode,this.generalizationLevel).then((function(e){if(t.vectorLayer.getSource().clear(),e&&e.features&&e.features.length){var r="#ffffff";if(t.useDelayStyle)r="#a0a0a0";else{var n=e.features[0].properties,o=n.type,i=n.stroke;i&&"#"!==i[0]&&(i="#".concat(i)),r=i||ht(o),r=/#ffffff/i.test(r)?"#ff0000":r}var c=[new Kt.Style({zIndex:2,image:new Kt.Circle({radius:5,fill:new Kt.Fill({color:"#000000"})}),stroke:new Kt.Stroke({color:"#000000",width:6})}),new Kt.Style({zIndex:3,image:new Kt.Circle({radius:4,fill:new Kt.Fill({color:r})}),stroke:new Kt.Stroke({color:r,width:4})})];t.vectorLayer.setStyle(c);var a=Jo.readFeatures(e);a.forEach((function(e){e.setStyle(c)})),t.vectorLayer.getSource().addFeatures(a)}}))}},{key:"clone",value:function(e){return new i(Vo(Vo({},this.options),e))}}])&&Ho(t.prototype,r),n&&Ho(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Bo(Hr));function Xo(e){return(Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ei(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yo(Object(r),!0).forEach((function(t){ti(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ti(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ri(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ni(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oi(e,t){return(oi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ii(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ai(e);if(t){var o=ai(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ci(this,r)}}function ci(e,t){if(t&&("object"===Xo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ai(e){return(ai=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ui=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oi(e,t)}(i,e);var t,r,n,o=ii(i);function i(){return ri(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(e);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(e){return e===t.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:e})}},{key:"clone",value:function(e){return new i(ei(ei({},this.options),e))}}])&&ni(t.prototype,r),n&&ni(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);function li(e){return(li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function si(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?si(Object(r),!0).forEach((function(t){pi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):si(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bi(e,t){return(bi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=mi(e);if(t){var o=mi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return di(this,r)}}function di(e,t){if(t&&("object"===li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mi(e){return(mi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bi(e,t)}(i,e);var t,r,n,o=vi(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yi(this,i),(e=o.call(this,t)).abortController=new AbortController,e.format=new Ye.a,e}return t=i,(r=[{key:"getFeatureInfoUrl",value:function(e){var t=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(e,r,t,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(e),{signal:r}).then((function(e){return e.json()})).then((function(e){return e.features})).then((function(r){return{layer:t,coordinate:e,features:r.map((function(e){return t.format.readFeature(e)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:e,layer:t})}))}},{key:"clone",value:function(e){return new i(fi(fi({},this.options),e))}}])&&hi(t.prototype,r),n&&hi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);r(15),r(26),r(27),r(19);function Oi(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ji(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ji(Object(r),!0).forEach((function(t){Pi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ji(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ki(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Si(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ci(e);if(t){var o=Ci(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ti(this,r)}}function Ti(e,t){if(t&&("object"===Oi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ci(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ei(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ri(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xi(e,t,r){return t&&Ri(e.prototype,t),r&&Ri(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _i(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ii(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ai(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Bi(e);if(t){var o=Bi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Li(this,r)}}function Li(e,t){if(t&&("object"===_i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Bi(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ui=G;var Ui;function Fi(e){return(Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qi(){return(qi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ni(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ni(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Gi(e)););return e}function Hi(e,t){return(Hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ki(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Gi(e);if(t){var o=Gi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zi(this,r)}}function zi(e,t){if(t&&("object"===Fi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zi(e)}function Zi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gi(e){return(Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hi(e,t)}(i,e);var t,r,n,o=Ki(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).render=t.render.bind(Zi(t)),t}return t=i,(r=[{key:"activate",value:function(){qi(Gi(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)),qi(Gi(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return ct(this.map)}}])&&Vi(t.prototype,r),n&&Vi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function $i(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ji(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Qi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ji(Object(r),!0).forEach((function(t){Xi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ec(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=tc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function tc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==ic(e););return e}function rc(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ic(e);if(t){var o=ic(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return oc(this,r)}}function oc(e,t){if(t&&("object"===$i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ic(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ae(We.Map);var cc=r(20),ac=r.n(cc),uc=r(21);function lc(e){return(lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sc(e){return function(e){if(Array.isArray(e))return fc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return fc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pc(Object(r),!0).forEach((function(t){hc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dc(){return(dc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=mc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function mc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=wc(e)););return e}function gc(e,t){return(gc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=wc(e);if(t){var o=wc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jc(this,r)}}function jc(e,t){if(t&&("object"===lc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function wc(e){return(wc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pc(e){return function(e){if(Array.isArray(e))return kc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return kc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kc(e,t)}(e)||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 kc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Sc=function(e){var t=e.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Pc(r),Pc(n)),i=e.getCanvas(),c=i.width,a=i.height,u=Object($t.getWidth)(o)/c,l=Object($t.getHeight)(o)/a;return Math.max(u,l)},Tc=function(e,t){var r=e.getCanvas(),n=r.width,o=r.height,i=e.unproject({x:0,y:0}),c=e.unproject({x:0,y:o/t}),a=e.unproject({x:n/t,y:o/t}),u=e.unproject({x:n/t,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function Cc(e){return(Cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ec(e){return function(e){if(Array.isArray(e))return Rc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Rc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rc(e,t)}(e)||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 Rc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xc(Object(r),!0).forEach((function(t){Dc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ic(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ac(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Mc(){return(Mc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Lc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Lc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qc(e)););return e}function Bc(e,t){return(Bc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qc(e);if(t){var o=qc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fc(this,r)}}function Fc(e,t){if(t&&("object"===Cc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vc(e)}function Vc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qc(e){return(qc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bc(e,t)}(i,e);var t,r,n,o=Uc(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ic(this,i),(e=o.call(this,_c({},t))).onMove=e.onMove.bind(Vc(e)),e.onMoveEnd=e.onMoveEnd.bind(Vc(e)),e.onZoomEnd=e.onZoomEnd.bind(Vc(e)),e.onVisibilityChange=e.onVisibilityChange.bind(Vc(e)),e}return t=i,(r=[{key:"init",value:function(e,t){if(e){var r=e.getCanvas();Mc(qc(i.prototype),"init",this).call(this,e,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:Tc(e,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=t,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"}},e.addSource(this.key,n),e.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),Mc(qc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Mc(qc(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomend",this.onZoomEnd)}},{key:"stop",value:function(){Mc(qc(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(e){Mc(qc(i.prototype),"onUserClickCallback",this).call(this,_c({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"onUserMoveCallback",value:function(e){Mc(qc(i.prototype),"onUserMoveCallback",this).call(this,_c({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"renderTrajectories",value:function(e){var t=this.map.getCanvas(),r=t.width,n=t.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=ac()(Object(uc.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=ac()(Object(uc.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=[].concat(Ec(Object(Ge.fromLonLat)(u)),Ec(Object(Ge.fromLonLat)(l))),f=Object($t.getWidth)(s)/(r/this.pixelRatio),p=Object($t.getHeight)(s)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ge.fromLonLat)([o.lng,o.lat]),extent:s,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};Mc(qc(i.prototype),"renderTrajectories",this).call(this,h,e)}},{key:"getRefreshTimeInMs",value:function(){return Mc(qc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=Sc(this.map);return Mc(qc(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Sc(this.map);return Mc(qc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,_c({resolution:r},t))}},{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 e=Tc(this.map,this.pixelRatio),t=this.map.getSource(this.key);t&&t.setCoordinates(e),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){this.renderTrajectories()}},{key:"onFeatureHover",value:function(e,t,r){Mc(qc(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getCanvasContainer().style.cursor=e.length?"pointer":"auto"}}])&&Ac(t.prototype,r),n&&Ac(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(xr(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gc(e,t)}(i,e);var t,r,n,o=Oc(i);function i(){return bc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"init",value:function(e){dc(wc(i.prototype),"init",this).call(this,e),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(e){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),dc(wc(i.prototype),"terminate",this).call(this,e)}},{key:"onUserClickCallback",value:function(e){dc(wc(i.prototype),"onUserClickCallback",this).call(this,yc({coordinate:e.lngLat.toArray()},e))}},{key:"onUserMoveCallback",value:function(e){dc(wc(i.prototype),"onUserMoveCallback",this).call(this,yc({coordinate:e.lngLat.toArray()},e))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var e=this.map.getBounds().toArray();return Object(Ge.transformExtent)([].concat(sc(e[0]),sc(e[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(e){return new i(yc(yc({},this.options),e))}}])&&vc(t.prototype,r),n&&vc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w)));function Hc(e){return(Hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zc(){return(Zc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Gc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Gc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Qc(e)););return e}function Wc(e,t){return(Wc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qc(e);if(t){var o=Qc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jc(this,r)}}function Jc(e,t){if(t&&("object"===Hc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Qc(e){return(Qc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wc(e,t)}(i,e);var t,r,n,o=$c(i);function i(){return Kc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"purgeTrajectory",value:function(e,t,r){return Zc(Qc(i.prototype),"purgeTrajectory",this).call(this,e,t||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.getMercatorExtent(),n=Math.floor(this.getOlZoom())),Zc(Qc(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Zc(Qc(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&zc(t.prototype,r),n&&zc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Bo(Nc));function Yc(e){return(Yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ea(e){return function(e){if(Array.isArray(e))return ta(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ta(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ta(e,t)}(e)||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 ta(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){oa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ia(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ca(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function aa(){return(aa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ua(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ua(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ya(e)););return e}function la(e,t){return(la=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function sa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ya(e);if(t){var o=ya(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return fa(this,r)}}function fa(e,t){if(t&&("object"===Yc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pa(e)}function pa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ya(e){return(ya=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ha={mapbox:{TrajservLayer:function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&la(e,t)}(i,e);var t,r,n,o=sa(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ia(this,i),(e=o.call(this,na({},t))).onMove=e.onMove.bind(pa(e)),e.onMoveEnd=e.onMoveEnd.bind(pa(e)),e.onVisibilityChange=e.onVisibilityChange.bind(pa(e)),e}return t=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),aa(ya(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(aa(ya(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)),aa(ya(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(ea(r),ea(n)),c=Object($t.buffer)(o,Object($t.getWidth)(o)/10).join(","),a=this.map.getZoom();return aa(ya(i.prototype),"getParams",this).call(this,na(na({},e),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(e,t,r){console.log("to be implemented")}}])&&ca(t.prototype,r),n&&ca(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(oo(Nc)),TralisLayer:Xc},ol:{Map:Ze,Layer:A,WMSLayer:gi,MapboxLayer:Ht,TrajservLayer:mo,TralisLayer:Qo,VectorLayer:ui}};t.default=ha}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],t):"object"==typeof exports?exports["mobility-toolbox-js"]=t():e["mobility-toolbox-js"]=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=28)}([function(e,t){e.exports=require("ol/proj")},function(e,t){e.exports=require("ol/style")},function(e,t){e.exports=require("ol/extent")},function(e,t){e.exports=require("ol/Observable")},function(e,t){e.exports=require("ol/geom")},function(e,t){e.exports=require("ol/format/GeoJSON")},function(e,t){e.exports=require("query-string")},function(e,t){e.exports=require("ol/layer")},function(e,t){e.exports=require("ol/transform")},function(e,t){e.exports=require("ol/Object")},function(e,t){e.exports=require("ol/layer/Layer")},function(e,t){e.exports=require("maplibre-gl")},function(e,t){e.exports=require("ol/source/Source")},function(e,t){e.exports=require("ol/source")},function(e,t){e.exports=require("ol/Feature")},function(e,t){e.exports=require("ol")},function(e,t){e.exports=require("lodash.debounce")},function(e,t){e.exports=require("lodash.throttle")},function(e,t){e.exports=require("ol/geom/GeometryType")},function(e,t){e.exports=require("ol/format")},function(e,t){e.exports=require("@turf/transform-rotate")},function(e,t){e.exports=require("@turf/helpers")},function(e,t){e.exports=require("ol/Map")},function(e,t){e.exports=require("ol/control")},function(e,t){e.exports=require("ol/layer/Group")},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("ol/interaction")},function(e,t){e.exports=require("ol/events/condition")},function(e,t,r){e.exports=r(30)},function(e,t){e.exports=require("ol/geom/Point")},function(e,t,r){"use strict";r.r(t);var n=r(22),o=r.n(n),i=r(23),c=r(3),a=r.n(c),u=r(24),l=r.n(u),s=r(25);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(i,e);var t,r,n,o=m(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(e=o.call(this)).defineProperties(t);var r=t.onClick,n=t.onHover;return n&&e.onHover(n),r&&e.onClick(r),t.copyrights&&(e.copyrights=t.copyrights),e.onUserClickCallback=e.onUserClickCallback.bind(O(e)),e.onUserMoveCallback=e.onUserMoveCallback.bind(O(e)),e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},e),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,l=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(s.v4)(),v=n||b;Object.defineProperties(this,{options:{value:e},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!l},isClickActive:{value:!!l&&!!f},isHoverActive:{value:!!l&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return t.get("copyrights")},set:function(e){var r=Array.isArray(e)?e:[e];t.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(e){this.terminate(),this.map=e}},{key:"terminate",value:function(){}},{key:"get",value:function(e){return this.properties[e]}},{key:"set",value:function(e,t){this.properties[e]=t,this.dispatchEvent({type:"change:".concat(e),target:this})}},{key:"setVisible",value:function(e){var t=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];e!==this.visible&&(this.visible=e,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:t,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(e){return e.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(e){return!!this.children.find((function(t){return t.visible===e}))}},{key:"addChild",value:function(e){this.children.unshift(e),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(e){for(var t=0;t<this.children.length;t+=1)if(this.children[t].name===e){this.children.splice(t,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:e})}},{key:"onClick",value:function(e){if("function"!=typeof e)throw new Error("onClick callback must be of type function:",e);this.clickCallbacks.includes(e)||this.clickCallbacks.push(e)}},{key:"unClick",value:function(e){if("function"==typeof e){var t=this.clickCallbacks.indexOf(e);t>-1&&this.clickCallbacks.splice(t,1)}}},{key:"onUserClickCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.clickCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(e){if("function"!=typeof e)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(e)||this.hoverCallbacks.push(e)}},{key:"unHover",value:function(e){if("function"==typeof e){var t=this.hoverCallbacks.indexOf(e);t>-1&&this.hoverCallbacks.splice(t,1)}}},{key:"onUserMoveCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.hoverCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}}])&&v(t.prototype,r),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(a.a);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){T(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(){return(E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=R(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function R(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=I(e);if(t){var o=I(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(i,e);var t,r,n,o=_(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).olLayer&&t.olLayer.setVisible(t.visible),t}return t=i,(r=[{key:"defineProperties",value:function(e){E(I(i.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{olLayer:{value:e.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(e){var t=this;if(E(I(i.prototype),"init",this).call(this,e),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(e){e.element===t.olLayer&&t.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 l.a?this.olLayer.getLayers().getArray().forEach((function(e){e.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),E(I(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(e){var t=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];e!==this.visible&&(E(I(i.prototype),"setVisible",this).call(this,e,t,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var e=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(t){var r=e.olListenersKeys.indexOf(t);r>-1&&e.olListenersKeys.splice(r,1),Object(c.unByKey)([e.isHoverListenerKey,e.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(e){return new i(S(S({},this.options),e))}}])&&C(t.prototype,r),n&&C(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w),M=r(9),L=r.n(M);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var o=Z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return z(this,r)}}function z(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(i,e);var t,r,n,o=K(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(e=o.call(this,t)).defineProperties(t);var r=U({active:!1!==t.active},t),n=r.active;return e.active=n,e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=U({},e),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return t.get("active")},set:function(e){t.set("active",e),e?t.activate():t.deactivate(),t.render()}},map:{get:function(){return t.get("map")},set:function(e){if(t.map&&t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.deactivate(),t.set("map",e),t.map){var r=t.target||t.map.getContainer();t.element||t.createDefaultElement(),t.element&&r.appendChild(t.element),t.active&&t.activate()}t.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(){}}])&&N(t.prototype,r),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(){return(X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Y(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ne(e);if(t){var o=ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return re(this,r)}}function re(e,t){if(t&&("object"===W(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ce(e,t,r){return t&&ie(e.prototype,t),r&&ie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ae=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(r,e);var t=te(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return oe(this,r),(e=t.call(this,J(J({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],e.mobilityControls=[],(n.controls||[]).forEach((function(t){e.addControl(t)})),(n.layers||[]).forEach((function(t){e.addLayer(t)})),e}return ce(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(e){this.mobilityControls.push(e),e.map=this}},{key:"removeMobilityControl",value:function(e){e.map=null,this.mobilityControls=this.mobilityControls.filter((function(t){return t!==e}))}},{key:"addControl",value:function(e,t){e instanceof G?this.addMobilityControl(e):X(ne(r.prototype),"addControl",this).call(this,e,t)}},{key:"removeControl",value:function(e){e instanceof G?this.removeMobilityControl(e):X(ne(r.prototype),"removeControl",this).call(this,e)}}]),r}(e)},ue=r(10),le=r.n(ue);function se(e){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=he(e);if(t){var o=he(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ye(this,r)}}function ye(e,t){if(t&&("object"===se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function de(e,t,r){return t&&ve(e.prototype,t),r&&ve(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var me=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fe(e,t)}(r,e);var t=pe(r);function r(){return be(this,r),t.apply(this,arguments)}return de(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}(e)};function ge(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oe(e,t)}(e)||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 Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var je=function(e){var t=e.filter((function(e){return null!=e&&e.trim&&e.trim()})),r=t.map((function(e){return e.toLowerCase()}));return ge(new Set(r)).map((function(e){return t.find((function(t){return t.toLowerCase()===e}))}))};function we(e){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ke(){return(ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Se(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Se(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=xe(e)););return e}function Te(e,t){return(Te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=xe(e);if(t){var o=xe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ee(this,r)}}function Ee(e,t){if(t&&("object"===we(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Re(e)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}(i,e);var t,r,n,o=Ce(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).onPostRender=t.onPostRender.bind(Re(t)),t}return t=i,(r=[{key:"getCopyrights",value:function(){var e=this;if(!this.frameState)return[];var t=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ue.inView)(r,e.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(t=t.concat(n.getSource().getAttributions()(e.frameState)))})),je(t)}},{key:"activate",value:function(){ke(xe(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),ke(xe(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(e){this.map&&this.element&&(this.frameState=e.frameState,this.render())}}])&&Pe(t.prototype,r),n&&Pe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ie(e){return function(e){if(Array.isArray(e))return Ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ae(e,t)}(e)||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 Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){Be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ve(){return(Ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=qe(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function qe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ze(e)););return e}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ze(e);if(t){var o=ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ke(this,r)}}function Ke(e,t){if(t&&("object"===De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ze(e){return(ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ze=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}(c,e);var t,r,n,o=He(c);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Fe(this,c),o.call(this,Le({controls:[].concat(Ie(Object(i.defaults)({attribution:!1}).getArray()),[new _e])},e))}return t=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(e){e instanceof A?(e.init(this),this.mobilityLayers.push(e),e.olLayer&&Ve(ze(c.prototype),"addLayer",this).call(this,e.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Ve(ze(c.prototype),"addLayer",this).call(this,e)}},{key:"removeLayer",value:function(e){e instanceof A?(e.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(t){return t!==e})),e.olLayer&&Ve(ze(c.prototype),"removeLayer",this).call(this,e)):Ve(ze(c.prototype),"removeLayer",this).call(this,e)}},{key:"addControl",value:function(e){Ve(ze(c.prototype),"addControl",this).call(this,e)}},{key:"removeControl",value:function(e){Ve(ze(c.prototype),"removeControl",this).call(this,e)}}])&&Ue(t.prototype,r),n&&Ue(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(ae(o.a)),Ge=r(0),We=r(11),$e=r.n(We),Je=r(12),Qe=r.n(Je),Xe=r(5),Ye=r.n(Xe),et=r(6),tt=r.n(et);function rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(r),!0).forEach((function(t){ot(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var it=function(e,t,r){if(!1===e)return r;var n=tt.a.parseUrl(r);return!e&&n.query[t]?r:e?tt.a.stringifyUrl(nt(nt({},n),{},{query:nt(nt({},n.query),{},ot({},t,e))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},ct=function(e){if(!e||!e.style)return[];var t=e.style.sourceCaches,r=[];return Object.values(t).forEach((function(e){if(e.used){var t=e.getSource(),n=t.attribution||t.options&&t.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),je(r)},at={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]},ut=[/^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],lt=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],st=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ft=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],pt=function(e){return"string"==typeof e?ut.findIndex((function(t){return t.test(e)})):e},yt=function(e,t){try{var r=pt(e||0);return at[r][t]}catch(e){return 1}},ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return lt[t]}catch(e){return 1}},bt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return st[t]}catch(e){return 1}},vt=function(e,t,r,n){e.font="bold ".concat(n,"px Arial");for(var o=e.measureText(r),i=0;o.width>t-6&&i<25;)n-=.5,e.font="bold ".concat(n,"px arial, sans-serif"),o=e.measureText(r),i+=1;return n},dt=function(e,t,r){return t?r?"#ff0000":"#a0a0a0":e>=36e5?"#ed004c":e>=5e5?"#e80000":e>=3e5?"#ff4a00":e>=18e4?"#f7bf00":null===e?"#a0a0a0":"#00a00c"},mt=function(e,t){if(t)return String.fromCodePoint(215);if(e>36e5){var r=Math.round(e/36e5);return"+".concat(r,"h")}if(e>59e3){var n=Math.round(e/6e4);return"+".concat(n,"m")}return e>0?"+".concat(e,"s"):""},gt=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},Ot={},jt={},wt={},Pt={},kt={},St=function(e,t,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=t.zoom,l=t.pixelRatio,s=e.properties,f=s.line,p=s.type,y=e.properties,h=y.train_id,b=y.delay,v=y.cancelled,d=void 0!==v&&v,m=y.operator_provides_realtime_journey;p||(p="Rail"),f||(f={});var g=f,O=g.name,j=g.text_color,w=g.color;O||(O="I"),j||(j="#000000"),w&&"#"!==w[0]&&(w="#".concat(w)),"#"!==j[0]&&(j="#".concat(j));var P=Math.min(Math.floor(u||1),16),k=n&&n===h,S=o&&o===h,T=yt(p,P)*l,C=T>=7*l;(k||S)&&(T=C?T+5*l:14*l);var E=T>10*l,R="".concat(T).concat(p).concat(w).concat(k).concat(S).concat(d).concat(b);if(i&&(R+="".concat(m)),E&&(R+="".concat(O).concat(j)),!kt[R]){if(0===T)return kt[R]=null,null;var x,_=1*l,D=T+2,I=2*T,A=2*D+2*_+100*l,M=A/2,L=gt(A,A),B=L.getContext("2d");if(C&&null!==b){var F=function(e,t,r){var n="".concat(e,", ").concat(t,", ").concat(r);if(!Ot[n]){var o=gt(2*e,2*e),i=o.getContext("2d");i.beginPath(),i.arc(e,e,t,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),Ot[n]=o}return Ot[n]}(M,D,dt(b,d));B.drawImage(F,0,0)}if(C&&(k||b>=a||d)){var U=Math.max(d?19:14,Math.min(d?19:17,1.2*T))*l,V=mt(b,d);if(V){var q=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!jt[a]){var u=gt(e,r+8*c),l=u.getContext("2d");l.textAlign="left",l.textBaseline="middle",l.font=n,l.fillStyle=o,l.strokeStyle=i,l.lineWidth=1.5*c;var s=t;l.strokeText(s,0,r),l.fillText(s,0,r),jt[a]=u}return jt[a]}(V.length*U,V,U,"bold ".concat(U,"px arial, sans-serif"),dt(b,d,!0),c,l);B.drawImage(q,M+D+_,M-U)}}var N=function(e,t,r,n,o,i){var c="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!wt[c]){var a=gt(2*e,2*e),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(e,e,t,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),wt[c]=a}return wt[c]}(M,T,x=i?dt(b,d):w||ht(p),C||k||S,C&&i&&null===b&&"yes"===m,l);if(B.drawImage(N,0,0),E){var H=Math.max(T,10),K=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!Pt[a]){var u=gt(2*t,2*t),l=u.getContext("2d");i&&(l.save(),l.textBaseline="middle",l.textAlign="center",l.font="bold ".concat(r+2,"px Arial"),l.strokeStyle=o,l.strokeText(e,t,t),l.restore()),l.textBaseline="middle",l.textAlign="center",l.fillStyle=n,l.font="bold ".concat(r,"px Arial"),l.strokeStyle=o,l.strokeText(e,t,t),l.fillText(e,t,t),Pt[a]=u}return Pt[a]}(O,M,vt(B,I,O,H),i?"#000000":j||bt(p),x,i&&null===b&&"yes"===m,l);B.drawImage(K,0,0)}kt[R]=L}return kt[R]},Tt=document.createElement("canvas");Tt.width=15,Tt.height=15;var Ct=Tt.getContext("2d");Ct.arc(8,8,5,0,2*Math.PI,!1),Ct.fillStyle="#8ED6FF",Ct.fill(),Ct.lineWidth=3,Ct.strokeStyle="black",Ct.stroke(),Ct.lineWidth=3;var Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=(e.getUTCMonth()+1).toString();t=1===t.length?"0".concat(t):t;var r=e.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[e.getUTCFullYear(),t,r].join("")},Rt=function(e){return[e.getUTCHours(),e.getUTCMinutes(),"".concat(e.getUTCSeconds(),".").concat(e.getUTCMilliseconds())].join(":")};function xt(e){return(xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function It(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?It(Object(r),!0).forEach((function(t){Mt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ft(){return(Ft="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ut(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ut(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kt(e)););return e}function Vt(e,t){return(Vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kt(e);if(t){var o=Kt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Nt(this,r)}}function Nt(e,t){if(t&&("object"===xt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ht(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vt(e,t)}(i,e);var t,r,n,o=qt(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Lt(this,i);var r=new le.a({source:new Qe.a({}),render:function(t){if(!e.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=e.mbMap.getCanvas(),o=t.viewState,i=e.olLayer.getVisible();e.renderState.visible!==i&&(n.style.display=i?"block":"none",e.renderState.visible=i,n.style.position="absolute");var c=e.olLayer.getOpacity();e.renderState.opacity!==c&&(n.style.opacity=c,e.renderState.opacity=c);var a=o.rotation;e.renderState.rotation!==a&&(e.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,e.renderState.rotation=a),e.renderState.zoom===o.zoom&&e.renderState.center[0]===o.center[0]&&e.renderState.center[1]===o.center[1]||(e.mbMap.jumpTo({center:Object(Ge.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,e.renderState.zoom=o.zoom,e.renderState.center=o.center);var u=e.map.getSize();if(e.renderState.size[0]===u[0]&&e.renderState.size[1]===u[1]||(r=!0,e.renderState.size=u),e.mbMap&&e.mbMap.style&&e.mbMap.isStyleLoaded()&&r)try{e.mbMap._frame&&(e.mbMap._frame.cancel(),e.mbMap._frame=null),e.mbMap._render()}catch(e){console.warn(e)}return n}});return(e=o.call(this,At(At({},t),{},{olLayer:r}))).styleUrl=t.url,e.apiKey=t.apiKey,e.apiKeyName=t.apiKeyName||"key",e.updateAttribution=e.updateAttribution.bind(Ht(e)),e}return t=i,(r=[{key:"init",value:function(e){var t=this;Ft(Kt(i.prototype),"init",this).call(this,e),this.map&&!this.mbMap&&(this.format=new Ye.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{t.mbMap&&t.mbMap.resize()}catch(e){console.warn(e)}}))))}},{key:"createStyleUrl",value:function(){return it(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var e=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){e.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var t=_t(this.map.getView().getCenter(),2),r=t[0],n=t[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new $e.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ge.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(e){console.warn("Failed creating mapbox map: ",e)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){e.loaded=!0,e.copyrights=e.copyrights||ct(e.mbMap)||[],e.olLayer.getSource().setAttributions(e.copyrights),e.dispatchEvent({type:"load",target:e})}));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(){e.loadMbMap()})))}},{key:"updateAttribution",value:function(e){var t=this.copyrights||ct(e.target)||[];this.copyrights.toString()!==t.toString()&&this.olLayer.getSource().setAttributions(t)}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){var r=this;if(!(t&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:e,features:[],layer:this});var n=e&&this.mbMap.project(Object(Ge.toLonLat)(e));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,t).map((function(e){var t=r.format.readFeature(e);return t&&t.set("mapboxFeature",e),t}));return Promise.resolve({layer:this,features:a,coordinate:e})}},{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,Ft(Kt(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(e){return new i(At(At({},this.options),e))}}])&&Bt(t.prototype,r),n&&Bt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);var Zt=r(1),Gt=r(13),Wt=r(7);var $t=new Zt.Circle({radius:6,fill:new Zt.Fill({color:[255,0,0,1]}),stroke:new Zt.Stroke({color:[0,0,0,1],width:1})}),Jt=(new Zt.Style({stroke:new Zt.Stroke({color:[0,0,0,1],width:5})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(8)),Qt=r(2),Xt=r(16),Yt=r.n(Xt),er=r(17),tr=r.n(er),rr=r(18),nr=r.n(rr);function or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ir(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ir(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var cr=function(e,t,r){var n,o,i=t.properties,c=i.time_intervals,a=i.olGeometry,u=i.coordinate;if(r&&u)n=u;else if(a.getType()===nr.a.POINT)n=a.getCoordinates();else if(a.getType()===nr.a.LINE_STRING){var l=c||[[]],s=l[0],f=l[l.length-1];if(e<s[0])o=or(s,3)[2],n=a.getFirstCoordinate();else if(e>f[0]){o=or(f,3)[2],n=a.getLastCoordinate()}else for(var p=0;p<l.length-1;p+=1){var y=or(l[p],2),h=y[0],b=y[1],v=or(l[p+1],2),d=v[0],m=v[1];if(h<=e&&e<=d){var g=Math.min((e-h)/(d-h),1)*(m-b)+b;n=a.getCoordinateAt(g),o=or(l[p],3)[2];break}}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",a);return{coord:n,rotation:o}};function ar(e){return function(e){if(Array.isArray(e))return sr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||lr(e)||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 ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||lr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(e,t){if(e){if("string"==typeof e)return sr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sr(e,t):void 0}}function sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var pr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.style=t.style,this.canvas=t.canvas||document.createElement("canvas")}var t,r,n;return t=e,(r=[{key:"renderTrajectories",value:function(e,t,r){var n=t.time,o=void 0===n?Date.now():n,i=t.size,c=void 0===i?[]:i,a=t.center,u=t.resolution,l=t.rotation,s=void 0===l?0:l,f=t.pixelRatio,p=r.noInterpolate,y=void 0!==p&&p,h=r.hoverVehicleId,b=r.selectedVehicleId,v=this.canvas,d=v.getContext("2d");d.clearRect(0,0,v.width,v.height);var m=ur(c,2),g=m[0],O=m[1];if(g&&O&&(v.width!==g||v.height!==O)){var j=[g*f,O*f];v.width=j[0],v.height=j[1]}var w,P,k,S,T,C,E,R,x=Object(Jt.compose)(Object(Jt.create)(),c[0]/2,c[1]/2,1/u,-1/u,-s,-a[0],-a[1]);v.style&&(v.style.width="".concat(v.width/f,"px"),v.style.height="".concat(v.height/f,"px"));for(var _=0,D=e.length-1;D>=0;D-=1){var I=e[D],A=I.properties,M=A.train_id,L=A.timeOffset,B=cr(o-(L||0),I,y),F=B.coord,U=B.rotation;if(e[D].properties.coordinate=F,e[D].properties.rotation=U,F){var V=Object(Jt.apply)(x,ar(F));if(V&&!((V=V.map((function(e){return e*f})))[0]<0||V[0]>v.width||V[1]<0||V[1]>v.height)){var q=this.style(I,t,r);if(q){_+=1;var N=q.width,H=q.height;h!==M&&b!==M&&d.drawImage(q,V[0]-N/2,V[1]-H/2,N,H),h&&h===M&&(w=q,P=V,k=N,S=H),b&&b===M&&(T=q,C=V,E=N,R=H)}}}}return T&&d.drawImage(T,C[0]-E/2,C[1]-R/2,E,R),w&&d.drawImage(w,P[0]-k/2,P[1]-S/2,k,S),{nbTrajectoriesRendered:_}}}])&&fr(t.prototype,r),n&&fr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),yr=function(e,t,r,n){var o=[];if(!(e||t||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(e){var t=e.properties.name||e.properties.line&&e.properties.line.name||"";return!!t&&i.some((function(e){return new RegExp(e,"i").test(t)}))}))}if(e){var c=("string"==typeof e?e.split(","):e).map((function(e){return e.replace(/\s+/g,"").toUpperCase()}));o.push((function(e){var t=e.properties,r=t.line,n=(t.name||r&&r.name||"").toUpperCase();return!!n&&c.includes(n)}))}if(t){var a=("string"==typeof t?t.split(","):t).map((function(e){return parseInt(e,10)}));o.push((function(e){var t=parseInt(e.properties.routeIdentifier.split(".")[0],10);return a.includes(t)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(e){return u.some((function(t){return new RegExp(t,"i").test(e.properties.operator)}))}))}return o.length?function(e){for(var t=0;t<o.length;t+=1)if(!o[t](e))return!1;return!0}:null};function hr(e){return(hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function br(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||dr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vr(e){return function(e){if(Array.isArray(e))return mr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||dr(e)||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 dr(e,t){if(e){if("string"==typeof e)return mr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mr(e,t):void 0}}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(r),!0).forEach((function(t){jr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wr(){return(wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Pr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Pr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Er(e)););return e}function kr(e,t){return(kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Er(e);if(t){var o=Er(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Tr(this,r)}}function Tr(e,t){if(t&&("object"===hr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cr(e)}function Cr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _r(e,t,r){return t&&xr(e.prototype,t),r&&xr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Dr=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kr(e,t)}(r,e);var t=Sr(r);function r(e){var n;return Rr(this,r),(n=t.call(this,Or({hitTolerance:10},e))).onFeatureHover=n.onFeatureHover.bind(Cr(n)),n.onFeatureClick=n.onFeatureClick.bind(Cr(n)),n.renderTrajectoriesInternal=n.renderTrajectoriesInternal.bind(Cr(n)),n.throttleRenderTrajectories=tr()(n.renderTrajectoriesInternal,50,{leading:!1,trailing:!0}),n.debounceRenderTrajectories=Yt()(n.renderTrajectoriesInternal,50,{leading:!0,trailing:!0,maxWait:5e3}),n}return _r(r,[{key:"defineProperties",value:function(e){var t=this,n=e.regexPublishedLineName,o=e.publishedLineName,i=e.tripNumber,c=e.operator,a=e.style,u=e.speed,l=e.pixelRatio,s=e.hoverVehicleId,f=e.selectedVehicleId,p=e.filter,y=e.sort,h=e.time,b=e.live,v={style:a};Object.keys(v).forEach((function(e){return void 0===v[e]&&delete v[e]}));var d=u||1,m=h||new Date;wr(Er(r.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:a||this.defaultStyle},speed:{get:function(){return d},set:function(e){d=e,t.start()}},filter:{value:p,writable:!0},sort:{value:y,writable:!0},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==b||b,writable:!0},time:{get:function(){return m},set:function(e){m=e&&e.getTime?e:new Date(e),t.renderTrajectories()}},trajectories:{value:{},writable:!0},renderedTrajectories:{get:function(){return t.tracker&&t.tracker.renderedTrajectories||[]}},hoverVehicleId:{value:s,writable:!0},selectedVehicleId:{value:f,writable:!0},pixelRatio:{value:l||window.devicePixelRatio||1,writable:!0},initTrackerOptions:{value:v,writable:!1},useRequestAnimationFrame:{value:e.useRequestAnimationFrame||!1,writable:!0},useThrottle:{value:e.useThrottle||!0,writable:!0},useDebounce:{value:e.useDebounce||!1,writable:!0},publishedLineName:{get:function(){return o},set:function(e){o=e,t.updateFilters()}},tripNumber:{get:function(){return i},set:function(e){i=e,t.updateFilters()}},operator:{get:function(){return c},set:function(e){c=e,t.updateFilters()}},regexPublishedLineName:{get:function(){return n},set:function(e){n=e,t.updateFilters()}},delayDisplay:{value:e.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:e.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:e.useDelayStyle||!1,writable:!0}}),this.useDelayStyle&&!this.sort&&(this.sort=function(e,t){var r=e.properties,n=t.properties;return null===r.delay&&null!==n.delay?1:null===n.delay&&null!==r.delay?-1:r.cancelled&&!n.cancelled?n.delay<18e4?-1:1:n.cancelled&&!r.cancelled?r.delay<18e4?1:-1:n.delay-r.delay}),this.updateFilters()}},{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr(Er(r.prototype),"init",this).call(this,e),this.tracker=new pr(Or(Or({style:function(){return t.style.apply(t,arguments)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(e){e.target.visible?t.start():t.stop()}))}},{key:"terminate",value:function(){if(this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker){var e=this.tracker.canvas;e.getContext("2d").clearRect(0,0,e.width,e.height),this.tracker=null}wr(Er(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var e=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){e.time=e.live?new Date:e.time.getTime()+e.updateTimeDelay*e.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){if(this.stopUpdateTime(),this.tracker){var e=this.tracker.canvas;e.getContext("2d").clearRect(0,0,e.width,e.height)}}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(e,t){if(!this.tracker)return!1;var r=this.live?Date.now():this.time,n=Object.values(this.trajectories);return this.sort&&n.sort(this.sort),this.renderState=this.tracker.renderTrajectories(n,Or(Or({},e),{},{pixelRatio:this.pixelRatio,time:r}),{noInterpolate:e.zoom<this.minZoomInterpolation||t,hoverVehicleId:this.hoverVehicleId,selectedVehicleId:this.selectedVehicleId,iconScale:this.iconScale,delayDisplay:this.delayDisplay,delayOutlineColor:this.delayOutlineColor,useDelayStyle:this.useDelayStyle}),!0}},{key:"renderTrajectories",value:function(e,t){var r=this;this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null),!t&&this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(e,t)})):!t&&this.useDebounce?this.debounceRenderTrajectories(e,t):!t&&this.useThrottle?this.throttleRenderTrajectories(e,t):this.renderTrajectoriesInternal(e,t)}},{key:"getVehicle",value:function(e){return Object.values(this.trajectories).filter(e)}},{key:"getVehiclesAtCoordinate",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(Qt.buffer)([].concat(vr(e),vr(e)),this.hitTolerance*t),o=Object.values(this.trajectories),i=[],c=0;c<o.length&&(o[c].properties.coordinate&&Object(Qt.containsCoordinate)(n,o[c].properties.coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.resolution,o=r.nb,i=this.getVehiclesAtCoordinate(e,n,o);return Promise.resolve({layer:this,features:i.map((function(e){return t.format.readFeature(e)})),coordinate:e})}},{key:"onZoomEnd",value:function(e){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(e){var t,r=Math.round(e),n=ft[r]||25,o=Math.max(25,n/this.speed),i=Math.min(o,500);if(this.useThrottle?this.throttleRenderTrajectories=tr()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0}):this.useDebounce&&(this.debounceRenderTrajectories=Yt()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0,maxWait:5e3})),null!==(t=this.api)&&void 0!==t&&t.buffer){var c=br(this.api.buffer,2)[1];this.api.buffer=[i,c]}return o}},{key:"updateFilters",value:function(){var e=tt.a.parse(window.location.search.toLowerCase()),t=this.publishedLineName||e.publishedlinename,r=this.tripNumber||e.tripnumber,n=this.operator||e.operator,o=this.regexPublishedLineName;(t||r||n||o)&&(this.filter=yr(t,r,n,o))}},{key:"defaultStyle",value:function(e,t){return St(e,t,this)}}]),r}(e)};function Ir(e){return(Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ar(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ar(Object(r),!0).forEach((function(t){Lr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ar(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ur(){return(Ur="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Vr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Vr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kr(e)););return e}function qr(e,t){return(qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Nr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kr(e);if(t){var o=Kr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hr(this,r)}}function Hr(e,t){if(t&&("object"===Ir(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Kr(e){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qr(e,t)}(i,e);var t,r,n,o=Nr(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Br(this,i),(e=o.call(this,Mr({},t))).olLayer=t.olLayer||new Wt.Group({layers:[new Wt.Vector({source:new Gt.Vector({features:[]})}),new Wt.Layer({source:new Qe.a({}),render:function(t){if(!e.tracker||!e.tracker.canvas)return null;if(e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style.width="100%",e.container.style.height="100%",e.transformContainer=document.createElement("div"),e.transformContainer.style.position="absolute",e.transformContainer.style.width="100%",e.transformContainer.style.height="100%",e.container.appendChild(e.transformContainer),e.tracker.canvas.style.position="absolute",e.tracker.canvas.style.top="0",e.tracker.canvas.style.left="0",e.tracker.canvas.style.transformOrigin="top left",e.transformContainer.appendChild(e.tracker.canvas)),e.renderedViewState){var r=t.viewState,n=r.center,o=r.resolution,i=r.rotation,c=e.renderedViewState,a=c.center,u=c.resolution,l=c.rotation;if(u/o>=3){var s=e.tracker.canvas;s.getContext("2d").clearRect(0,0,s.width,s.height)}else{var f=e.map.getPixelFromCoordinate(a),p=e.map.getPixelFromCoordinate(n);e.transformContainer.style.transform=Object(Jt.composeCssTransform)(f[0]-p[0],f[1]-p[1],u/o,u/o,i-l,0,0)}}return e.container}})]}),e.vectorLayer=e.olLayer.getLayers().item(0),e.renderState={center:[0,0],zoom:null,rotation:0},e}return t=i,(r=[{key:"init",value:function(e){var t=this;Ur(Kr(i.prototype),"init",this).call(this,e),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(e){var r=t.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();t.currentZoom!==n&&t.onZoomEnd(e),t.currentZoom=n,t.onMoveEnd(e)}})))}},{key:"terminate",value:function(){Ur(Kr(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(e){if(this.map&&this.tracker&&this.tracker.canvas){var t=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(e);return!!t.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(e){var t=this.map.getView();Ur(Kr(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:t.calculateExtent(),resolution:t.getResolution(),rotation:t.getRotation(),zoom:t.getZoom(),pixelRatio:this.pixelRatio},e)}},{key:"renderTrajectoriesInternal",value:function(e,t){!this.map.getView().getAnimating()&&!this.map.getView().getInteracting()&&Ur(Kr(i.prototype),"renderTrajectoriesInternal",this).call(this,e,t)&&(this.renderedViewState=Mr({},e),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Ur(Kr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=this.map.getView().getResolution();return Ur(Kr(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(e))return Promise.resolve({features:[],layer:this,coordinate:e});var r=this.map.getView().getResolution();return Ur(Kr(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Mr({resolution:r},t))}},{key:"onMoveEnd",value:function(e){}},{key:"onZoomEnd",value:function(e){Ur(Kr(i.prototype),"onZoomEnd",this).call(this,e)}},{key:"onFeatureHover",value:function(e,t,r){Ur(Kr(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getTargetElement().style.cursor=e.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(e,t,r){Ur(Kr(i.prototype),"onFeatureClick",this).call(this,e,t,r),!e.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(e){return new i(Mr(Mr({},this.options),e))}}])&&Fr(t.prototype,r),n&&Fr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Dr(A)),Zr=r(14),Gr=r.n(Zr),Wr=r(4);function $r(e){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jr(Object(r),!0).forEach((function(t){Xr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function en(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tn(e,t){return(tn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=on(e);if(t){var o=on(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return nn(this,r)}}function nn(e,t){if(t&&("object"===$r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function on(e){return(on=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tn(e,t)}(i,e);var t,r,n,o=rn(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Yr(this,i),(e=o.call(this)).url=t.url,e.apiKey=t.apiKey,e}return t=i,(r=[{key:"fetch",value:function(e){function t(t,r,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r){var n=Qr(Qr({},t||{}),{},{key:this.apiKey}),o=Qr({},n);return Object.keys(n).forEach((function(e){return(void 0===o[e]||null===o[e])&&delete o[e]})),this.apiKey?fetch("".concat(this.url).concat(e||"","?").concat(tt.a.stringify(o)),r).then((function(e){try{return e.json().then((function(e){if(e.error)throw new Error(e.error);return e}))}catch(e){return Promise.reject(new Error(e))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&en(t.prototype,r),n&&en(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function an(e){return(an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ln(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?un(Object(r),!0).forEach((function(t){sn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yn(e,t){return(yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=vn(e);if(t){var o=vn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bn(this,r)}}function bn(e,t){if(t&&("object"===an(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function vn(e){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yn(e,t)}(i,e);var t,r,n,o=hn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fn(this,i),o.call(this,ln({url:"https://api.geops.io/stops/v1/"},e))}return t=i,(r=[{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",e,{signal:t.signal}).then((function(e){return e.features}))}}])&&pn(t.prototype,r),n&&pn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(cn);function mn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var On=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=n.d,i=n.m,c=n.y;t.push({day:o,month:i,year:c})}return t},jn=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(r),!0).forEach((function(t){gn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);["a","f","tt"].forEach((function(e){t[e]||(t[e]={})}));for(var r=t.id,n=t.hs,o=t.t,i=t.ln,c=t.sn,a=t.wa,u=t.ba,l=t.rt,s=t.fid,f=t.rid,p=t.c,y=t.tc,h=t.a,b=h.n,v=h.u,d=h.tz,m=t.f,g=m.n,O=m.u,j=m.tz,w=t.tt,P=w.n,k=w.p,S=w.t,T=t.sts,C=On(P),E=On(k),R=p&&"#".concat(p),x=y&&"#".concat(y),_=[],D=0;D<(T||[]).length;D+=1){var I=T[D],A=I.sid,M=I.n,L=I.p,B=I.at,F=I.dt,U=I.ap,V=I.dp,q=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;_.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==B?1e3*U:null,departureTime:-1!==F?1e3*V:null,arrivalDelay:q,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:R,color:x,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:_,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:l,feedsId:s,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:E},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},wn=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=new Wr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,l=i.RouteIdentifier,s=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;t.push({id:c,type:a,name:u,routeIdentifier:l,directionText:s,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 t};function Pn(e){return(Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(r),!0).forEach((function(t){Tn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Rn(e,t){return(Rn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Dn(e);if(t){var o=Dn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _n(this,r)}}function _n(e,t){if(t&&("object"===Pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Dn(e){return(Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var In=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rn(e,t)}(i,e);var t,r,n,o=xn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Cn(this,i),o.call(this,Sn({url:"https://api.geops.io/tracker/v1"},e))}return t=i,(r=[{key:"fetchTrajectoryById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",e,{signal:t.signal})}},{key:"fetchTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",e,{signal:t.signal}).then((function(e){return wn(e.features)}))}},{key:"fetchTrajectoryStations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",e,{signal:t.signal}).then((function(e){return jn(e)}))}}])&&En(t.prototype,r),n&&En(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(cn);function An(e){return function(e){if(Array.isArray(e))return Mn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Mn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mn(e,t)}(e)||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 Mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ln(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Bn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defineProperties()}var t,r,n;return t=e,n=[{key:"getRequestString",value:function(e,t){var r="".concat(e," ").concat(t.channel);return r+=t.args?" ".concat(t.args):"",(r+=t.id?" ".concat(t.id):"").trim()}}],(r=[{key:"defineProperties",value:function(){var e=this;Object.defineProperties(this,{closed:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSED)}},closing:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSING)}},connecting:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CONNECTING)}},open:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.OPEN)}},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}},{key:"connect",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(e),this.open?(r(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(function(){r(),t.subscribePreviousSubscriptions()}))}},{key:"close",value:function(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}},{key:"send",value:function(e){var t=this;if(this.websocket){var r=function(){t.websocket.send(e)};this.open?this.messagesOnOpen.includes(e)||r():this.messagesOnOpen.includes(e)||(this.messagesOnOpen.push(e),this.websocket.addEventListener("open",(function(){t.messagesOnOpen=[],r()})),this.websocket.addEventListener("close",(function(){t.messagesOnOpen=[]})))}}},{key:"listen",value:function(e,t,r){this.unlisten(e,t);var n=function(r){var n={};try{n=JSON.parse(r.data)}catch(e){console.error("WebSocket: unable to parse JSON data",e,r.data)}var o=e.channel;o+=e.args?" ".concat(e.args):"",("buffer"===n.source?n.content:[n]).forEach((function(r){(null==r?void 0:r.source)!==o||e.id&&e.id!==n.client_reference||t(r)}))};return this.websocket&&(this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r))),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(e,t){var r=this;this.websocket&&this.subscriptions.filter((function(r){return r.params.channel===e.channel&&(!t||r.cb===t)})).forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))}))}},{key:"get",value:function(t,r,n){var o=e.getRequestString("GET",t);this.send(o),this.listen(t,r,n)}},{key:"subscribe",value:function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(t,r,n),c=i.onMessageCb,a=i.onErrorCb,u=e.getRequestString("",t),l=this.subscriptions.findIndex((function(e){return t.channel===e.params.channel&&r===e.cb})),s={params:t,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,quiet:o};l>-1?this.subscriptions[l]=s:this.subscriptions.push(s),this.subscribed[u]||(s.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(e,t){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===e&&(!t||r.cb===t)}));n.forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==e||t&&r.cb!==t})),e&&this.subscribed[e]&&!this.subscriptions.find((function(t){return t.params.channel===e}))&&n.find((function(e){return!e.quiet}))&&(this.send("DEL ".concat(e)),this.subscribed[e]=!1)}},{key:"subscribePreviousSubscriptions",value:function(){var e=this;Object.keys(this.subscribed).forEach((function(t){e.subscribed[t]=!1})),An(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)}))}}])&&Ln(t.prototype,r),n&&Ln(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Fn=function(e,t){return e===t.SCHEMATIC?"_schematic":""},Un=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=e.has_fzo&&n.indexOf(e.state)>-1,i=t.has_fzo&&n.indexOf(t.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(e.state!==t.state)return n.indexOf(e.state)-n.indexOf(t.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(e.min_arrival_time||e.time).getTime()-u,a=new Date(t.min_arrival_time||t.time).getTime()-u):(c=new Date(e.time).getTime()-u,a=new Date(t.time).getTime()-u),c-a},Vn=function(e){if(e)return e.stations.forEach((function(e){e.arrivalTimeWithDelay=e.arrivalTime,e.departureTime&&(e.departureTimeWithDelay=e.departureTime),e.arrivalDelay&&(e.arrivalTime-=e.arrivalDelay,e.departureTime&&(e.departureTime-=e.arrivalDelay))})),e};function qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Hn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},Kn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qn(this,e),this.defineProperties(t),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=t.prefix||"",this.onOpen=this.onOpen.bind(this)}var t,r,n;return t=e,(r=[{key:"defineProperties",value:function(e){var t=this,r=e;"string"==typeof e&&(r={url:e});var n=r.apiKey,o=r,i=o.url,c=o.projection,a=o.bbox,u=o.buffer,l=void 0===u?[100,100]:u,s=new Bn;n&&(i="".concat(i||"wss://tralis-tracker-api.geops.io/ws","?key=").concat(n)),Object.defineProperties(this,{url:{get:function(){return i},set:function(e){i=e,t.open()}},projection:{get:function(){return c},set:function(e){e!==c&&(c=e,t.conn&&t.conn.send("PROJECTION ".concat(c)))}},bbox:{get:function(){return a},set:function(e){JSON.stringify(e)!==JSON.stringify(a)&&(a=e,t.conn&&t.conn.send("BBOX ".concat(a.join(" "))))}},buffer:{get:function(){return l},set:function(e){JSON.stringify(e)!==JSON.stringify(l)&&(l=e,t.conn&&t.conn.send("BUFFER ".concat(l.join(" "))))}},conn:{value:s,writable:!0},pingIntervalMs:{value:e.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:e.pingIntervalMs||100,writable:!0}})}},{key:"open",value:function(){var e=this;this.close(),this.conn.connect(this.url,this.onOpen),this.conn.websocket.onclose=function(){e.onClose()}}},{key:"close",value:function(){this.conn.close()}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"onOpen",value:function(){var e=this;this.projection&&this.conn.send("PROJECTION ".concat(this.projection)),this.bbox&&this.conn.send("BBOX ".concat(this.bbox.join(" "))),this.buffer&&this.conn.send("BUFFER ".concat(this.buffer.join(" "))),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval((function(){e.conn.send("PING")}),this.pingIntervalMs))}},{key:"onClose",value:function(){var e=this;window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((function(){return e.open()}),this.reconnectTimeoutMs))}},{key:"subscribe",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:e},t,r,n)}},{key:"unsubscribe",value:function(e,t,r){this.conn.unsubscribe("".concat(e).concat(Fn(Hn.SCHEMATIC,Hn)).concat(t),r),this.conn.unsubscribe("".concat(e).concat(Fn(Hn.TOPOGRAPHIC,Hn)).concat(t||""),r)}},{key:"filterDepartures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(e).map((function(t){return e[t]}));r.sort((function(e,r){return Un(e,r,t)}));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 l=r[u],s=new Date(l.time).getTime();s>o&&s<n&&("BOARDING"===l.state&&(-1===c.indexOf(l.platform)?c.push(l.platform):l.state="HIDDEN"),a&&l.to[0]===a.to[0]&&Math.abs(s-a.time)<1e3&&l.line.name===a.line.name&&(l.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(l.state)&&(l.cancelled=!0),(a=l).time=s,i.unshift(l))}return i}},{key:"subscribeDepartures",value:function(e,t,r){var n=this;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=e;var o=e?"timetable_".concat(e):null,i={};this.subscribe(o,(function(e){if(e.source===o){var c=e.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(n.departureUpdateTimeout),n.departureUpdateTimeout=window.setTimeout((function(){var e=n.filterDepartures(i,t||!1);r(e)}),100)}}),(function(){r([])}))}},{key:"unsubscribeDepartures",value:function(e){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",e),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(e){this.subscribe("".concat(this.prefix,"newsticker"),(function(t){e(t.content)}))}},{key:"unsubscribeDisruptions",value:function(e){this.unsubscribe("".concat(this.prefix,"newsticker"),"",e)}},{key:"getStation",value:function(e,t){var r=this,n={channel:"station".concat(Fn(t,Hn)),args:e};return new Promise((function(e,t){r.conn.get(n,(function(r){r.content?e(r.content):t()}))}))}},{key:"getStations",value:function(e){var t=this,r=[],n={channel:"station".concat(Fn(e,Hn))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(e,o){t.conn.get(n,(function(n){n.content?(r.push(n.content),window.clearTimeout(t.stationUpdateTimeout),t.stationUpdateTimeout=window.setTimeout((function(){e(r)}),50)):o(n.content)}))}))}},{key:"subscribeStations",value:function(e,t){this.unsubscribeStations(),this.subscribe("station".concat(Fn(e,Hn)),(function(e){e.content&&t(e.content)}))}},{key:"unsubscribeStations",value:function(e){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",e)}},{key:"subscribeExtraGeoms",value:function(e){var t=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?t.extraGeoms[o]=n:delete t.extraGeoms[o],e(Object.keys(t.extraGeoms).map((function(e){return t.extraGeoms[e]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(e){this.unsubscribe("extra_geoms","",e)}},{key:"subscribeTrajectory",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeTrajectory(t),this.subscribe("trajectory".concat(Fn(e,Hn)),t,null,r)}},{key:"unsubscribeTrajectory",value:function(e){this.unsubscribe("trajectory","",e)}},{key:"subscribeDeletedVehicles",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeDeletedVehicles(t),this.subscribe("deleted_vehicles".concat(Fn(e,Hn)),t,null,r)}},{key:"unsubscribeDeletedVehicles",value:function(e){this.unsubscribe("deleted_vehicles","",e)}},{key:"getFullTrajectory",value:function(e,t,r){var n=this,o=["full_trajectory".concat(Fn(t,Hn))];e&&o.push(e),t&&t!==Hn.TOPOGRAPHIC||!r||o.push("gen".concat(r));var i={channel:o.join("_")};return new Promise((function(e){n.conn.get(i,(function(t){t.content&&e(t.content)}))}))}},{key:"getFullTrajectories",value:function(e,t,r){var n=this,o=e.map((function(e){return n.getFullTrajectory(e,t,r)}));return Promise.all(o)}},{key:"subscribeFullTrajectory",value:function(e,t){this.unsubscribeFullTrajectory(e),this.subscribe("full_trajectory".concat(Fn(t,Hn),"_").concat(e),(function(e){console.log("subscribe full_trajectory",e)}),(function(e){console.log("subscribe full_trajectory error",e)}))}},{key:"unsubscribeFullTrajectory",value:function(e,t){this.unsubscribe("full_trajectory","_".concat(e),t)}},{key:"getStopSequence",value:function(e){var t=this,r={channel:"stopsequence_".concat(e)};return new Promise((function(e,n){t.conn.get(r,(function(t){if(t.content&&t.content.length){var r=t.content.map((function(e){return Vn(e)}));e(r)}e([])}),(function(e){n(e)}))}))}},{key:"getStopSequences",value:function(e){var t=this,r=e.map((function(e){return t.getStopSequence(e)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(e,t){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(e),this.subscribe("stopsequence_".concat(e),(function(e){if(e.content&&e.content.length){var r=e.content.map((function(e){return Vn(e)}));t(r)}}),(function(e){console.log("subscribe stopsequence error",e)}))}},{key:"unsubscribeStopSequence",value:function(e,t){this.unsubscribe("stopsequence","_".concat(e),t)}},{key:"subscribeHealthCheck",value:function(e){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",e)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&Nn(t.prototype,r),n&&Nn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function zn(e){return(zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(r),!0).forEach((function(t){Wn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Qn(){return(Qn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Xn(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Xn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ro(e)););return e}function Yn(e,t){return(Yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ro(e);if(t){var o=ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return to(this,r)}}function to(e,t){if(t&&("object"===zn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ro(e){return(ro=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function no(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function io(e,t,r){return t&&oo(e.prototype,t),r&&oo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var co=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yn(e,t)}(r,e);var t=eo(r);function r(){return no(this,r),t.apply(this,arguments)}return io(r,[{key:"defineProperties",value:function(e){var t=this;Qn(ro(r.prototype),"defineProperties",this).call(this,e);var n,o=3;if(!e.api){var i={};e.url&&(i.url=e.url),e.apiKey&&(i.apiKey=e.apiKey),n=new In(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(e){e!==o&&(o=e,t.visible&&t.start())}},api:{value:e.api||n}})}},{key:"init",value:function(e){Qn(ro(r.prototype),"init",this).call(this,e),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(e,t){return null===e.delay||e.delay<t.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),Qn(ro(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Qn(ro(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(e,t,n){var o=$n(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Qn(ro(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=$n(e,1)[0];o?(this.selectedVehicleId=o.get("train_id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Qn(ro(r.prototype),"onFeatureClick",this).call(this,e,t,n)}},{key:"highlightTrajectory",value:function(){var e=this,t=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:t,time:Rt(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:Rt(new Date)}))];Promise.all(n).then((function(t){var r=$n(t,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(e){i.push(e.coordinates)})),o){var c=o.p,a=o.t,u=o.c,l=[];c.forEach((function(e){e.forEach((function(e){l.push([e.x,e.y])}))}));var s=u?"#".concat(u):ht(a),f=/#ffffff/i.test(s)?"#ff0000":s;e.drawFullTrajectory(i,l,e.useDelayStyle?"#a0a0a0":f)}})).catch((function(){e.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=1e3*(this.requestIntervalSeconds+5),r=this.speed*t,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=Gn(Gn({},e),{},{btime:Rt(n),etime:Rt(this.later),date:Et(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var e=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){e.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var e=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(e){if("AbortError"!==e.name)throw e})).then((function(t){t&&(e.trajectories=t,e.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(e,t,r){}},{key:"defaultStyle",value:function(e,t){var r=t.zoom,n=e.type,o=e.name,i=e.id,c=e.color,a=e.textColor,u=e.delay,l=e.cancelled,s=e.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(s).concat(u).concat(p).concat(y).concat(l),b=yt(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(s).concat(u).concat(p).concat(y).concat(l)),!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=dt(u,l),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||l)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(l?19:14,Math.min(l?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=dt(u,l,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=mt(u,l);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?dt(u,l):c||ht(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"===s&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=vt(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===s&&(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||bt(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}(e)};function ao(e){return(ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(r),!0).forEach((function(t){so(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function so(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function po(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yo(){return(yo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ho(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ho(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=go(e)););return e}function bo(e,t){return(bo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=go(e);if(t){var o=go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mo(this,r)}}function mo(e,t){if(t&&("object"===ao(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function go(e){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Oo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bo(e,t)}(i,e);var t,r,n,o=vo(i);function i(){return fo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"start",value:function(){var e=this;this.map&&(yo(go(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){e.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),yo(go(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var e=this.map.getView().getZoom();e!==this.currentZoom&&(this.currentZoom=e,this.requestIntervalSeconds=200/e||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(e,t,r){var n=this.vectorLayer.getSource();if(n.clear(),e){var o=new Wr.MultiPoint(e.map((function(e){return Object(Ge.fromLonLat)(e)}))),i=new Gr.a(o);i.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var c=new Gr.a(o);c.setStyle(new Zt.Style({zIndex:4,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:r})})})),n.addFeatures([i,c])}if(t){var a=new Gr.a({geometry:new Wr.LineString(t)});a.setStyle([new Zt.Style({zIndex:2,stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,stroke:new Zt.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getView().calculateExtent(),r=Object(Qt.buffer)(t,Object(Qt.getWidth)(t)/10).join(","),n=this.map.getView().getZoom();return yo(go(i.prototype),"getParams",this).call(this,lo(lo({},e),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(e){return new i(lo(lo({},this.options),e))}}])&&po(t.prototype,r),n&&po(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(co(zr));r(29);function jo(e){return(jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||ko(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Po(e){return function(e){if(Array.isArray(e))return So(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ko(e)||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 ko(e,t){if(e){if("string"==typeof e)return So(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?So(e,t):void 0}}function So(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function To(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Co(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?To(Object(r),!0).forEach((function(t){Eo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):To(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ro(){return(Ro="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=xo(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function xo(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Mo(e)););return e}function _o(e,t){return(_o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Do(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mo(e);if(t){var o=Mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Io(this,r)}}function Io(e,t){if(t&&("object"===jo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ao(e)}function Ao(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mo(e){return(Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Lo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fo(e,t,r){return t&&Bo(e.prototype,t),r&&Bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Uo=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_o(e,t)}(r,e);var t=Do(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Lo(this,r),(e=t.call(this,Co({},n))).debug=n.debug,e.mode=n.mode||Hn.TOPOGRAPHIC,e.api=n.api||new Kn(n),e.tenant=n.tenant||"",e.minZoomNonTrain=n.minZoomNonTrain||9,e.minZoomInterpolation=n.minZoomInterpolation||8,e.format=new Ye.a,e.generalizationLevelByZoom=n.generalizationLevelByZoom||{0:5,1:5,2:5,3:5,4:5,5:5,6:5,7:5,8:10,9:30,10:30,11:100,12:100,13:100},e.isUpdateBboxOnMoveEnd=!1!==n.isUpdateBboxOnMoveEnd,e.onTrajectoryMessage=e.onTrajectoryMessage.bind(Ao(e)),e.onDeleteTrajectoryMessage=e.onDeleteTrajectoryMessage.bind(Ao(e)),e.onDocumentVisibilityChange=e.onDocumentVisibilityChange.bind(Ao(e)),e}return Fo(r,[{key:"init",value:function(e){Ro(Mo(r.prototype),"init",this).call(this,e),document.addEventListener("visibilitychange",this.onDocumentVisibilityChange)}},{key:"terminate",value:function(){document.removeEventListener("visibilitychange",this.onDocumentVisibilityChange),Ro(Mo(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Ro(Mo(r.prototype),"start",this).call(this),this.api.open(),this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.isUpdateBboxOnMoveEnd&&this.setBbox()}},{key:"stop",value:function(){Ro(Mo(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close()}},{key:"setBbox",value:function(e,t){for(var r=Object.keys(this.trajectories),n=r.length-1;n>=0;n-=1)this.purgeTrajectory(this.trajectories[r[n]],e,t);var o=Po(e);this.isUpdateBboxOnMoveEnd&&(o.push(t),this.tenant&&o.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[t],this.generalizationLevel&&o.push("gen=".concat(this.generalizationLevel))),this.api.bbox=o}},{key:"setMode",value:function(e){this.mode!==e&&(this.mode=e,this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd))}},{key:"getTrajectoryInfos",value:function(e){var t=[this.api.getStopSequence(e,this.mode),this.api.getFullTrajectory(e,this.mode,this.generalizationLevel)];return Promise.all(t).then((function(e){var t=wo(e,2);return{stopSequence:t[0],fullTrajectory:t[1]}}))}},{key:"purgeTrajectory",value:function(e,t,r){var n=e.properties,o=n.type,i=n.bounds,c=n.train_id;return(!Object(Qt.intersects)(t,i)||"rail"!==o&&r<(this.minZoomNonTrain||9))&&(this.removeTrajectory(c),!0)}},{key:"addTrajectory",value:function(e){this.filter&&!this.filter(e)||(this.trajectories[e.properties.train_id]=e,this.renderTrajectories())}},{key:"removeTrajectory",value:function(e){delete this.trajectories[e]}},{key:"onDocumentVisibilityChange",value:function(){this.visible&&(document.hidden?this.stop():this.start())}},{key:"onTrajectoryMessage",value:function(e){if(e.content){var t=e.content,r=t.geometry,n=t.properties,o=(n.train_id,n.time_since_update),i=n.raw_coordinates;o<0||this.purgeTrajectory(t)||(this.debug&&this.mode===Hn.TOPOGRAPHIC&&i?t.properties.olGeometry={type:"Point",coordinates:Object(Ge.fromLonLat)(i,this.map.getView().getProjection())}:t.properties.olGeometry=this.format.readGeometry(r),t.properties.timeOffset=Date.now()-e.timestamp,this.addTrajectory(t))}}},{key:"onDeleteTrajectoryMessage",value:function(e){e.content&&this.removeTrajectory(e.content)}},{key:"onFeatureHover",value:function(e,t,n){var o=wo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories(!0)),Ro(Mo(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=wo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.selectedVehicleId!==i&&(this.selectedVehicleId=i,this.selectedVehicle=o,this.renderTrajectories(!0)),Ro(Mo(r.prototype),"onFeatureClick",this).call(this,e,t,n)}}]),r}(e)};function Vo(e){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function No(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qo(Object(r),!0).forEach((function(t){Ho(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ho(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ko(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zo(){return(Zo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Go(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Go(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Qo(e)););return e}function Wo(e,t){return(Wo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qo(e);if(t){var o=Qo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jo(this,r)}}function Jo(e,t){if(t&&("object"===Vo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Qo(e){return(Qo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xo=new Ye.a,Yo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wo(e,t)}(i,e);var t,r,n,o=$o(i);function i(){return Ko(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"purgeTrajectory",value:function(e,t,r){return Zo(Qo(i.prototype),"purgeTrajectory",this).call(this,e,t||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.map.getView().calculateExtent(),n=Math.floor(this.map.getView().getZoom())),Zo(Qo(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Zo(Qo(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.isClickActive&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"onFeatureClick",value:function(e,t,r){Zo(Qo(i.prototype),"onFeatureClick",this).call(this,e,t,r),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"highlightTrajectory",value:function(e){var t=this;this.api.getFullTrajectory(e,this.mode,this.generalizationLevel).then((function(e){if(t.vectorLayer.getSource().clear(),e&&e.features&&e.features.length){var r="#ffffff";if(t.useDelayStyle)r="#a0a0a0";else{var n=e.features[0].properties,o=n.type,i=n.stroke;i&&"#"!==i[0]&&(i="#".concat(i)),r=i||ht(o),r=/#ffffff/i.test(r)?"#ff0000":r}var c=[new Zt.Style({zIndex:2,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})}),stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:r})}),stroke:new Zt.Stroke({color:r,width:4})})];t.vectorLayer.setStyle(c);var a=Xo.readFeatures(e);a.forEach((function(e){e.setStyle(c)})),t.vectorLayer.getSource().addFeatures(a)}}))}},{key:"clone",value:function(e){return new i(No(No({},this.options),e))}}])&&zo(t.prototype,r),n&&zo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Uo(zr));function ei(e){return(ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ri(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ti(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ni(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ii(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ci(e,t){return(ci=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ai(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=li(e);if(t){var o=li(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ui(this,r)}}function ui(e,t){if(t&&("object"===ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function li(e){return(li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var si=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ci(e,t)}(i,e);var t,r,n,o=ai(i);function i(){return oi(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(e);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(e){return e===t.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:e})}},{key:"clone",value:function(e){return new i(ri(ri({},this.options),e))}}])&&ii(t.prototype,r),n&&ii(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);function fi(e){return(fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pi(Object(r),!0).forEach((function(t){hi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function di(e,t){return(di=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Oi(e);if(t){var o=Oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gi(this,r)}}function gi(e,t){if(t&&("object"===fi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oi(e){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ji=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&di(e,t)}(i,e);var t,r,n,o=mi(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return bi(this,i),(e=o.call(this,t)).abortController=new AbortController,e.format=new Ye.a,e}return t=i,(r=[{key:"getFeatureInfoUrl",value:function(e){var t=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(e,r,t,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(e),{signal:r}).then((function(e){return e.json()})).then((function(e){return e.features})).then((function(r){return{layer:t,coordinate:e,features:r.map((function(e){return t.format.readFeature(e)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:e,layer:t})}))}},{key:"clone",value:function(e){return new i(yi(yi({},this.options),e))}}])&&vi(t.prototype,r),n&&vi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);r(15),r(26),r(27),r(19);function wi(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ki(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pi(Object(r),!0).forEach((function(t){Si(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ti(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ci(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ri(e);if(t){var o=Ri(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ei(this,r)}}function Ei(e,t){if(t&&("object"===wi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ri(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Di(e,t,r){return t&&_i(e.prototype,t),r&&_i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ii(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ai(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Li(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ui(e);if(t){var o=Ui(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Fi(this,r)}}function Fi(e,t){if(t&&("object"===Ii(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ui(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Vi=G;var Vi;function qi(e){return(qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ni(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hi(){return(Hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ki(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ki(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$i(e)););return e}function zi(e,t){return(zi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$i(e);if(t){var o=$i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gi(this,r)}}function Gi(e,t){if(t&&("object"===qi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wi(e)}function Wi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $i(e){return($i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ji=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zi(e,t)}(i,e);var t,r,n,o=Zi(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).render=t.render.bind(Wi(t)),t}return t=i,(r=[{key:"activate",value:function(){Hi($i(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),Hi($i(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return ct(this.map)}}])&&Ni(t.prototype,r),n&&Ni(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function Qi(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Yi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xi(Object(r),!0).forEach((function(t){ec(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ec(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rc(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=nc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function nc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==ac(e););return e}function oc(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ic(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ac(e);if(t){var o=ac(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return cc(this,r)}}function cc(e,t){if(t&&("object"===Qi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ac(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ae(We.Map);var uc=r(20),lc=r.n(uc),sc=r(21);function fc(e){return(fc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pc(e){return function(e){if(Array.isArray(e))return yc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yc(e,t)}(e)||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 yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(r),!0).forEach((function(t){vc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function gc(){return(gc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Oc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Oc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=kc(e)););return e}function jc(e,t){return(jc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kc(e);if(t){var o=kc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pc(this,r)}}function Pc(e,t){if(t&&("object"===fc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function kc(e){return(kc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Sc(e){return function(e){if(Array.isArray(e))return Tc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Tc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tc(e,t)}(e)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Cc=function(e){var t=e.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Sc(r),Sc(n)),i=e.getCanvas(),c=i.width,a=i.height,u=Object(Qt.getWidth)(o)/c,l=Object(Qt.getHeight)(o)/a;return Math.max(u,l)},Ec=function(e,t){var r=e.getCanvas(),n=r.width,o=r.height,i=e.unproject({x:0,y:0}),c=e.unproject({x:0,y:o/t}),a=e.unproject({x:n/t,y:o/t}),u=e.unproject({x:n/t,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function Rc(e){return(Rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xc(e){return function(e){if(Array.isArray(e))return _c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return _c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _c(e,t)}(e)||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 _c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Dc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dc(Object(r),!0).forEach((function(t){Ac(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ac(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Bc(){return(Bc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Fc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Fc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Hc(e)););return e}function Uc(e,t){return(Uc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Hc(e);if(t){var o=Hc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qc(this,r)}}function qc(e,t){if(t&&("object"===Rc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Nc(e)}function Nc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hc(e){return(Hc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Kc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uc(e,t)}(i,e);var t,r,n,o=Vc(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Mc(this,i),(e=o.call(this,Ic({},t))).onMove=e.onMove.bind(Nc(e)),e.onMoveEnd=e.onMoveEnd.bind(Nc(e)),e.onZoomEnd=e.onZoomEnd.bind(Nc(e)),e.onVisibilityChange=e.onVisibilityChange.bind(Nc(e)),e}return t=i,(r=[{key:"init",value:function(e,t){if(e){var r=e.getCanvas();Bc(Hc(i.prototype),"init",this).call(this,e,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:Ec(e,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=t,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"}},e.addSource(this.key,n),e.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),Bc(Hc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Bc(Hc(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(){Bc(Hc(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(e){Bc(Hc(i.prototype),"onUserClickCallback",this).call(this,Ic({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"onUserMoveCallback",value:function(e){Bc(Hc(i.prototype),"onUserMoveCallback",this).call(this,Ic({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"renderTrajectories",value:function(e){var t=this.map.getCanvas(),r=t.width,n=t.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=lc()(Object(sc.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=lc()(Object(sc.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=[].concat(xc(Object(Ge.fromLonLat)(u)),xc(Object(Ge.fromLonLat)(l))),f=Object(Qt.getWidth)(s)/(r/this.pixelRatio),p=Object(Qt.getHeight)(s)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ge.fromLonLat)([o.lng,o.lat]),extent:s,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};Bc(Hc(i.prototype),"renderTrajectories",this).call(this,h,e)}},{key:"getRefreshTimeInMs",value:function(){return Bc(Hc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=Cc(this.map);return Bc(Hc(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Cc(this.map);return Bc(Hc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Ic({resolution:r},t))}},{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 e=Ec(this.map,this.pixelRatio),t=this.map.getSource(this.key);t&&t.setCoordinates(e),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){this.renderTrajectories()}},{key:"onFeatureHover",value:function(e,t,r){Bc(Hc(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getCanvasContainer().style.cursor=e.length?"pointer":"auto"}}])&&Lc(t.prototype,r),n&&Lc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Dr(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jc(e,t)}(i,e);var t,r,n,o=wc(i);function i(){return dc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"init",value:function(e){gc(kc(i.prototype),"init",this).call(this,e),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(e){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),gc(kc(i.prototype),"terminate",this).call(this,e)}},{key:"onUserClickCallback",value:function(e){gc(kc(i.prototype),"onUserClickCallback",this).call(this,bc({coordinate:e.lngLat.toArray()},e))}},{key:"onUserMoveCallback",value:function(e){gc(kc(i.prototype),"onUserMoveCallback",this).call(this,bc({coordinate:e.lngLat.toArray()},e))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var e=this.map.getBounds().toArray();return Object(Ge.transformExtent)([].concat(pc(e[0]),pc(e[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(e){return new i(bc(bc({},this.options),e))}}])&&mc(t.prototype,r),n&&mc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w)));function zc(e){return(zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wc(){return(Wc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=$c(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function $c(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Yc(e)););return e}function Jc(e,t){return(Jc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Yc(e);if(t){var o=Yc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Xc(this,r)}}function Xc(e,t){if(t&&("object"===zc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Yc(e){return(Yc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ea=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jc(e,t)}(i,e);var t,r,n,o=Qc(i);function i(){return Zc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"purgeTrajectory",value:function(e,t,r){return Wc(Yc(i.prototype),"purgeTrajectory",this).call(this,e,t||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.getMercatorExtent(),n=Math.floor(this.getOlZoom())),Wc(Yc(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Wc(Yc(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Gc(t.prototype,r),n&&Gc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Uo(Kc));function ta(e){return(ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ra(e){return function(e){if(Array.isArray(e))return na(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return na(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return na(e,t)}(e)||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 na(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function oa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(r),!0).forEach((function(t){ca(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ua(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function la(){return(la="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=sa(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function sa(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ba(e)););return e}function fa(e,t){return(fa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ba(e);if(t){var o=ba(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ya(this,r)}}function ya(e,t){if(t&&("object"===ta(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ha(e)}function ha(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ba(e){return(ba=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var va={mapbox:{TrajservLayer:function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fa(e,t)}(i,e);var t,r,n,o=pa(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return aa(this,i),(e=o.call(this,ia({},t))).onMove=e.onMove.bind(ha(e)),e.onMoveEnd=e.onMoveEnd.bind(ha(e)),e.onVisibilityChange=e.onVisibilityChange.bind(ha(e)),e}return t=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),la(ba(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(la(ba(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)),la(ba(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(ra(r),ra(n)),c=Object(Qt.buffer)(o,Object(Qt.getWidth)(o)/10).join(","),a=this.map.getZoom();return la(ba(i.prototype),"getParams",this).call(this,ia(ia({},e),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(e,t,r){console.log("to be implemented")}}])&&ua(t.prototype,r),n&&ua(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(co(Kc)),TralisLayer:ea},ol:{Map:Ze,Layer:A,WMSLayer:ji,MapboxLayer:zt,TrajservLayer:Oo,TralisLayer:Yo,VectorLayer:si}};t.default=va}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|