mobility-toolbox-js 1.4.3 → 1.4.4
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/api/tralis/TralisAPI.js +9 -2
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],e):"object"==typeof exports?exports["mobility-toolbox-js"]=e():t["mobility-toolbox-js"]=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e){t.exports=require("ol/proj")},function(t,e){t.exports=require("ol/style")},function(t,e){t.exports=require("ol/Observable")},function(t,e){t.exports=require("ol/geom")},function(t,e){t.exports=require("ol/extent")},function(t,e){t.exports=require("query-string")},function(t,e){t.exports=require("ol/layer")},function(t,e){t.exports=require("ol/format/GeoJSON")},function(t,e){t.exports=require("ol/Feature")},function(t,e){t.exports=require("ol/Object")},function(t,e){t.exports=require("ol/layer/Layer")},function(t,e){t.exports=require("mapbox-gl")},function(t,e){t.exports=require("ol/source/Source")},function(t,e){t.exports=require("ol/source")},function(t,e){t.exports=require("ol")},function(t,e){t.exports=require("ol/geom/GeometryType")},function(t,e){t.exports=require("ol/format")},function(t,e){t.exports=require("ol/Map")},function(t,e){t.exports=require("ol/control")},function(t,e){t.exports=require("ol/layer/Group")},function(t,e){t.exports=require("uuid")},function(t,e){t.exports=require("ol/geom/Point")},function(t,e){t.exports=require("ol/interaction")},function(t,e){t.exports=require("ol/events/condition")},function(t,e,r){t.exports=r(25)},function(t,e,r){"use strict";r.r(e);var n=r(17),o=r.n(n),i=r(18),c=r(2),a=r.n(c),u=r(19),s=r.n(u),l=r(20);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g(t);if(e){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}function m(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var O=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(i,t);var e,r,n,o=d(i);function i(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this)).defineProperties(y({isQueryable:!0},t)),t.copyrights&&(e.copyrights=t.copyrights);var r=t.onClick;return r&&e.onClick(r),e}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=t.name,n=t.key,o=t.children,i=t.visible,c=t.properties,a=t.isBaseLayer,u=t.isQueryable,s=t.hitTolerance,f=Object(l.v4)(),p=r||f;Object.defineProperties(this,{options:{value:t},name:{value:p},key:{value:n||p.toLowerCase()},isBaseLayer:{value:!!a},isQueryable:{value:!!u},hitTolerance:{value:s||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:o||[],writable:!0},copyrights:{get:function(){return e.get("copyrights")},set:function(t){var r=Array.isArray(t)?t:[t];return e.set("copyrights",r)}},visible:{value:void 0===i||i,writable:!0},properties:{value:y({},c||{})},map:{writable:!0},clickCallbacks:{value:[]}})}},{key:"init",value:function(t){this.terminate(),this.map=t}},{key:"terminate",value:function(){}},{key:"get",value:function(t){return this.properties[t]}},{key:"set",value:function(t,e){this.properties[t]=e,this.dispatchEvent({type:"change:".concat(t),target:this})}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(this.visible=t,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:e,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(t){return t.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(t){return!!this.children.find((function(e){return e.visible===t}))}},{key:"addChild",value:function(t){this.children.unshift(t),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(t){for(var e=0;e<this.children.length;e+=1)if(this.children[e].name===t)return void this.children.splice(e,1);this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(){return Promise.resolve({layer:this,features:[],coordinate:null})}},{key:"onClick",value:function(t){if("function"!=typeof t)throw new Error("callback must be of type function.");this.clickCallbacks.includes(t)||this.clickCallbacks.push(t)}},{key:"unClick",value:function(t){if("function"==typeof t){var e=this.clickCallbacks.indexOf(t);e>=-1&&this.clickCallbacks.splice(e,1)}}}])&&b(e.prototype,r),n&&b(e,n),i}(a.a);function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function R(t,e,r){return(R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_(t);if(e){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return x(this,r)}}function x(t,e){return!e||"object"!==j(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&T(t,e)}(i,t);var e,r,n,o=D(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).olLayer&&e.olLayer.setVisible(e.visible),e}return e=i,(r=[{key:"defineProperties",value:function(t){R(_(i.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{olLayer:{value:t.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(t){var e=this;if(R(_(i.prototype),"init",this).call(this,t),this.map&&this.olLayer&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(t){t.element===e.olLayer&&e.terminate()}))),this.copyrights)){var r=this.copyrights||[];this.olLayer instanceof s.a?this.olLayer.getLayers().getArray().forEach((function(t){t.getSource().setAttributions(r)})):this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),R(_(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(R(_(i.prototype),"setVisible",this).call(this,t,e,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"clone",value:function(t){return new i(P(P({},this.options),t))}}])&&k(e.prototype,r),n&&k(e,n),i}(O),E=r(9),I=r.n(E);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){V(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function q(t,e){return(q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=K(t);if(e){var o=K(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return B(this,r)}}function B(t,e){return!e||"object"!==M(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function K(t){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&q(t,e)}(i,t);var e,r,n,o=N(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};F(this,i),(t=o.call(this,e)).defineProperties(e);var r=L({active:!1!==e.active},e),n=r.active;return t.active=n,t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=L({},t),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return e.get("active")},set:function(t){e.set("active",t),t?e.activate():e.deactivate(),e.render()}},map:{get:function(){return e.get("map")},set:function(t){if(e.map&&e.element&&e.element.parentNode&&e.element.parentNode.removeChild(e.element),e.deactivate(),e.set("map",t),e.map){var r=e.target||e.map.getContainer();e.element||e.createDefaultElement(),e.element&&r.appendChild(e.element),e.active&&e.activate()}e.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&U(e.prototype,r),n&&U(e,n),i}(I.a);function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(r),!0).forEach((function(e){W(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $(t,e,r){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=X(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function J(t,e){return(J=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Q(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=X(t);if(e){var o=X(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Y(this,r)}}function Y(t,e){return!e||"object"!==G(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function X(t){return(X=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rt(t,e,r){return e&&et(t.prototype,e),r&&et(t,r),t}var nt=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&J(t,e)}(r,t);var e=Q(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tt(this,r),(t=e.call(this,H(H({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],t.mobilityControls=[],(n.controls||[]).forEach((function(e){t.addControl(e)})),(n.layers||[]).forEach((function(e){t.addLayer(e)})),t}return rt(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(t){this.mobilityControls.push(t),t.map=this}},{key:"removeMobilityControl",value:function(t){t.map=null,this.mobilityControls=this.mobilityControls.filter((function(e){return e!==t}))}},{key:"addControl",value:function(t,e){t instanceof z?this.addMobilityControl(t):$(X(r.prototype),"addControl",this).call(this,t,e)}},{key:"removeControl",value:function(t){t instanceof z?this.removeMobilityControl(t):$(X(r.prototype),"removeControl",this).call(this,t)}}]),r}(t)},ot=r(10),it=r.n(ot);function ct(t){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=lt(t);if(e){var o=lt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return st(this,r)}}function st(t,e){return!e||"object"!==ct(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function lt(t){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function yt(t,e,r){return e&&pt(t.prototype,e),r&&pt(t,r),t}var ht=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(r,t);var e=ut(r);function r(){return ft(this,r),e.apply(this,arguments)}return yt(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(t)};function bt(t){return function(t){if(Array.isArray(t))return vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var dt=function(t){var e=t.filter((function(t){return null!=t&&t.trim&&t.trim()})),r=e.map((function(t){return t.toLowerCase()}));return bt(new Set(r)).map((function(t){return e.find((function(e){return e.toLowerCase()===t}))}))};function mt(t){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ot(t,e,r){return(Ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=kt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function jt(t,e){return(jt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=kt(t);if(e){var o=kt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pt(this,r)}}function Pt(t,e){return!e||"object"!==mt(e)&&"function"!=typeof e?St(t):e}function St(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function kt(t){return(kt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jt(t,e)}(i,t);var e,r,n,o=wt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).onPostRender=e.onPostRender.bind(St(e)),e}return e=i,(r=[{key:"getCopyrights",value:function(){var t=this;if(!this.frameState)return[];var e=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ot.inView)(r,t.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(e=e.concat(n.getSource().getAttributions()(t.frameState)))})),dt(e)}},{key:"activate",value:function(){Ot(kt(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),Ot(kt(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(t){this.map&&this.element&&(this.frameState=t.frameState,this.render())}}])&>(e.prototype,r),n&>(e,n),i}(ht(z));function Tt(t){return(Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dt(t){return function(t){if(Array.isArray(t))return xt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return xt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(r),!0).forEach((function(e){Et(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Et(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function It(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function At(t,e,r){return(At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ut(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Lt(t,e){return(Lt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ut(t);if(e){var o=Ut(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ft(this,r)}}function Ft(t,e){return!e||"object"!==Tt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ut(t){return(Ut=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var qt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Lt(t,e)}(c,t);var e,r,n,o=Vt(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return It(this,c),o.call(this,Ct({controls:[].concat(Dt(Object(i.defaults)({attribution:!1}).getArray()),[new Rt])},t))}return e=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(t){t instanceof C?(t.init(this),this.mobilityLayers.push(t),t.olLayer&&At(Ut(c.prototype),"addLayer",this).call(this,t.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):At(Ut(c.prototype),"addLayer",this).call(this,t)}},{key:"removeLayer",value:function(t){t instanceof C?(t.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(e){return e!==t})),t.olLayer&&At(Ut(c.prototype),"removeLayer",this).call(this,t)):At(Ut(c.prototype),"removeLayer",this).call(this,t)}},{key:"addControl",value:function(t){At(Ut(c.prototype),"addControl",this).call(this,t)}},{key:"removeControl",value:function(t){At(Ut(c.prototype),"removeControl",this).call(this,t)}}])&&Mt(e.prototype,r),n&&Mt(e,n),c}(nt(o.a)),Nt=r(0),Bt=r(11),Kt=r.n(Bt),zt=r(12),Gt=r.n(zt),Zt=r(7),Ht=r.n(Zt),Wt=r(5),$t=r.n(Wt);function Jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(r),!0).forEach((function(e){Yt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Yt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Xt=function(t,e,r){if(!1===t)return r;var n=$t.a.parseUrl(r);return!t&&n.query[e]?r:t?$t.a.stringifyUrl(Qt(Qt({},n),{},{query:Qt(Qt({},n.query),{},Yt({},e,t))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},te=function(t){if(!t||!t.style)return[];var e=t.style.sourceCaches,r=[];return Object.values(e).forEach((function(t){if(t.used){var e=t.getSource(),n=e.attribution||e.options&&e.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),dt(r)};function ee(t){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function re(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ne(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ie(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?oe(Object(r),!0).forEach((function(e){ce(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ce(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ue(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function se(t,e,r){return(se="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=he(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function le(t,e){return(le=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=he(t);if(e){var o=he(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return pe(this,r)}}function pe(t,e){return!e||"object"!==ee(e)&&"function"!=typeof e?ye(t):e}function ye(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function he(t){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var be=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&le(t,e)}(i,t);var e,r,n,o=fe(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ae(this,i);var r=new it.a({source:new Gt.a({}),render:function(e){if(!t.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=t.mbMap.getCanvas(),o=e.viewState,i=t.olLayer.getVisible();t.renderState.visible!==i&&(n.style.display=i?"block":"none",t.renderState.visible=i,n.style.position="absolute");var c=t.olLayer.getOpacity();t.renderState.opacity!==c&&(n.style.opacity=c,t.renderState.opacity=c);var a=o.rotation;t.renderState.rotation!==a&&(t.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,t.renderState.rotation=a),t.renderState.zoom===o.zoom&&t.renderState.center[0]===o.center[0]&&t.renderState.center[1]===o.center[1]||(t.mbMap.jumpTo({center:Object(Nt.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,t.renderState.zoom=o.zoom,t.renderState.center=o.center);var u=t.map.getSize();if(t.renderState.size[0]===u[0]&&t.renderState.size[1]===u[1]||(r=!0,t.renderState.size=u),t.mbMap&&t.mbMap.style&&t.mbMap.isStyleLoaded()&&r)try{t.mbMap._frame&&(t.mbMap._frame.cancel(),t.mbMap._frame=null),t.mbMap._render()}catch(t){console.warn(t)}return n}});return(t=o.call(this,ie(ie({},e),{},{olLayer:r}))).styleUrl=e.url,t.apiKey=e.apiKey,t.apiKeyName=e.apiKeyName||"key",t.updateAttribution=t.updateAttribution.bind(ye(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;se(he(i.prototype),"init",this).call(this,t),this.map&&!this.mbMap&&(this.format=new Ht.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{e.mbMap&&e.mbMap.resize()}catch(t){console.warn(t)}}))))}},{key:"createStyleUrl",value:function(){return Xt(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var t=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){t.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var e=re(this.map.getView().getCenter(),2),r=e[0],n=e[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new Kt.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Nt.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(t){console.warn("Failed creating mapbox map: ",t)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){t.loaded=!0,t.copyrights=t.copyrights||te(t.mbMap)||[],t.olLayer.getSource().setAttributions(t.copyrights),t.dispatchEvent({type:"load",target:t})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){t.loadMbMap()})))}},{key:"updateAttribution",value:function(t){var e=this.copyrights||te(t.target)||[];this.copyrights.toString()!==e.toString()&&this.olLayer.getSource().setAttributions(e)}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){var r=this;if(!(e&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:t,features:[],layer:this});var n=t&&this.mbMap.project(Object(Nt.toLonLat)(t));if(this.hitTolerance){var o=n,i=o.x,c=o.y;n=[{x:i-this.hitTolerance,y:c-this.hitTolerance},{x:i+this.hitTolerance,y:c+this.hitTolerance}]}var a=this.mbMap.queryRenderedFeatures(n,e).map((function(t){var e=r.format.readFeature(t);return e&&e.set("mapboxFeature",t),e}));return Promise.resolve({layer:this,features:a,coordinate:t})}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,se(he(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(t){return new i(ie(ie({},this.options),t))}}])&&ue(e.prototype,r),n&&ue(e,n),i}(C);var ve=r(1),de=r(13),me=r(6);var ge=r(4),Oe=r(15),je=r.n(Oe);function we(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Pe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pe(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ke(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Re(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Te=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Se(Object(r),!0).forEach((function(e){ke(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({interpolate:!0},e);this.pixelRatio=e.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.getPixelFromCoordinate=r.getPixelFromCoordinate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var e,r,n;return e=t,(r=[{key:"setVisible",value:function(t){this.canvas&&(this.canvas.style.visibility=t?"visible":"hidden")}},{key:"setTrajectories",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&t.sort(this.sort),this.trajectories=t}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.clear();var i,c,a,u,s,l,f,p,y=we(r,2),h=y[0],b=y[1];if(h&&b&&(this.canvas.width!==h||this.canvas.height!==b)){var v=[h*this.pixelRatio,b*this.pixelRatio];this.canvas.width=v[0],this.canvas.height=v[1]}this.canvas.style.left="0px",this.canvas.style.top="0px",this.canvas.style.transform="",this.canvas.style.width="".concat(this.canvas.width/this.pixelRatio,"px"),this.canvas.style.height="".concat(this.canvas.height/this.pixelRatio,"px"),this.currResolution=n||this.currResolution,this.renderedTrajectories=[];for(var d=(this.trajectories||[]).length-1;d>=0;d-=1){var m=this.trajectories[d],g=m.geometry,O=m.timeIntervals,j=m.timeOffset;if(!this.filter||this.filter(m,d,this.trajectories)){var w=null,P=void 0;if(!m.coordinate||!o&&this.interpolate){if(O&&O.length>1){for(var S=e-(j||0),k=void 0,R=void 0,T=void 0,D=void 0,x=void 0,_=0;_<O.length-1;_+=1){var C=we(O[_],3);k=C[0],T=C[1],P=C[2];var E=we(O[_+1],2);if(R=E[0],D=E[1],k<=S&&S<=R)break;k=null,R=null}if(g.getType()===je.a.POINT)w=g.getCoordinates();else if(g.getType()===je.a.LINE_STRING){if(k&&R){x=this.interpolate?Math.min((S-k)/(R-k),1):0;var I=this.interpolate?x*(D-T)+T:0;w=g.getCoordinateAt(I),this.trajectories[d].rotation=P,this.trajectories[d].endFraction=x}else if(S<O[0][0]){var M=we(O,1),A=we(M[0],3);P=A[2],x=0,w=g.getFirstCoordinate()}else if(S>O[O.length-1][0]){var L=we(O[O.length-1],3);P=L[2],x=1,w=g.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",g);this.trajectories[d].rotation=P,this.trajectories[d].endFraction=x||0}}else w=m.coordinate;if(w){this.trajectories[d].coordinate=w;var V=this.getPixelFromCoordinate(w);if(!V)continue;V=V.map((function(e){return e*t.pixelRatio})),this.trajectories[d].rendered=!0,this.renderedTrajectories.push(this.trajectories[d]);var F=this.style(m,this.currResolution,this.pixelRatio);if(!F)continue;var U=F.width,q=F.height;this.hoverVehicleId!==m.id&&this.selectedVehicleId!==m.id&&this.canvasContext.drawImage(F,V[0]-U/2,V[1]-q/2,U,q),this.hoverVehicleId===m.id&&(i=F,c=V,a=U,u=q),this.selectedVehicleId===m.id&&(s=F,l=V,f=U,p=q)}}}s&&this.canvasContext.drawImage(s,l[0]-f/2,l[1]-p/2,f,p),i&&this.canvasContext.drawImage(i,c[0]-a/2,c[1]-u/2,a,u)}},{key:"destroy",value:function(){Object(c.unByKey)(this.olEventsKeys),this.renderedTrajectories=[],this.clear()}}])&&Re(e.prototype,r),n&&Re(e,n),t}(),De={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]},xe=["Tram","Subway / Metro / S-Bahn","Train","Bus","Ferry","Cable Car","Gondola","Funicular","Long distance bus","Rail"],_e=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],Ce=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],Ee=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],Ie=function(t){if("string"==typeof t){var e=xe.find((function(e){return new RegExp(t).test(e)}));return xe.indexOf(e)}return t},Me=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=Ie(t);return _e[e]}catch(t){return 1}},Ae=function(t,e,r){return e?r?"#ff0000":"#a0a0a0":t>=36e5?"#ed004c":t>=5e5?"#e80000":t>=3e5?"#ff4a00":t>=18e4?"#f7bf00":null===t?"#a0a0a0":"#00a00c"};function Le(t){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ve(t){return function(t){if(Array.isArray(t))return Fe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Fe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fe(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ue(Object(r),!0).forEach((function(e){Ne(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ne(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Be(t,e,r){return(Be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ze(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ke(t,e){return(Ke=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ze(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ze(t);if(e){var o=Ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ge(this,r)}}function Ge(t,e){return!e||"object"!==Le(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ze(t){return(Ze=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function He(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function We(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $e(t,e,r){return e&&We(t.prototype,e),r&&We(t,r),t}var Je=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ke(t,e)}(r,t);var e=ze(r);function r(){return He(this,r),e.apply(this,arguments)}return $e(r,[{key:"defineProperties",value:function(t){var e=this,n=qe({isHoverActive:!0},t),o=n.isHoverActive,i=n.style,c=n.speed,a=t.pixelRatio,u=t.interpolate,s=t.hoverVehicleId,l=t.selectedVehicleId,f=t.filter,p=t.sort,y=t.time,h=t.live,b={pixelRatio:a||window.devicePixelRatio||1,interpolate:u,hoverVehicleId:s,selectedVehicleId:l,filter:f,sort:p,style:i};Object.keys(b).forEach((function(t){return void 0===b[t]&&delete b[t]}));var v=c||1,d=y||new Date;Be(Ze(r.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{isTrackerLayer:{value:!0},isHoverActive:{value:!!o,writable:!0},style:{value:i||this.defaultStyle},speed:{get:function(){return v},set:function(t){v=t,e.start()}},filter:{get:function(){return e.tracker?e.tracker.filter:e.initTrackerOptions.filter},set:function(t){e.tracker?e.tracker.filter=t:e.initTrackerOptions.filter=t}},sort:{get:function(){return e.tracker?e.tracker.sort:e.initTrackerOptions.sort},set:function(t){e.tracker?e.tracker.sort=t:e.initTrackerOptions.sort=t}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==h||h,writable:!0},time:{get:function(){return d},set:function(t){d=t&&t.getTime?t:new Date(t),e.renderTrajectories()}},renderedTrajectories:{get:function(){var t;return(null===(t=e.tracker)||void 0===t?void 0:t.renderedTrajectories)||[]}},hoverVehicleId:{get:function(){return e.tracker?e.tracker.hoverVehicleId:e.initTrackerOptions.hoverVehicleId},set:function(t){e.tracker?e.tracker.hoverVehicleId=t:e.initTrackerOptions.hoverVehicleId=t}},selectedVehicleId:{get:function(){return e.tracker?e.tracker.selectedVehicleId:e.initTrackerOptions.selectedVehicleId},set:function(t){e.tracker?e.tracker.selectedVehicleId=t:e.initTrackerOptions.selectedVehicleId=t}},pixelRatio:{get:function(){return e.tracker?e.tracker.pixelRatio:e.initTrackerOptions.pixelRatio},set:function(t){e.tracker?e.tracker.pixelRatio=t:e.initTrackerOptions.pixelRatio=t}},initTrackerOptions:{value:b,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0}})}},{key:"init",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Be(Ze(r.prototype),"init",this).call(this,t),this.tracker=new Te(qe(qe({style:function(t,r){return e.style(t,r)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(t){t.target.visible?e.start():e.stop()}))}},{key:"terminate",value:function(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),Be(Ze(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.tracker.setVisible(!0),this.renderTrajectories(),this.startUpdateTime()}},{key:"startUpdateTime",value:function(){var t=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){t.time=t.live?new Date:t.time.getTime()+t.updateTimeDelay*t.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(t,e,r,n){if(this.tracker){var o=this.live?Date.now():this.time;this.tracker.renderTrajectories(o,t,e,n)}}},{key:"renderTrajectories",value:function(t,e,r,n){var o=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){o.renderTrajectoriesInternal(t,e,r,n)})):this.renderTrajectoriesInternal(t,e,r,n)}},{key:"getVehicle",value:function(t){return this.tracker.getTrajectories().filter(t)}},{key:"getVehiclesAtCoordinate",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(ge.buffer)([].concat(Ve(t),Ve(t)),10*e),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(ge.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getRefreshTimeInMs",value:function(t){var e=Math.round(t),r=Ee[e]||25;return Math.max(25,r/this.speed)}},{key:"defaultStyle",value:function(t){var e=t.id;if(this.styleCache[e])return this.styleCache[e];var r=document.createElement("canvas");r.width=200,r.height=15;var n=r.getContext("2d");return n.arc(8,8,5,0,2*Math.PI,!1),n.fillStyle="#8ED6FF",n.fill(),n.lineWidth=3,n.strokeStyle="black",n.stroke(),n.font="bold 12px arial",n.strokeStyle="white",n.lineWidth=3,n.strokeText(e,20,10),n.fillStyle="black",n.fillText(e,20,10),this.styleCache[e]=r,this.styleCache[e]}}]),r}(t)};function Qe(t){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ye(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Xe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xe(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function er(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tr(Object(r),!0).forEach((function(e){rr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function rr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ir(t,e,r){return(ir="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sr(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function cr(t,e){return(cr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ar(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=sr(t);if(e){var o=sr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ur(this,r)}}function ur(t,e){return!e||"object"!==Qe(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function sr(t){return(sr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cr(t,e)}(i,t);var e,r,n,o=ar(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nr(this,i),(t=o.call(this,er({},e))).renderWhenZooming=e.renderWhenZooming||function(){return!0},t.renderWhenRotating=e.renderWhenRotating||function(){return!0},t.olLayer=e.olLayer||new me.Group({layers:[new me.Layer({source:new Gt.a({}),render:function(e){if(!t.tracker||!t.tracker.canvas)return null;var r=e.viewState,n=r.zoom,o=r.center,i=r.rotation,c=n!==t.renderState.zoom,a=n!==t.renderState.zoom;if(c||a){if(t.renderState.zoom=n,t.renderState.center=o,t.renderState.rotation=i,c&&!t.renderWhenZooming(n)||a&&!t.renderWhenRotating(i))return t.tracker.clear(),t.tracker.canvas;t.renderTrajectories(!0)}else if(t.renderState.center[0]!==o[0]||t.renderState.center[1]!==o[1]){var u=t.map.getPixelFromCoordinate(o),s=t.map.getPixelFromCoordinate(t.renderState.center),l=parseFloat(t.tracker.canvas.style.left),f=parseFloat(t.tracker.canvas.style.top);t.tracker.canvas.style.left="".concat(l-(u[0]-s[0]),"px"),t.tracker.canvas.style.top="".concat(f-(u[1]-s[1]),"px"),t.renderState.center=o,t.renderState.rotation=i}return t.tracker.canvas}})]}),t.renderState={center:[0,0],zoom:null,rotation:0},t.olEventsKeys=[],t}return e=i,(r=[{key:"init",value:function(t){t&&ir(sr(i.prototype),"init",this).call(this,t,{getPixelFromCoordinate:t.getPixelFromCoordinate.bind(t)})}},{key:"start",value:function(){var t=this;ir(sr(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("moveend",(function(){var e=t.map.getView().getZoom();e!==t.currentZoom&&(t.currentZoom=e,t.requestIntervalSeconds=200/e||1e3)})),this.map.on("pointermove",(function(e){if(!t.map.getView().getInteracting()&&!t.map.getView().getAnimating()&&t.isHoverActive){var r=Ye(t.getVehiclesAtCoordinate(e.coordinate,1),1)[0],n=r&&r.id;t.hoverVehicleId!==n&&(t.map.getTargetElement().style.cursor=r?"pointer":"auto",t.hoverVehicleId=n,t.renderTrajectories())}}))]}},{key:"stop",value:function(){ir(sr(i.prototype),"stop",this).call(this),Object(c.unByKey)(this.olEventsKeys),this.olEventsKeys=[]}},{key:"renderTrajectories",value:function(t){var e=this.map.getView();ir(sr(i.prototype),"renderTrajectories",this).call(this,this.map.getSize(),e.getResolution(),e.getRotation(),t)}},{key:"getRefreshTimeInMs",value:function(){return ir(sr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=this.map.getView().getResolution();return ir(sr(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"clone",value:function(t){return new i(er(er({},this.options),t))}}])&&or(e.prototype,r),n&&or(e,n),i}(Je(C)),fr=r(8),pr=r.n(fr),yr=r(3),hr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=(t.getUTCMonth()+1).toString();e=1===e.length?"0".concat(e):e;var r=t.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[t.getUTCFullYear(),e,r].join("")},br=function(t){return[t.getUTCHours(),t.getUTCMinutes(),"".concat(t.getUTCSeconds(),".").concat(t.getUTCMilliseconds())].join(":")};function vr(t){return(vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dr(Object(r),!0).forEach((function(e){gr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function gr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wr(t,e){return(wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Pr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=kr(t);if(e){var o=kr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Sr(this,r)}}function Sr(t,e){return!e||"object"!==vr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function kr(t){return(kr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wr(t,e)}(i,t);var e,r,n,o=Pr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Or(this,i),(t=o.call(this)).url=e.url,t.apiKey=e.apiKey,t}return e=i,(r=[{key:"fetch",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=mr(mr({},e),{},{key:this.apiKey}),o=mr({},n);return Object.keys(n).forEach((function(t){return(void 0===o[t]||null===o[t])&&delete o[t]})),this.apiKey?fetch("".concat(this.url).concat(t,"?").concat($t.a.stringify(o)),r).then((function(t){try{return t.json().then((function(t){if(t.error)throw new Error(t.error);return t}))}catch(t){return Promise.reject(new Error(t))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&jr(e.prototype,r),n&&jr(e,n),i}(I.a);function Tr(t){return(Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dr(Object(r),!0).forEach((function(e){_r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ir(t,e){return(Ir=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Lr(t);if(e){var o=Lr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ar(this,r)}}function Ar(t,e){return!e||"object"!==Tr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Lr(t){return(Lr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Vr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ir(t,e)}(i,t);var e,r,n,o=Mr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Cr(this,i),o.call(this,xr({url:"https://api.geops.io/stops/v1/"},t))}return e=i,(r=[{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",t,{signal:e.signal}).then((function(t){return t.features}))}}])&&Er(e.prototype,r),n&&Er(e,n),i}(Rr);function Fr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ur(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var qr=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=n.d,i=n.m,c=n.y;e.push({day:o,month:i,year:c})}return e},Nr=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fr(Object(r),!0).forEach((function(e){Ur(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);["a","f","tt"].forEach((function(t){e[t]||(e[t]={})}));for(var r=e.id,n=e.hs,o=e.t,i=e.ln,c=e.sn,a=e.wa,u=e.ba,s=e.rt,l=e.fid,f=e.rid,p=e.c,y=e.tc,h=e.a,b=h.n,v=h.u,d=h.tz,m=e.f,g=m.n,O=m.u,j=m.tz,w=e.tt,P=w.n,S=w.p,k=w.t,R=e.sts,T=qr(P),D=qr(S),x=p&&"#".concat(p),_=y&&"#".concat(y),C=[],E=0;E<(R||[]).length;E+=1){var I=R[E],M=I.sid,A=I.n,L=I.p,V=I.at,F=I.dt,U=I.ap,q=I.dp,N=I.ad,B=I.dd,K=I.dot,z=I.put,G=I.c,Z=I.wa;C.push({stationId:M,stationName:A,coordinates:L,arrivalTime:-1!==V?1e3*U:null,departureTime:-1!==F?1e3*q:null,arrivalDelay:N,departureDelay:B,noDropOff:!!K,noPickUp:!!z,cancelled:!!G,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:x,color:_,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:C,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:k,notOperatingDays:T,additionalOperatingDays:D},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},Br=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=new yr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=i.DirectionText,f=i.Operator,p=i.OperatorURL,y=i.Publisher,h=i.PublisherURL,b=i.License,v=i.LicenseUrl,d=i.LicenseNote,m=i.Color,g=i.JourneyIdentifier,O=i.RealtimeAvailable,j=i.OperatorProvidesRealtime,w=i.DayOfOperation,P=i.Delay,S=i.TimeIntervals,k=i.TextColor,R=i.Cancelled;e.push({id:c,type:a,name:u,routeIdentifier:s,directionText:l,operator:f,operatorUrl:p,publisher:y,publisherUrl:h,license:b,licenseUrl:v,licenseNote:d,journeyIdentifier:g,realtimeAvailable:O,operatorProvidesRealtime:j,dayOfOperation:w,delay:P,timeIntervals:S,color:m&&"#".concat(m),textColor:k&&"#".concat(k),geometry:o,cancelled:R})}return e};function Kr(t){return(Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?zr(Object(r),!0).forEach((function(e){Zr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Zr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $r(t,e){return($r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Jr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yr(t);if(e){var o=Yr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qr(this,r)}}function Qr(t,e){return!e||"object"!==Kr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Yr(t){return(Yr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Xr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$r(t,e)}(i,t);var e,r,n,o=Jr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Hr(this,i),o.call(this,Gr({url:"https://api.geops.io/tracker/v1"},t))}return e=i,(r=[{key:"fetchTrajectoryById",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",t,{signal:e.signal})}},{key:"fetchTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",t,{signal:e.signal}).then((function(t){return Br(t.features)}))}},{key:"fetchTrajectoryStations",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",t,{signal:e.signal}).then((function(t){return Nr(t)}))}}])&&Wr(e.prototype,r),n&&Wr(e,n),i}(Rr);function tn(t){return function(t){if(Array.isArray(t))return en(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return en(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return en(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function en(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var nn=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subscriptions=[],this.connect(e),setInterval((function(){r.send("PING")}),1e4),this.subscribed={}}var e,r,n;return e=t,n=[{key:"getRequestString",value:function(t,e){var r="".concat(t," ").concat(e.channel);return r+=e.args?" ".concat(e.args):"",(r+=e.id?" ".concat(e.id):"").trim()}}],(r=[{key:"connect",value:function(t){var e=this;this.websocket&&this.websocket.readyState!==this.websocket.CLOSED&&this.websocket.close(),this.websocket=new WebSocket(t),this.currentProj&&this.setProjection(this.currentProj),this.currentBbox&&this.setBbox(this.currentBbox),tn(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,!0)})),this.websocket.onclose=function(){window.clearTimeout(e.reconnectTimeout),e.reconnectTimeout=window.setTimeout((function(){return e.connect(t)}),100)}}},{key:"get",value:function(e,r,n){var o=t.getRequestString("GET",e);this.send(o),this.listen(e,r,n)}},{key:"send",value:function(t){var e=this,r=function(){e.websocket.send(t)};this.websocket.readyState===WebSocket.CONNECTING?this.websocket.addEventListener("open",r):r()}},{key:"setProjection",value:function(t){this.currentProj=t,this.send("PROJECTION ".concat(t))}},{key:"setBbox",value:function(t){var e=this;this.currentBbox=t,this.send("BBOX ".concat(t.join(" "))),this.subscriptions.forEach((function(t){e.get(t.params,t.cb,t.errorCb)}))}},{key:"listen",value:function(t,e,r){this.unlisten(t,e);var n=function(r){var n=JSON.parse(r.data),o=t.channel;o+=t.args?" ".concat(t.args):"",n.source!==o||t.id&&t.id!==n.client_reference||e(n)};return this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r)),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t.channel&&(!e||r.cb===e)})).forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))}))}},{key:"subscribe",value:function(e,r,n,o){var i=this.listen(e,r,n),c=i.onMessageCb,a=i.onErrorCb,u=t.getRequestString("",e);if(!o){var s=this.subscriptions.findIndex((function(t){return e.channel===t.params.channel&&r===t.cb})),l={params:e,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a};s>-1?this.subscriptions[s]=l:this.subscriptions.push(l)}this.subscribed[u]||(this.send("GET ".concat(u)),this.send("SUB ".concat(u)),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t&&(!e||r.cb===e)})).forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==t||e&&r.cb!==e})),t&&this.subscribed[t]&&!this.subscriptions.find((function(e){return e.params.channel===t}))&&(this.send("DEL ".concat(t)),this.subscribed[t]=!1)}}])&&rn(e.prototype,r),n&&rn(e,n),t}(),on=function(t,e){return t===e.SCHEMATIC?"_schematic":""},cn=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=t.has_fzo&&n.indexOf(t.state)>-1,i=e.has_fzo&&n.indexOf(e.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(t.state!==e.state)return n.indexOf(t.state)-n.indexOf(e.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(t.min_arrival_time||t.time).getTime()-u,a=new Date(e.min_arrival_time||e.time).getTime()-u):(c=new Date(t.time).getTime()-u,a=new Date(e.time).getTime()-u),c-a},an=function(t){if(t)return t.stations.forEach((function(t){t.arrivalTimeWithDelay=t.arrivalTime,t.departureTime&&(t.departureTimeWithDelay=t.departureTime),t.arrivalDelay&&(t.arrivalTime-=t.arrivalDelay,t.departureTime&&(t.departureTime-=t.arrivalDelay))})),t};function un(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ln={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},fn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};un(this,t);var r=null;r="string"==typeof e?e:e.url,e.apiKey&&(r="".concat(r,"?key=").concat(e.apiKey)),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=e.prefix||"",this.conn=new nn(r),this.conn.setProjection(e.projection||"epsg:3857"),e.bbox&&this.conn.setBbox(e.bbox)}var e,r,n;return e=t,(r=[{key:"subscribe",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:t},e,r,n)}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;this.conn.unsubscribe("".concat(t).concat(on(ln.SCHEMATIC,ln)).concat(e),r),this.conn.unsubscribe("".concat(t).concat(on(ln.TOPOGRAPHIC,ln)).concat(e),r)}},{key:"filterDepartures",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(t).map((function(e){return t[e]}));r.sort((function(t,r){return cn(t,r,e)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],c=[],a=null,u=r.length-1;u>=0;u-=1){var s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=t;var o=t?"timetable_".concat(t):null,i={};this.subscribe(o,(function(t){if(t.source===o){var c=t.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(e.departureUpdateTimeout),e.departureUpdateTimeout=window.setTimeout((function(){var t=e.filterDepartures(i,r);n(t)}),100)}}),(function(){n([])}))}},{key:"unsubscribeDepartures",value:function(t){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",t),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(t){this.subscribe("".concat(this.prefix,"newsticker"),(function(e){t(e.content)}))}},{key:"unsubscribeDisruptions",value:function(t){this.unsubscribe("".concat(this.prefix,"newsticker"),"",t)}},{key:"getStation",value:function(t,e){var r=this,n={channel:"station".concat(on(e,ln)),args:t};return new Promise((function(t,e){r.conn.get(n,(function(r){r.content?t(r.content):e()}))}))}},{key:"getStations",value:function(t,e){var r=this,n=[];e&&this.conn.setBbox(e);var o={channel:"station".concat(on(t,ln))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(t,e){r.conn.get(o,(function(o){o.content?(n.push(o.content),window.clearTimeout(r.stationUpdateTimeout),r.stationUpdateTimeout=window.setTimeout((function(){t(n)}),50)):e(o.content)}))}))}},{key:"subscribeStations",value:function(t,e,r){this.unsubscribeStations(),e&&this.conn.setBbox(e),this.subscribe("station".concat(on(t,ln)),(function(t){t.content&&r(t.content)}))}},{key:"unsubscribeStations",value:function(t){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",t)}},{key:"subscribeExtraGeoms",value:function(t){var e=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?e.extraGeoms[o]=n:delete e.extraGeoms[o],t(Object.keys(e.extraGeoms).map((function(t){return e.extraGeoms[t]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(t){this.unsubscribe("extra_geoms","",t)}},{key:"subscribeTrajectory",value:function(t,e){this.unsubscribeTrajectory(e),this.subscribe("trajectory".concat(on(t,ln)),e)}},{key:"unsubscribeTrajectory",value:function(t){this.unsubscribe("trajectory","",t)}},{key:"subscribeDeletedVehicles",value:function(t,e){this.unsubscribeDeletedVehicles(e),this.subscribe("deleted_vehicles".concat(on(t,ln)),e)}},{key:"unsubscribeDeletedVehicles",value:function(t){this.unsubscribe("deleted_vehicles","",t)}},{key:"getFullTrajectory",value:function(t,e){var r=this,n={channel:"full_trajectory".concat(on(e,ln),"_").concat(t)};return new Promise((function(t){r.conn.get(n,(function(e){e.content&&t(e.content)}))}))}},{key:"getFullTrajectories",value:function(t,e){var r=this,n=t.map((function(t){return r.getFullTrajectory(t,e)}));return Promise.all(n)}},{key:"subscribeFullTrajectory",value:function(t,e){this.unsubscribeFullTrajectory(t),this.subscribe("full_trajectory".concat(on(e,ln),"_").concat(t),(function(t){console.log("subscribe full_trajectory",t)}),(function(t){console.log("subscribe full_trajectory error",t)}))}},{key:"unsubscribeFullTrajectory",value:function(t,e){this.unsubscribe("full_trajectory","_".concat(t),e)}},{key:"getStopSequence",value:function(t){var e=this,r={channel:"stopsequence_".concat(t)};return new Promise((function(t,n){e.conn.get(r,(function(e){t(an(e.content&&e.content[0]))}),(function(t){n(t)}))}))}},{key:"getStopSequences",value:function(t){var e=this,r=t.map((function(t){return e.getStopSequence(t)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(t,e){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(t),this.subscribe("stopsequence_".concat(t),(function(t){if(t.content&&t.content.length){var r=t.content.map((function(t){return an(t)}));e(r)}}),(function(t){console.log("subscribe stopsequence error",t)}))}},{key:"unsubscribeStopSequence",value:function(t,e){this.unsubscribe("stopsequence","_".concat(t),e)}},{key:"subscribeHealthCheck",value:function(t){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",t)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&sn(e.prototype,r),n&&sn(e,n),t}();function pn(t){return(pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function hn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yn(Object(r),!0).forEach((function(e){bn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vn(t,e,r){return(vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=On(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function dn(t,e){return(dn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=On(t);if(e){var o=On(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gn(this,r)}}function gn(t,e){return!e||"object"!==pn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function On(t){return(On=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Pn(t,e,r){return e&&wn(t.prototype,e),r&&wn(t,r),t}var Sn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dn(t,e)}(r,t);var e=mn(r);function r(){return jn(this,r),e.apply(this,arguments)}return Pn(r,[{key:"defineProperties",value:function(t){var e=this;vn(On(r.prototype),"defineProperties",this).call(this,t);var n,o=t.regexPublishedLineName,i=t.publishedLineName,c=t.tripNumber,a=t.operator,u=3;if(!t.api){var s={};t.url&&(s.url=t.url),t.apiKey&&(s.apiKey=t.apiKey),n=new Xr(s)}Object.defineProperties(this,{showVehicleTraj:{value:void 0===t.showVehicleTraj||t.showVehicleTraj,writable:!0},delayDisplay:{value:t.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:t.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:t.useDelayStyle||!1,writable:!0},requestIntervalSeconds:{get:function(){return u},set:function(t){t!==u&&(u=t,e.visible&&e.start())}},publishedLineName:{get:function(){return i},set:function(t){i=t,e.updateFilters()}},tripNumber:{get:function(){return c},set:function(t){c=t,e.updateFilters()}},operator:{get:function(){return a},set:function(t){a=t,e.updateFilters()}},regexPublishedLineName:{get:function(){return o},set:function(t){o=t,e.updateFilters()}},api:{value:t.api||n}})}},{key:"init",value:function(t){vn(On(r.prototype),"init",this).call(this,t),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(t,e){return null===t.delay||t.delay<e.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),vn(On(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.journeyId=null,this.stopUpdateTrajectories(),this.abortFetchTrajectories(),vn(On(r.prototype),"stop",this).call(this)}},{key:"updateFilters",value:function(){var t=$t.a.parse(window.location.search.toLowerCase());this.filter=function(t,e,r,n){var o=[];if(!(t||e||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(t){return i.some((function(e){return new RegExp(e,"i").test(t.name)}))}))}if(t){var c=("string"==typeof t?t.split(","):t).map((function(t){return t.replace(/\s+/g,"").toUpperCase()}));o.push((function(t){return c.some((function(e){return e===t.name.toUpperCase()}))}))}if(e){var a=("string"==typeof e?e.split(","):e).map((function(t){return parseInt(t,10)}));o.push((function(t){var e=parseInt(t.routeIdentifier.split(".")[0],10);return a.some((function(t){return t===e}))}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(t){return u.some((function(e){return new RegExp(e,"i").test(t.operator)}))}))}return o.length?function(t){for(var e=0;e<o.length;e+=1)if(!o[e](t))return!1;return!0}:null}(this.publishedLineName||t.publishedlinename,this.tripNumber||t.tripnumber,this.operator||t.operator,this.regexPublishedLineName)}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"updateTrajectoryStations",value:function(t){var e=this.getParams({id:t,time:br(new Date)});return this.api.fetchTrajectoryStations(e)}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=1e3*(this.requestIntervalSeconds+5),r=this.speed*e,n=this.time,o=!0;if(this.later&&n.getTime()>this.later.getTime()-1e3*this.requestIntervalSeconds&&(o=!1),!this.later||!o||this.later.getTime()-n.getTime()>r){var i=new Date(n.getTime()+r);this.later=i}var c=hn(hn({},t),{},{btime:br(n),etime:br(this.later),date:hr(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var t=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){t.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var t=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(t){if("AbortError"!==t.name)throw t})).then((function(e){e&&(t.tracker.setTrajectories(e),t.renderTrajectories())}))}},{key:"defaultStyle",value:function(t,e){var r=t.type,n=t.name,o=t.id,i=t.color,c=t.textColor,a=t.delay,u=t.cancelled,s=t.operatorProvidesRealtime,l=Math.min(Math.floor(e||1),16),f=this.hoverVehicleId===o,p=this.selectedVehicleId===o,y="".concat(l).concat(r).concat(n).concat(s).concat(a).concat(f).concat(p).concat(u),h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;try{var r=Ie(t);return De[r][e]}catch(t){return 1}}(r,l)*this.pixelRatio,b=h>=7*this.pixelRatio;(f||p)&&(h=b?h+5*this.pixelRatio:14*this.pixelRatio);var v=h>10*this.pixelRatio;if(v||(y="".concat(l).concat(r).concat(i).concat(s).concat(a).concat(f).concat(p).concat(u)),!this.styleCache[y]){if(0===h)return this.styleCache[y]=null,null;var d=1*this.pixelRatio,m=h+2,g=2*h,O=document.createElement("canvas");O.width=2*m+2*d+100*this.pixelRatio,O.height=2*m+2*d+100*this.pixelRatio;var j,w=O.getContext("2d"),P=O.width/2;if(b&&null!==a&&(w.save(),w.beginPath(),w.arc(P,P,m,0,2*Math.PI,!1),w.fillStyle=Ae(a,u),w.filter="blur(1px)",w.fill(),w.restore()),b&&(f||a>=this.delayDisplay||u)){w.save(),w.textAlign="left",w.textBaseline="middle",w.font="bold ".concat(Math.max(u?19:14,Math.min(u?19:17,1.2*h)),"px arial, sans-serif"),w.fillStyle=Ae(a,u,!0),w.strokeStyle=this.delayOutlineColor,w.lineWidth=1.5*this.pixelRatio;var S=function(t,e){if(e)return String.fromCodePoint(215);if(t>36e5){var r=Math.round(t/36e5);return"+".concat(r,"h")}if(t>59e3){var n=Math.round(t/6e4);return"+".concat(n,"m")}return t>0?"+".concat(t,"s"):""}(a,u);w.strokeText(S,P+m+d,P),w.fillText(S,P+m+d,P),w.restore()}if(j=this.useDelayStyle?Ae(a,u):i||Me(r),w.save(),(b||f||p)&&(w.lineWidth=1*this.pixelRatio,w.strokeStyle="#000000"),w.fillStyle=j,w.beginPath(),w.arc(P,P,h,0,2*Math.PI,!1),w.fill(),b&&this.useDelayStyle&&null===a&&"yes"===s&&w.setLineDash([5,3]),(b||f||p)&&w.stroke(),w.restore(),v){var k=function(t,e,r,n){t.font="bold ".concat(n,"px Arial");for(var o=t.measureText(r),i=0;o.width>e-6&&i<25;)n-=.5,t.font="bold ".concat(n,"px arial, sans-serif"),o=t.measureText(r),i+=1;return n}(w,g,n,Math.max(h,10*this.pixelRatio));this.useDelayStyle&&null===a&&"yes"===s&&(w.save(),w.textBaseline="middle",w.textAlign="center",w.font="bold ".concat(k+2,"px Arial"),w.strokeStyle=j,w.strokeText(n,P,P),w.restore()),w.save(),w.textBaseline="middle",w.textAlign="center",w.fillStyle=this.useDelayStyle?"#000000":c||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=Ie(t);return Ce[e]}catch(t){return 1}}(r),w.font="bold ".concat(k,"px Arial"),w.strokeStyle=j,w.strokeText(n,P,P),w.fillText(n,P,P),w.restore()}this.styleCache[y]=O}return this.styleCache[y]}}]),r}(t)};function kn(t){return(kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||Dn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tn(t){return function(t){if(Array.isArray(t))return xn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Dn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dn(t,e){if(t){if("string"==typeof t)return xn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xn(t,e):void 0}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Cn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(r),!0).forEach((function(e){En(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function En(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function In(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function An(t,e,r){return(An="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Un(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ln(t,e){return(Ln=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Un(t);if(e){var o=Un(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fn(this,r)}}function Fn(t,e){return!e||"object"!==kn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Un(t){return(Un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var qn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ln(t,e)}(i,t);var e,r,n,o=Vn(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return In(this,i),(t=o.call(this,Cn({},e))).vectorLayer=new me.Vector({source:new de.Vector({features:[]})}),t.olLayer.getLayers().insertAt(0,t.vectorLayer),t}return e=i,(r=[{key:"init",value:function(t){t&&(t.addLayer(this.vectorLayer),An(Un(i.prototype),"init",this).call(this,t))}},{key:"terminate",value:function(){this.map&&this.map.removeLayer(this.vectorLayer),An(Un(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(An(Un(i.prototype),"start",this).call(this),this.olEventsKeys=[].concat(Tn(this.olEventsKeys),[this.map.on("singleclick",this.onMapClick.bind(this)),this.map.on("moveend",this.onMoveEnd.bind(this))]))}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"onMapClick",value:function(t){var e=this;if(this.clickCallbacks.length){var r=Rn(this.getVehiclesAtCoordinate(t.coordinate,1),1)[0],n=[];if(r){var o=r.coordinate?new yr.Point(r.coordinate):null;n.push(new pr.a(Cn({geometry:o},r))),n.length&&(this.selectedVehicleId=n[0].get("id"),this.journeyId=n[0].get("journeyIdentifier"),this.updateTrajectoryStations(this.selectedVehicleId).then((function(n){e.clickCallbacks.forEach((function(o){return o(Cn(Cn({},r),n),e,t)}))})))}else this.selectedVehicleId=null,this.vectorLayer.getSource().clear(),this.clickCallbacks.forEach((function(r){return r(null,e,t)}))}}},{key:"drawFullTrajectory",value:function(t,e,r){var n=/#ffffff/i.test(r)?"#ff0000":r,o=this.vectorLayer.getSource();if(o.clear(),t){var i=new yr.MultiPoint(t),c=new pr.a(i);c.setStyle(new ve.Style({zIndex:1,image:new ve.Circle({radius:5,fill:new ve.Fill({color:"#000000"})})}));var a=new pr.a(i);a.setStyle(new ve.Style({zIndex:4,image:new ve.Circle({radius:4,fill:new ve.Fill({color:this.useDelayStyle?"#a0a0a0":n})})})),o.addFeatures([c,a])}var u=new pr.a({geometry:e});u.setStyle([new ve.Style({zIndex:2,stroke:new ve.Stroke({color:"#000000",width:6})}),new ve.Style({zIndex:3,stroke:new ve.Stroke({color:this.useDelayStyle?"#a0a0a0":n,width:4})})]),o.addFeature(u)}},{key:"updateTrajectoryStations",value:function(t){var e=this;return An(Un(i.prototype),"updateTrajectoryStations",this).call(this,t).then((function(t){return e.stationsCoords=[],t.stations.forEach((function(t){e.stationsCoords.push(Object(Nt.transform)(t.coordinates,"EPSG:4326","EPSG:3857"))})),e.highlightTrajectory(),t}))}},{key:"highlightTrajectory",value:function(){var t=this;this.api.fetchTrajectoryById(this.getParams({id:this.journeyId,time:br(new Date)})).then((function(e){var r=e.p,n=e.t,o=e.c,i=[];r.forEach((function(t){t.forEach((function(t){i.push([t.x,t.y])}))})),t.drawFullTrajectory(t.stationsCoords,new yr.LineString(i),o?"#".concat(o):Me(n))})).catch((function(){t.vectorLayer.getSource().clear()}))}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getView().calculateExtent(),r=Object(ge.buffer)(e,Object(ge.getWidth)(e)/10).join(","),n=this.map.getView().getZoom();return An(Un(i.prototype),"getParams",this).call(this,Cn(Cn({},t),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"defaultStyle",value:function(t){var e=this.map.getView().getZoom();return An(Un(i.prototype),"defaultStyle",this).call(this,t,e)}},{key:"clone",value:function(t){return new i(Cn(Cn({},this.options),t))}}])&&Mn(e.prototype,r),n&&Mn(e,n),i}(Sn(lr)),Nn=r(21),Bn=r.n(Nn);function Kn(t){return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?zn(Object(r),!0).forEach((function(e){Zn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Zn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hn(t,e,r){return(Hn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yn(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Wn(t,e){return(Wn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yn(t);if(e){var o=Yn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jn(this,r)}}function Jn(t,e){return!e||"object"!==Kn(e)&&"function"!=typeof e?Qn(t):e}function Qn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yn(t){return(Yn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function to(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function eo(t,e,r){return e&&to(t.prototype,e),r&&to(t,r),t}var ro=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wn(t,e)}(r,t);var e=$n(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xn(this,r),(t=e.call(this,Gn({},n))).debug=n.debug,t.mode=n.mode||ln.TOPOGRAPHIC,t.trajectories=[],t.refreshTimeInMs=1e3/30,t.onMessage=t.onMessage.bind(Qn(t)),t.onDeleteMessage=t.onDeleteMessage.bind(Qn(t)),t.api=n.api||new fn(n),t.format=new Ht.a,t}return eo(r,[{key:"init",value:function(t){Hn(Yn(r.prototype),"init",this).call(this,t),this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage)}},{key:"terminate",value:function(){this.api.unsubscribeTrajectory(this.onMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteMessage),Hn(Yn(r.prototype),"terminate",this).call(this)}},{key:"setMode",value:function(t){this.mode!==t&&(this.mode=t,this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage))}},{key:"onMessage",value:function(t){if(t.content){var e=this.format.readFeature(t.content);if(e.set("timeOffset",Date.now()-t.timestamp),e.get("time_since_update")>=0){if(this.debug&&this.mode===ln.TOPOGRAPHIC&&e.get("raw_coordinates")){var r=new Bn.a(e.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),e.setGeometry(r)}this.addTrajectory(e.get("train_id"),e.getProperties(),!e.get("line"))}}}},{key:"onDeleteMessage",value:function(t){t.content&&this.removeTrajectoryByAttribute("train_id",t.content)}},{key:"addTrajectory",value:function(t,e,r){var n=this.trajectories.findIndex((function(e){return e.train_id===t})),o=e.time_intervals,i=Gn(Gn({},e),{},{id:t,timeIntervals:o});r?(this.trajectories.unshift(i),-1!==n&&this.tracker.trajectories.splice(n+1,1)):(this.trajectories.push(i),-1!==n&&this.tracker.trajectories.splice(n,1)),this.updateTrajectories()}},{key:"removeTrajectory",value:function(t){for(var e=0,r=this.trajectories.length;e<r;e+=1)if(this.trajectories[e].id===t){this.trajectories.splice(e,1);break}}},{key:"removeTrajectoryByAttribute",value:function(t,e){for(var r=0,n=this.trajectories.length;r<n;r+=1)if(this.trajectories[r][t]===e){this.removeTrajectory(this.trajectories[r].id);break}}},{key:"updateTrajectories",value:function(){this.tracker.setTrajectories(this.trajectories),this.renderTrajectories()}},{key:"getRefreshTimeInMs",value:function(){return this.refreshTimeInMs}}]),r}(t)};function no(t){return(no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function io(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?oo(Object(r),!0).forEach((function(e){co(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function co(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ao(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function so(t,e){return(so=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=po(t);if(e){var o=po(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return fo(this,r)}}function fo(t,e){return!e||"object"!==no(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function po(t){return(po=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&so(t,e)}(i,t);var e,r,n,o=lo(i);function i(){return ao(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"clone",value:function(t){return new i(io(io({},this.options),t))}}])&&uo(e.prototype,r),n&&uo(e,n),i}(ro(lr));function ho(t){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?bo(Object(r),!0).forEach((function(e){mo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function go(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jo(t,e,r){return(jo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ko(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function wo(t,e){return(wo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ko(t);if(e){var o=ko(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return So(this,r)}}function So(t,e){return!e||"object"!==ho(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ko(t){return(ko=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ro=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wo(t,e)}(i,t);var e,r,n,o=Po(i);function i(){return go(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(t);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(t){return t===e.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:t})}},{key:"init",value:function(t){var e=this;jo(ko(i.prototype),"init",this).call(this,t),this.map&&(this.singleClickRef=this.map.on("singleclick",(function(t){e.clickCallbacks.length&&e.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){return e.callClickCallbacks(t.features,t.layer,t.coordinate)})).catch((function(){return e.callClickCallbacks([],e,t.coordinate)}))})))}},{key:"callClickCallbacks",value:function(t,e,r){this.clickCallbacks.forEach((function(n){return n(t,e,r)}))}},{key:"terminate",value:function(){jo(ko(i.prototype),"terminate",this).call(this),this.singleClickRef&&Object(c.unByKey)(this.singleClickRef)}},{key:"clone",value:function(t){return new i(vo(vo({},this.options),t))}}])&&Oo(e.prototype,r),n&&Oo(e,n),i}(C);function To(t){return(To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Do(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Do(Object(r),!0).forEach((function(e){_o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Do(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Co(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Io(t,e,r){return(Io="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Mo(t,e){return(Mo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vo(t);if(e){var o=Vo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lo(this,r)}}function Lo(t,e){return!e||"object"!==To(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vo(t){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mo(t,e)}(i,t);var e,r,n,o=Ao(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Co(this,i),(t=o.call(this,e)).abortController=new AbortController,t.format=new Ht.a,t}return e=i,(r=[{key:"getFeatureInfoUrl",value:function(t){var e=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(t,r,e,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(t),{signal:r}).then((function(t){return t.json()})).then((function(t){return t.features})).then((function(r){return{layer:e,coordinate:t,features:r.map((function(t){return e.format.readFeature(t)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:t,layer:e})}))}},{key:"init",value:function(t){var e=this;Io(Vo(i.prototype),"init",this).call(this,t),this.map&&(this.singleClickRef=this.map.on("singleclick",(function(t){e.clickCallbacks.length&&e.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){return e.callClickCallbacks(t.features,t.layer,t.coordinate)}))})))}},{key:"callClickCallbacks",value:function(t,e,r){this.clickCallbacks.forEach((function(n){return n(t,e,r)}))}},{key:"terminate",value:function(){Io(Vo(i.prototype),"terminate",this).call(this),this.singleClickRef&&Object(c.unByKey)(this.singleClickRef)}},{key:"clone",value:function(t){return new i(xo(xo({},this.options),t))}}])&&Eo(e.prototype,r),n&&Eo(e,n),i}(C);r(14),r(22),r(23),r(16);function Uo(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function No(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qo(Object(r),!0).forEach((function(e){Bo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ko(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Zo(t);if(e){var o=Zo(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Go(this,r)}}function Go(t,e){return!e||"object"!==Uo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zo(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ho(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $o(t,e,r){return e&&Wo(t.prototype,e),r&&Wo(t,r),t}function Jo(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Xo(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ti(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ri(t);if(e){var o=ri(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return ei(this,r)}}function ei(t,e){return!e||"object"!==Jo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ri(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ni=z;var ni;function oi(t){return(oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ci(t,e,r){return(ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=fi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function ai(t,e){return(ai=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ui(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=fi(t);if(e){var o=fi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return si(this,r)}}function si(t,e){return!e||"object"!==oi(e)&&"function"!=typeof e?li(t):e}function li(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fi(t){return(fi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ai(t,e)}(i,t);var e,r,n,o=ui(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).render=e.render.bind(li(e)),e}return e=i,(r=[{key:"activate",value:function(){ci(fi(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),ci(fi(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return te(this.map)}}])&&ii(e.prototype,r),n&&ii(e,n),i}(ht(z));function yi(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function bi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hi(Object(r),!0).forEach((function(e){vi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function vi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function di(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mi(t,e,r){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==wi(t););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function gi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Oi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=wi(t);if(e){var o=wi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return ji(this,r)}}function ji(t,e){return!e||"object"!==yi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function wi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}nt(Bt.Map);function Pi(t){return function(t){if(Array.isArray(t))return Si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Si(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Si(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Si(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ki=function(t){var e=t.getBounds().toArray(),r=[].concat(Pi(Object(Nt.fromLonLat)(e[0])),Pi(Object(Nt.fromLonLat)(e[1]))),n=t.getCanvas(),o=n.width,i=n.height,c=Object(ge.getWidth)(r)/o,a=Object(ge.getHeight)(r)/i;return Math.max(c,a)},Ri=function(t,e){var r=t.getCanvas(),n=r.width,o=r.height,i=t.unproject({x:0,y:0}),c=t.unproject({x:0,y:o/e}),a=t.unproject({x:n/e,y:o/e}),u=t.unproject({x:n/e,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function Ti(t){return(Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Di(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return xi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xi(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ci(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_i(Object(r),!0).forEach((function(e){Ei(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ei(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ii(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ai(t,e,r){return(Ai="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Li(t,e){return(Li=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=qi(t);if(e){var o=qi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fi(this,r)}}function Fi(t,e){return!e||"object"!==Ti(e)&&"function"!=typeof e?Ui(t):e}function Ui(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qi(t){return(qi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Li(t,e)}(i,t);var e,r,n,o=Vi(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ii(this,i),(t=o.call(this,Ci({},e))).onMapZoomEnd=t.onMapZoomEnd.bind(Ui(t)),t.onMapMouseMove=t.onMapMouseMove.bind(Ui(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;if(t){var r=t.getCanvas();Ai(qi(i.prototype),"init",this).call(this,t,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio,getPixelFromCoordinate:function(t){var r=Di(Object(Nt.toLonLat)(t),2),n=r[0],o=r[1],i=e.map.project({lng:n,lat:o});return[i.x,i.y]}})}}},{key:"start",value:function(){Ai(qi(i.prototype),"start",this).call(this),this.map.on("zoomend",this.onMapZoomEnd),this.isHoverActive&&this.map.on("mousemove",this.onMapMouseMove)}},{key:"stop",value:function(){Ai(qi(i.prototype),"stop",this).call(this),this.map&&(this.map.off("zoomend",this.onMapZoomEnd),this.map.off("mousemove",this.onMapMouseMove))}},{key:"renderTrajectories",value:function(t){var e=this.map.getCanvas();Ai(qi(i.prototype),"renderTrajectories",this).call(this,[e.width/this.pixelRatio,e.height/this.pixelRatio],ki(this.map),this.map.getBearing(),t)}},{key:"getRefreshTimeInMs",value:function(){return Ai(qi(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=ki(this.map);return Ai(qi(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"onMapZoomEnd",value:function(){this.startUpdateTime(this.map.getZoom())}},{key:"onMapMouseMove",value:function(t){if(this.map.isMoving()||this.map.isRotating()||this.map.isZooming()||!this.isHoverActive)this.map.getContainer().style.cursor="auto";else{var e=Di(this.getVehiclesAtCoordinate(Object(Nt.fromLonLat)([t.lngLat.lng,t.lngLat.lat]),1),1)[0],r=e&&e.id;this.hoverVehicleId!==r&&(this.map.getContainer().style.cursor=e?"pointer":"auto",this.hoverVehicleId=r,this.renderTrajectories())}}}])&&Mi(e.prototype,r),n&&Mi(e,n),i}(Je(O));function Bi(t){return(Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ki(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function zi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ki(Object(r),!0).forEach((function(e){Gi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ki(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Gi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Wi(t,e,r){return(Wi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function $i(t,e){return($i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Xi(t);if(e){var o=Xi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qi(this,r)}}function Qi(t,e){return!e||"object"!==Bi(e)&&"function"!=typeof e?Yi(t):e}function Yi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xi(t){return(Xi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var tc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$i(t,e)}(i,t);var e,r,n,o=Ji(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Zi(this,i),(t=o.call(this,zi({},e))).onMove=t.onMove.bind(Yi(t)),t.onMoveEnd=t.onMoveEnd.bind(Yi(t)),t}return e=i,(r=[{key:"init",value:function(t,e){Wi(Xi(i.prototype),"init",this).call(this,t),this.map&&(this.map.on("zoomend",this.onZoomEnd),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.addSource("canvas-source",{type:"canvas",canvas:this.tracker.canvas,coordinates:Ri(this.map,this.pixelRatio),animate:!0}),this.map.addLayer({id:"canvas-layer",type:"raster",source:"canvas-source",paint:{"raster-opacity":1,"raster-fade-duration":0}},e))}},{key:"terminate",value:function(){this.map&&(this.map.off("zoomend",this.onZoomEnd),this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),Wi(Xi(i.prototype),"terminate",this).call(this)}},{key:"onMove",value:function(){this.map.getSource("canvas-source").setCoordinates(Ri(this.map,this.pixelRatio));var t=this.map.getCanvas(),e=t.width,r=t.height;this.renderTrajectories([e/this.pixelRatio,r/this.pixelRatio],ki(this.map),this.map.getBearing())}},{key:"onMoveEnd",value:function(){this.updateTrajectories()}}])&&Hi(e.prototype,r),n&&Hi(e,n),i}(ro(Ni));function ec(t){return(ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rc(t){return function(t){if(Array.isArray(t))return ic(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||oc(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nc(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||oc(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oc(t,e){if(t){if("string"==typeof t)return ic(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ic(t,e):void 0}}function ic(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ac(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?cc(Object(r),!0).forEach((function(e){uc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function uc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function fc(t,e,r){return(fc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function pc(t,e){return(pc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=vc(t);if(e){var o=vc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return hc(this,r)}}function hc(t,e){return!e||"object"!==ec(e)&&"function"!=typeof e?bc(t):e}function bc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vc(t){return(vc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var dc={mapbox:{TrajservLayer:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pc(t,e)}(i,t);var e,r,n,o=yc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sc(this,i),(t=o.call(this,ac({},e))).onMapClick=t.onMapClick.bind(bc(t)),t.onMove=t.onMove.bind(bc(t)),t.onMoveEnd=t.onMoveEnd.bind(bc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(bc(t)),t}return e=i,(r=[{key:"init",value:function(t,e){if(t){fc(vc(i.prototype),"init",this).call(this,t);var r={type:"canvas",canvas:this.tracker.canvas,coordinates:Ri(t,this.pixelRatio),animate:!0,attribution:this.copyrights};this.beforeId=e,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},t.addSource(this.key,r),t.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),fc(vc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(fc(vc(i.prototype),"start",this).call(this),this.map.on("click",this.onMapClick),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd))}},{key:"stop",value:function(){this.map&&(this.map.off("click",this.onClick),this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),fc(vc(i.prototype),"stop",this).call(this)}},{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(){this.map.getSource(this.key).setCoordinates(Ri(this.map,this.pixelRatio)),this.renderTrajectories(void 0,ki(this.map),this.map.getBearing())}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"onMapClick",value:function(t){var e=this;if(this.clickCallbacks.length){var r=nc(this.getVehiclesAtCoordinate(Object(Nt.fromLonLat)([t.lngLat.lng,t.lngLat.lat]),1),1)[0];r?(this.selectedVehicleId=r.id,this.journeyId=r.journeyIdentifier,this.updateTrajectoryStations(this.selectedVehicleId).then((function(n){e.stationsCoords=[],n.stations.forEach((function(t){e.stationsCoords.push(Object(Nt.fromLonLat)(t.coordinates))})),e.clickCallbacks.forEach((function(o){return o(ac(ac({},r),n),e,t)}))}))):(this.selectedVehicleId=null,this.clickCallbacks.forEach((function(r){return r(null,e,t)})))}}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getBounds().toArray(),r=Object(Nt.fromLonLat)(e[0]),n=Object(Nt.fromLonLat)(e[1]),o=[].concat(rc(r),rc(n)),c=Object(ge.buffer)(o,Object(ge.getWidth)(o)/10).join(","),a=this.map.getZoom();return fc(vc(i.prototype),"getParams",this).call(this,ac(ac({},t),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"defaultStyle",value:function(t){var e=this.map.getZoom();return fc(vc(i.prototype),"defaultStyle",this).call(this,t,e)}},{key:"drawFullTrajectory",value:function(t,e,r){console.log("to be implemented")}},{key:"highlightTrajectory",value:function(t){var e=this;this.api.fetchTrajectoryById({id:t,time:br(new Date)}).catch((function(){e.map.getLayer("highlight-trajectory")&&e.map.removeLayer("highlight-trajectory")}))}}])&&lc(e.prototype,r),n&&lc(e,n),i}(Sn(Ni)),TralisLayer:tc},ol:{Map:qt,Layer:C,WMSLayer:Fo,MapboxLayer:be,TrajservLayer:qn,TralisLayer:yo,VectorLayer:Ro}};e.default=dc}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],e):"object"==typeof exports?exports["mobility-toolbox-js"]=e():t["mobility-toolbox-js"]=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e){t.exports=require("ol/proj")},function(t,e){t.exports=require("ol/style")},function(t,e){t.exports=require("ol/Observable")},function(t,e){t.exports=require("ol/geom")},function(t,e){t.exports=require("ol/extent")},function(t,e){t.exports=require("query-string")},function(t,e){t.exports=require("ol/layer")},function(t,e){t.exports=require("ol/format/GeoJSON")},function(t,e){t.exports=require("ol/Feature")},function(t,e){t.exports=require("ol/Object")},function(t,e){t.exports=require("ol/layer/Layer")},function(t,e){t.exports=require("mapbox-gl")},function(t,e){t.exports=require("ol/source/Source")},function(t,e){t.exports=require("ol/source")},function(t,e){t.exports=require("ol")},function(t,e){t.exports=require("ol/geom/GeometryType")},function(t,e){t.exports=require("ol/format")},function(t,e){t.exports=require("ol/Map")},function(t,e){t.exports=require("ol/control")},function(t,e){t.exports=require("ol/layer/Group")},function(t,e){t.exports=require("uuid")},function(t,e){t.exports=require("ol/geom/Point")},function(t,e){t.exports=require("ol/interaction")},function(t,e){t.exports=require("ol/events/condition")},function(t,e,r){t.exports=r(25)},function(t,e,r){"use strict";r.r(e);var n=r(17),o=r.n(n),i=r(18),c=r(2),a=r.n(c),u=r(19),s=r.n(u),l=r(20);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g(t);if(e){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}function m(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var O=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(i,t);var e,r,n,o=d(i);function i(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this)).defineProperties(y({isQueryable:!0},t)),t.copyrights&&(e.copyrights=t.copyrights);var r=t.onClick;return r&&e.onClick(r),e}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=t.name,n=t.key,o=t.children,i=t.visible,c=t.properties,a=t.isBaseLayer,u=t.isQueryable,s=t.hitTolerance,f=Object(l.v4)(),p=r||f;Object.defineProperties(this,{options:{value:t},name:{value:p},key:{value:n||p.toLowerCase()},isBaseLayer:{value:!!a},isQueryable:{value:!!u},hitTolerance:{value:s||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:o||[],writable:!0},copyrights:{get:function(){return e.get("copyrights")},set:function(t){var r=Array.isArray(t)?t:[t];return e.set("copyrights",r)}},visible:{value:void 0===i||i,writable:!0},properties:{value:y({},c||{})},map:{writable:!0},clickCallbacks:{value:[]}})}},{key:"init",value:function(t){this.terminate(),this.map=t}},{key:"terminate",value:function(){}},{key:"get",value:function(t){return this.properties[t]}},{key:"set",value:function(t,e){this.properties[t]=e,this.dispatchEvent({type:"change:".concat(t),target:this})}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(this.visible=t,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:e,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(t){return t.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(t){return!!this.children.find((function(e){return e.visible===t}))}},{key:"addChild",value:function(t){this.children.unshift(t),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(t){for(var e=0;e<this.children.length;e+=1)if(this.children[e].name===t)return void this.children.splice(e,1);this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(){return Promise.resolve({layer:this,features:[],coordinate:null})}},{key:"onClick",value:function(t){if("function"!=typeof t)throw new Error("callback must be of type function.");this.clickCallbacks.includes(t)||this.clickCallbacks.push(t)}},{key:"unClick",value:function(t){if("function"==typeof t){var e=this.clickCallbacks.indexOf(t);e>=-1&&this.clickCallbacks.splice(e,1)}}}])&&b(e.prototype,r),n&&b(e,n),i}(a.a);function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function R(t,e,r){return(R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_(t);if(e){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return x(this,r)}}function x(t,e){return!e||"object"!==j(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&T(t,e)}(i,t);var e,r,n,o=D(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).olLayer&&e.olLayer.setVisible(e.visible),e}return e=i,(r=[{key:"defineProperties",value:function(t){R(_(i.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{olLayer:{value:t.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(t){var e=this;if(R(_(i.prototype),"init",this).call(this,t),this.map&&this.olLayer&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(t){t.element===e.olLayer&&e.terminate()}))),this.copyrights)){var r=this.copyrights||[];this.olLayer instanceof s.a?this.olLayer.getLayers().getArray().forEach((function(t){t.getSource().setAttributions(r)})):this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),R(_(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t!==this.visible&&(R(_(i.prototype),"setVisible",this).call(this,t,e,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"clone",value:function(t){return new i(P(P({},this.options),t))}}])&&k(e.prototype,r),n&&k(e,n),i}(O),E=r(9),I=r.n(E);function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){V(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function q(t,e){return(q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=K(t);if(e){var o=K(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return B(this,r)}}function B(t,e){return!e||"object"!==M(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function K(t){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&q(t,e)}(i,t);var e,r,n,o=N(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};F(this,i),(t=o.call(this,e)).defineProperties(e);var r=L({active:!1!==e.active},e),n=r.active;return t.active=n,t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=L({},t),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return e.get("active")},set:function(t){e.set("active",t),t?e.activate():e.deactivate(),e.render()}},map:{get:function(){return e.get("map")},set:function(t){if(e.map&&e.element&&e.element.parentNode&&e.element.parentNode.removeChild(e.element),e.deactivate(),e.set("map",t),e.map){var r=e.target||e.map.getContainer();e.element||e.createDefaultElement(),e.element&&r.appendChild(e.element),e.active&&e.activate()}e.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&U(e.prototype,r),n&&U(e,n),i}(I.a);function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(r),!0).forEach((function(e){W(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $(t,e,r){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=X(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function J(t,e){return(J=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Q(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=X(t);if(e){var o=X(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Y(this,r)}}function Y(t,e){return!e||"object"!==G(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function X(t){return(X=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rt(t,e,r){return e&&et(t.prototype,e),r&&et(t,r),t}var nt=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&J(t,e)}(r,t);var e=Q(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tt(this,r),(t=e.call(this,H(H({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],t.mobilityControls=[],(n.controls||[]).forEach((function(e){t.addControl(e)})),(n.layers||[]).forEach((function(e){t.addLayer(e)})),t}return rt(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(t){this.mobilityControls.push(t),t.map=this}},{key:"removeMobilityControl",value:function(t){t.map=null,this.mobilityControls=this.mobilityControls.filter((function(e){return e!==t}))}},{key:"addControl",value:function(t,e){t instanceof z?this.addMobilityControl(t):$(X(r.prototype),"addControl",this).call(this,t,e)}},{key:"removeControl",value:function(t){t instanceof z?this.removeMobilityControl(t):$(X(r.prototype),"removeControl",this).call(this,t)}}]),r}(t)},ot=r(10),it=r.n(ot);function ct(t){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=lt(t);if(e){var o=lt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return st(this,r)}}function st(t,e){return!e||"object"!==ct(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function lt(t){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function yt(t,e,r){return e&&pt(t.prototype,e),r&&pt(t,r),t}var ht=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(r,t);var e=ut(r);function r(){return ft(this,r),e.apply(this,arguments)}return yt(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(t)};function bt(t){return function(t){if(Array.isArray(t))return vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var dt=function(t){var e=t.filter((function(t){return null!=t&&t.trim&&t.trim()})),r=e.map((function(t){return t.toLowerCase()}));return bt(new Set(r)).map((function(t){return e.find((function(e){return e.toLowerCase()===t}))}))};function mt(t){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ot(t,e,r){return(Ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=kt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function jt(t,e){return(jt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=kt(t);if(e){var o=kt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pt(this,r)}}function Pt(t,e){return!e||"object"!==mt(e)&&"function"!=typeof e?St(t):e}function St(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function kt(t){return(kt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jt(t,e)}(i,t);var e,r,n,o=wt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).onPostRender=e.onPostRender.bind(St(e)),e}return e=i,(r=[{key:"getCopyrights",value:function(){var t=this;if(!this.frameState)return[];var e=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ot.inView)(r,t.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(e=e.concat(n.getSource().getAttributions()(t.frameState)))})),dt(e)}},{key:"activate",value:function(){Ot(kt(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),Ot(kt(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(t){this.map&&this.element&&(this.frameState=t.frameState,this.render())}}])&>(e.prototype,r),n&>(e,n),i}(ht(z));function Tt(t){return(Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dt(t){return function(t){if(Array.isArray(t))return xt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return xt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(r),!0).forEach((function(e){Et(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Et(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function It(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function At(t,e,r){return(At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ut(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Lt(t,e){return(Lt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ut(t);if(e){var o=Ut(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ft(this,r)}}function Ft(t,e){return!e||"object"!==Tt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ut(t){return(Ut=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var qt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Lt(t,e)}(c,t);var e,r,n,o=Vt(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return It(this,c),o.call(this,Ct({controls:[].concat(Dt(Object(i.defaults)({attribution:!1}).getArray()),[new Rt])},t))}return e=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(t){t instanceof C?(t.init(this),this.mobilityLayers.push(t),t.olLayer&&At(Ut(c.prototype),"addLayer",this).call(this,t.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):At(Ut(c.prototype),"addLayer",this).call(this,t)}},{key:"removeLayer",value:function(t){t instanceof C?(t.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(e){return e!==t})),t.olLayer&&At(Ut(c.prototype),"removeLayer",this).call(this,t)):At(Ut(c.prototype),"removeLayer",this).call(this,t)}},{key:"addControl",value:function(t){At(Ut(c.prototype),"addControl",this).call(this,t)}},{key:"removeControl",value:function(t){At(Ut(c.prototype),"removeControl",this).call(this,t)}}])&&Mt(e.prototype,r),n&&Mt(e,n),c}(nt(o.a)),Nt=r(0),Bt=r(11),Kt=r.n(Bt),zt=r(12),Gt=r.n(zt),Zt=r(7),Ht=r.n(Zt),Wt=r(5),$t=r.n(Wt);function Jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(r),!0).forEach((function(e){Yt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Yt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Xt=function(t,e,r){if(!1===t)return r;var n=$t.a.parseUrl(r);return!t&&n.query[e]?r:t?$t.a.stringifyUrl(Qt(Qt({},n),{},{query:Qt(Qt({},n.query),{},Yt({},e,t))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},te=function(t){if(!t||!t.style)return[];var e=t.style.sourceCaches,r=[];return Object.values(e).forEach((function(t){if(t.used){var e=t.getSource(),n=e.attribution||e.options&&e.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),dt(r)};function ee(t){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function re(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ne(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ie(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?oe(Object(r),!0).forEach((function(e){ce(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ce(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ue(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function se(t,e,r){return(se="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=he(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function le(t,e){return(le=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=he(t);if(e){var o=he(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return pe(this,r)}}function pe(t,e){return!e||"object"!==ee(e)&&"function"!=typeof e?ye(t):e}function ye(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function he(t){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var be=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&le(t,e)}(i,t);var e,r,n,o=fe(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ae(this,i);var r=new it.a({source:new Gt.a({}),render:function(e){if(!t.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=t.mbMap.getCanvas(),o=e.viewState,i=t.olLayer.getVisible();t.renderState.visible!==i&&(n.style.display=i?"block":"none",t.renderState.visible=i,n.style.position="absolute");var c=t.olLayer.getOpacity();t.renderState.opacity!==c&&(n.style.opacity=c,t.renderState.opacity=c);var a=o.rotation;t.renderState.rotation!==a&&(t.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,t.renderState.rotation=a),t.renderState.zoom===o.zoom&&t.renderState.center[0]===o.center[0]&&t.renderState.center[1]===o.center[1]||(t.mbMap.jumpTo({center:Object(Nt.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,t.renderState.zoom=o.zoom,t.renderState.center=o.center);var u=t.map.getSize();if(t.renderState.size[0]===u[0]&&t.renderState.size[1]===u[1]||(r=!0,t.renderState.size=u),t.mbMap&&t.mbMap.style&&t.mbMap.isStyleLoaded()&&r)try{t.mbMap._frame&&(t.mbMap._frame.cancel(),t.mbMap._frame=null),t.mbMap._render()}catch(t){console.warn(t)}return n}});return(t=o.call(this,ie(ie({},e),{},{olLayer:r}))).styleUrl=e.url,t.apiKey=e.apiKey,t.apiKeyName=e.apiKeyName||"key",t.updateAttribution=t.updateAttribution.bind(ye(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;se(he(i.prototype),"init",this).call(this,t),this.map&&!this.mbMap&&(this.format=new Ht.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{e.mbMap&&e.mbMap.resize()}catch(t){console.warn(t)}}))))}},{key:"createStyleUrl",value:function(){return Xt(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var t=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){t.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var e=re(this.map.getView().getCenter(),2),r=e[0],n=e[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new Kt.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Nt.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(t){console.warn("Failed creating mapbox map: ",t)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){t.loaded=!0,t.copyrights=t.copyrights||te(t.mbMap)||[],t.olLayer.getSource().setAttributions(t.copyrights),t.dispatchEvent({type:"load",target:t})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){t.loadMbMap()})))}},{key:"updateAttribution",value:function(t){var e=this.copyrights||te(t.target)||[];this.copyrights.toString()!==e.toString()&&this.olLayer.getSource().setAttributions(e)}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){var r=this;if(!(e&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:t,features:[],layer:this});var n=t&&this.mbMap.project(Object(Nt.toLonLat)(t));if(this.hitTolerance){var o=n,i=o.x,c=o.y;n=[{x:i-this.hitTolerance,y:c-this.hitTolerance},{x:i+this.hitTolerance,y:c+this.hitTolerance}]}var a=this.mbMap.queryRenderedFeatures(n,e).map((function(t){var e=r.format.readFeature(t);return e&&e.set("mapboxFeature",t),e}));return Promise.resolve({layer:this,features:a,coordinate:t})}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,se(he(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(t){return new i(ie(ie({},this.options),t))}}])&&ue(e.prototype,r),n&&ue(e,n),i}(C);var ve=r(1),de=r(13),me=r(6);var ge=r(4),Oe=r(15),je=r.n(Oe);function we(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Pe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pe(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ke(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Re(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Te=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Se(Object(r),!0).forEach((function(e){ke(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({interpolate:!0},e);this.pixelRatio=e.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.getPixelFromCoordinate=r.getPixelFromCoordinate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var e,r,n;return e=t,(r=[{key:"setVisible",value:function(t){this.canvas&&(this.canvas.style.visibility=t?"visible":"hidden")}},{key:"setTrajectories",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&t.sort(this.sort),this.trajectories=t}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.clear();var i,c,a,u,s,l,f,p,y=we(r,2),h=y[0],b=y[1];if(h&&b&&(this.canvas.width!==h||this.canvas.height!==b)){var v=[h*this.pixelRatio,b*this.pixelRatio];this.canvas.width=v[0],this.canvas.height=v[1]}this.canvas.style.left="0px",this.canvas.style.top="0px",this.canvas.style.transform="",this.canvas.style.width="".concat(this.canvas.width/this.pixelRatio,"px"),this.canvas.style.height="".concat(this.canvas.height/this.pixelRatio,"px"),this.currResolution=n||this.currResolution,this.renderedTrajectories=[];for(var d=(this.trajectories||[]).length-1;d>=0;d-=1){var m=this.trajectories[d],g=m.geometry,O=m.timeIntervals,j=m.timeOffset;if(!this.filter||this.filter(m,d,this.trajectories)){var w=null,P=void 0;if(!m.coordinate||!o&&this.interpolate){if(O&&O.length>1){for(var S=e-(j||0),k=void 0,R=void 0,T=void 0,D=void 0,x=void 0,_=0;_<O.length-1;_+=1){var C=we(O[_],3);k=C[0],T=C[1],P=C[2];var E=we(O[_+1],2);if(R=E[0],D=E[1],k<=S&&S<=R)break;k=null,R=null}if(g.getType()===je.a.POINT)w=g.getCoordinates();else if(g.getType()===je.a.LINE_STRING){if(k&&R){x=this.interpolate?Math.min((S-k)/(R-k),1):0;var I=this.interpolate?x*(D-T)+T:0;w=g.getCoordinateAt(I),this.trajectories[d].rotation=P,this.trajectories[d].endFraction=x}else if(S<O[0][0]){var M=we(O,1),A=we(M[0],3);P=A[2],x=0,w=g.getFirstCoordinate()}else if(S>O[O.length-1][0]){var L=we(O[O.length-1],3);P=L[2],x=1,w=g.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",g);this.trajectories[d].rotation=P,this.trajectories[d].endFraction=x||0}}else w=m.coordinate;if(w){this.trajectories[d].coordinate=w;var V=this.getPixelFromCoordinate(w);if(!V)continue;V=V.map((function(e){return e*t.pixelRatio})),this.trajectories[d].rendered=!0,this.renderedTrajectories.push(this.trajectories[d]);var F=this.style(m,this.currResolution,this.pixelRatio);if(!F)continue;var U=F.width,q=F.height;this.hoverVehicleId!==m.id&&this.selectedVehicleId!==m.id&&this.canvasContext.drawImage(F,V[0]-U/2,V[1]-q/2,U,q),this.hoverVehicleId===m.id&&(i=F,c=V,a=U,u=q),this.selectedVehicleId===m.id&&(s=F,l=V,f=U,p=q)}}}s&&this.canvasContext.drawImage(s,l[0]-f/2,l[1]-p/2,f,p),i&&this.canvasContext.drawImage(i,c[0]-a/2,c[1]-u/2,a,u)}},{key:"destroy",value:function(){Object(c.unByKey)(this.olEventsKeys),this.renderedTrajectories=[],this.clear()}}])&&Re(e.prototype,r),n&&Re(e,n),t}(),De={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]},xe=["Tram","Subway / Metro / S-Bahn","Train","Bus","Ferry","Cable Car","Gondola","Funicular","Long distance bus","Rail"],_e=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],Ce=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],Ee=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],Ie=function(t){if("string"==typeof t){var e=xe.find((function(e){return new RegExp(t).test(e)}));return xe.indexOf(e)}return t},Me=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=Ie(t);return _e[e]}catch(t){return 1}},Ae=function(t,e,r){return e?r?"#ff0000":"#a0a0a0":t>=36e5?"#ed004c":t>=5e5?"#e80000":t>=3e5?"#ff4a00":t>=18e4?"#f7bf00":null===t?"#a0a0a0":"#00a00c"};function Le(t){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ve(t){return function(t){if(Array.isArray(t))return Fe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Fe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fe(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ue(Object(r),!0).forEach((function(e){Ne(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ne(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Be(t,e,r){return(Be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ze(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ke(t,e){return(Ke=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ze(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ze(t);if(e){var o=Ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ge(this,r)}}function Ge(t,e){return!e||"object"!==Le(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ze(t){return(Ze=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function He(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function We(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $e(t,e,r){return e&&We(t.prototype,e),r&&We(t,r),t}var Je=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ke(t,e)}(r,t);var e=ze(r);function r(){return He(this,r),e.apply(this,arguments)}return $e(r,[{key:"defineProperties",value:function(t){var e=this,n=qe({isHoverActive:!0},t),o=n.isHoverActive,i=n.style,c=n.speed,a=t.pixelRatio,u=t.interpolate,s=t.hoverVehicleId,l=t.selectedVehicleId,f=t.filter,p=t.sort,y=t.time,h=t.live,b={pixelRatio:a||window.devicePixelRatio||1,interpolate:u,hoverVehicleId:s,selectedVehicleId:l,filter:f,sort:p,style:i};Object.keys(b).forEach((function(t){return void 0===b[t]&&delete b[t]}));var v=c||1,d=y||new Date;Be(Ze(r.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{isTrackerLayer:{value:!0},isHoverActive:{value:!!o,writable:!0},style:{value:i||this.defaultStyle},speed:{get:function(){return v},set:function(t){v=t,e.start()}},filter:{get:function(){return e.tracker?e.tracker.filter:e.initTrackerOptions.filter},set:function(t){e.tracker?e.tracker.filter=t:e.initTrackerOptions.filter=t}},sort:{get:function(){return e.tracker?e.tracker.sort:e.initTrackerOptions.sort},set:function(t){e.tracker?e.tracker.sort=t:e.initTrackerOptions.sort=t}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==h||h,writable:!0},time:{get:function(){return d},set:function(t){d=t&&t.getTime?t:new Date(t),e.renderTrajectories()}},renderedTrajectories:{get:function(){var t;return(null===(t=e.tracker)||void 0===t?void 0:t.renderedTrajectories)||[]}},hoverVehicleId:{get:function(){return e.tracker?e.tracker.hoverVehicleId:e.initTrackerOptions.hoverVehicleId},set:function(t){e.tracker?e.tracker.hoverVehicleId=t:e.initTrackerOptions.hoverVehicleId=t}},selectedVehicleId:{get:function(){return e.tracker?e.tracker.selectedVehicleId:e.initTrackerOptions.selectedVehicleId},set:function(t){e.tracker?e.tracker.selectedVehicleId=t:e.initTrackerOptions.selectedVehicleId=t}},pixelRatio:{get:function(){return e.tracker?e.tracker.pixelRatio:e.initTrackerOptions.pixelRatio},set:function(t){e.tracker?e.tracker.pixelRatio=t:e.initTrackerOptions.pixelRatio=t}},initTrackerOptions:{value:b,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0}})}},{key:"init",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Be(Ze(r.prototype),"init",this).call(this,t),this.tracker=new Te(qe(qe({style:function(t,r){return e.style(t,r)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(t){t.target.visible?e.start():e.stop()}))}},{key:"terminate",value:function(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),Be(Ze(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.tracker.setVisible(!0),this.renderTrajectories(),this.startUpdateTime()}},{key:"startUpdateTime",value:function(){var t=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){t.time=t.live?new Date:t.time.getTime()+t.updateTimeDelay*t.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(t,e,r,n){if(this.tracker){var o=this.live?Date.now():this.time;this.tracker.renderTrajectories(o,t,e,n)}}},{key:"renderTrajectories",value:function(t,e,r,n){var o=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){o.renderTrajectoriesInternal(t,e,r,n)})):this.renderTrajectoriesInternal(t,e,r,n)}},{key:"getVehicle",value:function(t){return this.tracker.getTrajectories().filter(t)}},{key:"getVehiclesAtCoordinate",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(ge.buffer)([].concat(Ve(t),Ve(t)),10*e),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(ge.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getRefreshTimeInMs",value:function(t){var e=Math.round(t),r=Ee[e]||25;return Math.max(25,r/this.speed)}},{key:"defaultStyle",value:function(t){var e=t.id;if(this.styleCache[e])return this.styleCache[e];var r=document.createElement("canvas");r.width=200,r.height=15;var n=r.getContext("2d");return n.arc(8,8,5,0,2*Math.PI,!1),n.fillStyle="#8ED6FF",n.fill(),n.lineWidth=3,n.strokeStyle="black",n.stroke(),n.font="bold 12px arial",n.strokeStyle="white",n.lineWidth=3,n.strokeText(e,20,10),n.fillStyle="black",n.fillText(e,20,10),this.styleCache[e]=r,this.styleCache[e]}}]),r}(t)};function Qe(t){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ye(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Xe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xe(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function er(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tr(Object(r),!0).forEach((function(e){rr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function rr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ir(t,e,r){return(ir="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sr(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function cr(t,e){return(cr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ar(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=sr(t);if(e){var o=sr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ur(this,r)}}function ur(t,e){return!e||"object"!==Qe(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function sr(t){return(sr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cr(t,e)}(i,t);var e,r,n,o=ar(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nr(this,i),(t=o.call(this,er({},e))).renderWhenZooming=e.renderWhenZooming||function(){return!0},t.renderWhenRotating=e.renderWhenRotating||function(){return!0},t.olLayer=e.olLayer||new me.Group({layers:[new me.Layer({source:new Gt.a({}),render:function(e){if(!t.tracker||!t.tracker.canvas)return null;var r=e.viewState,n=r.zoom,o=r.center,i=r.rotation,c=n!==t.renderState.zoom,a=n!==t.renderState.zoom;if(c||a){if(t.renderState.zoom=n,t.renderState.center=o,t.renderState.rotation=i,c&&!t.renderWhenZooming(n)||a&&!t.renderWhenRotating(i))return t.tracker.clear(),t.tracker.canvas;t.renderTrajectories(!0)}else if(t.renderState.center[0]!==o[0]||t.renderState.center[1]!==o[1]){var u=t.map.getPixelFromCoordinate(o),s=t.map.getPixelFromCoordinate(t.renderState.center),l=parseFloat(t.tracker.canvas.style.left),f=parseFloat(t.tracker.canvas.style.top);t.tracker.canvas.style.left="".concat(l-(u[0]-s[0]),"px"),t.tracker.canvas.style.top="".concat(f-(u[1]-s[1]),"px"),t.renderState.center=o,t.renderState.rotation=i}return t.tracker.canvas}})]}),t.renderState={center:[0,0],zoom:null,rotation:0},t.olEventsKeys=[],t}return e=i,(r=[{key:"init",value:function(t){t&&ir(sr(i.prototype),"init",this).call(this,t,{getPixelFromCoordinate:t.getPixelFromCoordinate.bind(t)})}},{key:"start",value:function(){var t=this;ir(sr(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("moveend",(function(){var e=t.map.getView().getZoom();e!==t.currentZoom&&(t.currentZoom=e,t.requestIntervalSeconds=200/e||1e3)})),this.map.on("pointermove",(function(e){if(!t.map.getView().getInteracting()&&!t.map.getView().getAnimating()&&t.isHoverActive){var r=Ye(t.getVehiclesAtCoordinate(e.coordinate,1),1)[0],n=r&&r.id;t.hoverVehicleId!==n&&(t.map.getTargetElement().style.cursor=r?"pointer":"auto",t.hoverVehicleId=n,t.renderTrajectories())}}))]}},{key:"stop",value:function(){ir(sr(i.prototype),"stop",this).call(this),Object(c.unByKey)(this.olEventsKeys),this.olEventsKeys=[]}},{key:"renderTrajectories",value:function(t){var e=this.map.getView();ir(sr(i.prototype),"renderTrajectories",this).call(this,this.map.getSize(),e.getResolution(),e.getRotation(),t)}},{key:"getRefreshTimeInMs",value:function(){return ir(sr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=this.map.getView().getResolution();return ir(sr(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"clone",value:function(t){return new i(er(er({},this.options),t))}}])&&or(e.prototype,r),n&&or(e,n),i}(Je(C)),fr=r(8),pr=r.n(fr),yr=r(3),hr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=(t.getUTCMonth()+1).toString();e=1===e.length?"0".concat(e):e;var r=t.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[t.getUTCFullYear(),e,r].join("")},br=function(t){return[t.getUTCHours(),t.getUTCMinutes(),"".concat(t.getUTCSeconds(),".").concat(t.getUTCMilliseconds())].join(":")};function vr(t){return(vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dr(Object(r),!0).forEach((function(e){gr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function gr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wr(t,e){return(wr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Pr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=kr(t);if(e){var o=kr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Sr(this,r)}}function Sr(t,e){return!e||"object"!==vr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function kr(t){return(kr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wr(t,e)}(i,t);var e,r,n,o=Pr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Or(this,i),(t=o.call(this)).url=e.url,t.apiKey=e.apiKey,t}return e=i,(r=[{key:"fetch",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=mr(mr({},e),{},{key:this.apiKey}),o=mr({},n);return Object.keys(n).forEach((function(t){return(void 0===o[t]||null===o[t])&&delete o[t]})),this.apiKey?fetch("".concat(this.url).concat(t,"?").concat($t.a.stringify(o)),r).then((function(t){try{return t.json().then((function(t){if(t.error)throw new Error(t.error);return t}))}catch(t){return Promise.reject(new Error(t))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&jr(e.prototype,r),n&&jr(e,n),i}(I.a);function Tr(t){return(Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dr(Object(r),!0).forEach((function(e){_r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ir(t,e){return(Ir=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Lr(t);if(e){var o=Lr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ar(this,r)}}function Ar(t,e){return!e||"object"!==Tr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Lr(t){return(Lr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Vr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ir(t,e)}(i,t);var e,r,n,o=Mr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Cr(this,i),o.call(this,xr({url:"https://api.geops.io/stops/v1/"},t))}return e=i,(r=[{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",t,{signal:e.signal}).then((function(t){return t.features}))}}])&&Er(e.prototype,r),n&&Er(e,n),i}(Rr);function Fr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ur(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var qr=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=n.d,i=n.m,c=n.y;e.push({day:o,month:i,year:c})}return e},Nr=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fr(Object(r),!0).forEach((function(e){Ur(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);["a","f","tt"].forEach((function(t){e[t]||(e[t]={})}));for(var r=e.id,n=e.hs,o=e.t,i=e.ln,c=e.sn,a=e.wa,u=e.ba,s=e.rt,l=e.fid,f=e.rid,p=e.c,y=e.tc,h=e.a,b=h.n,v=h.u,d=h.tz,m=e.f,g=m.n,O=m.u,j=m.tz,w=e.tt,P=w.n,S=w.p,k=w.t,R=e.sts,T=qr(P),D=qr(S),x=p&&"#".concat(p),_=y&&"#".concat(y),C=[],E=0;E<(R||[]).length;E+=1){var I=R[E],M=I.sid,A=I.n,L=I.p,V=I.at,F=I.dt,U=I.ap,q=I.dp,N=I.ad,B=I.dd,K=I.dot,z=I.put,G=I.c,Z=I.wa;C.push({stationId:M,stationName:A,coordinates:L,arrivalTime:-1!==V?1e3*U:null,departureTime:-1!==F?1e3*q:null,arrivalDelay:N,departureDelay:B,noDropOff:!!K,noPickUp:!!z,cancelled:!!G,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:x,color:_,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:C,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:k,notOperatingDays:T,additionalOperatingDays:D},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},Br=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=new yr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=i.DirectionText,f=i.Operator,p=i.OperatorURL,y=i.Publisher,h=i.PublisherURL,b=i.License,v=i.LicenseUrl,d=i.LicenseNote,m=i.Color,g=i.JourneyIdentifier,O=i.RealtimeAvailable,j=i.OperatorProvidesRealtime,w=i.DayOfOperation,P=i.Delay,S=i.TimeIntervals,k=i.TextColor,R=i.Cancelled;e.push({id:c,type:a,name:u,routeIdentifier:s,directionText:l,operator:f,operatorUrl:p,publisher:y,publisherUrl:h,license:b,licenseUrl:v,licenseNote:d,journeyIdentifier:g,realtimeAvailable:O,operatorProvidesRealtime:j,dayOfOperation:w,delay:P,timeIntervals:S,color:m&&"#".concat(m),textColor:k&&"#".concat(k),geometry:o,cancelled:R})}return e};function Kr(t){return(Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?zr(Object(r),!0).forEach((function(e){Zr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Zr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $r(t,e){return($r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Jr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yr(t);if(e){var o=Yr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qr(this,r)}}function Qr(t,e){return!e||"object"!==Kr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Yr(t){return(Yr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Xr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$r(t,e)}(i,t);var e,r,n,o=Jr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Hr(this,i),o.call(this,Gr({url:"https://api.geops.io/tracker/v1"},t))}return e=i,(r=[{key:"fetchTrajectoryById",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",t,{signal:e.signal})}},{key:"fetchTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",t,{signal:e.signal}).then((function(t){return Br(t.features)}))}},{key:"fetchTrajectoryStations",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",t,{signal:e.signal}).then((function(t){return Nr(t)}))}}])&&Wr(e.prototype,r),n&&Wr(e,n),i}(Rr);function tn(t){return function(t){if(Array.isArray(t))return en(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return en(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return en(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function en(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var nn=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subscriptions=[],this.connect(e),setInterval((function(){r.send("PING")}),1e4),this.subscribed={}}var e,r,n;return e=t,n=[{key:"getRequestString",value:function(t,e){var r="".concat(t," ").concat(e.channel);return r+=e.args?" ".concat(e.args):"",(r+=e.id?" ".concat(e.id):"").trim()}}],(r=[{key:"connect",value:function(t){var e=this;this.websocket&&this.websocket.readyState!==this.websocket.CLOSED&&this.websocket.close(),this.websocket=new WebSocket(t),this.currentProj&&this.setProjection(this.currentProj),this.currentBbox&&this.setBbox(this.currentBbox),tn(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,!0)})),this.websocket.onclose=function(){window.clearTimeout(e.reconnectTimeout),e.reconnectTimeout=window.setTimeout((function(){return e.connect(t)}),100)}}},{key:"get",value:function(e,r,n){var o=t.getRequestString("GET",e);this.send(o),this.listen(e,r,n)}},{key:"send",value:function(t){var e=this,r=function(){e.websocket.send(t)};this.websocket.readyState===WebSocket.CONNECTING?this.websocket.addEventListener("open",r):r()}},{key:"setProjection",value:function(t){this.currentProj=t,this.send("PROJECTION ".concat(t))}},{key:"setBbox",value:function(t){var e=this;this.currentBbox=t,this.send("BBOX ".concat(t.join(" "))),this.subscriptions.forEach((function(t){e.get(t.params,t.cb,t.errorCb)}))}},{key:"listen",value:function(t,e,r){this.unlisten(t,e);var n=function(r){var n=JSON.parse(r.data),o=t.channel;o+=t.args?" ".concat(t.args):"",n.source!==o||t.id&&t.id!==n.client_reference||e(n)};return this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r)),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t.channel&&(!e||r.cb===e)})).forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))}))}},{key:"subscribe",value:function(e,r,n,o){var i=this.listen(e,r,n),c=i.onMessageCb,a=i.onErrorCb,u=t.getRequestString("",e);if(!o){var s=this.subscriptions.findIndex((function(t){return e.channel===t.params.channel&&r===t.cb})),l={params:e,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a};s>-1?this.subscriptions[s]=l:this.subscriptions.push(l)}this.subscribed[u]||(this.send("GET ".concat(u)),this.send("SUB ".concat(u)),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(t,e){var r=this;this.subscriptions.filter((function(r){return r.params.channel===t&&(!e||r.cb===e)})).forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==t||e&&r.cb!==e})),t&&this.subscribed[t]&&!this.subscriptions.find((function(e){return e.params.channel===t}))&&(this.send("DEL ".concat(t)),this.subscribed[t]=!1)}}])&&rn(e.prototype,r),n&&rn(e,n),t}(),on=function(t,e){return t===e.SCHEMATIC?"_schematic":""},cn=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=t.has_fzo&&n.indexOf(t.state)>-1,i=e.has_fzo&&n.indexOf(e.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(t.state!==e.state)return n.indexOf(t.state)-n.indexOf(e.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(t.min_arrival_time||t.time).getTime()-u,a=new Date(e.min_arrival_time||e.time).getTime()-u):(c=new Date(t.time).getTime()-u,a=new Date(e.time).getTime()-u),c-a},an=function(t){if(t)return t.stations.forEach((function(t){t.arrivalTimeWithDelay=t.arrivalTime,t.departureTime&&(t.departureTimeWithDelay=t.departureTime),t.arrivalDelay&&(t.arrivalTime-=t.arrivalDelay,t.departureTime&&(t.departureTime-=t.arrivalDelay))})),t};function un(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ln={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},fn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};un(this,t);var r=null;r="string"==typeof e?e:e.url,e.apiKey&&(r="".concat(r,"?key=").concat(e.apiKey)),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=e.prefix||"",this.conn=new nn(r),this.conn.setProjection(e.projection||"epsg:3857"),e.bbox&&this.conn.setBbox(e.bbox)}var e,r,n;return e=t,(r=[{key:"subscribe",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:t},e,r,n)}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;this.conn.unsubscribe("".concat(t).concat(on(ln.SCHEMATIC,ln)).concat(e),r),this.conn.unsubscribe("".concat(t).concat(on(ln.TOPOGRAPHIC,ln)).concat(e),r)}},{key:"filterDepartures",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(t).map((function(e){return t[e]}));r.sort((function(t,r){return cn(t,r,e)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],c=[],a=null,u=r.length-1;u>=0;u-=1){var s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=t;var o=t?"timetable_".concat(t):null,i={};this.subscribe(o,(function(t){if(t.source===o){var c=t.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(e.departureUpdateTimeout),e.departureUpdateTimeout=window.setTimeout((function(){var t=e.filterDepartures(i,r);n(t)}),100)}}),(function(){n([])}))}},{key:"unsubscribeDepartures",value:function(t){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",t),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(t){this.subscribe("".concat(this.prefix,"newsticker"),(function(e){t(e.content)}))}},{key:"unsubscribeDisruptions",value:function(t){this.unsubscribe("".concat(this.prefix,"newsticker"),"",t)}},{key:"getStation",value:function(t,e){var r=this,n={channel:"station".concat(on(e,ln)),args:t};return new Promise((function(t,e){r.conn.get(n,(function(r){r.content?t(r.content):e()}))}))}},{key:"getStations",value:function(t,e){var r=this,n=[];e&&this.conn.setBbox(e);var o={channel:"station".concat(on(t,ln))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(t,e){r.conn.get(o,(function(o){o.content?(n.push(o.content),window.clearTimeout(r.stationUpdateTimeout),r.stationUpdateTimeout=window.setTimeout((function(){t(n)}),50)):e(o.content)}))}))}},{key:"subscribeStations",value:function(t,e,r){this.unsubscribeStations(),e&&this.conn.setBbox(e),this.subscribe("station".concat(on(t,ln)),(function(t){t.content&&r(t.content)}))}},{key:"unsubscribeStations",value:function(t){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",t)}},{key:"subscribeExtraGeoms",value:function(t){var e=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?e.extraGeoms[o]=n:delete e.extraGeoms[o],t(Object.keys(e.extraGeoms).map((function(t){return e.extraGeoms[t]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(t){this.unsubscribe("extra_geoms","",t)}},{key:"subscribeTrajectory",value:function(t,e){this.unsubscribeTrajectory(e),this.subscribe("trajectory".concat(on(t,ln)),e)}},{key:"unsubscribeTrajectory",value:function(t){this.unsubscribe("trajectory","",t)}},{key:"subscribeDeletedVehicles",value:function(t,e){this.unsubscribeDeletedVehicles(e),this.subscribe("deleted_vehicles".concat(on(t,ln)),e)}},{key:"unsubscribeDeletedVehicles",value:function(t){this.unsubscribe("deleted_vehicles","",t)}},{key:"getFullTrajectory",value:function(t,e){var r=this,n={channel:"full_trajectory".concat(on(e,ln),"_").concat(t)};return new Promise((function(t){r.conn.get(n,(function(e){e.content&&t(e.content)}))}))}},{key:"getFullTrajectories",value:function(t,e){var r=this,n=t.map((function(t){return r.getFullTrajectory(t,e)}));return Promise.all(n)}},{key:"subscribeFullTrajectory",value:function(t,e){this.unsubscribeFullTrajectory(t),this.subscribe("full_trajectory".concat(on(e,ln),"_").concat(t),(function(t){console.log("subscribe full_trajectory",t)}),(function(t){console.log("subscribe full_trajectory error",t)}))}},{key:"unsubscribeFullTrajectory",value:function(t,e){this.unsubscribe("full_trajectory","_".concat(t),e)}},{key:"getStopSequence",value:function(t){var e=this,r={channel:"stopsequence_".concat(t)};return new Promise((function(t,n){e.conn.get(r,(function(e){if(e.content&&e.content.length){var r=e.content.map((function(t){return an(t)}));t(r)}t([])}),(function(t){n(t)}))}))}},{key:"getStopSequences",value:function(t){var e=this,r=t.map((function(t){return e.getStopSequence(t)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(t,e){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(t),this.subscribe("stopsequence_".concat(t),(function(t){if(t.content&&t.content.length){var r=t.content.map((function(t){return an(t)}));e(r)}}),(function(t){console.log("subscribe stopsequence error",t)}))}},{key:"unsubscribeStopSequence",value:function(t,e){this.unsubscribe("stopsequence","_".concat(t),e)}},{key:"subscribeHealthCheck",value:function(t){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",t)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&sn(e.prototype,r),n&&sn(e,n),t}();function pn(t){return(pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function hn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yn(Object(r),!0).forEach((function(e){bn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vn(t,e,r){return(vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=On(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function dn(t,e){return(dn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=On(t);if(e){var o=On(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gn(this,r)}}function gn(t,e){return!e||"object"!==pn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function On(t){return(On=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Pn(t,e,r){return e&&wn(t.prototype,e),r&&wn(t,r),t}var Sn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dn(t,e)}(r,t);var e=mn(r);function r(){return jn(this,r),e.apply(this,arguments)}return Pn(r,[{key:"defineProperties",value:function(t){var e=this;vn(On(r.prototype),"defineProperties",this).call(this,t);var n,o=t.regexPublishedLineName,i=t.publishedLineName,c=t.tripNumber,a=t.operator,u=3;if(!t.api){var s={};t.url&&(s.url=t.url),t.apiKey&&(s.apiKey=t.apiKey),n=new Xr(s)}Object.defineProperties(this,{showVehicleTraj:{value:void 0===t.showVehicleTraj||t.showVehicleTraj,writable:!0},delayDisplay:{value:t.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:t.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:t.useDelayStyle||!1,writable:!0},requestIntervalSeconds:{get:function(){return u},set:function(t){t!==u&&(u=t,e.visible&&e.start())}},publishedLineName:{get:function(){return i},set:function(t){i=t,e.updateFilters()}},tripNumber:{get:function(){return c},set:function(t){c=t,e.updateFilters()}},operator:{get:function(){return a},set:function(t){a=t,e.updateFilters()}},regexPublishedLineName:{get:function(){return o},set:function(t){o=t,e.updateFilters()}},api:{value:t.api||n}})}},{key:"init",value:function(t){vn(On(r.prototype),"init",this).call(this,t),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(t,e){return null===t.delay||t.delay<e.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),vn(On(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.journeyId=null,this.stopUpdateTrajectories(),this.abortFetchTrajectories(),vn(On(r.prototype),"stop",this).call(this)}},{key:"updateFilters",value:function(){var t=$t.a.parse(window.location.search.toLowerCase());this.filter=function(t,e,r,n){var o=[];if(!(t||e||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(t){return i.some((function(e){return new RegExp(e,"i").test(t.name)}))}))}if(t){var c=("string"==typeof t?t.split(","):t).map((function(t){return t.replace(/\s+/g,"").toUpperCase()}));o.push((function(t){return c.some((function(e){return e===t.name.toUpperCase()}))}))}if(e){var a=("string"==typeof e?e.split(","):e).map((function(t){return parseInt(t,10)}));o.push((function(t){var e=parseInt(t.routeIdentifier.split(".")[0],10);return a.some((function(t){return t===e}))}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(t){return u.some((function(e){return new RegExp(e,"i").test(t.operator)}))}))}return o.length?function(t){for(var e=0;e<o.length;e+=1)if(!o[e](t))return!1;return!0}:null}(this.publishedLineName||t.publishedlinename,this.tripNumber||t.tripnumber,this.operator||t.operator,this.regexPublishedLineName)}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"updateTrajectoryStations",value:function(t){var e=this.getParams({id:t,time:br(new Date)});return this.api.fetchTrajectoryStations(e)}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=1e3*(this.requestIntervalSeconds+5),r=this.speed*e,n=this.time,o=!0;if(this.later&&n.getTime()>this.later.getTime()-1e3*this.requestIntervalSeconds&&(o=!1),!this.later||!o||this.later.getTime()-n.getTime()>r){var i=new Date(n.getTime()+r);this.later=i}var c=hn(hn({},t),{},{btime:br(n),etime:br(this.later),date:hr(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var t=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){t.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var t=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(t){if("AbortError"!==t.name)throw t})).then((function(e){e&&(t.tracker.setTrajectories(e),t.renderTrajectories())}))}},{key:"defaultStyle",value:function(t,e){var r=t.type,n=t.name,o=t.id,i=t.color,c=t.textColor,a=t.delay,u=t.cancelled,s=t.operatorProvidesRealtime,l=Math.min(Math.floor(e||1),16),f=this.hoverVehicleId===o,p=this.selectedVehicleId===o,y="".concat(l).concat(r).concat(n).concat(s).concat(a).concat(f).concat(p).concat(u),h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;try{var r=Ie(t);return De[r][e]}catch(t){return 1}}(r,l)*this.pixelRatio,b=h>=7*this.pixelRatio;(f||p)&&(h=b?h+5*this.pixelRatio:14*this.pixelRatio);var v=h>10*this.pixelRatio;if(v||(y="".concat(l).concat(r).concat(i).concat(s).concat(a).concat(f).concat(p).concat(u)),!this.styleCache[y]){if(0===h)return this.styleCache[y]=null,null;var d=1*this.pixelRatio,m=h+2,g=2*h,O=document.createElement("canvas");O.width=2*m+2*d+100*this.pixelRatio,O.height=2*m+2*d+100*this.pixelRatio;var j,w=O.getContext("2d"),P=O.width/2;if(b&&null!==a&&(w.save(),w.beginPath(),w.arc(P,P,m,0,2*Math.PI,!1),w.fillStyle=Ae(a,u),w.filter="blur(1px)",w.fill(),w.restore()),b&&(f||a>=this.delayDisplay||u)){w.save(),w.textAlign="left",w.textBaseline="middle",w.font="bold ".concat(Math.max(u?19:14,Math.min(u?19:17,1.2*h)),"px arial, sans-serif"),w.fillStyle=Ae(a,u,!0),w.strokeStyle=this.delayOutlineColor,w.lineWidth=1.5*this.pixelRatio;var S=function(t,e){if(e)return String.fromCodePoint(215);if(t>36e5){var r=Math.round(t/36e5);return"+".concat(r,"h")}if(t>59e3){var n=Math.round(t/6e4);return"+".concat(n,"m")}return t>0?"+".concat(t,"s"):""}(a,u);w.strokeText(S,P+m+d,P),w.fillText(S,P+m+d,P),w.restore()}if(j=this.useDelayStyle?Ae(a,u):i||Me(r),w.save(),(b||f||p)&&(w.lineWidth=1*this.pixelRatio,w.strokeStyle="#000000"),w.fillStyle=j,w.beginPath(),w.arc(P,P,h,0,2*Math.PI,!1),w.fill(),b&&this.useDelayStyle&&null===a&&"yes"===s&&w.setLineDash([5,3]),(b||f||p)&&w.stroke(),w.restore(),v){var k=function(t,e,r,n){t.font="bold ".concat(n,"px Arial");for(var o=t.measureText(r),i=0;o.width>e-6&&i<25;)n-=.5,t.font="bold ".concat(n,"px arial, sans-serif"),o=t.measureText(r),i+=1;return n}(w,g,n,Math.max(h,10*this.pixelRatio));this.useDelayStyle&&null===a&&"yes"===s&&(w.save(),w.textBaseline="middle",w.textAlign="center",w.font="bold ".concat(k+2,"px Arial"),w.strokeStyle=j,w.strokeText(n,P,P),w.restore()),w.save(),w.textBaseline="middle",w.textAlign="center",w.fillStyle=this.useDelayStyle?"#000000":c||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=Ie(t);return Ce[e]}catch(t){return 1}}(r),w.font="bold ".concat(k,"px Arial"),w.strokeStyle=j,w.strokeText(n,P,P),w.fillText(n,P,P),w.restore()}this.styleCache[y]=O}return this.styleCache[y]}}]),r}(t)};function kn(t){return(kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||Dn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tn(t){return function(t){if(Array.isArray(t))return xn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Dn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dn(t,e){if(t){if("string"==typeof t)return xn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xn(t,e):void 0}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Cn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(r),!0).forEach((function(e){En(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function En(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function In(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function An(t,e,r){return(An="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Un(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ln(t,e){return(Ln=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Un(t);if(e){var o=Un(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fn(this,r)}}function Fn(t,e){return!e||"object"!==kn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Un(t){return(Un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var qn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ln(t,e)}(i,t);var e,r,n,o=Vn(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return In(this,i),(t=o.call(this,Cn({},e))).vectorLayer=new me.Vector({source:new de.Vector({features:[]})}),t.olLayer.getLayers().insertAt(0,t.vectorLayer),t}return e=i,(r=[{key:"init",value:function(t){t&&(t.addLayer(this.vectorLayer),An(Un(i.prototype),"init",this).call(this,t))}},{key:"terminate",value:function(){this.map&&this.map.removeLayer(this.vectorLayer),An(Un(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(An(Un(i.prototype),"start",this).call(this),this.olEventsKeys=[].concat(Tn(this.olEventsKeys),[this.map.on("singleclick",this.onMapClick.bind(this)),this.map.on("moveend",this.onMoveEnd.bind(this))]))}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"onMapClick",value:function(t){var e=this;if(this.clickCallbacks.length){var r=Rn(this.getVehiclesAtCoordinate(t.coordinate,1),1)[0],n=[];if(r){var o=r.coordinate?new yr.Point(r.coordinate):null;n.push(new pr.a(Cn({geometry:o},r))),n.length&&(this.selectedVehicleId=n[0].get("id"),this.journeyId=n[0].get("journeyIdentifier"),this.updateTrajectoryStations(this.selectedVehicleId).then((function(n){e.clickCallbacks.forEach((function(o){return o(Cn(Cn({},r),n),e,t)}))})))}else this.selectedVehicleId=null,this.vectorLayer.getSource().clear(),this.clickCallbacks.forEach((function(r){return r(null,e,t)}))}}},{key:"drawFullTrajectory",value:function(t,e,r){var n=/#ffffff/i.test(r)?"#ff0000":r,o=this.vectorLayer.getSource();if(o.clear(),t){var i=new yr.MultiPoint(t),c=new pr.a(i);c.setStyle(new ve.Style({zIndex:1,image:new ve.Circle({radius:5,fill:new ve.Fill({color:"#000000"})})}));var a=new pr.a(i);a.setStyle(new ve.Style({zIndex:4,image:new ve.Circle({radius:4,fill:new ve.Fill({color:this.useDelayStyle?"#a0a0a0":n})})})),o.addFeatures([c,a])}var u=new pr.a({geometry:e});u.setStyle([new ve.Style({zIndex:2,stroke:new ve.Stroke({color:"#000000",width:6})}),new ve.Style({zIndex:3,stroke:new ve.Stroke({color:this.useDelayStyle?"#a0a0a0":n,width:4})})]),o.addFeature(u)}},{key:"updateTrajectoryStations",value:function(t){var e=this;return An(Un(i.prototype),"updateTrajectoryStations",this).call(this,t).then((function(t){return e.stationsCoords=[],t.stations.forEach((function(t){e.stationsCoords.push(Object(Nt.transform)(t.coordinates,"EPSG:4326","EPSG:3857"))})),e.highlightTrajectory(),t}))}},{key:"highlightTrajectory",value:function(){var t=this;this.api.fetchTrajectoryById(this.getParams({id:this.journeyId,time:br(new Date)})).then((function(e){var r=e.p,n=e.t,o=e.c,i=[];r.forEach((function(t){t.forEach((function(t){i.push([t.x,t.y])}))})),t.drawFullTrajectory(t.stationsCoords,new yr.LineString(i),o?"#".concat(o):Me(n))})).catch((function(){t.vectorLayer.getSource().clear()}))}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getView().calculateExtent(),r=Object(ge.buffer)(e,Object(ge.getWidth)(e)/10).join(","),n=this.map.getView().getZoom();return An(Un(i.prototype),"getParams",this).call(this,Cn(Cn({},t),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"defaultStyle",value:function(t){var e=this.map.getView().getZoom();return An(Un(i.prototype),"defaultStyle",this).call(this,t,e)}},{key:"clone",value:function(t){return new i(Cn(Cn({},this.options),t))}}])&&Mn(e.prototype,r),n&&Mn(e,n),i}(Sn(lr)),Nn=r(21),Bn=r.n(Nn);function Kn(t){return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?zn(Object(r),!0).forEach((function(e){Zn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Zn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hn(t,e,r){return(Hn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yn(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Wn(t,e){return(Wn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yn(t);if(e){var o=Yn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jn(this,r)}}function Jn(t,e){return!e||"object"!==Kn(e)&&"function"!=typeof e?Qn(t):e}function Qn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yn(t){return(Yn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function to(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function eo(t,e,r){return e&&to(t.prototype,e),r&&to(t,r),t}var ro=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wn(t,e)}(r,t);var e=$n(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xn(this,r),(t=e.call(this,Gn({},n))).debug=n.debug,t.mode=n.mode||ln.TOPOGRAPHIC,t.trajectories=[],t.refreshTimeInMs=1e3/30,t.onMessage=t.onMessage.bind(Qn(t)),t.onDeleteMessage=t.onDeleteMessage.bind(Qn(t)),t.api=n.api||new fn(n),t.format=new Ht.a,t}return eo(r,[{key:"init",value:function(t){Hn(Yn(r.prototype),"init",this).call(this,t),this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage)}},{key:"terminate",value:function(){this.api.unsubscribeTrajectory(this.onMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteMessage),Hn(Yn(r.prototype),"terminate",this).call(this)}},{key:"setMode",value:function(t){this.mode!==t&&(this.mode=t,this.api.subscribeTrajectory(this.mode,this.onMessage),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteMessage))}},{key:"onMessage",value:function(t){if(t.content){var e=this.format.readFeature(t.content);if(e.set("timeOffset",Date.now()-t.timestamp),e.get("time_since_update")>=0){if(this.debug&&this.mode===ln.TOPOGRAPHIC&&e.get("raw_coordinates")){var r=new Bn.a(e.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),e.setGeometry(r)}this.addTrajectory(e.get("train_id"),e.getProperties(),!e.get("line"))}}}},{key:"onDeleteMessage",value:function(t){t.content&&this.removeTrajectoryByAttribute("train_id",t.content)}},{key:"addTrajectory",value:function(t,e,r){var n=this.trajectories.findIndex((function(e){return e.train_id===t})),o=e.time_intervals,i=Gn(Gn({},e),{},{id:t,timeIntervals:o});r?(this.trajectories.unshift(i),-1!==n&&this.tracker.trajectories.splice(n+1,1)):(this.trajectories.push(i),-1!==n&&this.tracker.trajectories.splice(n,1)),this.updateTrajectories()}},{key:"removeTrajectory",value:function(t){for(var e=0,r=this.trajectories.length;e<r;e+=1)if(this.trajectories[e].id===t){this.trajectories.splice(e,1);break}}},{key:"removeTrajectoryByAttribute",value:function(t,e){for(var r=0,n=this.trajectories.length;r<n;r+=1)if(this.trajectories[r][t]===e){this.removeTrajectory(this.trajectories[r].id);break}}},{key:"updateTrajectories",value:function(){this.tracker.setTrajectories(this.trajectories),this.renderTrajectories()}},{key:"getRefreshTimeInMs",value:function(){return this.refreshTimeInMs}}]),r}(t)};function no(t){return(no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function io(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?oo(Object(r),!0).forEach((function(e){co(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function co(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ao(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function so(t,e){return(so=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=po(t);if(e){var o=po(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return fo(this,r)}}function fo(t,e){return!e||"object"!==no(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function po(t){return(po=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&so(t,e)}(i,t);var e,r,n,o=lo(i);function i(){return ao(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"clone",value:function(t){return new i(io(io({},this.options),t))}}])&&uo(e.prototype,r),n&&uo(e,n),i}(ro(lr));function ho(t){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?bo(Object(r),!0).forEach((function(e){mo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function go(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jo(t,e,r){return(jo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ko(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function wo(t,e){return(wo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Po(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ko(t);if(e){var o=ko(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return So(this,r)}}function So(t,e){return!e||"object"!==ho(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ko(t){return(ko=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ro=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wo(t,e)}(i,t);var e,r,n,o=Po(i);function i(){return go(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(t);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(t){return t===e.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:t})}},{key:"init",value:function(t){var e=this;jo(ko(i.prototype),"init",this).call(this,t),this.map&&(this.singleClickRef=this.map.on("singleclick",(function(t){e.clickCallbacks.length&&e.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){return e.callClickCallbacks(t.features,t.layer,t.coordinate)})).catch((function(){return e.callClickCallbacks([],e,t.coordinate)}))})))}},{key:"callClickCallbacks",value:function(t,e,r){this.clickCallbacks.forEach((function(n){return n(t,e,r)}))}},{key:"terminate",value:function(){jo(ko(i.prototype),"terminate",this).call(this),this.singleClickRef&&Object(c.unByKey)(this.singleClickRef)}},{key:"clone",value:function(t){return new i(vo(vo({},this.options),t))}}])&&Oo(e.prototype,r),n&&Oo(e,n),i}(C);function To(t){return(To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Do(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Do(Object(r),!0).forEach((function(e){_o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Do(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Co(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Io(t,e,r){return(Io="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Mo(t,e){return(Mo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vo(t);if(e){var o=Vo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lo(this,r)}}function Lo(t,e){return!e||"object"!==To(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vo(t){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mo(t,e)}(i,t);var e,r,n,o=Ao(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Co(this,i),(t=o.call(this,e)).abortController=new AbortController,t.format=new Ht.a,t}return e=i,(r=[{key:"getFeatureInfoUrl",value:function(t){var e=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(t,r,e,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(t),{signal:r}).then((function(t){return t.json()})).then((function(t){return t.features})).then((function(r){return{layer:e,coordinate:t,features:r.map((function(t){return e.format.readFeature(t)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:t,layer:e})}))}},{key:"init",value:function(t){var e=this;Io(Vo(i.prototype),"init",this).call(this,t),this.map&&(this.singleClickRef=this.map.on("singleclick",(function(t){e.clickCallbacks.length&&e.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){return e.callClickCallbacks(t.features,t.layer,t.coordinate)}))})))}},{key:"callClickCallbacks",value:function(t,e,r){this.clickCallbacks.forEach((function(n){return n(t,e,r)}))}},{key:"terminate",value:function(){Io(Vo(i.prototype),"terminate",this).call(this),this.singleClickRef&&Object(c.unByKey)(this.singleClickRef)}},{key:"clone",value:function(t){return new i(xo(xo({},this.options),t))}}])&&Eo(e.prototype,r),n&&Eo(e,n),i}(C);r(14),r(22),r(23),r(16);function Uo(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function No(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qo(Object(r),!0).forEach((function(e){Bo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ko(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Zo(t);if(e){var o=Zo(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Go(this,r)}}function Go(t,e){return!e||"object"!==Uo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zo(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ho(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $o(t,e,r){return e&&Wo(t.prototype,e),r&&Wo(t,r),t}function Jo(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Xo(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ti(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ri(t);if(e){var o=ri(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return ei(this,r)}}function ei(t,e){return!e||"object"!==Jo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ri(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ni=z;var ni;function oi(t){return(oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ci(t,e,r){return(ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=fi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function ai(t,e){return(ai=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ui(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=fi(t);if(e){var o=fi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return si(this,r)}}function si(t,e){return!e||"object"!==oi(e)&&"function"!=typeof e?li(t):e}function li(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fi(t){return(fi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ai(t,e)}(i,t);var e,r,n,o=ui(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).render=e.render.bind(li(e)),e}return e=i,(r=[{key:"activate",value:function(){ci(fi(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),ci(fi(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return te(this.map)}}])&&ii(e.prototype,r),n&&ii(e,n),i}(ht(z));function yi(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function bi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?hi(Object(r),!0).forEach((function(e){vi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function vi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function di(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mi(t,e,r){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==wi(t););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function gi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Oi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=wi(t);if(e){var o=wi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return ji(this,r)}}function ji(t,e){return!e||"object"!==yi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function wi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}nt(Bt.Map);function Pi(t){return function(t){if(Array.isArray(t))return Si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Si(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Si(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Si(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ki=function(t){var e=t.getBounds().toArray(),r=[].concat(Pi(Object(Nt.fromLonLat)(e[0])),Pi(Object(Nt.fromLonLat)(e[1]))),n=t.getCanvas(),o=n.width,i=n.height,c=Object(ge.getWidth)(r)/o,a=Object(ge.getHeight)(r)/i;return Math.max(c,a)},Ri=function(t,e){var r=t.getCanvas(),n=r.width,o=r.height,i=t.unproject({x:0,y:0}),c=t.unproject({x:0,y:o/e}),a=t.unproject({x:n/e,y:o/e}),u=t.unproject({x:n/e,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function Ti(t){return(Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Di(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return xi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xi(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ci(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_i(Object(r),!0).forEach((function(e){Ei(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ei(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ii(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ai(t,e,r){return(Ai="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Li(t,e){return(Li=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=qi(t);if(e){var o=qi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fi(this,r)}}function Fi(t,e){return!e||"object"!==Ti(e)&&"function"!=typeof e?Ui(t):e}function Ui(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qi(t){return(qi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Li(t,e)}(i,t);var e,r,n,o=Vi(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ii(this,i),(t=o.call(this,Ci({},e))).onMapZoomEnd=t.onMapZoomEnd.bind(Ui(t)),t.onMapMouseMove=t.onMapMouseMove.bind(Ui(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;if(t){var r=t.getCanvas();Ai(qi(i.prototype),"init",this).call(this,t,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio,getPixelFromCoordinate:function(t){var r=Di(Object(Nt.toLonLat)(t),2),n=r[0],o=r[1],i=e.map.project({lng:n,lat:o});return[i.x,i.y]}})}}},{key:"start",value:function(){Ai(qi(i.prototype),"start",this).call(this),this.map.on("zoomend",this.onMapZoomEnd),this.isHoverActive&&this.map.on("mousemove",this.onMapMouseMove)}},{key:"stop",value:function(){Ai(qi(i.prototype),"stop",this).call(this),this.map&&(this.map.off("zoomend",this.onMapZoomEnd),this.map.off("mousemove",this.onMapMouseMove))}},{key:"renderTrajectories",value:function(t){var e=this.map.getCanvas();Ai(qi(i.prototype),"renderTrajectories",this).call(this,[e.width/this.pixelRatio,e.height/this.pixelRatio],ki(this.map),this.map.getBearing(),t)}},{key:"getRefreshTimeInMs",value:function(){return Ai(qi(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=ki(this.map);return Ai(qi(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"onMapZoomEnd",value:function(){this.startUpdateTime(this.map.getZoom())}},{key:"onMapMouseMove",value:function(t){if(this.map.isMoving()||this.map.isRotating()||this.map.isZooming()||!this.isHoverActive)this.map.getContainer().style.cursor="auto";else{var e=Di(this.getVehiclesAtCoordinate(Object(Nt.fromLonLat)([t.lngLat.lng,t.lngLat.lat]),1),1)[0],r=e&&e.id;this.hoverVehicleId!==r&&(this.map.getContainer().style.cursor=e?"pointer":"auto",this.hoverVehicleId=r,this.renderTrajectories())}}}])&&Mi(e.prototype,r),n&&Mi(e,n),i}(Je(O));function Bi(t){return(Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ki(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function zi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ki(Object(r),!0).forEach((function(e){Gi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ki(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Gi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Wi(t,e,r){return(Wi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function $i(t,e){return($i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Xi(t);if(e){var o=Xi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Qi(this,r)}}function Qi(t,e){return!e||"object"!==Bi(e)&&"function"!=typeof e?Yi(t):e}function Yi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xi(t){return(Xi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var tc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$i(t,e)}(i,t);var e,r,n,o=Ji(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Zi(this,i),(t=o.call(this,zi({},e))).onMove=t.onMove.bind(Yi(t)),t.onMoveEnd=t.onMoveEnd.bind(Yi(t)),t}return e=i,(r=[{key:"init",value:function(t,e){Wi(Xi(i.prototype),"init",this).call(this,t),this.map&&(this.map.on("zoomend",this.onZoomEnd),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.addSource("canvas-source",{type:"canvas",canvas:this.tracker.canvas,coordinates:Ri(this.map,this.pixelRatio),animate:!0}),this.map.addLayer({id:"canvas-layer",type:"raster",source:"canvas-source",paint:{"raster-opacity":1,"raster-fade-duration":0}},e))}},{key:"terminate",value:function(){this.map&&(this.map.off("zoomend",this.onZoomEnd),this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),Wi(Xi(i.prototype),"terminate",this).call(this)}},{key:"onMove",value:function(){this.map.getSource("canvas-source").setCoordinates(Ri(this.map,this.pixelRatio));var t=this.map.getCanvas(),e=t.width,r=t.height;this.renderTrajectories([e/this.pixelRatio,r/this.pixelRatio],ki(this.map),this.map.getBearing())}},{key:"onMoveEnd",value:function(){this.updateTrajectories()}}])&&Hi(e.prototype,r),n&&Hi(e,n),i}(ro(Ni));function ec(t){return(ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rc(t){return function(t){if(Array.isArray(t))return ic(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||oc(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nc(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||oc(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oc(t,e){if(t){if("string"==typeof t)return ic(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ic(t,e):void 0}}function ic(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ac(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?cc(Object(r),!0).forEach((function(e){uc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function uc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function fc(t,e,r){return(fc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function pc(t,e){return(pc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=vc(t);if(e){var o=vc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return hc(this,r)}}function hc(t,e){return!e||"object"!==ec(e)&&"function"!=typeof e?bc(t):e}function bc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vc(t){return(vc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var dc={mapbox:{TrajservLayer:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pc(t,e)}(i,t);var e,r,n,o=yc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sc(this,i),(t=o.call(this,ac({},e))).onMapClick=t.onMapClick.bind(bc(t)),t.onMove=t.onMove.bind(bc(t)),t.onMoveEnd=t.onMoveEnd.bind(bc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(bc(t)),t}return e=i,(r=[{key:"init",value:function(t,e){if(t){fc(vc(i.prototype),"init",this).call(this,t);var r={type:"canvas",canvas:this.tracker.canvas,coordinates:Ri(t,this.pixelRatio),animate:!0,attribution:this.copyrights};this.beforeId=e,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},t.addSource(this.key,r),t.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),fc(vc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(fc(vc(i.prototype),"start",this).call(this),this.map.on("click",this.onMapClick),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd))}},{key:"stop",value:function(){this.map&&(this.map.off("click",this.onClick),this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),fc(vc(i.prototype),"stop",this).call(this)}},{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(){this.map.getSource(this.key).setCoordinates(Ri(this.map,this.pixelRatio)),this.renderTrajectories(void 0,ki(this.map),this.map.getBearing())}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"onMapClick",value:function(t){var e=this;if(this.clickCallbacks.length){var r=nc(this.getVehiclesAtCoordinate(Object(Nt.fromLonLat)([t.lngLat.lng,t.lngLat.lat]),1),1)[0];r?(this.selectedVehicleId=r.id,this.journeyId=r.journeyIdentifier,this.updateTrajectoryStations(this.selectedVehicleId).then((function(n){e.stationsCoords=[],n.stations.forEach((function(t){e.stationsCoords.push(Object(Nt.fromLonLat)(t.coordinates))})),e.clickCallbacks.forEach((function(o){return o(ac(ac({},r),n),e,t)}))}))):(this.selectedVehicleId=null,this.clickCallbacks.forEach((function(r){return r(null,e,t)})))}}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getBounds().toArray(),r=Object(Nt.fromLonLat)(e[0]),n=Object(Nt.fromLonLat)(e[1]),o=[].concat(rc(r),rc(n)),c=Object(ge.buffer)(o,Object(ge.getWidth)(o)/10).join(","),a=this.map.getZoom();return fc(vc(i.prototype),"getParams",this).call(this,ac(ac({},t),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"defaultStyle",value:function(t){var e=this.map.getZoom();return fc(vc(i.prototype),"defaultStyle",this).call(this,t,e)}},{key:"drawFullTrajectory",value:function(t,e,r){console.log("to be implemented")}},{key:"highlightTrajectory",value:function(t){var e=this;this.api.fetchTrajectoryById({id:t,time:br(new Date)}).catch((function(){e.map.getLayer("highlight-trajectory")&&e.map.removeLayer("highlight-trajectory")}))}}])&&lc(e.prototype,r),n&&lc(e,n),i}(Sn(Ni)),TralisLayer:tc},ol:{Map:qt,Layer:C,WMSLayer:Fo,MapboxLayer:be,TrajservLayer:qn,TralisLayer:yo,VectorLayer:Ro}};e.default=dc}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|