@feltmaps/js-sdk 1.7.0-next.10 → 1.7.0-next.12
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/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/controller-bundled.d.ts +50 -29
- package/dist/{controller-Dfbw7Li5.d.cts → controller-g5AHQrRU.d.cts} +50 -29
- package/dist/{controller-Dfbw7Li5.d.ts → controller-g5AHQrRU.d.ts} +50 -29
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +59 -14
- package/dist/handler.d.ts +59 -14
- package/dist/handler.js +1 -1
- package/package.json +1 -1
|
@@ -7870,6 +7870,14 @@ interface SelectionController {
|
|
|
7870
7870
|
|
|
7871
7871
|
type ToolType = "circle" | "highlighter" | "line" | "link" | "marker" | "note" | "pin" | "polygon" | "route" | "text";
|
|
7872
7872
|
type ConfigurableToolType = Exclude<ToolType, "link">;
|
|
7873
|
+
interface ShowToolInspectorSettings {
|
|
7874
|
+
/**
|
|
7875
|
+
* Whether to show the tool inspector.
|
|
7876
|
+
*
|
|
7877
|
+
* @defaultValue `false`
|
|
7878
|
+
*/
|
|
7879
|
+
showInspector: boolean;
|
|
7880
|
+
}
|
|
7873
7881
|
declare const PinToolSettingsSchema: z.ZodObject<{
|
|
7874
7882
|
symbol: z.ZodString;
|
|
7875
7883
|
color: z.ZodString;
|
|
@@ -7886,7 +7894,7 @@ declare const PinToolSettingsSchema: z.ZodObject<{
|
|
|
7886
7894
|
frame: "frame-circle" | "frame-square" | null;
|
|
7887
7895
|
afterCreation: "enter name" | "add another" | "select";
|
|
7888
7896
|
}>;
|
|
7889
|
-
interface PinToolSettings extends zInfer<typeof PinToolSettingsSchema
|
|
7897
|
+
interface PinToolSettings extends zInfer<typeof PinToolSettingsSchema>, ShowToolInspectorSettings {
|
|
7890
7898
|
symbol: PlaceSymbol;
|
|
7891
7899
|
/**
|
|
7892
7900
|
* What to do after creating the Place element.
|
|
@@ -7918,7 +7926,7 @@ declare const LineToolSettingsSchema: z.ZodObject<{
|
|
|
7918
7926
|
strokeStyle: "solid" | "dashed" | "dotted";
|
|
7919
7927
|
distanceMarker: boolean;
|
|
7920
7928
|
}>;
|
|
7921
|
-
interface LineToolSettings extends zInfer<typeof LineToolSettingsSchema
|
|
7929
|
+
interface LineToolSettings extends zInfer<typeof LineToolSettingsSchema>, ShowToolInspectorSettings {
|
|
7922
7930
|
}
|
|
7923
7931
|
declare const RouteToolSettingsSchema: z.ZodObject<{
|
|
7924
7932
|
color: z.ZodString;
|
|
@@ -7945,7 +7953,7 @@ declare const RouteToolSettingsSchema: z.ZodObject<{
|
|
|
7945
7953
|
routingMode: "driving" | "cycling" | "walking" | "flying" | null;
|
|
7946
7954
|
endCaps: boolean;
|
|
7947
7955
|
}>;
|
|
7948
|
-
interface RouteToolSettings extends zInfer<typeof RouteToolSettingsSchema
|
|
7956
|
+
interface RouteToolSettings extends zInfer<typeof RouteToolSettingsSchema>, ShowToolInspectorSettings {
|
|
7949
7957
|
}
|
|
7950
7958
|
declare const PolygonToolSettingsSchema: z.ZodObject<{
|
|
7951
7959
|
color: z.ZodString;
|
|
@@ -7969,7 +7977,7 @@ declare const PolygonToolSettingsSchema: z.ZodObject<{
|
|
|
7969
7977
|
fillOpacity: number;
|
|
7970
7978
|
areaMarker: boolean;
|
|
7971
7979
|
}>;
|
|
7972
|
-
interface PolygonToolSettings extends zInfer<typeof PolygonToolSettingsSchema
|
|
7980
|
+
interface PolygonToolSettings extends zInfer<typeof PolygonToolSettingsSchema>, ShowToolInspectorSettings {
|
|
7973
7981
|
}
|
|
7974
7982
|
declare const CircleToolSettingsSchema: z.ZodObject<{
|
|
7975
7983
|
color: z.ZodString;
|
|
@@ -7993,7 +8001,7 @@ declare const CircleToolSettingsSchema: z.ZodObject<{
|
|
|
7993
8001
|
fillOpacity: number;
|
|
7994
8002
|
radiusMarker: boolean;
|
|
7995
8003
|
}>;
|
|
7996
|
-
interface CircleToolSettings extends zInfer<typeof CircleToolSettingsSchema
|
|
8004
|
+
interface CircleToolSettings extends zInfer<typeof CircleToolSettingsSchema>, ShowToolInspectorSettings {
|
|
7997
8005
|
}
|
|
7998
8006
|
declare const MarkerToolSettingsSchema: z.ZodObject<{
|
|
7999
8007
|
color: z.ZodString;
|
|
@@ -8008,7 +8016,7 @@ declare const MarkerToolSettingsSchema: z.ZodObject<{
|
|
|
8008
8016
|
opacity: number;
|
|
8009
8017
|
size: number;
|
|
8010
8018
|
}>;
|
|
8011
|
-
interface MarkerToolSettings extends zInfer<typeof MarkerToolSettingsSchema
|
|
8019
|
+
interface MarkerToolSettings extends zInfer<typeof MarkerToolSettingsSchema>, ShowToolInspectorSettings {
|
|
8012
8020
|
}
|
|
8013
8021
|
declare const HighlighterToolSettingsSchema: z.ZodObject<{
|
|
8014
8022
|
color: z.ZodString;
|
|
@@ -8026,7 +8034,7 @@ declare const HighlighterToolSettingsSchema: z.ZodObject<{
|
|
|
8026
8034
|
size: number;
|
|
8027
8035
|
renderHoles: boolean;
|
|
8028
8036
|
}>;
|
|
8029
|
-
interface HighlighterToolSettings extends zInfer<typeof HighlighterToolSettingsSchema
|
|
8037
|
+
interface HighlighterToolSettings extends zInfer<typeof HighlighterToolSettingsSchema>, ShowToolInspectorSettings {
|
|
8030
8038
|
}
|
|
8031
8039
|
declare const TextToolSettingsSchema: z.ZodObject<{
|
|
8032
8040
|
color: z.ZodString;
|
|
@@ -8041,7 +8049,7 @@ declare const TextToolSettingsSchema: z.ZodObject<{
|
|
|
8041
8049
|
align: "center" | "left" | "right";
|
|
8042
8050
|
style: "italic" | "light" | "regular" | "caps";
|
|
8043
8051
|
}>;
|
|
8044
|
-
interface TextToolSettings extends zInfer<typeof TextToolSettingsSchema
|
|
8052
|
+
interface TextToolSettings extends zInfer<typeof TextToolSettingsSchema>, ShowToolInspectorSettings {
|
|
8045
8053
|
}
|
|
8046
8054
|
declare const NoteToolSettingsSchema: z.ZodObject<{
|
|
8047
8055
|
color: z.ZodString;
|
|
@@ -8056,7 +8064,7 @@ declare const NoteToolSettingsSchema: z.ZodObject<{
|
|
|
8056
8064
|
align: "center" | "left" | "right";
|
|
8057
8065
|
style: "italic" | "light" | "regular" | "caps";
|
|
8058
8066
|
}>;
|
|
8059
|
-
interface NoteToolSettings extends zInfer<typeof NoteToolSettingsSchema
|
|
8067
|
+
interface NoteToolSettings extends zInfer<typeof NoteToolSettingsSchema>, ShowToolInspectorSettings {
|
|
8060
8068
|
}
|
|
8061
8069
|
/**
|
|
8062
8070
|
* The parameters for changing the settings of each tool.
|
|
@@ -9951,7 +9959,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
9951
9959
|
placeholder?: string | undefined;
|
|
9952
9960
|
search?: boolean | undefined;
|
|
9953
9961
|
}>]>, "many">>;
|
|
9954
|
-
|
|
9962
|
+
onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
9955
9963
|
}>, "strip", z.ZodTypeAny, {
|
|
9956
9964
|
type: "Panel";
|
|
9957
9965
|
id: string;
|
|
@@ -10120,7 +10128,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
10120
10128
|
placeholder?: string | undefined;
|
|
10121
10129
|
search?: boolean | undefined;
|
|
10122
10130
|
})[] | undefined;
|
|
10123
|
-
|
|
10131
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
10124
10132
|
}, {
|
|
10125
10133
|
type: "Panel";
|
|
10126
10134
|
id: string;
|
|
@@ -10289,7 +10297,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
10289
10297
|
placeholder?: string | undefined;
|
|
10290
10298
|
search?: boolean | undefined;
|
|
10291
10299
|
})[] | undefined;
|
|
10292
|
-
|
|
10300
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
10293
10301
|
}>;
|
|
10294
10302
|
/**
|
|
10295
10303
|
* Represents a panel in the UI.
|
|
@@ -10299,7 +10307,11 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
10299
10307
|
* It can have a title, a body, a footer as well as a close button.
|
|
10300
10308
|
*
|
|
10301
10309
|
* The body and footer are arrays of UI elements and turn into vertical stacks of elements.
|
|
10302
|
-
*
|
|
10310
|
+
*
|
|
10311
|
+
* The close button is a button rendered in the top right corner of the panel that can be
|
|
10312
|
+
* used to close the panel and is only visible if `onClickClose` is provided.
|
|
10313
|
+
* Usually, you want to call {@link UiController.deletePanel} when the close button is clicked,
|
|
10314
|
+
* e.g. `onClickClose: () => felt.deletePanel("my-panel")`.
|
|
10303
10315
|
*
|
|
10304
10316
|
* #### Body
|
|
10305
10317
|
* Body is the main content of the panel. It is scrollable which means
|
|
@@ -10318,10 +10330,19 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
10318
10330
|
* body: [
|
|
10319
10331
|
* { type: "Text", text: "Hello" },
|
|
10320
10332
|
* ],
|
|
10321
|
-
* }
|
|
10333
|
+
* }
|
|
10322
10334
|
* ```
|
|
10323
10335
|
*
|
|
10324
10336
|
* @example
|
|
10337
|
+
* #### closable
|
|
10338
|
+
* ```typescript
|
|
10339
|
+
* {
|
|
10340
|
+
* id: "my-panel",
|
|
10341
|
+
* title: "My Panel",
|
|
10342
|
+
* onClickClose: () => felt.deletePanel("my-panel"),
|
|
10343
|
+
* }
|
|
10344
|
+
*
|
|
10345
|
+
* @example
|
|
10325
10346
|
* #### form
|
|
10326
10347
|
* ```typescript
|
|
10327
10348
|
* {
|
|
@@ -10337,11 +10358,11 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
10337
10358
|
* { type: "Button", label: "Save", onClick: () => alert("Save") },
|
|
10338
10359
|
* ] },
|
|
10339
10360
|
* ],
|
|
10340
|
-
* }
|
|
10361
|
+
* }
|
|
10341
10362
|
* ```
|
|
10342
10363
|
*
|
|
10343
10364
|
*/
|
|
10344
|
-
interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "
|
|
10365
|
+
interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClickClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
|
|
10345
10366
|
/**
|
|
10346
10367
|
* The elements to add to the panel body.
|
|
10347
10368
|
*/
|
|
@@ -10353,7 +10374,7 @@ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onC
|
|
|
10353
10374
|
/**
|
|
10354
10375
|
* A function to call when panel's close button is clicked.
|
|
10355
10376
|
*/
|
|
10356
|
-
|
|
10377
|
+
onClickClose?: () => void;
|
|
10357
10378
|
}
|
|
10358
10379
|
declare const uiPanelCreateSchema: {
|
|
10359
10380
|
params: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
@@ -11008,7 +11029,7 @@ declare const uiPanelCreateSchema: {
|
|
|
11008
11029
|
placeholder?: string | undefined;
|
|
11009
11030
|
search?: boolean | undefined;
|
|
11010
11031
|
}>]>, "many">>;
|
|
11011
|
-
|
|
11032
|
+
onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
11012
11033
|
}, "body" | "footer">, {
|
|
11013
11034
|
body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
11014
11035
|
onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
@@ -12036,7 +12057,7 @@ declare const uiPanelCreateSchema: {
|
|
|
12036
12057
|
placeholder?: string | undefined;
|
|
12037
12058
|
search?: boolean | undefined;
|
|
12038
12059
|
})[] | undefined;
|
|
12039
|
-
|
|
12060
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
12040
12061
|
}, {
|
|
12041
12062
|
body: ({
|
|
12042
12063
|
type: "Button";
|
|
@@ -12205,7 +12226,7 @@ declare const uiPanelCreateSchema: {
|
|
|
12205
12226
|
placeholder?: string | undefined;
|
|
12206
12227
|
search?: boolean | undefined;
|
|
12207
12228
|
})[] | undefined;
|
|
12208
|
-
|
|
12229
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
12209
12230
|
}>;
|
|
12210
12231
|
clonable: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<Omit<{
|
|
12211
12232
|
type: z.ZodOptional<z.ZodLiteral<"Panel">>;
|
|
@@ -12859,7 +12880,7 @@ declare const uiPanelCreateSchema: {
|
|
|
12859
12880
|
placeholder?: string | undefined;
|
|
12860
12881
|
search?: boolean | undefined;
|
|
12861
12882
|
}>]>, "many">>;
|
|
12862
|
-
|
|
12883
|
+
onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
12863
12884
|
}, "body" | "footer">, {
|
|
12864
12885
|
body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
12865
12886
|
onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
@@ -13727,7 +13748,7 @@ declare const uiPanelCreateSchema: {
|
|
|
13727
13748
|
onCreate: z.ZodOptional<z.ZodString>;
|
|
13728
13749
|
onDestroy: z.ZodOptional<z.ZodString>;
|
|
13729
13750
|
}>>, {
|
|
13730
|
-
|
|
13751
|
+
onClickClose: z.ZodOptional<z.ZodString>;
|
|
13731
13752
|
body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
13732
13753
|
onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
13733
13754
|
onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
@@ -15028,7 +15049,7 @@ declare const uiPanelCreateSchema: {
|
|
|
15028
15049
|
placeholder?: string | undefined;
|
|
15029
15050
|
search?: boolean | undefined;
|
|
15030
15051
|
})[] | undefined;
|
|
15031
|
-
|
|
15052
|
+
onClickClose?: string | undefined;
|
|
15032
15053
|
}, {
|
|
15033
15054
|
body: ({
|
|
15034
15055
|
type: "Button";
|
|
@@ -15181,7 +15202,7 @@ declare const uiPanelCreateSchema: {
|
|
|
15181
15202
|
placeholder?: string | undefined;
|
|
15182
15203
|
search?: boolean | undefined;
|
|
15183
15204
|
})[] | undefined;
|
|
15184
|
-
|
|
15205
|
+
onClickClose?: string | undefined;
|
|
15185
15206
|
}>;
|
|
15186
15207
|
};
|
|
15187
15208
|
/**
|
|
@@ -15976,7 +15997,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
|
|
|
15976
15997
|
placeholder?: string | undefined;
|
|
15977
15998
|
search?: boolean | undefined;
|
|
15978
15999
|
}>]>, "many">>;
|
|
15979
|
-
|
|
16000
|
+
onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
15980
16001
|
}, "body" | "footer">, {
|
|
15981
16002
|
body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
15982
16003
|
onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
@@ -17004,7 +17025,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
|
|
|
17004
17025
|
placeholder?: string | undefined;
|
|
17005
17026
|
search?: boolean | undefined;
|
|
17006
17027
|
})[] | undefined;
|
|
17007
|
-
|
|
17028
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
17008
17029
|
}, {
|
|
17009
17030
|
body: ({
|
|
17010
17031
|
type: "Button";
|
|
@@ -17173,7 +17194,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
|
|
|
17173
17194
|
placeholder?: string | undefined;
|
|
17174
17195
|
search?: boolean | undefined;
|
|
17175
17196
|
})[] | undefined;
|
|
17176
|
-
|
|
17197
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
17177
17198
|
}>;
|
|
17178
17199
|
placement: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
17179
17200
|
after: z.ZodString;
|
|
@@ -17363,7 +17384,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
|
|
|
17363
17384
|
placeholder?: string | undefined;
|
|
17364
17385
|
search?: boolean | undefined;
|
|
17365
17386
|
})[] | undefined;
|
|
17366
|
-
|
|
17387
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
17367
17388
|
};
|
|
17368
17389
|
placement?: {
|
|
17369
17390
|
after: string;
|
|
@@ -17541,7 +17562,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
|
|
|
17541
17562
|
placeholder?: string | undefined;
|
|
17542
17563
|
search?: boolean | undefined;
|
|
17543
17564
|
})[] | undefined;
|
|
17544
|
-
|
|
17565
|
+
onClickClose?: ((...args: unknown[]) => void) | undefined;
|
|
17545
17566
|
};
|
|
17546
17567
|
placement?: {
|
|
17547
17568
|
after: string;
|
package/dist/handler.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ge=Object.defineProperty;var xo=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var Eo=Object.prototype.hasOwnProperty;var Io=(r,y)=>{for(var N in y)Ge(r,N,{get:y[N],enumerable:!0})},Co=(r,y,N,Z)=>{if(y&&typeof y=="object"||typeof y=="function")for(let V of bo(y))!Eo.call(r,V)&&V!==N&&Ge(r,V,{get:()=>y[V],enumerable:!(Z=xo(y,V))||Z.enumerable});return r};var Lo=r=>Co(Ge({},"__esModule",{value:!0}),r);var Zn={};Io(Zn,{createMessageHandler:()=>An});module.exports=Lo(Zn);var d=require("zod");var I=require("zod");var P=require("zod");function e(r,y){return P.z.strictObject({type:P.z.literal(r),params:y})}function M(r,y){return P.z.strictObject({eventName:P.z.literal(r),id:P.z.string(),options:y})}function u(r){return P.z.strictObject({eventName:P.z.literal(r),id:P.z.string()})}var s=require("zod"),he=s.z.number(),fe=s.z.number(),Se=s.z.object({latitude:fe,longitude:he}),A=s.z.tuple([he,fe]),Y=s.z.object({type:s.z.literal("Polygon"),coordinates:s.z.array(s.z.array(A).min(4).refine(r=>r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1],"The last point of each ring must be identical to the first"))}),xe=s.z.object({type:s.z.literal("MultiPolygon"),coordinates:s.z.array(Y.shape.coordinates)}),Mo=s.z.object({type:s.z.literal("LineString"),coordinates:s.z.array(A).min(2)}),ee=s.z.object({type:s.z.literal("MultiLineString"),coordinates:s.z.array(Mo.shape.coordinates)}),it=s.z.number().min(1).max(23),T=s.z.tuple([he,fe,he,fe]),H=s.z.object({show:s.z.array(s.z.string()).optional(),hide:s.z.array(s.z.string()).optional()}),Uo=s.z.enum(["asc","desc"]),be=s.z.object({attribute:s.z.string(),direction:Uo});var t=require("zod");var U=t.z.object({id:t.z.string(),groupId:t.z.string().nullable(),color:t.z.string(),name:t.z.string().nullable(),description:t.z.string().nullable(),attributes:t.z.record(t.z.string(),t.z.unknown()),interaction:t.z.enum(["default","locked"]).optional()}),Ce=t.z.object({imageUrl:t.z.string().nullable()}),ke=t.z.object({strokeOpacity:t.z.number(),strokeWidth:t.z.number(),strokeStyle:t.z.enum(["solid","dashed","dotted"])}),Po=t.z.enum(["meter","kilometer","foot","mile"]),Ee=U.extend(Ce.shape).extend({type:t.z.literal("Place"),coordinates:A,symbol:t.z.string(),frame:t.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:t.z.boolean()}),te=U.extend(Ce.shape).extend(ke.shape).extend({type:t.z.literal("Path"),coordinates:ee.shape.coordinates,distanceMarker:t.z.boolean(),routingMode:t.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:t.z.boolean()}),oe=U.extend(Ce.shape).extend(ke.shape).extend({type:t.z.literal("Polygon"),coordinates:Y.shape.coordinates,fillOpacity:t.z.number().min(0).max(1),areaMarker:t.z.boolean()}),Ie=U.extend(Ce.shape).extend(ke.shape).extend({type:t.z.literal("Circle"),center:A,radius:t.z.number(),radiusMarker:t.z.boolean(),radiusDisplayAngle:t.z.number(),radiusDisplayUnit:Po.nullable(),fillOpacity:t.z.number().min(0).max(1)}),ae=U.extend({type:t.z.literal("Marker"),coordinates:ee.shape.coordinates,opacity:t.z.number().min(0).max(1),size:t.z.number().min(0).max(100),zoom:t.z.number().min(0).max(23)}),ne=U.extend({type:t.z.literal("Highlighter"),coordinates:xe.shape.coordinates,renderHoles:t.z.boolean(),opacity:t.z.number().min(0).max(1)}),lt=t.z.object({position:A,rotation:t.z.number(),scale:t.z.number(),zoom:t.z.number().min(0).max(23),text:t.z.string(),align:t.z.enum(["left","center","right"]),style:t.z.enum(["italic","light","regular","caps"]),name:t.z.string()}),ze=U.extend(lt.shape).extend({type:t.z.literal("Text")}),Fe=U.extend(lt.shape).extend({type:t.z.literal("Note"),widthScale:t.z.number().min(0)}),re=U.extend({type:t.z.literal("Image"),coordinates:ee.shape.coordinates,imageUrl:t.z.string(),opacity:t.z.number().min(0).max(1)}).omit({color:!0}),To=U.extend({type:t.z.literal("Link"),coordinates:ee.shape.coordinates,url:t.z.string()}),q={type:!0,coordinates:!0},G={id:!0},Be=Ee.partial().extend(Ee.pick(q).shape).omit(G),Le=te.partial().extend(te.pick(q).shape).omit(G),ve=oe.partial().extend(oe.pick(q).shape).omit(G),Oe=Ie.partial().extend(Ie.pick({type:!0,center:!0,radius:!0}).shape).omit(G),je=ae.partial().extend(ae.pick(q).shape).omit(G),Ve=ne.partial().extend(ne.pick(q).shape).omit(G),Ae=ze.partial().omit({...G,name:!0,type:!0}).extend({type:t.z.literal("Text"),text:t.z.string()}),we=Fe.partial().omit({...G,name:!0,type:!0}).extend({type:t.z.literal("Note"),text:t.z.string()}),Go=re.partial().extend(re.pick({...q,imageUrl:!0}).shape).omit(G),st=t.z.discriminatedUnion("type",[Be,Le,ve,Oe,je,Ve,Go,Ae,we]);var $n=te.omit({coordinates:!0}),Xn=oe.omit({coordinates:!0});var Yn=ae.omit({coordinates:!0}),er=ne.omit({coordinates:!0});var tr=re.omit({coordinates:!0}),or=To.omit({coordinates:!0}),z={type:!0,id:!0},zo=Ee.partial().extend(Ee.pick(z).shape),Fo=te.partial().extend(te.pick(z).shape),ko=oe.partial().extend(oe.pick(z).shape),Bo=Ie.partial().extend(Ie.pick(z).shape),vo=ae.partial().extend(ae.pick(z).shape),Oo=ne.partial().extend(ne.pick(z).shape),jo=ze.partial().extend(ze.pick(z).shape).omit({name:!0}),Vo=Fe.partial().extend(Fe.pick(z).shape).omit({name:!0}),Ao=re.partial().extend(re.pick(z).shape),mt=t.z.discriminatedUnion("type",[zo,Fo,ko,Bo,vo,Oo,jo,Vo,Ao]),pt=t.z.object({ids:t.z.array(t.z.string()).optional()}),ct=t.z.object({ids:t.z.array(t.z.string()).optional()});var wo=e("getElement",I.z.string()),Ro=e("getElementGeometry",I.z.string()),Do=e("getElements",pt.optional()),No=e("getElementGroup",I.z.string()),Ho=e("getElementGroups",ct.optional()),Jo=e("setElementGroupVisibility",H),Zo=M("onElementChange",I.z.object({id:I.z.string()})),qo=u("onElementCreate"),Wo=u("onElementCreateEnd"),Ko=M("onElementDelete",I.z.object({id:I.z.string()})),_o=M("onElementGroupChange",I.z.object({id:I.z.string()})),Qo=e("createElement",st),$o=e("updateElement",mt),Xo=e("deleteElement",I.z.string()),dt={methods:[wo,Ro,Do,No,Ho,Jo,Qo,$o,Xo],listeners:[Zo,qo,Wo,Ko,_o]};var Yo=u("onPointerClick"),ea=u("onPointerMove"),yt={methods:null,listeners:[Yo,ea]};var i=require("zod");var l=require("zod");var ta=l.z.enum(["in","ni"]),oa=l.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),cr=l.z.enum(["and","or"]),gt=l.z.union([l.z.number(),l.z.string(),l.z.boolean(),l.z.null()]),ut=l.z.string().or(l.z.null()),aa=l.z.tuple([ut,ta,l.z.array(gt).or(l.z.null())]),na=l.z.tuple([ut,oa,gt]),Re=l.z.union([aa,na]),De=l.z.tuple([l.z.lazy(()=>l.z.union([De,Re,l.z.null(),l.z.boolean()])),l.z.enum(["and","or"]),l.z.lazy(()=>l.z.union([De,Re,l.z.null(),l.z.boolean()]))]),F=l.z.union([De,Re,l.z.null(),l.z.boolean()]),k=l.z.union([T,Y,xe,l.z.array(A)]);var a=require("zod");var ht=a.z.enum(["avg","max","min","sum","median"]),ft=a.z.enum(["avg","max","min","sum","count"]),ra=a.z.object({method:ht,attribute:a.z.string()}),ia=a.z.object({methods:a.z.array(a.z.union([ht,a.z.literal("count")])),attribute:a.z.string().optional()}),St=a.z.object({boundary:k.optional(),filters:F.optional(),aggregation:ra.optional()}),xt=a.z.object({layerId:a.z.string(),attribute:a.z.string(),limit:a.z.number().optional(),boundary:k.optional(),filters:F.optional(),values:St.optional()}),gr=a.z.object({key:a.z.union([a.z.number(),a.z.string(),a.z.boolean()]),value:a.z.number().nullable()}),la=a.z.object({type:a.z.literal("equal-intervals"),count:a.z.number()}),sa=a.z.object({type:a.z.literal("time-interval"),interval:a.z.enum(["hour","day","week","month","year"])}),bt=a.z.object({layerId:a.z.string(),attribute:a.z.string(),steps:a.z.union([la,sa,a.z.array(a.z.number())]),boundary:k.optional(),filters:F.optional(),values:St.optional()}),ur=a.z.object({min:a.z.number(),max:a.z.number(),value:a.z.number()}),Et=a.z.object({layerId:a.z.string(),boundary:k.optional(),filters:F.optional(),aggregation:ia}),It=a.z.enum(["h3"]),ma=a.z.object({type:It,resolution:a.z.number(),method:ft.extract(["count"])}),pa=a.z.object({type:It,resolution:a.z.number(),method:ft.exclude(["count"]),attribute:a.z.string()}),ca=a.z.union([ma,pa]),Ct=a.z.object({layerId:a.z.string(),boundary:k.optional(),filters:F.optional(),gridConfig:ca});var n=require("zod");var Sr=n.z.enum(["processing","completed","failed","incomplete"]),Lt=n.z.object({type:n.z.literal("geoJsonUrl"),url:n.z.string().url(),refreshInterval:n.z.number().min(250).max(5*60*1e3).nullable().optional()}),Mt=n.z.object({type:n.z.literal("geoJsonData"),data:n.z.object({}).passthrough().or(n.z.instanceof(ArrayBuffer))}),Ut=n.z.object({type:n.z.literal("geoJsonFile"),file:n.z.instanceof(File)}),Pt=n.z.object({id:n.z.string(),style:n.z.object({}).passthrough().optional(),shownInLegend:n.z.boolean().optional(),name:n.z.string().optional(),caption:n.z.string().optional(),description:n.z.string().optional(),bounds:T.optional(),source:n.z.union([Lt,Mt,Ut]).optional()}),Tt=n.z.object({ids:n.z.array(n.z.string()).optional()}),Gt=n.z.object({ids:n.z.array(n.z.string()).optional()}),W=n.z.object({id:n.z.string(),layerId:n.z.string()}),zt=n.z.object({ids:W.array().optional(),layerIds:n.z.string().array().optional()}),Ft=n.z.object({layerIds:n.z.array(n.z.string()).optional(),areaQuery:n.z.union([n.z.object({coordinates:Se}),n.z.object({boundary:T})]).optional()}),da=n.z.object({Point:n.z.object({}).passthrough().optional(),Line:n.z.object({}).passthrough().optional(),Polygon:n.z.object({}).passthrough().optional()}),kt=n.z.object({source:n.z.union([Lt,Mt,Ut]),name:n.z.string(),bounds:T.optional(),caption:n.z.string().optional(),description:n.z.string().optional(),geometryStyles:da.optional()});var ya=e("getLayer",i.z.string()),ga=e("getLayers",Tt.optional()),ua=e("setLayerVisibility",H),ha=M("onLayerChange",i.z.object({id:i.z.string()})),fa=e("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),Sa=e("setLayerLegendVisibility",H),xa=e("createLayersFromGeoJson",kt),ba=e("updateLayer",Pt),Ea=e("deleteLayer",i.z.string()),Ia=e("getLayerGroup",i.z.string()),Ca=e("getLayerGroups",Gt.optional()),La=e("setLayerGroupVisibility",H),Ma=e("setLayerGroupLegendVisibility",H),Ua=M("onLayerGroupChange",i.z.object({id:i.z.string()})),Pa=e("getLegendItem",W),Ta=e("getLegendItems",zt.optional()),Ga=M("onLegendItemChange",W),za=e("setLegendItemVisibility",i.z.object({show:W.array().optional(),hide:W.array().optional()})),Fa=e("getLayerFilters",i.z.string()),ka=e("setLayerFilters",i.z.object({layerId:i.z.string(),filters:F,note:i.z.string().optional()})),Ba=M("onLayerFiltersChange",i.z.object({layerId:i.z.string()})),va=e("getLayerBoundaries",i.z.string()),Oa=e("setLayerBoundary",i.z.object({layerIds:i.z.array(i.z.string()),boundary:k.nullable()})),ja=M("onLayerBoundariesChange",i.z.object({layerId:i.z.string()})),Va=e("getRenderedFeatures",Ft.optional()),Aa=e("getFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),wa=e("getFeatures",i.z.object({layerId:i.z.string(),filters:F.optional(),sorting:be.optional(),boundary:k.optional(),search:i.z.string().optional(),pagination:i.z.string().optional().nullish()})),Ra=e("getGeoJsonFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Da=e("getCategoryData",xt),Na=e("getHistogramData",bt),Ha=e("getAggregates",Et),Ja=e("getPrecomputedAggregates",Ct),Za=e("getLayerSchema",i.z.string()),Bt={methods:[ya,ga,ua,fa,Sa,xa,Ea,ba,Ia,Ca,La,Ma,Pa,Ta,za,Fa,ka,va,Oa,Va,Aa,wa,Ra,Da,Na,Ha,Ja,Za],listeners:[ha,Ua,Ga,Ba,ja]};var vt=require("zod");var qa=e("getMapDetails",vt.z.undefined()),Ot={methods:[qa],listeners:[]};var ie=require("zod");var B=require("zod"),jt=B.z.object({id:B.z.string().or(B.z.number()),layerId:B.z.string(),showPopup:B.z.boolean().optional(),fitViewport:B.z.boolean().or(B.z.object({maxZoom:B.z.number()})).optional()});var Wa=e("getSelection",ie.z.undefined()),Ka=u("onSelectionChange"),_a=e("selectFeature",jt),Qa=e("clearSelection",ie.z.object({features:ie.z.boolean().optional(),elements:ie.z.boolean().optional()}).optional()),Vt={methods:[Wa,_a,Qa],listeners:[Ka]};var Nt=require("zod");var h=require("zod");var At=["circle","highlighter","line","marker","note","pin","polygon","route","text"],$a=[...At,"link"],wt=h.z.enum($a),Rt=h.z.enum(At),Xa=Be.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:h.z.enum(["enter name","add another","select"])}).required(),Ya=Le.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),en=Le.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),tn=ve.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),on=Oe.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),an=je.pick({color:!0,opacity:!0,size:!0}).required(),nn=Ve.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:h.z.number().min(0).max(200)}).required(),rn=Ae.pick({color:!0,align:!0,style:!0}).required(),ln=we.pick({color:!0,align:!0,style:!0}).required(),Dt=h.z.discriminatedUnion("tool",[Xa.partial().extend({tool:h.z.literal("pin")}),Ya.partial().extend({tool:h.z.literal("line")}),en.partial().extend({tool:h.z.literal("route")}),tn.partial().extend({tool:h.z.literal("polygon")}),on.partial().extend({tool:h.z.literal("circle")}),an.partial().extend({tool:h.z.literal("marker")}),nn.partial().extend({tool:h.z.literal("highlighter")}),rn.partial().extend({tool:h.z.literal("text")}),ln.partial().extend({tool:h.z.literal("note")})]);var sn=e("setTool",wt.nullable()),mn=e("getTool",Nt.z.undefined()),pn=u("onToolChange"),cn=e("setToolSettings",Dt),dn=e("getToolSettings",Rt),yn=u("onToolSettingsChange"),Ht={methods:[sn,mn,cn,dn],listeners:[pn,yn]};var $=require("zod");var o=require("zod");var w=require("zod"),J=w.z.union([w.z.object({after:w.z.string()}),w.z.object({before:w.z.string()}),w.z.object({at:w.z.enum(["start","end"])})]);var b=require("zod");var x=require("zod"),gn=x.z.object({onCreate:x.z.function().args().returns(x.z.void()).optional(),onDestroy:x.z.function().args().returns(x.z.void()).optional()}),un=x.z.object({onCreate:x.z.string().optional(),onDestroy:x.z.string().optional()}),g=gn.extend({id:x.z.string()}),Jt=g.partial({id:!0}),m={params:Jt,clonable:Jt.extend(un.shape)},K=g.extend({label:x.z.string().optional()}),_={params:K.extend(m.params.shape),clonable:K.extend(m.clonable.shape)};function p(r){return r.partial().extend({id:x.z.string(),type:r.shape.type})}var Ne=b.z.object({type:b.z.literal("ActionTrigger"),label:b.z.string(),disabled:b.z.boolean().optional()}),le={read:g.extend(Ne.shape).extend({onTrigger:b.z.function().returns(b.z.void())}),create:m.params.extend(Ne.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.function().returns(b.z.void())}),clonable:m.clonable.extend(Ne.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.string()})};var qt=require("zod");var He=g.extend({type:qt.z.literal("FlexibleSpace")}),Zt=He.partial({id:!0}),v={params:Zt,clonable:Zt.extend(m.clonable.shape)},Je={params:p(v.params),clonable:p(v.clonable)};var E=require("zod");var Q=require("zod");var R=require("zod");var se=g.extend({type:R.z.literal("Button"),label:R.z.string(),variant:R.z.enum(["primary","outlined","transparent","transparentThin"]).optional(),disabled:R.z.boolean().optional(),onClick:R.z.function().returns(R.z.void())}),Wt=se.extend(m.params.shape),O={params:Wt,clonable:Wt.extend(m.clonable.shape).extend({onClick:R.z.string()})},Ze={params:p(O.params),clonable:p(O.clonable)};var C=require("zod");var qe=require("zod");var me=g.extend({type:qe.z.literal("Text"),content:qe.z.string()}),Kt=me.extend(m.params.shape),j={params:Kt,clonable:Kt.extend(m.clonable.shape)},We={params:p(j.params),clonable:p(j.clonable)};var Ke=g.extend({type:C.z.literal("ButtonGroup"),align:C.z.enum(["start","end"]).optional(),items:C.z.array(C.z.union([se,me,He]))}),_t=Ke.extend(m.params.shape).omit({items:!0}).extend({items:C.z.array(C.z.union([O.params,j.params,v.params]))}),pe={params:_t,clonable:_t.extend(m.clonable.shape).extend({items:C.z.array(C.z.union([O.clonable,j.clonable,v.clonable]))})},_e={params:p(pe.params),clonable:p(pe.clonable.extend({items:C.z.array(C.z.union([O.clonable,j.clonable,v.clonable]))}))};var $t=require("zod");var Qe=g.extend({type:$t.z.literal("Divider")}),Qt=Qe.partial({id:!0}),ce={params:Qt,clonable:Qt.extend(m.clonable.shape)},$e={params:p(ce.params),clonable:p(ce.clonable)};var f=require("zod");var Xe=K.extend({type:f.z.literal("Select"),options:f.z.array(f.z.object({label:f.z.string(),value:f.z.string()})),value:f.z.string().optional(),placeholder:f.z.string().optional(),search:f.z.boolean().optional(),onChange:f.z.function().args(f.z.object({value:f.z.string()})).returns(f.z.void())}),Xt=Xe.extend(_.params.shape),de={params:Xt,clonable:Xt.extend(_.clonable.shape).extend({onChange:f.z.string()})},Ye={params:p(de.params),clonable:p(de.clonable)};var c=require("zod");var et=K.extend({type:c.z.literal("TextInput"),value:c.z.string(),placeholder:c.z.string().optional(),onChange:c.z.function().args(c.z.object({value:c.z.string()})).returns(c.z.void()).optional(),onBlur:c.z.function().args(c.z.object({value:c.z.string()})).returns(c.z.void()).optional(),onFocus:c.z.function().args(c.z.object({value:c.z.string()})).returns(c.z.void()).optional()}),Yt=et.extend(_.params.shape),ye={params:Yt,clonable:Yt.extend(_.clonable.shape).extend({onChange:c.z.string().optional(),onBlur:c.z.string().optional(),onFocus:c.z.string().optional()})},tt={params:p(ye.params),clonable:p(ye.clonable)};var ot=Q.z.discriminatedUnion("type",[se,me,Ke,Qe,et,Xe]),D={params:Q.z.discriminatedUnion("type",[O.params,j.params,pe.params,ce.params,ye.params,de.params]),clonable:Q.z.discriminatedUnion("type",[O.clonable,j.clonable,pe.clonable,ce.clonable,ye.clonable,de.clonable])},at={params:Q.z.discriminatedUnion("type",[Ze.params,We.params,_e.params,tt.params,Ye.params,Je.params,$e.params]),clonable:Q.z.discriminatedUnion("type",[Ze.clonable,We.clonable,_e.clonable,tt.clonable,Ye.clonable,Je.clonable,$e.clonable])};var hn=g.extend({type:E.z.literal("Panel"),title:E.z.string().optional(),body:E.z.array(ot),footer:E.z.array(ot).optional(),onClose:E.z.function().returns(E.z.void()).optional()}),eo=hn.extend(m.params.shape).partial({type:!0}).omit({body:!0,footer:!0}).extend({body:E.z.array(D.params),footer:E.z.array(D.params).optional()}),Me={params:eo,clonable:eo.extend(m.clonable.shape).extend({onClose:E.z.string().optional(),body:E.z.array(D.clonable),footer:E.z.array(D.clonable).optional()})};var bi=o.z.object({actionTrigger:le.create,placement:J.optional()}),to=o.z.object({actionTrigger:le.clonable,placement:J.optional()}),Ei=le.create.partial().required({id:!0}),oo=le.clonable.partial().required({id:!0}),Ii=o.z.object({panel:Me.params,placement:J.optional()}),ao=o.z.object({panel:Me.clonable,placement:J.optional()}),no=Me.clonable.partial().required({id:!0}),Ci=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:o.z.union([D.params,v.params]),container:o.z.union([o.z.literal("body"),o.z.literal("footer"),o.z.object({id:o.z.string()})]).optional(),placement:J.optional()}))}),ro=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:o.z.union([D.clonable,v.clonable]),container:o.z.union([o.z.literal("body"),o.z.literal("footer"),o.z.object({id:o.z.string()})]).optional(),placement:J.optional()}))}),Li=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:at.params}))}),io=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:at.clonable}))}),lo=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.string())}),so=o.z.object({showLegend:o.z.boolean().optional(),cooperativeGestures:o.z.boolean().optional(),fullScreenButton:o.z.boolean().optional(),geolocation:o.z.boolean().optional(),zoomControls:o.z.boolean().optional(),scaleBar:o.z.boolean().optional()}),mo=o.z.object({featureSelectPanel:o.z.boolean().optional(),featureHoverPanel:o.z.boolean().optional(),elementSelectPanel:o.z.boolean().optional(),linkClickOpen:o.z.boolean().optional(),imageLightboxOpen:o.z.boolean().optional()});var fn=e("createActionTrigger",to),Sn=e("updateActionTrigger",oo),xn=e("deleteActionTrigger",$.z.string()),bn=e("createPanel",ao),En=e("updatePanel",no),In=e("deletePanel",$.z.string()),Cn=e("createPanelElements",ro),Ln=e("updatePanelElements",io),Mn=e("deletePanelElements",lo),Un=e("updateUiControls",so),Pn=e("setOnMapInteractionsUi",mo),Tn=e("showLayerDataTable",$.z.object({layerId:$.z.string(),sorting:be.optional()}).optional()),Gn=e("hideLayerDataTable",$.z.undefined()),po={methods:[fn,Sn,xn,bn,En,In,Cn,Ln,Mn,Un,Pn,Tn,Gn],listeners:null};var nt=require("zod");var ge=require("zod");var Ue=ge.z.object({center:Se,zoom:it}),co=ge.z.object({center:Ue.shape.center.optional(),zoom:Ue.shape.zoom.optional()}),yo=ge.z.object({minZoom:Ue.shape.zoom.nullish(),maxZoom:Ue.shape.zoom.nullish(),bounds:T.nullish()}).nullable(),go=ge.z.object({bounds:T});var zn=e("getViewport",nt.z.undefined()),Fn=e("setViewport",co),kn=e("getViewportConstraints",nt.z.undefined()),Bn=e("setViewportConstraints",yo),vn=e("fitViewportToBounds",go),On=u("onViewportMove"),jn=u("onViewportMoveEnd"),Vn=u("onMapIdle"),uo={methods:[Fn,zn,kn,Bn,vn],listeners:[On,jn,Vn]};var rt=[po,uo,Bt,dt,Vt,yt,Ht,Ot];function An(r,y,N){let Z=new Map;async function V(L){if(!Hn.safeParse(L.data).success){N?.onUnknownMessage?.(L.data);return}let ue=So.safeParse(L.data);if(!ue.success){N?.onInvalidMessage?.(L.data,ue.error),L.ports[0]?.postMessage(ho(ue.error.message));return}let{data:S}=ue;if(S.type==="felt.ready")L.ports[0]?.postMessage(!0);else if(S.type==="felt.addListener"){if(S.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let X="options"in S.event?{options:"options"in S.event?S.event.options:void 0,handler:Te=>{L.ports[0]?.postMessage(Te)}}:{handler:Te=>{L.ports[0]?.postMessage(Te)}},Pe=y.listeners[S.event.eventName](X);Z.set(S.event.id,Pe)}else if(S.type==="felt.removeListener")Z.get(S.id)?.(),Z.delete(S.id);else try{let X=y.methods[S.type],Pe=await X(S.params);L.ports[0]?.postMessage(Pe)}catch(X){L.ports[0]?.postMessage(ho(X))}}return r.addEventListener("message",V),()=>{r.removeEventListener("message",V)}}var fo={methods:rt.map(r=>r.methods??[]).flat(),listeners:rt.map(r=>r.listeners??[]).flat()},wn=d.z.discriminatedUnion("eventName",[d.z.strictObject({eventName:d.z.literal("")}),d.z.strictObject({eventName:d.z.literal("onGenericEvent"),id:d.z.string(),options:d.z.object({id:d.z.string()})}),...fo.listeners]),Rn=d.z.strictObject({type:d.z.literal("felt.addListener"),event:wn}),Dn=d.z.strictObject({type:d.z.literal("felt.removeListener"),id:d.z.string()}),Nn=d.z.strictObject({type:d.z.literal("felt.ready")}),So=d.z.discriminatedUnion("type",[Nn,Rn,Dn,...fo.methods]),Hn=d.z.object({type:d.z.enum(So.options.map(r=>r.shape.type.value))});function ho(r){return{__error__:Jn(r)}}function Jn(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}0&&(module.exports={createMessageHandler});
|
|
1
|
+
"use strict";var ze=Object.defineProperty;var bo=Object.getOwnPropertyDescriptor;var Io=Object.getOwnPropertyNames;var Eo=Object.prototype.hasOwnProperty;var Co=(r,g)=>{for(var H in g)ze(r,H,{get:g[H],enumerable:!0})},Lo=(r,g,H,q)=>{if(g&&typeof g=="object"||typeof g=="function")for(let V of Io(g))!Eo.call(r,V)&&V!==H&&ze(r,V,{get:()=>g[V],enumerable:!(q=bo(g,V))||q.enumerable});return r};var Mo=r=>Lo(ze({},"__esModule",{value:!0}),r);var qa={};Co(qa,{createMessageHandler:()=>Aa});module.exports=Mo(qa);var d=require("zod");var E=require("zod");var P=require("zod");function e(r,g){return P.z.strictObject({type:P.z.literal(r),params:g})}function M(r,g){return P.z.strictObject({eventName:P.z.literal(r),id:P.z.string(),options:g})}function h(r){return P.z.strictObject({eventName:P.z.literal(r),id:P.z.string()})}var l=require("zod"),fe=l.z.number(),Se=l.z.number(),xe=l.z.object({latitude:Se,longitude:fe}),A=l.z.tuple([fe,Se]),ee=l.z.object({type:l.z.literal("Polygon"),coordinates:l.z.array(l.z.array(A).min(4).refine(r=>r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1],"The last point of each ring must be identical to the first"))}),be=l.z.object({type:l.z.literal("MultiPolygon"),coordinates:l.z.array(ee.shape.coordinates)}),Uo=l.z.object({type:l.z.literal("LineString"),coordinates:l.z.array(A).min(2)}),te=l.z.object({type:l.z.literal("MultiLineString"),coordinates:l.z.array(Uo.shape.coordinates)}),st=l.z.number().min(1).max(23),T=l.z.tuple([fe,Se,fe,Se]),J=l.z.object({show:l.z.array(l.z.string()).optional(),hide:l.z.array(l.z.string()).optional()}),Po=l.z.enum(["asc","desc"]),Ie=l.z.object({attribute:l.z.string(),direction:Po});var t=require("zod");var U=t.z.object({id:t.z.string(),groupId:t.z.string().nullable(),color:t.z.string(),name:t.z.string().nullable(),description:t.z.string().nullable(),attributes:t.z.record(t.z.string(),t.z.unknown()),interaction:t.z.enum(["default","locked"]).optional()}),Le=t.z.object({imageUrl:t.z.string().nullable()}),Be=t.z.object({strokeOpacity:t.z.number(),strokeWidth:t.z.number(),strokeStyle:t.z.enum(["solid","dashed","dotted"])}),To=t.z.enum(["meter","kilometer","foot","mile"]),Ee=U.extend(Le.shape).extend({type:t.z.literal("Place"),coordinates:A,symbol:t.z.string(),frame:t.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:t.z.boolean()}),oe=U.extend(Le.shape).extend(Be.shape).extend({type:t.z.literal("Path"),coordinates:te.shape.coordinates,distanceMarker:t.z.boolean(),routingMode:t.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:t.z.boolean()}),ne=U.extend(Le.shape).extend(Be.shape).extend({type:t.z.literal("Polygon"),coordinates:ee.shape.coordinates,fillOpacity:t.z.number().min(0).max(1),areaMarker:t.z.boolean()}),Ce=U.extend(Le.shape).extend(Be.shape).extend({type:t.z.literal("Circle"),center:A,radius:t.z.number(),radiusMarker:t.z.boolean(),radiusDisplayAngle:t.z.number(),radiusDisplayUnit:To.nullable(),fillOpacity:t.z.number().min(0).max(1)}),ae=U.extend({type:t.z.literal("Marker"),coordinates:te.shape.coordinates,opacity:t.z.number().min(0).max(1),size:t.z.number().min(0).max(100),zoom:t.z.number().min(0).max(23)}),re=U.extend({type:t.z.literal("Highlighter"),coordinates:be.shape.coordinates,renderHoles:t.z.boolean(),opacity:t.z.number().min(0).max(1)}),lt=t.z.object({position:A,rotation:t.z.number(),scale:t.z.number(),zoom:t.z.number().min(0).max(23),text:t.z.string(),align:t.z.enum(["left","center","right"]),style:t.z.enum(["italic","light","regular","caps"]),name:t.z.string()}),Fe=U.extend(lt.shape).extend({type:t.z.literal("Text")}),ke=U.extend(lt.shape).extend({type:t.z.literal("Note"),widthScale:t.z.number().min(0)}),ie=U.extend({type:t.z.literal("Image"),coordinates:te.shape.coordinates,imageUrl:t.z.string(),opacity:t.z.number().min(0).max(1)}).omit({color:!0}),Go=U.extend({type:t.z.literal("Link"),coordinates:te.shape.coordinates,url:t.z.string()}),W={type:!0,coordinates:!0},G={id:!0},ve=Ee.partial().extend(Ee.pick(W).shape).omit(G),Me=oe.partial().extend(oe.pick(W).shape).omit(G),Oe=ne.partial().extend(ne.pick(W).shape).omit(G),je=Ce.partial().extend(Ce.pick({type:!0,center:!0,radius:!0}).shape).omit(G),we=ae.partial().extend(ae.pick(W).shape).omit(G),Ve=re.partial().extend(re.pick(W).shape).omit(G),Ae=Fe.partial().omit({...G,name:!0,type:!0}).extend({type:t.z.literal("Text"),text:t.z.string()}),Re=ke.partial().omit({...G,name:!0,type:!0}).extend({type:t.z.literal("Note"),text:t.z.string()}),zo=ie.partial().extend(ie.pick({...W,imageUrl:!0}).shape).omit(G),mt=t.z.discriminatedUnion("type",[ve,Me,Oe,je,we,Ve,zo,Ae,Re]);var Xa=oe.omit({coordinates:!0}),Ya=ne.omit({coordinates:!0});var er=ae.omit({coordinates:!0}),tr=re.omit({coordinates:!0});var or=ie.omit({coordinates:!0}),nr=Go.omit({coordinates:!0}),z={type:!0,id:!0},Fo=Ee.partial().extend(Ee.pick(z).shape),ko=oe.partial().extend(oe.pick(z).shape),Bo=ne.partial().extend(ne.pick(z).shape),vo=Ce.partial().extend(Ce.pick(z).shape),Oo=ae.partial().extend(ae.pick(z).shape),jo=re.partial().extend(re.pick(z).shape),wo=Fe.partial().extend(Fe.pick(z).shape).omit({name:!0}),Vo=ke.partial().extend(ke.pick(z).shape).omit({name:!0}),Ao=ie.partial().extend(ie.pick(z).shape),pt=t.z.discriminatedUnion("type",[Fo,ko,Bo,vo,Oo,jo,wo,Vo,Ao]),ct=t.z.object({ids:t.z.array(t.z.string()).optional()}),dt=t.z.object({ids:t.z.array(t.z.string()).optional()});var Ro=e("getElement",E.z.string()),Do=e("getElementGeometry",E.z.string()),No=e("getElements",ct.optional()),Ho=e("getElementGroup",E.z.string()),Jo=e("getElementGroups",dt.optional()),Zo=e("setElementGroupVisibility",J),qo=M("onElementChange",E.z.object({id:E.z.string()})),Wo=h("onElementCreate"),Ko=h("onElementCreateEnd"),_o=M("onElementDelete",E.z.object({id:E.z.string()})),Qo=M("onElementGroupChange",E.z.object({id:E.z.string()})),$o=e("createElement",mt),Xo=e("updateElement",pt),Yo=e("deleteElement",E.z.string()),gt={methods:[Ro,Do,No,Ho,Jo,Zo,$o,Xo,Yo],listeners:[qo,Wo,Ko,_o,Qo]};var en=h("onPointerClick"),tn=h("onPointerMove"),yt={methods:null,listeners:[en,tn]};var i=require("zod");var s=require("zod");var on=s.z.enum(["in","ni"]),nn=s.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),dr=s.z.enum(["and","or"]),ut=s.z.union([s.z.number(),s.z.string(),s.z.boolean(),s.z.null()]),ht=s.z.string().or(s.z.null()),an=s.z.tuple([ht,on,s.z.array(ut).or(s.z.null())]),rn=s.z.tuple([ht,nn,ut]),De=s.z.union([an,rn]),Ne=s.z.tuple([s.z.lazy(()=>s.z.union([Ne,De,s.z.null(),s.z.boolean()])),s.z.enum(["and","or"]),s.z.lazy(()=>s.z.union([Ne,De,s.z.null(),s.z.boolean()]))]),F=s.z.union([Ne,De,s.z.null(),s.z.boolean()]),k=s.z.union([T,ee,be,s.z.array(A)]);var n=require("zod");var ft=n.z.enum(["avg","max","min","sum","median"]),St=n.z.enum(["avg","max","min","sum","count"]),sn=n.z.object({method:ft,attribute:n.z.string()}),ln=n.z.object({methods:n.z.array(n.z.union([ft,n.z.literal("count")])),attribute:n.z.string().optional()}),xt=n.z.object({boundary:k.optional(),filters:F.optional(),aggregation:sn.optional()}),bt=n.z.object({layerId:n.z.string(),attribute:n.z.string(),limit:n.z.number().optional(),boundary:k.optional(),filters:F.optional(),values:xt.optional()}),ur=n.z.object({key:n.z.union([n.z.number(),n.z.string(),n.z.boolean()]),value:n.z.number().nullable()}),mn=n.z.object({type:n.z.literal("equal-intervals"),count:n.z.number()}),pn=n.z.object({type:n.z.literal("time-interval"),interval:n.z.enum(["hour","day","week","month","year"])}),It=n.z.object({layerId:n.z.string(),attribute:n.z.string(),steps:n.z.union([mn,pn,n.z.array(n.z.number())]),boundary:k.optional(),filters:F.optional(),values:xt.optional()}),hr=n.z.object({min:n.z.number(),max:n.z.number(),value:n.z.number()}),Et=n.z.object({layerId:n.z.string(),boundary:k.optional(),filters:F.optional(),aggregation:ln}),Ct=n.z.enum(["h3"]),cn=n.z.object({type:Ct,resolution:n.z.number(),method:St.extract(["count"])}),dn=n.z.object({type:Ct,resolution:n.z.number(),method:St.exclude(["count"]),attribute:n.z.string()}),gn=n.z.union([cn,dn]),Lt=n.z.object({layerId:n.z.string(),boundary:k.optional(),filters:F.optional(),gridConfig:gn});var a=require("zod");var xr=a.z.enum(["processing","completed","failed","incomplete"]),Mt=a.z.object({type:a.z.literal("geoJsonUrl"),url:a.z.string().url(),refreshInterval:a.z.number().min(250).max(5*60*1e3).nullable().optional()}),Ut=a.z.object({type:a.z.literal("geoJsonData"),data:a.z.object({}).passthrough().or(a.z.instanceof(ArrayBuffer))}),Pt=a.z.object({type:a.z.literal("geoJsonFile"),file:a.z.instanceof(File)}),Tt=a.z.object({id:a.z.string(),style:a.z.object({}).passthrough().optional(),shownInLegend:a.z.boolean().optional(),name:a.z.string().optional(),caption:a.z.string().optional(),description:a.z.string().optional(),bounds:T.optional(),source:a.z.union([Mt,Ut,Pt]).optional()}),Gt=a.z.object({ids:a.z.array(a.z.string()).optional()}),zt=a.z.object({ids:a.z.array(a.z.string()).optional()}),K=a.z.object({id:a.z.string(),layerId:a.z.string()}),Ft=a.z.object({ids:K.array().optional(),layerIds:a.z.string().array().optional()}),kt=a.z.object({layerIds:a.z.array(a.z.string()).optional(),areaQuery:a.z.union([a.z.object({coordinates:xe}),a.z.object({boundary:T})]).optional()}),yn=a.z.object({Point:a.z.object({}).passthrough().optional(),Line:a.z.object({}).passthrough().optional(),Polygon:a.z.object({}).passthrough().optional()}),Bt=a.z.object({source:a.z.union([Mt,Ut,Pt]),name:a.z.string(),bounds:T.optional(),caption:a.z.string().optional(),description:a.z.string().optional(),geometryStyles:yn.optional()});var un=e("getLayer",i.z.string()),hn=e("getLayers",Gt.optional()),fn=e("setLayerVisibility",J),Sn=M("onLayerChange",i.z.object({id:i.z.string()})),xn=e("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),bn=e("setLayerLegendVisibility",J),In=e("createLayersFromGeoJson",Bt),En=e("updateLayer",Tt),Cn=e("deleteLayer",i.z.string()),Ln=e("getLayerGroup",i.z.string()),Mn=e("getLayerGroups",zt.optional()),Un=e("setLayerGroupVisibility",J),Pn=e("setLayerGroupLegendVisibility",J),Tn=M("onLayerGroupChange",i.z.object({id:i.z.string()})),Gn=e("getLegendItem",K),zn=e("getLegendItems",Ft.optional()),Fn=M("onLegendItemChange",K),kn=e("setLegendItemVisibility",i.z.object({show:K.array().optional(),hide:K.array().optional()})),Bn=e("getLayerFilters",i.z.string()),vn=e("setLayerFilters",i.z.object({layerId:i.z.string(),filters:F,note:i.z.string().optional()})),On=M("onLayerFiltersChange",i.z.object({layerId:i.z.string()})),jn=e("getLayerBoundaries",i.z.string()),wn=e("setLayerBoundary",i.z.object({layerIds:i.z.array(i.z.string()),boundary:k.nullable()})),Vn=M("onLayerBoundariesChange",i.z.object({layerId:i.z.string()})),An=e("getRenderedFeatures",kt.optional()),Rn=e("getFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Dn=e("getFeatures",i.z.object({layerId:i.z.string(),filters:F.optional(),sorting:Ie.optional(),boundary:k.optional(),search:i.z.string().optional(),pagination:i.z.string().optional().nullish()})),Nn=e("getGeoJsonFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Hn=e("getCategoryData",bt),Jn=e("getHistogramData",It),Zn=e("getAggregates",Et),qn=e("getPrecomputedAggregates",Lt),Wn=e("getLayerSchema",i.z.string()),vt={methods:[un,hn,fn,xn,bn,In,Cn,En,Ln,Mn,Un,Pn,Gn,zn,kn,Bn,vn,jn,wn,An,Rn,Dn,Nn,Hn,Jn,Zn,qn,Wn],listeners:[Sn,Tn,Fn,On,Vn]};var Ot=require("zod");var Kn=e("getMapDetails",Ot.z.undefined()),jt={methods:[Kn],listeners:[]};var se=require("zod");var B=require("zod"),wt=B.z.object({id:B.z.string().or(B.z.number()),layerId:B.z.string(),showPopup:B.z.boolean().optional(),fitViewport:B.z.boolean().or(B.z.object({maxZoom:B.z.number()})).optional()});var _n=e("getSelection",se.z.undefined()),Qn=h("onSelectionChange"),$n=e("selectFeature",wt),Xn=e("clearSelection",se.z.object({features:se.z.boolean().optional(),elements:se.z.boolean().optional()}).optional()),Vt={methods:[_n,$n,Xn],listeners:[Qn]};var Ht=require("zod");var y=require("zod");var At=["circle","highlighter","line","marker","note","pin","polygon","route","text"],Yn=[...At,"link"],Rt=y.z.enum(Yn),Dt=y.z.enum(At),v={showInspector:y.z.boolean().optional()},ea=ve.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:y.z.enum(["enter name","add another","select"])}).required(),ta=Me.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),oa=Me.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),na=Oe.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),aa=je.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),ra=we.pick({color:!0,opacity:!0,size:!0}).required(),ia=Ve.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:y.z.number().min(0).max(200)}).required(),sa=Ae.pick({color:!0,align:!0,style:!0}).required(),la=Re.pick({color:!0,align:!0,style:!0}).required(),Nt=y.z.discriminatedUnion("tool",[ea.partial().extend({tool:y.z.literal("pin"),...v}),ta.partial().extend({tool:y.z.literal("line"),...v}),oa.partial().extend({tool:y.z.literal("route"),...v}),na.partial().extend({tool:y.z.literal("polygon"),...v}),aa.partial().extend({tool:y.z.literal("circle"),...v}),ra.partial().extend({tool:y.z.literal("marker"),...v}),ia.partial().extend({tool:y.z.literal("highlighter"),...v}),sa.partial().extend({tool:y.z.literal("text"),...v}),la.partial().extend({tool:y.z.literal("note"),...v})]);var ma=e("setTool",Rt.nullable()),pa=e("getTool",Ht.z.undefined()),ca=h("onToolChange"),da=e("setToolSettings",Nt),ga=e("getToolSettings",Dt),ya=h("onToolSettingsChange"),Jt={methods:[ma,pa,da,ga],listeners:[ca,ya]};var X=require("zod");var o=require("zod");var R=require("zod"),Z=R.z.union([R.z.object({after:R.z.string()}),R.z.object({before:R.z.string()}),R.z.object({at:R.z.enum(["start","end"])})]);var b=require("zod");var x=require("zod"),ua=x.z.object({onCreate:x.z.function().args().returns(x.z.void()).optional(),onDestroy:x.z.function().args().returns(x.z.void()).optional()}),ha=x.z.object({onCreate:x.z.string().optional(),onDestroy:x.z.string().optional()}),u=ua.extend({id:x.z.string()}),Zt=u.partial({id:!0}),m={params:Zt,clonable:Zt.extend(ha.shape)},_=u.extend({label:x.z.string().optional()}),Q={params:_.extend(m.params.shape),clonable:_.extend(m.clonable.shape)};function p(r){return r.partial().extend({id:x.z.string(),type:r.shape.type})}var He=b.z.object({type:b.z.literal("ActionTrigger"),label:b.z.string(),disabled:b.z.boolean().optional()}),le={read:u.extend(He.shape).extend({onTrigger:b.z.function().returns(b.z.void())}),create:m.params.extend(He.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.function().returns(b.z.void())}),clonable:m.clonable.extend(He.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.string()})};var Wt=require("zod");var Je=u.extend({type:Wt.z.literal("FlexibleSpace")}),qt=Je.partial({id:!0}),O={params:qt,clonable:qt.extend(m.clonable.shape)},Ze={params:p(O.params),clonable:p(O.clonable)};var I=require("zod");var $=require("zod");var D=require("zod");var me=u.extend({type:D.z.literal("Button"),label:D.z.string(),variant:D.z.enum(["primary","outlined","transparent","transparentThin"]).optional(),disabled:D.z.boolean().optional(),onClick:D.z.function().returns(D.z.void())}),Kt=me.extend(m.params.shape),j={params:Kt,clonable:Kt.extend(m.clonable.shape).extend({onClick:D.z.string()})},qe={params:p(j.params),clonable:p(j.clonable)};var C=require("zod");var We=require("zod");var pe=u.extend({type:We.z.literal("Text"),content:We.z.string()}),_t=pe.extend(m.params.shape),w={params:_t,clonable:_t.extend(m.clonable.shape)},Ke={params:p(w.params),clonable:p(w.clonable)};var _e=u.extend({type:C.z.literal("ButtonGroup"),align:C.z.enum(["start","end"]).optional(),items:C.z.array(C.z.union([me,pe,Je]))}),Qt=_e.extend(m.params.shape).omit({items:!0}).extend({items:C.z.array(C.z.union([j.params,w.params,O.params]))}),ce={params:Qt,clonable:Qt.extend(m.clonable.shape).extend({items:C.z.array(C.z.union([j.clonable,w.clonable,O.clonable]))})},Qe={params:p(ce.params),clonable:p(ce.clonable.extend({items:C.z.array(C.z.union([j.clonable,w.clonable,O.clonable]))}))};var Xt=require("zod");var $e=u.extend({type:Xt.z.literal("Divider")}),$t=$e.partial({id:!0}),de={params:$t,clonable:$t.extend(m.clonable.shape)},Xe={params:p(de.params),clonable:p(de.clonable)};var f=require("zod");var Ye=_.extend({type:f.z.literal("Select"),options:f.z.array(f.z.object({label:f.z.string(),value:f.z.string()})),value:f.z.string().optional(),placeholder:f.z.string().optional(),search:f.z.boolean().optional(),onChange:f.z.function().args(f.z.object({value:f.z.string()})).returns(f.z.void())}),Yt=Ye.extend(Q.params.shape),ge={params:Yt,clonable:Yt.extend(Q.clonable.shape).extend({onChange:f.z.string()})},et={params:p(ge.params),clonable:p(ge.clonable)};var c=require("zod");var tt=_.extend({type:c.z.literal("TextInput"),value:c.z.string(),placeholder:c.z.string().optional(),onChange:c.z.function().args(c.z.object({value:c.z.string()})).returns(c.z.void()).optional(),onBlur:c.z.function().args(c.z.object({value:c.z.string()})).returns(c.z.void()).optional(),onFocus:c.z.function().args(c.z.object({value:c.z.string()})).returns(c.z.void()).optional()}),eo=tt.extend(Q.params.shape),ye={params:eo,clonable:eo.extend(Q.clonable.shape).extend({onChange:c.z.string().optional(),onBlur:c.z.string().optional(),onFocus:c.z.string().optional()})},ot={params:p(ye.params),clonable:p(ye.clonable)};var nt=$.z.discriminatedUnion("type",[me,pe,_e,$e,tt,Ye]),N={params:$.z.discriminatedUnion("type",[j.params,w.params,ce.params,de.params,ye.params,ge.params]),clonable:$.z.discriminatedUnion("type",[j.clonable,w.clonable,ce.clonable,de.clonable,ye.clonable,ge.clonable])},at={params:$.z.discriminatedUnion("type",[qe.params,Ke.params,Qe.params,ot.params,et.params,Ze.params,Xe.params]),clonable:$.z.discriminatedUnion("type",[qe.clonable,Ke.clonable,Qe.clonable,ot.clonable,et.clonable,Ze.clonable,Xe.clonable])};var fa=u.extend({type:I.z.literal("Panel"),title:I.z.string().optional(),body:I.z.array(nt),footer:I.z.array(nt).optional(),onClickClose:I.z.function().returns(I.z.void()).optional()}),to=fa.extend(m.params.shape).partial({type:!0}).omit({body:!0,footer:!0}).extend({body:I.z.array(N.params),footer:I.z.array(N.params).optional()}),Ue={params:to,clonable:to.extend(m.clonable.shape).extend({onClickClose:I.z.string().optional(),body:I.z.array(N.clonable),footer:I.z.array(N.clonable).optional()})};var Ii=o.z.object({actionTrigger:le.create,placement:Z.optional()}),oo=o.z.object({actionTrigger:le.clonable,placement:Z.optional()}),Ei=le.create.partial().required({id:!0}),no=le.clonable.partial().required({id:!0}),Ci=o.z.object({panel:Ue.params,placement:Z.optional()}),ao=o.z.object({panel:Ue.clonable,placement:Z.optional()}),ro=Ue.clonable.partial().required({id:!0}),Li=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:o.z.union([N.params,O.params]),container:o.z.union([o.z.literal("body"),o.z.literal("footer"),o.z.object({id:o.z.string()})]).optional(),placement:Z.optional()}))}),io=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:o.z.union([N.clonable,O.clonable]),container:o.z.union([o.z.literal("body"),o.z.literal("footer"),o.z.object({id:o.z.string()})]).optional(),placement:Z.optional()}))}),Mi=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:at.params}))}),so=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:at.clonable}))}),lo=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.string())}),mo=o.z.object({showLegend:o.z.boolean().optional(),cooperativeGestures:o.z.boolean().optional(),fullScreenButton:o.z.boolean().optional(),geolocation:o.z.boolean().optional(),zoomControls:o.z.boolean().optional(),scaleBar:o.z.boolean().optional()}),po=o.z.object({featureSelectPanel:o.z.boolean().optional(),featureHoverPanel:o.z.boolean().optional(),elementSelectPanel:o.z.boolean().optional(),linkClickOpen:o.z.boolean().optional(),imageLightboxOpen:o.z.boolean().optional()});var Sa=e("createActionTrigger",oo),xa=e("updateActionTrigger",no),ba=e("deleteActionTrigger",X.z.string()),Ia=e("createPanel",ao),Ea=e("updatePanel",ro),Ca=e("deletePanel",X.z.string()),La=e("createPanelElements",io),Ma=e("updatePanelElements",so),Ua=e("deletePanelElements",lo),Pa=e("updateUiControls",mo),Ta=e("setOnMapInteractionsUi",po),Ga=e("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:Ie.optional()}).optional()),za=e("hideLayerDataTable",X.z.undefined()),co={methods:[Sa,xa,ba,Ia,Ea,Ca,La,Ma,Ua,Pa,Ta,Ga,za],listeners:null};var rt=require("zod");var ue=require("zod");var Pe=ue.z.object({center:xe,zoom:st}),go=ue.z.object({center:Pe.shape.center.optional(),zoom:Pe.shape.zoom.optional()}),yo=ue.z.object({minZoom:Pe.shape.zoom.nullish(),maxZoom:Pe.shape.zoom.nullish(),bounds:T.nullish()}).nullable(),uo=ue.z.object({bounds:T});var Fa=e("getViewport",rt.z.undefined()),ka=e("setViewport",go),Ba=e("getViewportConstraints",rt.z.undefined()),va=e("setViewportConstraints",yo),Oa=e("fitViewportToBounds",uo),ja=h("onViewportMove"),wa=h("onViewportMoveEnd"),Va=h("onMapIdle"),ho={methods:[ka,Fa,Ba,va,Oa],listeners:[ja,wa,Va]};var it=[co,ho,vt,gt,Vt,yt,Jt,jt];function Aa(r,g,H){let q=new Map;async function V(L){if(!Ja.safeParse(L.data).success){H?.onUnknownMessage?.(L.data);return}let he=xo.safeParse(L.data);if(!he.success){H?.onInvalidMessage?.(L.data,he.error),L.ports[0]?.postMessage(fo(he.error.message));return}let{data:S}=he;if(S.type==="felt.ready")L.ports[0]?.postMessage(!0);else if(S.type==="felt.addListener"){if(S.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let Y="options"in S.event?{options:"options"in S.event?S.event.options:void 0,handler:Ge=>{L.ports[0]?.postMessage(Ge)}}:{handler:Ge=>{L.ports[0]?.postMessage(Ge)}},Te=g.listeners[S.event.eventName](Y);q.set(S.event.id,Te)}else if(S.type==="felt.removeListener")q.get(S.id)?.(),q.delete(S.id);else try{let Y=g.methods[S.type],Te=await Y(S.params);L.ports[0]?.postMessage(Te)}catch(Y){L.ports[0]?.postMessage(fo(Y))}}return r.addEventListener("message",V),()=>{r.removeEventListener("message",V)}}var So={methods:it.map(r=>r.methods??[]).flat(),listeners:it.map(r=>r.listeners??[]).flat()},Ra=d.z.discriminatedUnion("eventName",[d.z.strictObject({eventName:d.z.literal("")}),d.z.strictObject({eventName:d.z.literal("onGenericEvent"),id:d.z.string(),options:d.z.object({id:d.z.string()})}),...So.listeners]),Da=d.z.strictObject({type:d.z.literal("felt.addListener"),event:Ra}),Na=d.z.strictObject({type:d.z.literal("felt.removeListener"),id:d.z.string()}),Ha=d.z.strictObject({type:d.z.literal("felt.ready")}),xo=d.z.discriminatedUnion("type",[Ha,Da,Na,...So.methods]),Ja=d.z.object({type:d.z.enum(xo.options.map(r=>r.shape.type.value))});function fo(r){return{__error__:Za(r)}}function Za(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}0&&(module.exports={createMessageHandler});
|