mobility-toolbox-js 2.0.0-beta.52 → 2.0.0-beta.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -3
- package/api/RealtimeAPI.d.ts +8 -3
- package/api/RealtimeAPI.d.ts.map +1 -1
- package/api/RealtimeAPI.js +4 -1
- package/common/controls/ControlCommon.d.ts +1 -1
- package/common/controls/ControlCommon.d.ts.map +1 -1
- package/common/layers/LayerCommon.d.ts +1 -0
- package/common/layers/LayerCommon.d.ts.map +1 -1
- package/common/layers/LayerCommon.js +3 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +1 -1
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -1
- package/common/mixins/RealtimeLayerMixin.js +2 -2
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -1
- package/common/mixins/UserInteractionsLayerMixin.js +7 -10
- package/common/styles/realtimeDefaultStyle.d.ts +2 -2
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -1
- package/common/styles/realtimeDelayStyle.d.ts +2 -2
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -1
- package/common/styles/realtimeSimpleStyle.d.ts +2 -1
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -1
- package/common/typedefs.js +3 -3
- package/common/utils/{createTrackerFilters.d.ts → createRealtimeFilters.d.ts} +3 -3
- package/common/utils/createRealtimeFilters.d.ts.map +1 -0
- package/common/utils/{createTrackerFilters.js → createRealtimeFilters.js} +2 -2
- package/common/utils/getMapboxRender.d.ts +3 -3
- package/common/utils/getMapboxRender.d.ts.map +1 -1
- package/common/utils/getMapboxRender.js +2 -1
- package/common/utils/getMaplibreRender.d.ts +3 -1
- package/common/utils/getMaplibreRender.d.ts.map +1 -1
- package/common/utils/getMaplibreRender.js +4 -4
- package/common/utils/getRealtimeModeSuffix.d.ts +4 -2
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -1
- package/common/utils/getUrlWithParams.d.ts +2 -2
- package/common/utils/getUrlWithParams.d.ts.map +1 -1
- package/common/utils/getVehiclePosition.d.ts +7 -5
- package/common/utils/getVehiclePosition.d.ts.map +1 -1
- package/common/utils/index.d.ts +2 -2
- package/common/utils/index.js +3 -3
- package/common/utils/realtimeConfig.d.ts +49 -0
- package/common/utils/realtimeConfig.d.ts.map +1 -0
- package/common/utils/{trackerConfig.js → realtimeConfig.js} +17 -17
- package/common/utils/sortByDelay.d.ts +1 -1
- package/common/utils/sortByDelay.d.ts.map +1 -1
- package/common/utils/timeUtils.d.ts +23 -4
- package/common/utils/timeUtils.d.ts.map +1 -1
- package/common/utils/timeUtils.js +1 -1
- package/mbt.js +166 -166
- package/mbt.js.map +3 -3
- package/mbt.min.js +62 -62
- package/mbt.min.js.map +3 -3
- package/ol/controls/RoutingControl.d.ts +95 -91
- package/ol/controls/RoutingControl.d.ts.map +1 -1
- package/ol/controls/RoutingControl.js +100 -90
- package/ol/layers/Layer.d.ts +3 -2
- package/ol/layers/Layer.d.ts.map +1 -1
- package/ol/layers/Layer.js +2 -0
- package/ol/layers/MapGlLayer.d.ts.map +1 -1
- package/ol/layers/MapGlLayer.js +3 -5
- package/ol/layers/MapboxLayer.d.ts +1 -1
- package/ol/layers/MapboxLayer.d.ts.map +1 -1
- package/ol/layers/MapboxLayer.js +1 -0
- package/ol/layers/MapboxStyleLayer.js +4 -2
- package/ol/layers/MaplibreLayer.d.ts +2 -1
- package/ol/layers/MaplibreLayer.d.ts.map +1 -1
- package/ol/layers/RoutingLayer.d.ts +15 -5
- package/ol/layers/RoutingLayer.d.ts.map +1 -1
- package/ol/layers/RoutingLayer.js +3 -2
- package/ol/styles/fullTrajectoryStyle.d.ts +2 -2
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -1
- package/package.json +1 -1
- package/types/common.d.ts +6 -1
- package/common/utils/createTrackerFilters.d.ts.map +0 -1
- package/common/utils/trackerConfig.d.ts +0 -24
- package/common/utils/trackerConfig.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -13,17 +13,40 @@ Visit https://mobility-toolbox-js.vercel.app/
|
|
|
13
13
|
|
|
14
14
|
## Demos
|
|
15
15
|
|
|
16
|
-
* Display [real-time vehicle positions and prognosis data](
|
|
16
|
+
* Display [real-time vehicle positions and prognosis data](https://mobility.portal.geops.io) on a map.
|
|
17
17
|
* Search for [stops and stations](https://maps.trafimage.ch) all over the world.
|
|
18
18
|
* Get [precise geographic courses](https://routing-demo.geops.io/) for all modes of transport.
|
|
19
19
|
* Generate beautiful [schematic](https://mobility.portal.geops.io/world.geops.networkplans) or [topographic](https://mobility.portal.geops.io) maps for public transport, mobility and logistics.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Install
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Install the library and the peer dependencies:
|
|
24
|
+
|
|
25
|
+
### Using mapbox-gl
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add mobility-toolbox-js ol@6.14.1 mapbox-gl@1 maplibre-gl@npm:empty-npm-package@1.0.0
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Using maplibre-gl
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn add mobility-toolbox-js ol@6.14.1 maplibre-gl@2 mapbox-gl@npm:empty-npm-package@1.0.0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Development
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
yarn install
|
|
41
|
+
yarn dev
|
|
42
|
+
```
|
|
24
43
|
|
|
25
44
|
## Deploy
|
|
26
45
|
|
|
27
46
|
This library website is deployed automatically using [Vercel](https://vercel.com/geops).
|
|
28
47
|
For Vercel we have to add the nextjs and raw-loader modules in the dev dependencies of the main package.json.
|
|
29
48
|
But those 2 librairies are not need to build the library.
|
|
49
|
+
|
|
50
|
+
## Version 1.x.x
|
|
51
|
+
|
|
52
|
+
The master branch is now open for the version 2 development. The version 1 is still available in [1.x.x](https://github.com/geops/mobility-toolbox-js/tree/1.x.x) branch.
|
package/api/RealtimeAPI.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export declare type RealtimeAPIExtraGeomsById = {
|
|
|
15
15
|
export declare type RealtimeAPIDeparturesById = {
|
|
16
16
|
[index: string]: RealtimeDeparture;
|
|
17
17
|
};
|
|
18
|
+
export declare type RealtimeModesType = {
|
|
19
|
+
RAW: RealtimeMode;
|
|
20
|
+
TOPOGRAPHIC: RealtimeMode;
|
|
21
|
+
SCHEMATIC: RealtimeMode;
|
|
22
|
+
};
|
|
18
23
|
/**
|
|
19
24
|
* Enum for Realtime modes.
|
|
20
25
|
* @readonly
|
|
@@ -25,9 +30,9 @@ export declare type RealtimeAPIDeparturesById = {
|
|
|
25
30
|
* @enum {RealtimeMode}
|
|
26
31
|
*/
|
|
27
32
|
export declare const RealtimeModes: {
|
|
28
|
-
RAW:
|
|
29
|
-
TOPOGRAPHIC:
|
|
30
|
-
SCHEMATIC:
|
|
33
|
+
RAW: RealtimeMode;
|
|
34
|
+
TOPOGRAPHIC: RealtimeMode;
|
|
35
|
+
SCHEMATIC: RealtimeMode;
|
|
31
36
|
};
|
|
32
37
|
/**
|
|
33
38
|
* This class provides convenience methods to access to the [geOps realtime api](https://developer.geops.io/apis/realtime/).
|
package/api/RealtimeAPI.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealtimeAPI.d.ts","sourceRoot":"","sources":["../../src/api/RealtimeAPI.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EACnB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB,oBAAY,kBAAkB,GAAG;IAC/B,GAAG,CAAC,EAAE,MAAM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G,EAAE,eAAe,EAAE,EACtB,IAAI,EAAE,YAAY,EAClB,mBAAmB,EAAE,2BAA2B;IAQlD;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY;IAgB/D;;;;;OAKG;IACH,yBAAyB,CACvB,EAAE,EAAE,eAAe,EACnB,EAAE,CAAC,EAAE,wBAAwB;IAK/B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,EAAE,eAAe;IA0BnC;;;;;OAKG;IACH,gBAAgB,CAAC,GAAG,EAAE,eAAe,EAAE;IAKvC;;;;;OAKG;IACH,qBAAqB,CACnB,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI;IAyB5D;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,wBAAwB;IAI1E;;;OAGG;IACH,oBAAoB,CAAC,SAAS,EAAE,wBAAwB;IAKxD;;OAEG;IACH,sBAAsB;CAGvB;AACD,eAAe,WAAW,CAAC"}
|
package/api/RealtimeAPI.js
CHANGED
|
@@ -67,8 +67,11 @@ class RealtimeAPI {
|
|
|
67
67
|
const { apiKey } = opt;
|
|
68
68
|
let { url, projection, bbox, buffer = [100, 100] } = opt;
|
|
69
69
|
const wsApi = new WebSocketAPI();
|
|
70
|
+
if (!url) {
|
|
71
|
+
url = 'wss://api.geops.io/tracker-ws/v1/';
|
|
72
|
+
}
|
|
70
73
|
if (apiKey) {
|
|
71
|
-
url = `${url
|
|
74
|
+
url = `${url}?key=${apiKey}`;
|
|
72
75
|
}
|
|
73
76
|
Object.defineProperties(this, {
|
|
74
77
|
url: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlCommon.d.ts","sourceRoot":"","sources":["../../../src/common/controls/ControlCommon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlCommon.d.ts","sourceRoot":"","sources":["../../../src/common/controls/ControlCommon.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAC;AAExD,oBAAY,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,cAAM,aAAc,SAAQ,UAAU;IACpC,MAAM,EAAE,OAAO,CAAC;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;;OAQG;gBACS,OAAO,GAAE,oBAAyB;IAe9C;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,oBAAoB;IAuE9C;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM;IAIvB;;OAEG;IACH,aAAa;IAIb;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IAEH,UAAU;IAOV;;;;;OAKG;IAEH,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG;IAKpB;;;;;OAKG;IAEH,oBAAoB;CAMrB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerCommon.d.ts","sourceRoot":"","sources":["../../../src/common/layers/LayerCommon.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,WAAW,CAAC;AAInC,OAAO,KAAK,EACV,MAAM,EACN,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAErB,oBAAY,kBAAkB,GAAG;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,C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
|
|
37
37
|
constructor(options = {}) {
|
|
38
38
|
super();
|
|
39
|
+
this.properties = {};
|
|
40
|
+
this.options = {};
|
|
39
41
|
this.defineProperties(options);
|
|
40
42
|
if (options.properties) {
|
|
41
43
|
this.setProperties(options.properties);
|
|
42
44
|
}
|
|
45
|
+
this.options = options;
|
|
43
46
|
this.visible = options.visible === undefined ? true : !!options.visible;
|
|
44
47
|
this.group = options.group;
|
|
45
48
|
this.copyrights = options.copyrights;
|
|
@@ -6,7 +6,7 @@ import { RealtimeAPI } from '../../api';
|
|
|
6
6
|
import { AnyCanvas, AnyLayerClass, AnyMap, AnyRealtimeLayer, LayerGetFeatureInfoOptions, RealtimeGeneralizationLevel, RealtimeMode, RealtimeRenderState, RealtimeStyleFunction, RealtimeStyleOptions, RealtimeTenant, RealtimeTrainId, ViewState } from '../../types';
|
|
7
7
|
import { RealtimeTrajectory } from '../../api/typedefs';
|
|
8
8
|
import { WebSocketAPIMessageEventData } from '../api/WebSocketAPI';
|
|
9
|
-
import { OlLayerOptions } from '../../ol/layers/Layer';
|
|
9
|
+
import type { OlLayerOptions } from '../../ol/layers/Layer';
|
|
10
10
|
export declare type RealtimeLayerMixinOptions = OlLayerOptions & {
|
|
11
11
|
debug?: boolean;
|
|
12
12
|
mode?: RealtimeMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealtimeLayerMixin.d.ts","sourceRoot":"","sources":["../../../src/common/mixins/RealtimeLayerMixin.ts"],"names":[],"mappings":"AAOA,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAIxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAiB,MAAM,WAAW,CAAC;AAGvD,OAAO,EACL,SAAS,EACT,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,0BA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iBtC;;;;;;;;;;;WAWG;4DAGO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,QAClC,MAAM;QAad;;;;WAIG;;yCAa8B,kBAAkB,GAAG,eAAe;QAYrE;;;;;WAKG;;;QAgBH;;;;;WAKG;kCACuB,4BAA4B;QA+CtD;;;;;;WAMG;wCAC6B,4BAA4B;QAO5D;;;;;;WAMG;iCAES,OAAO,EAAE,SACZ,gBAAgB;QAgBzB;;;;;;WAMG;iCAES,OAAO,EAAE,SACZ,gBAAgB;;MAkB5B;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -12,7 +12,7 @@ import { fromLonLat } from 'ol/proj';
|
|
|
12
12
|
import realtimeDefaultStyle from '../styles/realtimeDefaultStyle';
|
|
13
13
|
import { RealtimeAPI, RealtimeModes } from '../../api';
|
|
14
14
|
import renderTrajectories from '../utils/renderTrajectories';
|
|
15
|
-
import * as
|
|
15
|
+
import * as realtimeConfig from '../utils/realtimeConfig';
|
|
16
16
|
/**
|
|
17
17
|
* RealtimeLayerInterface.
|
|
18
18
|
*/
|
|
@@ -128,7 +128,7 @@ function RealtimeLayerMixin(Base) {
|
|
|
128
128
|
* Custom options to pass as last parameter of the style function.
|
|
129
129
|
*/
|
|
130
130
|
styleOptions: {
|
|
131
|
-
value: Object.assign(Object.assign({},
|
|
131
|
+
value: Object.assign(Object.assign({}, realtimeConfig), (styleOptions || {})),
|
|
132
132
|
},
|
|
133
133
|
/**
|
|
134
134
|
* Speed of the wheel of time.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInteractionsLayerMixin.d.ts","sourceRoot":"","sources":["../../../src/common/mixins/UserInteractionsLayerMixin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserInteractionsLayerMixin.d.ts","sourceRoot":"","sources":["../../../src/common/mixins/UserInteractionsLayerMixin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,oBAAY,iCAAiC,GAAG;IAC9C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,OAAO,CAAC,EAAE,uBAAuB,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,qBAAa,8BAA8B;gBAU7B,OAAO,KAAK;IAExB;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM;IAEvB;;OAEG;IACH,aAAa;IAEb;;OAEG;IACH,wBAAwB;IAExB;;OAEG;IACH,0BAA0B;IAE1B;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,uBAAuB;IAEzC;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,uBAAuB;IAEzC;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,uBAAuB;IAEzC;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,uBAAuB;CAC1C;AAED;;;;;;GAMG;AACH,iBAAS,0BAA0B,CAAC,CAAC,SAAS,gBAAgB,EAC5D,IAAI,EAAE,CAAC,GACN,CAAC,GAAG,OAAO,WAAW,CAkQxB;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
/* eslint-disable max-classes-per-file */
|
|
6
6
|
import { fromLonLat } from 'ol/proj';
|
|
7
7
|
import { unByKey } from 'ol/Observable';
|
|
8
|
+
import BaseEvent from 'ol/events/Event';
|
|
8
9
|
/**
|
|
9
10
|
* UserInteractionsLayerInterface.
|
|
10
11
|
*/
|
|
@@ -204,11 +205,9 @@ function UserInteractionsLayerMixin(Base) {
|
|
|
204
205
|
};
|
|
205
206
|
return this.getFeatureInfoAtCoordinate(coordinate)
|
|
206
207
|
.then((featureInfo) => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
target: featureInfo,
|
|
211
|
-
});
|
|
208
|
+
const event = new BaseEvent('user:click');
|
|
209
|
+
event.target = featureInfo;
|
|
210
|
+
this.dispatchEvent(event);
|
|
212
211
|
return featureInfo;
|
|
213
212
|
})
|
|
214
213
|
.catch(() => emptyFeatureInfo);
|
|
@@ -228,11 +227,9 @@ function UserInteractionsLayerMixin(Base) {
|
|
|
228
227
|
};
|
|
229
228
|
return this.getFeatureInfoAtCoordinate(coordinate)
|
|
230
229
|
.then((featureInfo) => {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
target: featureInfo,
|
|
235
|
-
});
|
|
230
|
+
const event = new BaseEvent('user:hover');
|
|
231
|
+
event.target = featureInfo;
|
|
232
|
+
this.dispatchEvent(event);
|
|
236
233
|
return featureInfo;
|
|
237
234
|
})
|
|
238
235
|
.catch(() => emptyFeatureInfo);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RealtimeStyleFunction } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Draw circle delay background
|
|
4
4
|
*
|
|
@@ -31,6 +31,6 @@ export declare const getTextCanvas: (text: string, origin: number, textSize: num
|
|
|
31
31
|
* @param {RealtimeStyleOptions} options Some options to change the rendering
|
|
32
32
|
* @return a canvas
|
|
33
33
|
*/
|
|
34
|
-
declare const realtimeDefaultStyle:
|
|
34
|
+
declare const realtimeDefaultStyle: RealtimeStyleFunction;
|
|
35
35
|
export default realtimeDefaultStyle;
|
|
36
36
|
//# sourceMappingURL=realtimeDefaultStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtimeDefaultStyle.d.ts","sourceRoot":"","sources":["../../../src/common/styles/realtimeDefaultStyle.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"realtimeDefaultStyle.d.ts","sourceRoot":"","sources":["../../../src/common/styles/realtimeDefaultStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAMrB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WACnB,MAAM,UACN,MAAM,SACP,MAAM,2CAmBd,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,UACtB,MAAM,QACP,MAAM,YACF,MAAM,QACV,MAAM,cACA,MAAM,sBACC,MAAM,eACb,MAAM,2CAuBnB,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,eAAe,WAClB,MAAM,UACN,MAAM,SACP,MAAM,aACF,OAAO,WACT,OAAO,cACJ,MAAM,2CAiCnB,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAClB,MAAM,UACJ,MAAM,YACJ,MAAM,aACL,MAAM,eACJ,MAAM,aACR,OAAO,cACN,MAAM,2CAmCnB,CAAC;AAKF;;;;;;;GAOG;AACH,QAAA,MAAM,oBAAoB,EAAE,qBA8M3B,CAAC;AACF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RealtimeStyleFunction } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* A tracker style that display the delay as backgroundColor.
|
|
4
4
|
*
|
|
@@ -7,6 +7,6 @@ import { RealtimeTrajectory, ViewState, RealtimeStyleOptions } from '../../types
|
|
|
7
7
|
* @param {*} options Some options to change the rendering
|
|
8
8
|
* @return a canvas
|
|
9
9
|
*/
|
|
10
|
-
declare const realtimeDelayStyle:
|
|
10
|
+
declare const realtimeDelayStyle: RealtimeStyleFunction;
|
|
11
11
|
export default realtimeDelayStyle;
|
|
12
12
|
//# sourceMappingURL=realtimeDelayStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtimeDelayStyle.d.ts","sourceRoot":"","sources":["../../../src/common/styles/realtimeDelayStyle.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"realtimeDelayStyle.d.ts","sourceRoot":"","sources":["../../../src/common/styles/realtimeDelayStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB;;;;;;;GAOG;AACH,QAAA,MAAM,kBAAkB,EAAE,qBASzB,CAAC;AACF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtimeSimpleStyle.d.ts","sourceRoot":"","sources":["../../../src/common/styles/realtimeSimpleStyle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"realtimeSimpleStyle.d.ts","sourceRoot":"","sources":["../../../src/common/styles/realtimeSimpleStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAOzD,QAAA,MAAM,mBAAmB,EAAE,qBAiB1B,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
package/common/typedefs.js
CHANGED
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
*/
|
|
40
40
|
/**
|
|
41
41
|
* @typedef {Object} LayerCommonOptions
|
|
42
|
-
* @property {string} key Identifier of the layer. Must be unique.
|
|
42
|
+
* @property {string!} key Identifier of the layer. Must be unique.
|
|
43
43
|
* @property {string!} name Name of the layer.
|
|
44
44
|
* @property {string!} group Group of the layer.
|
|
45
|
-
* @property {string[]} copyrights List of copyrights.
|
|
46
|
-
* @property {Layer[]} children List of children layers.
|
|
45
|
+
* @property {string[]!} copyrights List of copyrights.
|
|
46
|
+
* @property {Layer[]!} children List of children layers.
|
|
47
47
|
* @property {boolean!} visible Define if the layer is currently display on the map.
|
|
48
48
|
* @property {boolean!} disabled Define if the layer is currently display on the map but can't be seen (extent, zoom ,data restrictions).
|
|
49
49
|
* @property {number!} hittolerance Hit-detection tolerance in css pixels. Pixels inside the radius around the given position will be checked for features.
|
|
@@ -8,6 +8,6 @@ import { RealtimeTrajectory } from '../../types';
|
|
|
8
8
|
* @param {Regexp} regexLine - A regex aplly of vehcile's name.
|
|
9
9
|
* @private
|
|
10
10
|
*/
|
|
11
|
-
declare const
|
|
12
|
-
export default
|
|
13
|
-
//# sourceMappingURL=
|
|
11
|
+
declare const createRealtimeFilters: (line: string | string[], route: string | string[], operator: string | string[], regexLine: string | string[]) => ((trajectory: RealtimeTrajectory) => boolean) | null;
|
|
12
|
+
export default createRealtimeFilters;
|
|
13
|
+
//# sourceMappingURL=createRealtimeFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createRealtimeFilters.d.ts","sourceRoot":"","sources":["../../../src/common/utils/createRealtimeFilters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD;;;;;;;;GAQG;AACH,QAAA,MAAM,qBAAqB,SACnB,MAAM,GAAG,MAAM,EAAE,SAChB,MAAM,GAAG,MAAM,EAAE,YACd,MAAM,GAAG,MAAM,EAAE,aAChB,MAAM,GAAG,MAAM,EAAE,mBACb,kBAAkB,KAAK,OAAO,QA8E9C,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param {Regexp} regexLine - A regex aplly of vehcile's name.
|
|
8
8
|
* @private
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
10
|
+
const createRealtimeFilters = (line, route, operator, regexLine) => {
|
|
11
11
|
const filterList = [];
|
|
12
12
|
if (!line && !route && !operator && !regexLine) {
|
|
13
13
|
return null;
|
|
@@ -71,4 +71,4 @@ const createFilters = (line, route, operator, regexLine) => {
|
|
|
71
71
|
return true;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
export default
|
|
74
|
+
export default createRealtimeFilters;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MapboxLayer } from '../../ol';
|
|
1
|
+
import { RenderFunction } from 'ol/layer/Layer';
|
|
2
|
+
import type { MapboxLayer } from '../../ol';
|
|
3
3
|
/**
|
|
4
4
|
* Return the render function fo the olLayer of a MaplibreLayer
|
|
5
5
|
*/
|
|
6
|
-
export default function getMapboxRender(mapoxLayer: MapboxLayer):
|
|
6
|
+
export default function getMapboxRender(mapoxLayer: MapboxLayer): RenderFunction;
|
|
7
7
|
//# sourceMappingURL=getMapboxRender.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMapboxRender.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getMapboxRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"getMapboxRender.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getMapboxRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,UAAU,EAAE,WAAW,GACtB,cAAc,CAwFhB"}
|
|
@@ -3,10 +3,11 @@ import { toLonLat } from 'ol/proj';
|
|
|
3
3
|
* Return the render function fo the olLayer of a MaplibreLayer
|
|
4
4
|
*/
|
|
5
5
|
export default function getMapboxRender(mapoxLayer) {
|
|
6
|
+
const emptyDiv = document.createElement('div');
|
|
6
7
|
return (frameState) => {
|
|
7
8
|
const { map, mbMap, renderState, olLayer } = mapoxLayer;
|
|
8
9
|
if (!map || !mbMap) {
|
|
9
|
-
return
|
|
10
|
+
return emptyDiv;
|
|
10
11
|
}
|
|
11
12
|
let changed = false;
|
|
12
13
|
const canvas = mbMap.getCanvas();
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { RenderFunction } from 'ol/layer/Layer';
|
|
2
|
+
import type { MaplibreLayer } from '../../ol';
|
|
1
3
|
/**
|
|
2
4
|
* Return the render function fo the olLayer of a MaplibreLayer
|
|
3
5
|
*/
|
|
4
|
-
export default function getMaplibreRender(maplibreLayer:
|
|
6
|
+
export default function getMaplibreRender(maplibreLayer: MaplibreLayer): RenderFunction;
|
|
5
7
|
//# sourceMappingURL=getMaplibreRender.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMaplibreRender.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getMaplibreRender.
|
|
1
|
+
{"version":3,"file":"getMaplibreRender.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getMaplibreRender.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AAEH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,aAAa,EAAE,aAAa,GAC3B,cAAc,CAoChB"}
|
|
@@ -4,21 +4,21 @@ import { toDegrees } from 'ol/math';
|
|
|
4
4
|
* Return the render function fo the olLayer of a MaplibreLayer
|
|
5
5
|
*/
|
|
6
6
|
export default function getMaplibreRender(maplibreLayer) {
|
|
7
|
+
const emptyDiv = document.createElement('div');
|
|
7
8
|
return (frameState) => {
|
|
8
9
|
const { map, mbMap, olLayer } = maplibreLayer;
|
|
9
10
|
if (!map || !mbMap) {
|
|
10
|
-
return
|
|
11
|
+
return emptyDiv;
|
|
11
12
|
}
|
|
12
13
|
const canvas = mbMap.getCanvas();
|
|
13
14
|
const { viewState } = frameState;
|
|
14
|
-
const opacity = olLayer.getOpacity();
|
|
15
|
-
canvas.style.opacity = opacity
|
|
15
|
+
const opacity = (olLayer === null || olLayer === void 0 ? void 0 : olLayer.getOpacity()) || 1;
|
|
16
|
+
canvas.style.opacity = `${opacity}`;
|
|
16
17
|
// adjust view parameters in mapbox
|
|
17
18
|
mbMap.jumpTo({
|
|
18
19
|
center: toLonLat(viewState.center),
|
|
19
20
|
zoom: viewState.zoom - 1,
|
|
20
21
|
bearing: toDegrees(-viewState.rotation),
|
|
21
|
-
animate: false,
|
|
22
22
|
});
|
|
23
23
|
if (!canvas.isConnected) {
|
|
24
24
|
// The canvas is not connected to the DOM, request a map rendering at the next animation frame
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import type { RealtimeMode } from '../../types';
|
|
2
|
+
import type { RealtimeModesType } from '../../api/RealtimeAPI';
|
|
2
3
|
/**
|
|
3
4
|
* Get the websocket channel suffix, depending on the current mode.
|
|
4
5
|
* @param {String} mode Mode 'topographic' ou 'schematic'.
|
|
5
6
|
* @private
|
|
6
7
|
*/
|
|
7
|
-
declare
|
|
8
|
+
declare const getModeSuffix: (mode: RealtimeMode, modes: RealtimeModesType) => string;
|
|
9
|
+
export default getModeSuffix;
|
|
8
10
|
//# sourceMappingURL=getRealtimeModeSuffix.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRealtimeModeSuffix.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getRealtimeModeSuffix.
|
|
1
|
+
{"version":3,"file":"getRealtimeModeSuffix.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getRealtimeModeSuffix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;;GAIG;AACH,QAAA,MAAM,aAAa,SAAU,YAAY,SAAS,iBAAiB,KAAG,MACxB,CAAC;AAE/C,eAAe,aAAa,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export default getUrlWithParams;
|
|
2
1
|
/**
|
|
3
2
|
* Return the styleUrl with apiKey parameters set.
|
|
4
3
|
* @param {string} url a url.
|
|
5
4
|
* @param {Object<String,String>} params a list of key/value pair to add to the url.
|
|
6
5
|
* @ignore
|
|
7
6
|
*/
|
|
8
|
-
declare
|
|
7
|
+
declare const getUrlWithParams: (url: string, params: Object) => URL;
|
|
8
|
+
export default getUrlWithParams;
|
|
9
9
|
//# sourceMappingURL=getUrlWithParams.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUrlWithParams.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getUrlWithParams.
|
|
1
|
+
{"version":3,"file":"getUrlWithParams.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getUrlWithParams.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,QAAS,MAAM,UAAU,MAAM,KAAG,GAYvD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { Coordinate } from 'ol/coordinate';
|
|
2
|
+
export declare type VehiclePosition = {
|
|
3
|
+
coord: Coordinate;
|
|
4
|
+
rotation: number;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* Interpolate or not the vehicle position from a trajectory at a specific date.
|
|
4
8
|
*
|
|
@@ -7,8 +11,6 @@ export default getVehiclePosition;
|
|
|
7
11
|
* @param {boolean} noInterpolate If true, the vehicle position is not interpolated on each render but only once.
|
|
8
12
|
* @returns
|
|
9
13
|
*/
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
rotation: any;
|
|
13
|
-
};
|
|
14
|
+
declare const getVehiclePosition: (now: number, trajectory: GeoJSONFeature, noInterpolate: boolean) => VehiclePosition;
|
|
15
|
+
export default getVehiclePosition;
|
|
14
16
|
//# sourceMappingURL=getVehiclePosition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVehiclePosition.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getVehiclePosition.
|
|
1
|
+
{"version":3,"file":"getVehiclePosition.d.ts","sourceRoot":"","sources":["../../../src/common/utils/getVehiclePosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,QAAA,MAAM,kBAAkB,QACjB,MAAM,6CAEI,OAAO,KACrB,eA2DF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
package/common/utils/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { default as getUrlWithParams } from "./getUrlWithParams";
|
|
2
2
|
export { default as getMapboxMapCopyrights } from "./getMapboxMapCopyrights";
|
|
3
3
|
export { default as removeDuplicate } from "./removeDuplicate";
|
|
4
|
-
export { default as
|
|
4
|
+
export { default as createRealtimeFilters } from "./createRealtimeFilters";
|
|
5
5
|
export { default as getLayersAsFlatArray } from "./getLayersAsFlatArray";
|
|
6
6
|
export * from "./timeUtils";
|
|
7
7
|
export { default as sortByDelay } from "./sortByDelay";
|
|
8
8
|
export { default as renderTrajectories } from "./renderTrajectories";
|
|
9
9
|
export { default as getMaplibreRender } from "./getMaplibreRender";
|
|
10
10
|
export { default as getMapboxRender } from "./getMapboxRender";
|
|
11
|
-
export * as
|
|
11
|
+
export * as realtimeConfig from "./realtimeConfig";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/common/utils/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { default as getUrlWithParams } from './getUrlWithParams';
|
|
2
2
|
export { default as getMapboxMapCopyrights } from './getMapboxMapCopyrights';
|
|
3
3
|
export { default as removeDuplicate } from './removeDuplicate';
|
|
4
|
-
export { default as
|
|
4
|
+
export { default as createRealtimeFilters } from './createRealtimeFilters';
|
|
5
5
|
export { default as getLayersAsFlatArray } from './getLayersAsFlatArray';
|
|
6
6
|
export * from './timeUtils';
|
|
7
7
|
export { default as sortByDelay } from './sortByDelay';
|
|
8
8
|
export { default as renderTrajectories } from './renderTrajectories';
|
|
9
9
|
export { default as getMaplibreRender } from './getMaplibreRender';
|
|
10
10
|
export { default as getMapboxRender } from './getMapboxRender';
|
|
11
|
-
import * as
|
|
12
|
-
export {
|
|
11
|
+
import * as realtimeConfig_1 from './realtimeConfig';
|
|
12
|
+
export { realtimeConfig_1 as realtimeConfig };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AnyCanvasContext, RealtimeMot } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Trajserv value: 'Tram', 'Subway / Metro / S-Bahn', 'Train', 'Bus', 'Ferry', 'Cable Car', 'Gondola', 'Funicular', 'Long distance bus', 'Rail',
|
|
4
|
+
* New endpoint use Rail instead of Train.
|
|
5
|
+
* New tracker values: null, "tram", "subway", "rail", "bus", "ferry", "cablecar", "gondola", "funicular", "coach".
|
|
6
|
+
*
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
export declare const types: RegExp[];
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
export declare const bgColors: string[];
|
|
14
|
+
/**
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
export declare const textColors: string[];
|
|
18
|
+
/**
|
|
19
|
+
* @ignore
|
|
20
|
+
*/
|
|
21
|
+
export declare const getTypeIndex: (type: RealtimeMot) => number;
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
export declare const getRadius: (type: RealtimeMot, zoom: number) => number;
|
|
26
|
+
/**
|
|
27
|
+
* @ignore
|
|
28
|
+
*/
|
|
29
|
+
export declare const getBgColor: (type: RealtimeMot) => string;
|
|
30
|
+
/**
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
export declare const getTextColor: (type: RealtimeMot) => string;
|
|
34
|
+
/**
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
export declare const getTextSize: (ctx: AnyCanvasContext, markerSize: number, text: string, fontSize: number) => number;
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
* @param {number} delayInMs Delay in milliseconds.
|
|
41
|
+
* @param {boolean} cancelled true if the journey is cancelled.
|
|
42
|
+
* @param {boolean} isDelayText true if the color is used for delay text of the symbol.
|
|
43
|
+
*/
|
|
44
|
+
export declare const getDelayColor: (delayInMs: number, cancelled: boolean, isDelayText: boolean) => string;
|
|
45
|
+
/**
|
|
46
|
+
* @ignore
|
|
47
|
+
*/
|
|
48
|
+
export declare const getDelayText: (delayInMs: number, cancelled: boolean) => string;
|
|
49
|
+
//# sourceMappingURL=realtimeConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtimeConfig.d.ts","sourceRoot":"","sources":["../../../src/common/utils/realtimeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAe5D;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,MAAM,EAWzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,EAW5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,EAW9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,SAAU,WAAW,KAAG,MAKhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,SAAU,WAAW,QAAQ,MAAM,KAAG,MAO3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,WAAW,KAAG,MAO9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,SAAU,WAAW,KAAG,MAOhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,QACjB,gBAAgB,cACT,MAAM,QACZ,MAAM,YACF,MAAM,KACf,MAkBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,cACb,MAAM,aACN,OAAO,eACL,OAAO,KACnB,MAoBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,cAAe,MAAM,aAAa,OAAO,KAAG,MAmBpE,CAAC"}
|