@feltmaps/js-sdk 1.5.0-next.18 → 1.5.0-next.19

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/handler.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z, ZodError } from 'zod';
2
- import { Q as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, m as LayerGroup, q as LegendItem, t as LayerFilters, v as LayerFeature, w as GeoJsonFeature, y as GetLayerCategoriesGroup, A as GetLayerHistogramBin, B as AggregationMethod, D as LayerSchema, i as LayerChangeCallbackParams, o as LayerGroupChangeCallbackParams, s as LegendItemChangeCallbackParams, aB as FilterTernary, H as MapDetails, I as EntityNode, T as ToolType, O as ToolSettingsMap, P as ToolSettingsChangeEvent, V as ViewportState, W as ViewportConstraints, b6 as UnionToIntersection, b7 as PromiseOrNot } from './types-Cy5ifEPb.js';
2
+ import { O as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, j as LayerGroup, n as LegendItem, q as LayerFilters, s as LayerFeature, t as GeoJsonFeature, v as GetLayerCategoriesGroup, x as GetLayerHistogramBin, A as AggregationMethod, z as LayerSchema, i as LayerChangeCallbackParams, l as LayerGroupChangeCallbackParams, p as LegendItemChangeCallbackParams, aI as FilterTernary, B as MapDetails, D as EntityNode, T as ToolType, K as ToolSettingsMap, N as ToolSettingsChangeEvent, V as ViewportState, R as ViewportConstraints, bd as UnionToIntersection, be as PromiseOrNot } from './types-BQxcl9Qq.js';
3
3
 
4
4
  type Method<TRequest extends {
5
5
  type: string;
@@ -1964,73 +1964,39 @@ declare const SetLayerLegendVisibilityMessage: z.ZodObject<{
1964
1964
  }>;
1965
1965
  declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
1966
1966
  type: z.ZodLiteral<"createLayersFromGeoJson">;
1967
- params: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1968
- name: z.ZodString;
1969
- geometryStyles: z.ZodOptional<z.ZodObject<{
1970
- Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1971
- Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1972
- Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1967
+ params: z.ZodObject<{
1968
+ source: z.ZodUnion<[z.ZodObject<{
1969
+ type: z.ZodLiteral<"geoJsonUrl">;
1970
+ url: z.ZodString;
1973
1971
  }, "strip", z.ZodTypeAny, {
1974
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1975
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1976
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1972
+ type: "geoJsonUrl";
1973
+ url: string;
1977
1974
  }, {
1978
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1979
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1980
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1981
- }>>;
1982
- }, {
1983
- arrayBuffer: z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>;
1984
- }>, "strip", z.ZodTypeAny, {
1985
- name: string;
1986
- arrayBuffer: ArrayBuffer;
1987
- geometryStyles?: {
1988
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1989
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1990
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1991
- } | undefined;
1992
- }, {
1993
- name: string;
1994
- arrayBuffer: ArrayBuffer;
1995
- geometryStyles?: {
1996
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1997
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1998
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1999
- } | undefined;
2000
- }>, z.ZodObject<z.objectUtil.extendShape<{
2001
- name: z.ZodString;
2002
- geometryStyles: z.ZodOptional<z.ZodObject<{
2003
- Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2004
- Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2005
- Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1975
+ type: "geoJsonUrl";
1976
+ url: string;
1977
+ }>, z.ZodObject<{
1978
+ type: z.ZodLiteral<"geoJsonData">;
1979
+ data: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2006
1980
  }, "strip", z.ZodTypeAny, {
2007
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2008
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2009
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1981
+ type: "geoJsonData";
1982
+ data: {} & {
1983
+ [k: string]: unknown;
1984
+ };
2010
1985
  }, {
2011
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2012
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2013
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2014
- }>>;
2015
- }, {
2016
- file: z.ZodType<File, z.ZodTypeDef, File>;
2017
- }>, "strip", z.ZodTypeAny, {
2018
- name: string;
2019
- file: File;
2020
- geometryStyles?: {
2021
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2022
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2023
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2024
- } | undefined;
2025
- }, {
2026
- name: string;
2027
- file: File;
2028
- geometryStyles?: {
2029
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2030
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2031
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2032
- } | undefined;
2033
- }>, z.ZodObject<z.objectUtil.extendShape<{
1986
+ type: "geoJsonData";
1987
+ data: {} & {
1988
+ [k: string]: unknown;
1989
+ };
1990
+ }>, z.ZodObject<{
1991
+ type: z.ZodLiteral<"geoJsonFile">;
1992
+ file: z.ZodType<File, z.ZodTypeDef, File>;
1993
+ }, "strip", z.ZodTypeAny, {
1994
+ type: "geoJsonFile";
1995
+ file: File;
1996
+ }, {
1997
+ type: "geoJsonFile";
1998
+ file: File;
1999
+ }>]>;
2034
2000
  name: z.ZodString;
2035
2001
  geometryStyles: z.ZodOptional<z.ZodObject<{
2036
2002
  Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
@@ -2045,11 +2011,20 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2045
2011
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2046
2012
  Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2047
2013
  }>>;
2048
- }, {
2049
- url: z.ZodString;
2050
- }>, "strip", z.ZodTypeAny, {
2014
+ }, "strip", z.ZodTypeAny, {
2051
2015
  name: string;
2052
- url: string;
2016
+ source: {
2017
+ type: "geoJsonUrl";
2018
+ url: string;
2019
+ } | {
2020
+ type: "geoJsonData";
2021
+ data: {} & {
2022
+ [k: string]: unknown;
2023
+ };
2024
+ } | {
2025
+ type: "geoJsonFile";
2026
+ file: File;
2027
+ };
2053
2028
  geometryStyles?: {
2054
2029
  Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2055
2030
  Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2057,33 +2032,39 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2057
2032
  } | undefined;
2058
2033
  }, {
2059
2034
  name: string;
2060
- url: string;
2035
+ source: {
2036
+ type: "geoJsonUrl";
2037
+ url: string;
2038
+ } | {
2039
+ type: "geoJsonData";
2040
+ data: {} & {
2041
+ [k: string]: unknown;
2042
+ };
2043
+ } | {
2044
+ type: "geoJsonFile";
2045
+ file: File;
2046
+ };
2061
2047
  geometryStyles?: {
2062
2048
  Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2063
2049
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2064
2050
  Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2065
2051
  } | undefined;
2066
- }>]>;
2052
+ }>;
2067
2053
  }, z.UnknownKeysParam, z.ZodTypeAny, {
2068
2054
  params: {
2069
2055
  name: string;
2070
- arrayBuffer: ArrayBuffer;
2071
- geometryStyles?: {
2072
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2073
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2074
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2075
- } | undefined;
2076
- } | {
2077
- name: string;
2078
- file: File;
2079
- geometryStyles?: {
2080
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2081
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2082
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2083
- } | undefined;
2084
- } | {
2085
- name: string;
2086
- url: string;
2056
+ source: {
2057
+ type: "geoJsonUrl";
2058
+ url: string;
2059
+ } | {
2060
+ type: "geoJsonData";
2061
+ data: {} & {
2062
+ [k: string]: unknown;
2063
+ };
2064
+ } | {
2065
+ type: "geoJsonFile";
2066
+ file: File;
2067
+ };
2087
2068
  geometryStyles?: {
2088
2069
  Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2089
2070
  Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2094,23 +2075,18 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2094
2075
  }, {
2095
2076
  params: {
2096
2077
  name: string;
2097
- arrayBuffer: ArrayBuffer;
2098
- geometryStyles?: {
2099
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2100
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2101
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2102
- } | undefined;
2103
- } | {
2104
- name: string;
2105
- file: File;
2106
- geometryStyles?: {
2107
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2108
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2109
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2110
- } | undefined;
2111
- } | {
2112
- name: string;
2113
- url: string;
2078
+ source: {
2079
+ type: "geoJsonUrl";
2080
+ url: string;
2081
+ } | {
2082
+ type: "geoJsonData";
2083
+ data: {} & {
2084
+ [k: string]: unknown;
2085
+ };
2086
+ } | {
2087
+ type: "geoJsonFile";
2088
+ file: File;
2089
+ };
2114
2090
  geometryStyles?: {
2115
2091
  Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2116
2092
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
package/handler.js CHANGED
@@ -1 +1 @@
1
- "use strict";var re=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var st=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var pt=(o,l)=>{for(var G in l)re(o,G,{get:l[G],enumerable:!0})},mt=(o,l,G,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let b of st(l))!lt.call(o,b)&&b!==G&&re(o,b,{get:()=>l[b],enumerable:!(z=it(l,b))||z.enumerable});return o};var ct=o=>mt(re({},"__esModule",{value:!0}),o);var gr={};pt(gr,{createMessageHandler:()=>ir});module.exports=ct(gr);var y=require("zod");var d=require("zod");var f=require("zod");function t(o,l){return f.z.strictObject({type:f.z.literal(o),params:l})}function S(o,l){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string(),options:l})}function p(o){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string()})}var i=require("zod"),B=i.z.number(),D=i.z.number(),Z=i.z.object({latitude:D,longitude:B}),C=i.z.tuple([B,D]),P=i.z.object({type:i.z.literal("Polygon"),coordinates:i.z.array(i.z.array(C).min(4).refine(o=>o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1],"The last point of each ring must be identical to the first"))}),J=i.z.object({type:i.z.literal("MultiPolygon"),coordinates:i.z.array(P.shape.coordinates)}),yt=i.z.object({type:i.z.literal("LineString"),coordinates:i.z.array(C).min(2)}),w=i.z.object({type:i.z.literal("MultiLineString"),coordinates:i.z.array(yt.shape.coordinates)}),fe=i.z.number().min(1).max(23),I=i.z.tuple([B,D,B,D]),T=i.z.object({show:i.z.array(i.z.string()).optional(),hide:i.z.array(i.z.string()).optional()}),gt=i.z.enum(["asc","desc"]),Se=i.z.object({attribute:i.z.string(),direction:gt});var e=require("zod");var h=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ne=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),dt=e.z.enum(["meter","kilometer","foot","mile"]),q=h.extend($.shape).extend({type:e.z.literal("Place"),coordinates:C,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),V=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Path"),coordinates:w.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),O=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Polygon"),coordinates:P.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),W=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Circle"),center:C,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:dt.nullable(),fillOpacity:e.z.number().min(0).max(1)}),U=h.extend({type:e.z.literal("Marker"),coordinates:w.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),R=h.extend({type:e.z.literal("Highlighter"),coordinates:J.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),xe=e.z.object({position:C,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),coordinates:P.shape.coordinates}),Le=e.z.object({text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),_=h.extend(xe.shape).extend(Le.shape).extend({type:e.z.literal("Text")}),Q=h.extend(xe.shape).extend(Le.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),N=h.extend({type:e.z.literal("Image"),coordinates:w.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),ut=h.extend({type:e.z.literal("Link"),coordinates:w.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},x={id:!0},ae=q.partial().extend(q.pick(F).shape).omit(x),K=V.partial().extend(V.pick(F).shape).omit(x),ie=O.partial().extend(O.pick(F).shape).omit(x),se=W.partial().extend(W.pick({type:!0,center:!0,radius:!0}).shape).omit(x),le=U.partial().extend(U.pick(F).shape).omit(x),pe=R.partial().extend(R.pick(F).shape).omit(x),me=_.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ce=Q.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),ht=N.partial().extend(N.pick({...F,imageUrl:!0}).shape).omit(x),Me=e.z.discriminatedUnion("type",[ae,K,ie,se,le,pe,ht,me,ce]);var xr=V.omit({coordinates:!0}),Lr=O.omit({coordinates:!0});var Mr=U.omit({coordinates:!0}),br=R.omit({coordinates:!0}),Cr=_.omit({coordinates:!0}),Gr=Q.omit({coordinates:!0}),Ir=N.omit({coordinates:!0}),Tr=ut.omit({coordinates:!0}),L={type:!0,id:!0},ft=q.partial().extend(q.pick(L).shape),St=V.partial().extend(V.pick(L).shape),xt=O.partial().extend(O.pick(L).shape),Lt=W.partial().extend(W.pick(L).shape),Mt=U.partial().extend(U.pick(L).shape),bt=R.partial().extend(R.pick(L).shape),Ct=_.partial().extend(_.pick(L).shape).omit({coordinates:!0,name:!0}),Gt=Q.partial().extend(Q.pick(L).shape).omit({coordinates:!0,name:!0}),It=N.partial().extend(N.pick(L).shape),be=e.z.discriminatedUnion("type",[ft,St,xt,Lt,Mt,bt,Ct,Gt,It]),Ce=e.z.object({ids:e.z.array(e.z.string()).optional()}),Ge=e.z.object({ids:e.z.array(e.z.string()).optional()});var Tt=t("getElement",d.z.string()),Et=t("getElementGeometry",d.z.string()),zt=t("getElements",Ce.optional()),Pt=t("getElementGroup",d.z.string()),Ft=t("getElementGroups",Ge.optional()),kt=t("setElementGroupVisibility",T),vt=S("onElementChange",d.z.object({id:d.z.string()})),wt=p("onElementCreate"),Vt=p("onElementCreateEnd"),Ot=S("onElementDelete",d.z.object({id:d.z.string()})),Ut=S("onElementGroupChange",d.z.object({id:d.z.string()})),Rt=t("createElement",Me),Nt=t("updateElement",be),jt=t("deleteElement",d.z.string()),Ie={methods:[Tt,Et,zt,Pt,Ft,kt,Rt,Nt,jt],listeners:[vt,wt,Vt,Ot,Ut]};var At=p("onPointerClick"),Ht=p("onPointerMove"),Te={methods:null,listeners:[At,Ht]};var s=require("zod");var n=require("zod"),Bt=n.z.enum(["in","ni"]),Dt=n.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Vr=n.z.enum(["and","or"]),Ee=n.z.union([n.z.number(),n.z.string(),n.z.boolean(),n.z.null()]),ze=n.z.string().or(n.z.null()),Zt=n.z.tuple([ze,Bt,n.z.array(Ee).or(n.z.null())]),Jt=n.z.tuple([ze,Dt,Ee]),ye=n.z.union([Zt,Jt]),ge=n.z.tuple([n.z.lazy(()=>n.z.union([ge,ye,n.z.null(),n.z.boolean()])),n.z.enum(["and","or"]),n.z.lazy(()=>n.z.union([ge,ye,n.z.null(),n.z.boolean()]))]),E=n.z.union([ge,ye,n.z.null(),n.z.boolean()]);var r=require("zod");var Pe=r.z.enum(["avg","max","min","sum","median"]),qt=r.z.object({method:Pe,attribute:r.z.string()}),Wt=r.z.object({methods:r.z.array(r.z.union([Pe,r.z.literal("count")])),attribute:r.z.string().optional()}),X=r.z.union([I,P,J,r.z.array(C)]),Fe=r.z.object({boundary:X.optional(),filters:E.optional(),aggregation:qt.optional()}),ke=r.z.object({layerId:r.z.string(),attribute:r.z.string(),limit:r.z.number().optional(),boundary:X.optional(),filters:E.optional(),values:Fe.optional()}),Nr=r.z.object({key:r.z.union([r.z.number(),r.z.string(),r.z.boolean()]),value:r.z.number().nullable()}),_t=r.z.object({type:r.z.literal("equal-intervals"),count:r.z.number()}),Qt=r.z.object({type:r.z.literal("time-interval"),interval:r.z.enum(["hour","day","week","month","year"])}),ve=r.z.object({layerId:r.z.string(),attribute:r.z.string(),steps:r.z.union([_t,Qt,r.z.array(r.z.number())]),boundary:X.optional(),filters:E.optional(),values:Fe.optional()}),jr=r.z.object({min:r.z.number(),max:r.z.number(),value:r.z.number()}),we=r.z.object({layerId:r.z.string(),boundary:X.optional(),filters:E.optional(),aggregation:Wt});var a=require("zod");var Br=a.z.enum(["processing","completed","failed","incomplete"]),Ve=a.z.object({ids:a.z.array(a.z.string()).optional()}),Oe=a.z.object({ids:a.z.array(a.z.string()).optional()}),k=a.z.object({id:a.z.string(),layerId:a.z.string()}),Ue=a.z.object({ids:k.array().optional(),layerIds:a.z.string().array().optional()}),Re=a.z.object({layerIds:a.z.array(a.z.string()).optional(),areaQuery:a.z.union([a.z.object({coordinates:Z}),a.z.object({boundary:I})]).optional()}),$t=a.z.object({Point:a.z.object({}).passthrough().optional(),Line:a.z.object({}).passthrough().optional(),Polygon:a.z.object({}).passthrough().optional()}),de=a.z.object({name:a.z.string(),geometryStyles:$t.optional()}),Kt=de.extend({file:a.z.instanceof(File)}),Xt=de.extend({url:a.z.string().url()}),Yt=de.extend({arrayBuffer:a.z.instanceof(ArrayBuffer)}),Ne=a.z.union([Yt,Kt,Xt]);var eo=t("getLayer",s.z.string()),to=t("getLayers",Ve.optional()),oo=t("setLayerVisibility",T),ro=S("onLayerChange",s.z.object({id:s.z.string()})),no=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),ao=t("setLayerLegendVisibility",T),io=t("createLayersFromGeoJson",Ne),so=t("deleteLayer",s.z.string()),lo=t("getLayerGroup",s.z.string()),po=t("getLayerGroups",Oe.optional()),mo=t("setLayerGroupVisibility",T),co=t("setLayerGroupLegendVisibility",T),yo=S("onLayerGroupChange",s.z.object({id:s.z.string()})),go=t("getLegendItem",k),uo=t("getLegendItems",Ue.optional()),ho=S("onLegendItemChange",k),fo=t("setLegendItemVisibility",s.z.object({show:k.array().optional(),hide:k.array().optional()})),So=t("getLayerFilters",s.z.string()),xo=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:E,note:s.z.string().optional()})),Lo=S("onLayerFiltersChange",s.z.object({layerId:s.z.string()})),Mo=t("getRenderedFeatures",Re.optional()),bo=t("getFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Co=t("getGeoJsonFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Go=t("getCategoryData",ke),Io=t("getHistogramData",ve),To=t("getAggregates",we),Eo=t("getLayerSchema",s.z.string()),je={methods:[eo,to,oo,no,ao,io,so,lo,po,mo,co,go,uo,fo,So,xo,Mo,bo,Co,Go,Io,To,Eo],listeners:[ro,yo,ho,Lo]};var Ae=require("zod");var zo=t("getMapDetails",Ae.z.undefined()),He={methods:[zo],listeners:[]};var j=require("zod");var M=require("zod"),Be=M.z.object({id:M.z.string().or(M.z.number()),layerId:M.z.string(),showPopup:M.z.boolean().optional(),fitViewport:M.z.boolean().or(M.z.object({maxZoom:M.z.number()})).optional()});var Po=t("getSelection",j.z.undefined()),Fo=p("onSelectionChange"),ko=t("selectFeature",Be),vo=t("clearSelection",j.z.object({features:j.z.boolean().optional(),elements:j.z.boolean().optional()}).optional()),De={methods:[Po,ko,vo],listeners:[Fo]};var _e=require("zod");var m=require("zod");var Ze=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Je=m.z.enum([...Ze,"link"]),qe=m.z.enum(Ze),wo=ae.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Vo=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Oo=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Uo=ie.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Ro=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),No=le.pick({color:!0,opacity:!0,size:!0}).required(),jo=pe.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),Ao=me.pick({color:!0,align:!0,style:!0}).required(),Ho=ce.pick({color:!0,align:!0,style:!0}).required(),We=m.z.discriminatedUnion("tool",[wo.partial().extend({tool:m.z.literal("pin")}),Vo.partial().extend({tool:m.z.literal("line")}),Oo.partial().extend({tool:m.z.literal("route")}),Uo.partial().extend({tool:m.z.literal("polygon")}),Ro.partial().extend({tool:m.z.literal("circle")}),No.partial().extend({tool:m.z.literal("marker")}),jo.partial().extend({tool:m.z.literal("highlighter")}),Ao.partial().extend({tool:m.z.literal("text")}),Ho.partial().extend({tool:m.z.literal("note")})]);var Bo=t("setTool",Je.nullable()),Do=t("getTool",_e.z.undefined()),Zo=p("onToolChange"),Jo=t("setToolSettings",We),qo=t("getToolSettings",qe),Wo=p("onToolSettingsChange"),Qe={methods:[Bo,Do,Jo,qo],listeners:[Zo,Wo]};var Y=require("zod");var c=require("zod"),$e=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Ke=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var _o=t("updateUiControls",$e),Qo=t("setOnMapInteractionsUi",Ke),$o=t("showLayerDataTable",Y.z.object({layerId:Y.z.string(),sorting:Se.optional()}).optional()),Ko=t("hideLayerDataTable",Y.z.undefined()),Xe={methods:[_o,Qo,$o,Ko],listeners:null};var ue=require("zod");var A=require("zod");var ee=A.z.object({center:Z,zoom:fe}),Ye=A.z.object({center:ee.shape.center.optional(),zoom:ee.shape.zoom.optional()}),et=A.z.object({minZoom:ee.shape.zoom.nullish(),maxZoom:ee.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),tt=A.z.object({bounds:I});var Xo=t("getViewport",ue.z.undefined()),Yo=t("setViewport",Ye),er=t("getViewportConstraints",ue.z.undefined()),tr=t("setViewportConstraints",et),or=t("fitViewportToBounds",tt),rr=p("onViewportMove"),nr=p("onViewportMoveEnd"),ar=p("onMapIdle"),ot={methods:[Yo,Xo,er,tr,or],listeners:[rr,nr,ar]};var he=[Xe,ot,je,Ie,De,Te,Qe,He];function ir(o,l,G){let z=new Map;async function b(u){if(!cr.safeParse(u.data).success){G?.onUnknownMessage?.(u.data);return}let H=at.safeParse(u.data);if(!H.success){G?.onInvalidMessage?.(u.data,H.error),u.ports[0]?.postMessage(rt(H.error.message));return}let{data:g}=H;if(g.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let v="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:oe=>{u.ports[0]?.postMessage(oe)}}:{handler:oe=>{u.ports[0]?.postMessage(oe)}},te=l.listeners[g.event.eventName](v);z.set(g.event.id,te)}else if(g.type==="felt.removeListener")z.get(g.id)?.(),z.delete(g.id);else try{let v=l.methods[g.type],te=await v(g.params);u.ports[0]?.postMessage(te)}catch(v){u.ports[0]?.postMessage(rt(v))}}return o.addEventListener("message",b),()=>{o.removeEventListener("message",b)}}var nt={methods:he.map(o=>o.methods??[]).flat(),listeners:he.map(o=>o.listeners??[]).flat()},sr=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...nt.listeners]),lr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:sr}),pr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),mr=y.z.strictObject({type:y.z.literal("felt.ready")}),at=y.z.discriminatedUnion("type",[mr,lr,pr,...nt.methods]),cr=y.z.object({type:y.z.enum(at.options.map(o=>o.shape.type.value))});function rt(o){return{__error__:yr(o)}}function yr(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}0&&(module.exports={createMessageHandler});
1
+ "use strict";var re=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var st=Object.prototype.hasOwnProperty;var lt=(o,l)=>{for(var G in l)re(o,G,{get:l[G],enumerable:!0})},pt=(o,l,G,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let M of it(l))!st.call(o,M)&&M!==G&&re(o,M,{get:()=>l[M],enumerable:!(z=at(l,M))||z.enumerable});return o};var mt=o=>pt(re({},"__esModule",{value:!0}),o);var yr={};lt(yr,{createMessageHandler:()=>ar});module.exports=mt(yr);var y=require("zod");var d=require("zod");var f=require("zod");function t(o,l){return f.z.strictObject({type:f.z.literal(o),params:l})}function S(o,l){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string(),options:l})}function p(o){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string()})}var i=require("zod"),H=i.z.number(),J=i.z.number(),B=i.z.object({latitude:J,longitude:H}),C=i.z.tuple([H,J]),P=i.z.object({type:i.z.literal("Polygon"),coordinates:i.z.array(i.z.array(C).min(4).refine(o=>o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1],"The last point of each ring must be identical to the first"))}),Z=i.z.object({type:i.z.literal("MultiPolygon"),coordinates:i.z.array(P.shape.coordinates)}),ct=i.z.object({type:i.z.literal("LineString"),coordinates:i.z.array(C).min(2)}),v=i.z.object({type:i.z.literal("MultiLineString"),coordinates:i.z.array(ct.shape.coordinates)}),he=i.z.number().min(1).max(23),I=i.z.tuple([H,J,H,J]),T=i.z.object({show:i.z.array(i.z.string()).optional(),hide:i.z.array(i.z.string()).optional()}),yt=i.z.enum(["asc","desc"]),fe=i.z.object({attribute:i.z.string(),direction:yt});var e=require("zod");var h=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ne=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),gt=e.z.enum(["meter","kilometer","foot","mile"]),q=h.extend($.shape).extend({type:e.z.literal("Place"),coordinates:C,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),w=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Path"),coordinates:v.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),O=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Polygon"),coordinates:P.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),W=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Circle"),center:C,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:gt.nullable(),fillOpacity:e.z.number().min(0).max(1)}),U=h.extend({type:e.z.literal("Marker"),coordinates:v.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),j=h.extend({type:e.z.literal("Highlighter"),coordinates:Z.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:C,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),coordinates:P.shape.coordinates}),xe=e.z.object({text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),_=h.extend(Se.shape).extend(xe.shape).extend({type:e.z.literal("Text")}),Q=h.extend(Se.shape).extend(xe.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),R=h.extend({type:e.z.literal("Image"),coordinates:v.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),dt=h.extend({type:e.z.literal("Link"),coordinates:v.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},x={id:!0},ae=q.partial().extend(q.pick(F).shape).omit(x),K=w.partial().extend(w.pick(F).shape).omit(x),ie=O.partial().extend(O.pick(F).shape).omit(x),se=W.partial().extend(W.pick({type:!0,center:!0,radius:!0}).shape).omit(x),le=U.partial().extend(U.pick(F).shape).omit(x),pe=j.partial().extend(j.pick(F).shape).omit(x),me=_.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ce=Q.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),ut=R.partial().extend(R.pick({...F,imageUrl:!0}).shape).omit(x),Le=e.z.discriminatedUnion("type",[ae,K,ie,se,le,pe,ut,me,ce]);var Sr=w.omit({coordinates:!0}),xr=O.omit({coordinates:!0});var Lr=U.omit({coordinates:!0}),br=j.omit({coordinates:!0}),Mr=_.omit({coordinates:!0}),Cr=Q.omit({coordinates:!0}),Gr=R.omit({coordinates:!0}),Ir=dt.omit({coordinates:!0}),L={type:!0,id:!0},ht=q.partial().extend(q.pick(L).shape),ft=w.partial().extend(w.pick(L).shape),St=O.partial().extend(O.pick(L).shape),xt=W.partial().extend(W.pick(L).shape),Lt=U.partial().extend(U.pick(L).shape),bt=j.partial().extend(j.pick(L).shape),Mt=_.partial().extend(_.pick(L).shape).omit({coordinates:!0,name:!0}),Ct=Q.partial().extend(Q.pick(L).shape).omit({coordinates:!0,name:!0}),Gt=R.partial().extend(R.pick(L).shape),be=e.z.discriminatedUnion("type",[ht,ft,St,xt,Lt,bt,Mt,Ct,Gt]),Me=e.z.object({ids:e.z.array(e.z.string()).optional()}),Ce=e.z.object({ids:e.z.array(e.z.string()).optional()});var It=t("getElement",d.z.string()),Tt=t("getElementGeometry",d.z.string()),Et=t("getElements",Me.optional()),zt=t("getElementGroup",d.z.string()),Pt=t("getElementGroups",Ce.optional()),Ft=t("setElementGroupVisibility",T),kt=S("onElementChange",d.z.object({id:d.z.string()})),Vt=p("onElementCreate"),vt=p("onElementCreateEnd"),wt=S("onElementDelete",d.z.object({id:d.z.string()})),Ot=S("onElementGroupChange",d.z.object({id:d.z.string()})),Ut=t("createElement",Le),jt=t("updateElement",be),Rt=t("deleteElement",d.z.string()),Ge={methods:[It,Tt,Et,zt,Pt,Ft,Ut,jt,Rt],listeners:[kt,Vt,vt,wt,Ot]};var Nt=p("onPointerClick"),At=p("onPointerMove"),Ie={methods:null,listeners:[Nt,At]};var s=require("zod");var a=require("zod"),Dt=a.z.enum(["in","ni"]),Ht=a.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),vr=a.z.enum(["and","or"]),Te=a.z.union([a.z.number(),a.z.string(),a.z.boolean(),a.z.null()]),Ee=a.z.string().or(a.z.null()),Jt=a.z.tuple([Ee,Dt,a.z.array(Te).or(a.z.null())]),Bt=a.z.tuple([Ee,Ht,Te]),ye=a.z.union([Jt,Bt]),ge=a.z.tuple([a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()])),a.z.enum(["and","or"]),a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()]))]),E=a.z.union([ge,ye,a.z.null(),a.z.boolean()]);var r=require("zod");var ze=r.z.enum(["avg","max","min","sum","median"]),Zt=r.z.object({method:ze,attribute:r.z.string()}),qt=r.z.object({methods:r.z.array(r.z.union([ze,r.z.literal("count")])),attribute:r.z.string().optional()}),X=r.z.union([I,P,Z,r.z.array(C)]),Pe=r.z.object({boundary:X.optional(),filters:E.optional(),aggregation:Zt.optional()}),Fe=r.z.object({layerId:r.z.string(),attribute:r.z.string(),limit:r.z.number().optional(),boundary:X.optional(),filters:E.optional(),values:Pe.optional()}),jr=r.z.object({key:r.z.union([r.z.number(),r.z.string(),r.z.boolean()]),value:r.z.number().nullable()}),Wt=r.z.object({type:r.z.literal("equal-intervals"),count:r.z.number()}),_t=r.z.object({type:r.z.literal("time-interval"),interval:r.z.enum(["hour","day","week","month","year"])}),ke=r.z.object({layerId:r.z.string(),attribute:r.z.string(),steps:r.z.union([Wt,_t,r.z.array(r.z.number())]),boundary:X.optional(),filters:E.optional(),values:Pe.optional()}),Rr=r.z.object({min:r.z.number(),max:r.z.number(),value:r.z.number()}),Ve=r.z.object({layerId:r.z.string(),boundary:X.optional(),filters:E.optional(),aggregation:qt});var n=require("zod");var Dr=n.z.enum(["processing","completed","failed","incomplete"]),Qt=n.z.object({type:n.z.literal("geoJsonUrl"),url:n.z.string().url()}),$t=n.z.object({type:n.z.literal("geoJsonData"),data:n.z.object({}).passthrough()}),Kt=n.z.object({type:n.z.literal("geoJsonFile"),file:n.z.instanceof(File)}),ve=n.z.object({ids:n.z.array(n.z.string()).optional()}),we=n.z.object({ids:n.z.array(n.z.string()).optional()}),k=n.z.object({id:n.z.string(),layerId:n.z.string()}),Oe=n.z.object({ids:k.array().optional(),layerIds:n.z.string().array().optional()}),Ue=n.z.object({layerIds:n.z.array(n.z.string()).optional(),areaQuery:n.z.union([n.z.object({coordinates:B}),n.z.object({boundary:I})]).optional()}),Xt=n.z.object({Point:n.z.object({}).passthrough().optional(),Line:n.z.object({}).passthrough().optional(),Polygon:n.z.object({}).passthrough().optional()}),je=n.z.object({source:n.z.union([Qt,$t,Kt]),name:n.z.string(),geometryStyles:Xt.optional()});var Yt=t("getLayer",s.z.string()),eo=t("getLayers",ve.optional()),to=t("setLayerVisibility",T),oo=S("onLayerChange",s.z.object({id:s.z.string()})),ro=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",T),ao=t("createLayersFromGeoJson",je),io=t("deleteLayer",s.z.string()),so=t("getLayerGroup",s.z.string()),lo=t("getLayerGroups",we.optional()),po=t("setLayerGroupVisibility",T),mo=t("setLayerGroupLegendVisibility",T),co=S("onLayerGroupChange",s.z.object({id:s.z.string()})),yo=t("getLegendItem",k),go=t("getLegendItems",Oe.optional()),uo=S("onLegendItemChange",k),ho=t("setLegendItemVisibility",s.z.object({show:k.array().optional(),hide:k.array().optional()})),fo=t("getLayerFilters",s.z.string()),So=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:E,note:s.z.string().optional()})),xo=S("onLayerFiltersChange",s.z.object({layerId:s.z.string()})),Lo=t("getRenderedFeatures",Ue.optional()),bo=t("getFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Mo=t("getGeoJsonFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Co=t("getCategoryData",Fe),Go=t("getHistogramData",ke),Io=t("getAggregates",Ve),To=t("getLayerSchema",s.z.string()),Re={methods:[Yt,eo,to,ro,no,ao,io,so,lo,po,mo,yo,go,ho,fo,So,Lo,bo,Mo,Co,Go,Io,To],listeners:[oo,co,uo,xo]};var Ne=require("zod");var Eo=t("getMapDetails",Ne.z.undefined()),Ae={methods:[Eo],listeners:[]};var N=require("zod");var b=require("zod"),De=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 zo=t("getSelection",N.z.undefined()),Po=p("onSelectionChange"),Fo=t("selectFeature",De),ko=t("clearSelection",N.z.object({features:N.z.boolean().optional(),elements:N.z.boolean().optional()}).optional()),He={methods:[zo,Fo,ko],listeners:[Po]};var We=require("zod");var m=require("zod");var Je=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Be=m.z.enum([...Je,"link"]),Ze=m.z.enum(Je),Vo=ae.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),vo=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),wo=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Oo=ie.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Uo=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),jo=le.pick({color:!0,opacity:!0,size:!0}).required(),Ro=pe.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),No=me.pick({color:!0,align:!0,style:!0}).required(),Ao=ce.pick({color:!0,align:!0,style:!0}).required(),qe=m.z.discriminatedUnion("tool",[Vo.partial().extend({tool:m.z.literal("pin")}),vo.partial().extend({tool:m.z.literal("line")}),wo.partial().extend({tool:m.z.literal("route")}),Oo.partial().extend({tool:m.z.literal("polygon")}),Uo.partial().extend({tool:m.z.literal("circle")}),jo.partial().extend({tool:m.z.literal("marker")}),Ro.partial().extend({tool:m.z.literal("highlighter")}),No.partial().extend({tool:m.z.literal("text")}),Ao.partial().extend({tool:m.z.literal("note")})]);var Do=t("setTool",Be.nullable()),Ho=t("getTool",We.z.undefined()),Jo=p("onToolChange"),Bo=t("setToolSettings",qe),Zo=t("getToolSettings",Ze),qo=p("onToolSettingsChange"),_e={methods:[Do,Ho,Bo,Zo],listeners:[Jo,qo]};var Y=require("zod");var c=require("zod"),Qe=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),$e=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var Wo=t("updateUiControls",Qe),_o=t("setOnMapInteractionsUi",$e),Qo=t("showLayerDataTable",Y.z.object({layerId:Y.z.string(),sorting:fe.optional()}).optional()),$o=t("hideLayerDataTable",Y.z.undefined()),Ke={methods:[Wo,_o,Qo,$o],listeners:null};var de=require("zod");var A=require("zod");var ee=A.z.object({center:B,zoom:he}),Xe=A.z.object({center:ee.shape.center.optional(),zoom:ee.shape.zoom.optional()}),Ye=A.z.object({minZoom:ee.shape.zoom.nullish(),maxZoom:ee.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),et=A.z.object({bounds:I});var Ko=t("getViewport",de.z.undefined()),Xo=t("setViewport",Xe),Yo=t("getViewportConstraints",de.z.undefined()),er=t("setViewportConstraints",Ye),tr=t("fitViewportToBounds",et),or=p("onViewportMove"),rr=p("onViewportMoveEnd"),nr=p("onMapIdle"),tt={methods:[Xo,Ko,Yo,er,tr],listeners:[or,rr,nr]};var ue=[Ke,tt,Re,Ge,He,Ie,_e,Ae];function ar(o,l,G){let z=new Map;async function M(u){if(!mr.safeParse(u.data).success){G?.onUnknownMessage?.(u.data);return}let D=nt.safeParse(u.data);if(!D.success){G?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(ot(D.error.message));return}let{data:g}=D;if(g.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let V="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:oe=>{u.ports[0]?.postMessage(oe)}}:{handler:oe=>{u.ports[0]?.postMessage(oe)}},te=l.listeners[g.event.eventName](V);z.set(g.event.id,te)}else if(g.type==="felt.removeListener")z.get(g.id)?.(),z.delete(g.id);else try{let V=l.methods[g.type],te=await V(g.params);u.ports[0]?.postMessage(te)}catch(V){u.ports[0]?.postMessage(ot(V))}}return o.addEventListener("message",M),()=>{o.removeEventListener("message",M)}}var rt={methods:ue.map(o=>o.methods??[]).flat(),listeners:ue.map(o=>o.listeners??[]).flat()},ir=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...rt.listeners]),sr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:ir}),lr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),pr=y.z.strictObject({type:y.z.literal("felt.ready")}),nt=y.z.discriminatedUnion("type",[pr,sr,lr,...rt.methods]),mr=y.z.object({type:y.z.enum(nt.options.map(o=>o.shape.type.value))});function ot(o){return{__error__:cr(o)}}function cr(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}0&&(module.exports={createMessageHandler});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feltmaps/js-sdk",
3
- "version": "1.5.0-next.18",
3
+ "version": "1.5.0-next.19",
4
4
  "description": "An SDK for Felt maps",
5
5
  "keywords": [
6
6
  "felt",