@arcgis/portal-components 5.1.0-next.99 → 5.1.0
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 +2 -2
- package/dist/cdn/3AFLX4RZ.js +31 -0
- package/dist/cdn/3XDKOO6K.js +2 -0
- package/dist/cdn/4ISLOZQ3.js +2 -0
- package/dist/cdn/{TTZBF4KI.js → 563BUCQX.js} +1 -1
- package/dist/cdn/{JOYFDD4B.js → 5BPXS3WU.js} +1 -1
- package/dist/cdn/65JPRIL4.js +98 -0
- package/dist/cdn/6K7GPATC.js +2 -0
- package/dist/cdn/6RA33SDH.js +34 -0
- package/dist/cdn/7IAAHGM2.js +2 -0
- package/dist/cdn/{SOPWLUP4.js → ABRHXRFP.js} +1 -1
- package/dist/cdn/BCUEYBNI.js +2 -0
- package/dist/cdn/CAQR2NSG.js +4 -0
- package/dist/cdn/D42PED2R.js +2 -0
- package/dist/cdn/DEHBTA5D.js +2 -0
- package/dist/cdn/EZ7YC5N5.js +99 -0
- package/dist/cdn/{SEZNHA2J.js → FK7QXBE2.js} +1 -1
- package/dist/cdn/IBYY5ORN.js +122 -0
- package/dist/cdn/ITFWXO7A.js +49 -0
- package/dist/cdn/JWUQZ52F.js +134 -0
- package/dist/cdn/KBYWRUKO.js +2 -0
- package/dist/cdn/KFH2OM2D.js +2 -0
- package/dist/cdn/{GPPEHGUO.js → LVUHKMSB.js} +1 -1
- package/dist/cdn/NDKFZPYE.js +2 -0
- package/dist/cdn/NX4L2LC2.js +2 -0
- package/dist/cdn/OYABHYVF.js +2 -0
- package/dist/cdn/{V5ZWDMLE.js → PIZFXU2N.js} +1 -1
- package/dist/cdn/QOCYNLQ7.js +71 -0
- package/dist/cdn/{ERNT74VA.js → QUYBZ3J7.js} +1 -1
- package/dist/cdn/R2XPTETT.js +22 -0
- package/dist/cdn/R53CO5LK.js +77 -0
- package/dist/cdn/{HQAGVE4P.js → RNRPTWHT.js} +17 -1
- package/dist/cdn/{32DRTMS4.js → SFKRR7GW.js} +1 -1
- package/dist/cdn/SQ54YADV.js +533 -0
- package/dist/cdn/SX4KDMYV.js +69 -0
- package/dist/cdn/TKQAFRBM.js +36 -0
- package/dist/cdn/TNDL67UN.js +2 -0
- package/dist/cdn/{LJUIMVQ2.js → W4RAJWHA.js} +1 -1
- package/dist/cdn/WHLL7DNC.js +146 -0
- package/dist/cdn/X3LZYQ4U.js +66 -0
- package/dist/cdn/XR4PMNYP.js +2 -0
- package/dist/cdn/YJK6JAPE.js +422 -0
- package/dist/cdn/{5WK4GJK2.js → Z5UVAVHJ.js} +1 -1
- package/dist/cdn/{3OTUKLZI.js → ZCL2V7W3.js} +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/portal-item-type/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/portal-item-type/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/functionalities.js +10 -0
- package/dist/chunks/groups.js +86 -0
- package/dist/chunks/item.js +124 -22
- package/dist/chunks/portal.js +48 -8
- package/dist/chunks/runtime.js +3 -3
- package/dist/chunks/user.js +4 -109
- package/dist/chunks/user2.js +113 -0
- package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +7 -0
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +20 -6
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +738 -124
- package/dist/components/arcgis-portal-ai-assistant/index.js +2 -1
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.d.ts +42 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +51 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/index.d.ts +1 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/index.js +6 -0
- package/dist/components/arcgis-portal-classification-config/customElement.js +44 -37
- package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
- package/dist/components/arcgis-portal-mentionable-text-area/customElement.d.ts +2 -1
- package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +38 -41
- package/dist/components/arcgis-portal-mentionable-text-area/utils.d.ts +7 -0
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +3 -3
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +131 -63
- package/dist/components/arcgis-portal-user-avatar/customElement.js +24 -27
- package/dist/components/arcgis-portal-voice-input/customElement.d.ts +1 -1
- 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/index.d.ts +16 -0
- package/dist/loader.js +3 -2
- package/dist/types/lumina.d.ts +9 -1
- package/dist/types/preact.d.ts +10 -1
- package/dist/types/react.d.ts +11 -1
- package/dist/types/stencil.d.ts +9 -1
- package/package.json +12 -10
- package/dist/cdn/2UAWM45V.js +0 -2
- package/dist/cdn/4XGP5S32.js +0 -2
- package/dist/cdn/AMCZ4UZQ.js +0 -2
- package/dist/cdn/CVTNZK7F.js +0 -2
- package/dist/cdn/DAD7LUKA.js +0 -2
- package/dist/cdn/F5QGCGHF.js +0 -2
- package/dist/cdn/HGOHRPAD.js +0 -2
- package/dist/cdn/IZQBJ5VK.js +0 -2
- package/dist/cdn/JFG6QVNF.js +0 -2
- package/dist/cdn/LCWXNCUX.js +0 -396
- package/dist/cdn/NJMHL2Y7.js +0 -4
- package/dist/cdn/OGQ2PD7M.js +0 -2
- package/dist/cdn/S2PHM4WZ.js +0 -2
- package/dist/cdn/ZAHK6WQT.js +0 -138
- package/dist/chunks/item2.js +0 -128
- /package/dist/cdn/{3OPKWSWR.js → 34BMNP6G.js} +0 -0
- /package/dist/cdn/{JQKWT7SI.js → FPAFR5IL.js} +0 -0
- /package/dist/cdn/{N5K4DR3J.js → FPKINYFN.js} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`# ArcGIS Knowledge Graph Cypher Rules
|
|
3
|
+
|
|
4
|
+
## GOAL
|
|
5
|
+
|
|
6
|
+
Generate a Cypher query that answers the user\u2019s request and conforms to the data model.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. USER OVERRIDES (HIGHEST PRIORITY)
|
|
11
|
+
|
|
12
|
+
If the user specifies any of the following, ALWAYS follow their instructions over defaults:
|
|
13
|
+
|
|
14
|
+
- LIMIT (or no limit)
|
|
15
|
+
- Output columns / data model
|
|
16
|
+
- Inclusion/exclusion of globalid
|
|
17
|
+
- Ordering, grouping, filtering, projection
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 2. DATA MODEL CONFORMANCE (NON-NEGOTIABLE)
|
|
22
|
+
|
|
23
|
+
Use ONLY valid data model elements.
|
|
24
|
+
|
|
25
|
+
### Required
|
|
26
|
+
|
|
27
|
+
- Use only valid entity types, relationship types, and properties
|
|
28
|
+
- Ensure relationships connect valid entity types
|
|
29
|
+
- infer direction from user prompt. if not clear use the least restrictive valid form supported by the model.
|
|
30
|
+
|
|
31
|
+
### VALIDATION RULES (STRICT)
|
|
32
|
+
|
|
33
|
+
- Enforce exact schema match: all entities, relationships, and properties must exist exactly in the data model
|
|
34
|
+
- Validate relationship integrity: types, source\u2192target pairing, and direction must match schema
|
|
35
|
+
- Enforce field correctness: properties and filters must exist on the referenced type and use valid data types
|
|
36
|
+
- Ensure alias consistency: each alias maps to one type only and cannot change meaning
|
|
37
|
+
- Apply strict failure: if any component is invalid, do NOT generate the query and do NOT infer or repair
|
|
38
|
+
|
|
39
|
+
## 4. PATH RESOLUTION
|
|
40
|
+
|
|
41
|
+
- First attempt a direct relationship
|
|
42
|
+
- If none exists \u2192 use a valid multi-hop path
|
|
43
|
+
- Each hop MUST be valid in the data model
|
|
44
|
+
- Max path length: 3 (unless user requests more)
|
|
45
|
+
|
|
46
|
+
### Path selection
|
|
47
|
+
|
|
48
|
+
- Prefer shortest valid path
|
|
49
|
+
- If multiple valid paths exist \u2192 choose best match to user intent
|
|
50
|
+
- If no valid path exists \u2192 do not speculate
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 5. PERFORMANCE
|
|
55
|
+
|
|
56
|
+
- Use the minimal number of entities and relationships
|
|
57
|
+
- Prefer shortest valid path
|
|
58
|
+
- Avoid unnecessary patterns or complexity
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 6. CYPHER RULES
|
|
63
|
+
|
|
64
|
+
- UNION queries must return identical columns
|
|
65
|
+
- Apply LIMIT only after UNION (not inside subqueries)
|
|
66
|
+
- Do NOT use: OVER, REDUCE()
|
|
67
|
+
- Do NOT use reserved keywords as variables (call, match, return, as etc.)
|
|
68
|
+
- Use only valid openCypher syntax
|
|
69
|
+
- After OPTIONAL MATCH, always add:
|
|
70
|
+
WITH ...
|
|
71
|
+
WHERE var IS NOT NULL
|
|
72
|
+
before using var in any MATCH or relationship pattern.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 7. SPATIAL RULES
|
|
77
|
+
|
|
78
|
+
- Prefer graph relationships over spatial functions
|
|
79
|
+
- Use spatial functions only when necessary
|
|
80
|
+
- Always ensure geometry is not null if using spatial functions
|
|
81
|
+
- for example: WHERE n.shape IS NOT NULL
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 9. DEFAULT OUTPUT (IF NOT SPECIFIED)
|
|
86
|
+
|
|
87
|
+
- Add LIMIT 50 unless results are clearly small
|
|
88
|
+
- Use descriptive aliases with AS
|
|
89
|
+
- ALWAYS Return full entities and relationships unless user requests specific properties
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 11. OUTPUT FORMAT
|
|
94
|
+
|
|
95
|
+
- Valid \u2192 return ONLY Cypher query
|
|
96
|
+
- No explanation
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
`;export{e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import{a as o}from"./5BPXS3WU.js";import b from"./GPSI4ROI.js";import a from"./PBZ25RYU.js";import{a as f}from"./PIZFXU2N.js";import"./SFKRR7GW.js";import{K as n,Q as r,h as c,j as e}from"./CAQR2NSG.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{c:d,d:h},{f:v}])=>{var C=c`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: "var(--calcite-color-foreground-2)"}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`,l=class extends n{constructor(){super(...arguments),this.messages=f(),this.selectFavoriteClassification=i=>{let a=i.target.value;if(a){this.hasUpdateError=!1;let t=this.favoriteClassifications.find(({name:s})=>s===a);t&&this.updateClassificationData(t)}},this.uploadFavoriteClassificationValueHandle=async i=>{let a=await h(this.portalItem,this.favoriteClassifications);if(this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i}),a){let{result:t,error:s}=a;if(s){console.error(s),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.uploadClassificationFavoriteError??"Failed to upload classification favorites"});return}t&&this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i})}},this.retrieveFavoriteClassificationHandle=async()=>{let i=await d(this.portalItem);if(i){let{result:a,error:t}=i;if(t){console.error(t),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.retrieveClassificationFavoriteError??"Failed to retrieve classification favorites"});return}a&&this.resetFavoriteClassification(a.favorites)}},this.changeFavoriteClassificationName=i=>{let a=i.target.value;this.newFavoriteClassificationName=a,this.hasDuplicatedClassificationError=this.favoriteClassifications.some(t=>t.name===a)},this.saveNewFavoriteClassification=async()=>{let i=this.newFavoriteClassificationName;if(this.favoriteClassifications.some(s=>s.name===i)){this.hasDuplicatedClassificationError=!0;return}if(!i)return;let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a};this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.addClassificationFavoriteSuccessMessage??"Classification Favorite added successfully"),await this.retrieveFavoriteClassificationHandle(),this.showSaveClassificationDialog=!1},this.updateFavoriteClassification=async()=>{if(!this.selectedFavoriteClassificationName){this.hasUpdateError=!0;return}await this.addFavoriteClassification(this.selectedFavoriteClassificationName),await this.retrieveFavoriteClassificationHandle()},this.deleteNonEnabledAttributes=()=>{let i=structuredClone(this.portalItem?.classification??{}),a=Object.fromEntries(Object.entries(i).filter(([t])=>this.attributeExpressionResults?.get(t)?.enabled!==!1));return{...a,...v(this.portalItem,a)}},this.addFavoriteClassification=async i=>{let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a},s=this.favoriteClassifications.findIndex(m=>m.name===i);s>=0?this.favoriteClassifications[s].classification=a:this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.updateClassificationFavoriteSuccessMessage??"Classification Favorite updated successfully")},this.removeFavoriteClassification=async i=>{this.favoriteClassifications=this.favoriteClassifications.filter(a=>a.name!==i),this.favoriteClassifications.length===0&&(this.showManageClassificationDialog=!1),await this.uploadFavoriteClassificationValueHandle(this.messages.removeClassificationFavoriteSuccessMessage??"Classification Favorite removed successfully"),await this.retrieveFavoriteClassificationHandle()},this.newFavoriteClassificationName="",this.showManageClassificationDialog=!1,this.showSaveClassificationDialog=!1,this.hasDuplicatedClassificationError=!1,this.hasUpdateError=!1,this.alertIndicator={alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:""},this.isNotificationModalActive=!1,this.favoriteClassifications=[],this.selectedFavoriteClassificationName="",this.resetFavoriteClassification=()=>{},this.updateClassificationData=()=>{},this.renderFavoriteClassificationError=i=>{let{alertIndicatorType:a,alertIndicatorIcon:t,alertIndicatorInfo:s}=i;return e`<calcite-alert .icon=${t} .label=${this.messages.classificationNotificationHandler??"Classification notification handler"} auto-close-duration=medium open .kind=${a} @calciteAlertClose=${()=>this.alertIndicator===null}><div slot=message>${s}</div></calcite-alert>`}}static{this.properties={newFavoriteClassificationName:16,showManageClassificationDialog:16,showSaveClassificationDialog:16,hasDuplicatedClassificationError:16,hasUpdateError:16,alertIndicator:16,isNotificationModalActive:16,portalItem:0,classificationValue:0,favoriteClassifications:0,selectedFavoriteClassificationName:1,attributeExpressionResults:0,resetFavoriteClassification:0,updateClassificationData:0}}static{this.styles=C}load(){this.newFavoriteClassificationName=this.classificationValue?.banner??""}onOpenFavoriteClassificationModal(){this.newFavoriteClassificationName=this.classificationValue?.banner??"",this.showSaveClassificationDialog=!0}getValidationMessage(){return this.newFavoriteClassificationName?this.hasDuplicatedClassificationError?this.messages.duplicatedClassificationError:"":this.messages.emptyFavoriteError}render(){return e`<div>${this.favoriteClassifications.length>0?e`<div><calcite-label><div class="select-favorite-label">${this.messages.applyClassificationFavoriteLabel}<calcite-link @click=${()=>this.showManageClassificationDialog=!0}>${this.messages.manageClassificationFavoriteBtn}</calcite-link></div><calcite-combobox label=select-calcite-combobox selection-mode=single .placeholder=${this.messages.selectFavoritePlaceholder} placeholder-icon=folder-star @calciteComboboxChange=${this.selectFavoriteClassification} .status=${this.hasUpdateError?"invalid":"idle"} .validationIcon=${this.hasUpdateError?"exclamation-mark-triangle":void 0} .validationMessage=${this.hasUpdateError?this.messages.updateWarning:""}>${o(this.favoriteClassifications,({name:i})=>i,({name:i})=>e`<calcite-combobox-item .selected=${this.selectedFavoriteClassificationName===i} icon=folder-star .value=${i} .heading=${i}></calcite-combobox-item>`)}</calcite-combobox></calcite-label><div class="favorite-actions"><calcite-link icon-start=refresh @click=${this.updateFavoriteClassification}>${this.messages.updateClassificationFavoriteBtn}</calcite-link><calcite-link icon-start=star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationBtn}</calcite-link></div></div>`:e`<div class="save-new-favorite-button"><calcite-link icon-start=folder-star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationFavoriteBtn}</calcite-link></div>`}<calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.manageClassificationFavoriteLabel} .open=${this.showManageClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${()=>this.showManageClassificationDialog=!1}><calcite-list class="classification-favorite-list" .label=${this.messages.classificationFavoriteListLabel??"Classification Favorite list label"} selection-appearance=border selection-mode=single-persist>${o(this.favoriteClassifications,({name:i})=>i,({name:i})=>e`<calcite-list-item .label=${i} .value=${i} class="classification-favorite-item"><div slot=content-end><calcite-icon icon=trash scale=s @click=${async()=>await this.removeFavoriteClassification(i)}></calcite-icon></div></calcite-list-item>`)}</calcite-list><calcite-button slot=footer-end scale=l @click=${()=>this.showManageClassificationDialog=!1}><div>${this.messages.favoriteClassificationBtnDone}</div></calcite-button></calcite-dialog><calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.addFavoriteDialogHeading} .open=${this.showSaveClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${()=>this.showSaveClassificationDialog=!1}><calcite-label class="classification-favorite-input-section">${this.messages.addClassificationFavorite}<calcite-input id=classification-favorite-name name=classification-favorite-name scale=m .value=${this.newFavoriteClassificationName} @calciteInputInput=${this.changeFavoriteClassificationName} .status=${!this.newFavoriteClassificationName||this.hasDuplicatedClassificationError?"invalid":"idle"} validation-icon=exclamation-mark-triangle .validationMessage=${this.getValidationMessage()}></calcite-input></calcite-label><calcite-button scale=l slot=footer-end @click=${this.saveNewFavoriteClassification}>${this.messages.favoriteClassificationBtnDone}</calcite-button></calcite-dialog></div>`}};r("arcgis-portal-classification-favorite",l);return l},a,b)
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`# ArcGIS Online Map Viewer \u2014 Layer Filter Tool Calling Assistant
|
|
3
|
+
|
|
4
|
+
You are an assistant that helps manage layer filters and visual effects for **ArcGIS Online Map Viewer** by selecting and calling the appropriate tool.
|
|
5
|
+
|
|
6
|
+
You may make **zero or one** tool call based on the assigned task.
|
|
7
|
+
|
|
8
|
+
## You are given:
|
|
9
|
+
|
|
10
|
+
Assigned task:
|
|
11
|
+
{assignedTask}
|
|
12
|
+
|
|
13
|
+
Latest user request:
|
|
14
|
+
{userRequest}
|
|
15
|
+
|
|
16
|
+
Prior steps:
|
|
17
|
+
{priorSteps}
|
|
18
|
+
|
|
19
|
+
Use the assigned task as the primary instruction for the current query.
|
|
20
|
+
Use the latest user request as supporting context when needed.
|
|
21
|
+
Use prior steps only when the assigned task clearly depends on earlier results.
|
|
22
|
+
|
|
23
|
+
A list of layers, with layerId, layerSummary and each with associated field information
|
|
24
|
+
{layerFieldInfo}
|
|
25
|
+
|
|
26
|
+
FieldInfo:
|
|
27
|
+
|
|
28
|
+
- \`name\`: the actual field name used in layer filter expressions
|
|
29
|
+
- \`type\`: one of \`string\`, \`number\`, \`date\`, etc.
|
|
30
|
+
- \`alias\`: a human-readable label
|
|
31
|
+
- \`description\`: optional field metadata
|
|
32
|
+
- \`statistics\`: such as min, max, unique values, etc.
|
|
33
|
+
|
|
34
|
+
This is what the query tool returned:
|
|
35
|
+
{queryResponse}
|
|
36
|
+
|
|
37
|
+
## Your task
|
|
38
|
+
|
|
39
|
+
1. Decide whether a tool call is needed (see "When to call a tool" below).
|
|
40
|
+
2. If needed, determine \`targetLayer\` using the priority rules below.
|
|
41
|
+
3. Select the most appropriate tool.
|
|
42
|
+
|
|
43
|
+
## How to determine targetLayer (follow in order)
|
|
44
|
+
|
|
45
|
+
Use the FIRST rule that matches:
|
|
46
|
+
|
|
47
|
+
1. **queryResponse includes \`objectIds\` and \`objectIdField\`** \u2192 pass them as \`targetLayer.objectIds\` array and set \`where\` to \`"1=1"\`. Do NOT construct a WHERE clause with IN(...).
|
|
48
|
+
|
|
49
|
+
2. **queryResponse includes a \`where\` clause** \u2192 copy that exact \`where\` string and the \`layerId\` into \`targetLayer\`. Do NOT regenerate, rephrase, or simplify it.
|
|
50
|
+
|
|
51
|
+
3. **Assigned task explicitly asks for a DIFFERENT set of features** than what the query returned (e.g., query found declined apps but assigned task says "now highlight the approved ones"), OR the assigned task asks to clear/reset filters \u2192 generate a new WHERE clause using the rules in "Generating new WHERE clauses" below.
|
|
52
|
+
|
|
53
|
+
### Also forward geometryFilter and useCurrentExtent
|
|
54
|
+
|
|
55
|
+
If the query tool call in the message history used a \`geometryFilter\` (spatial/proximity query) or \`useCurrentExtent: true\`, include the same parameters in your tool call. Without them, the filter would apply to the entire layer instead of just the spatially scoped features.
|
|
56
|
+
|
|
57
|
+
## When to call a tool
|
|
58
|
+
|
|
59
|
+
ALWAYS call a tool when:
|
|
60
|
+
|
|
61
|
+
- The assigned task asked to "show", "find", "locate", or "where is" something
|
|
62
|
+
- The assigned task asked a question that identifies specific features (e.g., "which has the highest...?", "find all X that are Y")
|
|
63
|
+
- The assigned task wants to clear or reset filters of the map
|
|
64
|
+
|
|
65
|
+
### No tool call
|
|
66
|
+
|
|
67
|
+
Make no tool call when:
|
|
68
|
+
|
|
69
|
+
- The query returned zero features
|
|
70
|
+
- The assigned task asked a pure aggregate/statistical question (e.g., "what is the average?", "how many total?")
|
|
71
|
+
- No meaningful filter can be generated
|
|
72
|
+
- The assigned task was fully answered by the query step with no need for map interaction
|
|
73
|
+
- Even if objectIds are available in the query response, do not highlight features unless the assigned task explicitly asked to see, show, highlight or emphasize them
|
|
74
|
+
|
|
75
|
+
## Generating new WHERE clauses (exception case only)
|
|
76
|
+
|
|
77
|
+
Only use these rules when rule 3 above applies \u2014 i.e., the assigned task explicitly asked for a different feature set.
|
|
78
|
+
|
|
79
|
+
- Use only the field's **\`name\`** in the expression \u2014 not the alias.
|
|
80
|
+
- Use field \`type\` to choose operators:
|
|
81
|
+
- **String** \u2192 \`LIKE '%value%'\`, \`=\`, \`IN (...)\`
|
|
82
|
+
- **Number/Date** \u2192 \`=\`, \`<\`, \`>\`, \`BETWEEN\`, etc.
|
|
83
|
+
- **Coded-value domain fields** \u2192 use the numeric/string **code**, never the domain name.
|
|
84
|
+
- **Range domain fields** \u2192 use the listed min/max as valid bounds.
|
|
85
|
+
- DO NOT use subqueries or \`SELECT\`.
|
|
86
|
+
- Combine conditions with \`AND\`, \`OR\`, or \`NOT\` as appropriate.
|
|
87
|
+
|
|
88
|
+
## SQL-92 Date/Time Syntax
|
|
89
|
+
|
|
90
|
+
User timezone: {userTimezone} ({userTimezoneOffset})
|
|
91
|
+
|
|
92
|
+
Database stores dates in UTC. Convert user's local time to UTC.
|
|
93
|
+
|
|
94
|
+
To convert: if offset is \`-08:00\`, add 8 hours. If \`-05:00\`, add 5 hours.
|
|
95
|
+
|
|
96
|
+
Format: \`TIMESTAMP 'YYYY-MM-DD HH:MM:SS'\`
|
|
97
|
+
|
|
98
|
+
## Geometry and Spatial Queries (for setFeatureEffect)
|
|
99
|
+
|
|
100
|
+
When dealing with geometry and proximity and spatial queries:
|
|
101
|
+
|
|
102
|
+
1. TARGET LAYER = What you want to FIND/RETURN in results
|
|
103
|
+
2. GEOMETRY LAYER = The location to search FROM (with distance buffer)
|
|
104
|
+
|
|
105
|
+
For questions like "Is [specific item A] near/within [any of type B]":
|
|
106
|
+
|
|
107
|
+
- Target: Type B (what we're searching for)
|
|
108
|
+
- Geometry: Specific item A (where we're searching from)
|
|
109
|
+
|
|
110
|
+
Examples:
|
|
111
|
+
|
|
112
|
+
Q: "Is well P132_1873 within 300m from a protected area?"
|
|
113
|
+
Target: Protected Areas (what we want to find)
|
|
114
|
+
Geometry: Well (where="ID = 'P132_1873'" - single point)
|
|
115
|
+
|
|
116
|
+
Q: "Find roads within 500m of park X"
|
|
117
|
+
Target: Roads (what we want to find)
|
|
118
|
+
Geometry: Park X (specific location)
|
|
119
|
+
|
|
120
|
+
Key principle: The geometry layer should be the SIMPLER geometry (ideally a single feature or small set),
|
|
121
|
+
not a large collection that requires union operations.
|
|
122
|
+
`;export{e as default};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`## Navigation Agent - Tool Intent Classifier
|
|
3
|
+
|
|
4
|
+
You are an assistant that classifies the assigned task intent for navigation agent.
|
|
5
|
+
|
|
6
|
+
You are given the following tool options:
|
|
7
|
+
{tools}
|
|
8
|
+
|
|
9
|
+
Bookmarks: {bookmarks}
|
|
10
|
+
|
|
11
|
+
Assigned task:
|
|
12
|
+
{assignedTask}
|
|
13
|
+
|
|
14
|
+
Latest user request:
|
|
15
|
+
{userRequest}
|
|
16
|
+
|
|
17
|
+
Prior steps:
|
|
18
|
+
{priorSteps}
|
|
19
|
+
|
|
20
|
+
Use the assigned task as the primary instruction for the current query. The question will **not** be restated again here.
|
|
21
|
+
Use the latest user request as supporting context when needed.
|
|
22
|
+
Use prior steps only when the assigned task clearly depends on earlier results.
|
|
23
|
+
|
|
24
|
+
Return exactly one intent (tool name) based on the assigned task.
|
|
25
|
+
If none apply, return an **empty string**.
|
|
26
|
+
|
|
27
|
+
Choose only from provided tools.
|
|
28
|
+
|
|
29
|
+
## Note:
|
|
30
|
+
|
|
31
|
+
This is the order of preference in case of overlap:
|
|
32
|
+
|
|
33
|
+
1. Bookmark (if exists)
|
|
34
|
+
2. Feature (if exists)
|
|
35
|
+
3. Geocode / Address
|
|
36
|
+
|
|
37
|
+
For example, "Where is Yosemite National Park". This is an address, but:
|
|
38
|
+
A map that contains a bookmark with Yosemite National Park should prefer the bookmark.
|
|
39
|
+
If bookmark does not exist, a map that has the National Parks layer, for example, should prefer the feature.
|
|
40
|
+
If both of these do not exist, geocode and go to that address.
|
|
41
|
+
|
|
42
|
+
Additional mapping guidance:
|
|
43
|
+
|
|
44
|
+
- "zoom/go to [layer]" with no filter \u2192 prefer \`goToLayer\`.
|
|
45
|
+
- "zoom/go to [features] where/with ..." (has a condition/filter) \u2192 prefer \`goToFeatures\`.
|
|
46
|
+
- Explicit numeric zoom/scale/viewpoint requests \u2192 prefer the matching zoom/scale/viewpoint tool.
|
|
47
|
+
|
|
48
|
+
Return the name of the tool as a string.
|
|
49
|
+
`;export{e as default};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`# ArcGIS Knowledge Agent \u2014 Action Summary
|
|
3
|
+
|
|
4
|
+
You are a Knowledge Graph assistant that has executed tool calls to answer a user request.
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
**Data model**
|
|
9
|
+
{dataModelSummary}
|
|
10
|
+
|
|
11
|
+
**Assigned task**
|
|
12
|
+
{assignedTask}
|
|
13
|
+
|
|
14
|
+
**User request**
|
|
15
|
+
{userRequest}
|
|
16
|
+
|
|
17
|
+
**Tool result**
|
|
18
|
+
{toolResult}
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Goal
|
|
23
|
+
|
|
24
|
+
Generate a concise, complete Markdown response using the tool results.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Priority Rules (Strict Order)
|
|
29
|
+
|
|
30
|
+
### 1. User Formatting Override (Highest Priority)
|
|
31
|
+
|
|
32
|
+
- If the user specifies a format (table, list, bullets, etc.):
|
|
33
|
+
- Use that format exactly
|
|
34
|
+
- Ignore ALL default formatting rules below
|
|
35
|
+
- Do NOT add summaries or extra sections unless requested
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### 2. Default Output (When no override)
|
|
40
|
+
|
|
41
|
+
Produce:
|
|
42
|
+
|
|
43
|
+
- **Summary**: 1\u20132 sentences (no header, no bullets)
|
|
44
|
+
- **Results**: Minimal, well-formatted data
|
|
45
|
+
- **Note (optional)**:
|
|
46
|
+
- 1\u20132 italicized sentences describing tool limitations
|
|
47
|
+
|
|
48
|
+
#### Limits
|
|
49
|
+
|
|
50
|
+
- maxPreviewItems: 5
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### 3. Output Constraints (Non-Negotiable)
|
|
55
|
+
|
|
56
|
+
- Output **valid Markdown only** (no JSON)
|
|
57
|
+
- Do NOT hallucinate data (entities, fields, counts, relationships)
|
|
58
|
+
- Do NOT include:
|
|
59
|
+
- reasoning
|
|
60
|
+
- classification labels
|
|
61
|
+
- follow-up questions
|
|
62
|
+
- next steps
|
|
63
|
+
- intro phrases (\u201CHere are\u2026\u201D)
|
|
64
|
+
- restating the question
|
|
65
|
+
- End immediately after the response
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### 4. Data Handling Rules
|
|
70
|
+
|
|
71
|
+
- If results are empty \u2192 clearly state no results returned
|
|
72
|
+
- If insufficient data \u2192 state limitation, do NOT speculate
|
|
73
|
+
- Do NOT output:
|
|
74
|
+
- raw nested objects
|
|
75
|
+
- large arrays
|
|
76
|
+
- geometry
|
|
77
|
+
- Summarize complex structures
|
|
78
|
+
- Truncate long values with \`\u2026\`
|
|
79
|
+
- Show entities/relationships only once
|
|
80
|
+
- Use:
|
|
81
|
+
- \u201Centity\u201D (not node)
|
|
82
|
+
- \u201Crelationship\u201D (not edge)
|
|
83
|
+
- Hide \`globalid\` and \`objectid\` unless explicitly requested
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### 5. Formatting Rules (Default Mode Only)
|
|
88
|
+
|
|
89
|
+
- No headers; use _italic labels_ if needed
|
|
90
|
+
- Use:
|
|
91
|
+
- bullets \u2192 single item summaries
|
|
92
|
+
- tables \u2192 multiple results (limit to 5 rows)
|
|
93
|
+
- Reduce columns to key fields only
|
|
94
|
+
- Format:
|
|
95
|
+
- dates \u2192 \u201Cday month year\u201D
|
|
96
|
+
- time separate from date
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### 6. Result-Type Formatting
|
|
101
|
+
|
|
102
|
+
**SEARCH_HITS**
|
|
103
|
+
|
|
104
|
+
- Highlight top match (bullets)
|
|
105
|
+
- Table for remaining results
|
|
106
|
+
|
|
107
|
+
**ENTITIES**
|
|
108
|
+
|
|
109
|
+
- Group by type (if multiple)
|
|
110
|
+
- Show key properties only
|
|
111
|
+
|
|
112
|
+
**RELATIONSHIPS**
|
|
113
|
+
|
|
114
|
+
- Format: \`(entity) \u2014[relationship]\u2192 (entity)\`
|
|
115
|
+
|
|
116
|
+
**PATHS**
|
|
117
|
+
|
|
118
|
+
- Summary + 1-3 examples
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Internal Processing (Do NOT output)
|
|
123
|
+
|
|
124
|
+
Classify results into:
|
|
125
|
+
|
|
126
|
+
- SEARCH_HITS, ENTITIES, RELATIONSHIPS, PATHS
|
|
127
|
+
|
|
128
|
+
## Failure Handling
|
|
129
|
+
|
|
130
|
+
- If data is insufficient \u2192 clearly state limitation
|
|
131
|
+
- Never infer or fabricate missing information
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
`;export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import b from"./KFH2OM2D.js";import"./Z5UVAVHJ.js";import a from"./PBZ25RYU.js";import{a as f}from"./PIZFXU2N.js";import"./SFKRR7GW.js";import{K as n,M as c,Q as l,h as e,j as s,p as o}from"./CAQR2NSG.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{a:d,b:h}])=>{var p=e`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`,r=class extends n{constructor(){super(...arguments),this.classificationModel=d(this),this.messages=f(),this._classificationDataTask=h(this),this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.status=this.classificationModel.status,this.missingExistingClassification=!1,this.variant="full",this.autoDestroyDisabled=!1,this.validationErrors=""}static{this.properties={portalClassificationSchema:16,status:16,itemClassification:16,portalItem:0,missingExistingClassification:5,variant:1,autoDestroyDisabled:5,validationErrors:1}}static{this.styles=p}async destroy(){await this.manager.destroy()}willUpdate(a){if(a.has("portalItem")){let{portalItem:i}=this;i?.load().then(()=>{i?.id&&i?.loaded&&i?.classification&&!this.missingExistingClassification?this.classificationModel.validateClassification(this.variant==="preview"?null:i.id,i.classification,i?.portal.restUrl).catch(o(this)).then(t=>{this.validationErrors=t??""}):this.validationErrors=""}).catch(o(this))}}getStyle(){let a={};if(this.variant==="preview"&&(a.fontSize="var(--calcite-font-size-sm)",a.padding="var(--calcite-spacing-xs)"),this.itemClassification&&this.portalClassificationSchema){let i=this.itemClassification.classification,t=this.portalClassificationSchema.classificationMetadata.classificationValueProperties.find(({value:m})=>m===i);t?.backgroundColor&&(a.backgroundColor=t.backgroundColor),t?.textColor&&(a.color=t.textColor)}return a}render(){return this._classificationDataTask.render({pending:void 0,error:void 0,complete:()=>this.portalClassificationSchema&&this.portalItem?.portal.authMode!=="anonymous"?this.validationErrors&&this.variant==="full"?s`<div class="invalid-container"><calcite-icon class="invalid-icon" scale=s icon=exclamation-mark-triangle .textLabel=${this.messages.invalidclassificationerror}></calcite-icon><span class="invalid-message">${this.messages.invalidclassificationerror}</span></div>`:s`<div class="banner" style=${c(this.getStyle())}>${this.itemClassification?.banner??this.messages.notyetclassified??"Not yet classified"}</div>`:""})}};l("arcgis-portal-classification-banner",r);return r},a,b)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{b as P}from"./Z5UVAVHJ.js";import a from"./PBZ25RYU.js";import{a as E}from"./SFKRR7GW.js";import{n as v,s as g,t as C,x as w}from"./CAQR2NSG.js";export default $arcgis.t(([j,{property:p,subclass:I},{on:Y,watch:M},{createObservable:D,trackAccess:O},{property:J,subclass:Q},z,{a:b,b:x}])=>{var A=(t,o)=>i=>U(i,t),u=class extends w{constructor(o,i){super(o),this.Y=new Map,this.A=void 0,this.#e=D();let e=this;e.#t=i,e.Z(),e.setProvisionalExports(S(o,new WeakRef(e),o.M.length-1,e.instance,e.Y),!1),g(o,r=>{if(r){let n=M(()=>o[r],s=>{if(s===e.instance)return;let c=e.instance;e.exports=s,e.instance=s,e.Y.forEach((d,m)=>o.requestUpdate(d,c[m])),e.#o&&c.destroy(),e.#o=!1},{sync:!0});e.onDestroy(n.remove)}},e.exports)}#o;#e;#t;get exports(){return O(this.#e),super.exports}set exports(o){super.exports=o,this.#e.notify()}Z(){let o=this;o.instance="prototype"in o.#t&&"declaredClass"in o.#t.prototype?new o.#t:o.#t(),o.#o=!0}hostConnected(){this.exports=this.instance}hostDestroy(){this.#o&&this.instance.destroy?.()}},U=E(u),S=(t,o,i,e,r)=>new Proxy(e,{get:(n,s)=>{let c=n[s];if(typeof s=="symbol"||r.has(s))return c;let d=t.M[i];return d.A=s,C(t,m=>{if(d.A=void 0,m!==void 0){let f=m.key;r.set(s,f);let h=t.constructor.getPropertyOptions(f),y=s!==f&&f.toLowerCase().includes("disable");$(o,h,s,f,y),h.i===void 0&&N(h,i,s,y)}},c)}}),$=(t,o,i,e,r,n)=>n=M(()=>{let s=t.deref();return s===void 0||s.component.manager.destroyed?n=n.remove():s.exports[i]},(s,c)=>{if(!n)return;t.deref().component?.requestUpdate(e,r?!c:c),o.c=!1},{sync:!0}),N=(t,o,i,e)=>{t.d.get=function(){let r=this.M[o]?.exports[i];return e?!r:r},t.d.set=function(r){let n=this.M[o];n.A!==i&&(n.exports[i]=e?!r:r)}};var L=Object.defineProperty,V=Object.getOwnPropertyDescriptor,l=(t,o,i,e)=>{for(var r=e>1?void 0:e?V(o,i):o,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(e?s(o,i,r):s(r))||r);return e&&r&&L(o,i,r),r},a=class extends j{constructor(){super(...arguments),this.fetching=!1,this.status="idle",this.error=void 0,this.portalUrl=void 0,this._itemClassificationValidationErrors=new Map,this.fetchingPromise=new v}get primaryAttribute(){return this.portalClassificationSchema?.classificationMetadata.primaryAttribute}setPortalClassificationData({portalUrl:t,schema:o}){this.portalUrl=t,this.portalClassificationSchema=o,this.status="loaded",this.fetchingPromise.resolve(!0)}setFetching(t){this.fetching=t}async loadPortalClassificationData(t,{signal:o}){this.status="loading";let{result:i,error:e}=await b(t,o);if(e){e.name==="AbortError"?console.log("Request aborted."):(this.error=e,this.status="error",this.fetchingPromise.reject(e));return}else this.setPortalClassificationData({schema:i,portalUrl:t})}async validateClassification(t,o,i,e){if(!o)return"";let r=t?this._itemClassificationValidationErrors.get(t):void 0;if(r)return await r;let n=(async()=>{let{error:s}=await x(i,o,e??{});return s?s?.details.raw.messages.join(", "):""})();return t&&this._itemClassificationValidationErrors.set(t,n),t?await this._itemClassificationValidationErrors.get(t):await n}};l([p()],a.prototype,"portalClassificationSchema",2);l([p()],a.prototype,"fetching",2);l([p()],a.prototype,"status",2);l([p()],a.prototype,"error",2);l([p()],a.prototype,"portalUrl",2);l([p()],a.prototype,"_itemClassificationValidationErrors",2);a=l([I("custom.ClassificationModel")],a);var k;function _(t){return k??=new a(t),k}var at=A(_),ct=t=>new P(t,{task:async([o],{signal:i})=>{if(!o)throw new Error("Portal item is required to load classification data");if(o.loaded||await o.load({signal:i}),t.itemClassification=o.classification,t.classificationModel.status==="loading"&&await t.classificationModel.fetchingPromise.promise,!t.portalItem?.portal.hasClassificationSchema){t.classificationModel.setPortalClassificationData({portalUrl:o.portal.restUrl,schema:void 0});return}(t.classificationModel.status==="idle"||t.classificationModel.status==="loaded"&&t.classificationModel.portalUrl!==o.portal.restUrl)&&await t.classificationModel.loadPortalClassificationData(o.portal.restUrl,{signal:i})},args:()=>[t.portalItem]});return{a:at,b:ct}},"core/Accessor","core/accessorSupport/decorators","core/reactiveUtils","applications/Components/reactiveUtils","core/accessorSupport/decorators","core/Accessor",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import a from"./TTZBF4KI.js";import{a as T}from"./S2PHM4WZ.js";import{b as W}from"./5WK4GJK2.js";import{a as q}from"./V5ZWDMLE.js";import"./32DRTMS4.js";import{G as C,H as P,I as J,M as A,O as B,h as R,j as y,n as N,p as S,q as j,u as E}from"./NJMHL2Y7.js";import"./CFDTXKJ6.js";export default $arcgis.t(([le,Ie,ve,Fe,x,de,I,pe,fe,L,Z,$,ee,{g:G,i:z,j:V,k:U,l:_,m:H,n:K,o:Q,p:X,q:Y}])=>{var k=(i=>(i.expression="expression/",i))(k||{});function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let r=t.get(s);return r?.title?r.title:s}else return ee.supportsFieldConfiguration(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function re(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${k.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,r=s?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=a.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(a=>{t(new Error(a))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function ae(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,o=e.sourceJSON;if(!r||!a||!a.portal.user||!U(a)||V(a)||_(a)||H(o)||a.portal.isPortal&&z(a)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!s?.ignoreLayerRenderer&&e.featureReduction){let f=new Set;if(await I.collectFeatureReductionFields(f,e,e.featureReduction),Array.from(f).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(f=>d(f,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let f=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(f&&((await I.getExpressionFields(e,f)).some(b=>d(b,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(f=>d(f,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(f=>f.keyField)?.some(f=>d(f,t.name)))return!1;let u=G(a,a.portal.user),v=s?.userItemInfo?.userGroups??await K(e)??[],g=s?.userItemInfo?.itemGroups??await Q(e)??[],w=Y(v,g);if(!u&&!w)return!1;let m=s?.userItemInfo?.relatedItems??await X(a.id,a.portal,{relationshipType:"Service2Service"});return!(m?.data?.relatedItems&&m.data.relatedItems.some(f=>["WMTS","Map Service","Vector Tile Service"].includes(f.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`;try{let r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await Z(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(o=>d(o,e))):!1}catch{return!1}}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let r=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],a=!1;for(let o=0;o<r.length;o++){let c=r[o].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${T(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await Z(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let o=a.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=L.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(u=>d(u,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=L.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(r&&await ne(i,e,r))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?pe.fromJSON(t):fe.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!Array.from(r).some(a=>d(a,e.name))}var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Ne=({fieldType:i})=>y`<calcite-icon scale=s .icon=${h.get(i)}></calcite-icon>`,Ee=R`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,O=class extends J{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new W(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>s.includes(a.name));let r=s.some(a=>!e.fields.find(o=>o.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async o=>await ae(t,e,o,this.options)));if(this.fieldsAreDeletable=a.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=re(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?te(t,r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return de.supportsFieldConfiguration(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(o=>({name:o}))},a={deleteFromDefinition:JSON.stringify(r)};await x(s,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(u=>delete u.prototype.attributes[l]):n.types?.forEach(u=>{u.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let o=new Ie;o.description=a.description??"",o.name=a.name||s.newFeature,o.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let u=0;u<a.prototype.attributes.length;u++)if(a.prototype.attributes[u]===n.name){l=!0,c[n.name]=a.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,r.push(o)}),r}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),t.popupTemplate?.content?.forEach((l,u)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[u].fieldInfos=(t.popupTemplate?.content)[u].fieldInfos?.filter(v=>v.fieldName!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let u=t.isTable,v=u?l.tables:l.layers,g=v?.find(w=>w.id===t.layerId);if(s.forEach(w=>{g?.attributeTableInfo?.attributeTableElements&&(g.attributeTableInfo.attributeTableElements=g.attributeTableInfo.attributeTableElements.map(m=>{if(m.type==="field")return m.fieldName===w?void 0:m;if(m.type==="group"&&Array.isArray(m.attributeTableElements)){let f=m.attributeTableElements.filter(b=>!(b.type==="field"&&b.fieldName===w));return f.length?{...m,attributeTableElements:f}:void 0}return m}).filter(Boolean),g.attributeTableInfo.orderByFields=g.attributeTableInfo.orderByFields.filter(m=>m.field!==w))}),g?.layerDefinition?.fieldConfigurations&&(g.layerDefinition.fieldConfigurations=g.layerDefinition.fieldConfigurations.filter(w=>!s.includes(w.name))),g?.popupInfo){s.forEach(b=>{g.popupInfo.fieldInfos=g.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),g.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(g.popupInfo.popupElements[M].fieldInfos=g.popupInfo.popupElements[M].fieldInfos.filter(ce=>ce.fieldName!==b))})});let w=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,m={};u?(m.tables=v,l.layers&&(m.layers=l.layers)):(m.layers=v,l.tables&&(m.tables=l.tables));let f={f:"json",text:JSON.stringify(m)};await x(w,{query:{...f},method:"post",responseType:"json"}).then(b=>{b.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=A(y`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&y`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:s,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,j("fieldNames"))),y`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${s?.length===1?e.deleteField:e.deleteFields} ${P(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return y`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return y`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};B("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","applications/PortalApp/layerUtils","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql","applications/PortalApp/layerUtils",a)
|
|
2
|
+
import a from"./563BUCQX.js";import{a as T}from"./BCUEYBNI.js";import{b as W}from"./Z5UVAVHJ.js";import{a as q}from"./PIZFXU2N.js";import"./SFKRR7GW.js";import{I as C,J as P,K as J,O as A,Q as B,h as R,j as y,o as N,q as S,r as j,v as E}from"./CAQR2NSG.js";import"./CFDTXKJ6.js";export default $arcgis.t(([le,Ie,ve,Fe,x,de,I,pe,fe,L,Z,$,ee,{g:G,i:z,j:V,k:U,l:_,m:H,n:K,o:Q,p:X,q:Y}])=>{var k=(i=>(i.expression="expression/",i))(k||{});function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let r=t.get(s);return r?.title?r.title:s}else return ee.supportsFieldConfiguration(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function re(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${k.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,r=s?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=a.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(a=>{t(new Error(a))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function ae(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,o=e.sourceJSON;if(!r||!a||!a.portal.user||!U(a)||V(a)||_(a)||H(o)||a.portal.isPortal&&z(a)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!s?.ignoreLayerRenderer&&e.featureReduction){let f=new Set;if(await I.collectFeatureReductionFields(f,e,e.featureReduction),Array.from(f).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(f=>d(f,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let f=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(f&&((await I.getExpressionFields(e,f)).some(b=>d(b,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(f=>d(f,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(f=>f.keyField)?.some(f=>d(f,t.name)))return!1;let u=G(a,a.portal.user),v=s?.userItemInfo?.userGroups??await K(e)??[],g=s?.userItemInfo?.itemGroups??await Q(e)??[],w=Y(v,g);if(!u&&!w)return!1;let m=s?.userItemInfo?.relatedItems??await X(a.id,a.portal,{relationshipType:"Service2Service"});return!(m?.data?.relatedItems&&m.data.relatedItems.some(f=>["WMTS","Map Service","Vector Tile Service"].includes(f.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`;try{let r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await Z(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(o=>d(o,e))):!1}catch{return!1}}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let r=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],a=!1;for(let o=0;o<r.length;o++){let c=r[o].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${T(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await Z(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let o=a.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=L.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(u=>d(u,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=L.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(r&&await ne(i,e,r))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?pe.fromJSON(t):fe.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!Array.from(r).some(a=>d(a,e.name))}var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Ne=({fieldType:i})=>y`<calcite-icon scale=s .icon=${h.get(i)}></calcite-icon>`,Ee=R`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,O=class extends J{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new W(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>s.includes(a.name));let r=s.some(a=>!e.fields.find(o=>o.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async o=>await ae(t,e,o,this.options)));if(this.fieldsAreDeletable=a.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=re(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?te(t,r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return de.supportsFieldConfiguration(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(o=>({name:o}))},a={deleteFromDefinition:JSON.stringify(r)};await x(s,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(u=>delete u.prototype.attributes[l]):n.types?.forEach(u=>{u.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let o=new Ie;o.description=a.description??"",o.name=a.name||s.newFeature,o.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let u=0;u<a.prototype.attributes.length;u++)if(a.prototype.attributes[u]===n.name){l=!0,c[n.name]=a.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,r.push(o)}),r}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),t.popupTemplate?.content?.forEach((l,u)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[u].fieldInfos=(t.popupTemplate?.content)[u].fieldInfos?.filter(v=>v.fieldName!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let u=t.isTable,v=u?l.tables:l.layers,g=v?.find(w=>w.id===t.layerId);if(s.forEach(w=>{g?.attributeTableInfo?.attributeTableElements&&(g.attributeTableInfo.attributeTableElements=g.attributeTableInfo.attributeTableElements.map(m=>{if(m.type==="field")return m.fieldName===w?void 0:m;if(m.type==="group"&&Array.isArray(m.attributeTableElements)){let f=m.attributeTableElements.filter(b=>!(b.type==="field"&&b.fieldName===w));return f.length?{...m,attributeTableElements:f}:void 0}return m}).filter(Boolean),g.attributeTableInfo.orderByFields=g.attributeTableInfo.orderByFields.filter(m=>m.field!==w))}),g?.layerDefinition?.fieldConfigurations&&(g.layerDefinition.fieldConfigurations=g.layerDefinition.fieldConfigurations.filter(w=>!s.includes(w.name))),g?.popupInfo){s.forEach(b=>{g.popupInfo.fieldInfos=g.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),g.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(g.popupInfo.popupElements[M].fieldInfos=g.popupInfo.popupElements[M].fieldInfos.filter(ce=>ce.fieldName!==b))})});let w=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,m={};u?(m.tables=v,l.layers&&(m.layers=l.layers)):(m.layers=v,l.tables&&(m.tables=l.tables));let f={f:"json",text:JSON.stringify(m)};await x(w,{query:{...f},method:"post",responseType:"json"}).then(b=>{b.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=A(y`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&y`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:s,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,j("fieldNames"))),y`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${s?.length===1?e.deleteField:e.deleteFields} ${P(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return y`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return y`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};B("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","applications/PortalApp/layerUtils","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql","applications/PortalApp/layerUtils",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as m}from"./5BPXS3WU.js";import{a as h}from"./PIZFXU2N.js";import"./SFKRR7GW.js";import{K as b,N as a,Q as d,h as c,j as i,v as u}from"./CAQR2NSG.js";import"./CFDTXKJ6.js";var g=c`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;function s(o,e){return o.uiElement===e}var n=class extends b{constructor(){super(...arguments),this.messages=h(),this.isRequiredErrors=new Set,this.arcgisAttributeValueChange=u()}static{this.properties={validationMsg:16,attributeKey:1,attribute:0,value:0,renderingInfo:0,isRequiredErrors:0}}static{this.styles=g}willUpdate(e){(e.has("renderingInfo")||e.has("isRequiredErrors"))&&(this.validationMsg=this._getValidationMessage())}_getValidationMessage(){if(this.renderingInfo?.attributeValidationResult)return this.renderingInfo.attributeValidationResult;if(this.isRequiredErrors.has(this.attributeKey))return this.messages.requiredfield??"This is a required field."}renderCheckbox(){return s(this.attribute,"checkbox")?i`<calcite-label class="spacing-y" .for=${this.attributeKey} layout=inline><calcite-checkbox .checked=${this.value} id=${this.attributeKey??a} @calciteCheckboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.checked})} .required=${this.attribute.isRequired??!1} .status=${this.validationMsg?"invalid":"valid"}></calcite-checkbox>${this.attribute.label}</calcite-label>`:null}renderDateInput(){return s(this.attribute,"date")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-input-date-picker id=${this.attributeKey??a} .name=${this.attribute.label} @calciteInputDatePickerChange=${e=>this.isConnected&&this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} overlay-positioning=fixed .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-date-picker></calcite-label>`:null}renderTextInput(){if(!s(this.attribute,"text"))return null;let e=this.attribute.label,t=this.attribute.description;return i`<calcite-label .for=${this.attributeKey}><div class="portal-classification-form-element-tooltip">${e}${this.attribute.labelTooltip&&i`<div><calcite-icon scale=s icon=information .id=${`tooltip-button-${this.attribute.bannerLabel}`} text-label=${this.messages.information??"Information"??a}></calcite-icon><calcite-tooltip .referenceElement=${`tooltip-button-${this.attribute.bannerLabel}`} placement=right>${this.attribute.labelTooltip}</calcite-tooltip></div>`||""}</div><calcite-input-text id=${this.attributeKey??a} .label=${e} .name=${this.attributeKey} @calciteInputTextChange=${r=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:r.target.value})} .placeholder=${t} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-text></calcite-label>`}renderSingleSelect(){return s(this.attribute,"single-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox selection-mode=single id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} .placeholder=${this.attribute.description??this.messages.selectanoption} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} overlay-positioning=fixed validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value} data-testid=${`single-select-${this.attributeKey}`}>${this._renderSingleSelectComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderSingleSelectComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return m(this.renderingInfo?.valueExpressionResult,t=>t.label,t=>i`<calcite-combobox-item .selected=${e===t.value} .heading=${t.label} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`)}_renderComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return this.renderingInfo?.valueExpressionResult.map(t=>i`<calcite-combobox-item .selected=${e?.includes(t.value)} .heading=${t.label} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`)}renderMultiSelect(){return s(this.attribute,"multi-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderGroupedComboboxOptions(){if(!this.renderingInfo?.valueExpressionResult||Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t,r])=>i`<calcite-combobox-item .selected=${e?.includes(t)} .heading=${t} .value=${t}>${r.map(l=>i`<calcite-combobox-item .selected=${e?.includes(l.value)} .heading=${l.label} .value=${l.value} data-testid=${`grouped-combobox-item-${l.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`)}renderMultiGroupedSelectNested(){return s(this.attribute,"multi-grouped-select-nested")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderGroupedComboboxOptions()}</calcite-combobox></calcite-label>`:null}render(){switch(this.attribute.uiElement){case"checkbox":return this.renderCheckbox();case"date":return this.renderDateInput();case"multi-select":return this.renderMultiSelect();case"multi-grouped-select-nested":return this.renderMultiGroupedSelectNested();case"single-select":return this.renderSingleSelect();case"text":return this.renderTextInput();default:return i`<div>Not Implemented Yet.</div>`}}};d("arcgis-portal-classification-form-element",n);export{n as ArcgisPortalClassificationFormElement};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import b from"./ZCL2V7W3.js";import a from"./XR4PMNYP.js";import"./BCUEYBNI.js";import{c as R}from"./SFKRR7GW.js";import{B as M,C as S,F as E,I as P,J as g,K as D,L as v,Q as L,h as k,j as d,l as A,v as u}from"./CAQR2NSG.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{a:O,c:U},{a:x,c:_}])=>{var F=(a,e=100)=>{let s;return(...n)=>{let i=()=>{clearTimeout(s),a(...n)};clearTimeout(s),s=setTimeout(i,e)}};var q=M(class extends S{constructor(){super(...arguments),this.key=A}render(a,e){return this.key=a,e}update(a,[e,s]){return e!==this.key&&(E(a),this.key=e),s}});var y=["@","#","$"],V=400;function Q(a,e){let s=null;for(let n of e){let i=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new RegExp(`${i}"([^"\\n]*)"?$`,"u"),t=a.match(r);if(t){let c=t[0],l=a.length-c.length,h=t[1]??"";(!s||l>s.startIndex)&&(s={starter:n,mentionText:c,query:h,startIndex:l})}let o=new RegExp(`${i}[\\p{L}\\p{N}_-]+$`,"u"),m=a.match(o);if(m){let c=m[0],l=a.length-c.length,h=c.slice(n.length);(!s||l>s.startIndex)&&(s={starter:n,mentionText:c,query:h,startIndex:l})}}return s}var N=a=>y.includes(a)?a:"@",G=R(a=>{let e=[],s=async r=>await x({requester:async()=>await O(a.portal,r,{num:3}),key:"items",id:r}),n=async r=>await x({requester:async()=>await U(a.portal,{query:`title:${r}`,num:3}),key:"groups",id:r}),i=F(async(r,t)=>{a.isFetchingEntities=!0;let o=r.toLowerCase();switch(N(t)){case"@":let m=10;a.filteredItemsInfo={type:"user",items:e.filter(h=>h.username?.toLowerCase().includes(o)||h.fullName?.toLowerCase().includes(o)).slice(0,m)};break;case"#":let{result:c}=await s(o);a.filteredItemsInfo={type:"item",items:c?.results??[]};break;case"$":let{results:l}=await n(o);a.filteredItemsInfo={type:"group",items:l};break}(a.filteredItemsInfo?.items?.length??0)===0&&await a.closePopover(),a.isFetchingEntities=!1},V);return{fetchUsers:async()=>{try{let{users:r}=await _(a.portal);e=r??[]}catch(r){e=[],console.error("error fetching org users:",r)}},filterItems:i,getItemText:(r,t)=>{let o="";switch(N(t)){case"@":o=r.username;break;case"#":o=r.title??"";break;case"$":o=r.title??"";break}return o.trim()}}}),$=({id:a,label:e,selected:s,description:n,contentStart:i,onSelect:r})=>q(a,d`<calcite-list-item class=${v({selected:s})} .label=${e} .description=${n} .selected=${s} @pointerdown=${async t=>{t.preventDefault(),t.stopPropagation(),await r()}} ${g(t=>{s&&t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})})}>${i}</calcite-list-item>`),j=k`.selected{--calcite-list-background-color: var(--calcite-color-foreground-2)}.mentionable-list{max-height:13rem;overflow-y:auto;padding:.25rem;width:min(100vw,24rem)}.mentionable-list--loading{min-height:10rem}`,w=class extends D{constructor(){super(...arguments),this.calciteTextAreaRef=P(),this.mentionableEntityController=G(this),this.handleInput=e=>{let{bubbleNewValueChange:s,checkForMention:n}=this,i=e.target.value;this._value=i,s(this._value);let r=this.nativeTextAreaRef?.selectionStart??0;n(i,r)},this.handleKeyDown=e=>{if(!this.popoverOpen){this.arcgisUserMentionableTextAreaKeyDown.emit(e),this.arcgisMentionableTextAreaKeyDown.emit(e);return}switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedItemIndex=Math.min(this.selectedItemIndex+1,this.filteredItems.length-1);break;case"ArrowUp":e.preventDefault(),this.selectedItemIndex=Math.max(this.selectedItemIndex-1,0);break;case"Enter":e.preventDefault(),this.selectItem(this.filteredItems[this.selectedItemIndex]);break;case"Escape":e.preventDefault(),this.closePopover.bind(this)();break}},this.handleClosePopover=()=>{this.popoverOpen=!1,this.currentMentionQuery="",this.selectedItemIndex=0,this.currentStarter=null},this.bubbleNewValueChange=e=>{this.arcgisUserMentionableTextAreaChange.emit(e),this.arcgisMentionableTextAreaChange.emit(e)},this.checkForMention=(e,s)=>{let n=e.substring(0,s),i=Q(n,this.starters??y);if(i){let{starter:r}=i;this.currentStarter=r,this.filterMentionItems(i),this.popoverOpen=!0;return}this.handleClosePopover()},this.filterMentionItems=e=>{let{mentionText:s,query:n,starter:i,startIndex:r}=e;this.currentMentionQuery=s,this.mentionStartPosition=r;let t=n.toLowerCase();this.mentionableEntityController.filterItems(t,i),this.selectedItemIndex=0},this.popoverOpen=!1,this.currentMentionQuery="",this.mentionStartPosition=0,this.selectedItemIndex=0,this.currentStarter=null,this._value="",this.filteredItemsInfo=null,this.isFetchingEntities=!1,this.popoverPlacement="bottom-start",this.disabled=!1,this.scale="m",this.rows=3,this.starters=y,this.readOnly=!1,this.arcgisMentionableSelectedIndexChange=u(),this.arcgisMentionableTextAreaChange=u(),this.arcgisMentionableTextAreaKeyDown=u(),this.arcgisUserMentionableTextAreaChange=u(),this.arcgisUserMentionableTextAreaKeyDown=u(),this.renderItemInfo=()=>{let{filteredItemsInfo:e,selectedItemIndex:s,portal:n}=this;if(!e)return null;let{items:i,type:r}=e;switch(r){case"user":return i.map((t,o)=>$({id:t.id,label:`@${t.username}`,description:t.fullName,selected:o===s,contentStart:d`<arcgis-portal-user-avatar slot=content-start .user=${t} .portal=${n} scale=m></arcgis-portal-user-avatar>`,onSelect:async()=>await this.selectItem(t)}));case"item":return i.map((t,o)=>$({id:t.id??`item-${o}`,label:`#${t.title}`,description:t.id??void 0,selected:o===s,onSelect:async()=>await this.selectItem(t),contentStart:d`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}));case"group":return i.map((t,o)=>$({id:t.id??`group-${o}`,label:`${t.title}`,description:t.id??void 0,selected:o===s,onSelect:async()=>await this.selectItem(t),contentStart:d`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}))}}}static{this.properties={popoverOpen:16,currentMentionQuery:16,mentionStartPosition:16,selectedItemIndex:16,currentStarter:16,_value:16,filteredItemsInfo:16,isFetchingEntities:16,popoverListLabel:1,popoverPlacement:1,disabled:5,portal:0,user:0,scale:1,value:1,maxLength:9,rows:9,starters:0,placeholder:1,readOnly:5}}static{this.styles=j}get filteredItems(){return this.filteredItemsInfo?.items??[]}async closePopover(){this.handleClosePopover()}async focusTextArea(){await this.calciteTextAreaRef.value?.setFocus()}async selectItem(e){let{currentStarter:s,_value:n,mentionStartPosition:i,currentMentionQuery:r,handleClosePopover:t,calciteTextAreaRef:o,nativeTextAreaRef:m,bubbleNewValueChange:c}=this;if(!e||!s)return;let l=this.mentionableEntityController.getItemText(e,s).replaceAll('"',"").trim(),h=/\s/u.test(l)?`${s}"${l}"`:`${s}${l}`,f=(n??"").substring(0,i),p=(n??"").substring(i+r.length),I=`${f}${h} ${p}`;this._value=I,c(this._value);let b=i+h.length+1;t(),await this.updateComplete,o.value?.setFocus(),m&&(m.selectionEnd=b)}willUpdate(e){e.has("value")&&(this._value=this.value??""),e.has("selectedItemIndex")&&this.arcgisMentionableSelectedIndexChange.emit(this.selectedItemIndex)}loaded(){this.updateComplete.then(()=>{let e=this.calciteTextAreaRef.value?.shadowRoot?.querySelector("textarea");e&&(this.nativeTextAreaRef=e)}),this.mentionableEntityController.fetchUsers()}render(){let{popoverPlacement:e,scale:s,_value:n,maxLength:i,rows:r,placeholder:t,readOnly:o,popoverOpen:m,closePopover:c,handleInput:l,handleKeyDown:h,disabled:f,isFetchingEntities:p,filteredItemsInfo:I,renderItemInfo:b,popoverListLabel:T}=this,C=this.calciteTextAreaRef.value,K=I?.items??[];return d`<calcite-text-area .placeholder=${t} .value=${n} .maxLength=${i} .rows=${r} .scale=${s} .readOnly=${o} .disabled=${f} @blur=${c} @calciteTextAreaInput=${l} @keydown=${h} ${g(this.calciteTextAreaRef)}></calcite-text-area>${C&&d`<calcite-popover .open=${m} .placement=${e} class="mention-popover" .label=${T} .referenceElement=${C} trigger-disabled pointer-disabled focus-trap-disabled><div class=${v({"mentionable-list":!0,"mentionable-list--loading":p})}>${p&&d`<calcite-scrim .loading=${p}></calcite-scrim>`||""}${K.length>0&&d`<calcite-list .label=${T}>${b()}</calcite-list>`||""}</div></calcite-popover>`||""}`}};L("arcgis-portal-mentionable-text-area",w);return w},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{e as r}from"./
|
|
2
|
+
import{e as r}from"./SFKRR7GW.js";import{R as o}from"./CAQR2NSG.js";var s=r(o);export{s as a};
|