@situm/react-native 3.15.0-beta.4 → 3.15.0
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/lib/commonjs/index.js +72 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/sdk/index.js +930 -0
- package/lib/commonjs/sdk/index.js.map +1 -1
- package/lib/commonjs/sdk/internaDelegatedState.js +48 -0
- package/lib/commonjs/sdk/internaDelegatedState.js.map +1 -0
- package/lib/commonjs/sdk/nativeInterface.js +20 -0
- package/lib/commonjs/sdk/nativeInterface.js.map +1 -0
- package/lib/commonjs/sdk/types/constants.js +73 -0
- package/lib/commonjs/sdk/types/index.js +414 -0
- package/lib/commonjs/sdk/types/index.js.map +1 -0
- package/lib/commonjs/sdk/utils.js +156 -0
- package/lib/commonjs/sdk/utils.js.map +1 -0
- package/lib/commonjs/utils/index.js +17 -0
- package/lib/commonjs/utils/logError.js +21 -0
- package/lib/commonjs/utils/logError.js.map +1 -0
- package/lib/commonjs/wayfinding/components/MapView.js +388 -0
- package/lib/commonjs/wayfinding/components/MapView.js.map +1 -0
- package/lib/commonjs/wayfinding/hooks/index.js +233 -0
- package/lib/commonjs/wayfinding/hooks/index.js.map +1 -0
- package/lib/commonjs/wayfinding/index.js +57 -0
- package/lib/commonjs/wayfinding/store/index.js +246 -0
- package/lib/commonjs/wayfinding/store/index.js.map +1 -0
- package/lib/commonjs/wayfinding/store/utils.js +49 -0
- package/lib/commonjs/wayfinding/types/constants.js +13 -0
- package/lib/commonjs/wayfinding/types/index.js +6 -0
- package/lib/commonjs/wayfinding/types/index.js.map +1 -0
- package/lib/commonjs/wayfinding/utils/index.js +12 -0
- package/lib/commonjs/wayfinding/utils/mapper.js +204 -0
- package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -0
- package/lib/module/index.js +14 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/sdk/index.js +904 -0
- package/lib/module/sdk/index.js.map +1 -1
- package/lib/module/sdk/internaDelegatedState.js +43 -0
- package/lib/module/sdk/internaDelegatedState.js.map +1 -0
- package/lib/module/sdk/nativeInterface.js +20 -0
- package/lib/module/sdk/nativeInterface.js.map +1 -0
- package/lib/module/sdk/types/constants.js +70 -0
- package/lib/module/sdk/types/index.js +445 -0
- package/lib/module/sdk/types/index.js.map +1 -0
- package/lib/module/sdk/utils.js +146 -0
- package/lib/module/sdk/utils.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/logError.js +17 -0
- package/lib/module/utils/logError.js.map +1 -0
- package/lib/module/wayfinding/components/MapView.js +381 -0
- package/lib/module/wayfinding/components/MapView.js.map +1 -0
- package/lib/module/wayfinding/hooks/index.js +226 -0
- package/lib/module/wayfinding/hooks/index.js.map +1 -0
- package/lib/module/wayfinding/index.js +15 -0
- package/lib/module/wayfinding/store/index.js +213 -0
- package/lib/module/wayfinding/store/index.js.map +1 -0
- package/lib/module/wayfinding/store/utils.js +40 -0
- package/lib/module/wayfinding/types/constants.js +9 -0
- package/lib/module/wayfinding/types/index.js +4 -0
- package/lib/module/wayfinding/types/index.js.map +1 -0
- package/lib/module/wayfinding/utils/index.js +7 -0
- package/lib/module/wayfinding/utils/index.js.map +1 -0
- package/lib/module/wayfinding/utils/mapper.js +195 -0
- package/lib/module/wayfinding/utils/mapper.js.map +1 -0
- package/lib/typescript/sdk/index.d.ts +2 -2
- package/lib/typescript/sdk/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/sdk/index.ts +12 -3
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name Building
|
|
7
|
+
* @description A Building object definition
|
|
8
|
+
*
|
|
9
|
+
* @property {string} buildingIdentifier - The unique identifier of the resource
|
|
10
|
+
* @property {string} name - The building name that is appropriate for display to the user.
|
|
11
|
+
* @property {string} address - Te building address.
|
|
12
|
+
* @property {Bounds} bounds - Compute corners of this building, without rotation, in earth coordinates.
|
|
13
|
+
* @property {Bounds} boundsRotated - Compute corners of this building, with rotation, in earth coordinates.
|
|
14
|
+
* @property {Coordinate} center - Center of the building's base, as geographical coordinate.
|
|
15
|
+
* @property {Dimensions} Dimensions - Dimensions of building's base (height and width) in meters.
|
|
16
|
+
* @property {string} infoHtml - Additional information about building, formatted with HTML
|
|
17
|
+
* @property {string} pictureThumbUrl - The URL of building thumbnail image
|
|
18
|
+
* @property {string} pictureUrl - The URL of building image
|
|
19
|
+
* @property {number} rotation - Rotation angle of the building's base, relative to the west-east axis, increasing in counter-clockwise, being 0 the west-east axis.
|
|
20
|
+
* @property {string} userIdentifier - Unique identifier of the owner user of the building
|
|
21
|
+
* @property {object} customFields - Map of custom fields, indexed by their name.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @name BuildingInfo
|
|
26
|
+
* @description Full information of a building
|
|
27
|
+
*
|
|
28
|
+
* @property {Building} building - Building basic information
|
|
29
|
+
* @property {Floor[]} floors - Array with the information of each floor
|
|
30
|
+
* @property {Poi[]} indoorPOIs - Array with the information of each indoor POI
|
|
31
|
+
* @property {Poi[]} outdoorPOIs - Array with the information of each outdoor POI
|
|
32
|
+
* @property {Geofence} geofences - Array with the information of each geofence
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/** @name Bounds
|
|
36
|
+
* @description Represents a rectangle bounds in a greographic 2D space.
|
|
37
|
+
*
|
|
38
|
+
* @property {Coordinate} northEast - The coordinate of the north-east corner of the bound.
|
|
39
|
+
* @property {Coordinate} northWest - The coordinate of the north-west corner of the bound.
|
|
40
|
+
* @property {Coordinate} southEast - The coordinate of the south-east corner of the bound.
|
|
41
|
+
* @property {Coordinate} southWest - The coordinate of the south-east corner of the bound.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/** @name Dimensions
|
|
45
|
+
* @description Define 2D dimensions of a rectangular area.
|
|
46
|
+
*
|
|
47
|
+
* @property {number} width - Width of rectangle in meters
|
|
48
|
+
* @property {number} height - Height of rectangle in meters.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @name Coordinate
|
|
53
|
+
* @description A structure that contains geographical coordinate.
|
|
54
|
+
*
|
|
55
|
+
* @property {number} latitude - Latitude in degrees
|
|
56
|
+
* @property {number} longitude - Longitude in degrees
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @name CartesianCoordinate
|
|
61
|
+
* @description A structure that contains cartesian coordinate.
|
|
62
|
+
*
|
|
63
|
+
* @property {number} x - Value of coordinate at x-axis
|
|
64
|
+
* @property {number} y - Value of coordinate at y-axis
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @name Floor
|
|
69
|
+
* @description Floor of a building.
|
|
70
|
+
*
|
|
71
|
+
* @property {number} altitude - Altitude of the floor above ground level, in meters.
|
|
72
|
+
* @property {string} buildingIdentifier - The identifier of building which this floor belongs.
|
|
73
|
+
* @property {number} level - The number of the floor.
|
|
74
|
+
* @property {string} name - The name of the floor
|
|
75
|
+
* @property {string} mapUrl - The floor map image url
|
|
76
|
+
* @property {number} scale - The scale of the floor image, in px/meters
|
|
77
|
+
* @property {string} floorIdentifier - The unique identifier of the resource
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @name POI
|
|
82
|
+
* @description Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
|
|
83
|
+
*
|
|
84
|
+
* @property {string} identifier - The unique identifier of the resource
|
|
85
|
+
* @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
|
|
86
|
+
* @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate of this position, relative to building {@link Bounds}.
|
|
87
|
+
* @property {Coordinate} coordinate - Geographical coordinate of this position
|
|
88
|
+
* @property {string} floorIdentifier - If this POI is outside the building (isOutdoor == true), this field has no meaning.
|
|
89
|
+
* @property {string} poiName - A name for the POI, appropriate for display to the user.
|
|
90
|
+
* @property {Point} position - {@link Point} where the point is located.
|
|
91
|
+
* @property {boolean} isIndoor - Whether the POI is placed outside the building or not.
|
|
92
|
+
* @property {boolean} isOutdoor - Whether the POI is placed outside the building or not.
|
|
93
|
+
* @property {PoiCategory} category - Category of the POI
|
|
94
|
+
* @property {string} infoHtml - Additional information about POI, in HTML
|
|
95
|
+
* @property {object} customFields - Map of custom fields, indexed by their name.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @name Geofence
|
|
100
|
+
* @description Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
|
|
101
|
+
*
|
|
102
|
+
* @property {string} identifier - The unique identifier of the resource
|
|
103
|
+
* @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
|
|
104
|
+
* @property {string} floorIdentifier - If this POI is outside the building (isOutdoor == true), this field has no meaning.
|
|
105
|
+
* @property {string} name - A name for the geofence, appropriate for display to the user.
|
|
106
|
+
* @property {string} infoHtml - Additional information about POI, in HTML
|
|
107
|
+
* @property {Point[]} polygonPoints - List of points of that define the area of the geofence
|
|
108
|
+
* @property {object} customFields - Map of custom fields, indexed by their name.
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @name PoiCategory
|
|
113
|
+
* @description Category of Point of Interest.
|
|
114
|
+
*
|
|
115
|
+
* @property {string} poiCategoryCode - Unique code of the category
|
|
116
|
+
* @property {string} poiCategoryName - The category name appropriate for display to the user
|
|
117
|
+
* @property {string} icon_selected - The selected icon url
|
|
118
|
+
* @property {string} icon_unselected - The unselected icon url
|
|
119
|
+
* @property {boolean} public - Whether the category is public or not
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @name PoiIcon
|
|
124
|
+
* @description Category of Point of Interest.
|
|
125
|
+
*
|
|
126
|
+
* @property {string} data - Base64 POI icon image
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @name Point
|
|
131
|
+
* @description Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building.
|
|
132
|
+
*
|
|
133
|
+
* @property {string} buildingIdentifier - Unique identifier for the building to which this point belongs
|
|
134
|
+
* @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate (in meters) relative to the Bounds of building's base.
|
|
135
|
+
* @property {Coordinate} coordinate - Geographic coordinate (latitude, longitude) of the point, regardless of whether it's placed inside or outside the building.
|
|
136
|
+
* @property {string} floorIdentifier - Floor identifier (inside the building) where this point is placed.
|
|
137
|
+
* @property {boolean} isIndoor - If the POI is inside the building.
|
|
138
|
+
* @property {boolean} idOutdoor - If the POI is outside the building.
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @name Route
|
|
143
|
+
* @description Route between two points.
|
|
144
|
+
*
|
|
145
|
+
* @property {Poi} poiTo - The destination Poi the user is currently navigating to.
|
|
146
|
+
* @property {RouteStep[]} edges - Ordered list of steps to go to the goal point
|
|
147
|
+
* @property {RouteStep} firstStep - First step
|
|
148
|
+
* @property {Point} from - Point where the route starts.
|
|
149
|
+
* @property {Indication} indications - Ordered list of instructions to go to the destination
|
|
150
|
+
* @property {RouteStep} lastStep - Last step
|
|
151
|
+
* @property {Point[]} nodes - A collection of points of the route (not ordered)
|
|
152
|
+
* @property {Point[]} points - List of ordered points of the route
|
|
153
|
+
* @property {Point} to - Last point and goal of the route.
|
|
154
|
+
* @property {RouteStep[]} steps - Ordered list of steps to go to the goal point
|
|
155
|
+
* @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @name RouteStep
|
|
160
|
+
* @description A fragment of a route, described by the initial point from and the last point to of the fragment, and some information about the step within the route.
|
|
161
|
+
*
|
|
162
|
+
* @property {number} distance - Distance between from and to in meters.
|
|
163
|
+
* @property {number} distanceToGoal - Distance in meters between the start point of this step (from) and the last point in the route ('to' of the last step).
|
|
164
|
+
* @property {Point} from - Start point of this step.
|
|
165
|
+
* @property {number} id - Position of this RouteStep in the list of steps (Route.steps) of the route to which it belongs.
|
|
166
|
+
* @property {Point} to - End point of this step.
|
|
167
|
+
* @property {boolean} isFirst - Returns true if this is the first step in the route.
|
|
168
|
+
* @property {boolean} isLast - Returns true if this is the last step in the route.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @name RouteSegment
|
|
173
|
+
* @description A fragment of a route, described by a floor identifier and a list of consecutive points from the same floor
|
|
174
|
+
*
|
|
175
|
+
* @property {string} floorIdentifier - Identifier of the floor containing the points in this segment
|
|
176
|
+
* @property {Point[]} points - Consecutive points in the same floor forming a path
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @name Indication
|
|
181
|
+
* @description Represents the instruction that a user should follow when on a RouteStep to continue the route.
|
|
182
|
+
*
|
|
183
|
+
* @property {number} distance - The distance between the origin and destination
|
|
184
|
+
* @property {number} distanceToNextLevel - The number of levels between the origin and destination
|
|
185
|
+
* @property {string} indicationType - The Indication.Action of the instruction as String
|
|
186
|
+
* @property {number} orientation - The angle a user should change his direction in order to go from the origin to the destination.
|
|
187
|
+
* @property {string} orientationType - The Indication.Orientation of the instruction as String
|
|
188
|
+
* @property {number} stepIdxDestination - The index of the indication's step of destination.
|
|
189
|
+
* @property {number} stepIdxOrigin - The index of the indication's step of origin
|
|
190
|
+
* @property {boolean} neededLevelChange - If the user should change the level in order to arrive at the destination.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @name NavigationProgress
|
|
195
|
+
* @description Provides information of the progress of a user while following a route.
|
|
196
|
+
*
|
|
197
|
+
* @property {Location} closestLocationInRoute - Closest location in the route from the user location provided .
|
|
198
|
+
* @property {number} distanceToClosestPointInRoute - Distance between the real user location (provided to updateWithLocation(Location)) and the closest route location.
|
|
199
|
+
* @property {Indication} currentIndication - The current indication.
|
|
200
|
+
* @property {Indication} nextIndication - The next indication.
|
|
201
|
+
* @property {number} currentStepIndex - The index of the closest route step to the user, where closestLocationInRoute is.
|
|
202
|
+
* @property {number} distanceToGoal - The distance in meters from closestLocationInRoute to route's goal point.
|
|
203
|
+
* @property {number} distanceToEndStep - The distance in meters to go from closestLocationInRoute to the end of the current step.
|
|
204
|
+
* @property {number} timeToEndStep - The estimated time to go from closestLocationInRoute to the end of the current route step, considering a speed of 1 meter/second.
|
|
205
|
+
* @property {number} timeToGoal - The estimated time to go from closestLocationInRoute to the goal/end of route, considering a speed of 1 meter/second.
|
|
206
|
+
* @property {RouteStep} routeStep - The closest route step to the user, where closestLocationInRoute is.
|
|
207
|
+
* @property {Point[]} points - List of ordered points of the remaining route
|
|
208
|
+
* @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @name LocationRequest
|
|
213
|
+
* @description A data object that contains parameters for the location service, LocationManager.
|
|
214
|
+
*
|
|
215
|
+
* @property {number} buildingIdentifier - Identifier of the building on which the positioning will be started
|
|
216
|
+
* @property {number} interval - Default interval (in milliseconds) to notify location updates
|
|
217
|
+
* @property {string} indoorProvider - Default indoor provider. Possible values are INPHONE and SUPPORT
|
|
218
|
+
* @property {boolean} useBle - Defines whether or not to use BLE for positioning
|
|
219
|
+
* @property {boolean} useWifi - Defines whether or not to use Wi-Fi for positioning
|
|
220
|
+
* @property {boolean} useGps - Defines whether or not to use GPS for indoor positioning
|
|
221
|
+
* @property {boolean} useBarometer - Defines whether or not to use the barometer for indoor positioning
|
|
222
|
+
* @property {string} motionMode - Default motion mode. Possible values are BY_CAR, BY_FOOT, and RADIOMAX
|
|
223
|
+
* @property {boolean} useForegroundService - Defines whether or not to activate the {@link http://developers.situm.es/pages/android/using_situm_sdk_background.html foreground service}
|
|
224
|
+
* @property {boolean} useDeadReckoning - Defines whether or not to use dead reckoning to get fast position updates using only the inertial sensors, between the server position updates.
|
|
225
|
+
* @property {OutdoorLocationOptions} outdoorLocationOptions - Outdoor location options. Only used in an indoor/outdoor request
|
|
226
|
+
* @property {BeaconFilter[]} beaconFilters - Deprecated - Beacon filters to be handled during scan time, otherwise only Situm beacons will be scanned. Can be invoked multiple times to add as much beacon filters as you want. The SitumSDK now does it automatically
|
|
227
|
+
* @property {number} smallestDisplacement - Default smallest displacement to notify location updates
|
|
228
|
+
* @property {string} realtimeUpdateInterval - Default interval to send locations to the Realtime. Possible values are REALTIME, FAST, NORMAL, SLOW, and BATTERY_SAVER
|
|
229
|
+
* @property {ForegroundServiceNotificationOptions} foregroundServiceNotificationOptions - Used to configure the notification options for a foreground service, allowing the definition of the title, message, stop button, button text, and the {@link ForegroundServiceNotificationsTapAction}.
|
|
230
|
+
*/
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* A data object that let you customize the Foreground Service Notification
|
|
234
|
+
* that will be shown in the system's tray when the app is running as a
|
|
235
|
+
* Foreground Service.
|
|
236
|
+
* To be used with {@link LocationRequest}.
|
|
237
|
+
* Only applies for Android.
|
|
238
|
+
* @property {ForegroundServiceNotificationOptions} foregroundServiceNotificationOptions
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @name ForegroundServiceNotificationsTapAction
|
|
243
|
+
* @description Predefined actions performed when tapping the Situm Foreground Service Notification.
|
|
244
|
+
*/
|
|
245
|
+
export let ForegroundServiceNotificationsTapAction = /*#__PURE__*/function (ForegroundServiceNotificationsTapAction) {
|
|
246
|
+
/**
|
|
247
|
+
* Launch the app's main activity using the information returned by android.content.pm.PackageManager#getLaunchIntentForPackage(String).
|
|
248
|
+
*/
|
|
249
|
+
ForegroundServiceNotificationsTapAction["LaunchApp"] = "LAUNCH_APP";
|
|
250
|
+
/**
|
|
251
|
+
* Launch the operating system settings screen for the current app.
|
|
252
|
+
*/
|
|
253
|
+
ForegroundServiceNotificationsTapAction["LaunchSettings"] = "LAUNCH_SETTINGS";
|
|
254
|
+
/**
|
|
255
|
+
* Do nothing when tapping the notification.
|
|
256
|
+
*/
|
|
257
|
+
ForegroundServiceNotificationsTapAction["DoNothing"] = "DO_NOTHING";
|
|
258
|
+
return ForegroundServiceNotificationsTapAction;
|
|
259
|
+
}({});
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @name NavigationRequest
|
|
263
|
+
* @description A data object that contains the request for navigation.
|
|
264
|
+
*
|
|
265
|
+
* @property {number} distanceToGoalThreshold - Distance threshold to consider reaching the goal (meters).
|
|
266
|
+
* @property {number} distanceToIgnoreFirstIndication - Maximum distance to ignore the first indication when navigating (meters).
|
|
267
|
+
* @property {number} distanceToFloorChangeThreshold - Distance threshold from when a floor change is considered reached (meters).
|
|
268
|
+
* @property {number} distanceToChangeIndicationThreshold - Distance threshold to change the indication (meters).
|
|
269
|
+
* @property {boolean} ignoreLowQualityLocations - Ignore low-quality locations.
|
|
270
|
+
* @property {number} indicationsInterval - Interval between indications (milliseconds).
|
|
271
|
+
* @property {number} outsideRouteThreshold - Distance threshold to consider being outside the route (meters).
|
|
272
|
+
* @property {number} roundIndicationsStep - Step to round indications (meters).
|
|
273
|
+
* @property {number} timeToFirstIndication - Time to wait until the first indication is returned (milliseconds).
|
|
274
|
+
* @property {number} timeToIgnoreUnexpectedFloorChanges - Time to ignore the locations received during navigation, when the next indication is a floor change,
|
|
275
|
+
* if the locations are on a wrong floor (not in origin or destination floors) (milliseconds).
|
|
276
|
+
*/
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @name DirectionsRequest
|
|
280
|
+
* @description A data object that contains the request for directions.
|
|
281
|
+
*
|
|
282
|
+
* @property {Building} positioningBuilding
|
|
283
|
+
* @property {Point|Location} from - Current user's position as the starting point of the route.
|
|
284
|
+
* @property {Point|Poi} to - Point to, where the route should end.
|
|
285
|
+
* @property {DirectionsOptions} options - Options that can be added to the request.
|
|
286
|
+
*/
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @name DirectionsOptions
|
|
290
|
+
* @description A data object that contains the directions options.
|
|
291
|
+
*
|
|
292
|
+
* @property {boolean} minimizeFloorChanges - Defines wheter or not the route should be calculated minimizing the floor changes even if the result is longer.
|
|
293
|
+
* @property {string} accessibilityMode - Defines the accessibility mode of the route. Possible values are: CHOOSE_SHORTEST, ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES, ONLY_ACCESSIBLE
|
|
294
|
+
* @property {number} startingAngle - Current user's orientation in degrees.
|
|
295
|
+
* @property {String[]} includedTags List of tags that you want to use when calculating a route. Only the tags added here will be used. If there are other tags in the graph they won't be used. The edges without a tag will be used. If you don't set nothing all the graph will be used to calculate the route. You can learn more about this topic on https://situm.com/docs/cartography-management/#tags
|
|
296
|
+
* @property {String[]} excludedTags List of tags that you want your route to avoid. If you exclude a tag the route will never pass through an edge that have this tag. If the route can only be generated passing through an edge with this tag the route calculation will fail. You can learn more about this topic on https://situm.com/docs/cartography-management/#tags.
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @name OutdoorLocationOptions
|
|
301
|
+
* @description Outdoor location options are only used in indoor-outdoor mode (Only available for Android)
|
|
302
|
+
*
|
|
303
|
+
* @property {boolean} continuousMode - Environment detection continuous mode (true) or burst mode (false).
|
|
304
|
+
* @property {boolean} userDefinedThreshold
|
|
305
|
+
* @property {number} burstInterval - Interval to scan for GPS and detect the environment (in seconds).
|
|
306
|
+
* @property {number} averageSnrThreshold
|
|
307
|
+
*/
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @name BeaconFilter
|
|
311
|
+
* @description Represents a BLE filter. Now the only field is the BLE proximity UUID
|
|
312
|
+
*
|
|
313
|
+
* @property {string} uuid - Assigns the proximity UUID
|
|
314
|
+
*/
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* @name RealTimeRequest
|
|
318
|
+
* @description A data object that contains the parameters to process realtime data of the users.
|
|
319
|
+
*
|
|
320
|
+
* @property {Building} building object
|
|
321
|
+
* @property {int} pollTime - Interval in milliseconds (minimum is 3000ms).
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @name RealTimeData
|
|
326
|
+
* @description A data object that contains information of the location of users in realtime.
|
|
327
|
+
*
|
|
328
|
+
* @property {Array<Location>} locations object
|
|
329
|
+
*/
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @name SdkVersion
|
|
333
|
+
* @description Represents the version information of the SDK and its compatibility with different platforms.
|
|
334
|
+
*
|
|
335
|
+
* @type
|
|
336
|
+
* @property {string} react_native - The version of React Native used in the SDK.
|
|
337
|
+
* @property {string} [ios] - Optional. The specific version of the Situm SDK for the iOS platform.
|
|
338
|
+
* @property {string} [android] - Optional. The specific version of the Situm SDK for the Android platform.
|
|
339
|
+
*/
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* @name ConfigurationOptions
|
|
343
|
+
* @description Configuration options for initializing the SDK or other modules.
|
|
344
|
+
*
|
|
345
|
+
* @type
|
|
346
|
+
* @property {boolean} [useRemoteConfig] - Optional. Determines whether to use Remote Configuration settings.
|
|
347
|
+
* @property {number} [cacheMaxAge] - Optional. The maximum age of the cache in seconds.
|
|
348
|
+
*/
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @name Location
|
|
352
|
+
* @description Represents a location with various attributes including position, accuracy, and bearing.
|
|
353
|
+
*
|
|
354
|
+
* @interface
|
|
355
|
+
* @property {Position} [position] - Optional. The position information of the location.
|
|
356
|
+
* @property {number} [accuracy] - Optional. The accuracy of the location information in meters.
|
|
357
|
+
* @property {Object} [bearing] - Optional. Bearing information including degrees and degreesClockwise.
|
|
358
|
+
* @property {boolean} [hasBearing] - Optional. Indicates if bearing information is available.
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* @name LocationStatus
|
|
363
|
+
* @description Represents the status of a location, including a name and a numeric code.
|
|
364
|
+
*
|
|
365
|
+
* @interface
|
|
366
|
+
* @property {LocationStatusName} statusName - The name of the location status.
|
|
367
|
+
* @property {number} statusCode - The numeric code representing the location status.
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* @name ErrorType
|
|
372
|
+
* @description Enumeration of error types to categorize the severity of errors.
|
|
373
|
+
*
|
|
374
|
+
* @enum {string}
|
|
375
|
+
* @property {string} CRITICAL - Represents critical errors that will cause the system not to work (e.g. positioning will be stopped).
|
|
376
|
+
* @property {string} NON_CRITICAL - Represents non-critical errors that are less severe.
|
|
377
|
+
*/
|
|
378
|
+
export let ErrorType = /*#__PURE__*/function (ErrorType) {
|
|
379
|
+
ErrorType["CRITICAL"] = "CRITICAL";
|
|
380
|
+
ErrorType["NON_CRITICAL"] = "NON_CRITICAL";
|
|
381
|
+
return ErrorType;
|
|
382
|
+
}({});
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @name ErrorCode
|
|
386
|
+
* @description Enumeration of error codes provided by Situm SDK.
|
|
387
|
+
*
|
|
388
|
+
* @enum {string}
|
|
389
|
+
* @property {string} LOCATION_PERMISSION_DENIED - Indicates that location permissions were not granted by the user.
|
|
390
|
+
* @property {string} BLUETOOTH_PERMISSION_DENIED - Indicates that Bluetooth permissions were not granted.
|
|
391
|
+
* @property {string} BLUETOOTH_DISABLED - Indicates that Bluetooth is disabled on the device.
|
|
392
|
+
* @property {string} LOCATION_DISABLED - Indicates that the location services are disabled on the device.
|
|
393
|
+
* @property {string} REDUCED_ACCURACY - Indicates that the precise location has been turned off on the device.
|
|
394
|
+
* @property {string} UNKNOWN - Represents an unknown error or an error that does not fit other categories.
|
|
395
|
+
*/
|
|
396
|
+
export let ErrorCode = /*#__PURE__*/function (ErrorCode) {
|
|
397
|
+
ErrorCode["LOCATION_PERMISSION_DENIED"] = "LOCATION_PERMISSION_DENIED";
|
|
398
|
+
ErrorCode["BLUETOOTH_PERMISSION_DENIED"] = "BLUETOOTH_PERMISSION_DENIED";
|
|
399
|
+
ErrorCode["BLUETOOTH_DISABLED"] = "BLUETOOTH_DISABLED";
|
|
400
|
+
ErrorCode["LOCATION_DISABLED"] = "LOCATION_DISABLED";
|
|
401
|
+
ErrorCode["REDUCED_ACCURACY"] = "REDUCED_ACCURACY";
|
|
402
|
+
ErrorCode["UNKNOWN"] = "UNKNOWN";
|
|
403
|
+
return ErrorCode;
|
|
404
|
+
}({});
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @name Error
|
|
408
|
+
* @description Represents an error with a specific code, message, and type.
|
|
409
|
+
*
|
|
410
|
+
* @interface
|
|
411
|
+
* @property {ErrorCode} code - The specific error code associated with this error.
|
|
412
|
+
* @property {string} message - A descriptive message providing more details about the error.
|
|
413
|
+
* @property {ErrorType} type - The type of the error indicating its severity (critical or non-critical).
|
|
414
|
+
*/
|
|
415
|
+
|
|
416
|
+
// TODO: add types
|
|
417
|
+
|
|
418
|
+
export class InternalCall {
|
|
419
|
+
constructor(type, data) {
|
|
420
|
+
this.type = type;
|
|
421
|
+
this.data = data;
|
|
422
|
+
}
|
|
423
|
+
get() {
|
|
424
|
+
return this.data;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* @name
|
|
430
|
+
* UserHelperColorScheme
|
|
431
|
+
* @description
|
|
432
|
+
* Color scheme for the user helper UI.
|
|
433
|
+
* @property {string} primaryColor - Primary color for the user helper UI. Use HEX color code (e.g. "#ff5733").
|
|
434
|
+
* @property {string} secondaryColor - Secondary color for the user helper UI. Use HEX color code (e.g. "#ff5733").
|
|
435
|
+
*/
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* @name
|
|
439
|
+
* UserHelperOptions
|
|
440
|
+
* @description
|
|
441
|
+
* Configuration options for the user helper.
|
|
442
|
+
* @property {boolean} enabled - Whether the user helper is enabled. Equivalent to the underlying native SitumSdk.userHelperManager#autoManage(true).
|
|
443
|
+
* @property {UserHelperColorScheme} colorScheme - Color scheme for the user helper UI.
|
|
444
|
+
*/
|
|
445
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ForegroundServiceNotificationsTapAction","ErrorType","ErrorCode","InternalCall","constructor","type","data","get"],"sourceRoot":"../../../../src","sources":["sdk/types/index.ts"],"mappings":";;AAAA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA,WAAYA,uCAAuC,0BAAvCA,uCAAuC;EACjD;AACF;AACA;EAHYA,uCAAuC;EAMjD;AACF;AACA;EARYA,uCAAuC;EAWjD;AACF;AACA;EAbYA,uCAAuC;EAAA,OAAvCA,uCAAuC;AAAA;;AAiBnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AAKrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AASrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;;AAGA,OAAO,MAAMC,YAAY,CAAU;EAIjCC,WAAWA,CAACC,IAAsB,EAAEC,IAAO,EAAE;IAC3C,IAAI,CAACD,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;EAClB;EAEAC,GAAGA,CAAA,EAAS;IACV,OAAO,IAAI,CAACD,IAAI;EAClB;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { LocationStatusName, logError } from "..";
|
|
4
|
+
import { ErrorCode, ErrorType } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Handles callbacks coming from SDKs asynchronously
|
|
7
|
+
*
|
|
8
|
+
* @param response
|
|
9
|
+
* @param resolve
|
|
10
|
+
* @param reject
|
|
11
|
+
* @param errorMessage
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const handleAsyncCallback = (response, resolve, reject, errorMessage) => {
|
|
15
|
+
if (response?.success) {
|
|
16
|
+
resolve();
|
|
17
|
+
} else {
|
|
18
|
+
reject({
|
|
19
|
+
code: ErrorCode.UNKNOWN,
|
|
20
|
+
message: errorMessage || "Unknown error.",
|
|
21
|
+
type: ErrorType.NON_CRITICAL
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Handles callbacks coming from SDKs synchronously
|
|
28
|
+
*
|
|
29
|
+
* @param response
|
|
30
|
+
* @param errorMessage
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
export const handleSyncCallback = (r, errorMessage) => {
|
|
34
|
+
if (r?.success) {
|
|
35
|
+
return;
|
|
36
|
+
} else {
|
|
37
|
+
throw {
|
|
38
|
+
code: -1,
|
|
39
|
+
message: errorMessage || "Unknown error."
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Wraps all SDK API methods with a exception handling code, and defines helper functions.
|
|
46
|
+
*
|
|
47
|
+
* @param fn
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
export const exceptionWrapper = fn => {
|
|
51
|
+
let returnValue;
|
|
52
|
+
try {
|
|
53
|
+
fn({
|
|
54
|
+
onCallback: handleSyncCallback,
|
|
55
|
+
onSuccess: response => {
|
|
56
|
+
returnValue = response;
|
|
57
|
+
},
|
|
58
|
+
onError: error => {
|
|
59
|
+
logError(error);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
} catch (error) {
|
|
64
|
+
logError(error);
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
return returnValue;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Wraps all SDK API methods with a promise, and defines helper functions.
|
|
72
|
+
*
|
|
73
|
+
* @param fn
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
export const promiseWrapper = fn => {
|
|
77
|
+
return new Promise((resolve, reject) => {
|
|
78
|
+
try {
|
|
79
|
+
return fn({
|
|
80
|
+
resolve,
|
|
81
|
+
reject,
|
|
82
|
+
onCallback: (r, errorMessage) => handleAsyncCallback(r, resolve, reject, errorMessage),
|
|
83
|
+
onSuccess: response => resolve(response),
|
|
84
|
+
onError: error => {
|
|
85
|
+
logError(error);
|
|
86
|
+
reject(error);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
} catch (error) {
|
|
90
|
+
logError(error);
|
|
91
|
+
reject({
|
|
92
|
+
code: ErrorCode.UNKNOWN,
|
|
93
|
+
message: typeof error === "object" && error !== null && "message" in error ? error?.message : "Unknown error.",
|
|
94
|
+
type: ErrorType.NON_CRITICAL
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
export function locationStatusAdapter(statusName) {
|
|
100
|
+
// The MapView will only understand status names declared at LocationStatusName and CALCULATING
|
|
101
|
+
// is not one of them.
|
|
102
|
+
// TODO: implement status & error adapter on native SDKs.
|
|
103
|
+
if (statusName === "CALCULATING") {
|
|
104
|
+
statusName = LocationStatusName.STARTING;
|
|
105
|
+
}
|
|
106
|
+
return statusName;
|
|
107
|
+
}
|
|
108
|
+
export function locationErrorAdapter(error) {
|
|
109
|
+
let adaptedCode = ErrorCode.UNKNOWN;
|
|
110
|
+
const adaptedMessage = error.message;
|
|
111
|
+
const adaptedType = ErrorType.CRITICAL;
|
|
112
|
+
switch (error.code.toString()) {
|
|
113
|
+
case "8001": // MISSING_LOCATION_PERMISSION
|
|
114
|
+
case "8": // kSITLocationErrorLocationDisabled
|
|
115
|
+
case "9": // kSITLocationErrorLocationRestricted
|
|
116
|
+
case "10":
|
|
117
|
+
// kSITLocationErrorLocationAuthStatusNotDetermined
|
|
118
|
+
adaptedCode = ErrorCode.LOCATION_PERMISSION_DENIED;
|
|
119
|
+
break;
|
|
120
|
+
case "8002":
|
|
121
|
+
// LOCATION_DISABLED
|
|
122
|
+
adaptedCode = ErrorCode.LOCATION_DISABLED;
|
|
123
|
+
break;
|
|
124
|
+
case "8012":
|
|
125
|
+
// MISSING_BLUETOOTH_PERMISSION
|
|
126
|
+
adaptedCode = ErrorCode.BLUETOOTH_PERMISSION_DENIED;
|
|
127
|
+
break;
|
|
128
|
+
case "8100": //BLUETOOTH_DISABLED. 8100 ->This number does not exist in Situm SDK. We made it up in SitumMapper.java (RN adapter)
|
|
129
|
+
case "6":
|
|
130
|
+
// kSITLocationErrorBluetoothisOff
|
|
131
|
+
adaptedCode = ErrorCode.BLUETOOTH_DISABLED;
|
|
132
|
+
break;
|
|
133
|
+
case "11":
|
|
134
|
+
//kSITLocationErrorLocationAccuracyAuthorizationStatusReducedAccuracy
|
|
135
|
+
adaptedCode = ErrorCode.REDUCED_ACCURACY;
|
|
136
|
+
break;
|
|
137
|
+
// Add more cases as needed
|
|
138
|
+
}
|
|
139
|
+
const returnError = {
|
|
140
|
+
code: adaptedCode,
|
|
141
|
+
message: adaptedMessage,
|
|
142
|
+
type: adaptedType
|
|
143
|
+
};
|
|
144
|
+
return returnError;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LocationStatusName","logError","ErrorCode","ErrorType","handleAsyncCallback","response","resolve","reject","errorMessage","success","code","UNKNOWN","message","type","NON_CRITICAL","handleSyncCallback","r","exceptionWrapper","fn","returnValue","onCallback","onSuccess","onError","error","promiseWrapper","Promise","locationStatusAdapter","statusName","STARTING","locationErrorAdapter","adaptedCode","adaptedMessage","adaptedType","CRITICAL","toString","LOCATION_PERMISSION_DENIED","LOCATION_DISABLED","BLUETOOTH_PERMISSION_DENIED","BLUETOOTH_DISABLED","REDUCED_ACCURACY","returnError"],"sourceRoot":"../../../src","sources":["sdk/utils.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Small utility that can be used as an error handler. You cannot just pass
|
|
5
|
+
* `console.error` as a failure callback - it's not properly bound. If passes an
|
|
6
|
+
* `Error` object, it will print the message and stack.
|
|
7
|
+
*/
|
|
8
|
+
export const logError = __DEV__ ? function (response) {
|
|
9
|
+
if (response instanceof String) {
|
|
10
|
+
console.log(response);
|
|
11
|
+
} else {
|
|
12
|
+
console.log(JSON.stringify(response));
|
|
13
|
+
}
|
|
14
|
+
} : function (_response) {
|
|
15
|
+
// do nothing
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=logError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["logError","__DEV__","response","String","console","log","JSON","stringify","_response"],"sourceRoot":"../../../src","sources":["utils/logError.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,GAAGC,OAAO,GAC3B,UAAUC,QAAiB,EAAE;EAC3B,IAAIA,QAAQ,YAAYC,MAAM,EAAE;IAC9BC,OAAO,CAACC,GAAG,CAACH,QAAQ,CAAC;EACvB,CAAC,MAAM;IACLE,OAAO,CAACC,GAAG,CAACC,IAAI,CAACC,SAAS,CAACL,QAAQ,CAAC,CAAC;EACvC;AACF,CAAC,GACD,UAAUM,SAAc,EAAE;EACxB;AAAA,CACD","ignoreList":[]}
|