@arenarium/maps 1.5.3 → 1.5.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/dist/main.d.ts +422 -0
- package/dist/main.js +1 -1
- package/package.json +2 -2
package/dist/main.d.ts
CHANGED
|
@@ -73,3 +73,425 @@ export { MapProvider }
|
|
|
73
73
|
export { MapProviderMarker }
|
|
74
74
|
|
|
75
75
|
export { }
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// this file is generated — do not edit it
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/// <reference types="@sveltejs/kit" />
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* This module provides access to environment variables that are injected _statically_ into your bundle at build time and are limited to _private_ access.
|
|
85
|
+
*
|
|
86
|
+
* | | Runtime | Build time |
|
|
87
|
+
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
88
|
+
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
|
89
|
+
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
|
90
|
+
*
|
|
91
|
+
* Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination.
|
|
92
|
+
*
|
|
93
|
+
* **_Private_ access:**
|
|
94
|
+
*
|
|
95
|
+
* - This module cannot be imported into client-side code
|
|
96
|
+
* - This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured)
|
|
97
|
+
*
|
|
98
|
+
* For example, given the following build time environment:
|
|
99
|
+
*
|
|
100
|
+
* ```env
|
|
101
|
+
* ENVIRONMENT=production
|
|
102
|
+
* PUBLIC_BASE_URL=http://site.com
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* With the default `publicPrefix` and `privatePrefix`:
|
|
106
|
+
*
|
|
107
|
+
* ```ts
|
|
108
|
+
* import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/private';
|
|
109
|
+
*
|
|
110
|
+
* console.log(ENVIRONMENT); // => "production"
|
|
111
|
+
* console.log(PUBLIC_BASE_URL); // => throws error during build
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values.
|
|
115
|
+
*/
|
|
116
|
+
declare module '$env/static/private' {
|
|
117
|
+
export const VITE_API_URL: string;
|
|
118
|
+
export const VITE_LIB_VERSION: string;
|
|
119
|
+
export const SHELL: string;
|
|
120
|
+
export const npm_command: string;
|
|
121
|
+
export const WINDOWID: string;
|
|
122
|
+
export const COLORTERM: string;
|
|
123
|
+
export const XDG_MENU_PREFIX: string;
|
|
124
|
+
export const TERM_PROGRAM_VERSION: string;
|
|
125
|
+
export const QT_IM_MODULES: string;
|
|
126
|
+
export const NODE: string;
|
|
127
|
+
export const LC_ADDRESS: string;
|
|
128
|
+
export const LC_NAME: string;
|
|
129
|
+
export const SSH_AUTH_SOCK: string;
|
|
130
|
+
export const MEMORY_PRESSURE_WRITE: string;
|
|
131
|
+
export const VP_TOOL_RECURSION: string;
|
|
132
|
+
export const XMODIFIERS: string;
|
|
133
|
+
export const DESKTOP_SESSION: string;
|
|
134
|
+
export const LC_MONETARY: string;
|
|
135
|
+
export const PWD: string;
|
|
136
|
+
export const LOGNAME: string;
|
|
137
|
+
export const XDG_SESSION_DESKTOP: string;
|
|
138
|
+
export const XDG_SESSION_TYPE: string;
|
|
139
|
+
export const SYSTEMD_EXEC_PID: string;
|
|
140
|
+
export const ZED_FILENAME: string;
|
|
141
|
+
export const XAUTHORITY: string;
|
|
142
|
+
export const ZED_COLUMN: string;
|
|
143
|
+
export const ZED_FILE: string;
|
|
144
|
+
export const GJS_DEBUG_TOPICS: string;
|
|
145
|
+
export const MOTD_SHOWN: string;
|
|
146
|
+
export const GDM_LANG: string;
|
|
147
|
+
export const ZED_RELATIVE_DIR: string;
|
|
148
|
+
export const HOME: string;
|
|
149
|
+
export const USERNAME: string;
|
|
150
|
+
export const LC_PAPER: string;
|
|
151
|
+
export const LANG: string;
|
|
152
|
+
export const XDG_CURRENT_DESKTOP: string;
|
|
153
|
+
export const npm_package_version: string;
|
|
154
|
+
export const ZED_LANGUAGE: string;
|
|
155
|
+
export const MEMORY_PRESSURE_WATCH: string;
|
|
156
|
+
export const WAYLAND_DISPLAY: string;
|
|
157
|
+
export const VIRTUAL_ENV_DISABLE_PROMPT: string;
|
|
158
|
+
export const MANROFFOPT: string;
|
|
159
|
+
export const INVOCATION_ID: string;
|
|
160
|
+
export const pnpm_config_verify_deps_before_run: string;
|
|
161
|
+
export const MANAGERPID: string;
|
|
162
|
+
export const INIT_CWD: string;
|
|
163
|
+
export const npm_lifecycle_script: string;
|
|
164
|
+
export const GJS_DEBUG_OUTPUT: string;
|
|
165
|
+
export const GNOME_SETUP_DISPLAY: string;
|
|
166
|
+
export const XDG_SESSION_CLASS: string;
|
|
167
|
+
export const LC_IDENTIFICATION: string;
|
|
168
|
+
export const TERM: string;
|
|
169
|
+
export const npm_package_name: string;
|
|
170
|
+
export const ZED_STEM: string;
|
|
171
|
+
export const USER: string;
|
|
172
|
+
export const MANPAGER: string;
|
|
173
|
+
export const DISPLAY: string;
|
|
174
|
+
export const npm_lifecycle_event: string;
|
|
175
|
+
export const SHLVL: string;
|
|
176
|
+
export const MOZ_ENABLE_WAYLAND: string;
|
|
177
|
+
export const LC_TELEPHONE: string;
|
|
178
|
+
export const ZED_DIRNAME: string;
|
|
179
|
+
export const npm_config_manage_package_manager_versions: string;
|
|
180
|
+
export const QT_IM_MODULE: string;
|
|
181
|
+
export const LC_MEASUREMENT: string;
|
|
182
|
+
export const ZED_MAIN_GIT_WORKTREE: string;
|
|
183
|
+
export const ZED_RELATIVE_FILE: string;
|
|
184
|
+
export const MANAGERPIDFDID: string;
|
|
185
|
+
export const npm_config_user_agent: string;
|
|
186
|
+
export const PNPM_SCRIPT_SRC_DIR: string;
|
|
187
|
+
export const npm_execpath: string;
|
|
188
|
+
export const LD_LIBRARY_PATH: string;
|
|
189
|
+
export const XDG_RUNTIME_DIR: string;
|
|
190
|
+
export const NODE_PATH: string;
|
|
191
|
+
export const ZED_ROW: string;
|
|
192
|
+
export const LC_TIME: string;
|
|
193
|
+
export const npm_package_json: string;
|
|
194
|
+
export const ZED_ENVIRONMENT: string;
|
|
195
|
+
export const JOURNAL_STREAM: string;
|
|
196
|
+
export const XDG_DATA_DIRS: string;
|
|
197
|
+
export const PATH: string;
|
|
198
|
+
export const npm_config_node_gyp: string;
|
|
199
|
+
export const GDMSESSION: string;
|
|
200
|
+
export const XDG_SESSION_EXTRA_DEVICE_ACCESS: string;
|
|
201
|
+
export const ZED_WORKTREE_ROOT: string;
|
|
202
|
+
export const DBUS_SESSION_BUS_ADDRESS: string;
|
|
203
|
+
export const MAIL: string;
|
|
204
|
+
export const ALACRITTY_WINDOW_ID: string;
|
|
205
|
+
export const ZED_TERM: string;
|
|
206
|
+
export const GIO_LAUNCHED_DESKTOP_FILE_PID: string;
|
|
207
|
+
export const npm_node_execpath: string;
|
|
208
|
+
export const GIO_LAUNCHED_DESKTOP_FILE: string;
|
|
209
|
+
export const LC_NUMERIC: string;
|
|
210
|
+
export const TERM_PROGRAM: string;
|
|
211
|
+
export const NODE_ENV: string;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* This module provides access to environment variables that are injected _statically_ into your bundle at build time and are _publicly_ accessible.
|
|
218
|
+
*
|
|
219
|
+
* | | Runtime | Build time |
|
|
220
|
+
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
221
|
+
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
|
222
|
+
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
|
223
|
+
*
|
|
224
|
+
* Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination.
|
|
225
|
+
*
|
|
226
|
+
* **_Public_ access:**
|
|
227
|
+
*
|
|
228
|
+
* - This module _can_ be imported into client-side code
|
|
229
|
+
* - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included
|
|
230
|
+
*
|
|
231
|
+
* For example, given the following build time environment:
|
|
232
|
+
*
|
|
233
|
+
* ```env
|
|
234
|
+
* ENVIRONMENT=production
|
|
235
|
+
* PUBLIC_BASE_URL=http://site.com
|
|
236
|
+
* ```
|
|
237
|
+
*
|
|
238
|
+
* With the default `publicPrefix` and `privatePrefix`:
|
|
239
|
+
*
|
|
240
|
+
* ```ts
|
|
241
|
+
* import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/public';
|
|
242
|
+
*
|
|
243
|
+
* console.log(ENVIRONMENT); // => throws error during build
|
|
244
|
+
* console.log(PUBLIC_BASE_URL); // => "http://site.com"
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values.
|
|
248
|
+
*/
|
|
249
|
+
declare module '$env/static/public' {
|
|
250
|
+
export const PUBLIC_GOOGLE_MAPS_API_KEY: string;
|
|
251
|
+
export const PUBLIC_GOOGLE_MAPS_MAP_ID: string;
|
|
252
|
+
export const PUBLIC_MAP_BOX_API_KEY: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* This module provides access to environment variables set _dynamically_ at runtime and that are limited to _private_ access.
|
|
259
|
+
*
|
|
260
|
+
* | | Runtime | Build time |
|
|
261
|
+
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
262
|
+
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
|
263
|
+
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
|
264
|
+
*
|
|
265
|
+
* Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`.
|
|
266
|
+
*
|
|
267
|
+
* **_Private_ access:**
|
|
268
|
+
*
|
|
269
|
+
* - This module cannot be imported into client-side code
|
|
270
|
+
* - This module includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured)
|
|
271
|
+
*
|
|
272
|
+
* > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter.
|
|
273
|
+
*
|
|
274
|
+
* > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed:
|
|
275
|
+
* >
|
|
276
|
+
* > ```env
|
|
277
|
+
* > MY_FEATURE_FLAG=
|
|
278
|
+
* > ```
|
|
279
|
+
* >
|
|
280
|
+
* > You can override `.env` values from the command line like so:
|
|
281
|
+
* >
|
|
282
|
+
* > ```sh
|
|
283
|
+
* > MY_FEATURE_FLAG="enabled" npm run dev
|
|
284
|
+
* > ```
|
|
285
|
+
*
|
|
286
|
+
* For example, given the following runtime environment:
|
|
287
|
+
*
|
|
288
|
+
* ```env
|
|
289
|
+
* ENVIRONMENT=production
|
|
290
|
+
* PUBLIC_BASE_URL=http://site.com
|
|
291
|
+
* ```
|
|
292
|
+
*
|
|
293
|
+
* With the default `publicPrefix` and `privatePrefix`:
|
|
294
|
+
*
|
|
295
|
+
* ```ts
|
|
296
|
+
* import { env } from '$env/dynamic/private';
|
|
297
|
+
*
|
|
298
|
+
* console.log(env.ENVIRONMENT); // => "production"
|
|
299
|
+
* console.log(env.PUBLIC_BASE_URL); // => undefined
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
declare module '$env/dynamic/private' {
|
|
303
|
+
export const env: {
|
|
304
|
+
VITE_API_URL: string;
|
|
305
|
+
VITE_LIB_VERSION: string;
|
|
306
|
+
SHELL: string;
|
|
307
|
+
npm_command: string;
|
|
308
|
+
WINDOWID: string;
|
|
309
|
+
COLORTERM: string;
|
|
310
|
+
XDG_MENU_PREFIX: string;
|
|
311
|
+
TERM_PROGRAM_VERSION: string;
|
|
312
|
+
QT_IM_MODULES: string;
|
|
313
|
+
NODE: string;
|
|
314
|
+
LC_ADDRESS: string;
|
|
315
|
+
LC_NAME: string;
|
|
316
|
+
SSH_AUTH_SOCK: string;
|
|
317
|
+
MEMORY_PRESSURE_WRITE: string;
|
|
318
|
+
VP_TOOL_RECURSION: string;
|
|
319
|
+
XMODIFIERS: string;
|
|
320
|
+
DESKTOP_SESSION: string;
|
|
321
|
+
LC_MONETARY: string;
|
|
322
|
+
PWD: string;
|
|
323
|
+
LOGNAME: string;
|
|
324
|
+
XDG_SESSION_DESKTOP: string;
|
|
325
|
+
XDG_SESSION_TYPE: string;
|
|
326
|
+
SYSTEMD_EXEC_PID: string;
|
|
327
|
+
ZED_FILENAME: string;
|
|
328
|
+
XAUTHORITY: string;
|
|
329
|
+
ZED_COLUMN: string;
|
|
330
|
+
ZED_FILE: string;
|
|
331
|
+
GJS_DEBUG_TOPICS: string;
|
|
332
|
+
MOTD_SHOWN: string;
|
|
333
|
+
GDM_LANG: string;
|
|
334
|
+
ZED_RELATIVE_DIR: string;
|
|
335
|
+
HOME: string;
|
|
336
|
+
USERNAME: string;
|
|
337
|
+
LC_PAPER: string;
|
|
338
|
+
LANG: string;
|
|
339
|
+
XDG_CURRENT_DESKTOP: string;
|
|
340
|
+
npm_package_version: string;
|
|
341
|
+
ZED_LANGUAGE: string;
|
|
342
|
+
MEMORY_PRESSURE_WATCH: string;
|
|
343
|
+
WAYLAND_DISPLAY: string;
|
|
344
|
+
VIRTUAL_ENV_DISABLE_PROMPT: string;
|
|
345
|
+
MANROFFOPT: string;
|
|
346
|
+
INVOCATION_ID: string;
|
|
347
|
+
pnpm_config_verify_deps_before_run: string;
|
|
348
|
+
MANAGERPID: string;
|
|
349
|
+
INIT_CWD: string;
|
|
350
|
+
npm_lifecycle_script: string;
|
|
351
|
+
GJS_DEBUG_OUTPUT: string;
|
|
352
|
+
GNOME_SETUP_DISPLAY: string;
|
|
353
|
+
XDG_SESSION_CLASS: string;
|
|
354
|
+
LC_IDENTIFICATION: string;
|
|
355
|
+
TERM: string;
|
|
356
|
+
npm_package_name: string;
|
|
357
|
+
ZED_STEM: string;
|
|
358
|
+
USER: string;
|
|
359
|
+
MANPAGER: string;
|
|
360
|
+
DISPLAY: string;
|
|
361
|
+
npm_lifecycle_event: string;
|
|
362
|
+
SHLVL: string;
|
|
363
|
+
MOZ_ENABLE_WAYLAND: string;
|
|
364
|
+
LC_TELEPHONE: string;
|
|
365
|
+
ZED_DIRNAME: string;
|
|
366
|
+
npm_config_manage_package_manager_versions: string;
|
|
367
|
+
QT_IM_MODULE: string;
|
|
368
|
+
LC_MEASUREMENT: string;
|
|
369
|
+
ZED_MAIN_GIT_WORKTREE: string;
|
|
370
|
+
ZED_RELATIVE_FILE: string;
|
|
371
|
+
MANAGERPIDFDID: string;
|
|
372
|
+
npm_config_user_agent: string;
|
|
373
|
+
PNPM_SCRIPT_SRC_DIR: string;
|
|
374
|
+
npm_execpath: string;
|
|
375
|
+
LD_LIBRARY_PATH: string;
|
|
376
|
+
XDG_RUNTIME_DIR: string;
|
|
377
|
+
NODE_PATH: string;
|
|
378
|
+
ZED_ROW: string;
|
|
379
|
+
LC_TIME: string;
|
|
380
|
+
npm_package_json: string;
|
|
381
|
+
ZED_ENVIRONMENT: string;
|
|
382
|
+
JOURNAL_STREAM: string;
|
|
383
|
+
XDG_DATA_DIRS: string;
|
|
384
|
+
PATH: string;
|
|
385
|
+
npm_config_node_gyp: string;
|
|
386
|
+
GDMSESSION: string;
|
|
387
|
+
XDG_SESSION_EXTRA_DEVICE_ACCESS: string;
|
|
388
|
+
ZED_WORKTREE_ROOT: string;
|
|
389
|
+
DBUS_SESSION_BUS_ADDRESS: string;
|
|
390
|
+
MAIL: string;
|
|
391
|
+
ALACRITTY_WINDOW_ID: string;
|
|
392
|
+
ZED_TERM: string;
|
|
393
|
+
GIO_LAUNCHED_DESKTOP_FILE_PID: string;
|
|
394
|
+
npm_node_execpath: string;
|
|
395
|
+
GIO_LAUNCHED_DESKTOP_FILE: string;
|
|
396
|
+
LC_NUMERIC: string;
|
|
397
|
+
TERM_PROGRAM: string;
|
|
398
|
+
NODE_ENV: string;
|
|
399
|
+
[key: `PUBLIC_${string}`]: undefined;
|
|
400
|
+
[key: `${string}`]: string | undefined;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* This module provides access to environment variables set _dynamically_ at runtime and that are _publicly_ accessible.
|
|
408
|
+
*
|
|
409
|
+
* | | Runtime | Build time |
|
|
410
|
+
* | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
411
|
+
* | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) |
|
|
412
|
+
* | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) |
|
|
413
|
+
*
|
|
414
|
+
* Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`.
|
|
415
|
+
*
|
|
416
|
+
* **_Public_ access:**
|
|
417
|
+
*
|
|
418
|
+
* - This module _can_ be imported into client-side code
|
|
419
|
+
* - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included
|
|
420
|
+
*
|
|
421
|
+
* > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter.
|
|
422
|
+
*
|
|
423
|
+
* > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed:
|
|
424
|
+
* >
|
|
425
|
+
* > ```env
|
|
426
|
+
* > MY_FEATURE_FLAG=
|
|
427
|
+
* > ```
|
|
428
|
+
* >
|
|
429
|
+
* > You can override `.env` values from the command line like so:
|
|
430
|
+
* >
|
|
431
|
+
* > ```sh
|
|
432
|
+
* > MY_FEATURE_FLAG="enabled" npm run dev
|
|
433
|
+
* > ```
|
|
434
|
+
*
|
|
435
|
+
* For example, given the following runtime environment:
|
|
436
|
+
*
|
|
437
|
+
* ```env
|
|
438
|
+
* ENVIRONMENT=production
|
|
439
|
+
* PUBLIC_BASE_URL=http://example.com
|
|
440
|
+
* ```
|
|
441
|
+
*
|
|
442
|
+
* With the default `publicPrefix` and `privatePrefix`:
|
|
443
|
+
*
|
|
444
|
+
* ```ts
|
|
445
|
+
* import { env } from '$env/dynamic/public';
|
|
446
|
+
* console.log(env.ENVIRONMENT); // => undefined, not public
|
|
447
|
+
* console.log(env.PUBLIC_BASE_URL); // => "http://example.com"
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* ```
|
|
451
|
+
*
|
|
452
|
+
* ```
|
|
453
|
+
*/
|
|
454
|
+
declare module '$env/dynamic/public' {
|
|
455
|
+
export const env: {
|
|
456
|
+
PUBLIC_GOOGLE_MAPS_API_KEY: string;
|
|
457
|
+
PUBLIC_GOOGLE_MAPS_MAP_ID: string;
|
|
458
|
+
PUBLIC_MAP_BOX_API_KEY: string;
|
|
459
|
+
[key: `PUBLIC_${string}`]: string | undefined;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
// this file is generated — do not edit it
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
declare module "svelte/elements" {
|
|
468
|
+
export interface HTMLAttributes<T> {
|
|
469
|
+
'data-sveltekit-keepfocus'?: true | '' | 'off' | undefined | null;
|
|
470
|
+
'data-sveltekit-noscroll'?: true | '' | 'off' | undefined | null;
|
|
471
|
+
'data-sveltekit-preload-code'?:
|
|
472
|
+
| true
|
|
473
|
+
| ''
|
|
474
|
+
| 'eager'
|
|
475
|
+
| 'viewport'
|
|
476
|
+
| 'hover'
|
|
477
|
+
| 'tap'
|
|
478
|
+
| 'off'
|
|
479
|
+
| undefined
|
|
480
|
+
| null;
|
|
481
|
+
'data-sveltekit-preload-data'?: true | '' | 'hover' | 'tap' | 'off' | undefined | null;
|
|
482
|
+
'data-sveltekit-reload'?: true | '' | 'off' | undefined | null;
|
|
483
|
+
'data-sveltekit-replacestate'?: true | '' | 'off' | undefined | null;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// See https://svelte.dev/docs/kit/types#app.d.ts
|
|
488
|
+
// for information about these interfaces
|
|
489
|
+
declare global {
|
|
490
|
+
namespace App {
|
|
491
|
+
// interface Error {}
|
|
492
|
+
// interface Locals {}
|
|
493
|
+
// interface PageData {}
|
|
494
|
+
// interface PageState {}
|
|
495
|
+
// interface Platform {}
|
|
496
|
+
}
|
|
497
|
+
}
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`X-Version`,t=e=>new Promise(t=>setTimeout(t,e));async function n(e,n){let r=0,i=Math.max(1,n?.retry?.times??1);for(;r<i;)try{return{data:await e(),error:null}}catch(e){if(r++,r===i){if(e instanceof Error)return(!n?.exceptions||n.exceptions.some(t=>e instanceof t)===!1)&&n?.catch?.(e),{data:null,error:e};throw n?.catch?.(e),e}else n?.retry?.delay&&await t(n.retry.delay)}throw Error(`Unreachable code`)}async function r(e,t,r,i,a){let o=await n(async()=>await fetch(e,{...r,headers:{"Content-Type":`application/json`,...r?.headers},method:`POST`,body:t?JSON.stringify(t):void 0}),{retry:{times:i,delay:a}});if(o.error)throw o.error;let s=o.data;if(!s.ok)throw Error(await s.text());return await s.json()}async function i(e,t,r,i,a){let o=await n(async()=>await fetch(e,{...r,headers:{"Content-Type":`application/json`,...r?.headers},method:`PUT`,body:t?JSON.stringify(t):void 0}),{retry:{times:i,delay:a}});if(o.error)throw o.error;let s=o.data;if(!s.ok)throw Error(await s.text())}var a,o={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function s(e){return!e&&!a?o:{lang:e?.lang??a?.lang,message:e?.message,abortEarly:e?.abortEarly??a?.abortEarly,abortPipeEarly:e?.abortPipeEarly??a?.abortPipeEarly}}var c;function l(e){return c?.get(e)}var u;function d(e){return u?.get(e)}var f;function p(e,t){return f?.get(e)?.get(t)}function m(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function h(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??m(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u=e.kind===`schema`,f=i?.message??e.message??p(e.reference,c.lang)??(u?d(c.lang):null)??r.message??l(c.lang);f!==void 0&&(c.message=typeof f==`function`?f(c):f),u&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}var g=new WeakMap;function _(e){let t=g.get(e);return t||(t={version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},s())}},g.set(e,t)),t}function v(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}var y=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function b(e){return{kind:`transformation`,type:`args`,reference:b,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:e},t);if(r.issues)throw new y(r.issues);return n(...r.value)},e}}}var x=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u;function S(e,t){return{kind:`validation`,type:`check`,reference:S,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&h(this,`input`,e,t),e}}}function C(e){return{kind:`validation`,type:`hex_color`,reference:C,async:!1,expects:null,requirement:x,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&h(this,`hex color`,e,t),e}}}function w(e,t){return{kind:`validation`,type:`length`,reference:w,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length!==this.requirement&&h(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function T(e,t){return{kind:`validation`,type:`max_value`,reference:T,async:!1,expects:`<=${e instanceof Date?e.toJSON():m(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value<=this.requirement)&&h(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():m(e.value)}),e}}}function E(e,t){return{kind:`validation`,type:`min_length`,reference:E,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&h(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function D(e,t){return{kind:`validation`,type:`min_value`,reference:D,async:!1,expects:`>=${e instanceof Date?e.toJSON():m(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>=this.requirement)&&h(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():m(e.value)}),e}}}function ee(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function te(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function ne(){return{kind:`schema`,type:`any`,reference:ne,expects:`any`,async:!1,get"~standard"(){return _(this)},"~run"(e){return e.typed=!0,e}}}function re(e,t){return{kind:`schema`,type:`array`,reference:re,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else h(this,`type`,e,t);return e}}}function ie(e){return{kind:`schema`,type:`boolean`,reference:ie,expects:`boolean`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:h(this,`type`,e,t),e}}}function ae(e,t){return{kind:`schema`,type:`custom`,reference:ae,expects:`unknown`,async:!1,check:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:h(this,`type`,e,t),e}}}function oe(e,t){let n=[];for(let t in e)(`${+t}`!==t||typeof e[t]!=`string`||!Object.is(e[e[t]],+t))&&n.push(e[t]);return{kind:`schema`,type:`enum`,reference:oe,expects:v(n.map(m),`|`),async:!1,enum:e,options:n,message:t,get"~standard"(){return _(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:h(this,`type`,e,t),e}}}function se(e){return{kind:`schema`,type:`function`,reference:se,expects:`Function`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`function`?e.typed=!0:h(this,`type`,e,t),e}}}function O(e){return{kind:`schema`,type:`number`,reference:O,expects:`number`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:h(this,`type`,e,t),e}}}function k(e,t){return{kind:`schema`,type:`object`,reference:k,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:te(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=ee(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(h(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else h(this,`type`,e,t);return e}}}function A(e,t){return{kind:`schema`,type:`optional`,reference:A,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return _(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=te(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function j(e){return{kind:`schema`,type:`string`,reference:j,expects:`string`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:h(this,`type`,e,t),e}}}function ce(e,t){return{kind:`schema`,type:`tuple`,reference:ce,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<this.items.length;r++){let i=n[r],a=this.items[r][`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else h(this,`type`,e,t);return e}}}function le(e,t,n){let r=e[`~run`]({value:t},s(n));if(r.issues)throw new y(r.issues);return r.value}function M(...e){return{...e[0],pipe:e,get"~standard"(){return _(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}function N(e,t){return le(e,t)}var ue=function(e){return e[e.Error=0]=`Error`,e[e.Warning=1]=`Warning`,e[e.Info=2]=`Info`,e}({}),de=function(e){return e[e.Library=0]=`Library`,e[e.Web=1]=`Web`,e[e.API=2]=`API`,e}({}),fe=M(j(),w(32)),pe=M(j(),E(1)),P=ae(e=>e instanceof HTMLElement,`Must be an HTMLElement`),F=M(se(),b(ce([j(),P]))),me=M(k({radius:M(O(),D(0),T(128)),stroke:M(O(),D(0),T(128))}),S(e=>e.stroke<=e.radius,`Stroke must be less than or equal to radius`)),he=k({background:A(M(j(),C())),stroke:A(M(j(),C())),shadow:A(j())}),ge=M(k({width:M(O(),D(1),T(655.36)),height:M(O(),D(1),T(655.36)),padding:M(O(),D(1))}),S(e=>Math.min(e.width,e.height)/e.padding>=4,`Padding must not exceed 25% of the minimum dimension (width or height)`)),_e=k({background:A(M(j(),C())),radius:A(M(O(),D(0))),filter:A(j())}),ve=re(k({id:M(j(),E(1)),rank:M(O(),D(0),T(4294967295)),lat:M(O(),D(-90),T(90)),lng:M(O(),D(-180),T(180)),tooltip:k({element:P,style:A(_e),dimensions:A(ge),initialize:A(F)}),pin:A(k({element:A(P),style:A(he),dimensions:A(me),initialize:A(F)})),popup:A(k({element:P,style:A(_e),dimensions:A(ge),initialize:A(F)}))})),ye=1e6;function I(e){return Math.round(e*ye)/ye}function be(e){return Math.round(e*100)/100}var xe=class{static create(e,t,n){throw Error(`Must override static create method!`)}},Se=25e-5,L=.1,Ce=.2,we=1e6,Te=2e6,Ee=3e6,De=100,Oe=class{#e=!1;#t=!1;#n;#r;#i;constructor(e,t){if((t??0)<0)throw Error(`Invalid interval`);this.#n=t??De/Math.max(4,navigator?.hardwareConcurrency??1),this.#i=e}async process(){this.#e=!1,this.#i()||!this.#e?this.stop():this.#r=window.setTimeout(this.process.bind(this),this.#n)}run(){this.#e=!0,this.#t||(this.#t=!0,this.#r=window.setTimeout(this.process.bind(this),0))}stop(){this.#e=!1,this.#t=!1,this.#r&&window.clearTimeout(this.#r),this.#r=void 0}},ke=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){if(e.value<0||1<e.value)throw Error(`Invalid value`);this.#e=!1,this.#t=0,this.#n=0,this.#r=e.easing,this.#i=e.callback,this.#a=e.value,this.#o=e.value,this.#s=e.timespan,this.#c=!1}target(e){if(e===this.#o)return;this.#o=e,this.#c=this.#a<this.#o;let t=performance.now(),n=this.#s*Math.abs(e-this.#a);this.#t=t+n,!this.#e&&window.requestAnimationFrame(this.#l.bind(this))}set(e){this.#a=e,this.#o=e,this.#t=performance.now(),this.#e=!1,window.requestAnimationFrame(()=>this.#i(this.#r(e)))}end(){this.set(this.#o)}expired(){return performance.now()>this.#t}#l(e){if(this.#e===!1){this.#n=e,this.#e=!0,window.requestAnimationFrame(this.#l.bind(this));return}let t=e>=this.#t;t===!0&&(this.#a=this.#o);let n=this.#a===this.#o;if(n===!1){let t=(e-this.#n)/this.#s,r=this.#c?Math.min(this.#a+t,this.#o):Math.max(this.#a-t,this.#o);this.#a=r,n=r===this.#o}if(this.#i(this.#r(this.#a)),this.#n=e,t===!0||n===!0){this.#e=!1;return}window.requestAnimationFrame(this.#l.bind(this))}},Ae=class{#e;#t;#n;#r;#i=!1;#a=!1;#o=!0;#s=0;#c=1;#l=new ke({value:0,timespan:75,easing:this.#u,callback:this.#d.bind(this)});constructor(e,t){let n=t.style,r=t.dimensions,i=r.radius*2,a=r.stroke,o=n?.background??`#008800`,s=n?.stroke??`#ffffff`,c=n?.shadow??`0px 2px 2px rgba(0, 0, 0, 0.5)`,l=document.createElement(`div`);l.classList.add(`arenarium-maps-component-pin`),l.style.width=`${i}px`,l.style.height=`${i}px`,l.style.borderRadius=`${i}px`,l.style.border=`solid ${a}px ${s}`,l.style.background=o,l.style.boxShadow=c,l.style.scale=`0`,l.style.filter=`brightness(${this.#f(0)})`,this.#e=e,this.#t=t.content,this.#n=t.initialize,this.#r=l}getElement(){return this.#r}setDisplayed(e){e===!0&&(this.#r&&this.#t&&this.#t.parentElement!==this.#r&&this.#r.appendChild(this.#t),this.#i===!1&&this.#n&&this.#t&&(this.#i=!0,setTimeout(this.#n.bind(this,this.#e,this.#t),0))),this.#a!==e&&(this.#a=e,this.#r.style.display=e?`flex`:`none`,this.#r.style.contentVisibility=e?`visible`:`hidden`,e===!1&&this.#l.end())}getDisplayed(){return this.#a}setCollapsed(e){this.#o!==e&&(this.#o=e,this.#l.target(this.#o?0:this.#s))}getCollapsed(){return this.#a?this.#l.expired():!0}setScale(e,t){this.#s=e,this.#c=t,this.#l.target(e)}#u(e){return e}#d(e){this.#r.style.scale=e.toString(),this.#r.style.opacity=e.toString(),this.#r.style.filter=`brightness(${this.#f(e)})`}#f(e){return 1-this.#c*(1-e)}};function R(e,t,n){if(e<=0||t<=0)return{x:0,y:0};let r=e/2,i=t/2,a=Math.sqrt(r*r+i*i),o=Math.atan(i/r)*(180/Math.PI),s=Math.PI/180*n;return n<180?n<90?n<o?{x:0,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:0}:n<180-o?{x:a*Math.cos(s)-r,y:0}:{x:-e,y:a*Math.sin(s)-i}:n<270?n<180+o?{x:-e,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:-t}:n<360-o?{x:a*Math.cos(s)-r,y:-t}:{x:0,y:a*Math.sin(s)-i}}var je=30,Me=class{value;target;speed;min;max;constructor(e){this.value=e.value,this.target=e.value,this.speed=0,this.min=e.min,this.max=e.max}set(e){this.value=e,this.target=e,this.speed=0}snap(){this.value=this.target,this.speed=0}frame(e,t,n,r){if(this.value===this.target)return!0;let i=this.target-this.value;if(Math.abs(i)<t)return!0;let a=i*n-this.speed*r;return this.speed+=a*e,this.value+=this.speed*e,this.value<this.min||this.value>this.max}},Ne=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){this.#e=!1,this.#t=0,this.#n=0,this.#r=e.callback,this.#i=e.stiffness,this.#a=e.damping,this.#o=e.precision,this.#s=new Me(e.x),this.#c=new Me(e.y)}target(e,t){if(this.#s.target==e&&this.#c.target==t)return;this.#s.target=e,this.#c.target=t;let n=performance.now(),r=Math.sqrt((e-this.#s.value)**2+(t-this.#c.value)**2),i=2*Math.sqrt(2*Math.abs(r)/this.#i);this.#n=n,this.#t=n+i,this.#e===!1&&(this.#e=!0,window.requestAnimationFrame(this.#l.bind(this)))}set(e,t){this.#s.set(e),this.#c.set(t);let n=performance.now();this.#n=n,this.#t=n,this.#e=!1,window.requestAnimationFrame(()=>this.#r(this.#s.value,this.#c.value))}end(){this.set(this.#s.target,this.#c.target)}expired(){return performance.now()>this.#t}#l(e){let t=!1,n=!1;try{if(e>=this.#t){t=!0,n=!0;return}let r=Math.min(je,e-this.#n);t=this.#s.frame(r,this.#o,this.#i,this.#a),n=this.#c.frame(r,this.#o,this.#i,this.#a)}finally{t===!0&&this.#s.snap(),n===!0&&this.#c.snap(),this.#r(this.#s.value,this.#c.value),this.#n=e,t===!1||n===!1?window.requestAnimationFrame(this.#l.bind(this)):this.#e=!1}}},Pe=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_=!1;#v=!1;#y=!0;#b;#x=NaN;#S=!1;#C;constructor(e,t){let n=t.dimensions,r=t.style,i=n.width+2*n.padding,a=n.height+2*n.padding,o=n.padding,s=n.width,c=n.height,l=r?.background??`#ffffff`,u=Math.min(r?.radius??8,Math.min(s,c)/2),d=Math.min(1,2*u/Math.min(c,s)),f=n.width,p=n.height,m=r?.radius??0,h=n.padding*2,g=Math.min(3,.5*u),_=r?.background??`#ffffff`,v=a<i?a/i:1,y=i<a?i/a:1,b=Math.min(i,a)/2,x=b*Math.SQRT2,S=15*Math.SQRT2,C=document.createElement(`div`);C.classList.add(`arenarium-maps-component-tooltip-element`),C.classList.add(`arenarium-maps-component-tooltip-body`),C.style.width=`${f}px`,C.style.height=`${p}px`,C.style.borderRadius=`${m}px`,C.style.opacity=`0`,this.#g=C;let w=document.createElement(`div`);w.classList.add(`arenarium-maps-component-tooltip-element`),w.classList.add(`arenarium-maps-component-tooltip-bubble`),w.style.width=`${s}px`,w.style.height=`${c}px`,w.style.borderRadius=`${u}px`,w.style.backgroundColor=`rgb(from ${l} r g b / 1)`,w.appendChild(C);let T=document.createElement(`div`);T.classList.add(`arenarium-maps-component-tooltip-element`),T.classList.add(`arenarium-maps-component-tooltip-pointer`),T.style.width=`${h}px`,T.style.height=`${h}px`,T.style.borderRadius=`${g}px`,T.style.backgroundColor=`rgb(from ${_} r g b / 1)`;let E=document.createElement(`div`);E.classList.add(`arenarium-maps-component-tooltip-element`),E.classList.add(`arenarium-maps-component-tooltip-anchor`),E.style.filter=r?.filter??`drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.5))`,E.style.scale=`0`,E.style.opacity=`0`,E.appendChild(T),E.appendChild(w),this.#e=e,this.#t=t.content,this.#n=t.initialize,this.#r=i,this.#i=a,this.#a=o,this.#o=E,this.#s=T,this.#c=v,this.#l=y,this.#d=b,this.#u=x,this.#f=15,this.#p=S,this.#m=w,this.#h=d;let D=Math.min(4,1+3*(n.width*n.height)/65536),ee=Se/D;this.#b=new ke({value:0,timespan:125*Math.cbrt(D),easing:this.#w,callback:this.#T.bind(this)}),this.#C=new Ne({stiffness:ee,damping:2*Math.sqrt(ee),precision:1,x:{value:-i/2,min:-i-i*L,max:i*L},y:{value:-a/2,min:-a-a*L,max:a*L},callback:this.#E.bind(this)})}getElement(){return this.#o}setDisplayed(e){this.#v!==e&&(this.#v=e,e===!0&&(this.#t&&this.#t.parentElement!==this.#g&&this.#g.appendChild(this.#t),this.#_===!1&&this.#n&&this.#t&&(this.#_=!0,setTimeout(this.#n.bind(this,this.#e,this.#t),0))),this.#o.style.display=e?`initial`:`none`,this.#o.style.contentVisibility=e?`visible`:`hidden`,e===!1&&(this.#b.end(),this.#C.end()))}getDisplayed(){return this.#v}setCollapsed(e){this.#y!==e&&(this.#y=e,this.#b.target(+!e))}getCollapsed(){return this.#v?this.#b.expired():!0}#w(e){return-.5*(Math.cos(Math.PI*e)-1)}#T(e){this.#o.style.opacity=`${e}`,this.#o.style.scale=`${e}`,this.#g.style.opacity=`${e}`}setAngle(e){if(Number.isNaN(e)){this.#x=NaN,this.#S=!1;return}if(this.#S===!1){this.#S=!0,this.#x=e;let t=R(this.#r,this.#i,e);this.#C.set(Math.round(t.x),Math.round(t.y));return}if(this.#x!==e){this.#x=e;let t=R(this.#r,this.#i,e);this.#C.target(Math.round(t.x),Math.round(t.y));return}}#E(e,t){let n=e+this.#r/2,r=t+this.#i/2,i=n*this.#c,a=r*this.#l,o=Math.sqrt(i*i+a*a),s=(o-this.#d)/(this.#u-this.#d),c=Math.atan2(a,i)/Math.PI*180-45,l=this.#f+s*(this.#p-this.#f),u=o<this.#d?o/this.#d:1,d=.5*((1+.5*this.#h)*s),f=e+this.#a*(1-d*(i/this.#d)),p=t+this.#a*(1-d*(a/this.#d));this.#s.style.transform=`scale(${u}) rotate(${c}deg) skew(${l}deg, ${l}deg)`,this.#m.style.transform=`translate(${Math.round(f)}px, ${Math.round(p)}px)`}},Fe=class{id;pin;tooltip;popup;constructor(e,t,n,r,i){this.id=t.id,this.pin=new Ie(e,t,n),this.tooltip=new Le(e,t,r),this.popup=i?new Re(e,t,i):void 0}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove(),this.popup?.remove()}},z=class{id;lat;lng;rank;shown=!0;displayed=!1;component;marker;constructor(e,t,n){this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.rank=t.rank;let r=n.getElement(),i=document.createElement(`div`);i.appendChild(r),this.component=n,this.marker=e.createMarker({element:i,lat:t.lat,lng:t.lng,z:this.getZIndex()})}remove(){this.component.setDisplayed(!1),this.marker.remove()}setCollapsed(e){this.component.setCollapsed(e)}getCollapsed(){return this.component.getCollapsed()}getDisplayed(){return this.displayed}setDisplayed(e){this.displayed!==e&&(this.displayed=e,e?(this.component.setDisplayed(!0),this.marker.insert()):(this.component.setDisplayed(!1),this.marker.remove()))}},Ie=class extends z{properties;zoom=NaN;constructor(e,t,n){let r=new Ae(t.id,n);super(e,t,r),this.properties=n}update(e){e?this.zoom=e.zoom:this.zoom=NaN,this.marker.update(this.getZIndex())}getZIndex(){return this.zoom===void 0||Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+we}setScale(e,t){this.component.setScale(e,t)}},Le=class extends z{properties;zoom=NaN;angle=NaN;directions=[];constructor(e,t,n){let r=new Pe(t.id,n);super(e,t,r),this.properties=n}update(e){e?(this.zoom=e.zoom,this.directions=e.directions):(this.zoom=NaN,this.directions=[]),this.marker.update(this.getZIndex())}getZIndex(){return this.zoom===void 0||Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+Te}findAngle(e){let t=this.directions.findLast(t=>t.zoom<=e)?.angle;if(t===void 0)throw Error(`Failed to find angle`);return t}setAngle(e){this.angle=e,this.component.setAngle(e)}},Re=class extends z{properties;angle=NaN;constructor(e,t,n){let r=new Pe(t.id,n);super(e,t,r),this.shown=!1,this.properties=n}getZIndex(){return Ee}setAngle(e){this.angle=e,this.component.setAngle(e)}},ze=class{info;properties;element;state;constructor(e,t,n,r,i){this.info=t,this.properties={pin:n,tooltip:r,popup:i},this.element=new Fe(e,t,n,r,i)}update(e){this.state=e,this.element.update(e)}},Be=class{#e;#t;#n;constructor(e,t){if(t<=0)throw Error(`Invalid timeout`);this.#e=e,this.#t=t}start(){this.#n===void 0&&(this.#n=window.setInterval(this.#e,this.#t))}stop(){this.#n!==void 0&&(window.clearInterval(this.#n),this.#n=void 0)}running(){return this.#n!==void 0}},Ve=100,He=class{#e=void 0;#t=`idle`;#n;#r;#i;#a;#o;#s;#c;constructor(e,t,n,r,i,a){this.#n=e,this.#r=new Be(this.#l.bind(this),Ve/Math.max(4,navigator?.hardwareConcurrency??1)),this.#i=t,this.#a=n,this.#o=r,this.#s=i,this.#c=a}#l(){try{if(this.#i()){this.#r.stop();return}let e=this.#n.getViewport(),t=this.#t,n=JSON.stringify(e)===JSON.stringify(this.#e)?`idle`:`move`;n===`move`&&this.#o(),n===`idle`&&t===`move`&&this.#s(),this.#t=n,this.#e=e}catch(e){this.#a(`Failed to process map state interval`,e)}}start(){this.#r.running()===!1&&(this.#r.start(),this.#n.getContainer().addEventListener(`click`,this.#c))}stop(){this.#r.running()===!0&&(this.#r.stop(),this.#n.getContainer().removeEventListener(`click`,this.#c))}idle(){return this.#t===`idle`}};function B(e,t,n){let r=e.replace(/^#/,``),i,a,o,s;if(r.length!==6&&r.length!==8)throw Error(`Invalid hex color: must be 6 or 8 characters`);return r.length===8?(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=parseInt(r.substring(6,8),16)):(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=255),i=Math.round(i*(1-t)),a=Math.round(a*(1-t)),o=Math.round(o*(1-t)),s=s*n/255,i=Math.max(0,Math.min(255,i)),a=Math.max(0,Math.min(255,a)),o=Math.max(0,Math.min(255,o)),s=Math.max(0,Math.min(1,s)),`rgba(${i}, ${a}, ${o}, ${s.toFixed(2)})`}function V(e,t,n){return{x:We(t)*n,y:Ge(e)*n}}function Ue(e,t,n){return{lat:qe(t/n),lng:Ke(e/n)}}function We(e){return(180+e)/360}function Ge(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Ke(e){return e*360-180}function qe(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}var H=class{#e;#t;constructor(e,t,n,r){if(n<e)throw Error(`Invalid bounds: swLat: ${e}, neLat: ${n}`);if(r<t)throw Error(`Invalid bounds: swLng: ${t}, neLng: ${r}`);this.#e={lat:e,lng:t},this.#t={lat:n,lng:r}}contains(e,t){return!(e<this.#e.lat||this.#t.lat<e||t<this.#e.lng||this.#t.lng<t)}intersects(e){return!(e.ne.lat<this.#e.lat||this.#t.lat<e.sw.lat||e.ne.lng<this.#e.lng||this.#t.lng<e.sw.lng)}},Je=class e{#e;#t;constructor(e,t,n,r){if(t<180&&180<r){this.#e=new H(e,t,n,180),this.#t=new H(e,-180,n,r-360);return}if(t<-180&&-180<r){this.#e=new H(e,360+t,n,180),this.#t=new H(e,-180,n,r);return}this.#e=new H(e,t,n,r),this.#t=new H(0,0,0,0)}static normalize(e){let t=e.bounds,n=e.center;if(t.ne.lng-t.sw.lng>360)return{sw:{lat:t.sw.lat,lng:-180},ne:{lat:t.ne.lat,lng:180}};if(t.sw.lng>t.ne.lng)return t.sw.lng+t.ne.lng<0?{sw:{lat:t.sw.lat,lng:t.sw.lng},ne:{lat:t.ne.lat,lng:t.ne.lng+360}}:{sw:{lat:t.sw.lat,lng:t.sw.lng-360},ne:{lat:t.ne.lat,lng:t.ne.lng}};if(-180<=n.lng&&n.lng<=180){let e=Math.abs(t.ne.lng-n.lng),r=Math.abs(t.sw.lng-n.lng);if(e+r>360)return{sw:{lat:t.sw.lat,lng:-180},ne:{lat:t.ne.lat,lng:180}};if(t.sw.lng<=n.lng&&t.ne.lng<=n.lng||t.sw.lng>=n.lng&&t.ne.lng>=n.lng)return{sw:{lat:t.sw.lat,lng:n.lng-e},ne:{lat:t.ne.lat,lng:n.lng+r}}}return e.bounds}static create(t){let n=this.normalize(t),r=n.sw,i=n.ne;return new e(r.lat,r.lng,i.lat,i.lng)}static offset(t,n,r){let i=this.normalize(t),a=n*2**t.zoom,o=V(i.sw.lat,i.sw.lng,a),s=V(i.ne.lat,i.ne.lng,a),c=Math.min(o.y+r.bottom,a),l=Math.max(s.y-r.top,0),u=o.x-r.left,d=s.x+r.right;d-u>a&&(u=0,d=a),d<u&&(d=u=(s.x-o.x)/2);let f=Ue(u,c,a),p=Ue(d,l,a);return new e(f.lat,f.lng,p.lat,p.lng)}contains(e,t){return this.#e.contains(e,t)||this.#t.contains(e,t)}intersects(e){return this.#e.intersects(e)||this.#t.intersects(e)}},Ye=class{#e;#t=0;#n=Ce;#r=Ce;#i=1;#a=1;#o=3;#s=3;#c=new Set;constructor(e,t){this.#e=e,this.update(t)}update(e){this.#n=e?.pin?.fadeout?.color??.2,this.#r=e?.pin?.fadeout?.scale??.2,this.#i=e?.pin?.fadeout?.opacity??1,this.#a=this.#n<this.#r?this.#n/this.#r:1,this.#o=e?.pin?.depth??3,this.#s=this.#o}insert(e){this.#c.add(e)}clear(){this.#c.forEach(e=>e.remove()),this.#c.clear(),this.#e.updateCircles([],this.#o)}refresh(){let e=Array.from(this.#c);this.#t=e.reduce((e,t)=>Math.max(e,t.properties.dimensions.radius*2),0),this.#s=Math.max(1,this.#o-Math.log10(e.length))}draw(){let e=Array.from(this.#c),t=[];for(let n=0;n<e.length;n++){let r=e[n],i=Math.max(0,Math.min(1,this.#n*this.#o)),a=Math.max(0,Math.min(1,this.#r*this.#o)),o=Math.max(0,Math.min(1,this.#i*this.#o)),s=r.properties.style?.background??`#008800`,c=B(s,0,1),l=B(s,i,o),u=r.properties.dimensions.radius-r.properties.dimensions.stroke,d=u*(1-a),f=r.properties.style?.stroke??`#ffffff`,p=B(f,0,1),m=B(f,i,o),h=r.properties.dimensions.stroke,g=h*(1-a),_={color:{min:l,max:c},radius:{min:d,max:u},stroke:{color:{min:m,max:p},width:{min:g,max:h}},lat:r.lat,lng:r.lng,rank:r.rank,zoom:r.zoom};t.push(_)}this.#e.updateCircles(t,this.#o)}render(e,t){let n=e.zoom,r=Je.offset(e,t.size,{top:this.#t,bottom:this.#t,right:this.#t,left:this.#t});for(let e of this.#c){let t=Number.isNaN(e.zoom);if(t||=n+this.#s<e.zoom,t||=r.contains(e.lat,e.lng)===!1,t){e.setDisplayed(!1);continue}if(e.shown&&n<e.zoom){let t=(e.zoom-n)/this.#s,r=Math.max(0,1-t*this.#r),i=this.#a;e.setDisplayed(!0),e.setCollapsed(!1),e.setScale(r,i)}else e.setCollapsed(!0),e.getCollapsed()&&e.setDisplayed(!1)}}},Xe=class{#e=0;#t=0;#n=1;#r=new Set;constructor(e,t){this.update(t)}update(e){this.#n=e?.tooltip?.depth??1}insert(e){this.#r.add(e)}clear(){this.#r.forEach(e=>e.remove()),this.#r.clear()}refresh(){let e=Array.from(this.#r).map(e=>e.properties.dimensions);this.#e=e.reduce((e,t)=>Math.max(e,t.width+2*t.padding),0),this.#t=e.reduce((e,t)=>Math.max(e,t.height+2*t.padding),0)}render(e,t){let n=e.zoom,r=Je.offset(e,t.size,{top:this.#t,bottom:this.#t,right:this.#e,left:this.#e});for(let e of this.#r){let t=Number.isNaN(e.zoom);if(t||=n+this.#n<e.zoom,t||=r.contains(e.lat,e.lng)===!1,t){e.setDisplayed(!1);continue}if(e.shown&&e.zoom<=n){let t=e.findAngle(n);e.setDisplayed(!0),e.setCollapsed(!1),e.setAngle(t)}else e.setCollapsed(!0),e.getCollapsed()&&(e.setDisplayed(!1),e.setAngle(NaN))}}},Ze=class{#e;#t=!0;#n={top:0,bottom:0,left:0,right:0};#r=new Set;constructor(e,t){this.#e=e,this.update(t)}update(e){this.#t=e?.popup?.pan?.enabled??this.#t,this.#n={top:e?.popup?.pan?.padding?.top??this.#n.top,bottom:e?.popup?.pan?.padding?.bottom??this.#n.bottom,left:e?.popup?.pan?.padding?.left??this.#n.left,right:e?.popup?.pan?.padding?.right??this.#n.right}}insert(e){this.#r.add(e)}clear(){this.#r.forEach(e=>e.remove()),this.#r.clear()}show(e){if(!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!1,e.tooltip.shown=!1,e.popup.angle=e.tooltip.angle,e.popup.shown=!0,this.#t===!1))return;let t=this.#e.getViewport(),n=this.#e.getParameters().size,r=t.bounds,i=t.zoom,a=e.popup,o=n*2**i,s=V(r.sw.lat,r.ne.lng,o),c=V(r.ne.lat,r.sw.lng,o),l={x:c.x+this.#n.left,y:c.y+this.#n.top},u={x:s.x-this.#n.right,y:s.y-this.#n.bottom},d=u.x-l.x,f=u.y-l.y,p=a.properties.dimensions,m=p.width+p.padding*8,h=p.height+p.padding*8,g=V(a.lat,a.lng,o),_=R(m,h,e.tooltip.angle),v=g.x+_.x,y=v+m,b=g.y+_.y,x=b+h,S=v-l.x,C=u.x-y,w=b-l.y,T=u.y-x,E=0;d<m?E=(S-C)/2:(S<0&&(E=S),C<0&&(E=-C));let D=0;f<h?D=(w-T)/2:(w<0&&(D=w),T<0&&(D=-T)),(E!==0||D!==0)&&this.#e.panBy(E,D)}hide(e){!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}render(){for(let e of this.#r)e.shown?(e.setDisplayed(!0),e.setCollapsed(!1),e.setAngle(e.angle)):(e.setCollapsed(!0),e.getCollapsed()&&(e.setDisplayed(!1),e.setAngle(NaN)))}},Qe=class{#e;#t;#n;#r;constructor(e,t){this.#e=new Ye(e,t),this.#t=new Xe(e,t),this.#n=new Ze(e,t),this.#r=[]}update(e){this.#e.update(e),this.#t.update(e),this.#n.update(e)}insertElements(e){if(e.length!==0){for(let t=0;t<e.length;t++){let n=e[t].element;this.#r.push(n),this.#e.insert(n.pin),this.#t.insert(n.tooltip),n.popup!==void 0&&this.#n.insert(n.popup)}this.#e.refresh(),this.#t.refresh(),this.#e.draw()}}refreshElements(){this.#e.draw()}renderElements(e,t){this.#n.render(),this.#t.render(e,t),this.#e.render(e,t)}clearElements(){this.#r=[],this.#e.clear(),this.#t.clear(),this.#n.clear()}showPopup(e){for(let t=0;t<this.#r.length;t++){let n=this.#r[t];n.id===e?this.#n.show(n):this.#n.hide(n)}}hidePopup(){for(let e=0;e<this.#r.length;e++){let t=this.#r[e];this.#n.hide(t)}}},U=14097894508562428199n,W=13011662864482103923n,G=11160318154034397263n,$e=14504361325974414679n,K=18446744073709551615n;function q(e){return e&K}function J(e,t){return t===0?e&K:(e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K)}function et(e,t){return e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K}function Y(e){return q(e^e>>47n)}function X(e,t=0){let n=0n;for(let r=0;r<8;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&K}function tt(e,t=0){let n=0n;for(let r=0;r<4;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&4294967295n}function nt(e){let t=11376068507788127593n,n=(e.first^e.second)*t&K;n^=n>>47n,n&=K;let r=(e.second^n)*t&K;return r^=r>>47n,r=r*t&K,r}function Z(e,t){return nt({first:e,second:t})}function rt(e){let t=e.length;if(t>8){let n=X(e),r=X(e,t-8);return(Z(n,et(r+BigInt(t)&K,t))^r)&K}if(t>=4){let n=tt(e);return Z(BigInt(t)+(n<<3n)&K,tt(e,t-4))}if(t>0){let n=BigInt(e[0]),r=BigInt(e[t>>1]),i=BigInt(e[t-1]),a=q(n+(r<<8n)),o=q(BigInt(t)+(i<<2n));return q(Y(q(a*G)^q(o*$e))*G)}return G}function it(e){let t=e.length,n=q(X(e)*W),r=X(e,8),i=q(X(e,t-8)*G),a=q(X(e,t-16)*U);return Z(q(J(q(n-r),43)+J(i,30)+a),q(n+J(r^$e,20)-i+BigInt(t)))}function at(e,t,n,r,i,a){i=q(i+e),a=J(q(a+i+r),21);let o=i;return i=q(i+t),i=q(i+n),a=q(a+J(i,44)),{first:q(i+r),second:q(a+o)}}function Q(e,t,n,r){return at(X(e,t),X(e,t+8),X(e,t+16),X(e,t+24),n,r)}function ot(e){let t=e.length,n=X(e,24),r=q(X(e)+q((BigInt(t)+X(e,t-16))*U)),i=J(q(r+n),52),a=J(r,37);r=q(r+X(e,8)),a=q(a+J(r,7)),r=q(r+X(e,16));let o=q(r+n),s=q(i+J(r,31)+a);r=q(X(e,16)+X(e,t-32));let c=X(e,t-8);i=J(q(r+c),52),a=J(r,37),r=q(r+X(e,t-24)),a=q(a+J(r,7)),r=q(r+X(e,t-16));let l=q(r+c);return q(Y(q(Y(q(q(o+q(i+J(r,31)+a))*G+q(l+s)*U))*U+s))*G)}function st(e){let t;t=typeof e==`string`?new TextEncoder().encode(e):e;let n=t.length;if(n<=32)return n<=16?rt(t):it(t);if(n<=64)return ot(t);let r=X(t),i=q(X(t,n-16)^W),a=q(X(t,n-56)^U),o=Q(t,n-64,BigInt(n),i),s=Q(t,n-32,q(BigInt(n)*W),U);a=q(a+Y(o.second)*W),r=q(J(q(a+r),39)*W),i=q(J(i,33)*W);let c=n-1&-64,l=0;for(;c>0;)r=q(J(q(r+i+o.first+X(t,l+16)),37)*W),i=q(J(q(i+o.second+X(t,l+48)),42)*W),r^=s.second,i^=o.first,a=J(a^s.first,33),o=Q(t,l,q(o.second*W),q(r+s.first)),s=Q(t,l+32,q(a+s.second),i),[a,r]=[r,a],l+=64,c-=64;return Z(Z(o.first,s.first)+q(Y(i)*W)+a,Z(o.second,s.second)+r)}function ct(e){return st(e).toString()}var lt=class{#e;#t;#n=0;constructor(e){this.#e=e,this.#t=new Map,this.#e.onmessage=this.#r.bind(this),this.#e.onerror=this.#i.bind(this)}invoke(e,...t){return new Promise((n,r)=>{let i=`${e.toString()}_${this.#n++}_${performance.now()}`,a={id:i,method:e.toString(),args:t};this.#t.set(i,{resolve:n,reject:r}),this.#e.postMessage(a)})}terminate(){this.#t.forEach(e=>e.reject(Error(`Terminated`))),this.#t.clear(),this.#e.terminate()}#r(e){let t=this.#t.get(e.data.id);if(!t)throw Error(`Unknown invocation: ${e.data.id}`);e.data.error?t.reject(Error(e.data.error)):t.resolve(e.data.result),this.#t.delete(e.data.id)}#i(e){this.#t.forEach(t=>t.reject(Error(e.message))),this.#t.clear()}},ut='(function(){var e=class{#e;constructor(e){this.#e=e}listen(){self.onmessage=this.#t.bind(this)}async#t(e){let{id:t,method:n,args:r}=e.data;try{let e=this.#e[n];if(typeof e!=`function`)throw Error(`Unknown method: ${n}`);let i={id:t,result:await e(...r)};self.postMessage(i)}catch(e){let n={id:t,error:e instanceof Error?e.message:String(e)};self.postMessage(n)}}};let t=`X-Token`,n=e=>new Promise(t=>setTimeout(t,e));async function r(e,t){let r=0,i=Math.max(1,t?.retry?.times??1);for(;r<i;)try{return{data:await e(),error:null}}catch(e){if(r++,r===i){if(e instanceof Error)return(!t?.exceptions||t.exceptions.some(t=>e instanceof t)===!1)&&t?.catch?.(e),{data:null,error:e};throw t?.catch?.(e),e}else t?.retry?.delay&&await n(t.retry.delay)}throw Error(`Unreachable code`)}let i=[0,30,60,90,120,150,180,210,240,270,300,330],a=1e6;function o(e){let t=new ArrayBuffer(4+e.items.length*16),n=new DataView(t);n.setUint8(0,e.parameters.size/256),n.setUint8(1,e.parameters.zoom.min),n.setUint8(2,e.parameters.zoom.max),n.setUint8(3,e.parameters.zoom.scale);let r=e.items.length,i=e.items,o=4;for(let e=0;e<r;e++){let t=i[e];n.setUint32(o+0,t.rank,!0),n.setInt32(o+4,Math.round(t.lat*a),!0),n.setInt32(o+8,Math.round(t.lng*a),!0),n.setUint16(o+12,Math.round(t.width*100),!0),n.setUint16(o+14,Math.round(t.height*100),!0),o+=16}return t}function s(e){let t=new DataView(e),n=t.getUint32(0,!0),r=0;r+=4;let a=Array(n);for(let e=0;e<n;e++){let n=t.getUint8(r)/5,o=t.getUint8(r+1),s=Array(o);r+=2;for(let e=0;e<o;e++){let n=t.getUint8(r)/5,a=t.getUint8(r+1);r+=2,s[e]={zoom:n,angle:i[a]}}a[e]={zoom:n,directions:s}}return a}new e({async fetch(e){let n=o(e.input),i=self.location.host.startsWith(`localhost`)||self.location.host.startsWith(`127.0.0.1`),a=await r(async()=>await fetch(`https://4.1.api.maps.arenarium.dev/states`,{method:`POST`,headers:{"X-Version":`1.5.2`,"X-Key":e.key,[t]:e.jwt,"Cache-Control":i?`no-cache`:``,"Content-Type":`application/octet-stream`},body:n}),{retry:{times:3,delay:500}});if(a.error)throw a.error;let c=a.data;if(!c.ok)throw Error(await c.text());return{jwt:c.headers.get(t)??``,output:s(await c.arrayBuffer())}}}).listen()})();',dt=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,ut],{type:`text/javascript;charset=utf-8`});function ft(e){let t;try{if(t=dt&&(self.URL||self.webkitURL).createObjectURL(dt),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(ut),{name:e?.name})}}var pt=class{#e;#t;#n;#r;#i;#a;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=new Map,this.#r=n?.states?.cache?.enabled??!0,this.#i=new ft,this.#a=new lt(this.#i)}update(e){this.#r=e?.states?.cache?.enabled??!0}clearStates(){this.#n.clear()}async updateStates(e,t){if(t.length===0)return;if(t.length===1){t[0].update({zoom:0,directions:[{zoom:0,angle:270}]});return}t.sort((e,t)=>e.info.id.localeCompare(t.info.id));let n=this.getStatesInputs(t),r=ct(JSON.stringify(n)),i;if(this.#r&&(i=this.#n.get(r)),i===void 0){let t=await this.getStatesResult(e,n);t.jwt&&(this.#t=t.jwt),i=t.output}this.#r&&this.#n.set(r,i);for(let e=0;e<t.length;e++){let n=t[e],r=i[e];n.update(r)}}getStatesInputs(e){return e.map(e=>{let t=e.info,n=e.properties.tooltip.dimensions;return{lat:t.lat,lng:t.lng,rank:t.rank,width:n.width+2*n.padding,height:n.height+2*n.padding}})}async getStatesResult(e,t){let n={key:this.#e,jwt:this.#t,input:{parameters:e,items:t}};return await this.#a.invoke(`fetch`,n)}},$=`1.5.2`,mt=`https://4.1.api.maps.arenarium.dev/auth`,ht=`https://4.1.api.maps.arenarium.dev/log`,gt=class t extends xe{#e;#t;#n;#r;#i;#a;#o;constructor(e,t,n,r){super(),N(fe,e),N(pe,t),this.#e=e,this.#t=n,this.#n=new He(this.#t,this.#l.bind(this),this.#g.bind(this),this.#p.bind(this),this.#m.bind(this),this.#h.bind(this)),this.#r=new Map,this.#i=new Oe(this.#y.bind(this)),this.#a=new Qe(n,r),this.#o=new pt(e,t,r)}static async create(e,n,r){return await t.#s(e,n,r)}update(e){this.#f(e)}clear(){this.#d()}async updateMarkers(e){await this.#b(e)}async removeMarkers(){await this.#x()}showTooltip(e){this.#S(e)}showPopup(e){this.#C(e)}hidePopup(){this.#w()}static async#s(n,i,a){let o=await r(mt,{key:n},{headers:{[e]:$}});this.#c($,o.version)&&console.warn(`This version of @arenarium/maps is deprecated and may not work correctly. Please upgrade to the latest version.`);let s=o.jwt;if(!s)throw Error(`Failed to get api jwt`);return new t(n,s,i,a)}static#c(e,t){if(!t)return!1;let n=t.split(`.`),r=e.split(`.`);if(n.length!==r.length)return!0;let i=Number.parseInt(n.join(``)),a=Number.parseInt(r.join(``));return Number.isNaN(i)||Number.isNaN(a)?!1:a<i}#l(){return this.#t.getContainer().parentElement===null}#u(t,n){if(n instanceof Error){console.error(n);try{i(ht,{level:ue.Error,source:de.Library,title:t,content:{version:$,key:this.#e,name:n.name,message:n.message,cause:n.cause,stack:n.stack}},{headers:{[e]:$}})}catch(e){console.error(e)}}}#d(){this.#n.stop(),this.#i.stop(),this.#r.clear(),this.#o.clearStates(),this.#a.clearElements()}#f(e){this.#o.update(e),this.#a.update(e)}#p(){this.#i.run()}#m(){this.#i.run()}#h(){this.#w()}#g(e,t){this.#d(),this.#u(e,t)}#_(e){let t=[],n=this.#t.getContainer(),r=e=>{let t=document.createElement(`div`);t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.width=`max-content`,t.style.zIndex=`-1`;try{return t.appendChild(e),n.appendChild(t),t.getBoundingClientRect()}finally{n.removeChild(t)}},i=(e,t)=>{if(t)return t;if(e){let t=r(e),n=t.width,i=t.height;return{radius:Math.max(n,i)/2,stroke:2}}else return{radius:8,stroke:2}},a=(e,t)=>{if(t)return t;let n=r(e),i=be(n.width),a=be(n.height);return{width:i,height:a,padding:Math.min(Math.round(Math.min(i,a)/4),8)}};for(let n=0;n<e.length;n++){let r=e[n],o={id:r.id,rank:r.rank,lat:I(r.lat),lng:I(r.lng)},s={initialize:r.pin?.initialize,content:r.pin?.element,style:r.pin?.style,dimensions:i(r.pin?.element,r.pin?.dimensions)},c={initialize:r.tooltip.initialize,content:r.tooltip.element,style:r.tooltip.style,dimensions:a(r.tooltip.element,r.tooltip.dimensions)},l;r.popup&&(l={initialize:r.popup.initialize,content:r.popup.element,style:r.popup.style,dimensions:a(r.popup.element,r.popup.dimensions)},r.tooltip.element.addEventListener(`click`,e=>{e.stopPropagation(),this.#C(r.id)}));let u=new ze(this.#t,o,s,c,l);t.push(u)}return t}#v(e){N(ve,e);let t=new Set;for(let n of e){if(t.has(n.id))throw Error(`Two or more markers have the same id`);t.add(n.id)}let n=new Set;for(let t of e){let e=`${I(t.lat)},${I(t.lng)}`;if(n.has(e))throw Error(`Two or more markers have the same coordinates`);n.add(e)}}#y(){try{if(this.#l())return!0;let e=this.#t.getParameters(),t=this.#t.getViewport();return this.#a.renderElements(t,e),!1}catch(e){return this.#d(),this.#u(`Failed to render markers`,e),!0}}async#b(e){this.#v(e);try{let t=[];for(let n=0;n<e.length;n++){let r=e[n];this.#r.has(r.id)||t.push(r)}let n=this.#_(t);for(let e=0;e<n.length;e++){let t=n[e];this.#r.set(t.info.id,t)}this.#a.insertElements(n),this.#i.run();let r=this.#t.getParameters(),i=Array.from(this.#r.values());await this.#o.updateStates(r,i),this.#a.refreshElements(),this.#i.run(),this.#n.start()}catch(e){throw this.#d(),this.#u(`Failed to update markers`,e),e}}async#x(){try{this.#r.clear(),this.#a.clearElements()}catch(e){throw this.#u(`Failed to remove markers`,e),e}}#S(e){if(!this.#l())try{let t=this.#r.get(e);if(!t)return;let n=t.info.lat,r=t.info.lng,i=t.state?.zoom;if(!i)return;this.#t.moveTo(n,r,i)}catch(e){throw this.#u(`Failed to show tooltip`,e),e}}#C(e){if(!this.#l())try{this.#a.showPopup(e)}catch(e){throw this.#a.hidePopup(),this.#u(`Failed to show popup`,e),e}finally{this.#i.run()}}#w(){if(!this.#l())try{this.#a.hidePopup()}catch(e){throw this.#u(`Failed to hide popup`,e),e}finally{this.#i.run()}}};export{gt as MapManager};
|
|
1
|
+
var e=`X-Version`,t=e=>new Promise(t=>setTimeout(t,e));async function n(e,n){let r=0,i=Math.max(1,n?.retry?.times??1);for(;r<i;)try{return{data:await e(),error:null}}catch(e){if(r++,r===i){if(e instanceof Error)return(!n?.exceptions||n.exceptions.some(t=>e instanceof t)===!1)&&n?.catch?.(e),{data:null,error:e};throw n?.catch?.(e),e}else n?.retry?.delay&&await t(n.retry.delay)}throw Error(`Unreachable code`)}async function r(e,t,r,i,a){let o=await n(async()=>await fetch(e,{...r,headers:{"Content-Type":`application/json`,...r?.headers},method:`POST`,body:t?JSON.stringify(t):void 0}),{retry:{times:i,delay:a}});if(o.error)throw o.error;let s=o.data;if(!s.ok)throw Error(await s.text());return await s.json()}async function i(e,t,r,i,a){let o=await n(async()=>await fetch(e,{...r,headers:{"Content-Type":`application/json`,...r?.headers},method:`PUT`,body:t?JSON.stringify(t):void 0}),{retry:{times:i,delay:a}});if(o.error)throw o.error;let s=o.data;if(!s.ok)throw Error(await s.text())}var a,o={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function s(e){return!e&&!a?o:{lang:e?.lang??a?.lang,message:e?.message,abortEarly:e?.abortEarly??a?.abortEarly,abortPipeEarly:e?.abortPipeEarly??a?.abortPipeEarly}}var c;function l(e){return c?.get(e)}var u;function d(e){return u?.get(e)}var f;function p(e,t){return f?.get(e)?.get(t)}function m(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function h(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??m(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u=e.kind===`schema`,f=i?.message??e.message??p(e.reference,c.lang)??(u?d(c.lang):null)??r.message??l(c.lang);f!==void 0&&(c.message=typeof f==`function`?f(c):f),u&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}var g=new WeakMap;function _(e){let t=g.get(e);return t||(t={version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},s())}},g.set(e,t)),t}function v(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}var y=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function b(e){return{kind:`transformation`,type:`args`,reference:b,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:e},t);if(r.issues)throw new y(r.issues);return n(...r.value)},e}}}var ee=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u;function x(e,t){return{kind:`validation`,type:`check`,reference:x,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&h(this,`input`,e,t),e}}}function S(e){return{kind:`validation`,type:`hex_color`,reference:S,async:!1,expects:null,requirement:ee,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&h(this,`hex color`,e,t),e}}}function C(e,t){return{kind:`validation`,type:`length`,reference:C,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length!==this.requirement&&h(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function w(e,t){return{kind:`validation`,type:`max_value`,reference:w,async:!1,expects:`<=${e instanceof Date?e.toJSON():m(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value<=this.requirement)&&h(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():m(e.value)}),e}}}function T(e,t){return{kind:`validation`,type:`min_length`,reference:T,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&h(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function E(e,t){return{kind:`validation`,type:`min_value`,reference:E,async:!1,expects:`>=${e instanceof Date?e.toJSON():m(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>=this.requirement)&&h(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():m(e.value)}),e}}}function te(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function ne(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function re(){return{kind:`schema`,type:`any`,reference:re,expects:`any`,async:!1,get"~standard"(){return _(this)},"~run"(e){return e.typed=!0,e}}}function ie(e,t){return{kind:`schema`,type:`array`,reference:ie,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else h(this,`type`,e,t);return e}}}function ae(e){return{kind:`schema`,type:`boolean`,reference:ae,expects:`boolean`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:h(this,`type`,e,t),e}}}function oe(e,t){return{kind:`schema`,type:`custom`,reference:oe,expects:`unknown`,async:!1,check:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:h(this,`type`,e,t),e}}}function se(e,t){let n=[];for(let t in e)(`${+t}`!==t||typeof e[t]!=`string`||!Object.is(e[e[t]],+t))&&n.push(e[t]);return{kind:`schema`,type:`enum`,reference:se,expects:v(n.map(m),`|`),async:!1,enum:e,options:n,message:t,get"~standard"(){return _(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:h(this,`type`,e,t),e}}}function ce(e){return{kind:`schema`,type:`function`,reference:ce,expects:`Function`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`function`?e.typed=!0:h(this,`type`,e,t),e}}}function D(e){return{kind:`schema`,type:`number`,reference:D,expects:`number`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:h(this,`type`,e,t),e}}}function O(e,t){return{kind:`schema`,type:`object`,reference:O,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:ne(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=te(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(h(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else h(this,`type`,e,t);return e}}}function k(e,t){return{kind:`schema`,type:`optional`,reference:k,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return _(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=ne(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function A(e){return{kind:`schema`,type:`string`,reference:A,expects:`string`,async:!1,message:e,get"~standard"(){return _(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:h(this,`type`,e,t),e}}}function le(e,t){return{kind:`schema`,type:`tuple`,reference:le,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return _(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<this.items.length;r++){let i=n[r],a=this.items[r][`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else h(this,`type`,e,t);return e}}}function ue(e,t,n){let r=e[`~run`]({value:t},s(n));if(r.issues)throw new y(r.issues);return r.value}function j(...e){return{...e[0],pipe:e,get"~standard"(){return _(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}function M(e,t){return ue(e,t)}var de=function(e){return e[e.Error=0]=`Error`,e[e.Warning=1]=`Warning`,e[e.Info=2]=`Info`,e}({}),fe=function(e){return e[e.Library=0]=`Library`,e[e.Web=1]=`Web`,e[e.API=2]=`API`,e}({}),pe=j(A(),C(32)),me=j(A(),T(1)),N=oe(e=>e instanceof HTMLElement,`Must be an HTMLElement`),P=j(ce(),b(le([A(),N]))),he=j(O({radius:j(D(),E(0),w(128)),stroke:j(D(),E(0),w(128))}),x(e=>e.stroke<=e.radius,`Stroke must be less than or equal to radius`)),ge=O({background:k(j(A(),S())),stroke:k(j(A(),S())),shadow:k(A())}),_e=j(O({width:j(D(),E(1),w(655.36)),height:j(D(),E(1),w(655.36)),padding:j(D(),E(1))}),x(e=>Math.min(e.width,e.height)/e.padding>=4,`Padding must not exceed 25% of the minimum dimension (width or height)`)),ve=O({background:k(j(A(),S())),radius:k(j(D(),E(0))),filter:k(A())}),ye=ie(O({id:j(A(),T(1)),rank:j(D(),E(0),w(4294967295)),lat:j(D(),E(-90),w(90)),lng:j(D(),E(-180),w(180)),tooltip:O({element:N,style:k(ve),dimensions:k(_e),initialize:k(P)}),pin:k(O({element:k(N),style:k(ge),dimensions:k(he),initialize:k(P)})),popup:k(O({element:N,style:k(ve),dimensions:k(_e),initialize:k(P)}))})),be=1e6;function F(e){return Math.round(e*be)/be}function xe(e){return Math.round(e*100)/100}var Se=class{static create(e,t,n){throw Error(`Must override static create method!`)}},Ce=25e-5,I=.1,we=.2,Te=1e6,Ee=2e6,De=3e6,Oe=100,ke=class{#e=!1;#t=!1;#n;#r;#i;constructor(e,t){if((t??0)<0)throw Error(`Invalid interval`);this.#n=t??Oe/Math.max(4,navigator?.hardwareConcurrency??1),this.#i=e}async process(){this.#e=!1,this.#i()||!this.#e?this.stop():this.#r=window.setTimeout(this.process.bind(this),this.#n)}run(){this.#e=!0,this.#t||(this.#t=!0,this.#r=window.setTimeout(this.process.bind(this),0))}stop(){this.#e=!1,this.#t=!1,this.#r&&window.clearTimeout(this.#r),this.#r=void 0}},Ae=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){if(e.value<0||1<e.value)throw Error(`Invalid value`);this.#e=!1,this.#t=0,this.#n=0,this.#r=e.easing,this.#i=e.callback,this.#a=e.value,this.#o=e.value,this.#s=e.timespan,this.#c=!1}target(e){if(e===this.#o)return;this.#o=e,this.#c=this.#a<this.#o;let t=performance.now(),n=this.#s*Math.abs(e-this.#a);this.#t=t+n,!this.#e&&window.requestAnimationFrame(this.#l.bind(this))}set(e){this.#a=e,this.#o=e,this.#t=performance.now(),this.#e=!1,window.requestAnimationFrame(()=>this.#i(this.#r(e)))}end(){this.set(this.#o)}expired(){return performance.now()>this.#t}#l(e){if(this.#e===!1){this.#n=e,this.#e=!0,window.requestAnimationFrame(this.#l.bind(this));return}let t=e>=this.#t;t===!0&&(this.#a=this.#o);let n=this.#a===this.#o;if(n===!1){let t=(e-this.#n)/this.#s,r=this.#c?Math.min(this.#a+t,this.#o):Math.max(this.#a-t,this.#o);this.#a=r,n=r===this.#o}if(this.#i(this.#r(this.#a)),this.#n=e,t===!0||n===!0){this.#e=!1;return}window.requestAnimationFrame(this.#l.bind(this))}},je=class{#e;#t;#n;#r;#i=!1;#a=!1;#o=!0;#s=0;#c=1;#l=new Ae({value:0,timespan:75,easing:this.#u,callback:this.#d.bind(this)});constructor(e,t){let n=t.style,r=t.dimensions,i=r.radius*2,a=r.stroke,o=n?.background??`#008800`,s=n?.stroke??`#ffffff`,c=n?.shadow??`0px 2px 2px rgba(0, 0, 0, 0.5)`,l=document.createElement(`div`);l.classList.add(`arenarium-maps-component-pin`),l.style.width=`${i}px`,l.style.height=`${i}px`,l.style.borderRadius=`${i}px`,l.style.border=`solid ${a}px ${s}`,l.style.background=o,l.style.boxShadow=c,l.style.scale=`0`,l.style.filter=`brightness(${this.#f(0)})`,this.#e=e,this.#t=t.content,this.#n=t.initialize,this.#r=l}getElement(){return this.#r}setDisplayed(e){e===!0&&(this.#r&&this.#t&&this.#t.parentElement!==this.#r&&this.#r.appendChild(this.#t),this.#i===!1&&this.#n&&this.#t&&(this.#i=!0,setTimeout(this.#n.bind(this,this.#e,this.#t),0))),this.#a!==e&&(this.#a=e,this.#r.style.display=e?`flex`:`none`,this.#r.style.contentVisibility=e?`visible`:`hidden`,e===!1&&this.#l.end())}getDisplayed(){return this.#a}setCollapsed(e){this.#o!==e&&(this.#o=e,this.#l.target(this.#o?0:this.#s))}getCollapsed(){return this.#a?this.#l.expired():!0}setScale(e,t){this.#s=e,this.#c=t,this.#l.target(e)}#u(e){return e}#d(e){this.#r.style.scale=e.toString(),this.#r.style.opacity=e.toString(),this.#r.style.filter=`brightness(${this.#f(e)})`}#f(e){return 1-this.#c*(1-e)}};function L(e,t,n){if(e<=0||t<=0)return{x:0,y:0};let r=e/2,i=t/2,a=Math.sqrt(r*r+i*i),o=Math.atan(i/r)*(180/Math.PI),s=Math.PI/180*n;return n<180?n<90?n<o?{x:0,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:0}:n<180-o?{x:a*Math.cos(s)-r,y:0}:{x:-e,y:a*Math.sin(s)-i}:n<270?n<180+o?{x:-e,y:a*Math.sin(s)-i}:{x:a*Math.cos(s)-r,y:-t}:n<360-o?{x:a*Math.cos(s)-r,y:-t}:{x:0,y:a*Math.sin(s)-i}}var Me=30,Ne=class{value;target;speed;min;max;constructor(e){this.value=e.value,this.target=e.value,this.speed=0,this.min=e.min,this.max=e.max}set(e){this.value=e,this.target=e,this.speed=0}snap(){this.value=this.target,this.speed=0}frame(e,t,n,r){if(this.value===this.target)return!0;let i=this.target-this.value;if(Math.abs(i)<t)return!0;let a=i*n-this.speed*r;return this.speed+=a*e,this.value+=this.speed*e,this.value<this.min||this.value>this.max}},Pe=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){this.#e=!1,this.#t=0,this.#n=0,this.#r=e.callback,this.#i=e.stiffness,this.#a=e.damping,this.#o=e.precision,this.#s=new Ne(e.x),this.#c=new Ne(e.y)}target(e,t){if(this.#s.target==e&&this.#c.target==t)return;this.#s.target=e,this.#c.target=t;let n=performance.now(),r=Math.sqrt((e-this.#s.value)**2+(t-this.#c.value)**2),i=2*Math.sqrt(2*Math.abs(r)/this.#i);this.#n=n,this.#t=n+i,this.#e===!1&&(this.#e=!0,window.requestAnimationFrame(this.#l.bind(this)))}set(e,t){this.#s.set(e),this.#c.set(t);let n=performance.now();this.#n=n,this.#t=n,this.#e=!1,window.requestAnimationFrame(()=>this.#r(this.#s.value,this.#c.value))}end(){this.set(this.#s.target,this.#c.target)}expired(){return performance.now()>this.#t}#l(e){let t=!1,n=!1;try{if(e>=this.#t){t=!0,n=!0;return}let r=Math.min(Me,e-this.#n);t=this.#s.frame(r,this.#o,this.#i,this.#a),n=this.#c.frame(r,this.#o,this.#i,this.#a)}finally{t===!0&&this.#s.snap(),n===!0&&this.#c.snap(),this.#r(this.#s.value,this.#c.value),this.#n=e,t===!1||n===!1?window.requestAnimationFrame(this.#l.bind(this)):this.#e=!1}}},Fe=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_=!1;#v=!1;#y=!0;#b;#x=NaN;#S=!1;#C;constructor(e,t){let n=t.dimensions,r=t.style,i=n.width+2*n.padding,a=n.height+2*n.padding,o=n.padding,s=n.width,c=n.height,l=r?.background??`#ffffff`,u=Math.min(r?.radius??8,Math.min(s,c)/2),d=Math.min(1,2*u/Math.min(c,s)),f=n.width,p=n.height,m=r?.radius??0,h=n.padding*2,g=Math.min(3,.5*u),_=r?.background??`#ffffff`,v=a<i?a/i:1,y=i<a?i/a:1,b=Math.min(i,a)/2,ee=b*Math.SQRT2,x=15*Math.SQRT2,S=document.createElement(`div`);S.classList.add(`arenarium-maps-component-tooltip-element`),S.classList.add(`arenarium-maps-component-tooltip-body`),S.style.width=`${f}px`,S.style.height=`${p}px`,S.style.borderRadius=`${m}px`,S.style.opacity=`0`,this.#g=S;let C=document.createElement(`div`);C.classList.add(`arenarium-maps-component-tooltip-element`),C.classList.add(`arenarium-maps-component-tooltip-bubble`),C.style.width=`${s}px`,C.style.height=`${c}px`,C.style.borderRadius=`${u}px`,C.style.backgroundColor=`rgb(from ${l} r g b / 1)`,C.appendChild(S);let w=document.createElement(`div`);w.classList.add(`arenarium-maps-component-tooltip-element`),w.classList.add(`arenarium-maps-component-tooltip-pointer`),w.style.width=`${h}px`,w.style.height=`${h}px`,w.style.borderRadius=`${g}px`,w.style.backgroundColor=`rgb(from ${_} r g b / 1)`;let T=document.createElement(`div`);T.classList.add(`arenarium-maps-component-tooltip-element`),T.classList.add(`arenarium-maps-component-tooltip-anchor`),T.style.filter=r?.filter??`drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.5))`,T.style.scale=`0`,T.style.opacity=`0`,T.appendChild(w),T.appendChild(C),this.#e=e,this.#t=t.content,this.#n=t.initialize,this.#r=i,this.#i=a,this.#a=o,this.#o=T,this.#s=w,this.#c=v,this.#l=y,this.#d=b,this.#u=ee,this.#f=15,this.#p=x,this.#m=C,this.#h=d;let E=Math.min(4,1+3*(n.width*n.height)/65536),te=Ce/E;this.#b=new Ae({value:0,timespan:125*Math.cbrt(E),easing:this.#w,callback:this.#T.bind(this)}),this.#C=new Pe({stiffness:te,damping:2*Math.sqrt(te),precision:1,x:{value:-i/2,min:-i-i*I,max:i*I},y:{value:-a/2,min:-a-a*I,max:a*I},callback:this.#E.bind(this)})}getElement(){return this.#o}setDisplayed(e){this.#v!==e&&(this.#v=e,e===!0&&(this.#t&&this.#t.parentElement!==this.#g&&this.#g.appendChild(this.#t),this.#_===!1&&this.#n&&this.#t&&(this.#_=!0,setTimeout(this.#n.bind(this,this.#e,this.#t),0))),this.#o.style.display=e?`initial`:`none`,this.#o.style.contentVisibility=e?`visible`:`hidden`,e===!1&&(this.#b.end(),this.#C.end()))}getDisplayed(){return this.#v}setCollapsed(e){this.#y!==e&&(this.#y=e,this.#b.target(+!e))}getCollapsed(){return this.#v?this.#b.expired():!0}#w(e){return-.5*(Math.cos(Math.PI*e)-1)}#T(e){this.#o.style.opacity=`${e}`,this.#o.style.scale=`${e}`,this.#g.style.opacity=`${e}`}setAngle(e){if(Number.isNaN(e)){this.#x=NaN,this.#S=!1;return}if(this.#S===!1){this.#S=!0,this.#x=e;let t=L(this.#r,this.#i,e);this.#C.set(Math.round(t.x),Math.round(t.y));return}if(this.#x!==e){this.#x=e;let t=L(this.#r,this.#i,e);this.#C.target(Math.round(t.x),Math.round(t.y));return}}#E(e,t){let n=e+this.#r/2,r=t+this.#i/2,i=n*this.#c,a=r*this.#l,o=Math.sqrt(i*i+a*a),s=(o-this.#d)/(this.#u-this.#d),c=Math.atan2(a,i)/Math.PI*180-45,l=this.#f+s*(this.#p-this.#f),u=o<this.#d?o/this.#d:1,d=.5*((1+.5*this.#h)*s),f=e+this.#a*(1-d*(i/this.#d)),p=t+this.#a*(1-d*(a/this.#d));this.#s.style.transform=`scale(${u}) rotate(${c}deg) skew(${l}deg, ${l}deg)`,this.#m.style.transform=`translate(${Math.round(f)}px, ${Math.round(p)}px)`}},Ie=class{id;pin;tooltip;popup;constructor(e,t,n,r,i){this.id=t.id,this.pin=new Le(e,t,n),this.tooltip=new Re(e,t,r),this.popup=i?new ze(e,t,i):void 0}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove(),this.popup?.remove()}},R=class{id;lat;lng;rank;shown=!0;displayed=!1;component;marker;constructor(e,t,n){this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.rank=t.rank;let r=n.getElement(),i=document.createElement(`div`);i.appendChild(r),this.component=n,this.marker=e.createMarker({element:i,lat:t.lat,lng:t.lng,z:this.getZIndex()})}remove(){this.component.setDisplayed(!1),this.marker.remove()}setCollapsed(e){this.component.setCollapsed(e)}getCollapsed(){return this.component.getCollapsed()}getDisplayed(){return this.displayed}setDisplayed(e){this.displayed!==e&&(this.displayed=e,e?(this.component.setDisplayed(!0),this.marker.insert()):(this.component.setDisplayed(!1),this.marker.remove()))}},Le=class extends R{properties;zoom=NaN;constructor(e,t,n){let r=new je(t.id,n);super(e,t,r),this.properties=n}update(e){e?this.zoom=e.zoom:this.zoom=NaN,this.marker.update(this.getZIndex())}getZIndex(){return this.zoom===void 0||Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+Te}setScale(e,t){this.component.setScale(e,t)}},Re=class extends R{properties;zoom=NaN;angle=NaN;directions=[];constructor(e,t,n){let r=new Fe(t.id,n);super(e,t,r),this.properties=n}update(e){e?(this.zoom=e.zoom,this.directions=e.directions):(this.zoom=NaN,this.directions=[]),this.marker.update(this.getZIndex())}getZIndex(){return this.zoom===void 0||Number.isNaN(this.zoom)?this.rank:Math.round(-this.zoom*5)+Ee}findAngle(e){let t=this.directions.findLast(t=>t.zoom<=e)?.angle;if(t===void 0)throw Error(`Failed to find angle`);return t}setAngle(e){this.angle=e,this.component.setAngle(e)}},ze=class extends R{properties;angle=NaN;constructor(e,t,n){let r=new Fe(t.id,n);super(e,t,r),this.shown=!1,this.properties=n}getZIndex(){return De}setAngle(e){this.angle=e,this.component.setAngle(e)}},Be=class{info;properties;element;state;constructor(e,t,n,r,i){this.info=t,this.properties={pin:n,tooltip:r,popup:i},this.element=new Ie(e,t,n,r,i)}update(e){this.state=e,this.element.update(e)}},Ve=class{#e;#t;#n;constructor(e,t){if(t<=0)throw Error(`Invalid timeout`);this.#e=e,this.#t=t}start(){this.#n===void 0&&(this.#n=window.setInterval(this.#e,this.#t))}stop(){this.#n!==void 0&&(window.clearInterval(this.#n),this.#n=void 0)}running(){return this.#n!==void 0}},He=100,Ue=class{#e=void 0;#t=`idle`;#n;#r;#i;#a;#o;#s;#c;constructor(e,t,n,r,i,a){this.#n=e,this.#r=new Ve(this.#l.bind(this),He/Math.max(4,navigator?.hardwareConcurrency??1)),this.#i=t,this.#a=n,this.#o=r,this.#s=i,this.#c=a}#l(){try{if(this.#i()){this.#r.stop();return}let e=this.#n.getViewport(),t=this.#t,n=JSON.stringify(e)===JSON.stringify(this.#e)?`idle`:`move`;n===`move`&&this.#o(),n===`idle`&&t===`move`&&this.#s(),this.#t=n,this.#e=e}catch(e){this.#a(`Failed to process map state interval`,e)}}start(){this.#r.running()===!1&&(this.#r.start(),this.#n.getContainer().addEventListener(`click`,this.#c))}stop(){this.#r.running()===!0&&(this.#r.stop(),this.#n.getContainer().removeEventListener(`click`,this.#c))}idle(){return this.#t===`idle`}};function z(e,t,n){let r=e.replace(/^#/,``),i,a,o,s;if(r.length!==6&&r.length!==8)throw Error(`Invalid hex color: must be 6 or 8 characters`);return r.length===8?(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=parseInt(r.substring(6,8),16)):(i=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16),s=255),i=Math.round(i*(1-t)),a=Math.round(a*(1-t)),o=Math.round(o*(1-t)),s=s*n/255,i=Math.max(0,Math.min(255,i)),a=Math.max(0,Math.min(255,a)),o=Math.max(0,Math.min(255,o)),s=Math.max(0,Math.min(1,s)),`rgba(${i}, ${a}, ${o}, ${s.toFixed(2)})`}function B(e,t,n){return{x:We(t)*n,y:Ge(e)*n}}function V(e,t,n){return{lat:qe(t/n),lng:Ke(e/n)}}function We(e){return(180+e)/360}function Ge(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Ke(e){return e*360-180}function qe(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}var H=class{#e;#t;constructor(e,t,n,r){if(n<e)throw Error(`Invalid bounds: swLat: ${e}, neLat: ${n}`);if(r<t)throw Error(`Invalid bounds: swLng: ${t}, neLng: ${r}`);this.#e={lat:e,lng:t},this.#t={lat:n,lng:r}}contains(e,t){return!(e<this.#e.lat||this.#t.lat<e||t<this.#e.lng||this.#t.lng<t)}intersects(e){return!(e.ne.lat<this.#e.lat||this.#t.lat<e.sw.lat||e.ne.lng<this.#e.lng||this.#t.lng<e.sw.lng)}},Je=class e{#e;#t;constructor(e,t,n,r){if(t<180&&180<r){this.#e=new H(e,t,n,180),this.#t=new H(e,-180,n,r-360);return}if(t<-180&&-180<r){this.#e=new H(e,360+t,n,180),this.#t=new H(e,-180,n,r);return}this.#e=new H(e,t,n,r),this.#t=new H(0,0,0,0)}static normalize(e){let t=e.bounds,n=e.center;if(t.ne.lng-t.sw.lng>360)return{sw:{lat:t.sw.lat,lng:-180},ne:{lat:t.ne.lat,lng:180}};if(t.sw.lng>t.ne.lng)return t.sw.lng+t.ne.lng<0?{sw:{lat:t.sw.lat,lng:t.sw.lng},ne:{lat:t.ne.lat,lng:t.ne.lng+360}}:{sw:{lat:t.sw.lat,lng:t.sw.lng-360},ne:{lat:t.ne.lat,lng:t.ne.lng}};if(-180<=n.lng&&n.lng<=180){let e=Math.abs(t.ne.lng-n.lng),r=Math.abs(t.sw.lng-n.lng);if(e+r>360)return{sw:{lat:t.sw.lat,lng:-180},ne:{lat:t.ne.lat,lng:180}};if(t.sw.lng<=n.lng&&t.ne.lng<=n.lng||t.sw.lng>=n.lng&&t.ne.lng>=n.lng)return{sw:{lat:t.sw.lat,lng:n.lng-e},ne:{lat:t.ne.lat,lng:n.lng+r}}}return e.bounds}static create(t){let n=this.normalize(t),r=n.sw,i=n.ne;return new e(r.lat,r.lng,i.lat,i.lng)}static viewport(t,n,r){let i=this.normalize(t),a=n*2**t.zoom,o=B(i.sw.lat,i.sw.lng,a),s=B(i.ne.lat,i.ne.lng,a),c=Math.min(o.y+r.bottom,a),l=Math.max(s.y-r.top,0),u=o.x-r.left,d=s.x+r.right;d-u>a&&(u=0,d=a),d<u&&(d=u=(s.x-o.x)/2);let f=V(u,c,a),p=V(d,l,a);return new e(f.lat,f.lng,p.lat,p.lng)}static max(t,n,r){let i=n*2**t,a=r.left,o=i-r.bottom,s=i-r.right,c=r.top,l=V(a,o,i),u=V(s,c,i);return new e(l.lat,l.lng,u.lat,u.lng)}contains(e,t){return this.#e.contains(e,t)||this.#t.contains(e,t)}intersects(e){return this.#e.intersects(e)||this.#t.intersects(e)}},Ye=class{#e;#t=0;#n=we;#r=we;#i=1;#a=1;#o=3;#s=3;#c=new Set;constructor(e,t){this.#e=e,this.update(t)}update(e){this.#n=e?.pin?.fadeout?.color??.2,this.#r=e?.pin?.fadeout?.scale??.2,this.#i=e?.pin?.fadeout?.opacity??1,this.#a=this.#n<this.#r?this.#n/this.#r:1,this.#o=e?.pin?.depth??3,this.#s=this.#o}insert(e){this.#c.add(e)}clear(){this.#c.forEach(e=>e.remove()),this.#c.clear(),this.#e.updateCircles([],this.#o)}refresh(){let e=Array.from(this.#c);this.#t=e.reduce((e,t)=>Math.max(e,t.properties.dimensions.radius*2),0),this.#s=Math.max(1,this.#o-Math.log10(e.length))}draw(){let e=Array.from(this.#c),t=[];for(let n=0;n<e.length;n++){let r=e[n],i=Math.max(0,Math.min(1,this.#n*this.#o)),a=Math.max(0,Math.min(1,this.#r*this.#o)),o=Math.max(0,Math.min(1,this.#i*this.#o)),s=r.properties.style?.background??`#008800`,c=z(s,0,1),l=z(s,i,o),u=r.properties.dimensions.radius-r.properties.dimensions.stroke,d=u*(1-a),f=r.properties.style?.stroke??`#ffffff`,p=z(f,0,1),m=z(f,i,o),h=r.properties.dimensions.stroke,g=h*(1-a),_={color:{min:l,max:c},radius:{min:d,max:u},stroke:{color:{min:m,max:p},width:{min:g,max:h}},lat:r.lat,lng:r.lng,rank:r.rank,zoom:r.zoom};t.push(_)}this.#e.updateCircles(t,this.#o)}render(e,t){let n=e.zoom,r=Je.viewport(e,t.size,{top:this.#t,bottom:this.#t,right:this.#t,left:this.#t});for(let e of this.#c){let t=Number.isNaN(e.zoom);if(t||=n+this.#s<e.zoom,t||=r.contains(e.lat,e.lng)===!1,t){e.setDisplayed(!1);continue}if(e.shown&&n<e.zoom){let t=(e.zoom-n)/this.#s,r=Math.max(0,1-t*this.#r),i=this.#a;e.setDisplayed(!0),e.setCollapsed(!1),e.setScale(r,i)}else e.setCollapsed(!0),e.getCollapsed()&&e.setDisplayed(!1)}}},Xe=class{#e=0;#t=0;#n=1;#r=new Set;constructor(e,t){this.update(t)}update(e){this.#n=e?.tooltip?.depth??1}insert(e){this.#r.add(e)}clear(){this.#r.forEach(e=>e.remove()),this.#r.clear()}refresh(){let e=Array.from(this.#r).map(e=>e.properties.dimensions);this.#e=e.reduce((e,t)=>Math.max(e,t.width+2*t.padding),0),this.#t=e.reduce((e,t)=>Math.max(e,t.height+2*t.padding),0)}render(e,t){let n=e.zoom,r=Je.viewport(e,t.size,{top:this.#t,bottom:this.#t,right:this.#e,left:this.#e}),i=Je.max(e.zoom,t.size,{top:this.#t,bottom:this.#t,right:this.#e,left:this.#e});for(let e of this.#r){let t=Number.isNaN(e.zoom);if(t||=n+this.#n<e.zoom,t||=r.contains(e.lat,e.lng)===!1,t||=i.contains(e.lat,e.lng)===!1,t){e.setDisplayed(!1);continue}if(e.shown&&e.zoom<=n){let t=e.findAngle(n);e.setDisplayed(!0),e.setCollapsed(!1),e.setAngle(t)}else e.setCollapsed(!0),e.getCollapsed()&&(e.setDisplayed(!1),e.setAngle(NaN))}}},Ze=class{#e;#t=!0;#n={top:0,bottom:0,left:0,right:0};#r=new Set;constructor(e,t){this.#e=e,this.update(t)}update(e){this.#t=e?.popup?.pan?.enabled??this.#t,this.#n={top:e?.popup?.pan?.padding?.top??this.#n.top,bottom:e?.popup?.pan?.padding?.bottom??this.#n.bottom,left:e?.popup?.pan?.padding?.left??this.#n.left,right:e?.popup?.pan?.padding?.right??this.#n.right}}insert(e){this.#r.add(e)}clear(){this.#r.forEach(e=>e.remove()),this.#r.clear()}show(e){if(!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!1,e.tooltip.shown=!1,e.popup.angle=e.tooltip.angle,e.popup.shown=!0,this.#t===!1))return;let t=this.#e.getViewport(),n=this.#e.getParameters().size,r=t.bounds,i=t.zoom,a=e.popup,o=n*2**i,s=B(r.sw.lat,r.ne.lng,o),c=B(r.ne.lat,r.sw.lng,o),l={x:c.x+this.#n.left,y:c.y+this.#n.top},u={x:s.x-this.#n.right,y:s.y-this.#n.bottom},d=u.x-l.x,f=u.y-l.y,p=a.properties.dimensions,m=p.width+p.padding*8,h=p.height+p.padding*8,g=B(a.lat,a.lng,o),_=L(m,h,e.tooltip.angle),v=g.x+_.x,y=v+m,b=g.y+_.y,ee=b+h,x=v-l.x,S=u.x-y,C=b-l.y,w=u.y-ee,T=0;d<m?T=(x-S)/2:(x<0&&(T=x),S<0&&(T=-S));let E=0;f<h?E=(C-w)/2:(C<0&&(E=C),w<0&&(E=-w)),(T!==0||E!==0)&&this.#e.panBy(T,E)}hide(e){!e.popup||!e.tooltip||!e.pin||(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}render(){for(let e of this.#r)e.shown?(e.setDisplayed(!0),e.setCollapsed(!1),e.setAngle(e.angle)):(e.setCollapsed(!0),e.getCollapsed()&&(e.setDisplayed(!1),e.setAngle(NaN)))}},Qe=class{#e;#t;#n;#r;constructor(e,t){this.#e=new Ye(e,t),this.#t=new Xe(e,t),this.#n=new Ze(e,t),this.#r=[]}update(e){this.#e.update(e),this.#t.update(e),this.#n.update(e)}insertElements(e){if(e.length!==0){for(let t=0;t<e.length;t++){let n=e[t].element;this.#r.push(n),this.#e.insert(n.pin),this.#t.insert(n.tooltip),n.popup!==void 0&&this.#n.insert(n.popup)}this.#e.refresh(),this.#t.refresh(),this.#e.draw()}}refreshElements(){this.#e.draw()}renderElements(e,t){this.#n.render(),this.#t.render(e,t),this.#e.render(e,t)}clearElements(){this.#r=[],this.#e.clear(),this.#t.clear(),this.#n.clear()}showPopup(e){for(let t=0;t<this.#r.length;t++){let n=this.#r[t];n.id===e?this.#n.show(n):this.#n.hide(n)}}hidePopup(){for(let e=0;e<this.#r.length;e++){let t=this.#r[e];this.#n.hide(t)}}},U=14097894508562428199n,W=13011662864482103923n,G=11160318154034397263n,$e=14504361325974414679n,K=18446744073709551615n;function q(e){return e&K}function J(e,t){return t===0?e&K:(e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K)}function et(e,t){return e&=K,(e>>BigInt(t)|e<<BigInt(64-t))&K}function Y(e){return q(e^e>>47n)}function X(e,t=0){let n=0n;for(let r=0;r<8;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&K}function tt(e,t=0){let n=0n;for(let r=0;r<4;r++)t+r<e.length&&(n|=BigInt(e[t+r])<<BigInt(r*8));return n&4294967295n}function nt(e){let t=11376068507788127593n,n=(e.first^e.second)*t&K;n^=n>>47n,n&=K;let r=(e.second^n)*t&K;return r^=r>>47n,r=r*t&K,r}function Z(e,t){return nt({first:e,second:t})}function rt(e){let t=e.length;if(t>8){let n=X(e),r=X(e,t-8);return(Z(n,et(r+BigInt(t)&K,t))^r)&K}if(t>=4){let n=tt(e);return Z(BigInt(t)+(n<<3n)&K,tt(e,t-4))}if(t>0){let n=BigInt(e[0]),r=BigInt(e[t>>1]),i=BigInt(e[t-1]),a=q(n+(r<<8n)),o=q(BigInt(t)+(i<<2n));return q(Y(q(a*G)^q(o*$e))*G)}return G}function it(e){let t=e.length,n=q(X(e)*W),r=X(e,8),i=q(X(e,t-8)*G),a=q(X(e,t-16)*U);return Z(q(J(q(n-r),43)+J(i,30)+a),q(n+J(r^$e,20)-i+BigInt(t)))}function at(e,t,n,r,i,a){i=q(i+e),a=J(q(a+i+r),21);let o=i;return i=q(i+t),i=q(i+n),a=q(a+J(i,44)),{first:q(i+r),second:q(a+o)}}function Q(e,t,n,r){return at(X(e,t),X(e,t+8),X(e,t+16),X(e,t+24),n,r)}function ot(e){let t=e.length,n=X(e,24),r=q(X(e)+q((BigInt(t)+X(e,t-16))*U)),i=J(q(r+n),52),a=J(r,37);r=q(r+X(e,8)),a=q(a+J(r,7)),r=q(r+X(e,16));let o=q(r+n),s=q(i+J(r,31)+a);r=q(X(e,16)+X(e,t-32));let c=X(e,t-8);i=J(q(r+c),52),a=J(r,37),r=q(r+X(e,t-24)),a=q(a+J(r,7)),r=q(r+X(e,t-16));let l=q(r+c);return q(Y(q(Y(q(q(o+q(i+J(r,31)+a))*G+q(l+s)*U))*U+s))*G)}function st(e){let t;t=typeof e==`string`?new TextEncoder().encode(e):e;let n=t.length;if(n<=32)return n<=16?rt(t):it(t);if(n<=64)return ot(t);let r=X(t),i=q(X(t,n-16)^W),a=q(X(t,n-56)^U),o=Q(t,n-64,BigInt(n),i),s=Q(t,n-32,q(BigInt(n)*W),U);a=q(a+Y(o.second)*W),r=q(J(q(a+r),39)*W),i=q(J(i,33)*W);let c=n-1&-64,l=0;for(;c>0;)r=q(J(q(r+i+o.first+X(t,l+16)),37)*W),i=q(J(q(i+o.second+X(t,l+48)),42)*W),r^=s.second,i^=o.first,a=J(a^s.first,33),o=Q(t,l,q(o.second*W),q(r+s.first)),s=Q(t,l+32,q(a+s.second),i),[a,r]=[r,a],l+=64,c-=64;return Z(Z(o.first,s.first)+q(Y(i)*W)+a,Z(o.second,s.second)+r)}function ct(e){return st(e).toString()}var lt=class{#e;#t;#n=0;constructor(e){this.#e=e,this.#t=new Map,this.#e.onmessage=this.#r.bind(this),this.#e.onerror=this.#i.bind(this)}invoke(e,...t){return new Promise((n,r)=>{let i=`${e.toString()}_${this.#n++}_${performance.now()}`,a={id:i,method:e.toString(),args:t};this.#t.set(i,{resolve:n,reject:r}),this.#e.postMessage(a)})}terminate(){this.#t.forEach(e=>e.reject(Error(`Terminated`))),this.#t.clear(),this.#e.terminate()}#r(e){let t=this.#t.get(e.data.id);if(!t)throw Error(`Unknown invocation: ${e.data.id}`);e.data.error?t.reject(Error(e.data.error)):t.resolve(e.data.result),this.#t.delete(e.data.id)}#i(e){this.#t.forEach(t=>t.reject(Error(e.message))),this.#t.clear()}},ut='(function(){var e=class{#e;constructor(e){this.#e=e}listen(){self.onmessage=this.#t.bind(this)}async#t(e){let{id:t,method:n,args:r}=e.data;try{let e=this.#e[n];if(typeof e!=`function`)throw Error(`Unknown method: ${n}`);let i={id:t,result:await e(...r)};self.postMessage(i)}catch(e){let n={id:t,error:e instanceof Error?e.message:String(e)};self.postMessage(n)}}};let t=`X-Token`,n=e=>new Promise(t=>setTimeout(t,e));async function r(e,t){let r=0,i=Math.max(1,t?.retry?.times??1);for(;r<i;)try{return{data:await e(),error:null}}catch(e){if(r++,r===i){if(e instanceof Error)return(!t?.exceptions||t.exceptions.some(t=>e instanceof t)===!1)&&t?.catch?.(e),{data:null,error:e};throw t?.catch?.(e),e}else t?.retry?.delay&&await n(t.retry.delay)}throw Error(`Unreachable code`)}let i=[0,30,60,90,120,150,180,210,240,270,300,330],a=1e6;function o(e){let t=new ArrayBuffer(4+e.items.length*16),n=new DataView(t);n.setUint8(0,e.parameters.size/256),n.setUint8(1,e.parameters.zoom.min),n.setUint8(2,e.parameters.zoom.max),n.setUint8(3,e.parameters.zoom.scale);let r=e.items.length,i=e.items,o=4;for(let e=0;e<r;e++){let t=i[e];n.setUint32(o+0,t.rank,!0),n.setInt32(o+4,Math.round(t.lat*a),!0),n.setInt32(o+8,Math.round(t.lng*a),!0),n.setUint16(o+12,Math.round(t.width*100),!0),n.setUint16(o+14,Math.round(t.height*100),!0),o+=16}return t}function s(e){let t=new DataView(e),n=t.getUint32(0,!0),r=0;r+=4;let a=Array(n);for(let e=0;e<n;e++){let n=t.getUint8(r)/5,o=t.getUint8(r+1),s=Array(o);r+=2;for(let e=0;e<o;e++){let n=t.getUint8(r)/5,a=t.getUint8(r+1);r+=2,s[e]={zoom:n,angle:i[a]}}a[e]={zoom:n,directions:s}}return a}new e({async fetch(e){let n=o(e.input),i=self.location.host.startsWith(`localhost`)||self.location.host.startsWith(`127.0.0.1`),a=await r(async()=>await fetch(`https://4.1.api.maps.arenarium.dev/states`,{method:`POST`,headers:{"X-Version":`1.5.3`,"X-Key":e.key,[t]:e.jwt,"Cache-Control":i?`no-cache`:``,"Content-Type":`application/octet-stream`},body:n}),{retry:{times:3,delay:500}});if(a.error)throw a.error;let c=a.data;if(!c.ok)throw Error(await c.text());return{jwt:c.headers.get(t)??``,output:s(await c.arrayBuffer())}}}).listen()})();',dt=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,ut],{type:`text/javascript;charset=utf-8`});function ft(e){let t;try{if(t=dt&&(self.URL||self.webkitURL).createObjectURL(dt),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(ut),{name:e?.name})}}var pt=class{#e;#t;#n;#r;#i;#a;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=new Map,this.#r=n?.states?.cache?.enabled??!0,this.#i=new ft,this.#a=new lt(this.#i)}update(e){this.#r=e?.states?.cache?.enabled??!0}clearStates(){this.#n.clear()}async updateStates(e,t){if(t.length===0)return;if(t.length===1){t[0].update({zoom:0,directions:[{zoom:0,angle:270}]});return}t.sort((e,t)=>e.info.id.localeCompare(t.info.id));let n=this.getStatesInputs(t),r=ct(JSON.stringify(n)),i;if(this.#r&&(i=this.#n.get(r)),i===void 0){let t=await this.getStatesResult(e,n);t.jwt&&(this.#t=t.jwt),i=t.output}this.#r&&this.#n.set(r,i);for(let e=0;e<t.length;e++){let n=t[e],r=i[e];n.update(r)}}getStatesInputs(e){return e.map(e=>{let t=e.info,n=e.properties.tooltip.dimensions;return{lat:t.lat,lng:t.lng,rank:t.rank,width:n.width+2*n.padding,height:n.height+2*n.padding}})}async getStatesResult(e,t){let n={key:this.#e,jwt:this.#t,input:{parameters:e,items:t}};return await this.#a.invoke(`fetch`,n)}},$=`1.5.3`,mt=`https://4.1.api.maps.arenarium.dev/auth`,ht=`https://4.1.api.maps.arenarium.dev/log`,gt=class t extends Se{#e;#t;#n;#r;#i;#a;#o;constructor(e,t,n,r){super(),M(pe,e),M(me,t),this.#e=e,this.#t=n,this.#n=new Ue(this.#t,this.#l.bind(this),this.#g.bind(this),this.#p.bind(this),this.#m.bind(this),this.#h.bind(this)),this.#r=new Map,this.#i=new ke(this.#y.bind(this)),this.#a=new Qe(n,r),this.#o=new pt(e,t,r)}static async create(e,n,r){return await t.#s(e,n,r)}update(e){this.#f(e)}clear(){this.#d()}async updateMarkers(e){await this.#b(e)}async removeMarkers(){await this.#x()}showTooltip(e){this.#S(e)}showPopup(e){this.#C(e)}hidePopup(){this.#w()}static async#s(n,i,a){let o=await r(mt,{key:n},{headers:{[e]:$}});this.#c($,o.version)&&console.warn(`This version of @arenarium/maps is deprecated and may not work correctly. Please upgrade to the latest version.`);let s=o.jwt;if(!s)throw Error(`Failed to get api jwt`);return new t(n,s,i,a)}static#c(e,t){if(!t)return!1;let n=t.split(`.`),r=e.split(`.`);if(n.length!==r.length)return!0;let i=Number.parseInt(n.join(``)),a=Number.parseInt(r.join(``));return Number.isNaN(i)||Number.isNaN(a)?!1:a<i}#l(){return this.#t.getContainer().parentElement===null}#u(t,n){if(n instanceof Error){console.error(n);try{i(ht,{level:de.Error,source:fe.Library,title:t,content:{version:$,key:this.#e,name:n.name,message:n.message,cause:n.cause,stack:n.stack}},{headers:{[e]:$}})}catch(e){console.error(e)}}}#d(){this.#n.stop(),this.#i.stop(),this.#r.clear(),this.#o.clearStates(),this.#a.clearElements()}#f(e){this.#o.update(e),this.#a.update(e)}#p(){this.#i.run()}#m(){this.#i.run()}#h(){this.#w()}#g(e,t){this.#d(),this.#u(e,t)}#_(e){let t=[],n=this.#t.getContainer(),r=e=>{let t=document.createElement(`div`);t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.width=`max-content`,t.style.zIndex=`-1`;try{return t.appendChild(e),n.appendChild(t),t.getBoundingClientRect()}finally{n.removeChild(t)}},i=(e,t)=>{if(t)return t;if(e){let t=r(e),n=t.width,i=t.height;return{radius:Math.max(n,i)/2,stroke:2}}else return{radius:8,stroke:2}},a=(e,t)=>{if(t)return t;let n=r(e),i=xe(n.width),a=xe(n.height);return{width:i,height:a,padding:Math.min(Math.round(Math.min(i,a)/4),8)}};for(let n=0;n<e.length;n++){let r=e[n],o={id:r.id,rank:r.rank,lat:F(r.lat),lng:F(r.lng)},s={initialize:r.pin?.initialize,content:r.pin?.element,style:r.pin?.style,dimensions:i(r.pin?.element,r.pin?.dimensions)},c={initialize:r.tooltip.initialize,content:r.tooltip.element,style:r.tooltip.style,dimensions:a(r.tooltip.element,r.tooltip.dimensions)},l;r.popup&&(l={initialize:r.popup.initialize,content:r.popup.element,style:r.popup.style,dimensions:a(r.popup.element,r.popup.dimensions)},r.tooltip.element.addEventListener(`click`,e=>{e.stopPropagation(),this.#C(r.id)}));let u=new Be(this.#t,o,s,c,l);t.push(u)}return t}#v(e){M(ye,e);let t=new Set;for(let n of e){if(t.has(n.id))throw Error(`Two or more markers have the same id`);t.add(n.id)}let n=new Set;for(let t of e){let e=`${F(t.lat)},${F(t.lng)}`;if(n.has(e))throw Error(`Two or more markers have the same coordinates`);n.add(e)}}#y(){try{if(this.#l())return!0;let e=this.#t.getParameters(),t=this.#t.getViewport();return this.#a.renderElements(t,e),!1}catch(e){return this.#d(),this.#u(`Failed to render markers`,e),!0}}async#b(e){this.#v(e);try{let t=[];for(let n=0;n<e.length;n++){let r=e[n];this.#r.has(r.id)||t.push(r)}let n=this.#_(t);for(let e=0;e<n.length;e++){let t=n[e];this.#r.set(t.info.id,t)}this.#a.insertElements(n),this.#i.run();let r=this.#t.getParameters(),i=Array.from(this.#r.values());await this.#o.updateStates(r,i),this.#a.refreshElements(),this.#i.run(),this.#n.start()}catch(e){throw this.#d(),this.#u(`Failed to update markers`,e),e}}async#x(){try{this.#r.clear(),this.#a.clearElements()}catch(e){throw this.#u(`Failed to remove markers`,e),e}}#S(e){if(!this.#l())try{let t=this.#r.get(e);if(!t)return;let n=t.info.lat,r=t.info.lng,i=t.state?.zoom;if(!i)return;this.#t.moveTo(n,r,i)}catch(e){throw this.#u(`Failed to show tooltip`,e),e}}#C(e){if(!this.#l())try{this.#a.showPopup(e)}catch(e){throw this.#a.hidePopup(),this.#u(`Failed to show popup`,e),e}finally{this.#i.run()}}#w(){if(!this.#l())try{this.#a.hidePopup()}catch(e){throw this.#u(`Failed to hide popup`,e),e}finally{this.#i.run()}}};export{gt as MapManager};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arenarium/maps",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "arenarium",
|
|
6
6
|
"description": "Visualize complex map markers clearly. A JavaScript library for effective display of map markers, compatible with MapLibre, Mapbox, and Google Maps.",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"**/*.css"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arenarium/maps-core": "1.1.
|
|
41
|
+
"@arenarium/maps-core": "1.1.2"
|
|
42
42
|
},
|
|
43
43
|
"clean-package": {
|
|
44
44
|
"indent": 2,
|