@agentic-ui-experience/ui-arcgis 0.0.1-beta.1
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/README.md +309 -0
- package/dist/ArcGISMapView.d.ts +51 -0
- package/dist/ArcGISMapView.js +1 -0
- package/dist/api.d.ts +1563 -0
- package/dist/api.js +1 -0
- package/dist/catalog.d.ts +1211 -0
- package/dist/catalog.js +1 -0
- package/dist/controller/api.d.ts +970 -0
- package/dist/controller/api.js +1 -0
- package/dist/controller/createArcGISMapController.d.ts +16 -0
- package/dist/controller/createArcGISMapController.js +1 -0
- package/dist/controller/featureFilter.d.ts +425 -0
- package/dist/controller/featureFilter.js +1 -0
- package/dist/controller/featureFilterExpression.d.ts +16 -0
- package/dist/controller/featureFilterExpression.js +1 -0
- package/dist/controller/featureFilterRuntime.d.ts +19 -0
- package/dist/controller/featureFilterRuntime.js +1 -0
- package/dist/controller/featureQuery.d.ts +275 -0
- package/dist/controller/featureQuery.js +1 -0
- package/dist/controller/featureQueryExpression.d.ts +16 -0
- package/dist/controller/featureQueryExpression.js +1 -0
- package/dist/controller/featureQueryRuntime.d.ts +12 -0
- package/dist/controller/featureQueryRuntime.js +1 -0
- package/dist/controller/useArcGISMapController.d.ts +13 -0
- package/dist/controller/useArcGISMapController.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -0
- package/dist/prompt.d.ts +2 -0
- package/dist/prompt.js +1 -0
- package/package.json +54 -0
- package/styles.css +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# @agentic-ui-experience/ui-arcgis
|
|
2
|
+
|
|
3
|
+
Optional ArcGIS extension for `@agentic-ui-experience/ui-core`,
|
|
4
|
+
`@agentic-ui-experience/ui-runtime`, and
|
|
5
|
+
`@agentic-ui-experience/ui-react`.
|
|
6
|
+
|
|
7
|
+
The package provides the `ArcGISMapView` component, its schema and Agent
|
|
8
|
+
metadata, and ready-made catalog projections. It does not proxy or re-export
|
|
9
|
+
the generic APIs from the foundational UI packages.
|
|
10
|
+
|
|
11
|
+
In this document, **Catalog**, **Runtime**, **Renderer**, and **Host app** follow the definitions in the [project glossary](../../docs/glossary.md). `ui-arcgis` extends the AGUI UI stack; A2UI remains the upstream basis of the UI Spec.
|
|
12
|
+
|
|
13
|
+
## Package role
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
ui-core / ui-runtime / ui-react
|
|
17
|
+
↑
|
|
18
|
+
ui-arcgis
|
|
19
|
+
↑
|
|
20
|
+
application
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Applications continue to create Agent tools, runtimes, and React renderers
|
|
24
|
+
from the foundational packages. They import only ArcGIS-specific components
|
|
25
|
+
and catalog projections from `ui-arcgis`.
|
|
26
|
+
|
|
27
|
+
## Exports
|
|
28
|
+
|
|
29
|
+
| Export | Consumer | Purpose |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `ArcGISMapViewApi` | Agent/runtime | Component name and Zod props schema; source of truth for the other projections |
|
|
32
|
+
| `ArcGISMapView` | React renderer | React implementation backed by ArcGIS Map Components |
|
|
33
|
+
| `useArcGISMapController` | Host React app | Attach snapshot and presentation-command APIs to a host-owned map element |
|
|
34
|
+
| `arcgisPromptDescriptor` | Agent tools | Static component schema, description, and style-guide projection |
|
|
35
|
+
| `arcgisRuntimeCatalog` | `ui-runtime` | Props validation and surface-state processing |
|
|
36
|
+
| `arcgisReactCatalog` | `ui-react` | Props validation and React renderer binding |
|
|
37
|
+
|
|
38
|
+
The three catalog exports share `ARCGIS_CATALOG_ID`, but have different types
|
|
39
|
+
and consumers. A prompt descriptor is not an executable runtime catalog and is
|
|
40
|
+
not UI output generated by an Agent.
|
|
41
|
+
|
|
42
|
+
## Install and load styles
|
|
43
|
+
|
|
44
|
+
Install this package alongside the foundational UI packages used by the host.
|
|
45
|
+
Install `@arcgis/core` directly when the host configures the ArcGIS SDK:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pnpm add @agentic-ui-experience/ui-arcgis @arcgis/core
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Load the ArcGIS Map Components styles once in the application:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import "@agentic-ui-experience/ui-arcgis/styles.css";
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Configure the portal in the host
|
|
58
|
+
|
|
59
|
+
Portal configuration belongs to the host application, not to an
|
|
60
|
+
`ArcGISMapView` prop. Initialize the global ArcGIS SDK before rendering maps:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import esriConfig from "@arcgis/core/config.js";
|
|
64
|
+
|
|
65
|
+
esriConfig.portalUrl = "https://example.arcgis.com";
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If the application uses OAuth, the host must also register OAuth information
|
|
69
|
+
and complete sign-in. Do not use a custom-portal token as a production Basemap
|
|
70
|
+
Styles API token.
|
|
71
|
+
|
|
72
|
+
Use the configured portal's default basemap with:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"source": {
|
|
77
|
+
"type": "basemap",
|
|
78
|
+
"basemap": "portal/default",
|
|
79
|
+
"center": { "latitude": 39.9, "longitude": 116.4 },
|
|
80
|
+
"zoom": 10
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Use the ready-made ArcGIS catalogs
|
|
86
|
+
|
|
87
|
+
When the application only needs the A2UI basic components and
|
|
88
|
+
`ArcGISMapView`, use the provided projections directly:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import {
|
|
92
|
+
arcgisPromptDescriptor,
|
|
93
|
+
arcgisRuntimeCatalog,
|
|
94
|
+
arcgisReactCatalog
|
|
95
|
+
} from "@agentic-ui-experience/ui-arcgis";
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- Pass `arcgisPromptDescriptor` to the agent-side `createUIToolCatalog`.
|
|
99
|
+
- Register `arcgisRuntimeCatalog` with a non-React runtime.
|
|
100
|
+
- Pass `arcgisReactCatalog` to `useUIRuntime({ catalog: arcgisReactCatalog })`
|
|
101
|
+
in a React application.
|
|
102
|
+
|
|
103
|
+
All three projections include the A2UI basic catalog capabilities.
|
|
104
|
+
|
|
105
|
+
## Attach to a host-owned map
|
|
106
|
+
|
|
107
|
+
Applications that keep a primary map mounted outside A2UI can attach the
|
|
108
|
+
controller hook to their own ArcGIS Map Component:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import React, { useRef } from "react";
|
|
112
|
+
import type { ArcgisMap } from "@arcgis/map-components/components/arcgis-map";
|
|
113
|
+
import { useArcGISMapController } from "@agentic-ui-experience/ui-arcgis";
|
|
114
|
+
|
|
115
|
+
const mapRef = useRef<ArcgisMap | null>(null);
|
|
116
|
+
const { status, controller } = useArcGISMapController(mapRef);
|
|
117
|
+
|
|
118
|
+
return React.createElement("arcgis-map", {
|
|
119
|
+
ref: mapRef,
|
|
120
|
+
"item-id": webMapItemId
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The hook waits for the component view, exposes serializable snapshots plus
|
|
125
|
+
`goTo` and `setLayerVisibility`, and removes its watches on unmount. It does
|
|
126
|
+
not render or destroy the host element. This controller API is separate from
|
|
127
|
+
the A2UI `ArcGISMapView`, which remains a display-only catalog component.
|
|
128
|
+
`execute(command, { signal, origin }?)` forwards cancellation to navigation and
|
|
129
|
+
checks the signal immediately around every map mutation. Cancelled operations
|
|
130
|
+
return the controller's typed `cancelled` failure instead of reporting success.
|
|
131
|
+
`origin` is an optional generic `{ transactionId, operationId }` identity; each
|
|
132
|
+
trimmed identifier is limited to 128 characters. It lets a host correlate
|
|
133
|
+
controller feedback with one exact transaction without coupling the package to
|
|
134
|
+
an application runtime.
|
|
135
|
+
|
|
136
|
+
`subscribe(listener)` publishes strict snapshot notifications with:
|
|
137
|
+
|
|
138
|
+
- `snapshot`: the complete serializable live map snapshot read at frame time;
|
|
139
|
+
- `operationOrigins`: at most 16 unique valid origins that explain mutations in
|
|
140
|
+
that frame; and
|
|
141
|
+
- `hasExternalChanges`: `true` whenever any observable change is not explained
|
|
142
|
+
by the controller's bounded mutation evidence.
|
|
143
|
+
|
|
144
|
+
The controller coalesces ordered visibility writes in one animation frame and
|
|
145
|
+
deduplicates repeated origins. It does not claim navigation interpolation from
|
|
146
|
+
viewpoint values alone. A navigation carrying a valid origin calls ArcGIS
|
|
147
|
+
`goTo` with `animate: false`; only its unchanged baseline or requested target
|
|
148
|
+
can remain a candidate for ownership until the matching promise and terminal
|
|
149
|
+
snapshot authenticate the origin. The viewpoint watcher latches any non-target
|
|
150
|
+
value as external even if another write restores the target before publication.
|
|
151
|
+
Navigation without an origin omits the animation option and keeps the ArcGIS
|
|
152
|
+
SDK's default behavior; its viewpoint feedback remains external.
|
|
153
|
+
Replacing the actual host map object retires queued evidence even when the old
|
|
154
|
+
and new maps share an item ID or omit item IDs.
|
|
155
|
+
|
|
156
|
+
Consumers must treat origins as hints scoped to the exact transaction that
|
|
157
|
+
created them, never as general snapshot ownership. A notification with
|
|
158
|
+
`hasExternalChanges: true` must always take the fail-closed reconciliation path,
|
|
159
|
+
even when it also contains one or more recognized origins.
|
|
160
|
+
|
|
161
|
+
### Structured feature filtering
|
|
162
|
+
|
|
163
|
+
The controller also exposes three serializable feature methods for host-owned
|
|
164
|
+
feature layers:
|
|
165
|
+
|
|
166
|
+
- `describeFeatureLayer(layerId, options?)` verifies that a layer view is
|
|
167
|
+
available without changing its filter, then returns the layer id, title,
|
|
168
|
+
and live field names, aliases, and ArcGIS field types.
|
|
169
|
+
- `setFeatureFilter(request, options?)` validates structured predicates,
|
|
170
|
+
counts the matching features, and applies one controller-owned filter for
|
|
171
|
+
the layer. A success includes the normalized request and
|
|
172
|
+
`matchedFeatureCount`, including when that count is zero.
|
|
173
|
+
- `clearFeatureFilter({ layerId }, options?)` clears one controller-owned filter, or all
|
|
174
|
+
controller-owned filters when `layerId` is `null`, and reports the layer ids
|
|
175
|
+
actually cleared. A pre-aborted clear performs no mutation.
|
|
176
|
+
|
|
177
|
+
A set request has one `layerId`, `logic: "and" | "or"`, and one to eight
|
|
178
|
+
predicates. Each predicate has an exact live `fieldName`, an `operator`, and
|
|
179
|
+
zero to 50 string or finite-number `values`; strings are limited to 256
|
|
180
|
+
characters. Supported field categories are numeric, string, GUID/global ID,
|
|
181
|
+
and date/time. The operators are:
|
|
182
|
+
|
|
183
|
+
- `eq` and `ne`: numeric, string, identifier, or date/time fields; exactly one
|
|
184
|
+
value.
|
|
185
|
+
- `gt`, `gte`, `lt`, and `lte`: numeric or date/time fields; exactly one value.
|
|
186
|
+
- `between`: numeric or date/time fields; exactly two values.
|
|
187
|
+
- `in`: numeric, string, or GUID/global ID fields; one to 50 values.
|
|
188
|
+
- `contains` and `starts_with`: string fields; exactly one string value.
|
|
189
|
+
- `is_null` and `is_not_null`: every supported field category; no values.
|
|
190
|
+
|
|
191
|
+
`date` field values must be ISO instants with `Z` or an explicit offset and
|
|
192
|
+
second precision; fractional seconds are rejected rather than truncated.
|
|
193
|
+
|
|
194
|
+
The controller compiles these predicates internally. Raw expressions and
|
|
195
|
+
ArcGIS SDK objects are never public inputs or results.
|
|
196
|
+
|
|
197
|
+
Feature filters are transient and view-local. On the first set for a layer,
|
|
198
|
+
the controller clones the host's existing layer-view filter as its baseline.
|
|
199
|
+
It composes the structured predicate with the baseline `where` using `AND` and
|
|
200
|
+
preserves the baseline object ids, geometry, spatial relationship, distance,
|
|
201
|
+
units, and time extent. It queries the combined candidate count before
|
|
202
|
+
swapping the view filter; validation, count, cancellation, or apply failures
|
|
203
|
+
leave the old filter unchanged. A later set replaces only the
|
|
204
|
+
controller-owned predicate. Clear and controller disposal restore a clone of
|
|
205
|
+
the original host baseline. Nothing is written to the WebMap, and no filter
|
|
206
|
+
survives controller disposal or a newly mounted view.
|
|
207
|
+
|
|
208
|
+
### Reference application
|
|
209
|
+
|
|
210
|
+
[Map Workspace](../../apps/map-workspace/README.md) demonstrates the controller
|
|
211
|
+
with a persistent host WebMap, compact agent context, semantic layer retrieval,
|
|
212
|
+
and explicit map tools. WebMap embedding resources and semantic retrieval are
|
|
213
|
+
application-local responsibilities; they are not capabilities of
|
|
214
|
+
`ui-arcgis`.
|
|
215
|
+
|
|
216
|
+
## Compose with application components
|
|
217
|
+
|
|
218
|
+
If an application also owns custom components, it must create one application
|
|
219
|
+
catalog ID and derive all three projections from the combined component set:
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
import { defineCatalogPromptDescriptor } from "@agentic-ui-experience/ui-core";
|
|
223
|
+
import { defineCatalog as defineRuntimeCatalog } from "@agentic-ui-experience/ui-runtime";
|
|
224
|
+
import { defineReactCatalog } from "@agentic-ui-experience/ui-react";
|
|
225
|
+
import {
|
|
226
|
+
ArcGISMapView,
|
|
227
|
+
ArcGISMapViewApi,
|
|
228
|
+
arcGISMapViewDescription,
|
|
229
|
+
arcgisStyleGuide
|
|
230
|
+
} from "@agentic-ui-experience/ui-arcgis";
|
|
231
|
+
import {
|
|
232
|
+
Weather,
|
|
233
|
+
WeatherApi,
|
|
234
|
+
weatherDescription,
|
|
235
|
+
weatherStyleGuide
|
|
236
|
+
} from "./weather.js";
|
|
237
|
+
|
|
238
|
+
const id = "com.example.application.v1";
|
|
239
|
+
const componentApis = [WeatherApi, ArcGISMapViewApi] as const;
|
|
240
|
+
|
|
241
|
+
export const promptDescriptor = defineCatalogPromptDescriptor({
|
|
242
|
+
id,
|
|
243
|
+
components: componentApis,
|
|
244
|
+
descriptions: {
|
|
245
|
+
Weather: weatherDescription,
|
|
246
|
+
ArcGISMapView: arcGISMapViewDescription
|
|
247
|
+
},
|
|
248
|
+
styleGuide: [weatherStyleGuide, arcgisStyleGuide].join("\n\n")
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
export const runtimeCatalog = defineRuntimeCatalog({
|
|
252
|
+
id,
|
|
253
|
+
components: componentApis
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
export const reactCatalog = defineReactCatalog({
|
|
257
|
+
id,
|
|
258
|
+
components: [Weather, ArcGISMapView]
|
|
259
|
+
});
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
A surface selects one `createSurface.catalogId`, so the application owns the
|
|
263
|
+
final composition. `ui-arcgis` does not guess which other components an
|
|
264
|
+
application needs.
|
|
265
|
+
|
|
266
|
+
## `ArcGISMapView` props
|
|
267
|
+
|
|
268
|
+
- `title?`, `description?`
|
|
269
|
+
- `source`: required `webmap` or `basemap` source
|
|
270
|
+
- `controls?`: `zoom`, `legend`, `layerList`, and `search`
|
|
271
|
+
- `height?`: 180–640 pixels; defaults to 280
|
|
272
|
+
- `openInArcGIS?`: show the open-in-ArcGIS action
|
|
273
|
+
|
|
274
|
+
Web map source:
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"source": {
|
|
279
|
+
"type": "webmap",
|
|
280
|
+
"itemId": "0123456789abcdef0123456789abcdef"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Basemap source:
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"source": {
|
|
290
|
+
"type": "basemap",
|
|
291
|
+
"basemap": "portal/default",
|
|
292
|
+
"center": { "latitude": 39.9, "longitude": 116.4 },
|
|
293
|
+
"zoom": 10
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Other basemap values are `arcgis/topographic`, `arcgis/streets`,
|
|
299
|
+
`arcgis/navigation`, `arcgis/light-gray`, `arcgis/dark-gray`,
|
|
300
|
+
`arcgis/imagery`, and `arcgis/outdoor`. Omitting `basemap` defaults to
|
|
301
|
+
`arcgis/topographic`.
|
|
302
|
+
|
|
303
|
+
## Verify
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
pnpm --filter @agentic-ui-experience/ui-arcgis test
|
|
307
|
+
pnpm --filter @agentic-ui-experience/map-workspace exec tsc --noEmit
|
|
308
|
+
pnpm --filter @agentic-ui-experience/map-workspace build
|
|
309
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ReactComponentImplementation } from "@agentic-ui-experience/ui-react";
|
|
2
|
+
import { type ArcGISMapViewProps, normalizeArcGISMapViewProps } from "./api.js";
|
|
3
|
+
type ArcGISMapFailure = "registration" | "load";
|
|
4
|
+
type NormalizedArcGISMapViewProps = ReturnType<typeof normalizeArcGISMapViewProps>;
|
|
5
|
+
type ArcGISMapSource = NormalizedArcGISMapViewProps["source"];
|
|
6
|
+
type ArcGISPortalWithDefaultBasemap = {
|
|
7
|
+
defaultBasemap: unknown | null;
|
|
8
|
+
load(): Promise<unknown>;
|
|
9
|
+
};
|
|
10
|
+
type GetDefaultArcGISPortal = () => Promise<ArcGISPortalWithDefaultBasemap>;
|
|
11
|
+
type ArcGISMapFailureState = {
|
|
12
|
+
sourceKey: string;
|
|
13
|
+
failure: ArcGISMapFailure | null;
|
|
14
|
+
};
|
|
15
|
+
export declare function applyPortalDefaultBasemap(mapElement: {
|
|
16
|
+
basemap?: unknown;
|
|
17
|
+
}, getPortal?: GetDefaultArcGISPortal, isCurrent?: () => boolean): Promise<void>;
|
|
18
|
+
export declare function observeArcGISComponentRegistration(registration: Promise<unknown>, onFailure: (failure: ArcGISMapFailure) => void): Promise<void>;
|
|
19
|
+
export declare function createArcGISMapLoadErrorHandler(onFailure: (failure: ArcGISMapFailure) => void): () => void;
|
|
20
|
+
export declare function observeArcGISMapLoadError(mapElement: EventTarget, onFailure: (failure: ArcGISMapFailure) => void): () => void;
|
|
21
|
+
export declare function getArcGISMapSourceKey(source: ArcGISMapSource): string;
|
|
22
|
+
export declare function createArcGISMapElementProps(props: NormalizedArcGISMapViewProps, sourceKey: string): {
|
|
23
|
+
style: {
|
|
24
|
+
display: string;
|
|
25
|
+
height: string;
|
|
26
|
+
width: string;
|
|
27
|
+
};
|
|
28
|
+
"item-id": string;
|
|
29
|
+
key: string;
|
|
30
|
+
} | {
|
|
31
|
+
style: {
|
|
32
|
+
display: string;
|
|
33
|
+
height: string;
|
|
34
|
+
width: string;
|
|
35
|
+
};
|
|
36
|
+
zoom?: string | undefined;
|
|
37
|
+
center: string;
|
|
38
|
+
basemap?: "arcgis/topographic" | "arcgis/streets" | "arcgis/navigation" | "arcgis/light-gray" | "arcgis/dark-gray" | "arcgis/imagery" | "arcgis/outdoor" | undefined;
|
|
39
|
+
"item-id"?: undefined;
|
|
40
|
+
key: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function getArcGISMapFailureForSource(state: ArcGISMapFailureState, sourceKey: string): ArcGISMapFailure | null;
|
|
43
|
+
export declare function resetArcGISMapFailureForSource(state: ArcGISMapFailureState, sourceKey: string): ArcGISMapFailureState;
|
|
44
|
+
export declare const ArcGISMapView: ReactComponentImplementation;
|
|
45
|
+
export declare function ArcGISMapViewContent({ props }: {
|
|
46
|
+
props: ArcGISMapViewProps;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function ArcGISMapFailureFallback({ failure }: {
|
|
49
|
+
failure: ArcGISMapFailure;
|
|
50
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x1b108b=_0x1ff4;(function(_0x1e4085,_0x25a20c){const _0xfe742a=_0x1ff4,_0xc7559a=_0x1e4085();while(!![]){try{const _0x5acfde=parseInt(_0xfe742a(0x218))/0x1*(parseInt(_0xfe742a(0x1ea))/0x2)+-parseInt(_0xfe742a(0x1ef))/0x3*(-parseInt(_0xfe742a(0x206))/0x4)+parseInt(_0xfe742a(0x21f))/0x5*(parseInt(_0xfe742a(0x1f4))/0x6)+parseInt(_0xfe742a(0x219))/0x7*(-parseInt(_0xfe742a(0x201))/0x8)+parseInt(_0xfe742a(0x1f2))/0x9*(-parseInt(_0xfe742a(0x20d))/0xa)+parseInt(_0xfe742a(0x210))/0xb*(parseInt(_0xfe742a(0x21d))/0xc)+-parseInt(_0xfe742a(0x1eb))/0xd;if(_0x5acfde===_0x25a20c)break;else _0xc7559a['push'](_0xc7559a['shift']());}catch(_0xd26fe6){_0xc7559a['push'](_0xc7559a['shift']());}}}(_0x1d2d,0x51245));import{jsx,jsxs,Fragment}from'react/jsx-runtime';import _0x421bb5 from'react';import _0x16e949 from'@arcgis/core/config.js';import{createComponentImplementation}from'@agentic-ui-experience/ui-react';import{ArcGISMapViewApi,normalizeArcGISMapViewProps}from'./api.js';let arcgisComponentsRegistration;async function getDefaultArcGISPortal(){const {default:_0x3b7609}=await import('@arcgis/core/portal/Portal.js');return _0x3b7609['getDefault']();}async function applyPortalDefaultBasemap(_0x38d425,_0x573ce9=getDefaultArcGISPortal,_0x5129ca=()=>!![]){const _0x1f2c6b=_0x1ff4,_0x3e95ba=await _0x573ce9();await _0x3e95ba['load']();if(!_0x3e95ba['defaultBasemap'])throw new Error('The\x20configured\x20ArcGIS\x20portal\x20has\x20no\x20default\x20basemap.');_0x5129ca()&&(_0x38d425[_0x1f2c6b(0x213)]=_0x3e95ba[_0x1f2c6b(0x1fd)]);}function ensureArcGISMapComponents(){const _0x9e9e8d=_0x1ff4;if(typeof window===_0x9e9e8d(0x209))return Promise['resolve']();return!arcgisComponentsRegistration&&(arcgisComponentsRegistration=Promise['all']([import('@arcgis/map-components/components/arcgis-map'),import('@arcgis/map-components/components/arcgis-zoom'),import('@arcgis/map-components/components/arcgis-legend'),import('@arcgis/map-components/components/arcgis-layer-list'),import('@arcgis/map-components/components/arcgis-search')])['then'](()=>void 0x0)[_0x9e9e8d(0x21b)](_0x31b46c=>{arcgisComponentsRegistration=void 0x0;throw _0x31b46c;})),arcgisComponentsRegistration;}function observeArcGISComponentRegistration(_0x18669a,_0x5c27d1){const _0x29c121=_0x1ff4;return _0x18669a[_0x29c121(0x20b)](()=>void 0x0,()=>{_0x5c27d1('registration');});}function createArcGISMapLoadErrorHandler(_0x1255d4){return()=>{_0x1255d4('load');};}function _0x1ff4(_0x2f8779,_0x4b4421){_0x2f8779=_0x2f8779-0x1e5;const _0x1d2d94=_0x1d2d();let _0x1ff4c4=_0x1d2d94[_0x2f8779];return _0x1ff4c4;}function observeArcGISMapLoadError(_0x4b43d8,_0x2e9de3){const _0x2402bc=createArcGISMapLoadErrorHandler(_0x2e9de3);return _0x4b43d8['addEventListener']('arcgisLoadError',_0x2402bc),()=>{const _0x5aa7a2=_0x1ff4;_0x4b43d8[_0x5aa7a2(0x211)](_0x5aa7a2(0x1f5),_0x2402bc);};}function _0x1d2d(){const _0x594e4e=['defaultBasemap','layerList','registration','#64748b','8XUWuAU','_blank','section','alert','noopener\x20noreferrer','368jvQlIL','webmap','arcgis-legend','undefined','/home/webmap/viewer.html?webmap=','then','1px\x20solid\x20rgba(226,\x20232,\x20240,\x200.9)','521530avnXnj','#ffffff','&level=','11EpQKgA','removeEventListener','toFixed','basemap','source','header','nowrap','center','12unZNUR','1791181jgwBzu','div','catch','100%','7035972rpDGKe','ArcGIS\x20map\x20could\x20not\x20be\x20loaded.','35AwbgbO','#2563eb','longitude','arcgis-layer-list','createElement','latitude','/home/webmap/viewer.html?center=','sourceKey','36028cIbEZW','7425613agdJdt','current','Open\x20in\x20ArcGIS','arcgis-zoom','14061YhHRDt','top-right','zoom','18sHOAGZ','type','25752AzdKiH','arcgisLoadError','flex','controls','stringify','isFinite','height','legend','hidden'];_0x1d2d=function(){return _0x594e4e;};return _0x1d2d();}function getArcGISMapSourceKey(_0x145c41){const _0x1b6ab1=_0x1ff4;if(_0x145c41['type']===_0x1b6ab1(0x207))return JSON['stringify']([_0x145c41[_0x1b6ab1(0x1f3)],_0x145c41['itemId']]);return JSON[_0x1b6ab1(0x1f8)]([_0x145c41['type'],_0x145c41['basemap'],_0x145c41['center'][_0x1b6ab1(0x221)],_0x145c41['center'][_0x1b6ab1(0x1e7)],_0x145c41['zoom']??null]);}function createArcGISMapElementProps(_0xe6e260,_0x6f397a){const _0x5c7380=_0x1ff4,_0x1c3683=_0xe6e260[_0x5c7380(0x214)][_0x5c7380(0x1f3)]===_0x5c7380(0x207)?{'item-id':_0xe6e260[_0x5c7380(0x214)]['itemId']}:{..._0xe6e260[_0x5c7380(0x214)][_0x5c7380(0x213)]==='portal/default'?{}:{'basemap':_0xe6e260['source']['basemap']},'center':_0xe6e260[_0x5c7380(0x214)][_0x5c7380(0x217)][_0x5c7380(0x221)]+','+_0xe6e260[_0x5c7380(0x214)]['center']['latitude'],..._0xe6e260[_0x5c7380(0x214)]['zoom']===void 0x0?{}:{'zoom':String(_0xe6e260[_0x5c7380(0x214)][_0x5c7380(0x1f1)])}};return{'key':_0x6f397a,..._0x1c3683,'style':{'display':'block','height':_0xe6e260[_0x5c7380(0x1fa)]+'px','width':'100%'}};}function getArcGISMapFailureForSource(_0x43777a,_0x1bf755){return _0x43777a['sourceKey']===_0x1bf755?_0x43777a['failure']:null;}function resetArcGISMapFailureForSource(_0x1e5b2f,_0x1061d6){const _0x280e63=_0x1ff4;if(_0x1e5b2f[_0x280e63(0x1e9)]===_0x1061d6&&_0x1e5b2f['failure']===null)return _0x1e5b2f;return{'sourceKey':_0x1061d6,'failure':null};}function createOpenUrl(_0x4e4be1){const _0x58caa5=_0x1ff4,_0x279eb0=_0x16e949['portalUrl']['replace'](/\/+$/,'');if(_0x4e4be1[_0x58caa5(0x214)][_0x58caa5(0x1f3)]==='webmap')return _0x279eb0+_0x58caa5(0x20a)+encodeURIComponent(_0x4e4be1[_0x58caa5(0x214)]['itemId']);const {latitude:_0x9a595d,longitude:_0xdb4c02}=_0x4e4be1['source']['center'],_0x4dfc5c=_0x4e4be1[_0x58caa5(0x214)][_0x58caa5(0x1f1)]??0xb,_0x3fe962=_0xdb4c02['toFixed'](0x5)+','+_0x9a595d[_0x58caa5(0x212)](0x5);return _0x279eb0+_0x58caa5(0x1e8)+encodeURIComponent(_0x3fe962)+_0x58caa5(0x20f)+_0x4dfc5c;}const ArcGISMapView=createComponentImplementation(ArcGISMapViewApi,({props:_0x279cd7})=>jsx(ArcGISMapViewContent,{'props':_0x279cd7}));function ArcGISMapViewContent({props:_0x226552}){const _0x36cfdc=_0x1ff4,_0x43231b=normalizeArcGISMapViewProps(_0x226552),_0x5341a0=_0x43231b['title']??'ArcGIS\x20map',_0xe35d9=createOpenUrl(_0x43231b);if(_0x43231b[_0x36cfdc(0x214)]['type']==='basemap'&&(!Number[_0x36cfdc(0x1f9)](_0x43231b['source'][_0x36cfdc(0x217)][_0x36cfdc(0x1e7)])||!Number[_0x36cfdc(0x1f9)](_0x43231b['source']['center']['longitude'])))return jsx(_0x36cfdc(0x21a),{'style':fallbackStyle,'children':'ArcGISMapView\x20needs\x20valid\x20finite\x20latitude\x20and\x20longitude.'});return jsxs(_0x36cfdc(0x203),{'style':shellStyle,'aria-label':_0x5341a0,'children':[jsxs(_0x36cfdc(0x215),{'style':headerStyle,'children':[jsxs(_0x36cfdc(0x21a),{'style':{'minWidth':0x0},'children':[jsx(_0x36cfdc(0x21a),{'style':titleStyle,'children':_0x5341a0}),_0x43231b['description']?jsx(_0x36cfdc(0x21a),{'style':descriptionStyle,'children':_0x43231b['description']}):null]}),_0x43231b['openInArcGIS']&&_0xe35d9?jsx('a',{'href':_0xe35d9,'target':_0x36cfdc(0x202),'rel':_0x36cfdc(0x205),'style':linkStyle,'children':_0x36cfdc(0x1ed)}):null]}),jsx(ArcGISMapBody,{'props':_0x43231b})]});}function ArcGISMapBody({props:_0xb48313}){const _0x20224b=_0x1ff4,_0x1bccdd=getArcGISMapSourceKey(_0xb48313['source']),_0x34d1bc=_0x421bb5['useRef'](null),[_0x513985,_0x358766]=_0x421bb5['useState']({'sourceKey':_0x1bccdd,'failure':null}),_0x4ccb8e=getArcGISMapFailureForSource(_0x513985,_0x1bccdd);_0x421bb5['useEffect'](()=>{let _0x58ecbd=!![];_0x358766(_0x1b2b8a=>resetArcGISMapFailureForSource(_0x1b2b8a,_0x1bccdd));const _0x453986=_0x3f5907=>{_0x58ecbd&&_0x358766({'sourceKey':_0x1bccdd,'failure':_0x3f5907});};return void ensureArcGISMapComponents()['then'](()=>{const _0x4b8e92=_0x1ff4;if(!_0x58ecbd||_0xb48313['source'][_0x4b8e92(0x1f3)]!==_0x4b8e92(0x213)||_0xb48313['source'][_0x4b8e92(0x213)]!=='portal/default')return;const _0x50635f=_0x34d1bc[_0x4b8e92(0x1ec)];if(!_0x50635f){_0x453986('load');return;}void applyPortalDefaultBasemap(_0x50635f,getDefaultArcGISPortal,()=>_0x58ecbd&&_0x34d1bc['current']===_0x50635f)[_0x4b8e92(0x21b)](()=>{_0x453986('load');});},()=>{const _0x300eac=_0x1ff4;_0x453986(_0x300eac(0x1ff));}),()=>{_0x58ecbd=![];};},[_0x1bccdd]),_0x421bb5['useEffect'](()=>{const _0x427dd0=_0x1ff4,_0x492d4b=_0x34d1bc[_0x427dd0(0x1ec)];if(!_0x492d4b)return;return observeArcGISMapLoadError(_0x492d4b,_0x58ba36=>{_0x358766({'sourceKey':_0x1bccdd,'failure':_0x58ba36});});},[_0x1bccdd]);if(_0x4ccb8e)return jsx(ArcGISMapFailureFallback,{'failure':_0x4ccb8e});return _0x421bb5['createElement']('arcgis-map',{...createArcGISMapElementProps(_0xb48313,_0x1bccdd),'ref':_0x34d1bc},jsxs(Fragment,{'children':[_0xb48313[_0x20224b(0x1f7)]['zoom']?_0x421bb5[_0x20224b(0x1e6)](_0x20224b(0x1ee),{'slot':'top-left'}):null,_0xb48313['controls']['search']?_0x421bb5['createElement']('arcgis-search',{'slot':_0x20224b(0x1f0)}):null,_0xb48313[_0x20224b(0x1f7)][_0x20224b(0x1fb)]?_0x421bb5[_0x20224b(0x1e6)](_0x20224b(0x208),{'slot':'bottom-left'}):null,_0xb48313[_0x20224b(0x1f7)][_0x20224b(0x1fe)]?_0x421bb5[_0x20224b(0x1e6)](_0x20224b(0x1e5),{'slot':_0x20224b(0x1f0)}):null]}));}function ArcGISMapFailureFallback({failure:_0x3f6e73}){const _0x385927=_0x1ff4;return jsx('div',{'role':_0x385927(0x204),'style':mapFailureStyle,'children':_0x3f6e73==='registration'?'ArcGIS\x20map\x20components\x20could\x20not\x20be\x20loaded.':_0x385927(0x21e)});}const shellStyle={'width':_0x1b108b(0x21c),'borderRadius':0x8,'border':'1px\x20solid\x20rgba(148,\x20163,\x20184,\x200.45)','background':_0x1b108b(0x20e),'overflow':'hidden'},headerStyle={'display':_0x1b108b(0x1f6),'alignItems':'center','justifyContent':'space-between','gap':0xa,'padding':'10px\x2012px','borderBottom':_0x1b108b(0x20c)},titleStyle={'color':'#111827','fontSize':0xd,'fontWeight':0x2bc,'lineHeight':1.2,'overflow':_0x1b108b(0x1fc),'textOverflow':'ellipsis','whiteSpace':_0x1b108b(0x216)},descriptionStyle={'color':_0x1b108b(0x200),'fontSize':0xc,'lineHeight':1.3,'marginTop':0x4},linkStyle={'color':_0x1b108b(0x220),'flexShrink':0x0,'fontSize':0xc,'fontWeight':0x2bc,'textDecoration':'none'},fallbackStyle={'width':'100%','borderRadius':0x8,'border':'1px\x20solid\x20rgba(220,\x2038,\x2038,\x200.25)','background':'#fff5f5','color':'#991b1b','fontSize':0xd,'padding':'12px\x2014px'},mapFailureStyle={...fallbackStyle,'border':0x0,'borderRadius':0x0};export{ArcGISMapFailureFallback,ArcGISMapView,ArcGISMapViewContent,applyPortalDefaultBasemap,createArcGISMapElementProps,createArcGISMapLoadErrorHandler,getArcGISMapFailureForSource,getArcGISMapSourceKey,observeArcGISComponentRegistration,observeArcGISMapLoadError,resetArcGISMapFailureForSource};
|