@arcgis/ai-components 5.2.0-next.9 → 5.2.0-next.91
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/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/agent-utils/FunctionAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.d.ts +7 -4
- package/dist/agent-utils/LLMAgent.js +4 -2
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/WorkflowAgent.js +14 -15
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +25 -33
- package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
- package/dist/agent-utils/types.d.ts +37 -8
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +109 -0
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/agents/tools/help/listFields/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.js +52 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getStatistics/adapter.js +154 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +127 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/cdn/2EY3BQQX.js +2 -0
- package/dist/cdn/2PTPBAIN.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4EBLRHYE.js +2 -0
- package/dist/cdn/4HDDRBIY.js +2 -0
- package/dist/cdn/4KOV2NEI.js +9 -0
- package/dist/cdn/4NJ2FF7H.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/4WIDLQUH.js +2 -0
- package/dist/cdn/5FL5BTTX.js +66 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/6HF36IKA.js +2 -0
- package/dist/cdn/6KFMRBAA.js +2 -0
- package/dist/cdn/6VJXUIXY.js +3 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7DFXYMEA.js +2 -0
- package/dist/cdn/7M6VKBTK.js +6 -0
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/7ZFAFKJT.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/AT4XVTJR.js +44 -0
- package/dist/cdn/AZCIDPML.js +2 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/C5ZL5Z52.js +18 -0
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
- package/dist/cdn/CJMUJXPL.js +2 -0
- package/dist/cdn/COL6QYGQ.js +2 -0
- package/dist/cdn/CP5BVGJU.js +2 -0
- package/dist/cdn/CZM4URK7.js +2 -0
- package/dist/cdn/DP6O6PMH.js +2 -0
- package/dist/cdn/{V2P4AIGG.js → EKB7CAMM.js} +1 -1
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/EYNEYD34.js +2 -0
- package/dist/cdn/FDDQ67BG.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FQH3HOFH.js +2 -0
- package/dist/cdn/{GGSZM7KV.js → FUZ77UGP.js} +6 -4
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/GFEOVHJK.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HIPQ3VRW.js +2 -0
- package/dist/cdn/HKSFWTWK.js +14 -0
- package/dist/cdn/HMUWQCXU.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JJJZ7FOM.js +2 -0
- package/dist/cdn/JKIESH74.js +2 -0
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KCU4FWF7.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/LPR72QZF.js +36 -0
- package/dist/cdn/{DHOVCT6R.js → MKOQJXQQ.js} +1 -1
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/OAKRPM7D.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/OL5656NI.js +2 -0
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OWTGH34K.js +2 -0
- package/dist/cdn/OYSPNIJI.js +156 -0
- package/dist/cdn/PEYYWXFE.js +2 -0
- package/dist/cdn/PKUDO2RC.js +3 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PSYRZMX2.js +2 -0
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QCFICJ7U.js +3 -0
- package/dist/cdn/QNNGPA3Q.js +2 -0
- package/dist/cdn/R74ZHFA6.js +2 -0
- package/dist/cdn/RBE55SWR.js +2 -0
- package/dist/cdn/RHYNE5OE.js +2 -0
- package/dist/cdn/RLEHNAIA.js +2 -0
- package/dist/cdn/RSNGZQCQ.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/SHD6YFSR.js +2 -0
- package/dist/cdn/SUYWKYWI.js +22 -0
- package/dist/cdn/SZ2QSSB3.js +2 -0
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → TMZ6DF22.js} +1 -1
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/U2D53TAX.js +14 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHZG7SKO.js +2 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V52XWEGV.js +11 -0
- package/dist/cdn/V6F3HEK7.js +2 -0
- package/dist/cdn/V6HOUZPZ.js +2 -0
- package/dist/cdn/VAXH6RUQ.js +134 -0
- package/dist/cdn/VLLZ2FFU.js +2 -0
- package/dist/cdn/VNJMTA6O.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/W5JPJWMM.js +2 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/WNNMKCKS.js +2 -0
- package/dist/cdn/WP7ORLSB.js +6 -0
- package/dist/cdn/WR2SQX3J.js +2 -0
- package/dist/cdn/X3COUAXY.js +4 -0
- package/dist/cdn/Y7XD7ZRD.js +2 -0
- package/dist/cdn/YEZ3AMNX.js +2 -0
- package/dist/cdn/YLVJA4ZE.js +2 -0
- package/dist/cdn/YQSU6IUO.js +2 -0
- package/dist/cdn/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZLWWWTH4.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZQMBJ6MI.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/ZVGUAOXE.js +2 -0
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +1299 -2113
- package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/baseAgentState.js +56 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +133 -177
- package/dist/chunks/data_explore_query_prompt.js +9 -4
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +259 -282
- package/dist/chunks/helpGraph.js +35 -25
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +37 -31
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +124 -103
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +298 -139
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +21 -27
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +14 -10
- package/dist/chunks/types.js +59 -0
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +72 -0
- package/dist/components/arcgis-assistant/customElement.js +416 -172
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +20 -4
- package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
- package/dist/components/arcgis-assistant-message/customElement.d.ts +5 -0
- package/dist/components/arcgis-assistant-message/customElement.js +29 -26
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +7 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
- package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +9 -8
- package/dist/oauth-callback.html +1 -1
- package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
- package/dist/types/lumina.d.ts +10 -8
- package/dist/types/preact.d.ts +10 -8
- package/dist/types/react.d.ts +10 -8
- package/dist/types/stencil.d.ts +12 -10
- package/dist/utils/index.d.ts +8 -8
- package/dist/utils/index.js +56 -55
- package/package.json +32 -12
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/53ZCUPKK.js +0 -22
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/5XRDJL7R.js +0 -14
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/EECZLT6C.js +0 -166
- package/dist/cdn/ETRWZ3MS.js +0 -108
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/H7422XUG.js +0 -2
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/I6HNBTWY.js +0 -2
- package/dist/cdn/I7SRZPVS.js +0 -72
- package/dist/cdn/IG6YKZH3.js +0 -3
- package/dist/cdn/JVIKKZND.js +0 -3
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/OH64RMOR.js +0 -4
- package/dist/cdn/P26NON3Z.js +0 -16
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S3VPZFWQ.js +0 -36
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/TR7RL3IK.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
function c(e, o) {
|
|
3
|
+
const t = e?.configurable?.context;
|
|
4
|
+
if (!t || typeof t != "object")
|
|
5
|
+
throw new Error("Agent context missing");
|
|
6
|
+
const n = o.filter((i) => !(i in t));
|
|
7
|
+
if (n.length)
|
|
8
|
+
throw new Error(`Agent context missing: ${n.join(", ")}`);
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
c as f
|
|
13
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import v from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
3
|
+
import L from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
4
|
+
const $ = 10, b = ["string", "small-integer", "integer"], w = async (u, e, { includeSummaryStatistics: d = !0, includeUniqueValues: y = !0 } = {}) => {
|
|
5
|
+
let r = null, s = null;
|
|
6
|
+
try {
|
|
7
|
+
if (e.type !== "geometry" && e.type !== "oid" && e.type !== "global-id") {
|
|
8
|
+
d && (r = await v({ layer: u, field: e.name }));
|
|
9
|
+
const i = e.domain?.type === "coded-value" ? e.domain : null;
|
|
10
|
+
y && (b.includes(e.type) || i) && (s = (await L({ layer: u, field: e.name })).uniqueValueInfos.sort((n, f) => f.count - n.count).slice(0, $), i && (s = s.map((n) => ({
|
|
11
|
+
...n,
|
|
12
|
+
value: i.getName(n.value) ?? n.value
|
|
13
|
+
}))));
|
|
14
|
+
}
|
|
15
|
+
} catch (i) {
|
|
16
|
+
console.error(`Error fetching statistics for field ${e.name}:`, i);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
summaryStatistics: r,
|
|
20
|
+
uniqueValues: s
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
function N(u, e) {
|
|
24
|
+
return ["string", "small-integer", "integer"].includes(u) || e === "coded-value";
|
|
25
|
+
}
|
|
26
|
+
async function x(u, e, d, y = !0) {
|
|
27
|
+
const r = [], s = [], i = [];
|
|
28
|
+
for (const n of u) {
|
|
29
|
+
let f = function(a) {
|
|
30
|
+
const t = e.get(a)?.layerItem;
|
|
31
|
+
return t ? [
|
|
32
|
+
t.name && `Name: ${t.name}`,
|
|
33
|
+
t.title && `Title: ${t.title}`,
|
|
34
|
+
t.description && `Description: ${t.description}`
|
|
35
|
+
].filter(Boolean).join(" | ") : a;
|
|
36
|
+
};
|
|
37
|
+
const { layerId: c, results: q } = n, I = d.map?.allLayers.find((a) => a.id === c), S = e.get(c)?.fieldRegistry;
|
|
38
|
+
if (!S)
|
|
39
|
+
continue;
|
|
40
|
+
let l = r.find((a) => a.layerId === c);
|
|
41
|
+
l || (l = {
|
|
42
|
+
layerId: c,
|
|
43
|
+
layerSummary: f(c),
|
|
44
|
+
fieldInfos: []
|
|
45
|
+
}, r.push(l));
|
|
46
|
+
for (const a of q) {
|
|
47
|
+
const t = S.get(a.name);
|
|
48
|
+
if (!t)
|
|
49
|
+
continue;
|
|
50
|
+
const o = t.statistics, p = y && !o?.summaryStatistics, g = N(t.type, t.domain?.type) && !o?.uniqueValues, h = p || g;
|
|
51
|
+
if (i.push({
|
|
52
|
+
layerId: c,
|
|
53
|
+
fieldName: t.name,
|
|
54
|
+
didFetchStatistics: h
|
|
55
|
+
}), h) {
|
|
56
|
+
const F = w(I, t, {
|
|
57
|
+
includeSummaryStatistics: p,
|
|
58
|
+
includeUniqueValues: g
|
|
59
|
+
}).then((V) => {
|
|
60
|
+
const m = {
|
|
61
|
+
summaryStatistics: o?.summaryStatistics ?? null,
|
|
62
|
+
uniqueValues: o?.uniqueValues ?? null
|
|
63
|
+
};
|
|
64
|
+
p && (m.summaryStatistics = V.summaryStatistics), g && (m.uniqueValues = V.uniqueValues), S.set(t.name, { ...t, statistics: m }), t.statistics = m;
|
|
65
|
+
});
|
|
66
|
+
s.push(F);
|
|
67
|
+
}
|
|
68
|
+
l.fieldInfos.push(t);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return await Promise.all(s), {
|
|
72
|
+
layerFieldInfo: r,
|
|
73
|
+
didFetchStatistics: s.length > 0,
|
|
74
|
+
fieldStatisticsFetchStatus: i
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
x as b
|
|
79
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { formatDateOnly as F, convertDateFormatToIntlOptions as m, formatTimeOnly as T, formatDate as p } from "@arcgis/core/intl.js";
|
|
3
|
+
const w = /* @__PURE__ */ new Set([
|
|
4
|
+
"date",
|
|
5
|
+
"esrifieldtypedate",
|
|
6
|
+
"date-only",
|
|
7
|
+
"dateonly",
|
|
8
|
+
"esrifieldtypedateonly",
|
|
9
|
+
"time-only",
|
|
10
|
+
"timeonly",
|
|
11
|
+
"esrifieldtypetimeonly",
|
|
12
|
+
"timestamp-offset",
|
|
13
|
+
"timestampoffset",
|
|
14
|
+
"esrifieldtypetimestampoffset"
|
|
15
|
+
]), g = (t) => {
|
|
16
|
+
if (!t)
|
|
17
|
+
return !1;
|
|
18
|
+
const e = t.toLowerCase();
|
|
19
|
+
return w.has(e);
|
|
20
|
+
}, d = (t) => {
|
|
21
|
+
if (t instanceof Date)
|
|
22
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
23
|
+
if (typeof t == "number" && Number.isFinite(t)) {
|
|
24
|
+
const e = new Date(t);
|
|
25
|
+
return Number.isNaN(e.getTime()) ? null : e;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}, I = (t) => !t || t === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : t === "unknown" ? "UTC" : t, N = (t) => {
|
|
29
|
+
if (typeof t == "string" && t)
|
|
30
|
+
return t;
|
|
31
|
+
const e = d(t);
|
|
32
|
+
return e ? e.toISOString().slice(0, 10) : null;
|
|
33
|
+
}, k = () => {
|
|
34
|
+
const t = (/* @__PURE__ */ new Date()).getTimezoneOffset(), e = t <= 0 ? "+" : "-", n = Math.floor(Math.abs(t) / 60).toString().padStart(2, "0"), o = (Math.abs(t) % 60).toString().padStart(2, "0"), i = `${e}${n}:${o}`;
|
|
35
|
+
return { userTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone, userTimezoneOffset: i };
|
|
36
|
+
}, S = (t, e, n) => {
|
|
37
|
+
const o = e?.toLowerCase();
|
|
38
|
+
if (o && !g(o))
|
|
39
|
+
return t;
|
|
40
|
+
if (o === "date-only") {
|
|
41
|
+
const s = N(t);
|
|
42
|
+
return s ? F(s, m("short-date")) : t;
|
|
43
|
+
}
|
|
44
|
+
if (o === "time-only") {
|
|
45
|
+
if (typeof t == "string" && t)
|
|
46
|
+
return T(t, m("long-time"));
|
|
47
|
+
const s = d(t);
|
|
48
|
+
return s ? p(s, {
|
|
49
|
+
...m("long-time"),
|
|
50
|
+
timeZone: "UTC"
|
|
51
|
+
}) : t;
|
|
52
|
+
}
|
|
53
|
+
const i = d(t);
|
|
54
|
+
return i ? p(i, {
|
|
55
|
+
...m("short-date-short-time"),
|
|
56
|
+
timeZone: I(n)
|
|
57
|
+
}) : t;
|
|
58
|
+
}, l = (t, e, n) => {
|
|
59
|
+
if (t && typeof t != "function") {
|
|
60
|
+
const o = "getField" in n && n.getField?.(t), i = o && "getFieldDomain" in n && n.getFieldDomain ? n.getFieldDomain(o.name) : null;
|
|
61
|
+
if (i?.type === "coded-value") {
|
|
62
|
+
const s = i.codedValues.find((r) => r.code === e);
|
|
63
|
+
return s ? s.name : null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}, O = (t) => !t || t === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : t === "unknown" ? "UTC" : t, C = (t) => {
|
|
68
|
+
if (t instanceof Date)
|
|
69
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
70
|
+
if (typeof t == "number" && Number.isFinite(t)) {
|
|
71
|
+
const e = new Date(t);
|
|
72
|
+
return Number.isNaN(e.getTime()) ? null : e;
|
|
73
|
+
}
|
|
74
|
+
if (typeof t == "string" && t) {
|
|
75
|
+
const e = new Date(t);
|
|
76
|
+
return Number.isNaN(e.getTime()) ? null : e;
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}, V = (t, e) => {
|
|
80
|
+
if (typeof t != "number")
|
|
81
|
+
return t;
|
|
82
|
+
const n = {};
|
|
83
|
+
e.minimumFractionDigits !== void 0 && (n.minimumFractionDigits = e.minimumFractionDigits), e.maximumFractionDigits !== void 0 && (n.maximumFractionDigits = e.maximumFractionDigits), e.useGrouping === "always" ? n.useGrouping = !0 : e.useGrouping === "never" && (n.useGrouping = !1);
|
|
84
|
+
try {
|
|
85
|
+
return new Intl.NumberFormat(void 0, n).format(t);
|
|
86
|
+
} catch {
|
|
87
|
+
return t;
|
|
88
|
+
}
|
|
89
|
+
}, x = (t, e, n) => {
|
|
90
|
+
const o = C(t);
|
|
91
|
+
if (!o)
|
|
92
|
+
return t;
|
|
93
|
+
const i = {};
|
|
94
|
+
e.dateStyle ? i.dateStyle = e.dateStyle : (e.year && (i.year = e.year), e.month && (i.month = e.month)), e.timeStyle && (i.timeStyle = e.timeStyle), e.timeStyle && e.hour12 === "always" ? i.hour12 = !0 : e.timeStyle && e.hour12 === "never" && (i.hour12 = !1), i.timeZone = O(n);
|
|
95
|
+
try {
|
|
96
|
+
return new Intl.DateTimeFormat(void 0, i).format(o);
|
|
97
|
+
} catch {
|
|
98
|
+
return t;
|
|
99
|
+
}
|
|
100
|
+
}, y = (t, e) => t.getFieldAlias?.(e) ?? t.fieldsIndex?.get(e)?.alias ?? t.fieldsIndex?.get(e)?.name ?? e, D = (t, e, n, o, i) => {
|
|
101
|
+
if (n == null)
|
|
102
|
+
return n;
|
|
103
|
+
const r = t.getFieldConfiguration?.(e)?.fieldFormat;
|
|
104
|
+
return r?.type === "number" ? V(n, r) : r?.type === "date-time" ? !o || g(o) ? x(n, r, i) : n : S(n, o, i);
|
|
105
|
+
}, L = (t, e, n, o) => {
|
|
106
|
+
const i = t.fieldsIndex?.get(e), s = l(e, n, t) ?? n;
|
|
107
|
+
return D(t, e, s, i?.type, o);
|
|
108
|
+
}, $ = (t, e) => y(t, e), j = (t, e, n) => {
|
|
109
|
+
const o = t.objectIdField, i = e.features.map(
|
|
110
|
+
(r) => r.attributes[o]
|
|
111
|
+
), s = e.features.map((r) => {
|
|
112
|
+
const u = r.attributes, c = {};
|
|
113
|
+
return t.fields.forEach((a) => {
|
|
114
|
+
if (!Object.hasOwn(u, a.name))
|
|
115
|
+
return;
|
|
116
|
+
const f = u[a.name];
|
|
117
|
+
if (a.name === o) {
|
|
118
|
+
c[a.name] = f;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const b = l(a.name, f, t) ?? f, h = y(t, a.name);
|
|
122
|
+
c[h] = D(t, a.name, b, a.type, n);
|
|
123
|
+
}), c;
|
|
124
|
+
});
|
|
125
|
+
return { objectIds: i, attributes: s };
|
|
126
|
+
};
|
|
127
|
+
export {
|
|
128
|
+
j as a,
|
|
129
|
+
k as b,
|
|
130
|
+
L as f,
|
|
131
|
+
$ as g
|
|
132
|
+
};
|