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

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 { 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';
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-DWW9xTjP.js';
3
3
 
4
4
  type Method<TRequest extends {
5
5
  type: string;
@@ -602,13 +602,12 @@ declare const CreateElementMessage: z.ZodObject<{
602
602
  rotation: z.ZodOptional<z.ZodNumber>;
603
603
  scale: z.ZodOptional<z.ZodNumber>;
604
604
  zoom: z.ZodOptional<z.ZodNumber>;
605
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
606
605
  text: z.ZodOptional<z.ZodString>;
607
606
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
608
607
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
609
608
  name: z.ZodOptional<z.ZodString>;
610
609
  type: z.ZodOptional<z.ZodLiteral<"Text">>;
611
- }, "type" | "coordinates" | "id" | "name">, {
610
+ }, "type" | "id" | "name">, {
612
611
  type: z.ZodLiteral<"Text">;
613
612
  text: z.ZodString;
614
613
  }>, "strip", z.ZodTypeAny, {
@@ -650,14 +649,13 @@ declare const CreateElementMessage: z.ZodObject<{
650
649
  rotation: z.ZodOptional<z.ZodNumber>;
651
650
  scale: z.ZodOptional<z.ZodNumber>;
652
651
  zoom: z.ZodOptional<z.ZodNumber>;
653
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
654
652
  text: z.ZodOptional<z.ZodString>;
655
653
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
656
654
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
657
655
  name: z.ZodOptional<z.ZodString>;
658
656
  type: z.ZodOptional<z.ZodLiteral<"Note">>;
659
657
  widthScale: z.ZodOptional<z.ZodNumber>;
660
- }, "type" | "coordinates" | "id" | "name">, {
658
+ }, "type" | "id" | "name">, {
661
659
  type: z.ZodLiteral<"Note">;
662
660
  text: z.ZodString;
663
661
  }>, "strip", z.ZodTypeAny, {
@@ -1336,13 +1334,12 @@ declare const UpdateElementMessage: z.ZodObject<{
1336
1334
  rotation: z.ZodOptional<z.ZodNumber>;
1337
1335
  scale: z.ZodOptional<z.ZodNumber>;
1338
1336
  zoom: z.ZodOptional<z.ZodNumber>;
1339
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
1340
1337
  text: z.ZodOptional<z.ZodString>;
1341
1338
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
1342
1339
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
1343
1340
  name: z.ZodOptional<z.ZodString>;
1344
1341
  type: z.ZodOptional<z.ZodLiteral<"Text">>;
1345
- }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
1342
+ }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<{
1346
1343
  id: z.ZodString;
1347
1344
  groupId: z.ZodNullable<z.ZodString>;
1348
1345
  color: z.ZodString;
@@ -1355,15 +1352,13 @@ declare const UpdateElementMessage: z.ZodObject<{
1355
1352
  rotation: z.ZodNumber;
1356
1353
  scale: z.ZodNumber;
1357
1354
  zoom: z.ZodNumber;
1358
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
1359
- }>, {
1360
1355
  text: z.ZodString;
1361
1356
  align: z.ZodEnum<["left", "center", "right"]>;
1362
1357
  style: z.ZodEnum<["italic", "light", "regular", "caps"]>;
1363
1358
  name: z.ZodString;
1364
1359
  }>, {
1365
1360
  type: z.ZodLiteral<"Text">;
1366
- }>, "type" | "id">>, "coordinates" | "name">, "strip", z.ZodTypeAny, {
1361
+ }>, "type" | "id">>, "name">, "strip", z.ZodTypeAny, {
1367
1362
  type: "Text";
1368
1363
  id: string;
1369
1364
  groupId?: string | null | undefined;
@@ -1404,14 +1399,13 @@ declare const UpdateElementMessage: z.ZodObject<{
1404
1399
  rotation: z.ZodOptional<z.ZodNumber>;
1405
1400
  scale: z.ZodOptional<z.ZodNumber>;
1406
1401
  zoom: z.ZodOptional<z.ZodNumber>;
1407
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
1408
1402
  text: z.ZodOptional<z.ZodString>;
1409
1403
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
1410
1404
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
1411
1405
  name: z.ZodOptional<z.ZodString>;
1412
1406
  type: z.ZodOptional<z.ZodLiteral<"Note">>;
1413
1407
  widthScale: z.ZodOptional<z.ZodNumber>;
1414
- }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
1408
+ }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<{
1415
1409
  id: z.ZodString;
1416
1410
  groupId: z.ZodNullable<z.ZodString>;
1417
1411
  color: z.ZodString;
@@ -1424,8 +1418,6 @@ declare const UpdateElementMessage: z.ZodObject<{
1424
1418
  rotation: z.ZodNumber;
1425
1419
  scale: z.ZodNumber;
1426
1420
  zoom: z.ZodNumber;
1427
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
1428
- }>, {
1429
1421
  text: z.ZodString;
1430
1422
  align: z.ZodEnum<["left", "center", "right"]>;
1431
1423
  style: z.ZodEnum<["italic", "light", "regular", "caps"]>;
@@ -1433,7 +1425,7 @@ declare const UpdateElementMessage: z.ZodObject<{
1433
1425
  }>, {
1434
1426
  type: z.ZodLiteral<"Note">;
1435
1427
  widthScale: z.ZodNumber;
1436
- }>, "type" | "id">>, "coordinates" | "name">, "strip", z.ZodTypeAny, {
1428
+ }>, "type" | "id">>, "name">, "strip", z.ZodTypeAny, {
1437
1429
  type: "Note";
1438
1430
  id: string;
1439
1431
  groupId?: string | null | undefined;
package/handler.js CHANGED
@@ -1 +1 @@
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});
1
+ "use strict";var te=Object.defineProperty;var nt=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var it=Object.prototype.hasOwnProperty;var st=(o,l)=>{for(var G in l)te(o,G,{get:l[G],enumerable:!0})},lt=(o,l,G,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let M of at(l))!it.call(o,M)&&M!==G&&te(o,M,{get:()=>l[M],enumerable:!(z=nt(l,M))||z.enumerable});return o};var pt=o=>lt(te({},"__esModule",{value:!0}),o);var cr={};st(cr,{createMessageHandler:()=>nr});module.exports=pt(cr);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]),V=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(V.shape.coordinates)}),mt=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(mt.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()}),ct=i.z.enum(["asc","desc"]),fe=i.z.object({attribute:i.z.string(),direction:ct});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"])}),yt=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:V.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:yt.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)}),R=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),text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),oe=h.extend(Se.shape).extend({type:e.z.literal("Text")}),re=h.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),j=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}),gt=h.extend({type:e.z.literal("Link"),coordinates:v.shape.coordinates,url:e.z.string()}),P={type:!0,coordinates:!0},x={id:!0},ae=q.partial().extend(q.pick(P).shape).omit(x),Q=w.partial().extend(w.pick(P).shape).omit(x),ie=O.partial().extend(O.pick(P).shape).omit(x),se=W.partial().extend(W.pick({type:!0,center:!0,radius:!0}).shape).omit(x),le=U.partial().extend(U.pick(P).shape).omit(x),pe=R.partial().extend(R.pick(P).shape).omit(x),me=oe.partial().omit({...x,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ce=re.partial().omit({...x,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),dt=j.partial().extend(j.pick({...P,imageUrl:!0}).shape).omit(x),xe=e.z.discriminatedUnion("type",[ae,Q,ie,se,le,pe,dt,me,ce]);var fr=w.omit({coordinates:!0}),Sr=O.omit({coordinates:!0});var xr=U.omit({coordinates:!0}),Lr=R.omit({coordinates:!0});var br=j.omit({coordinates:!0}),Mr=gt.omit({coordinates:!0}),L={type:!0,id:!0},ut=q.partial().extend(q.pick(L).shape),ht=w.partial().extend(w.pick(L).shape),ft=O.partial().extend(O.pick(L).shape),St=W.partial().extend(W.pick(L).shape),xt=U.partial().extend(U.pick(L).shape),Lt=R.partial().extend(R.pick(L).shape),bt=oe.partial().extend(oe.pick(L).shape).omit({name:!0}),Mt=re.partial().extend(re.pick(L).shape).omit({name:!0}),Ct=j.partial().extend(j.pick(L).shape),Le=e.z.discriminatedUnion("type",[ut,ht,ft,St,xt,Lt,bt,Mt,Ct]),be=e.z.object({ids:e.z.array(e.z.string()).optional()}),Me=e.z.object({ids:e.z.array(e.z.string()).optional()});var Gt=t("getElement",d.z.string()),It=t("getElementGeometry",d.z.string()),Tt=t("getElements",be.optional()),Et=t("getElementGroup",d.z.string()),zt=t("getElementGroups",Me.optional()),Pt=t("setElementGroupVisibility",T),Ft=S("onElementChange",d.z.object({id:d.z.string()})),kt=p("onElementCreate"),Vt=p("onElementCreateEnd"),vt=S("onElementDelete",d.z.object({id:d.z.string()})),wt=S("onElementGroupChange",d.z.object({id:d.z.string()})),Ot=t("createElement",xe),Ut=t("updateElement",Le),Rt=t("deleteElement",d.z.string()),Ce={methods:[Gt,It,Tt,Et,zt,Pt,Ot,Ut,Rt],listeners:[Ft,kt,Vt,vt,wt]};var jt=p("onPointerClick"),Nt=p("onPointerMove"),Ge={methods:null,listeners:[jt,Nt]};var s=require("zod");var a=require("zod"),At=a.z.enum(["in","ni"]),Dt=a.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Fr=a.z.enum(["and","or"]),Ie=a.z.union([a.z.number(),a.z.string(),a.z.boolean(),a.z.null()]),Te=a.z.string().or(a.z.null()),Ht=a.z.tuple([Te,At,a.z.array(Ie).or(a.z.null())]),Jt=a.z.tuple([Te,Dt,Ie]),ye=a.z.union([Ht,Jt]),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 Ee=r.z.enum(["avg","max","min","sum","median"]),Bt=r.z.object({method:Ee,attribute:r.z.string()}),Zt=r.z.object({methods:r.z.array(r.z.union([Ee,r.z.literal("count")])),attribute:r.z.string().optional()}),$=r.z.union([I,V,Z,r.z.array(C)]),ze=r.z.object({boundary:$.optional(),filters:E.optional(),aggregation:Bt.optional()}),Pe=r.z.object({layerId:r.z.string(),attribute:r.z.string(),limit:r.z.number().optional(),boundary:$.optional(),filters:E.optional(),values:ze.optional()}),wr=r.z.object({key:r.z.union([r.z.number(),r.z.string(),r.z.boolean()]),value:r.z.number().nullable()}),qt=r.z.object({type:r.z.literal("equal-intervals"),count:r.z.number()}),Wt=r.z.object({type:r.z.literal("time-interval"),interval:r.z.enum(["hour","day","week","month","year"])}),Fe=r.z.object({layerId:r.z.string(),attribute:r.z.string(),steps:r.z.union([qt,Wt,r.z.array(r.z.number())]),boundary:$.optional(),filters:E.optional(),values:ze.optional()}),Or=r.z.object({min:r.z.number(),max:r.z.number(),value:r.z.number()}),ke=r.z.object({layerId:r.z.string(),boundary:$.optional(),filters:E.optional(),aggregation:Zt});var n=require("zod");var jr=n.z.enum(["processing","completed","failed","incomplete"]),_t=n.z.object({type:n.z.literal("geoJsonUrl"),url:n.z.string().url()}),Qt=n.z.object({type:n.z.literal("geoJsonData"),data:n.z.object({}).passthrough()}),$t=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()}),ve=n.z.object({ids:n.z.array(n.z.string()).optional()}),F=n.z.object({id:n.z.string(),layerId:n.z.string()}),we=n.z.object({ids:F.array().optional(),layerIds:n.z.string().array().optional()}),Oe=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()}),Kt=n.z.object({Point:n.z.object({}).passthrough().optional(),Line:n.z.object({}).passthrough().optional(),Polygon:n.z.object({}).passthrough().optional()}),Ue=n.z.object({source:n.z.union([_t,Qt,$t]),name:n.z.string(),geometryStyles:Kt.optional()});var Xt=t("getLayer",s.z.string()),Yt=t("getLayers",Ve.optional()),eo=t("setLayerVisibility",T),to=S("onLayerChange",s.z.object({id:s.z.string()})),oo=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),ro=t("setLayerLegendVisibility",T),no=t("createLayersFromGeoJson",Ue),ao=t("deleteLayer",s.z.string()),io=t("getLayerGroup",s.z.string()),so=t("getLayerGroups",ve.optional()),lo=t("setLayerGroupVisibility",T),po=t("setLayerGroupLegendVisibility",T),mo=S("onLayerGroupChange",s.z.object({id:s.z.string()})),co=t("getLegendItem",F),yo=t("getLegendItems",we.optional()),go=S("onLegendItemChange",F),uo=t("setLegendItemVisibility",s.z.object({show:F.array().optional(),hide:F.array().optional()})),ho=t("getLayerFilters",s.z.string()),fo=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:E,note:s.z.string().optional()})),So=S("onLayerFiltersChange",s.z.object({layerId:s.z.string()})),xo=t("getRenderedFeatures",Oe.optional()),Lo=t("getFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),bo=t("getGeoJsonFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Mo=t("getCategoryData",Pe),Co=t("getHistogramData",Fe),Go=t("getAggregates",ke),Io=t("getLayerSchema",s.z.string()),Re={methods:[Xt,Yt,eo,oo,ro,no,ao,io,so,lo,po,co,yo,uo,ho,fo,xo,Lo,bo,Mo,Co,Go,Io],listeners:[to,mo,go,So]};var je=require("zod");var To=t("getMapDetails",je.z.undefined()),Ne={methods:[To],listeners:[]};var N=require("zod");var b=require("zod"),Ae=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 Eo=t("getSelection",N.z.undefined()),zo=p("onSelectionChange"),Po=t("selectFeature",Ae),Fo=t("clearSelection",N.z.object({features:N.z.boolean().optional(),elements:N.z.boolean().optional()}).optional()),De={methods:[Eo,Po,Fo],listeners:[zo]};var qe=require("zod");var m=require("zod");var He=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Je=m.z.enum([...He,"link"]),Be=m.z.enum(He),ko=ae.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Vo=Q.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),vo=Q.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),wo=ie.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Oo=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Uo=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(),jo=me.pick({color:!0,align:!0,style:!0}).required(),No=ce.pick({color:!0,align:!0,style:!0}).required(),Ze=m.z.discriminatedUnion("tool",[ko.partial().extend({tool:m.z.literal("pin")}),Vo.partial().extend({tool:m.z.literal("line")}),vo.partial().extend({tool:m.z.literal("route")}),wo.partial().extend({tool:m.z.literal("polygon")}),Oo.partial().extend({tool:m.z.literal("circle")}),Uo.partial().extend({tool:m.z.literal("marker")}),Ro.partial().extend({tool:m.z.literal("highlighter")}),jo.partial().extend({tool:m.z.literal("text")}),No.partial().extend({tool:m.z.literal("note")})]);var Ao=t("setTool",Je.nullable()),Do=t("getTool",qe.z.undefined()),Ho=p("onToolChange"),Jo=t("setToolSettings",Ze),Bo=t("getToolSettings",Be),Zo=p("onToolSettingsChange"),We={methods:[Ao,Do,Jo,Bo],listeners:[Ho,Zo]};var K=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()}),Qe=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 qo=t("updateUiControls",_e),Wo=t("setOnMapInteractionsUi",Qe),_o=t("showLayerDataTable",K.z.object({layerId:K.z.string(),sorting:fe.optional()}).optional()),Qo=t("hideLayerDataTable",K.z.undefined()),$e={methods:[qo,Wo,_o,Qo],listeners:null};var de=require("zod");var A=require("zod");var X=A.z.object({center:B,zoom:he}),Ke=A.z.object({center:X.shape.center.optional(),zoom:X.shape.zoom.optional()}),Xe=A.z.object({minZoom:X.shape.zoom.nullish(),maxZoom:X.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),Ye=A.z.object({bounds:I});var $o=t("getViewport",de.z.undefined()),Ko=t("setViewport",Ke),Xo=t("getViewportConstraints",de.z.undefined()),Yo=t("setViewportConstraints",Xe),er=t("fitViewportToBounds",Ye),tr=p("onViewportMove"),or=p("onViewportMoveEnd"),rr=p("onMapIdle"),et={methods:[Ko,$o,Xo,Yo,er],listeners:[tr,or,rr]};var ue=[$e,et,Re,Ce,De,Ge,We,Ne];function nr(o,l,G){let z=new Map;async function M(u){if(!pr.safeParse(u.data).success){G?.onUnknownMessage?.(u.data);return}let D=rt.safeParse(u.data);if(!D.success){G?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(tt(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 k="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:ee=>{u.ports[0]?.postMessage(ee)}}:{handler:ee=>{u.ports[0]?.postMessage(ee)}},Y=l.listeners[g.event.eventName](k);z.set(g.event.id,Y)}else if(g.type==="felt.removeListener")z.get(g.id)?.(),z.delete(g.id);else try{let k=l.methods[g.type],Y=await k(g.params);u.ports[0]?.postMessage(Y)}catch(k){u.ports[0]?.postMessage(tt(k))}}return o.addEventListener("message",M),()=>{o.removeEventListener("message",M)}}var ot={methods:ue.map(o=>o.methods??[]).flat(),listeners:ue.map(o=>o.listeners??[]).flat()},ar=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...ot.listeners]),ir=y.z.strictObject({type:y.z.literal("felt.addListener"),event:ar}),sr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),lr=y.z.strictObject({type:y.z.literal("felt.ready")}),rt=y.z.discriminatedUnion("type",[lr,ir,sr,...ot.methods]),pr=y.z.object({type:y.z.enum(rt.options.map(o=>o.shape.type.value))});function tt(o){return{__error__:mr(o)}}function mr(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.19",
3
+ "version": "1.5.0-next.20",
4
4
  "description": "An SDK for Felt maps",
5
5
  "keywords": [
6
6
  "felt",
@@ -1109,13 +1109,12 @@ declare const TextCreateSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
1109
1109
  rotation: z.ZodOptional<z.ZodNumber>;
1110
1110
  scale: z.ZodOptional<z.ZodNumber>;
1111
1111
  zoom: z.ZodOptional<z.ZodNumber>;
1112
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
1113
1112
  text: z.ZodOptional<z.ZodString>;
1114
1113
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
1115
1114
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
1116
1115
  name: z.ZodOptional<z.ZodString>;
1117
1116
  type: z.ZodOptional<z.ZodLiteral<"Text">>;
1118
- }, "type" | "coordinates" | "id" | "name">, {
1117
+ }, "type" | "id" | "name">, {
1119
1118
  type: z.ZodLiteral<"Text">;
1120
1119
  text: z.ZodString;
1121
1120
  }>, "strip", z.ZodTypeAny, {
@@ -1158,14 +1157,13 @@ declare const NoteCreateSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
1158
1157
  rotation: z.ZodOptional<z.ZodNumber>;
1159
1158
  scale: z.ZodOptional<z.ZodNumber>;
1160
1159
  zoom: z.ZodOptional<z.ZodNumber>;
1161
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
1162
1160
  text: z.ZodOptional<z.ZodString>;
1163
1161
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
1164
1162
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
1165
1163
  name: z.ZodOptional<z.ZodString>;
1166
1164
  type: z.ZodOptional<z.ZodLiteral<"Note">>;
1167
1165
  widthScale: z.ZodOptional<z.ZodNumber>;
1168
- }, "type" | "coordinates" | "id" | "name">, {
1166
+ }, "type" | "id" | "name">, {
1169
1167
  type: z.ZodLiteral<"Note">;
1170
1168
  text: z.ZodString;
1171
1169
  }>, "strip", z.ZodTypeAny, {
@@ -2104,7 +2102,7 @@ declare const HighlighterReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
2104
2102
  renderHoles: boolean;
2105
2103
  interaction?: "default" | "locked" | undefined;
2106
2104
  }>;
2107
- declare const TextReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
2105
+ declare const TextReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
2108
2106
  /**
2109
2107
  * The unique identifier for the element.
2110
2108
  */
@@ -2169,12 +2167,31 @@ declare const TextReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
2169
2167
  */
2170
2168
  interaction: z.ZodOptional<z.ZodEnum<["default", "locked"]>>;
2171
2169
  }, {
2170
+ /**
2171
+ * The geographical position of the center of the element.
2172
+ */
2172
2173
  position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
2174
+ /**
2175
+ * The rotation of the element in degrees.
2176
+ *
2177
+ * @default 0
2178
+ */
2173
2179
  rotation: z.ZodNumber;
2180
+ /**
2181
+ * The relative scale of the element from the default size. This is combined
2182
+ * with the `zoom` to determine the actual size of the element.
2183
+ *
2184
+ * @default 1
2185
+ */
2174
2186
  scale: z.ZodNumber;
2187
+ /**
2188
+ * The zoom level at which the element was created. This is combined with
2189
+ * the `scale` to determine the actual size of the element.
2190
+ *
2191
+ * When creating an element, if you don't supply this value it defaults to
2192
+ * the current zoom of the map when you call `createElement`.
2193
+ */
2175
2194
  zoom: z.ZodNumber;
2176
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
2177
- }>, {
2178
2195
  /**
2179
2196
  * The text in the element.
2180
2197
  */
@@ -2200,7 +2217,7 @@ declare const TextReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
2200
2217
  name: z.ZodString;
2201
2218
  }>, {
2202
2219
  type: z.ZodLiteral<"Text">;
2203
- }>, "coordinates">, "strip", z.ZodTypeAny, {
2220
+ }>, "strip", z.ZodTypeAny, {
2204
2221
  type: "Text";
2205
2222
  id: string;
2206
2223
  groupId: string | null;
@@ -2233,7 +2250,7 @@ declare const TextReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
2233
2250
  style: "italic" | "light" | "regular" | "caps";
2234
2251
  interaction?: "default" | "locked" | undefined;
2235
2252
  }>;
2236
- declare const NoteReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
2253
+ declare const NoteReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
2237
2254
  /**
2238
2255
  * The unique identifier for the element.
2239
2256
  */
@@ -2298,12 +2315,31 @@ declare const NoteReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
2298
2315
  */
2299
2316
  interaction: z.ZodOptional<z.ZodEnum<["default", "locked"]>>;
2300
2317
  }, {
2318
+ /**
2319
+ * The geographical position of the center of the element.
2320
+ */
2301
2321
  position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
2322
+ /**
2323
+ * The rotation of the element in degrees.
2324
+ *
2325
+ * @default 0
2326
+ */
2302
2327
  rotation: z.ZodNumber;
2328
+ /**
2329
+ * The relative scale of the element from the default size. This is combined
2330
+ * with the `zoom` to determine the actual size of the element.
2331
+ *
2332
+ * @default 1
2333
+ */
2303
2334
  scale: z.ZodNumber;
2335
+ /**
2336
+ * The zoom level at which the element was created. This is combined with
2337
+ * the `scale` to determine the actual size of the element.
2338
+ *
2339
+ * When creating an element, if you don't supply this value it defaults to
2340
+ * the current zoom of the map when you call `createElement`.
2341
+ */
2304
2342
  zoom: z.ZodNumber;
2305
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
2306
- }>, {
2307
2343
  /**
2308
2344
  * The text in the element.
2309
2345
  */
@@ -2330,7 +2366,7 @@ declare const NoteReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
2330
2366
  }>, {
2331
2367
  type: z.ZodLiteral<"Note">;
2332
2368
  widthScale: z.ZodNumber;
2333
- }>, "coordinates">, "strip", z.ZodTypeAny, {
2369
+ }>, "strip", z.ZodTypeAny, {
2334
2370
  type: "Note";
2335
2371
  id: string;
2336
2372
  groupId: string | null;
@@ -3461,13 +3497,12 @@ declare const TextUpdateSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
3461
3497
  rotation: z.ZodOptional<z.ZodNumber>;
3462
3498
  scale: z.ZodOptional<z.ZodNumber>;
3463
3499
  zoom: z.ZodOptional<z.ZodNumber>;
3464
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
3465
3500
  text: z.ZodOptional<z.ZodString>;
3466
3501
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
3467
3502
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
3468
3503
  name: z.ZodOptional<z.ZodString>;
3469
3504
  type: z.ZodOptional<z.ZodLiteral<"Text">>;
3470
- }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3505
+ }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3471
3506
  /**
3472
3507
  * The unique identifier for the element.
3473
3508
  */
@@ -3532,12 +3567,31 @@ declare const TextUpdateSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
3532
3567
  */
3533
3568
  interaction: z.ZodOptional<z.ZodEnum<["default", "locked"]>>;
3534
3569
  }, {
3570
+ /**
3571
+ * The geographical position of the center of the element.
3572
+ */
3535
3573
  position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
3574
+ /**
3575
+ * The rotation of the element in degrees.
3576
+ *
3577
+ * @default 0
3578
+ */
3536
3579
  rotation: z.ZodNumber;
3580
+ /**
3581
+ * The relative scale of the element from the default size. This is combined
3582
+ * with the `zoom` to determine the actual size of the element.
3583
+ *
3584
+ * @default 1
3585
+ */
3537
3586
  scale: z.ZodNumber;
3587
+ /**
3588
+ * The zoom level at which the element was created. This is combined with
3589
+ * the `scale` to determine the actual size of the element.
3590
+ *
3591
+ * When creating an element, if you don't supply this value it defaults to
3592
+ * the current zoom of the map when you call `createElement`.
3593
+ */
3538
3594
  zoom: z.ZodNumber;
3539
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
3540
- }>, {
3541
3595
  /**
3542
3596
  * The text in the element.
3543
3597
  */
@@ -3563,7 +3617,7 @@ declare const TextUpdateSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
3563
3617
  name: z.ZodString;
3564
3618
  }>, {
3565
3619
  type: z.ZodLiteral<"Text">;
3566
- }>, "type" | "id">>, "coordinates" | "name">, "strip", z.ZodTypeAny, {
3620
+ }>, "type" | "id">>, "name">, "strip", z.ZodTypeAny, {
3567
3621
  type: "Text";
3568
3622
  id: string;
3569
3623
  groupId?: string | null | undefined;
@@ -3605,14 +3659,13 @@ declare const NoteUpdateSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
3605
3659
  rotation: z.ZodOptional<z.ZodNumber>;
3606
3660
  scale: z.ZodOptional<z.ZodNumber>;
3607
3661
  zoom: z.ZodOptional<z.ZodNumber>;
3608
- coordinates: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
3609
3662
  text: z.ZodOptional<z.ZodString>;
3610
3663
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
3611
3664
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
3612
3665
  name: z.ZodOptional<z.ZodString>;
3613
3666
  type: z.ZodOptional<z.ZodLiteral<"Note">>;
3614
3667
  widthScale: z.ZodOptional<z.ZodNumber>;
3615
- }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3668
+ }, Pick<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3616
3669
  /**
3617
3670
  * The unique identifier for the element.
3618
3671
  */
@@ -3677,12 +3730,31 @@ declare const NoteUpdateSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
3677
3730
  */
3678
3731
  interaction: z.ZodOptional<z.ZodEnum<["default", "locked"]>>;
3679
3732
  }, {
3733
+ /**
3734
+ * The geographical position of the center of the element.
3735
+ */
3680
3736
  position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
3737
+ /**
3738
+ * The rotation of the element in degrees.
3739
+ *
3740
+ * @default 0
3741
+ */
3681
3742
  rotation: z.ZodNumber;
3743
+ /**
3744
+ * The relative scale of the element from the default size. This is combined
3745
+ * with the `zoom` to determine the actual size of the element.
3746
+ *
3747
+ * @default 1
3748
+ */
3682
3749
  scale: z.ZodNumber;
3750
+ /**
3751
+ * The zoom level at which the element was created. This is combined with
3752
+ * the `scale` to determine the actual size of the element.
3753
+ *
3754
+ * When creating an element, if you don't supply this value it defaults to
3755
+ * the current zoom of the map when you call `createElement`.
3756
+ */
3683
3757
  zoom: z.ZodNumber;
3684
- coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
3685
- }>, {
3686
3758
  /**
3687
3759
  * The text in the element.
3688
3760
  */
@@ -3709,7 +3781,7 @@ declare const NoteUpdateSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
3709
3781
  }>, {
3710
3782
  type: z.ZodLiteral<"Note">;
3711
3783
  widthScale: z.ZodNumber;
3712
- }>, "type" | "id">>, "coordinates" | "name">, "strip", z.ZodTypeAny, {
3784
+ }>, "type" | "id">>, "name">, "strip", z.ZodTypeAny, {
3713
3785
  type: "Note";
3714
3786
  id: string;
3715
3787
  groupId?: string | null | undefined;
@@ -3872,10 +3944,22 @@ interface HighlighterElementCreate extends zInfer<typeof HighlighterCreateSchema
3872
3944
  coordinates: LngLatTuple[][][];
3873
3945
  }
3874
3946
  interface TextElementCreate extends zInfer<typeof TextCreateSchema> {
3875
- position: LngLatTuple;
3947
+ /**
3948
+ * The geographical position of the center of the text element.
3949
+ *
3950
+ * If this is omitted, the text will be placed at the center of the current
3951
+ * viewport.
3952
+ */
3953
+ position?: LngLatTuple;
3876
3954
  }
3877
3955
  interface NoteElementCreate extends zInfer<typeof NoteCreateSchema> {
3878
- position: LngLatTuple;
3956
+ /**
3957
+ * The geographical position of the center of the note element.
3958
+ *
3959
+ * If this is omitted, the note will be placed at the center of the current
3960
+ * viewport.
3961
+ */
3962
+ position?: LngLatTuple;
3879
3963
  }
3880
3964
  interface ImageElementCreate extends zInfer<typeof ImageCreateSchema> {
3881
3965
  }
@@ -3894,9 +3978,15 @@ interface MarkerElementRead extends zInfer<typeof MarkerReadSchema> {
3894
3978
  interface HighlighterElementRead extends zInfer<typeof HighlighterReadSchema> {
3895
3979
  }
3896
3980
  interface TextElementRead extends zInfer<typeof TextReadSchema> {
3981
+ /**
3982
+ * The geographical position of the center of the text element.
3983
+ */
3897
3984
  position: LngLatTuple;
3898
3985
  }
3899
3986
  interface NoteElementRead extends zInfer<typeof NoteReadSchema> {
3987
+ /**
3988
+ * The geographical position of the center of the note element.
3989
+ */
3900
3990
  position: LngLatTuple;
3901
3991
  }
3902
3992
  interface ImageElementRead extends zInfer<typeof ImageReadSchema> {