@feltmaps/js-sdk 1.7.0-next.10 → 1.7.0-next.11

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 CHANGED
@@ -1,5 +1,5 @@
1
- import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-Dfbw7Li5.cjs';
2
- export { au as AggregatedGridConfig, av as AggregationConfig, aw as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b8 as CircleToolSettings, b9 as ConfigurableToolType, ax as CountGridConfig, bp as CreateActionTriggerParams, K as CreateLayersFromGeoJsonParams, bq as CreatePanelElementsParams, br as CreatePanelParams, O as DataOnlyLayer, bs as DeletePanelElementsParams, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aM as ElementGroupNode, aN as ElementNode, g as ElementUpdate, B as ElementsController, aO as EntityNode, aP as FeatureNode, aQ as FeatureSelection, aU as FeltBoundary, Q as FeltTiledVectorSource, aV as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aW as GeoJsonFeature, S as GeoJsonFileVectorSource, aX as GeoJsonGeometry, aY as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, ay as GetLayerCalculationParams, az as GetLayerCategoriesGroup, aA as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, aB as GetLayerHistogramBin, aC as GetLayerHistogramParams, aD as GetLayerPrecomputedCalculationParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, aE as GridConfig, aF as GridType, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, ba as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, bb as InputToolSettings, J as InteractionsController, aZ as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aR as LayerGroupNode, aS as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aJ as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, a_ as LineStringGeometry, bc as LineToolSettings, L as LinkElementRead, a$ as LngLatTuple, aK as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, bd as MarkerToolSettings, aL as MiscController, aG as MultiAggregationConfig, b0 as MultiLineStringGeometry, b1 as MultiPointGeometry, b2 as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, be as NoteToolSettings, bt as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, bf as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, bg as PlaceFrame, bh as PlaceSymbol, bx as PlacementForUIElement, b3 as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, b4 as PolygonGeometry, bi as PolygonToolSettings, aH as PrecomputedAggregationMethod, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bj as RouteToolSettings, aT as SelectionController, b_ as SetViewportCenterZoomParams, b5 as SetVisibilityRequest, b6 as SortConfig, b7 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, bk as TextToolSettings, bl as ToolSettingsChangeEvent, bm as ToolSettingsMap, bn as ToolType, bo as ToolsController, bY as UIActionTriggerCreate, bA as UIButtonElement, bB as UIButtonElementCreate, bC as UIButtonElementUpdate, bG as UIButtonGroupElement, bH as UIButtonGroupElementCreate, bI as UIButtonGroupElementUpdate, bM as UIDividerElement, bN as UIDividerElementCreate, bO as UIDividerElementUpdate, bJ as UIFlexibleSpaceElement, bK as UIFlexibleSpaceElementCreate, bL as UIFlexibleSpaceElementUpdate, by as UIPanel, bz as UIPanelCreate, bV as UIPanelElements, bW as UIPanelElementsCreate, bX as UIPanelElementsUpdate, bS as UISelectElement, bT as UISelectElementCreate, bU as UISelectElementUpdate, bD as UITextElement, bE as UITextElementCreate, bF as UITextElementUpdate, bP as UITextInputElement, bQ as UITextInputElementCreate, bR as UITextInputElementUpdate, bZ as UiController, bu as UpdateActionTriggerParams, ab as UpdateLayerParams, bv as UpdatePanelElementsParams, bw as UpdatePanelParams, aI as ValueConfiguration, ac as VectorLayer, b$ as ViewportConstraints, c2 as ViewportController, c0 as ViewportFitBoundsParams, c1 as ViewportState } from './controller-Dfbw7Li5.cjs';
1
+ import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-Bg7dynri.cjs';
2
+ export { au as AggregatedGridConfig, av as AggregationConfig, aw as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b8 as CircleToolSettings, b9 as ConfigurableToolType, ax as CountGridConfig, bp as CreateActionTriggerParams, K as CreateLayersFromGeoJsonParams, bq as CreatePanelElementsParams, br as CreatePanelParams, O as DataOnlyLayer, bs as DeletePanelElementsParams, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aM as ElementGroupNode, aN as ElementNode, g as ElementUpdate, B as ElementsController, aO as EntityNode, aP as FeatureNode, aQ as FeatureSelection, aU as FeltBoundary, Q as FeltTiledVectorSource, aV as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aW as GeoJsonFeature, S as GeoJsonFileVectorSource, aX as GeoJsonGeometry, aY as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, ay as GetLayerCalculationParams, az as GetLayerCategoriesGroup, aA as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, aB as GetLayerHistogramBin, aC as GetLayerHistogramParams, aD as GetLayerPrecomputedCalculationParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, aE as GridConfig, aF as GridType, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, ba as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, bb as InputToolSettings, J as InteractionsController, aZ as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aR as LayerGroupNode, aS as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aJ as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, a_ as LineStringGeometry, bc as LineToolSettings, L as LinkElementRead, a$ as LngLatTuple, aK as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, bd as MarkerToolSettings, aL as MiscController, aG as MultiAggregationConfig, b0 as MultiLineStringGeometry, b1 as MultiPointGeometry, b2 as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, be as NoteToolSettings, bt as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, bf as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, bg as PlaceFrame, bh as PlaceSymbol, bx as PlacementForUIElement, b3 as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, b4 as PolygonGeometry, bi as PolygonToolSettings, aH as PrecomputedAggregationMethod, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bj as RouteToolSettings, aT as SelectionController, b_ as SetViewportCenterZoomParams, b5 as SetVisibilityRequest, b6 as SortConfig, b7 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, bk as TextToolSettings, bl as ToolSettingsChangeEvent, bm as ToolSettingsMap, bn as ToolType, bo as ToolsController, bY as UIActionTriggerCreate, bA as UIButtonElement, bB as UIButtonElementCreate, bC as UIButtonElementUpdate, bG as UIButtonGroupElement, bH as UIButtonGroupElementCreate, bI as UIButtonGroupElementUpdate, bM as UIDividerElement, bN as UIDividerElementCreate, bO as UIDividerElementUpdate, bJ as UIFlexibleSpaceElement, bK as UIFlexibleSpaceElementCreate, bL as UIFlexibleSpaceElementUpdate, by as UIPanel, bz as UIPanelCreate, bV as UIPanelElements, bW as UIPanelElementsCreate, bX as UIPanelElementsUpdate, bS as UISelectElement, bT as UISelectElementCreate, bU as UISelectElementUpdate, bD as UITextElement, bE as UITextElementCreate, bF as UITextElementUpdate, bP as UITextInputElement, bQ as UITextInputElementCreate, bR as UITextInputElementUpdate, bZ as UiController, bu as UpdateActionTriggerParams, ab as UpdateLayerParams, bv as UpdatePanelElementsParams, bw as UpdatePanelParams, aI as ValueConfiguration, ac as VectorLayer, b$ as ViewportConstraints, c2 as ViewportController, c0 as ViewportFitBoundsParams, c1 as ViewportState } from './controller-Bg7dynri.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-Dfbw7Li5.js';
2
- export { au as AggregatedGridConfig, av as AggregationConfig, aw as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b8 as CircleToolSettings, b9 as ConfigurableToolType, ax as CountGridConfig, bp as CreateActionTriggerParams, K as CreateLayersFromGeoJsonParams, bq as CreatePanelElementsParams, br as CreatePanelParams, O as DataOnlyLayer, bs as DeletePanelElementsParams, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aM as ElementGroupNode, aN as ElementNode, g as ElementUpdate, B as ElementsController, aO as EntityNode, aP as FeatureNode, aQ as FeatureSelection, aU as FeltBoundary, Q as FeltTiledVectorSource, aV as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aW as GeoJsonFeature, S as GeoJsonFileVectorSource, aX as GeoJsonGeometry, aY as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, ay as GetLayerCalculationParams, az as GetLayerCategoriesGroup, aA as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, aB as GetLayerHistogramBin, aC as GetLayerHistogramParams, aD as GetLayerPrecomputedCalculationParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, aE as GridConfig, aF as GridType, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, ba as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, bb as InputToolSettings, J as InteractionsController, aZ as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aR as LayerGroupNode, aS as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aJ as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, a_ as LineStringGeometry, bc as LineToolSettings, L as LinkElementRead, a$ as LngLatTuple, aK as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, bd as MarkerToolSettings, aL as MiscController, aG as MultiAggregationConfig, b0 as MultiLineStringGeometry, b1 as MultiPointGeometry, b2 as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, be as NoteToolSettings, bt as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, bf as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, bg as PlaceFrame, bh as PlaceSymbol, bx as PlacementForUIElement, b3 as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, b4 as PolygonGeometry, bi as PolygonToolSettings, aH as PrecomputedAggregationMethod, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bj as RouteToolSettings, aT as SelectionController, b_ as SetViewportCenterZoomParams, b5 as SetVisibilityRequest, b6 as SortConfig, b7 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, bk as TextToolSettings, bl as ToolSettingsChangeEvent, bm as ToolSettingsMap, bn as ToolType, bo as ToolsController, bY as UIActionTriggerCreate, bA as UIButtonElement, bB as UIButtonElementCreate, bC as UIButtonElementUpdate, bG as UIButtonGroupElement, bH as UIButtonGroupElementCreate, bI as UIButtonGroupElementUpdate, bM as UIDividerElement, bN as UIDividerElementCreate, bO as UIDividerElementUpdate, bJ as UIFlexibleSpaceElement, bK as UIFlexibleSpaceElementCreate, bL as UIFlexibleSpaceElementUpdate, by as UIPanel, bz as UIPanelCreate, bV as UIPanelElements, bW as UIPanelElementsCreate, bX as UIPanelElementsUpdate, bS as UISelectElement, bT as UISelectElementCreate, bU as UISelectElementUpdate, bD as UITextElement, bE as UITextElementCreate, bF as UITextElementUpdate, bP as UITextInputElement, bQ as UITextInputElementCreate, bR as UITextInputElementUpdate, bZ as UiController, bu as UpdateActionTriggerParams, ab as UpdateLayerParams, bv as UpdatePanelElementsParams, bw as UpdatePanelParams, aI as ValueConfiguration, ac as VectorLayer, b$ as ViewportConstraints, c2 as ViewportController, c0 as ViewportFitBoundsParams, c1 as ViewportState } from './controller-Dfbw7Li5.js';
1
+ import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-Bg7dynri.js';
2
+ export { au as AggregatedGridConfig, av as AggregationConfig, aw as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b8 as CircleToolSettings, b9 as ConfigurableToolType, ax as CountGridConfig, bp as CreateActionTriggerParams, K as CreateLayersFromGeoJsonParams, bq as CreatePanelElementsParams, br as CreatePanelParams, O as DataOnlyLayer, bs as DeletePanelElementsParams, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aM as ElementGroupNode, aN as ElementNode, g as ElementUpdate, B as ElementsController, aO as EntityNode, aP as FeatureNode, aQ as FeatureSelection, aU as FeltBoundary, Q as FeltTiledVectorSource, aV as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aW as GeoJsonFeature, S as GeoJsonFileVectorSource, aX as GeoJsonGeometry, aY as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, ay as GetLayerCalculationParams, az as GetLayerCategoriesGroup, aA as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, aB as GetLayerHistogramBin, aC as GetLayerHistogramParams, aD as GetLayerPrecomputedCalculationParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, aE as GridConfig, aF as GridType, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, ba as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, bb as InputToolSettings, J as InteractionsController, aZ as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aR as LayerGroupNode, aS as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aJ as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, a_ as LineStringGeometry, bc as LineToolSettings, L as LinkElementRead, a$ as LngLatTuple, aK as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, bd as MarkerToolSettings, aL as MiscController, aG as MultiAggregationConfig, b0 as MultiLineStringGeometry, b1 as MultiPointGeometry, b2 as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, be as NoteToolSettings, bt as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, bf as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, bg as PlaceFrame, bh as PlaceSymbol, bx as PlacementForUIElement, b3 as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, b4 as PolygonGeometry, bi as PolygonToolSettings, aH as PrecomputedAggregationMethod, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bj as RouteToolSettings, aT as SelectionController, b_ as SetViewportCenterZoomParams, b5 as SetVisibilityRequest, b6 as SortConfig, b7 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, bk as TextToolSettings, bl as ToolSettingsChangeEvent, bm as ToolSettingsMap, bn as ToolType, bo as ToolsController, bY as UIActionTriggerCreate, bA as UIButtonElement, bB as UIButtonElementCreate, bC as UIButtonElementUpdate, bG as UIButtonGroupElement, bH as UIButtonGroupElementCreate, bI as UIButtonGroupElementUpdate, bM as UIDividerElement, bN as UIDividerElementCreate, bO as UIDividerElementUpdate, bJ as UIFlexibleSpaceElement, bK as UIFlexibleSpaceElementCreate, bL as UIFlexibleSpaceElementUpdate, by as UIPanel, bz as UIPanelCreate, bV as UIPanelElements, bW as UIPanelElementsCreate, bX as UIPanelElementsUpdate, bS as UISelectElement, bT as UISelectElementCreate, bU as UISelectElementUpdate, bD as UITextElement, bE as UITextElementCreate, bF as UITextElementUpdate, bP as UITextInputElement, bQ as UITextInputElementCreate, bR as UITextInputElementUpdate, bZ as UiController, bu as UpdateActionTriggerParams, ab as UpdateLayerParams, bv as UpdatePanelElementsParams, bw as UpdatePanelParams, aI as ValueConfiguration, ac as VectorLayer, b$ as ViewportConstraints, c2 as ViewportController, c0 as ViewportFitBoundsParams, c1 as ViewportState } from './controller-Bg7dynri.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -9951,7 +9951,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9951
9951
  placeholder?: string | undefined;
9952
9952
  search?: boolean | undefined;
9953
9953
  }>]>, "many">>;
9954
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
9954
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
9955
9955
  }>, "strip", z.ZodTypeAny, {
9956
9956
  type: "Panel";
9957
9957
  id: string;
@@ -10120,7 +10120,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10120
10120
  placeholder?: string | undefined;
10121
10121
  search?: boolean | undefined;
10122
10122
  })[] | undefined;
10123
- onClose?: ((...args: unknown[]) => void) | undefined;
10123
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
10124
10124
  }, {
10125
10125
  type: "Panel";
10126
10126
  id: string;
@@ -10289,7 +10289,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10289
10289
  placeholder?: string | undefined;
10290
10290
  search?: boolean | undefined;
10291
10291
  })[] | undefined;
10292
- onClose?: ((...args: unknown[]) => void) | undefined;
10292
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
10293
10293
  }>;
10294
10294
  /**
10295
10295
  * Represents a panel in the UI.
@@ -10299,7 +10299,11 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10299
10299
  * It can have a title, a body, a footer as well as a close button.
10300
10300
  *
10301
10301
  * The body and footer are arrays of UI elements and turn into vertical stacks of elements.
10302
- * The close button is a button that can be used to close the panel.
10302
+ *
10303
+ * The close button is a button rendered in the top right corner of the panel that can be
10304
+ * used to close the panel and is only visible if `onClickClose` is provided.
10305
+ * Usually, you want to call {@link UiController.deletePanel} when the close button is clicked,
10306
+ * e.g. `onClickClose: () => felt.deletePanel("my-panel")`.
10303
10307
  *
10304
10308
  * #### Body
10305
10309
  * Body is the main content of the panel. It is scrollable which means
@@ -10318,10 +10322,19 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10318
10322
  * body: [
10319
10323
  * { type: "Text", text: "Hello" },
10320
10324
  * ],
10321
- * });
10325
+ * }
10322
10326
  * ```
10323
10327
  *
10324
10328
  * @example
10329
+ * #### closable
10330
+ * ```typescript
10331
+ * {
10332
+ * id: "my-panel",
10333
+ * title: "My Panel",
10334
+ * onClickClose: () => felt.deletePanel("my-panel"),
10335
+ * }
10336
+ *
10337
+ * @example
10325
10338
  * #### form
10326
10339
  * ```typescript
10327
10340
  * {
@@ -10337,11 +10350,11 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10337
10350
  * { type: "Button", label: "Save", onClick: () => alert("Save") },
10338
10351
  * ] },
10339
10352
  * ],
10340
- * });
10353
+ * }
10341
10354
  * ```
10342
10355
  *
10343
10356
  */
10344
- interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
10357
+ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClickClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
10345
10358
  /**
10346
10359
  * The elements to add to the panel body.
10347
10360
  */
@@ -10353,7 +10366,7 @@ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onC
10353
10366
  /**
10354
10367
  * A function to call when panel's close button is clicked.
10355
10368
  */
10356
- onClose?: () => void;
10369
+ onClickClose?: () => void;
10357
10370
  }
10358
10371
  declare const uiPanelCreateSchema: {
10359
10372
  params: z.ZodObject<z.objectUtil.extendShape<Omit<{
@@ -11008,7 +11021,7 @@ declare const uiPanelCreateSchema: {
11008
11021
  placeholder?: string | undefined;
11009
11022
  search?: boolean | undefined;
11010
11023
  }>]>, "many">>;
11011
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
11024
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
11012
11025
  }, "body" | "footer">, {
11013
11026
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
11014
11027
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -12036,7 +12049,7 @@ declare const uiPanelCreateSchema: {
12036
12049
  placeholder?: string | undefined;
12037
12050
  search?: boolean | undefined;
12038
12051
  })[] | undefined;
12039
- onClose?: ((...args: unknown[]) => void) | undefined;
12052
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
12040
12053
  }, {
12041
12054
  body: ({
12042
12055
  type: "Button";
@@ -12205,7 +12218,7 @@ declare const uiPanelCreateSchema: {
12205
12218
  placeholder?: string | undefined;
12206
12219
  search?: boolean | undefined;
12207
12220
  })[] | undefined;
12208
- onClose?: ((...args: unknown[]) => void) | undefined;
12221
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
12209
12222
  }>;
12210
12223
  clonable: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<Omit<{
12211
12224
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
@@ -12859,7 +12872,7 @@ declare const uiPanelCreateSchema: {
12859
12872
  placeholder?: string | undefined;
12860
12873
  search?: boolean | undefined;
12861
12874
  }>]>, "many">>;
12862
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
12875
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
12863
12876
  }, "body" | "footer">, {
12864
12877
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
12865
12878
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -13727,7 +13740,7 @@ declare const uiPanelCreateSchema: {
13727
13740
  onCreate: z.ZodOptional<z.ZodString>;
13728
13741
  onDestroy: z.ZodOptional<z.ZodString>;
13729
13742
  }>>, {
13730
- onClose: z.ZodOptional<z.ZodString>;
13743
+ onClickClose: z.ZodOptional<z.ZodString>;
13731
13744
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
13732
13745
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
13733
13746
  onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -15028,7 +15041,7 @@ declare const uiPanelCreateSchema: {
15028
15041
  placeholder?: string | undefined;
15029
15042
  search?: boolean | undefined;
15030
15043
  })[] | undefined;
15031
- onClose?: string | undefined;
15044
+ onClickClose?: string | undefined;
15032
15045
  }, {
15033
15046
  body: ({
15034
15047
  type: "Button";
@@ -15181,7 +15194,7 @@ declare const uiPanelCreateSchema: {
15181
15194
  placeholder?: string | undefined;
15182
15195
  search?: boolean | undefined;
15183
15196
  })[] | undefined;
15184
- onClose?: string | undefined;
15197
+ onClickClose?: string | undefined;
15185
15198
  }>;
15186
15199
  };
15187
15200
  /**
@@ -15976,7 +15989,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
15976
15989
  placeholder?: string | undefined;
15977
15990
  search?: boolean | undefined;
15978
15991
  }>]>, "many">>;
15979
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
15992
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
15980
15993
  }, "body" | "footer">, {
15981
15994
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
15982
15995
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -17004,7 +17017,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17004
17017
  placeholder?: string | undefined;
17005
17018
  search?: boolean | undefined;
17006
17019
  })[] | undefined;
17007
- onClose?: ((...args: unknown[]) => void) | undefined;
17020
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17008
17021
  }, {
17009
17022
  body: ({
17010
17023
  type: "Button";
@@ -17173,7 +17186,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17173
17186
  placeholder?: string | undefined;
17174
17187
  search?: boolean | undefined;
17175
17188
  })[] | undefined;
17176
- onClose?: ((...args: unknown[]) => void) | undefined;
17189
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17177
17190
  }>;
17178
17191
  placement: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
17179
17192
  after: z.ZodString;
@@ -17363,7 +17376,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17363
17376
  placeholder?: string | undefined;
17364
17377
  search?: boolean | undefined;
17365
17378
  })[] | undefined;
17366
- onClose?: ((...args: unknown[]) => void) | undefined;
17379
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17367
17380
  };
17368
17381
  placement?: {
17369
17382
  after: string;
@@ -17541,7 +17554,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17541
17554
  placeholder?: string | undefined;
17542
17555
  search?: boolean | undefined;
17543
17556
  })[] | undefined;
17544
- onClose?: ((...args: unknown[]) => void) | undefined;
17557
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17545
17558
  };
17546
17559
  placement?: {
17547
17560
  after: string;
@@ -9951,7 +9951,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
9951
9951
  placeholder?: string | undefined;
9952
9952
  search?: boolean | undefined;
9953
9953
  }>]>, "many">>;
9954
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
9954
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
9955
9955
  }>, "strip", z.ZodTypeAny, {
9956
9956
  type: "Panel";
9957
9957
  id: string;
@@ -10120,7 +10120,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10120
10120
  placeholder?: string | undefined;
10121
10121
  search?: boolean | undefined;
10122
10122
  })[] | undefined;
10123
- onClose?: ((...args: unknown[]) => void) | undefined;
10123
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
10124
10124
  }, {
10125
10125
  type: "Panel";
10126
10126
  id: string;
@@ -10289,7 +10289,7 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10289
10289
  placeholder?: string | undefined;
10290
10290
  search?: boolean | undefined;
10291
10291
  })[] | undefined;
10292
- onClose?: ((...args: unknown[]) => void) | undefined;
10292
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
10293
10293
  }>;
10294
10294
  /**
10295
10295
  * Represents a panel in the UI.
@@ -10299,7 +10299,11 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10299
10299
  * It can have a title, a body, a footer as well as a close button.
10300
10300
  *
10301
10301
  * The body and footer are arrays of UI elements and turn into vertical stacks of elements.
10302
- * The close button is a button that can be used to close the panel.
10302
+ *
10303
+ * The close button is a button rendered in the top right corner of the panel that can be
10304
+ * used to close the panel and is only visible if `onClickClose` is provided.
10305
+ * Usually, you want to call {@link UiController.deletePanel} when the close button is clicked,
10306
+ * e.g. `onClickClose: () => felt.deletePanel("my-panel")`.
10303
10307
  *
10304
10308
  * #### Body
10305
10309
  * Body is the main content of the panel. It is scrollable which means
@@ -10318,10 +10322,19 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10318
10322
  * body: [
10319
10323
  * { type: "Text", text: "Hello" },
10320
10324
  * ],
10321
- * });
10325
+ * }
10322
10326
  * ```
10323
10327
  *
10324
10328
  * @example
10329
+ * #### closable
10330
+ * ```typescript
10331
+ * {
10332
+ * id: "my-panel",
10333
+ * title: "My Panel",
10334
+ * onClickClose: () => felt.deletePanel("my-panel"),
10335
+ * }
10336
+ *
10337
+ * @example
10325
10338
  * #### form
10326
10339
  * ```typescript
10327
10340
  * {
@@ -10337,11 +10350,11 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
10337
10350
  * { type: "Button", label: "Save", onClick: () => alert("Save") },
10338
10351
  * ] },
10339
10352
  * ],
10340
- * });
10353
+ * }
10341
10354
  * ```
10342
10355
  *
10343
10356
  */
10344
- interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
10357
+ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClickClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
10345
10358
  /**
10346
10359
  * The elements to add to the panel body.
10347
10360
  */
@@ -10353,7 +10366,7 @@ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onC
10353
10366
  /**
10354
10367
  * A function to call when panel's close button is clicked.
10355
10368
  */
10356
- onClose?: () => void;
10369
+ onClickClose?: () => void;
10357
10370
  }
10358
10371
  declare const uiPanelCreateSchema: {
10359
10372
  params: z.ZodObject<z.objectUtil.extendShape<Omit<{
@@ -11008,7 +11021,7 @@ declare const uiPanelCreateSchema: {
11008
11021
  placeholder?: string | undefined;
11009
11022
  search?: boolean | undefined;
11010
11023
  }>]>, "many">>;
11011
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
11024
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
11012
11025
  }, "body" | "footer">, {
11013
11026
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
11014
11027
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -12036,7 +12049,7 @@ declare const uiPanelCreateSchema: {
12036
12049
  placeholder?: string | undefined;
12037
12050
  search?: boolean | undefined;
12038
12051
  })[] | undefined;
12039
- onClose?: ((...args: unknown[]) => void) | undefined;
12052
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
12040
12053
  }, {
12041
12054
  body: ({
12042
12055
  type: "Button";
@@ -12205,7 +12218,7 @@ declare const uiPanelCreateSchema: {
12205
12218
  placeholder?: string | undefined;
12206
12219
  search?: boolean | undefined;
12207
12220
  })[] | undefined;
12208
- onClose?: ((...args: unknown[]) => void) | undefined;
12221
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
12209
12222
  }>;
12210
12223
  clonable: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<Omit<{
12211
12224
  type: z.ZodOptional<z.ZodLiteral<"Panel">>;
@@ -12859,7 +12872,7 @@ declare const uiPanelCreateSchema: {
12859
12872
  placeholder?: string | undefined;
12860
12873
  search?: boolean | undefined;
12861
12874
  }>]>, "many">>;
12862
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
12875
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
12863
12876
  }, "body" | "footer">, {
12864
12877
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
12865
12878
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -13727,7 +13740,7 @@ declare const uiPanelCreateSchema: {
13727
13740
  onCreate: z.ZodOptional<z.ZodString>;
13728
13741
  onDestroy: z.ZodOptional<z.ZodString>;
13729
13742
  }>>, {
13730
- onClose: z.ZodOptional<z.ZodString>;
13743
+ onClickClose: z.ZodOptional<z.ZodString>;
13731
13744
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
13732
13745
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
13733
13746
  onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -15028,7 +15041,7 @@ declare const uiPanelCreateSchema: {
15028
15041
  placeholder?: string | undefined;
15029
15042
  search?: boolean | undefined;
15030
15043
  })[] | undefined;
15031
- onClose?: string | undefined;
15044
+ onClickClose?: string | undefined;
15032
15045
  }, {
15033
15046
  body: ({
15034
15047
  type: "Button";
@@ -15181,7 +15194,7 @@ declare const uiPanelCreateSchema: {
15181
15194
  placeholder?: string | undefined;
15182
15195
  search?: boolean | undefined;
15183
15196
  })[] | undefined;
15184
- onClose?: string | undefined;
15197
+ onClickClose?: string | undefined;
15185
15198
  }>;
15186
15199
  };
15187
15200
  /**
@@ -15976,7 +15989,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
15976
15989
  placeholder?: string | undefined;
15977
15990
  search?: boolean | undefined;
15978
15991
  }>]>, "many">>;
15979
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
15992
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
15980
15993
  }, "body" | "footer">, {
15981
15994
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
15982
15995
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -17004,7 +17017,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17004
17017
  placeholder?: string | undefined;
17005
17018
  search?: boolean | undefined;
17006
17019
  })[] | undefined;
17007
- onClose?: ((...args: unknown[]) => void) | undefined;
17020
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17008
17021
  }, {
17009
17022
  body: ({
17010
17023
  type: "Button";
@@ -17173,7 +17186,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17173
17186
  placeholder?: string | undefined;
17174
17187
  search?: boolean | undefined;
17175
17188
  })[] | undefined;
17176
- onClose?: ((...args: unknown[]) => void) | undefined;
17189
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17177
17190
  }>;
17178
17191
  placement: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
17179
17192
  after: z.ZodString;
@@ -17363,7 +17376,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17363
17376
  placeholder?: string | undefined;
17364
17377
  search?: boolean | undefined;
17365
17378
  })[] | undefined;
17366
- onClose?: ((...args: unknown[]) => void) | undefined;
17379
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17367
17380
  };
17368
17381
  placement?: {
17369
17382
  after: string;
@@ -17541,7 +17554,7 @@ declare const CreatePanelParamsSchema: z.ZodObject<{
17541
17554
  placeholder?: string | undefined;
17542
17555
  search?: boolean | undefined;
17543
17556
  })[] | undefined;
17544
- onClose?: ((...args: unknown[]) => void) | undefined;
17557
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
17545
17558
  };
17546
17559
  placement?: {
17547
17560
  after: string;
@@ -11059,7 +11059,7 @@ declare const uiPanelSchema: ZodObject<objectUtil.extendShape<objectUtil.extendS
11059
11059
  placeholder?: string | undefined;
11060
11060
  search?: boolean | undefined;
11061
11061
  }>]>, "many">>;
11062
- onClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
11062
+ onClickClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
11063
11063
  }>, "strip", ZodTypeAny, {
11064
11064
  type: "Panel";
11065
11065
  id: string;
@@ -11228,7 +11228,7 @@ declare const uiPanelSchema: ZodObject<objectUtil.extendShape<objectUtil.extendS
11228
11228
  placeholder?: string | undefined;
11229
11229
  search?: boolean | undefined;
11230
11230
  })[] | undefined;
11231
- onClose?: ((...args: unknown[]) => void) | undefined;
11231
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
11232
11232
  }, {
11233
11233
  type: "Panel";
11234
11234
  id: string;
@@ -11397,7 +11397,7 @@ declare const uiPanelSchema: ZodObject<objectUtil.extendShape<objectUtil.extendS
11397
11397
  placeholder?: string | undefined;
11398
11398
  search?: boolean | undefined;
11399
11399
  })[] | undefined;
11400
- onClose?: ((...args: unknown[]) => void) | undefined;
11400
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
11401
11401
  }>;
11402
11402
  /**
11403
11403
  * Represents a panel in the UI.
@@ -11407,7 +11407,11 @@ declare const uiPanelSchema: ZodObject<objectUtil.extendShape<objectUtil.extendS
11407
11407
  * It can have a title, a body, a footer as well as a close button.
11408
11408
  *
11409
11409
  * The body and footer are arrays of UI elements and turn into vertical stacks of elements.
11410
- * The close button is a button that can be used to close the panel.
11410
+ *
11411
+ * The close button is a button rendered in the top right corner of the panel that can be
11412
+ * used to close the panel and is only visible if `onClickClose` is provided.
11413
+ * Usually, you want to call {@link UiController.deletePanel} when the close button is clicked,
11414
+ * e.g. `onClickClose: () => felt.deletePanel("my-panel")`.
11411
11415
  *
11412
11416
  * #### Body
11413
11417
  * Body is the main content of the panel. It is scrollable which means
@@ -11426,10 +11430,19 @@ declare const uiPanelSchema: ZodObject<objectUtil.extendShape<objectUtil.extendS
11426
11430
  * body: [
11427
11431
  * { type: "Text", text: "Hello" },
11428
11432
  * ],
11429
- * });
11433
+ * }
11430
11434
  * ```
11431
11435
  *
11432
11436
  * @example
11437
+ * #### closable
11438
+ * ```typescript
11439
+ * {
11440
+ * id: "my-panel",
11441
+ * title: "My Panel",
11442
+ * onClickClose: () => felt.deletePanel("my-panel"),
11443
+ * }
11444
+ *
11445
+ * @example
11433
11446
  * #### form
11434
11447
  * ```typescript
11435
11448
  * {
@@ -11445,11 +11458,11 @@ declare const uiPanelSchema: ZodObject<objectUtil.extendShape<objectUtil.extendS
11445
11458
  * { type: "Button", label: "Save", onClick: () => alert("Save") },
11446
11459
  * ] },
11447
11460
  * ],
11448
- * });
11461
+ * }
11449
11462
  * ```
11450
11463
  *
11451
11464
  */
11452
- interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
11465
+ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClickClose" | "body" | "footer" | "onCreate" | "onDestroy"> {
11453
11466
  /**
11454
11467
  * The elements to add to the panel body.
11455
11468
  */
@@ -11461,7 +11474,7 @@ interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onC
11461
11474
  /**
11462
11475
  * A function to call when panel's close button is clicked.
11463
11476
  */
11464
- onClose?: () => void;
11477
+ onClickClose?: () => void;
11465
11478
  }
11466
11479
  declare const uiPanelCreateSchema: {
11467
11480
  params: ZodObject<objectUtil.extendShape<Omit<{
@@ -12116,7 +12129,7 @@ declare const uiPanelCreateSchema: {
12116
12129
  placeholder?: string | undefined;
12117
12130
  search?: boolean | undefined;
12118
12131
  }>]>, "many">>;
12119
- onClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
12132
+ onClickClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
12120
12133
  }, "body" | "footer">, {
12121
12134
  body: ZodArray<ZodDiscriminatedUnion<"type", [ZodObject<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<{
12122
12135
  onCreate: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
@@ -13144,7 +13157,7 @@ declare const uiPanelCreateSchema: {
13144
13157
  placeholder?: string | undefined;
13145
13158
  search?: boolean | undefined;
13146
13159
  })[] | undefined;
13147
- onClose?: ((...args: unknown[]) => void) | undefined;
13160
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
13148
13161
  }, {
13149
13162
  body: ({
13150
13163
  type: "Button";
@@ -13313,7 +13326,7 @@ declare const uiPanelCreateSchema: {
13313
13326
  placeholder?: string | undefined;
13314
13327
  search?: boolean | undefined;
13315
13328
  })[] | undefined;
13316
- onClose?: ((...args: unknown[]) => void) | undefined;
13329
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
13317
13330
  }>;
13318
13331
  clonable: ZodObject<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<Omit<{
13319
13332
  type: ZodOptional<ZodLiteral<"Panel">>;
@@ -13967,7 +13980,7 @@ declare const uiPanelCreateSchema: {
13967
13980
  placeholder?: string | undefined;
13968
13981
  search?: boolean | undefined;
13969
13982
  }>]>, "many">>;
13970
- onClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
13983
+ onClickClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
13971
13984
  }, "body" | "footer">, {
13972
13985
  body: ZodArray<ZodDiscriminatedUnion<"type", [ZodObject<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<{
13973
13986
  onCreate: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
@@ -14835,7 +14848,7 @@ declare const uiPanelCreateSchema: {
14835
14848
  onCreate: ZodOptional<ZodString>;
14836
14849
  onDestroy: ZodOptional<ZodString>;
14837
14850
  }>>, {
14838
- onClose: ZodOptional<ZodString>;
14851
+ onClickClose: ZodOptional<ZodString>;
14839
14852
  body: ZodArray<ZodDiscriminatedUnion<"type", [ZodObject<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<{
14840
14853
  onCreate: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
14841
14854
  onDestroy: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
@@ -16136,7 +16149,7 @@ declare const uiPanelCreateSchema: {
16136
16149
  placeholder?: string | undefined;
16137
16150
  search?: boolean | undefined;
16138
16151
  })[] | undefined;
16139
- onClose?: string | undefined;
16152
+ onClickClose?: string | undefined;
16140
16153
  }, {
16141
16154
  body: ({
16142
16155
  type: "Button";
@@ -16289,7 +16302,7 @@ declare const uiPanelCreateSchema: {
16289
16302
  placeholder?: string | undefined;
16290
16303
  search?: boolean | undefined;
16291
16304
  })[] | undefined;
16292
- onClose?: string | undefined;
16305
+ onClickClose?: string | undefined;
16293
16306
  }>;
16294
16307
  };
16295
16308
  /**
@@ -17084,7 +17097,7 @@ declare const CreatePanelParamsSchema: ZodObject<{
17084
17097
  placeholder?: string | undefined;
17085
17098
  search?: boolean | undefined;
17086
17099
  }>]>, "many">>;
17087
- onClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
17100
+ onClickClose: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
17088
17101
  }, "body" | "footer">, {
17089
17102
  body: ZodArray<ZodDiscriminatedUnion<"type", [ZodObject<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<{
17090
17103
  onCreate: ZodOptional<ZodFunction<ZodTuple<[], ZodUnknown>, ZodVoid>>;
@@ -18112,7 +18125,7 @@ declare const CreatePanelParamsSchema: ZodObject<{
18112
18125
  placeholder?: string | undefined;
18113
18126
  search?: boolean | undefined;
18114
18127
  })[] | undefined;
18115
- onClose?: ((...args: unknown[]) => void) | undefined;
18128
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
18116
18129
  }, {
18117
18130
  body: ({
18118
18131
  type: "Button";
@@ -18281,7 +18294,7 @@ declare const CreatePanelParamsSchema: ZodObject<{
18281
18294
  placeholder?: string | undefined;
18282
18295
  search?: boolean | undefined;
18283
18296
  })[] | undefined;
18284
- onClose?: ((...args: unknown[]) => void) | undefined;
18297
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
18285
18298
  }>;
18286
18299
  placement: ZodOptional<ZodUnion<[ZodObject<{
18287
18300
  after: ZodString;
@@ -18471,7 +18484,7 @@ declare const CreatePanelParamsSchema: ZodObject<{
18471
18484
  placeholder?: string | undefined;
18472
18485
  search?: boolean | undefined;
18473
18486
  })[] | undefined;
18474
- onClose?: ((...args: unknown[]) => void) | undefined;
18487
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
18475
18488
  };
18476
18489
  placement?: {
18477
18490
  after: string;
@@ -18649,7 +18662,7 @@ declare const CreatePanelParamsSchema: ZodObject<{
18649
18662
  placeholder?: string | undefined;
18650
18663
  search?: boolean | undefined;
18651
18664
  })[] | undefined;
18652
- onClose?: ((...args: unknown[]) => void) | undefined;
18665
+ onClickClose?: ((...args: unknown[]) => void) | undefined;
18653
18666
  };
18654
18667
  placement?: {
18655
18668
  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 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(),onClickClose: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({onClickClose: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,5 +1,5 @@
1
1
  import { z, ZodError } from 'zod';
2
- import { F as FeltController, c3 as UnwrapPromise, z as zInfer, c as ElementChangeCallbackParams, f as ElementGroupChangeCallbackParams, E as Element, D as MapInteractionEvent, ap as FilterTernary, $ as LayerChangeCallbackParams, a2 as LayerGroupChangeCallbackParams, a5 as LegendItemChangeCallbackParams, at as LayerFilters, as as LayerBoundaries, aO as EntityNode, bn as ToolType, bl as ToolSettingsChangeEvent, c4 as uiActionTriggerSchema, c5 as uiPanelCreateSchema, c1 as ViewportState, c6 as PromiseOrNot, c7 as UnionToIntersection } from './controller-Dfbw7Li5.cjs';
2
+ import { F as FeltController, c3 as UnwrapPromise, z as zInfer, c as ElementChangeCallbackParams, f as ElementGroupChangeCallbackParams, E as Element, D as MapInteractionEvent, ap as FilterTernary, $ as LayerChangeCallbackParams, a2 as LayerGroupChangeCallbackParams, a5 as LegendItemChangeCallbackParams, at as LayerFilters, as as LayerBoundaries, aO as EntityNode, bn as ToolType, bl as ToolSettingsChangeEvent, c4 as uiActionTriggerSchema, c5 as uiPanelCreateSchema, c1 as ViewportState, c6 as PromiseOrNot, c7 as UnionToIntersection } from './controller-Bg7dynri.cjs';
3
3
 
4
4
  type FeltControllerFunctions = Omit<FeltController, "iframe">;
5
5
  type Method<TRequest extends {
@@ -4941,7 +4941,7 @@ declare const CreatePanelMessage: z.ZodObject<{
4941
4941
  placeholder?: string | undefined;
4942
4942
  search?: boolean | undefined;
4943
4943
  }>]>, "many">>;
4944
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
4944
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
4945
4945
  }, "body" | "footer">, {
4946
4946
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
4947
4947
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -5809,7 +5809,7 @@ declare const CreatePanelMessage: z.ZodObject<{
5809
5809
  onCreate: z.ZodOptional<z.ZodString>;
5810
5810
  onDestroy: z.ZodOptional<z.ZodString>;
5811
5811
  }>>, {
5812
- onClose: z.ZodOptional<z.ZodString>;
5812
+ onClickClose: z.ZodOptional<z.ZodString>;
5813
5813
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
5814
5814
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
5815
5815
  onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -7110,7 +7110,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7110
7110
  placeholder?: string | undefined;
7111
7111
  search?: boolean | undefined;
7112
7112
  })[] | undefined;
7113
- onClose?: string | undefined;
7113
+ onClickClose?: string | undefined;
7114
7114
  }, {
7115
7115
  body: ({
7116
7116
  type: "Button";
@@ -7263,7 +7263,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7263
7263
  placeholder?: string | undefined;
7264
7264
  search?: boolean | undefined;
7265
7265
  })[] | undefined;
7266
- onClose?: string | undefined;
7266
+ onClickClose?: string | undefined;
7267
7267
  }>;
7268
7268
  placement: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7269
7269
  after: z.ZodString;
@@ -7437,7 +7437,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7437
7437
  placeholder?: string | undefined;
7438
7438
  search?: boolean | undefined;
7439
7439
  })[] | undefined;
7440
- onClose?: string | undefined;
7440
+ onClickClose?: string | undefined;
7441
7441
  };
7442
7442
  placement?: {
7443
7443
  after: string;
@@ -7599,7 +7599,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7599
7599
  placeholder?: string | undefined;
7600
7600
  search?: boolean | undefined;
7601
7601
  })[] | undefined;
7602
- onClose?: string | undefined;
7602
+ onClickClose?: string | undefined;
7603
7603
  };
7604
7604
  placement?: {
7605
7605
  after: string;
@@ -7763,7 +7763,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7763
7763
  placeholder?: string | undefined;
7764
7764
  search?: boolean | undefined;
7765
7765
  })[] | undefined;
7766
- onClose?: string | undefined;
7766
+ onClickClose?: string | undefined;
7767
7767
  };
7768
7768
  placement?: {
7769
7769
  after: string;
@@ -7928,7 +7928,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7928
7928
  placeholder?: string | undefined;
7929
7929
  search?: boolean | undefined;
7930
7930
  })[] | undefined;
7931
- onClose?: string | undefined;
7931
+ onClickClose?: string | undefined;
7932
7932
  };
7933
7933
  placement?: {
7934
7934
  after: string;
@@ -9096,7 +9096,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9096
9096
  placeholder?: string | undefined;
9097
9097
  search?: boolean | undefined;
9098
9098
  }>]>, "many">>>;
9099
- onClose: z.ZodOptional<z.ZodOptional<z.ZodString>>;
9099
+ onClickClose: z.ZodOptional<z.ZodOptional<z.ZodString>>;
9100
9100
  }, "strip", z.ZodTypeAny, {
9101
9101
  id: string;
9102
9102
  type?: "Panel" | undefined;
@@ -9249,7 +9249,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9249
9249
  placeholder?: string | undefined;
9250
9250
  search?: boolean | undefined;
9251
9251
  })[] | undefined;
9252
- onClose?: string | undefined;
9252
+ onClickClose?: string | undefined;
9253
9253
  }, {
9254
9254
  id: string;
9255
9255
  type?: "Panel" | undefined;
@@ -9402,7 +9402,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9402
9402
  placeholder?: string | undefined;
9403
9403
  search?: boolean | undefined;
9404
9404
  })[] | undefined;
9405
- onClose?: string | undefined;
9405
+ onClickClose?: string | undefined;
9406
9406
  }>;
9407
9407
  }, z.UnknownKeysParam, z.ZodTypeAny, {
9408
9408
  params: {
@@ -9557,7 +9557,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9557
9557
  placeholder?: string | undefined;
9558
9558
  search?: boolean | undefined;
9559
9559
  })[] | undefined;
9560
- onClose?: string | undefined;
9560
+ onClickClose?: string | undefined;
9561
9561
  };
9562
9562
  type: "updatePanel";
9563
9563
  }, {
@@ -9713,7 +9713,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9713
9713
  placeholder?: string | undefined;
9714
9714
  search?: boolean | undefined;
9715
9715
  })[] | undefined;
9716
- onClose?: string | undefined;
9716
+ onClickClose?: string | undefined;
9717
9717
  };
9718
9718
  type: "updatePanel";
9719
9719
  }>;
package/dist/handler.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z, ZodError } from 'zod';
2
- import { F as FeltController, c3 as UnwrapPromise, z as zInfer, c as ElementChangeCallbackParams, f as ElementGroupChangeCallbackParams, E as Element, D as MapInteractionEvent, ap as FilterTernary, $ as LayerChangeCallbackParams, a2 as LayerGroupChangeCallbackParams, a5 as LegendItemChangeCallbackParams, at as LayerFilters, as as LayerBoundaries, aO as EntityNode, bn as ToolType, bl as ToolSettingsChangeEvent, c4 as uiActionTriggerSchema, c5 as uiPanelCreateSchema, c1 as ViewportState, c6 as PromiseOrNot, c7 as UnionToIntersection } from './controller-Dfbw7Li5.js';
2
+ import { F as FeltController, c3 as UnwrapPromise, z as zInfer, c as ElementChangeCallbackParams, f as ElementGroupChangeCallbackParams, E as Element, D as MapInteractionEvent, ap as FilterTernary, $ as LayerChangeCallbackParams, a2 as LayerGroupChangeCallbackParams, a5 as LegendItemChangeCallbackParams, at as LayerFilters, as as LayerBoundaries, aO as EntityNode, bn as ToolType, bl as ToolSettingsChangeEvent, c4 as uiActionTriggerSchema, c5 as uiPanelCreateSchema, c1 as ViewportState, c6 as PromiseOrNot, c7 as UnionToIntersection } from './controller-Bg7dynri.js';
3
3
 
4
4
  type FeltControllerFunctions = Omit<FeltController, "iframe">;
5
5
  type Method<TRequest extends {
@@ -4941,7 +4941,7 @@ declare const CreatePanelMessage: z.ZodObject<{
4941
4941
  placeholder?: string | undefined;
4942
4942
  search?: boolean | undefined;
4943
4943
  }>]>, "many">>;
4944
- onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
4944
+ onClickClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
4945
4945
  }, "body" | "footer">, {
4946
4946
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
4947
4947
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -5809,7 +5809,7 @@ declare const CreatePanelMessage: z.ZodObject<{
5809
5809
  onCreate: z.ZodOptional<z.ZodString>;
5810
5810
  onDestroy: z.ZodOptional<z.ZodString>;
5811
5811
  }>>, {
5812
- onClose: z.ZodOptional<z.ZodString>;
5812
+ onClickClose: z.ZodOptional<z.ZodString>;
5813
5813
  body: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
5814
5814
  onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
5815
5815
  onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
@@ -7110,7 +7110,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7110
7110
  placeholder?: string | undefined;
7111
7111
  search?: boolean | undefined;
7112
7112
  })[] | undefined;
7113
- onClose?: string | undefined;
7113
+ onClickClose?: string | undefined;
7114
7114
  }, {
7115
7115
  body: ({
7116
7116
  type: "Button";
@@ -7263,7 +7263,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7263
7263
  placeholder?: string | undefined;
7264
7264
  search?: boolean | undefined;
7265
7265
  })[] | undefined;
7266
- onClose?: string | undefined;
7266
+ onClickClose?: string | undefined;
7267
7267
  }>;
7268
7268
  placement: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7269
7269
  after: z.ZodString;
@@ -7437,7 +7437,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7437
7437
  placeholder?: string | undefined;
7438
7438
  search?: boolean | undefined;
7439
7439
  })[] | undefined;
7440
- onClose?: string | undefined;
7440
+ onClickClose?: string | undefined;
7441
7441
  };
7442
7442
  placement?: {
7443
7443
  after: string;
@@ -7599,7 +7599,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7599
7599
  placeholder?: string | undefined;
7600
7600
  search?: boolean | undefined;
7601
7601
  })[] | undefined;
7602
- onClose?: string | undefined;
7602
+ onClickClose?: string | undefined;
7603
7603
  };
7604
7604
  placement?: {
7605
7605
  after: string;
@@ -7763,7 +7763,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7763
7763
  placeholder?: string | undefined;
7764
7764
  search?: boolean | undefined;
7765
7765
  })[] | undefined;
7766
- onClose?: string | undefined;
7766
+ onClickClose?: string | undefined;
7767
7767
  };
7768
7768
  placement?: {
7769
7769
  after: string;
@@ -7928,7 +7928,7 @@ declare const CreatePanelMessage: z.ZodObject<{
7928
7928
  placeholder?: string | undefined;
7929
7929
  search?: boolean | undefined;
7930
7930
  })[] | undefined;
7931
- onClose?: string | undefined;
7931
+ onClickClose?: string | undefined;
7932
7932
  };
7933
7933
  placement?: {
7934
7934
  after: string;
@@ -9096,7 +9096,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9096
9096
  placeholder?: string | undefined;
9097
9097
  search?: boolean | undefined;
9098
9098
  }>]>, "many">>>;
9099
- onClose: z.ZodOptional<z.ZodOptional<z.ZodString>>;
9099
+ onClickClose: z.ZodOptional<z.ZodOptional<z.ZodString>>;
9100
9100
  }, "strip", z.ZodTypeAny, {
9101
9101
  id: string;
9102
9102
  type?: "Panel" | undefined;
@@ -9249,7 +9249,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9249
9249
  placeholder?: string | undefined;
9250
9250
  search?: boolean | undefined;
9251
9251
  })[] | undefined;
9252
- onClose?: string | undefined;
9252
+ onClickClose?: string | undefined;
9253
9253
  }, {
9254
9254
  id: string;
9255
9255
  type?: "Panel" | undefined;
@@ -9402,7 +9402,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9402
9402
  placeholder?: string | undefined;
9403
9403
  search?: boolean | undefined;
9404
9404
  })[] | undefined;
9405
- onClose?: string | undefined;
9405
+ onClickClose?: string | undefined;
9406
9406
  }>;
9407
9407
  }, z.UnknownKeysParam, z.ZodTypeAny, {
9408
9408
  params: {
@@ -9557,7 +9557,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9557
9557
  placeholder?: string | undefined;
9558
9558
  search?: boolean | undefined;
9559
9559
  })[] | undefined;
9560
- onClose?: string | undefined;
9560
+ onClickClose?: string | undefined;
9561
9561
  };
9562
9562
  type: "updatePanel";
9563
9563
  }, {
@@ -9713,7 +9713,7 @@ declare const UpdatePanelMessage: z.ZodObject<{
9713
9713
  placeholder?: string | undefined;
9714
9714
  search?: boolean | undefined;
9715
9715
  })[] | undefined;
9716
- onClose?: string | undefined;
9716
+ onClickClose?: string | undefined;
9717
9717
  };
9718
9718
  type: "updatePanel";
9719
9719
  }>;
package/dist/handler.js CHANGED
@@ -1 +1 @@
1
- import{z as d}from"zod";import{z as L}from"zod";import{z as v}from"zod";function e(i,N){return v.strictObject({type:v.literal(i),params:N})}function I(i,N){return v.strictObject({eventName:v.literal(i),id:v.string(),options:N})}function g(i){return v.strictObject({eventName:v.literal(i),id:v.string()})}import{z as s}from"zod";var ce=s.number(),de=s.number(),ye=s.object({latitude:de,longitude:ce}),O=s.tuple([ce,de]),K=s.object({type:s.literal("Polygon"),coordinates:s.array(s.array(O).min(4).refine(i=>i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1],"The last point of each ring must be identical to the first"))}),ge=s.object({type:s.literal("MultiPolygon"),coordinates:s.array(K.shape.coordinates)}),go=s.object({type:s.literal("LineString"),coordinates:s.array(O).min(2)}),_=s.object({type:s.literal("MultiLineString"),coordinates:s.array(go.shape.coordinates)}),at=s.number().min(1).max(23),U=s.tuple([ce,de,ce,de]),A=s.object({show:s.array(s.string()).optional(),hide:s.array(s.string()).optional()}),uo=s.enum(["asc","desc"]),ue=s.object({attribute:s.string(),direction:uo});import{z as t}from"zod";var C=t.object({id:t.string(),groupId:t.string().nullable(),color:t.string(),name:t.string().nullable(),description:t.string().nullable(),attributes:t.record(t.string(),t.unknown()),interaction:t.enum(["default","locked"]).optional()}),Se=t.object({imageUrl:t.string().nullable()}),Ge=t.object({strokeOpacity:t.number(),strokeWidth:t.number(),strokeStyle:t.enum(["solid","dashed","dotted"])}),ho=t.enum(["meter","kilometer","foot","mile"]),he=C.extend(Se.shape).extend({type:t.literal("Place"),coordinates:O,symbol:t.string(),frame:t.enum(["frame-circle","frame-square"]).nullable(),hideLabel:t.boolean()}),Q=C.extend(Se.shape).extend(Ge.shape).extend({type:t.literal("Path"),coordinates:_.shape.coordinates,distanceMarker:t.boolean(),routingMode:t.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:t.boolean()}),$=C.extend(Se.shape).extend(Ge.shape).extend({type:t.literal("Polygon"),coordinates:K.shape.coordinates,fillOpacity:t.number().min(0).max(1),areaMarker:t.boolean()}),fe=C.extend(Se.shape).extend(Ge.shape).extend({type:t.literal("Circle"),center:O,radius:t.number(),radiusMarker:t.boolean(),radiusDisplayAngle:t.number(),radiusDisplayUnit:ho.nullable(),fillOpacity:t.number().min(0).max(1)}),X=C.extend({type:t.literal("Marker"),coordinates:_.shape.coordinates,opacity:t.number().min(0).max(1),size:t.number().min(0).max(100),zoom:t.number().min(0).max(23)}),Y=C.extend({type:t.literal("Highlighter"),coordinates:ge.shape.coordinates,renderHoles:t.boolean(),opacity:t.number().min(0).max(1)}),nt=t.object({position:O,rotation:t.number(),scale:t.number(),zoom:t.number().min(0).max(23),text:t.string(),align:t.enum(["left","center","right"]),style:t.enum(["italic","light","regular","caps"]),name:t.string()}),Pe=C.extend(nt.shape).extend({type:t.literal("Text")}),Te=C.extend(nt.shape).extend({type:t.literal("Note"),widthScale:t.number().min(0)}),ee=C.extend({type:t.literal("Image"),coordinates:_.shape.coordinates,imageUrl:t.string(),opacity:t.number().min(0).max(1)}).omit({color:!0}),fo=C.extend({type:t.literal("Link"),coordinates:_.shape.coordinates,url:t.string()}),H={type:!0,coordinates:!0},P={id:!0},ze=he.partial().extend(he.pick(H).shape).omit(P),xe=Q.partial().extend(Q.pick(H).shape).omit(P),Fe=$.partial().extend($.pick(H).shape).omit(P),ke=fe.partial().extend(fe.pick({type:!0,center:!0,radius:!0}).shape).omit(P),Be=X.partial().extend(X.pick(H).shape).omit(P),ve=Y.partial().extend(Y.pick(H).shape).omit(P),Oe=Pe.partial().omit({...P,name:!0,type:!0}).extend({type:t.literal("Text"),text:t.string()}),je=Te.partial().omit({...P,name:!0,type:!0}).extend({type:t.literal("Note"),text:t.string()}),So=ee.partial().extend(ee.pick({...H,imageUrl:!0}).shape).omit(P),rt=t.discriminatedUnion("type",[ze,xe,Fe,ke,Be,ve,So,Oe,je]);var Jn=Q.omit({coordinates:!0}),Zn=$.omit({coordinates:!0});var qn=X.omit({coordinates:!0}),Wn=Y.omit({coordinates:!0});var Kn=ee.omit({coordinates:!0}),_n=fo.omit({coordinates:!0}),T={type:!0,id:!0},xo=he.partial().extend(he.pick(T).shape),bo=Q.partial().extend(Q.pick(T).shape),Eo=$.partial().extend($.pick(T).shape),Io=fe.partial().extend(fe.pick(T).shape),Co=X.partial().extend(X.pick(T).shape),Lo=Y.partial().extend(Y.pick(T).shape),Mo=Pe.partial().extend(Pe.pick(T).shape).omit({name:!0}),Uo=Te.partial().extend(Te.pick(T).shape).omit({name:!0}),Po=ee.partial().extend(ee.pick(T).shape),it=t.discriminatedUnion("type",[xo,bo,Eo,Io,Co,Lo,Mo,Uo,Po]),lt=t.object({ids:t.array(t.string()).optional()}),st=t.object({ids:t.array(t.string()).optional()});var To=e("getElement",L.string()),Go=e("getElementGeometry",L.string()),zo=e("getElements",lt.optional()),Fo=e("getElementGroup",L.string()),ko=e("getElementGroups",st.optional()),Bo=e("setElementGroupVisibility",A),vo=I("onElementChange",L.object({id:L.string()})),Oo=g("onElementCreate"),jo=g("onElementCreateEnd"),Vo=I("onElementDelete",L.object({id:L.string()})),Ao=I("onElementGroupChange",L.object({id:L.string()})),wo=e("createElement",rt),Ro=e("updateElement",it),Do=e("deleteElement",L.string()),mt={methods:[To,Go,zo,Fo,ko,Bo,wo,Ro,Do],listeners:[vo,Oo,jo,Vo,Ao]};var No=g("onPointerClick"),Ho=g("onPointerMove"),pt={methods:null,listeners:[No,Ho]};import{z as r}from"zod";import{z as l}from"zod";var Jo=l.enum(["in","ni"]),Zo=l.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),ir=l.enum(["and","or"]),ct=l.union([l.number(),l.string(),l.boolean(),l.null()]),dt=l.string().or(l.null()),qo=l.tuple([dt,Jo,l.array(ct).or(l.null())]),Wo=l.tuple([dt,Zo,ct]),Ve=l.union([qo,Wo]),Ae=l.tuple([l.lazy(()=>l.union([Ae,Ve,l.null(),l.boolean()])),l.enum(["and","or"]),l.lazy(()=>l.union([Ae,Ve,l.null(),l.boolean()]))]),G=l.union([Ae,Ve,l.null(),l.boolean()]),z=l.union([U,K,ge,l.array(O)]);import{z as a}from"zod";var yt=a.enum(["avg","max","min","sum","median"]),gt=a.enum(["avg","max","min","sum","count"]),Ko=a.object({method:yt,attribute:a.string()}),_o=a.object({methods:a.array(a.union([yt,a.literal("count")])),attribute:a.string().optional()}),ut=a.object({boundary:z.optional(),filters:G.optional(),aggregation:Ko.optional()}),ht=a.object({layerId:a.string(),attribute:a.string(),limit:a.number().optional(),boundary:z.optional(),filters:G.optional(),values:ut.optional()}),pr=a.object({key:a.union([a.number(),a.string(),a.boolean()]),value:a.number().nullable()}),Qo=a.object({type:a.literal("equal-intervals"),count:a.number()}),$o=a.object({type:a.literal("time-interval"),interval:a.enum(["hour","day","week","month","year"])}),ft=a.object({layerId:a.string(),attribute:a.string(),steps:a.union([Qo,$o,a.array(a.number())]),boundary:z.optional(),filters:G.optional(),values:ut.optional()}),cr=a.object({min:a.number(),max:a.number(),value:a.number()}),St=a.object({layerId:a.string(),boundary:z.optional(),filters:G.optional(),aggregation:_o}),xt=a.enum(["h3"]),Xo=a.object({type:xt,resolution:a.number(),method:gt.extract(["count"])}),Yo=a.object({type:xt,resolution:a.number(),method:gt.exclude(["count"]),attribute:a.string()}),ea=a.union([Xo,Yo]),bt=a.object({layerId:a.string(),boundary:z.optional(),filters:G.optional(),gridConfig:ea});import{z as n}from"zod";var ur=n.enum(["processing","completed","failed","incomplete"]),Et=n.object({type:n.literal("geoJsonUrl"),url:n.string().url(),refreshInterval:n.number().min(250).max(5*60*1e3).nullable().optional()}),It=n.object({type:n.literal("geoJsonData"),data:n.object({}).passthrough().or(n.instanceof(ArrayBuffer))}),Ct=n.object({type:n.literal("geoJsonFile"),file:n.instanceof(File)}),Lt=n.object({id:n.string(),style:n.object({}).passthrough().optional(),shownInLegend:n.boolean().optional(),name:n.string().optional(),caption:n.string().optional(),description:n.string().optional(),bounds:U.optional(),source:n.union([Et,It,Ct]).optional()}),Mt=n.object({ids:n.array(n.string()).optional()}),Ut=n.object({ids:n.array(n.string()).optional()}),J=n.object({id:n.string(),layerId:n.string()}),Pt=n.object({ids:J.array().optional(),layerIds:n.string().array().optional()}),Tt=n.object({layerIds:n.array(n.string()).optional(),areaQuery:n.union([n.object({coordinates:ye}),n.object({boundary:U})]).optional()}),ta=n.object({Point:n.object({}).passthrough().optional(),Line:n.object({}).passthrough().optional(),Polygon:n.object({}).passthrough().optional()}),Gt=n.object({source:n.union([Et,It,Ct]),name:n.string(),bounds:U.optional(),caption:n.string().optional(),description:n.string().optional(),geometryStyles:ta.optional()});var oa=e("getLayer",r.string()),aa=e("getLayers",Mt.optional()),na=e("setLayerVisibility",A),ra=I("onLayerChange",r.object({id:r.string()})),ia=e("setLayerStyle",r.object({id:r.string(),style:r.object({}).passthrough()})),la=e("setLayerLegendVisibility",A),sa=e("createLayersFromGeoJson",Gt),ma=e("updateLayer",Lt),pa=e("deleteLayer",r.string()),ca=e("getLayerGroup",r.string()),da=e("getLayerGroups",Ut.optional()),ya=e("setLayerGroupVisibility",A),ga=e("setLayerGroupLegendVisibility",A),ua=I("onLayerGroupChange",r.object({id:r.string()})),ha=e("getLegendItem",J),fa=e("getLegendItems",Pt.optional()),Sa=I("onLegendItemChange",J),xa=e("setLegendItemVisibility",r.object({show:J.array().optional(),hide:J.array().optional()})),ba=e("getLayerFilters",r.string()),Ea=e("setLayerFilters",r.object({layerId:r.string(),filters:G,note:r.string().optional()})),Ia=I("onLayerFiltersChange",r.object({layerId:r.string()})),Ca=e("getLayerBoundaries",r.string()),La=e("setLayerBoundary",r.object({layerIds:r.array(r.string()),boundary:z.nullable()})),Ma=I("onLayerBoundariesChange",r.object({layerId:r.string()})),Ua=e("getRenderedFeatures",Tt.optional()),Pa=e("getFeature",r.object({id:r.string().or(r.number()),layerId:r.string()})),Ta=e("getFeatures",r.object({layerId:r.string(),filters:G.optional(),sorting:ue.optional(),boundary:z.optional(),search:r.string().optional(),pagination:r.string().optional().nullish()})),Ga=e("getGeoJsonFeature",r.object({id:r.string().or(r.number()),layerId:r.string()})),za=e("getCategoryData",ht),Fa=e("getHistogramData",ft),ka=e("getAggregates",St),Ba=e("getPrecomputedAggregates",bt),va=e("getLayerSchema",r.string()),zt={methods:[oa,aa,na,ia,la,sa,pa,ma,ca,da,ya,ga,ha,fa,xa,ba,Ea,Ca,La,Ua,Pa,Ta,Ga,za,Fa,ka,Ba,va],listeners:[ra,ua,Sa,Ia,Ma]};import{z as Oa}from"zod";var ja=e("getMapDetails",Oa.undefined()),Ft={methods:[ja],listeners:[]};import{z as be}from"zod";import{z as j}from"zod";var kt=j.object({id:j.string().or(j.number()),layerId:j.string(),showPopup:j.boolean().optional(),fitViewport:j.boolean().or(j.object({maxZoom:j.number()})).optional()});var Va=e("getSelection",be.undefined()),Aa=g("onSelectionChange"),wa=e("selectFeature",kt),Ra=e("clearSelection",be.object({features:be.boolean().optional(),elements:be.boolean().optional()}).optional()),Bt={methods:[Va,wa,Ra],listeners:[Aa]};import{z as $a}from"zod";import{z as u}from"zod";var vt=["circle","highlighter","line","marker","note","pin","polygon","route","text"],Da=[...vt,"link"],Ot=u.enum(Da),jt=u.enum(vt),Na=ze.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:u.enum(["enter name","add another","select"])}).required(),Ha=xe.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Ja=xe.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Za=Fe.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),qa=ke.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Wa=Be.pick({color:!0,opacity:!0,size:!0}).required(),Ka=ve.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:u.number().min(0).max(200)}).required(),_a=Oe.pick({color:!0,align:!0,style:!0}).required(),Qa=je.pick({color:!0,align:!0,style:!0}).required(),Vt=u.discriminatedUnion("tool",[Na.partial().extend({tool:u.literal("pin")}),Ha.partial().extend({tool:u.literal("line")}),Ja.partial().extend({tool:u.literal("route")}),Za.partial().extend({tool:u.literal("polygon")}),qa.partial().extend({tool:u.literal("circle")}),Wa.partial().extend({tool:u.literal("marker")}),Ka.partial().extend({tool:u.literal("highlighter")}),_a.partial().extend({tool:u.literal("text")}),Qa.partial().extend({tool:u.literal("note")})]);var Xa=e("setTool",Ot.nullable()),Ya=e("getTool",$a.undefined()),en=g("onToolChange"),tn=e("setToolSettings",Vt),on=e("getToolSettings",jt),an=g("onToolSettingsChange"),At={methods:[Xa,Ya,tn,on],listeners:[en,an]};import{z as me}from"zod";import{z as o}from"zod";import{z as w}from"zod";var R=w.union([w.object({after:w.string()}),w.object({before:w.string()}),w.object({at:w.enum(["start","end"])})]);import{z as x}from"zod";import{z as S}from"zod";var nn=S.object({onCreate:S.function().args().returns(S.void()).optional(),onDestroy:S.function().args().returns(S.void()).optional()}),rn=S.object({onCreate:S.string().optional(),onDestroy:S.string().optional()}),y=nn.extend({id:S.string()}),wt=y.partial({id:!0}),m={params:wt,clonable:wt.extend(rn.shape)},Z=y.extend({label:S.string().optional()}),q={params:Z.extend(m.params.shape),clonable:Z.extend(m.clonable.shape)};function p(i){return i.partial().extend({id:S.string(),type:i.shape.type})}var we=x.object({type:x.literal("ActionTrigger"),label:x.string(),disabled:x.boolean().optional()}),te={read:y.extend(we.shape).extend({onTrigger:x.function().returns(x.void())}),create:m.params.extend(we.shape).extend({type:x.undefined()}).extend({onTrigger:x.function().returns(x.void())}),clonable:m.clonable.extend(we.shape).extend({type:x.undefined()}).extend({onTrigger:x.string()})};import{z as ln}from"zod";var Re=y.extend({type:ln.literal("FlexibleSpace")}),Rt=Re.partial({id:!0}),F={params:Rt,clonable:Rt.extend(m.clonable.shape)},De={params:p(F.params),clonable:p(F.clonable)};import{z as b}from"zod";import{z as se}from"zod";import{z as D}from"zod";var oe=y.extend({type:D.literal("Button"),label:D.string(),variant:D.enum(["primary","outlined","transparent","transparentThin"]).optional(),disabled:D.boolean().optional(),onClick:D.function().returns(D.void())}),Dt=oe.extend(m.params.shape),k={params:Dt,clonable:Dt.extend(m.clonable.shape).extend({onClick:D.string()})},Ne={params:p(k.params),clonable:p(k.clonable)};import{z as M}from"zod";import{z as Nt}from"zod";var ae=y.extend({type:Nt.literal("Text"),content:Nt.string()}),Ht=ae.extend(m.params.shape),B={params:Ht,clonable:Ht.extend(m.clonable.shape)},He={params:p(B.params),clonable:p(B.clonable)};var Je=y.extend({type:M.literal("ButtonGroup"),align:M.enum(["start","end"]).optional(),items:M.array(M.union([oe,ae,Re]))}),Jt=Je.extend(m.params.shape).omit({items:!0}).extend({items:M.array(M.union([k.params,B.params,F.params]))}),ne={params:Jt,clonable:Jt.extend(m.clonable.shape).extend({items:M.array(M.union([k.clonable,B.clonable,F.clonable]))})},Ze={params:p(ne.params),clonable:p(ne.clonable.extend({items:M.array(M.union([k.clonable,B.clonable,F.clonable]))}))};import{z as sn}from"zod";var qe=y.extend({type:sn.literal("Divider")}),Zt=qe.partial({id:!0}),re={params:Zt,clonable:Zt.extend(m.clonable.shape)},We={params:p(re.params),clonable:p(re.clonable)};import{z as f}from"zod";var Ke=Z.extend({type:f.literal("Select"),options:f.array(f.object({label:f.string(),value:f.string()})),value:f.string().optional(),placeholder:f.string().optional(),search:f.boolean().optional(),onChange:f.function().args(f.object({value:f.string()})).returns(f.void())}),qt=Ke.extend(q.params.shape),ie={params:qt,clonable:qt.extend(q.clonable.shape).extend({onChange:f.string()})},_e={params:p(ie.params),clonable:p(ie.clonable)};import{z as c}from"zod";var Qe=Z.extend({type:c.literal("TextInput"),value:c.string(),placeholder:c.string().optional(),onChange:c.function().args(c.object({value:c.string()})).returns(c.void()).optional(),onBlur:c.function().args(c.object({value:c.string()})).returns(c.void()).optional(),onFocus:c.function().args(c.object({value:c.string()})).returns(c.void()).optional()}),Wt=Qe.extend(q.params.shape),le={params:Wt,clonable:Wt.extend(q.clonable.shape).extend({onChange:c.string().optional(),onBlur:c.string().optional(),onFocus:c.string().optional()})},$e={params:p(le.params),clonable:p(le.clonable)};var Xe=se.discriminatedUnion("type",[oe,ae,Je,qe,Qe,Ke]),V={params:se.discriminatedUnion("type",[k.params,B.params,ne.params,re.params,le.params,ie.params]),clonable:se.discriminatedUnion("type",[k.clonable,B.clonable,ne.clonable,re.clonable,le.clonable,ie.clonable])},Ye={params:se.discriminatedUnion("type",[Ne.params,He.params,Ze.params,$e.params,_e.params,De.params,We.params]),clonable:se.discriminatedUnion("type",[Ne.clonable,He.clonable,Ze.clonable,$e.clonable,_e.clonable,De.clonable,We.clonable])};var mn=y.extend({type:b.literal("Panel"),title:b.string().optional(),body:b.array(Xe),footer:b.array(Xe).optional(),onClose:b.function().returns(b.void()).optional()}),Kt=mn.extend(m.params.shape).partial({type:!0}).omit({body:!0,footer:!0}).extend({body:b.array(V.params),footer:b.array(V.params).optional()}),Ee={params:Kt,clonable:Kt.extend(m.clonable.shape).extend({onClose:b.string().optional(),body:b.array(V.clonable),footer:b.array(V.clonable).optional()})};var ji=o.object({actionTrigger:te.create,placement:R.optional()}),_t=o.object({actionTrigger:te.clonable,placement:R.optional()}),Vi=te.create.partial().required({id:!0}),Qt=te.clonable.partial().required({id:!0}),Ai=o.object({panel:Ee.params,placement:R.optional()}),$t=o.object({panel:Ee.clonable,placement:R.optional()}),Xt=Ee.clonable.partial().required({id:!0}),wi=o.object({panelId:o.string(),elements:o.array(o.object({element:o.union([V.params,F.params]),container:o.union([o.literal("body"),o.literal("footer"),o.object({id:o.string()})]).optional(),placement:R.optional()}))}),Yt=o.object({panelId:o.string(),elements:o.array(o.object({element:o.union([V.clonable,F.clonable]),container:o.union([o.literal("body"),o.literal("footer"),o.object({id:o.string()})]).optional(),placement:R.optional()}))}),Ri=o.object({panelId:o.string(),elements:o.array(o.object({element:Ye.params}))}),eo=o.object({panelId:o.string(),elements:o.array(o.object({element:Ye.clonable}))}),to=o.object({panelId:o.string(),elements:o.array(o.string())}),oo=o.object({showLegend:o.boolean().optional(),cooperativeGestures:o.boolean().optional(),fullScreenButton:o.boolean().optional(),geolocation:o.boolean().optional(),zoomControls:o.boolean().optional(),scaleBar:o.boolean().optional()}),ao=o.object({featureSelectPanel:o.boolean().optional(),featureHoverPanel:o.boolean().optional(),elementSelectPanel:o.boolean().optional(),linkClickOpen:o.boolean().optional(),imageLightboxOpen:o.boolean().optional()});var pn=e("createActionTrigger",_t),cn=e("updateActionTrigger",Qt),dn=e("deleteActionTrigger",me.string()),yn=e("createPanel",$t),gn=e("updatePanel",Xt),un=e("deletePanel",me.string()),hn=e("createPanelElements",Yt),fn=e("updatePanelElements",eo),Sn=e("deletePanelElements",to),xn=e("updateUiControls",oo),bn=e("setOnMapInteractionsUi",ao),En=e("showLayerDataTable",me.object({layerId:me.string(),sorting:ue.optional()}).optional()),In=e("hideLayerDataTable",me.undefined()),no={methods:[pn,cn,dn,yn,gn,un,hn,fn,Sn,xn,bn,En,In],listeners:null};import{z as so}from"zod";import{z as Ce}from"zod";var Ie=Ce.object({center:ye,zoom:at}),ro=Ce.object({center:Ie.shape.center.optional(),zoom:Ie.shape.zoom.optional()}),io=Ce.object({minZoom:Ie.shape.zoom.nullish(),maxZoom:Ie.shape.zoom.nullish(),bounds:U.nullish()}).nullable(),lo=Ce.object({bounds:U});var Cn=e("getViewport",so.undefined()),Ln=e("setViewport",ro),Mn=e("getViewportConstraints",so.undefined()),Un=e("setViewportConstraints",io),Pn=e("fitViewportToBounds",lo),Tn=g("onViewportMove"),Gn=g("onViewportMoveEnd"),zn=g("onMapIdle"),mo={methods:[Ln,Cn,Mn,Un,Pn],listeners:[Tn,Gn,zn]};var et=[no,mo,zt,mt,Bt,pt,At,Ft];function dl(i,N,tt){let Le=new Map;async function ot(E){if(!On.safeParse(E.data).success){tt?.onUnknownMessage?.(E.data);return}let pe=yo.safeParse(E.data);if(!pe.success){tt?.onInvalidMessage?.(E.data,pe.error),E.ports[0]?.postMessage(po(pe.error.message));return}let{data:h}=pe;if(h.type==="felt.ready")E.ports[0]?.postMessage(!0);else if(h.type==="felt.addListener"){if(h.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let W="options"in h.event?{options:"options"in h.event?h.event.options:void 0,handler:Ue=>{E.ports[0]?.postMessage(Ue)}}:{handler:Ue=>{E.ports[0]?.postMessage(Ue)}},Me=N.listeners[h.event.eventName](W);Le.set(h.event.id,Me)}else if(h.type==="felt.removeListener")Le.get(h.id)?.(),Le.delete(h.id);else try{let W=N.methods[h.type],Me=await W(h.params);E.ports[0]?.postMessage(Me)}catch(W){E.ports[0]?.postMessage(po(W))}}return i.addEventListener("message",ot),()=>{i.removeEventListener("message",ot)}}var co={methods:et.map(i=>i.methods??[]).flat(),listeners:et.map(i=>i.listeners??[]).flat()},Fn=d.discriminatedUnion("eventName",[d.strictObject({eventName:d.literal("")}),d.strictObject({eventName:d.literal("onGenericEvent"),id:d.string(),options:d.object({id:d.string()})}),...co.listeners]),kn=d.strictObject({type:d.literal("felt.addListener"),event:Fn}),Bn=d.strictObject({type:d.literal("felt.removeListener"),id:d.string()}),vn=d.strictObject({type:d.literal("felt.ready")}),yo=d.discriminatedUnion("type",[vn,kn,Bn,...co.methods]),On=d.object({type:d.enum(yo.options.map(i=>i.shape.type.value))});function po(i){return{__error__:jn(i)}}function jn(i){return i instanceof Error?i.message:typeof i=="object"&&i!==null&&"message"in i?String(i.message):typeof i=="string"?i:"Unknown error"}export{dl as createMessageHandler};
1
+ import{z as d}from"zod";import{z as L}from"zod";import{z as v}from"zod";function e(i,N){return v.strictObject({type:v.literal(i),params:N})}function I(i,N){return v.strictObject({eventName:v.literal(i),id:v.string(),options:N})}function g(i){return v.strictObject({eventName:v.literal(i),id:v.string()})}import{z as s}from"zod";var ce=s.number(),de=s.number(),ye=s.object({latitude:de,longitude:ce}),O=s.tuple([ce,de]),K=s.object({type:s.literal("Polygon"),coordinates:s.array(s.array(O).min(4).refine(i=>i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1],"The last point of each ring must be identical to the first"))}),ge=s.object({type:s.literal("MultiPolygon"),coordinates:s.array(K.shape.coordinates)}),go=s.object({type:s.literal("LineString"),coordinates:s.array(O).min(2)}),_=s.object({type:s.literal("MultiLineString"),coordinates:s.array(go.shape.coordinates)}),at=s.number().min(1).max(23),U=s.tuple([ce,de,ce,de]),A=s.object({show:s.array(s.string()).optional(),hide:s.array(s.string()).optional()}),uo=s.enum(["asc","desc"]),ue=s.object({attribute:s.string(),direction:uo});import{z as t}from"zod";var C=t.object({id:t.string(),groupId:t.string().nullable(),color:t.string(),name:t.string().nullable(),description:t.string().nullable(),attributes:t.record(t.string(),t.unknown()),interaction:t.enum(["default","locked"]).optional()}),Se=t.object({imageUrl:t.string().nullable()}),Ge=t.object({strokeOpacity:t.number(),strokeWidth:t.number(),strokeStyle:t.enum(["solid","dashed","dotted"])}),ho=t.enum(["meter","kilometer","foot","mile"]),he=C.extend(Se.shape).extend({type:t.literal("Place"),coordinates:O,symbol:t.string(),frame:t.enum(["frame-circle","frame-square"]).nullable(),hideLabel:t.boolean()}),Q=C.extend(Se.shape).extend(Ge.shape).extend({type:t.literal("Path"),coordinates:_.shape.coordinates,distanceMarker:t.boolean(),routingMode:t.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:t.boolean()}),$=C.extend(Se.shape).extend(Ge.shape).extend({type:t.literal("Polygon"),coordinates:K.shape.coordinates,fillOpacity:t.number().min(0).max(1),areaMarker:t.boolean()}),fe=C.extend(Se.shape).extend(Ge.shape).extend({type:t.literal("Circle"),center:O,radius:t.number(),radiusMarker:t.boolean(),radiusDisplayAngle:t.number(),radiusDisplayUnit:ho.nullable(),fillOpacity:t.number().min(0).max(1)}),X=C.extend({type:t.literal("Marker"),coordinates:_.shape.coordinates,opacity:t.number().min(0).max(1),size:t.number().min(0).max(100),zoom:t.number().min(0).max(23)}),Y=C.extend({type:t.literal("Highlighter"),coordinates:ge.shape.coordinates,renderHoles:t.boolean(),opacity:t.number().min(0).max(1)}),nt=t.object({position:O,rotation:t.number(),scale:t.number(),zoom:t.number().min(0).max(23),text:t.string(),align:t.enum(["left","center","right"]),style:t.enum(["italic","light","regular","caps"]),name:t.string()}),Pe=C.extend(nt.shape).extend({type:t.literal("Text")}),Te=C.extend(nt.shape).extend({type:t.literal("Note"),widthScale:t.number().min(0)}),ee=C.extend({type:t.literal("Image"),coordinates:_.shape.coordinates,imageUrl:t.string(),opacity:t.number().min(0).max(1)}).omit({color:!0}),fo=C.extend({type:t.literal("Link"),coordinates:_.shape.coordinates,url:t.string()}),H={type:!0,coordinates:!0},P={id:!0},ze=he.partial().extend(he.pick(H).shape).omit(P),xe=Q.partial().extend(Q.pick(H).shape).omit(P),Fe=$.partial().extend($.pick(H).shape).omit(P),ke=fe.partial().extend(fe.pick({type:!0,center:!0,radius:!0}).shape).omit(P),Be=X.partial().extend(X.pick(H).shape).omit(P),ve=Y.partial().extend(Y.pick(H).shape).omit(P),Oe=Pe.partial().omit({...P,name:!0,type:!0}).extend({type:t.literal("Text"),text:t.string()}),je=Te.partial().omit({...P,name:!0,type:!0}).extend({type:t.literal("Note"),text:t.string()}),So=ee.partial().extend(ee.pick({...H,imageUrl:!0}).shape).omit(P),rt=t.discriminatedUnion("type",[ze,xe,Fe,ke,Be,ve,So,Oe,je]);var Jn=Q.omit({coordinates:!0}),Zn=$.omit({coordinates:!0});var qn=X.omit({coordinates:!0}),Wn=Y.omit({coordinates:!0});var Kn=ee.omit({coordinates:!0}),_n=fo.omit({coordinates:!0}),T={type:!0,id:!0},xo=he.partial().extend(he.pick(T).shape),bo=Q.partial().extend(Q.pick(T).shape),Eo=$.partial().extend($.pick(T).shape),Io=fe.partial().extend(fe.pick(T).shape),Co=X.partial().extend(X.pick(T).shape),Lo=Y.partial().extend(Y.pick(T).shape),Mo=Pe.partial().extend(Pe.pick(T).shape).omit({name:!0}),Uo=Te.partial().extend(Te.pick(T).shape).omit({name:!0}),Po=ee.partial().extend(ee.pick(T).shape),it=t.discriminatedUnion("type",[xo,bo,Eo,Io,Co,Lo,Mo,Uo,Po]),lt=t.object({ids:t.array(t.string()).optional()}),st=t.object({ids:t.array(t.string()).optional()});var To=e("getElement",L.string()),Go=e("getElementGeometry",L.string()),zo=e("getElements",lt.optional()),Fo=e("getElementGroup",L.string()),ko=e("getElementGroups",st.optional()),Bo=e("setElementGroupVisibility",A),vo=I("onElementChange",L.object({id:L.string()})),Oo=g("onElementCreate"),jo=g("onElementCreateEnd"),Vo=I("onElementDelete",L.object({id:L.string()})),Ao=I("onElementGroupChange",L.object({id:L.string()})),wo=e("createElement",rt),Ro=e("updateElement",it),Do=e("deleteElement",L.string()),mt={methods:[To,Go,zo,Fo,ko,Bo,wo,Ro,Do],listeners:[vo,Oo,jo,Vo,Ao]};var No=g("onPointerClick"),Ho=g("onPointerMove"),pt={methods:null,listeners:[No,Ho]};import{z as r}from"zod";import{z as l}from"zod";var Jo=l.enum(["in","ni"]),Zo=l.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),ir=l.enum(["and","or"]),ct=l.union([l.number(),l.string(),l.boolean(),l.null()]),dt=l.string().or(l.null()),qo=l.tuple([dt,Jo,l.array(ct).or(l.null())]),Wo=l.tuple([dt,Zo,ct]),Ve=l.union([qo,Wo]),Ae=l.tuple([l.lazy(()=>l.union([Ae,Ve,l.null(),l.boolean()])),l.enum(["and","or"]),l.lazy(()=>l.union([Ae,Ve,l.null(),l.boolean()]))]),G=l.union([Ae,Ve,l.null(),l.boolean()]),z=l.union([U,K,ge,l.array(O)]);import{z as a}from"zod";var yt=a.enum(["avg","max","min","sum","median"]),gt=a.enum(["avg","max","min","sum","count"]),Ko=a.object({method:yt,attribute:a.string()}),_o=a.object({methods:a.array(a.union([yt,a.literal("count")])),attribute:a.string().optional()}),ut=a.object({boundary:z.optional(),filters:G.optional(),aggregation:Ko.optional()}),ht=a.object({layerId:a.string(),attribute:a.string(),limit:a.number().optional(),boundary:z.optional(),filters:G.optional(),values:ut.optional()}),pr=a.object({key:a.union([a.number(),a.string(),a.boolean()]),value:a.number().nullable()}),Qo=a.object({type:a.literal("equal-intervals"),count:a.number()}),$o=a.object({type:a.literal("time-interval"),interval:a.enum(["hour","day","week","month","year"])}),ft=a.object({layerId:a.string(),attribute:a.string(),steps:a.union([Qo,$o,a.array(a.number())]),boundary:z.optional(),filters:G.optional(),values:ut.optional()}),cr=a.object({min:a.number(),max:a.number(),value:a.number()}),St=a.object({layerId:a.string(),boundary:z.optional(),filters:G.optional(),aggregation:_o}),xt=a.enum(["h3"]),Xo=a.object({type:xt,resolution:a.number(),method:gt.extract(["count"])}),Yo=a.object({type:xt,resolution:a.number(),method:gt.exclude(["count"]),attribute:a.string()}),ea=a.union([Xo,Yo]),bt=a.object({layerId:a.string(),boundary:z.optional(),filters:G.optional(),gridConfig:ea});import{z as n}from"zod";var ur=n.enum(["processing","completed","failed","incomplete"]),Et=n.object({type:n.literal("geoJsonUrl"),url:n.string().url(),refreshInterval:n.number().min(250).max(5*60*1e3).nullable().optional()}),It=n.object({type:n.literal("geoJsonData"),data:n.object({}).passthrough().or(n.instanceof(ArrayBuffer))}),Ct=n.object({type:n.literal("geoJsonFile"),file:n.instanceof(File)}),Lt=n.object({id:n.string(),style:n.object({}).passthrough().optional(),shownInLegend:n.boolean().optional(),name:n.string().optional(),caption:n.string().optional(),description:n.string().optional(),bounds:U.optional(),source:n.union([Et,It,Ct]).optional()}),Mt=n.object({ids:n.array(n.string()).optional()}),Ut=n.object({ids:n.array(n.string()).optional()}),J=n.object({id:n.string(),layerId:n.string()}),Pt=n.object({ids:J.array().optional(),layerIds:n.string().array().optional()}),Tt=n.object({layerIds:n.array(n.string()).optional(),areaQuery:n.union([n.object({coordinates:ye}),n.object({boundary:U})]).optional()}),ta=n.object({Point:n.object({}).passthrough().optional(),Line:n.object({}).passthrough().optional(),Polygon:n.object({}).passthrough().optional()}),Gt=n.object({source:n.union([Et,It,Ct]),name:n.string(),bounds:U.optional(),caption:n.string().optional(),description:n.string().optional(),geometryStyles:ta.optional()});var oa=e("getLayer",r.string()),aa=e("getLayers",Mt.optional()),na=e("setLayerVisibility",A),ra=I("onLayerChange",r.object({id:r.string()})),ia=e("setLayerStyle",r.object({id:r.string(),style:r.object({}).passthrough()})),la=e("setLayerLegendVisibility",A),sa=e("createLayersFromGeoJson",Gt),ma=e("updateLayer",Lt),pa=e("deleteLayer",r.string()),ca=e("getLayerGroup",r.string()),da=e("getLayerGroups",Ut.optional()),ya=e("setLayerGroupVisibility",A),ga=e("setLayerGroupLegendVisibility",A),ua=I("onLayerGroupChange",r.object({id:r.string()})),ha=e("getLegendItem",J),fa=e("getLegendItems",Pt.optional()),Sa=I("onLegendItemChange",J),xa=e("setLegendItemVisibility",r.object({show:J.array().optional(),hide:J.array().optional()})),ba=e("getLayerFilters",r.string()),Ea=e("setLayerFilters",r.object({layerId:r.string(),filters:G,note:r.string().optional()})),Ia=I("onLayerFiltersChange",r.object({layerId:r.string()})),Ca=e("getLayerBoundaries",r.string()),La=e("setLayerBoundary",r.object({layerIds:r.array(r.string()),boundary:z.nullable()})),Ma=I("onLayerBoundariesChange",r.object({layerId:r.string()})),Ua=e("getRenderedFeatures",Tt.optional()),Pa=e("getFeature",r.object({id:r.string().or(r.number()),layerId:r.string()})),Ta=e("getFeatures",r.object({layerId:r.string(),filters:G.optional(),sorting:ue.optional(),boundary:z.optional(),search:r.string().optional(),pagination:r.string().optional().nullish()})),Ga=e("getGeoJsonFeature",r.object({id:r.string().or(r.number()),layerId:r.string()})),za=e("getCategoryData",ht),Fa=e("getHistogramData",ft),ka=e("getAggregates",St),Ba=e("getPrecomputedAggregates",bt),va=e("getLayerSchema",r.string()),zt={methods:[oa,aa,na,ia,la,sa,pa,ma,ca,da,ya,ga,ha,fa,xa,ba,Ea,Ca,La,Ua,Pa,Ta,Ga,za,Fa,ka,Ba,va],listeners:[ra,ua,Sa,Ia,Ma]};import{z as Oa}from"zod";var ja=e("getMapDetails",Oa.undefined()),Ft={methods:[ja],listeners:[]};import{z as be}from"zod";import{z as j}from"zod";var kt=j.object({id:j.string().or(j.number()),layerId:j.string(),showPopup:j.boolean().optional(),fitViewport:j.boolean().or(j.object({maxZoom:j.number()})).optional()});var Va=e("getSelection",be.undefined()),Aa=g("onSelectionChange"),wa=e("selectFeature",kt),Ra=e("clearSelection",be.object({features:be.boolean().optional(),elements:be.boolean().optional()}).optional()),Bt={methods:[Va,wa,Ra],listeners:[Aa]};import{z as $a}from"zod";import{z as u}from"zod";var vt=["circle","highlighter","line","marker","note","pin","polygon","route","text"],Da=[...vt,"link"],Ot=u.enum(Da),jt=u.enum(vt),Na=ze.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:u.enum(["enter name","add another","select"])}).required(),Ha=xe.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Ja=xe.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Za=Fe.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),qa=ke.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Wa=Be.pick({color:!0,opacity:!0,size:!0}).required(),Ka=ve.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:u.number().min(0).max(200)}).required(),_a=Oe.pick({color:!0,align:!0,style:!0}).required(),Qa=je.pick({color:!0,align:!0,style:!0}).required(),Vt=u.discriminatedUnion("tool",[Na.partial().extend({tool:u.literal("pin")}),Ha.partial().extend({tool:u.literal("line")}),Ja.partial().extend({tool:u.literal("route")}),Za.partial().extend({tool:u.literal("polygon")}),qa.partial().extend({tool:u.literal("circle")}),Wa.partial().extend({tool:u.literal("marker")}),Ka.partial().extend({tool:u.literal("highlighter")}),_a.partial().extend({tool:u.literal("text")}),Qa.partial().extend({tool:u.literal("note")})]);var Xa=e("setTool",Ot.nullable()),Ya=e("getTool",$a.undefined()),en=g("onToolChange"),tn=e("setToolSettings",Vt),on=e("getToolSettings",jt),an=g("onToolSettingsChange"),At={methods:[Xa,Ya,tn,on],listeners:[en,an]};import{z as me}from"zod";import{z as o}from"zod";import{z as w}from"zod";var R=w.union([w.object({after:w.string()}),w.object({before:w.string()}),w.object({at:w.enum(["start","end"])})]);import{z as x}from"zod";import{z as S}from"zod";var nn=S.object({onCreate:S.function().args().returns(S.void()).optional(),onDestroy:S.function().args().returns(S.void()).optional()}),rn=S.object({onCreate:S.string().optional(),onDestroy:S.string().optional()}),y=nn.extend({id:S.string()}),wt=y.partial({id:!0}),m={params:wt,clonable:wt.extend(rn.shape)},Z=y.extend({label:S.string().optional()}),q={params:Z.extend(m.params.shape),clonable:Z.extend(m.clonable.shape)};function p(i){return i.partial().extend({id:S.string(),type:i.shape.type})}var we=x.object({type:x.literal("ActionTrigger"),label:x.string(),disabled:x.boolean().optional()}),te={read:y.extend(we.shape).extend({onTrigger:x.function().returns(x.void())}),create:m.params.extend(we.shape).extend({type:x.undefined()}).extend({onTrigger:x.function().returns(x.void())}),clonable:m.clonable.extend(we.shape).extend({type:x.undefined()}).extend({onTrigger:x.string()})};import{z as ln}from"zod";var Re=y.extend({type:ln.literal("FlexibleSpace")}),Rt=Re.partial({id:!0}),F={params:Rt,clonable:Rt.extend(m.clonable.shape)},De={params:p(F.params),clonable:p(F.clonable)};import{z as b}from"zod";import{z as se}from"zod";import{z as D}from"zod";var oe=y.extend({type:D.literal("Button"),label:D.string(),variant:D.enum(["primary","outlined","transparent","transparentThin"]).optional(),disabled:D.boolean().optional(),onClick:D.function().returns(D.void())}),Dt=oe.extend(m.params.shape),k={params:Dt,clonable:Dt.extend(m.clonable.shape).extend({onClick:D.string()})},Ne={params:p(k.params),clonable:p(k.clonable)};import{z as M}from"zod";import{z as Nt}from"zod";var ae=y.extend({type:Nt.literal("Text"),content:Nt.string()}),Ht=ae.extend(m.params.shape),B={params:Ht,clonable:Ht.extend(m.clonable.shape)},He={params:p(B.params),clonable:p(B.clonable)};var Je=y.extend({type:M.literal("ButtonGroup"),align:M.enum(["start","end"]).optional(),items:M.array(M.union([oe,ae,Re]))}),Jt=Je.extend(m.params.shape).omit({items:!0}).extend({items:M.array(M.union([k.params,B.params,F.params]))}),ne={params:Jt,clonable:Jt.extend(m.clonable.shape).extend({items:M.array(M.union([k.clonable,B.clonable,F.clonable]))})},Ze={params:p(ne.params),clonable:p(ne.clonable.extend({items:M.array(M.union([k.clonable,B.clonable,F.clonable]))}))};import{z as sn}from"zod";var qe=y.extend({type:sn.literal("Divider")}),Zt=qe.partial({id:!0}),re={params:Zt,clonable:Zt.extend(m.clonable.shape)},We={params:p(re.params),clonable:p(re.clonable)};import{z as f}from"zod";var Ke=Z.extend({type:f.literal("Select"),options:f.array(f.object({label:f.string(),value:f.string()})),value:f.string().optional(),placeholder:f.string().optional(),search:f.boolean().optional(),onChange:f.function().args(f.object({value:f.string()})).returns(f.void())}),qt=Ke.extend(q.params.shape),ie={params:qt,clonable:qt.extend(q.clonable.shape).extend({onChange:f.string()})},_e={params:p(ie.params),clonable:p(ie.clonable)};import{z as c}from"zod";var Qe=Z.extend({type:c.literal("TextInput"),value:c.string(),placeholder:c.string().optional(),onChange:c.function().args(c.object({value:c.string()})).returns(c.void()).optional(),onBlur:c.function().args(c.object({value:c.string()})).returns(c.void()).optional(),onFocus:c.function().args(c.object({value:c.string()})).returns(c.void()).optional()}),Wt=Qe.extend(q.params.shape),le={params:Wt,clonable:Wt.extend(q.clonable.shape).extend({onChange:c.string().optional(),onBlur:c.string().optional(),onFocus:c.string().optional()})},$e={params:p(le.params),clonable:p(le.clonable)};var Xe=se.discriminatedUnion("type",[oe,ae,Je,qe,Qe,Ke]),V={params:se.discriminatedUnion("type",[k.params,B.params,ne.params,re.params,le.params,ie.params]),clonable:se.discriminatedUnion("type",[k.clonable,B.clonable,ne.clonable,re.clonable,le.clonable,ie.clonable])},Ye={params:se.discriminatedUnion("type",[Ne.params,He.params,Ze.params,$e.params,_e.params,De.params,We.params]),clonable:se.discriminatedUnion("type",[Ne.clonable,He.clonable,Ze.clonable,$e.clonable,_e.clonable,De.clonable,We.clonable])};var mn=y.extend({type:b.literal("Panel"),title:b.string().optional(),body:b.array(Xe),footer:b.array(Xe).optional(),onClickClose:b.function().returns(b.void()).optional()}),Kt=mn.extend(m.params.shape).partial({type:!0}).omit({body:!0,footer:!0}).extend({body:b.array(V.params),footer:b.array(V.params).optional()}),Ee={params:Kt,clonable:Kt.extend(m.clonable.shape).extend({onClickClose:b.string().optional(),body:b.array(V.clonable),footer:b.array(V.clonable).optional()})};var ji=o.object({actionTrigger:te.create,placement:R.optional()}),_t=o.object({actionTrigger:te.clonable,placement:R.optional()}),Vi=te.create.partial().required({id:!0}),Qt=te.clonable.partial().required({id:!0}),Ai=o.object({panel:Ee.params,placement:R.optional()}),$t=o.object({panel:Ee.clonable,placement:R.optional()}),Xt=Ee.clonable.partial().required({id:!0}),wi=o.object({panelId:o.string(),elements:o.array(o.object({element:o.union([V.params,F.params]),container:o.union([o.literal("body"),o.literal("footer"),o.object({id:o.string()})]).optional(),placement:R.optional()}))}),Yt=o.object({panelId:o.string(),elements:o.array(o.object({element:o.union([V.clonable,F.clonable]),container:o.union([o.literal("body"),o.literal("footer"),o.object({id:o.string()})]).optional(),placement:R.optional()}))}),Ri=o.object({panelId:o.string(),elements:o.array(o.object({element:Ye.params}))}),eo=o.object({panelId:o.string(),elements:o.array(o.object({element:Ye.clonable}))}),to=o.object({panelId:o.string(),elements:o.array(o.string())}),oo=o.object({showLegend:o.boolean().optional(),cooperativeGestures:o.boolean().optional(),fullScreenButton:o.boolean().optional(),geolocation:o.boolean().optional(),zoomControls:o.boolean().optional(),scaleBar:o.boolean().optional()}),ao=o.object({featureSelectPanel:o.boolean().optional(),featureHoverPanel:o.boolean().optional(),elementSelectPanel:o.boolean().optional(),linkClickOpen:o.boolean().optional(),imageLightboxOpen:o.boolean().optional()});var pn=e("createActionTrigger",_t),cn=e("updateActionTrigger",Qt),dn=e("deleteActionTrigger",me.string()),yn=e("createPanel",$t),gn=e("updatePanel",Xt),un=e("deletePanel",me.string()),hn=e("createPanelElements",Yt),fn=e("updatePanelElements",eo),Sn=e("deletePanelElements",to),xn=e("updateUiControls",oo),bn=e("setOnMapInteractionsUi",ao),En=e("showLayerDataTable",me.object({layerId:me.string(),sorting:ue.optional()}).optional()),In=e("hideLayerDataTable",me.undefined()),no={methods:[pn,cn,dn,yn,gn,un,hn,fn,Sn,xn,bn,En,In],listeners:null};import{z as so}from"zod";import{z as Ce}from"zod";var Ie=Ce.object({center:ye,zoom:at}),ro=Ce.object({center:Ie.shape.center.optional(),zoom:Ie.shape.zoom.optional()}),io=Ce.object({minZoom:Ie.shape.zoom.nullish(),maxZoom:Ie.shape.zoom.nullish(),bounds:U.nullish()}).nullable(),lo=Ce.object({bounds:U});var Cn=e("getViewport",so.undefined()),Ln=e("setViewport",ro),Mn=e("getViewportConstraints",so.undefined()),Un=e("setViewportConstraints",io),Pn=e("fitViewportToBounds",lo),Tn=g("onViewportMove"),Gn=g("onViewportMoveEnd"),zn=g("onMapIdle"),mo={methods:[Ln,Cn,Mn,Un,Pn],listeners:[Tn,Gn,zn]};var et=[no,mo,zt,mt,Bt,pt,At,Ft];function dl(i,N,tt){let Le=new Map;async function ot(E){if(!On.safeParse(E.data).success){tt?.onUnknownMessage?.(E.data);return}let pe=yo.safeParse(E.data);if(!pe.success){tt?.onInvalidMessage?.(E.data,pe.error),E.ports[0]?.postMessage(po(pe.error.message));return}let{data:h}=pe;if(h.type==="felt.ready")E.ports[0]?.postMessage(!0);else if(h.type==="felt.addListener"){if(h.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let W="options"in h.event?{options:"options"in h.event?h.event.options:void 0,handler:Ue=>{E.ports[0]?.postMessage(Ue)}}:{handler:Ue=>{E.ports[0]?.postMessage(Ue)}},Me=N.listeners[h.event.eventName](W);Le.set(h.event.id,Me)}else if(h.type==="felt.removeListener")Le.get(h.id)?.(),Le.delete(h.id);else try{let W=N.methods[h.type],Me=await W(h.params);E.ports[0]?.postMessage(Me)}catch(W){E.ports[0]?.postMessage(po(W))}}return i.addEventListener("message",ot),()=>{i.removeEventListener("message",ot)}}var co={methods:et.map(i=>i.methods??[]).flat(),listeners:et.map(i=>i.listeners??[]).flat()},Fn=d.discriminatedUnion("eventName",[d.strictObject({eventName:d.literal("")}),d.strictObject({eventName:d.literal("onGenericEvent"),id:d.string(),options:d.object({id:d.string()})}),...co.listeners]),kn=d.strictObject({type:d.literal("felt.addListener"),event:Fn}),Bn=d.strictObject({type:d.literal("felt.removeListener"),id:d.string()}),vn=d.strictObject({type:d.literal("felt.ready")}),yo=d.discriminatedUnion("type",[vn,kn,Bn,...co.methods]),On=d.object({type:d.enum(yo.options.map(i=>i.shape.type.value))});function po(i){return{__error__:jn(i)}}function jn(i){return i instanceof Error?i.message:typeof i=="object"&&i!==null&&"message"in i?String(i.message):typeof i=="string"?i:"Unknown error"}export{dl as createMessageHandler};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feltmaps/js-sdk",
3
- "version": "1.7.0-next.10",
3
+ "version": "1.7.0-next.11",
4
4
  "description": "An SDK for Felt maps",
5
5
  "keywords": [
6
6
  "felt",