@arcgis/coding-components 4.31.0-next.2 → 4.31.0-next.21
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 +22 -3
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +6 -6
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +5 -5
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/css.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/html.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/json.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +33 -0
- package/dist/arcgis-coding-components/assets/code-editor/ts.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/language-api-panel/t9n/language-api-panel.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/sql-expression-editor/api/sql-expression-api.t9n.en.json +735 -0
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-7984ea8e.js → p-1b799777.js} +2 -2
- package/dist/arcgis-coding-components/p-4d5cf512.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-60c2a820.js → p-56266a64.js} +2 -2
- package/dist/arcgis-coding-components/{p-e8211ffe.js → p-57b8bcd7.js} +1 -1
- package/dist/arcgis-coding-components/{p-9eced6fc.js → p-5b67b62b.js} +2 -2
- package/dist/arcgis-coding-components/{p-93a97573.js → p-64137fec.js} +3 -3
- package/dist/arcgis-coding-components/{p-e7ee4d64.js → p-6621a80f.js} +3 -3
- package/dist/arcgis-coding-components/p-77dd5521.js +6 -0
- package/dist/arcgis-coding-components/p-8eb7e694.js +6 -0
- package/dist/arcgis-coding-components/p-a2341e0c.js +6 -0
- package/dist/arcgis-coding-components/{p-bb7e832e.js → p-b715834b.js} +3 -3
- package/dist/arcgis-coding-components/p-cbee273f.js +6 -0
- package/dist/arcgis-coding-components/{p-5ef7cce5.js → p-cdc52d2f.js} +1 -1
- package/dist/arcgis-coding-components/{p-36fedc23.js → p-d7d1f130.js} +12 -12
- package/dist/arcgis-coding-components/p-e1f9b463.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-62ee6251.js → p-e5a924a1.js} +1 -1
- package/dist/arcgis-coding-components/p-f2d64a9d.js +6 -0
- package/dist/arcgis-coding-components/{p-03ea6cd7.js → p-ff62d134.js} +3 -3
- package/dist/arcgis-coding-components/p-ffce0588.entry.js +6 -0
- package/dist/cjs/{app-globals-aee5f4b5.js → app-globals-a9ef3ca8.js} +1 -1
- package/dist/cjs/arcade-defaults-f5241680.js +349 -0
- package/dist/cjs/arcade-language-features-0b9f3947.js +274 -0
- package/dist/cjs/arcade-mode-cc08d9cd.js +335 -0
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +181 -1501
- package/dist/cjs/arcgis-coding-components.cjs.js +4 -4
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +81 -0
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +80 -0
- package/dist/cjs/{css-7cc05f76.js → css-bb6a49ec.js} +1 -1
- package/dist/cjs/{cssMode-2b0daeae.js → cssMode-e7fac7d7.js} +3 -4
- package/dist/cjs/{html-f56911e1.js → html-7ff4071d.js} +3 -4
- package/dist/cjs/{htmlMode-43eed674.js → htmlMode-c89193ec.js} +3 -4
- package/dist/cjs/{index-b34238a6.js → index-4b7880ab.js} +9 -1
- package/dist/cjs/index.cjs.js +4 -3
- package/dist/cjs/{javascript-5115cb76.js → javascript-864c0220.js} +3 -4
- package/dist/cjs/{jsonMode-550dda36.js → jsonMode-ac4a7be7.js} +3 -4
- package/dist/cjs/{arcade-defaults-a8d8f8e2.js → language-defaults-base-57b37f9f.js} +842 -1183
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/sql-expr-defaults-245b036d.js +1347 -0
- package/dist/cjs/sql-expr-mode-304f5ce2.js +20844 -0
- package/dist/cjs/{tsMode-336306a9.js → tsMode-d30d4ab1.js} +4 -5
- package/dist/cjs/{typescript-b395242f.js → typescript-6c87ddb3.js} +3 -4
- package/dist/components/arcade-defaults.js +54 -1369
- package/dist/components/arcade-language-features.js +271 -0
- package/dist/components/arcade-mode.js +4 -264
- package/dist/components/arcade-results.js +7 -5
- package/dist/components/arcade-suggestions.js +7 -5
- package/dist/components/arcade-variables.js +8 -6
- package/dist/components/arcgis-arcade-editor.js +37 -35
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.js +1 -1
- package/dist/components/arcgis-assets.d.ts +1 -1
- package/dist/components/arcgis-assets.js +1 -1
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/arcgis-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-editor.js +120 -0
- package/dist/components/arcgis-sql-expression-fields.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-fields.js +11 -0
- package/dist/components/chunk-2JTWBRMN.js +1154 -0
- package/dist/components/code-editor.js +40 -13
- package/dist/components/fields.js +5 -5
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +30 -22
- package/dist/components/language-api-panel.js +13 -40
- package/dist/components/language-defaults-base.js +1309 -0
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +196 -0
- package/dist/components/sql-expr-mode.js +20842 -0
- package/dist/components/sql-expression-fields.js +102 -0
- package/dist/components/useT9n.js +45 -8
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-59faaf33.js → app-globals-6d0ca11d.js} +1 -1
- package/dist/esm/arcade-defaults-066445c4.js +344 -0
- package/dist/esm/arcade-language-features-0e00c199.js +269 -0
- package/dist/esm/{arcade-mode-5d46035e.js → arcade-mode-abf1e1cf.js} +3 -263
- package/dist/esm/arcgis-arcade-editor_6.entry.js +127 -1447
- package/dist/esm/arcgis-coding-components.js +5 -5
- package/dist/esm/arcgis-sql-expression-editor.entry.js +77 -0
- package/dist/esm/arcgis-sql-expression-fields.entry.js +76 -0
- package/dist/esm/{css-e257dc49.js → css-c6dae12d.js} +1 -1
- package/dist/esm/{cssMode-c11f7f40.js → cssMode-052bb603.js} +2 -3
- package/dist/esm/{html-a6c37a99.js → html-572696a1.js} +2 -3
- package/dist/esm/{htmlMode-1270bc7d.js → htmlMode-fc184f2d.js} +2 -3
- package/dist/esm/{index-a970952c.js → index-0edd9846.js} +9 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/{javascript-ee179624.js → javascript-8bfc0096.js} +3 -4
- package/dist/esm/{jsonMode-07502ccb.js → jsonMode-7adf94ff.js} +2 -3
- package/dist/esm/{arcade-defaults-9eb28407.js → language-defaults-base-85a7f476.js} +833 -1179
- package/dist/esm/loader.js +5 -5
- package/dist/esm/sql-expr-defaults-be84ec7f.js +1339 -0
- package/dist/esm/sql-expr-mode-a4413e5c.js +20840 -0
- package/dist/esm/{tsMode-96749a12.js → tsMode-d10773c8.js} +2 -3
- package/dist/esm/{typescript-a3cf9881.js → typescript-9491f23e.js} +2 -3
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +45 -10
- package/dist/types/components/arcade-results/arcade-results.d.ts +43 -1
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +22 -1
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +28 -1
- package/dist/types/components/code-editor/code-editor.d.ts +16 -5
- package/dist/types/components/language-api-panel/language-api-panel.d.ts +34 -8
- package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +24 -0
- package/dist/types/components/sql-expression-fields/sql-expression-fields.d.ts +32 -0
- package/dist/types/components.d.ts +98 -24
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +8 -1
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +5 -1
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/sql-expression-editor/sql-expression-editor.stories.d.ts +13 -0
- package/dist/types/dependencies.d.ts +6 -10
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
- package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
- package/dist/types/utils/fields.d.ts +2 -2
- package/dist/types/utils/language-defaults-base.d.ts +2 -9
- package/dist/types/utils/profile/editor-profile.d.ts +7 -6
- package/dist/types/utils/profile/types.d.ts +53 -65
- package/dist/types/utils/profile/utils.d.ts +9 -8
- package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +41 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +16 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +26 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +37 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +11 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +122 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +5 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +18 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +6 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +156 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +150 -0
- package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +1397 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +6 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +45 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +21 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +39 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-syntax.d.ts +8 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +43 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +34 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +100 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +41 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +17 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +24 -0
- package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +13 -0
- package/dist/types/utils/sql-expr-monaco/types.d.ts +89 -0
- package/package.json +27 -21
- package/dist/arcgis-coding-components/p-0c6de9b3.js +0 -6
- package/dist/arcgis-coding-components/p-81c37dab.entry.js +0 -6
- package/dist/cjs/arcade-mode-b85ae7d4.js +0 -595
- package/dist/components/chunk-IHYYRFLQ.js +0 -1363
- package/dist/types/components/arcade-editor/t9n-types.d.ts +0 -8
- package/dist/types/components/arcade-results/t9n-types.d.ts +0 -13
- package/dist/types/components/arcade-suggestions/t9n-types.d.ts +0 -6
- package/dist/types/components/arcade-variables/t9n-types.d.ts +0 -8
- package/dist/types/components/language-api-panel/t9n-types.d.ts +0 -8
- package/dist/types/utils/profile/predefined-profile.d.ts +0 -2
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.21
|
|
5
5
|
*/
|
|
6
|
-
import { g as getAssetPath } from './index-a970952c.js';
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Returns the last element of an array.
|
|
10
8
|
* @param array The array.
|
|
@@ -120594,7 +120592,7 @@ registerLanguage({
|
|
|
120594
120592
|
mimetypes: ["text/css"],
|
|
120595
120593
|
loader: () => {
|
|
120596
120594
|
{
|
|
120597
|
-
return import('./css-
|
|
120595
|
+
return import('./css-c6dae12d.js');
|
|
120598
120596
|
}
|
|
120599
120597
|
}
|
|
120600
120598
|
});
|
|
@@ -120612,7 +120610,7 @@ registerLanguage({
|
|
|
120612
120610
|
mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
|
|
120613
120611
|
loader: () => {
|
|
120614
120612
|
{
|
|
120615
|
-
return import('./html-
|
|
120613
|
+
return import('./html-572696a1.js');
|
|
120616
120614
|
}
|
|
120617
120615
|
}
|
|
120618
120616
|
});
|
|
@@ -120632,7 +120630,7 @@ registerLanguage({
|
|
|
120632
120630
|
mimetypes: ["text/javascript"],
|
|
120633
120631
|
loader: () => {
|
|
120634
120632
|
{
|
|
120635
|
-
return import('./javascript-
|
|
120633
|
+
return import('./javascript-8bfc0096.js');
|
|
120636
120634
|
}
|
|
120637
120635
|
}
|
|
120638
120636
|
});
|
|
@@ -120650,7 +120648,7 @@ registerLanguage({
|
|
|
120650
120648
|
mimetypes: ["text/typescript"],
|
|
120651
120649
|
loader: () => {
|
|
120652
120650
|
{
|
|
120653
|
-
return import('./typescript-
|
|
120651
|
+
return import('./typescript-9491f23e.js');
|
|
120654
120652
|
}
|
|
120655
120653
|
}
|
|
120656
120654
|
});
|
|
@@ -120769,19 +120767,19 @@ var cssDefaults = new LanguageServiceDefaultsImpl$3("css", optionsDefault$1, mod
|
|
|
120769
120767
|
var scssDefaults = new LanguageServiceDefaultsImpl$3("scss", optionsDefault$1, modeConfigurationDefault$2);
|
|
120770
120768
|
var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, modeConfigurationDefault$2);
|
|
120771
120769
|
monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
|
|
120772
|
-
function getMode$
|
|
120770
|
+
function getMode$3() {
|
|
120773
120771
|
{
|
|
120774
|
-
return import('./cssMode-
|
|
120772
|
+
return import('./cssMode-052bb603.js');
|
|
120775
120773
|
}
|
|
120776
120774
|
}
|
|
120777
120775
|
monaco_editor_core_exports$3.languages.onLanguage("less", () => {
|
|
120778
|
-
getMode$
|
|
120776
|
+
getMode$3().then((mode) => mode.setupMode(lessDefaults));
|
|
120779
120777
|
});
|
|
120780
120778
|
monaco_editor_core_exports$3.languages.onLanguage("scss", () => {
|
|
120781
|
-
getMode$
|
|
120779
|
+
getMode$3().then((mode) => mode.setupMode(scssDefaults));
|
|
120782
120780
|
});
|
|
120783
120781
|
monaco_editor_core_exports$3.languages.onLanguage("css", () => {
|
|
120784
|
-
getMode$
|
|
120782
|
+
getMode$3().then((mode) => mode.setupMode(cssDefaults));
|
|
120785
120783
|
});
|
|
120786
120784
|
|
|
120787
120785
|
/*!-----------------------------------------------------------------------------
|
|
@@ -120894,16 +120892,16 @@ monaco_editor_core_exports$2.languages.html = {
|
|
|
120894
120892
|
razorLanguageService,
|
|
120895
120893
|
registerHTMLLanguageService
|
|
120896
120894
|
};
|
|
120897
|
-
function getMode$
|
|
120895
|
+
function getMode$2() {
|
|
120898
120896
|
{
|
|
120899
|
-
return import('./htmlMode-
|
|
120897
|
+
return import('./htmlMode-fc184f2d.js');
|
|
120900
120898
|
}
|
|
120901
120899
|
}
|
|
120902
120900
|
function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
|
|
120903
120901
|
const defaults = new LanguageServiceDefaultsImpl$2(languageId, options, modeConfiguration);
|
|
120904
120902
|
let mode;
|
|
120905
120903
|
const onLanguageListener = monaco_editor_core_exports$2.languages.onLanguage(languageId, async () => {
|
|
120906
|
-
mode = (await getMode$
|
|
120904
|
+
mode = (await getMode$2()).setupMode(defaults);
|
|
120907
120905
|
});
|
|
120908
120906
|
return {
|
|
120909
120907
|
defaults,
|
|
@@ -120996,9 +120994,9 @@ var modeConfigurationDefault$1 = {
|
|
|
120996
120994
|
};
|
|
120997
120995
|
var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault, modeConfigurationDefault$1);
|
|
120998
120996
|
monaco_editor_core_exports$1.languages.json = { jsonDefaults };
|
|
120999
|
-
function getMode$
|
|
120997
|
+
function getMode$1() {
|
|
121000
120998
|
{
|
|
121001
|
-
return import('./jsonMode-
|
|
120999
|
+
return import('./jsonMode-7adf94ff.js');
|
|
121002
121000
|
}
|
|
121003
121001
|
}
|
|
121004
121002
|
monaco_editor_core_exports$1.languages.register({
|
|
@@ -121008,7 +121006,7 @@ monaco_editor_core_exports$1.languages.register({
|
|
|
121008
121006
|
mimetypes: ["application/json"]
|
|
121009
121007
|
});
|
|
121010
121008
|
monaco_editor_core_exports$1.languages.onLanguage("json", () => {
|
|
121011
|
-
getMode$
|
|
121009
|
+
getMode$1().then((mode) => mode.setupMode(jsonDefaults));
|
|
121012
121010
|
});
|
|
121013
121011
|
|
|
121014
121012
|
/*!-----------------------------------------------------------------------------
|
|
@@ -121248,10 +121246,10 @@ var modeConfigurationDefault = {
|
|
|
121248
121246
|
var typescriptDefaults = new LanguageServiceDefaultsImpl({ allowNonTsExtensions: true, target: 99 /* Latest */ }, { noSemanticValidation: false, noSyntaxValidation: false, onlyVisible: false }, {}, {}, modeConfigurationDefault);
|
|
121249
121247
|
var javascriptDefaults = new LanguageServiceDefaultsImpl({ allowNonTsExtensions: true, allowJs: true, target: 99 /* Latest */ }, { noSemanticValidation: true, noSyntaxValidation: false, onlyVisible: false }, {}, {}, modeConfigurationDefault);
|
|
121250
121248
|
var getTypeScriptWorker = () => {
|
|
121251
|
-
return getMode
|
|
121249
|
+
return getMode().then((mode) => mode.getTypeScriptWorker());
|
|
121252
121250
|
};
|
|
121253
121251
|
var getJavaScriptWorker = () => {
|
|
121254
|
-
return getMode
|
|
121252
|
+
return getMode().then((mode) => mode.getJavaScriptWorker());
|
|
121255
121253
|
};
|
|
121256
121254
|
monaco_editor_core_exports.languages.typescript = {
|
|
121257
121255
|
ModuleKind,
|
|
@@ -121265,16 +121263,16 @@ monaco_editor_core_exports.languages.typescript = {
|
|
|
121265
121263
|
getTypeScriptWorker,
|
|
121266
121264
|
getJavaScriptWorker
|
|
121267
121265
|
};
|
|
121268
|
-
function getMode
|
|
121266
|
+
function getMode() {
|
|
121269
121267
|
{
|
|
121270
|
-
return import('./tsMode-
|
|
121268
|
+
return import('./tsMode-d10773c8.js');
|
|
121271
121269
|
}
|
|
121272
121270
|
}
|
|
121273
121271
|
monaco_editor_core_exports.languages.onLanguage("typescript", () => {
|
|
121274
|
-
return getMode
|
|
121272
|
+
return getMode().then((mode) => mode.setupTypeScript(typescriptDefaults));
|
|
121275
121273
|
});
|
|
121276
121274
|
monaco_editor_core_exports.languages.onLanguage("javascript", () => {
|
|
121277
|
-
return getMode
|
|
121275
|
+
return getMode().then((mode) => mode.setupJavaScript(javascriptDefaults));
|
|
121278
121276
|
});
|
|
121279
121277
|
|
|
121280
121278
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -166714,6 +166712,760 @@ class ToggleHighContrast extends EditorAction {
|
|
|
166714
166712
|
}
|
|
166715
166713
|
registerEditorAction(ToggleHighContrast);
|
|
166716
166714
|
|
|
166715
|
+
// src/index.ts
|
|
166716
|
+
var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis && !("forceESM" in window.$arcgis);
|
|
166717
|
+
function isDefaultModule(module) {
|
|
166718
|
+
return module.default !== void 0;
|
|
166719
|
+
}
|
|
166720
|
+
async function importLayersFeatureLayer() {
|
|
166721
|
+
if (isAMD) {
|
|
166722
|
+
return await window.$arcgis.import("esri/layers/FeatureLayer");
|
|
166723
|
+
}
|
|
166724
|
+
const module = await import('@arcgis/core/layers/FeatureLayer.js');
|
|
166725
|
+
return isDefaultModule(module) ? module.default : module;
|
|
166726
|
+
}
|
|
166727
|
+
async function newLayersFeatureLayer(properties) {
|
|
166728
|
+
const ModConstructor = await importLayersFeatureLayer();
|
|
166729
|
+
return new ModConstructor(properties);
|
|
166730
|
+
}
|
|
166731
|
+
async function importPortalPortalItem() {
|
|
166732
|
+
if (isAMD) {
|
|
166733
|
+
return await window.$arcgis.import("esri/portal/PortalItem");
|
|
166734
|
+
}
|
|
166735
|
+
const module = await import('@arcgis/core/portal/PortalItem.js');
|
|
166736
|
+
return isDefaultModule(module) ? module.default : module;
|
|
166737
|
+
}
|
|
166738
|
+
async function newPortalPortalItem(properties) {
|
|
166739
|
+
const ModConstructor = await importPortalPortalItem();
|
|
166740
|
+
return new ModConstructor(properties);
|
|
166741
|
+
}
|
|
166742
|
+
async function importWebMap() {
|
|
166743
|
+
if (isAMD) {
|
|
166744
|
+
return await window.$arcgis.import("esri/WebMap");
|
|
166745
|
+
}
|
|
166746
|
+
const module = await import('@arcgis/core/WebMap.js');
|
|
166747
|
+
return isDefaultModule(module) ? module.default : module;
|
|
166748
|
+
}
|
|
166749
|
+
async function newWebMap(properties) {
|
|
166750
|
+
const ModConstructor = await importWebMap();
|
|
166751
|
+
return new ModConstructor(properties);
|
|
166752
|
+
}
|
|
166753
|
+
async function importWebScene() {
|
|
166754
|
+
if (isAMD) {
|
|
166755
|
+
return await window.$arcgis.import("esri/WebScene");
|
|
166756
|
+
}
|
|
166757
|
+
const module = await import('@arcgis/core/WebScene.js');
|
|
166758
|
+
return isDefaultModule(module) ? module.default : module;
|
|
166759
|
+
}
|
|
166760
|
+
async function newWebScene(properties) {
|
|
166761
|
+
const ModConstructor = await importWebScene();
|
|
166762
|
+
return new ModConstructor(properties);
|
|
166763
|
+
}
|
|
166764
|
+
async function importArcade() {
|
|
166765
|
+
if (isAMD) {
|
|
166766
|
+
return await window.$arcgis.import("esri/arcade");
|
|
166767
|
+
}
|
|
166768
|
+
const module = await import('@arcgis/core/arcade.js');
|
|
166769
|
+
return isDefaultModule(module) ? module.default : module;
|
|
166770
|
+
}
|
|
166771
|
+
async function importRequest() {
|
|
166772
|
+
if (isAMD) {
|
|
166773
|
+
return await window.$arcgis.import("esri/request");
|
|
166774
|
+
}
|
|
166775
|
+
const module = await import('@arcgis/core/request.js');
|
|
166776
|
+
return isDefaultModule(module) ? module.default : module;
|
|
166777
|
+
}
|
|
166778
|
+
|
|
166779
|
+
//#region Type Guards
|
|
166780
|
+
function isFeatureLayerLikeInstance(item) {
|
|
166781
|
+
return (!!item &&
|
|
166782
|
+
typeof item === "object" &&
|
|
166783
|
+
"declaredClass" in item &&
|
|
166784
|
+
typeof item.declaredClass === "string" &&
|
|
166785
|
+
item.declaredClass.startsWith("esri.layers.") &&
|
|
166786
|
+
isFieldsDefinition(item) &&
|
|
166787
|
+
"queryFeatures" in item &&
|
|
166788
|
+
typeof item.queryFeatures === "function");
|
|
166789
|
+
}
|
|
166790
|
+
function isGroupLayerCapable(item) {
|
|
166791
|
+
return (!!item &&
|
|
166792
|
+
typeof item === "object" &&
|
|
166793
|
+
"allLayers" in item &&
|
|
166794
|
+
"allTables" in item &&
|
|
166795
|
+
typeof item.allLayers === "object" &&
|
|
166796
|
+
typeof item.allTables === "object");
|
|
166797
|
+
}
|
|
166798
|
+
function isMapInstance(item) {
|
|
166799
|
+
return (!!item &&
|
|
166800
|
+
typeof item === "object" &&
|
|
166801
|
+
"declaredClass" in item &&
|
|
166802
|
+
typeof item.declaredClass === "string" &&
|
|
166803
|
+
(item.declaredClass === "esri.Map" ||
|
|
166804
|
+
item.declaredClass === "esri.WebMap" ||
|
|
166805
|
+
item.declaredClass === "esri.WebScene"));
|
|
166806
|
+
}
|
|
166807
|
+
function isLoadAllCapable(item) {
|
|
166808
|
+
return !!item && typeof item === "object" && "loadAll" in item && typeof item.loadAll === "function";
|
|
166809
|
+
}
|
|
166810
|
+
function isPortalItemDefinition(item) {
|
|
166811
|
+
return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
|
|
166812
|
+
}
|
|
166813
|
+
function isFeatureLayerItemDefinition(item) {
|
|
166814
|
+
return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
|
|
166815
|
+
}
|
|
166816
|
+
function isFieldsDefinition(item) {
|
|
166817
|
+
return !!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields);
|
|
166818
|
+
}
|
|
166819
|
+
function isUrlDefinition(item) {
|
|
166820
|
+
return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
|
|
166821
|
+
}
|
|
166822
|
+
function isSupportedServiceUrlDefinition(item) {
|
|
166823
|
+
return isUrlDefinition(item) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(item.url);
|
|
166824
|
+
}
|
|
166825
|
+
function isFeatureDefinition(item) {
|
|
166826
|
+
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
166827
|
+
}
|
|
166828
|
+
function isFeatureSetDefinition(item) {
|
|
166829
|
+
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
166830
|
+
}
|
|
166831
|
+
function isFeatureSetCollectionDefinition(item) {
|
|
166832
|
+
return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
|
|
166833
|
+
}
|
|
166834
|
+
function isSubtypeInstance(item) {
|
|
166835
|
+
return (!!item &&
|
|
166836
|
+
typeof item === "object" &&
|
|
166837
|
+
"declaredClass" in item &&
|
|
166838
|
+
item.declaredClass === "esri.layers.support.Subtype");
|
|
166839
|
+
}
|
|
166840
|
+
function isCodedValueDomainInstance(item) {
|
|
166841
|
+
return (!!item &&
|
|
166842
|
+
typeof item === "object" &&
|
|
166843
|
+
"declaredClass" in item &&
|
|
166844
|
+
item.declaredClass === "esri.layers.support.CodedValueDomain");
|
|
166845
|
+
}
|
|
166846
|
+
function isInheritedDomainInstance(item) {
|
|
166847
|
+
return (!!item &&
|
|
166848
|
+
typeof item === "object" &&
|
|
166849
|
+
"declaredClass" in item &&
|
|
166850
|
+
item.declaredClass === "esri.layers.support.InheritedDomain");
|
|
166851
|
+
}
|
|
166852
|
+
function isPredefinedProfile(item) {
|
|
166853
|
+
return (!!item &&
|
|
166854
|
+
typeof item === "object" &&
|
|
166855
|
+
"id" in item &&
|
|
166856
|
+
typeof item.id === "string" &&
|
|
166857
|
+
"definitions" in item &&
|
|
166858
|
+
typeof item.definitions === "object" &&
|
|
166859
|
+
!Array.isArray(item.definitions));
|
|
166860
|
+
}
|
|
166861
|
+
function isTitleCapableSource(item) {
|
|
166862
|
+
return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
|
|
166863
|
+
}
|
|
166864
|
+
function isUrlCapableSource(item) {
|
|
166865
|
+
return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
|
|
166866
|
+
}
|
|
166867
|
+
function isLayerIdCapableSource(item) {
|
|
166868
|
+
return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
|
|
166869
|
+
}
|
|
166870
|
+
function isFeatureTypesCapableLayer(item) {
|
|
166871
|
+
return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
|
|
166872
|
+
}
|
|
166873
|
+
function isDomainsCapableLayer(item) {
|
|
166874
|
+
return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
|
|
166875
|
+
}
|
|
166876
|
+
function isSubtypeFieldCapableLayer(item) {
|
|
166877
|
+
return !!item && typeof item === "object" && "subtypeField" in item;
|
|
166878
|
+
}
|
|
166879
|
+
function isSubtypesCapableLayer(item) {
|
|
166880
|
+
return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
|
|
166881
|
+
}
|
|
166882
|
+
function isPortalItemCapable(item) {
|
|
166883
|
+
return !!item && typeof item === "object" && "portalItem" in item;
|
|
166884
|
+
}
|
|
166885
|
+
function isRelationshipsCapableLayer(item) {
|
|
166886
|
+
return (isLayerIdCapableSource(item) &&
|
|
166887
|
+
"relationships" in item &&
|
|
166888
|
+
"url" in item &&
|
|
166889
|
+
Array.isArray(item.relationships) &&
|
|
166890
|
+
typeof item.url === "string");
|
|
166891
|
+
}
|
|
166892
|
+
function isTableCapableLayer(item) {
|
|
166893
|
+
return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
|
|
166894
|
+
}
|
|
166895
|
+
function isLoadableSource(item) {
|
|
166896
|
+
return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
|
|
166897
|
+
}
|
|
166898
|
+
//#endregion
|
|
166899
|
+
//#region Service Metadata
|
|
166900
|
+
async function supportedSourceFromDefinition(definition) {
|
|
166901
|
+
if (!definition) {
|
|
166902
|
+
return null;
|
|
166903
|
+
}
|
|
166904
|
+
let source = null;
|
|
166905
|
+
if (isFieldsDefinition(definition)) {
|
|
166906
|
+
source = definition;
|
|
166907
|
+
}
|
|
166908
|
+
else {
|
|
166909
|
+
source = await newLayersFeatureLayer(definition);
|
|
166910
|
+
}
|
|
166911
|
+
if (isLoadableSource(source)) {
|
|
166912
|
+
await source.load();
|
|
166913
|
+
}
|
|
166914
|
+
return source;
|
|
166915
|
+
}
|
|
166916
|
+
async function serviceMetaData(url) {
|
|
166917
|
+
url += "/layers";
|
|
166918
|
+
const request = await importRequest();
|
|
166919
|
+
const response = await request(url, { responseType: "json", query: { f: "json" } });
|
|
166920
|
+
const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
|
|
166921
|
+
const layers = getSupportedLayerInfos(response.data?.layers, queryCapability);
|
|
166922
|
+
const tables = getSupportedLayerInfos(response.data?.tables, queryCapability);
|
|
166923
|
+
return { layers, tables };
|
|
166924
|
+
}
|
|
166925
|
+
function getSupportedLayerInfos(layers, queryCapability) {
|
|
166926
|
+
if (!layers) {
|
|
166927
|
+
return [];
|
|
166928
|
+
}
|
|
166929
|
+
return layers.filter((layer) => {
|
|
166930
|
+
switch (layer.type) {
|
|
166931
|
+
case "Feature Layer":
|
|
166932
|
+
case "Oriented Imagery Layer":
|
|
166933
|
+
case "Catalog Layer":
|
|
166934
|
+
case "Table": {
|
|
166935
|
+
const capabilities = layer.capabilities
|
|
166936
|
+
? layer.capabilities
|
|
166937
|
+
.toLowerCase()
|
|
166938
|
+
.split(",")
|
|
166939
|
+
.map((value) => value.trim())
|
|
166940
|
+
: [];
|
|
166941
|
+
return capabilities.includes(queryCapability);
|
|
166942
|
+
}
|
|
166943
|
+
default:
|
|
166944
|
+
return false;
|
|
166945
|
+
}
|
|
166946
|
+
});
|
|
166947
|
+
}
|
|
166948
|
+
//#endregion
|
|
166949
|
+
|
|
166950
|
+
// src/array-utils.ts
|
|
166951
|
+
|
|
166952
|
+
// src/deferred.ts
|
|
166953
|
+
var Deferred = class {
|
|
166954
|
+
/**
|
|
166955
|
+
* Resolves the promise.
|
|
166956
|
+
* @param value The value to resolve the promise with.
|
|
166957
|
+
*/
|
|
166958
|
+
resolve(_value) {
|
|
166959
|
+
}
|
|
166960
|
+
/**
|
|
166961
|
+
* Rejects the promise.
|
|
166962
|
+
*/
|
|
166963
|
+
reject(_error) {
|
|
166964
|
+
}
|
|
166965
|
+
/**
|
|
166966
|
+
* Creates a new deferred promise.
|
|
166967
|
+
*/
|
|
166968
|
+
constructor() {
|
|
166969
|
+
this.promise = new Promise((resolve, reject) => {
|
|
166970
|
+
this.resolve = resolve;
|
|
166971
|
+
this.reject = reject;
|
|
166972
|
+
});
|
|
166973
|
+
}
|
|
166974
|
+
};
|
|
166975
|
+
|
|
166976
|
+
// src/dom.ts
|
|
166977
|
+
function inTargetElement(element, targetElement) {
|
|
166978
|
+
let currentElement = element;
|
|
166979
|
+
while (currentElement) {
|
|
166980
|
+
if (currentElement === targetElement) {
|
|
166981
|
+
return true;
|
|
166982
|
+
}
|
|
166983
|
+
if (!currentElement.parentNode) {
|
|
166984
|
+
return false;
|
|
166985
|
+
}
|
|
166986
|
+
if (currentElement.parentNode instanceof ShadowRoot) {
|
|
166987
|
+
currentElement = currentElement.parentNode.host;
|
|
166988
|
+
} else {
|
|
166989
|
+
currentElement = currentElement.parentNode;
|
|
166990
|
+
}
|
|
166991
|
+
}
|
|
166992
|
+
return false;
|
|
166993
|
+
}
|
|
166994
|
+
function observeAncestorsMutation(element, attributeFilter, callback) {
|
|
166995
|
+
const { subscribe } = observe(attributeFilter);
|
|
166996
|
+
return subscribe((mutations) => {
|
|
166997
|
+
const matched = mutations.some((mutation) => inTargetElement(element, mutation.target));
|
|
166998
|
+
if (matched) {
|
|
166999
|
+
callback();
|
|
167000
|
+
}
|
|
167001
|
+
});
|
|
167002
|
+
}
|
|
167003
|
+
var observers = {};
|
|
167004
|
+
function observe(attributeFilter) {
|
|
167005
|
+
const attributes = attributeFilter.join(",");
|
|
167006
|
+
const previousObserver = observers[attributes];
|
|
167007
|
+
if (previousObserver !== void 0) {
|
|
167008
|
+
return previousObserver;
|
|
167009
|
+
}
|
|
167010
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
167011
|
+
const mutationObserver = new MutationObserver((mutations) => subscribers.forEach((callback) => callback(mutations)));
|
|
167012
|
+
mutationObserver.observe(document.documentElement, {
|
|
167013
|
+
attributes: true,
|
|
167014
|
+
attributeFilter,
|
|
167015
|
+
subtree: true
|
|
167016
|
+
});
|
|
167017
|
+
const observer = {
|
|
167018
|
+
subscribe(callback) {
|
|
167019
|
+
subscribers.add(callback);
|
|
167020
|
+
return {
|
|
167021
|
+
remove: () => {
|
|
167022
|
+
subscribers.delete(callback);
|
|
167023
|
+
if (subscribers.size === 0) {
|
|
167024
|
+
mutationObserver.disconnect();
|
|
167025
|
+
observers[attributes] = void 0;
|
|
167026
|
+
}
|
|
167027
|
+
}
|
|
167028
|
+
};
|
|
167029
|
+
}
|
|
167030
|
+
};
|
|
167031
|
+
observers[attributes] = observer;
|
|
167032
|
+
return observer;
|
|
167033
|
+
}
|
|
167034
|
+
function closestElement(base, selector) {
|
|
167035
|
+
let currentElement = base;
|
|
167036
|
+
while (currentElement) {
|
|
167037
|
+
const element = currentElement.closest(selector);
|
|
167038
|
+
if (element) {
|
|
167039
|
+
return element;
|
|
167040
|
+
}
|
|
167041
|
+
const rootElement = currentElement.getRootNode();
|
|
167042
|
+
if (rootElement === document) {
|
|
167043
|
+
return null;
|
|
167044
|
+
}
|
|
167045
|
+
currentElement = rootElement.host;
|
|
167046
|
+
}
|
|
167047
|
+
return null;
|
|
167048
|
+
}
|
|
167049
|
+
function getElementTheme(base) {
|
|
167050
|
+
const themeElt = closestElement(base, ":is(.calcite-mode-light, .calcite-mode-dark)");
|
|
167051
|
+
return themeElt && themeElt.classList.contains("calcite-mode-dark") ? "dark" : "light";
|
|
167052
|
+
}
|
|
167053
|
+
function getElementAttribute(el, prop, fallbackValue) {
|
|
167054
|
+
const closest = closestElement(el, `[${prop}]`);
|
|
167055
|
+
return closest?.getAttribute(prop) ?? fallbackValue;
|
|
167056
|
+
}
|
|
167057
|
+
function isElement(ref) {
|
|
167058
|
+
return ref.nodeType === Node.ELEMENT_NODE;
|
|
167059
|
+
}
|
|
167060
|
+
function isHTMLWithSetFocus(ref) {
|
|
167061
|
+
return "setFocus" in ref && typeof ref.setFocus === "function";
|
|
167062
|
+
}
|
|
167063
|
+
function setFocus(ref, selector = "") {
|
|
167064
|
+
if (!isElement(ref)) {
|
|
167065
|
+
return false;
|
|
167066
|
+
}
|
|
167067
|
+
if (ref.matches(selector)) {
|
|
167068
|
+
if (isHTMLWithSetFocus(ref)) {
|
|
167069
|
+
setTimeout(() => ref.setFocus(), 0);
|
|
167070
|
+
}
|
|
167071
|
+
return true;
|
|
167072
|
+
}
|
|
167073
|
+
for (const child of ref.children) {
|
|
167074
|
+
if (setFocus(child, selector)) {
|
|
167075
|
+
return true;
|
|
167076
|
+
}
|
|
167077
|
+
}
|
|
167078
|
+
const shadowRoot = ref.shadowRoot;
|
|
167079
|
+
if (shadowRoot) {
|
|
167080
|
+
for (const child of shadowRoot.children) {
|
|
167081
|
+
if (setFocus(child, selector)) {
|
|
167082
|
+
return true;
|
|
167083
|
+
}
|
|
167084
|
+
}
|
|
167085
|
+
}
|
|
167086
|
+
return false;
|
|
167087
|
+
}
|
|
167088
|
+
function setFocusOnElement(ref, selector) {
|
|
167089
|
+
if (!ref?.shadowRoot) {
|
|
167090
|
+
return;
|
|
167091
|
+
}
|
|
167092
|
+
if (ref.hasAttribute("hydrated") || ref.hasAttribute("calcite-hydrated")) {
|
|
167093
|
+
setFocus(ref, selector);
|
|
167094
|
+
return;
|
|
167095
|
+
}
|
|
167096
|
+
const mutationObserver = new MutationObserver(() => {
|
|
167097
|
+
mutationObserver.disconnect();
|
|
167098
|
+
setFocus(ref, selector);
|
|
167099
|
+
});
|
|
167100
|
+
mutationObserver.observe(ref, {
|
|
167101
|
+
attributes: true,
|
|
167102
|
+
attributeFilter: ["hydrated", "calcite-hydrated"]
|
|
167103
|
+
});
|
|
167104
|
+
}
|
|
167105
|
+
|
|
167106
|
+
// src/errors.ts
|
|
167107
|
+
function safeCall(callback, thisContext, ...rest) {
|
|
167108
|
+
try {
|
|
167109
|
+
return callback?.call(thisContext, ...rest);
|
|
167110
|
+
} catch (error) {
|
|
167111
|
+
console.error(error, callback);
|
|
167112
|
+
}
|
|
167113
|
+
return void 0;
|
|
167114
|
+
}
|
|
167115
|
+
async function safeAsyncCall(callback, thisContext, ...rest) {
|
|
167116
|
+
try {
|
|
167117
|
+
const result = callback?.call(thisContext, ...rest);
|
|
167118
|
+
return result instanceof Promise ? await result : result;
|
|
167119
|
+
} catch (error) {
|
|
167120
|
+
console.error(error, callback);
|
|
167121
|
+
}
|
|
167122
|
+
return void 0;
|
|
167123
|
+
}
|
|
167124
|
+
|
|
167125
|
+
// src/guid.ts
|
|
167126
|
+
function gen(count) {
|
|
167127
|
+
let out = "";
|
|
167128
|
+
for (let i = 0; i < count; i++) {
|
|
167129
|
+
out += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
167130
|
+
}
|
|
167131
|
+
return out;
|
|
167132
|
+
}
|
|
167133
|
+
function generateGuid() {
|
|
167134
|
+
return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
|
|
167135
|
+
}
|
|
167136
|
+
|
|
167137
|
+
// src/intl.ts
|
|
167138
|
+
var supportedLocalesArray = [
|
|
167139
|
+
"ar",
|
|
167140
|
+
"bg",
|
|
167141
|
+
"bs",
|
|
167142
|
+
"ca",
|
|
167143
|
+
"cs",
|
|
167144
|
+
"da",
|
|
167145
|
+
"de",
|
|
167146
|
+
"el",
|
|
167147
|
+
"en",
|
|
167148
|
+
"es",
|
|
167149
|
+
"et",
|
|
167150
|
+
"fi",
|
|
167151
|
+
"fr",
|
|
167152
|
+
"he",
|
|
167153
|
+
"hr",
|
|
167154
|
+
"hu",
|
|
167155
|
+
"id",
|
|
167156
|
+
"it",
|
|
167157
|
+
"ja",
|
|
167158
|
+
"ko",
|
|
167159
|
+
"lt",
|
|
167160
|
+
"lv",
|
|
167161
|
+
"nl",
|
|
167162
|
+
"nb",
|
|
167163
|
+
"pl",
|
|
167164
|
+
"pt-BR",
|
|
167165
|
+
"pt-PT",
|
|
167166
|
+
"ro",
|
|
167167
|
+
"ru",
|
|
167168
|
+
"sk",
|
|
167169
|
+
"sl",
|
|
167170
|
+
"sr",
|
|
167171
|
+
"sv",
|
|
167172
|
+
"th",
|
|
167173
|
+
"tr",
|
|
167174
|
+
"uk",
|
|
167175
|
+
"vi",
|
|
167176
|
+
"zh-CN",
|
|
167177
|
+
"zh-HK",
|
|
167178
|
+
"zh-TW"
|
|
167179
|
+
];
|
|
167180
|
+
var supportedLocales = new Set(supportedLocalesArray);
|
|
167181
|
+
var defaultLocale = "en";
|
|
167182
|
+
var localeEquivalencies = {
|
|
167183
|
+
// We use `pt-BR` as it will have the same translations as `pt`, which has no corresponding bundle
|
|
167184
|
+
pt: "pt-PT",
|
|
167185
|
+
// We support both 'nb' and 'no' (BCP 47) for Norwegian but only `nb` has corresponding bundle
|
|
167186
|
+
no: "nb",
|
|
167187
|
+
// We can `zh-CN` as base translation for chinese locales which has no corresponding bundle.
|
|
167188
|
+
zh: "zh-CN"
|
|
167189
|
+
};
|
|
167190
|
+
async function fetchT9nStringsBundle(locale, assetsPath, prefix = "") {
|
|
167191
|
+
const path = `${assetsPath}/${prefix}`;
|
|
167192
|
+
const filePath = `${path}${locale}.json`;
|
|
167193
|
+
t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
|
|
167194
|
+
return await t9nStringsCache[filePath];
|
|
167195
|
+
}
|
|
167196
|
+
var t9nStringsCache = {};
|
|
167197
|
+
async function fetchBundle(locale, path) {
|
|
167198
|
+
const filePath = `${path}${locale}.json`;
|
|
167199
|
+
try {
|
|
167200
|
+
const response = await fetch(filePath);
|
|
167201
|
+
if (response.ok) {
|
|
167202
|
+
return await response.json();
|
|
167203
|
+
}
|
|
167204
|
+
} catch (error) {
|
|
167205
|
+
console.error(error);
|
|
167206
|
+
return {};
|
|
167207
|
+
}
|
|
167208
|
+
if (locale === defaultLocale) {
|
|
167209
|
+
return {};
|
|
167210
|
+
}
|
|
167211
|
+
return await fetchBundle(defaultLocale, path);
|
|
167212
|
+
}
|
|
167213
|
+
function getElementLocales(element) {
|
|
167214
|
+
const lang = getElementAttribute(element, "lang", navigator.language || defaultLocale);
|
|
167215
|
+
return { lang, t9nLocale: langToLocale(lang) };
|
|
167216
|
+
}
|
|
167217
|
+
function langToLocale(lang) {
|
|
167218
|
+
const parts = lang.split("-");
|
|
167219
|
+
const normalized = `${parts[0].toLowerCase()}${parts.slice(1).join("-").toUpperCase()}`;
|
|
167220
|
+
if (supportedLocales.has(normalized)) {
|
|
167221
|
+
return normalized;
|
|
167222
|
+
}
|
|
167223
|
+
const languageCode = normalized.slice(0, 2).toLowerCase();
|
|
167224
|
+
const locale = localeEquivalencies[languageCode] ?? languageCode;
|
|
167225
|
+
if (supportedLocales.has(locale)) {
|
|
167226
|
+
return locale;
|
|
167227
|
+
}
|
|
167228
|
+
return defaultLocale;
|
|
167229
|
+
}
|
|
167230
|
+
function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
|
|
167231
|
+
let result = void 0;
|
|
167232
|
+
const callback = () => void updateComponentLocateState(element, assetsPath, assetName).then((newResult) => {
|
|
167233
|
+
if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
|
|
167234
|
+
onUpdated(newResult);
|
|
167235
|
+
}
|
|
167236
|
+
result = newResult;
|
|
167237
|
+
}).catch(console.error);
|
|
167238
|
+
callback();
|
|
167239
|
+
return observeAncestorsMutation(element, ["lang"], callback);
|
|
167240
|
+
}
|
|
167241
|
+
async function updateComponentLocateState(element, assetsPath, assetName = element.tagName.toLowerCase().replace("arcgis-", "")) {
|
|
167242
|
+
const { lang, t9nLocale } = getElementLocales(element);
|
|
167243
|
+
const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
|
|
167244
|
+
const prefix = `${assetName}.t9n.`;
|
|
167245
|
+
const t9nStrings = await fetchT9nStringsBundle(t9nLocale, t9nAssetsPath, prefix);
|
|
167246
|
+
return { lang, t9nLocale, t9nStrings };
|
|
167247
|
+
}
|
|
167248
|
+
|
|
167249
|
+
// src/strings.ts
|
|
167250
|
+
var doubleQuote = '"';
|
|
167251
|
+
var singleQuote = "'";
|
|
167252
|
+
function repeatString(value, n) {
|
|
167253
|
+
return new Array(n + 1).join(value);
|
|
167254
|
+
}
|
|
167255
|
+
function quoteString(value) {
|
|
167256
|
+
let quote = doubleQuote;
|
|
167257
|
+
let alternateQuote = singleQuote;
|
|
167258
|
+
const avoidEscape = value.includes(quote) && !value.includes(alternateQuote);
|
|
167259
|
+
if (avoidEscape) {
|
|
167260
|
+
alternateQuote = doubleQuote;
|
|
167261
|
+
quote = singleQuote;
|
|
167262
|
+
}
|
|
167263
|
+
const alternateEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${alternateQuote})+)`, "gu");
|
|
167264
|
+
value = value.replace(
|
|
167265
|
+
alternateEscape,
|
|
167266
|
+
(_, boundaryChar, leadingEscapedSlashes, escapedQuoteChars) => (
|
|
167267
|
+
// We divide the escapedQuoteChars by 2 since there are 2 characters in each escaped part ('\\"'.length === 2)
|
|
167268
|
+
boundaryChar + leadingEscapedSlashes + repeatString(alternateQuote, escapedQuoteChars.length / 2)
|
|
167269
|
+
)
|
|
167270
|
+
);
|
|
167271
|
+
const quoteEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${quote}+)`, "gu");
|
|
167272
|
+
value = value.replace(
|
|
167273
|
+
quoteEscape,
|
|
167274
|
+
(_, boundaryChar, leadingEscapedSlashes, quoteChars) => boundaryChar + leadingEscapedSlashes + repeatString(`\\${quote}`, quoteChars.length)
|
|
167275
|
+
);
|
|
167276
|
+
return quote + value + quote;
|
|
167277
|
+
}
|
|
167278
|
+
function createFilterExpression(filterWord) {
|
|
167279
|
+
const sanitizedWord = filterWord ? filterWord.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu, "\\$&") : "^.*$";
|
|
167280
|
+
return new RegExp(sanitizedWord, "i");
|
|
167281
|
+
}
|
|
167282
|
+
function setValuesInString(message, values = {}) {
|
|
167283
|
+
return (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
|
|
167284
|
+
}
|
|
167285
|
+
function addLTRMark(value) {
|
|
167286
|
+
return `\u200E${value ?? ""}\u200E`;
|
|
167287
|
+
}
|
|
167288
|
+
|
|
167289
|
+
// src/timeouts.ts
|
|
167290
|
+
function devToolsAwareTimeout(callback, timeout) {
|
|
167291
|
+
const interval = timeout > longTimeoutThreshold ? longTimeoutInterval : timeout / shortTimeoutIntervals;
|
|
167292
|
+
let elapsed = 0;
|
|
167293
|
+
const reference = setInterval(() => {
|
|
167294
|
+
elapsed += interval;
|
|
167295
|
+
if (elapsed >= timeout) {
|
|
167296
|
+
clearInterval(reference);
|
|
167297
|
+
callback();
|
|
167298
|
+
}
|
|
167299
|
+
}, interval);
|
|
167300
|
+
return reference;
|
|
167301
|
+
}
|
|
167302
|
+
var longTimeoutThreshold = 4e3;
|
|
167303
|
+
var longTimeoutInterval = 2e3;
|
|
167304
|
+
var shortTimeoutIntervals = 4;
|
|
167305
|
+
|
|
167306
|
+
// src/type-guards.ts
|
|
167307
|
+
function isNotNull(item) {
|
|
167308
|
+
return item !== null;
|
|
167309
|
+
}
|
|
167310
|
+
function isNotUndefined(item) {
|
|
167311
|
+
return item !== void 0;
|
|
167312
|
+
}
|
|
167313
|
+
|
|
167314
|
+
// src/ui.ts
|
|
167315
|
+
function debounce(func, waitFor = 100) {
|
|
167316
|
+
let timeout;
|
|
167317
|
+
return (...args) => {
|
|
167318
|
+
const later = () => {
|
|
167319
|
+
clearTimeout(timeout);
|
|
167320
|
+
func(...args);
|
|
167321
|
+
};
|
|
167322
|
+
clearTimeout(timeout);
|
|
167323
|
+
timeout = setTimeout(later, waitFor);
|
|
167324
|
+
};
|
|
167325
|
+
}
|
|
167326
|
+
|
|
167327
|
+
// src/url.ts
|
|
167328
|
+
function hasSameOrigin(url1, url2, ignoreProtocol = false) {
|
|
167329
|
+
if (!url1 || !url2) {
|
|
167330
|
+
return false;
|
|
167331
|
+
}
|
|
167332
|
+
const url1Obj = new URL(url1);
|
|
167333
|
+
const url2Obj = new URL(url2);
|
|
167334
|
+
if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
|
|
167335
|
+
return false;
|
|
167336
|
+
}
|
|
167337
|
+
if (url1Obj.host == null || url2Obj.host == null) {
|
|
167338
|
+
return false;
|
|
167339
|
+
}
|
|
167340
|
+
return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
|
|
167341
|
+
}
|
|
167342
|
+
function isURL(url) {
|
|
167343
|
+
try {
|
|
167344
|
+
new URL(url);
|
|
167345
|
+
return true;
|
|
167346
|
+
} catch (e) {
|
|
167347
|
+
return false;
|
|
167348
|
+
}
|
|
167349
|
+
}
|
|
167350
|
+
|
|
167351
|
+
/**
|
|
167352
|
+
* Filters a collection of items by the given keys and filter word.
|
|
167353
|
+
*/
|
|
167354
|
+
function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
|
|
167355
|
+
if (!keys) {
|
|
167356
|
+
return [];
|
|
167357
|
+
}
|
|
167358
|
+
const _keys = !Array.isArray(keys) ? [keys] : keys;
|
|
167359
|
+
if (!_keys.length) {
|
|
167360
|
+
return [];
|
|
167361
|
+
}
|
|
167362
|
+
const filterExpression = createFilterExpression(filterWord);
|
|
167363
|
+
return collection.filter((item) => {
|
|
167364
|
+
if (beforeFilteringFn) {
|
|
167365
|
+
const res = beforeFilteringFn(item);
|
|
167366
|
+
if (res !== null || res !== undefined) {
|
|
167367
|
+
return res;
|
|
167368
|
+
}
|
|
167369
|
+
}
|
|
167370
|
+
return _keys.some((key) => filterExpression.test(String(item[key] ?? "")));
|
|
167371
|
+
});
|
|
167372
|
+
}
|
|
167373
|
+
/**
|
|
167374
|
+
* Returns the url to the portal item.
|
|
167375
|
+
*/
|
|
167376
|
+
function portalItemPageUrl(portalItem) {
|
|
167377
|
+
if (!portalItem) {
|
|
167378
|
+
return "";
|
|
167379
|
+
}
|
|
167380
|
+
return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
|
|
167381
|
+
}
|
|
167382
|
+
//#endregion
|
|
167383
|
+
|
|
167384
|
+
/**
|
|
167385
|
+
* Returns an icon name for the field type
|
|
167386
|
+
*/
|
|
167387
|
+
function fieldTypeToIconName(field) {
|
|
167388
|
+
switch (field.type) {
|
|
167389
|
+
case "oid":
|
|
167390
|
+
return "key";
|
|
167391
|
+
case "small-integer":
|
|
167392
|
+
case "big-integer":
|
|
167393
|
+
case "integer":
|
|
167394
|
+
case "single":
|
|
167395
|
+
case "double":
|
|
167396
|
+
case "long":
|
|
167397
|
+
return "number";
|
|
167398
|
+
case "global-id":
|
|
167399
|
+
case "guid":
|
|
167400
|
+
return "key";
|
|
167401
|
+
case "string":
|
|
167402
|
+
return "string";
|
|
167403
|
+
case "date":
|
|
167404
|
+
return "date-time";
|
|
167405
|
+
case "date-only":
|
|
167406
|
+
return "calendar";
|
|
167407
|
+
case "time-only":
|
|
167408
|
+
return "clock";
|
|
167409
|
+
case "timestamp-offset":
|
|
167410
|
+
return "time-zone";
|
|
167411
|
+
default:
|
|
167412
|
+
return "cube";
|
|
167413
|
+
}
|
|
167414
|
+
}
|
|
167415
|
+
/**
|
|
167416
|
+
* Returns the ApiValueVariable type for the given field.
|
|
167417
|
+
*/
|
|
167418
|
+
function fieldTypeToApiValueVarType(field) {
|
|
167419
|
+
switch (field.type) {
|
|
167420
|
+
case "small-integer":
|
|
167421
|
+
case "integer":
|
|
167422
|
+
case "big-integer":
|
|
167423
|
+
case "single":
|
|
167424
|
+
case "double":
|
|
167425
|
+
case "long":
|
|
167426
|
+
case "oid":
|
|
167427
|
+
return "number";
|
|
167428
|
+
case "global-id":
|
|
167429
|
+
case "guid":
|
|
167430
|
+
case "string":
|
|
167431
|
+
return "text";
|
|
167432
|
+
case "date":
|
|
167433
|
+
return "date";
|
|
167434
|
+
case "date-only":
|
|
167435
|
+
return "dateOnly";
|
|
167436
|
+
case "time-only":
|
|
167437
|
+
return "time";
|
|
167438
|
+
default:
|
|
167439
|
+
return "text";
|
|
167440
|
+
}
|
|
167441
|
+
}
|
|
167442
|
+
function supportedFields(fields) {
|
|
167443
|
+
return (fields ?? []).filter((field) => {
|
|
167444
|
+
switch (field.type) {
|
|
167445
|
+
case "string":
|
|
167446
|
+
case "small-integer":
|
|
167447
|
+
case "integer":
|
|
167448
|
+
case "big-integer":
|
|
167449
|
+
case "single":
|
|
167450
|
+
case "double":
|
|
167451
|
+
case "long":
|
|
167452
|
+
case "date":
|
|
167453
|
+
case "date-only":
|
|
167454
|
+
case "time-only":
|
|
167455
|
+
case "timestamp-offset":
|
|
167456
|
+
case "oid":
|
|
167457
|
+
case "guid":
|
|
167458
|
+
case "global-id":
|
|
167459
|
+
return true;
|
|
167460
|
+
default:
|
|
167461
|
+
return false;
|
|
167462
|
+
}
|
|
167463
|
+
});
|
|
167464
|
+
}
|
|
167465
|
+
function fieldAlias(field) {
|
|
167466
|
+
return field.alias || field.name;
|
|
167467
|
+
}
|
|
167468
|
+
|
|
166717
167469
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
166718
167470
|
|
|
166719
167471
|
function commonjsRequire (path) {
|
|
@@ -168989,752 +169741,6 @@ var main = {exports: {}};
|
|
|
168989
169741
|
});
|
|
168990
169742
|
}(main, main.exports));
|
|
168991
169743
|
|
|
168992
|
-
// src/index.ts
|
|
168993
|
-
var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis;
|
|
168994
|
-
function isDefaultModule(module) {
|
|
168995
|
-
return module.default !== void 0;
|
|
168996
|
-
}
|
|
168997
|
-
async function importLayersFeatureLayer() {
|
|
168998
|
-
if (isAMD) {
|
|
168999
|
-
return await window.$arcgis.import("esri/layers/FeatureLayer");
|
|
169000
|
-
}
|
|
169001
|
-
const module = await import('@arcgis/core/layers/FeatureLayer.js');
|
|
169002
|
-
return isDefaultModule(module) ? module.default : module;
|
|
169003
|
-
}
|
|
169004
|
-
async function newLayersFeatureLayer(properties) {
|
|
169005
|
-
const ModConstructor = await importLayersFeatureLayer();
|
|
169006
|
-
return new ModConstructor(properties);
|
|
169007
|
-
}
|
|
169008
|
-
async function importPortalPortalItem() {
|
|
169009
|
-
if (isAMD) {
|
|
169010
|
-
return await window.$arcgis.import("esri/portal/PortalItem");
|
|
169011
|
-
}
|
|
169012
|
-
const module = await import('@arcgis/core/portal/PortalItem.js');
|
|
169013
|
-
return isDefaultModule(module) ? module.default : module;
|
|
169014
|
-
}
|
|
169015
|
-
async function newPortalPortalItem(properties) {
|
|
169016
|
-
const ModConstructor = await importPortalPortalItem();
|
|
169017
|
-
return new ModConstructor(properties);
|
|
169018
|
-
}
|
|
169019
|
-
async function importWebMap() {
|
|
169020
|
-
if (isAMD) {
|
|
169021
|
-
return await window.$arcgis.import("esri/WebMap");
|
|
169022
|
-
}
|
|
169023
|
-
const module = await import('@arcgis/core/WebMap.js');
|
|
169024
|
-
return isDefaultModule(module) ? module.default : module;
|
|
169025
|
-
}
|
|
169026
|
-
async function newWebMap(properties) {
|
|
169027
|
-
const ModConstructor = await importWebMap();
|
|
169028
|
-
return new ModConstructor(properties);
|
|
169029
|
-
}
|
|
169030
|
-
async function importWebScene() {
|
|
169031
|
-
if (isAMD) {
|
|
169032
|
-
return await window.$arcgis.import("esri/WebScene");
|
|
169033
|
-
}
|
|
169034
|
-
const module = await import('@arcgis/core/WebScene.js');
|
|
169035
|
-
return isDefaultModule(module) ? module.default : module;
|
|
169036
|
-
}
|
|
169037
|
-
async function newWebScene(properties) {
|
|
169038
|
-
const ModConstructor = await importWebScene();
|
|
169039
|
-
return new ModConstructor(properties);
|
|
169040
|
-
}
|
|
169041
|
-
async function importArcade() {
|
|
169042
|
-
if (isAMD) {
|
|
169043
|
-
return await window.$arcgis.import("esri/arcade");
|
|
169044
|
-
}
|
|
169045
|
-
const module = await import('@arcgis/core/arcade.js');
|
|
169046
|
-
return isDefaultModule(module) ? module.default : module;
|
|
169047
|
-
}
|
|
169048
|
-
async function importRequest() {
|
|
169049
|
-
if (isAMD) {
|
|
169050
|
-
return await window.$arcgis.import("esri/request");
|
|
169051
|
-
}
|
|
169052
|
-
const module = await import('@arcgis/core/request.js');
|
|
169053
|
-
return isDefaultModule(module) ? module.default : module;
|
|
169054
|
-
}
|
|
169055
|
-
|
|
169056
|
-
//#region Type Guards
|
|
169057
|
-
function isQueryableLayerInstance(item) {
|
|
169058
|
-
return (!!item &&
|
|
169059
|
-
typeof item === "object" &&
|
|
169060
|
-
"declaredClass" in item &&
|
|
169061
|
-
typeof item.declaredClass === "string" &&
|
|
169062
|
-
item.declaredClass.startsWith("esri.layers.") &&
|
|
169063
|
-
"fields" in item &&
|
|
169064
|
-
"queryFeatures" in item &&
|
|
169065
|
-
typeof item.queryFeatures === "function");
|
|
169066
|
-
}
|
|
169067
|
-
function isSubtypeSublayerInstance(item) {
|
|
169068
|
-
return (!!item &&
|
|
169069
|
-
typeof item === "object" &&
|
|
169070
|
-
"declaredClass" in item &&
|
|
169071
|
-
typeof item.declaredClass === "string" &&
|
|
169072
|
-
item.declaredClass === "esri.layers.support.SubtypeSublayer");
|
|
169073
|
-
}
|
|
169074
|
-
function isGroupLayerInstance(item) {
|
|
169075
|
-
return (!!item &&
|
|
169076
|
-
typeof item === "object" &&
|
|
169077
|
-
"declaredClass" in item &&
|
|
169078
|
-
typeof item.declaredClass === "string" &&
|
|
169079
|
-
item.declaredClass === "esri.layers.GroupLayer");
|
|
169080
|
-
}
|
|
169081
|
-
function isMapInstance(item) {
|
|
169082
|
-
return (!!item &&
|
|
169083
|
-
typeof item === "object" &&
|
|
169084
|
-
"declaredClass" in item &&
|
|
169085
|
-
typeof item.declaredClass === "string" &&
|
|
169086
|
-
(item.declaredClass === "esri.Map" ||
|
|
169087
|
-
item.declaredClass === "esri.WebMap" ||
|
|
169088
|
-
item.declaredClass === "esri.WebScene"));
|
|
169089
|
-
}
|
|
169090
|
-
function isWebMapInstance(item) {
|
|
169091
|
-
return item.declaredClass === "esri.WebMap";
|
|
169092
|
-
}
|
|
169093
|
-
function isWebSceneInstance(item) {
|
|
169094
|
-
return item.declaredClass === "esri.WebScene";
|
|
169095
|
-
}
|
|
169096
|
-
function isLoadableMapInstance(item) {
|
|
169097
|
-
return item.declaredClass === "esri.WebMap" || item.declaredClass === "esri.WebScene";
|
|
169098
|
-
}
|
|
169099
|
-
function isPortalItemDefinition(item) {
|
|
169100
|
-
return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
|
|
169101
|
-
}
|
|
169102
|
-
function isFeatureLayerItemDefinition(item) {
|
|
169103
|
-
return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
|
|
169104
|
-
}
|
|
169105
|
-
function isFieldsDefinition(item) {
|
|
169106
|
-
return !!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields);
|
|
169107
|
-
}
|
|
169108
|
-
function isUrlDefinition(item) {
|
|
169109
|
-
return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
|
|
169110
|
-
}
|
|
169111
|
-
function isSupportedServiceUrlDefinition(item) {
|
|
169112
|
-
return isUrlDefinition(item) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(item.url);
|
|
169113
|
-
}
|
|
169114
|
-
function isSubtypeInstance(item) {
|
|
169115
|
-
return (!!item &&
|
|
169116
|
-
typeof item === "object" &&
|
|
169117
|
-
"declaredClass" in item &&
|
|
169118
|
-
item.declaredClass === "esri.layers.support.Subtype");
|
|
169119
|
-
}
|
|
169120
|
-
function isCodedValueDomainInstance(item) {
|
|
169121
|
-
return (!!item &&
|
|
169122
|
-
typeof item === "object" &&
|
|
169123
|
-
"declaredClass" in item &&
|
|
169124
|
-
item.declaredClass === "esri.layers.support.CodedValueDomain");
|
|
169125
|
-
}
|
|
169126
|
-
function isInheritedDomainInstance(item) {
|
|
169127
|
-
return (!!item &&
|
|
169128
|
-
typeof item === "object" &&
|
|
169129
|
-
"declaredClass" in item &&
|
|
169130
|
-
item.declaredClass === "esri.layers.support.InheritedDomain");
|
|
169131
|
-
}
|
|
169132
|
-
function isPredefinedProfile(item) {
|
|
169133
|
-
return (!!item &&
|
|
169134
|
-
typeof item === "object" &&
|
|
169135
|
-
"id" in item &&
|
|
169136
|
-
typeof item.id === "string" &&
|
|
169137
|
-
"definitions" in item &&
|
|
169138
|
-
typeof item.definitions === "object" &&
|
|
169139
|
-
!Array.isArray(item.definitions));
|
|
169140
|
-
}
|
|
169141
|
-
function isTitleCapableSource(item) {
|
|
169142
|
-
return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
|
|
169143
|
-
}
|
|
169144
|
-
function isUrlCapableSource(item) {
|
|
169145
|
-
return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
|
|
169146
|
-
}
|
|
169147
|
-
function isLayerIdCapableSource(item) {
|
|
169148
|
-
return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
|
|
169149
|
-
}
|
|
169150
|
-
function isFeatureTypesCapableLayer(item) {
|
|
169151
|
-
return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
|
|
169152
|
-
}
|
|
169153
|
-
function isDomainsCapableLayer(item) {
|
|
169154
|
-
return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
|
|
169155
|
-
}
|
|
169156
|
-
function isSubtypeFieldCapableLayer(item) {
|
|
169157
|
-
return !!item && typeof item === "object" && "subtypeField" in item;
|
|
169158
|
-
}
|
|
169159
|
-
function isSubtypesCapableLayer(item) {
|
|
169160
|
-
return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
|
|
169161
|
-
}
|
|
169162
|
-
function isRelationshipsCapableLayer(item) {
|
|
169163
|
-
return (isLayerIdCapableSource(item) &&
|
|
169164
|
-
"relationships" in item &&
|
|
169165
|
-
"url" in item &&
|
|
169166
|
-
Array.isArray(item.relationships) &&
|
|
169167
|
-
typeof item.url === "string");
|
|
169168
|
-
}
|
|
169169
|
-
function isTableCapableLayer(item) {
|
|
169170
|
-
return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
|
|
169171
|
-
}
|
|
169172
|
-
function isLoadableSource(item) {
|
|
169173
|
-
return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
|
|
169174
|
-
}
|
|
169175
|
-
//#endregion
|
|
169176
|
-
//#region Service Metadata
|
|
169177
|
-
async function supportedSourceFromDefinition(definition) {
|
|
169178
|
-
if (!definition) {
|
|
169179
|
-
return null;
|
|
169180
|
-
}
|
|
169181
|
-
let source = null;
|
|
169182
|
-
if (isFieldsDefinition(definition)) {
|
|
169183
|
-
source = definition;
|
|
169184
|
-
}
|
|
169185
|
-
else {
|
|
169186
|
-
source = await newLayersFeatureLayer(definition);
|
|
169187
|
-
}
|
|
169188
|
-
if (isLoadableSource(source)) {
|
|
169189
|
-
await source.load();
|
|
169190
|
-
}
|
|
169191
|
-
return source;
|
|
169192
|
-
}
|
|
169193
|
-
async function serviceMetaData(url) {
|
|
169194
|
-
url += "/layers";
|
|
169195
|
-
const request = await importRequest();
|
|
169196
|
-
const response = await request(url, { responseType: "json", query: { f: "json" } });
|
|
169197
|
-
const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
|
|
169198
|
-
const layers = getSupportedLayerInfos(response.data?.layers, queryCapability);
|
|
169199
|
-
const tables = getSupportedLayerInfos(response.data?.tables, queryCapability);
|
|
169200
|
-
return { layers, tables };
|
|
169201
|
-
}
|
|
169202
|
-
function getSupportedLayerInfos(layers, queryCapability) {
|
|
169203
|
-
if (!layers) {
|
|
169204
|
-
return [];
|
|
169205
|
-
}
|
|
169206
|
-
return layers.filter((layer) => {
|
|
169207
|
-
switch (layer.type) {
|
|
169208
|
-
case "Feature Layer":
|
|
169209
|
-
case "Oriented Imagery Layer":
|
|
169210
|
-
case "Catalog Layer":
|
|
169211
|
-
case "Table": {
|
|
169212
|
-
const capabilities = layer.capabilities
|
|
169213
|
-
? layer.capabilities
|
|
169214
|
-
.toLowerCase()
|
|
169215
|
-
.split(",")
|
|
169216
|
-
.map((value) => value.trim())
|
|
169217
|
-
: [];
|
|
169218
|
-
return capabilities.includes(queryCapability);
|
|
169219
|
-
}
|
|
169220
|
-
default:
|
|
169221
|
-
return false;
|
|
169222
|
-
}
|
|
169223
|
-
});
|
|
169224
|
-
}
|
|
169225
|
-
//#endregion
|
|
169226
|
-
|
|
169227
|
-
// src/array-utils.ts
|
|
169228
|
-
|
|
169229
|
-
// src/deferred.ts
|
|
169230
|
-
var Deferred = class {
|
|
169231
|
-
/**
|
|
169232
|
-
* Resolves the promise.
|
|
169233
|
-
* @param value The value to resolve the promise with.
|
|
169234
|
-
*/
|
|
169235
|
-
resolve(_value) {
|
|
169236
|
-
}
|
|
169237
|
-
/**
|
|
169238
|
-
* Rejects the promise.
|
|
169239
|
-
*/
|
|
169240
|
-
reject(_error) {
|
|
169241
|
-
}
|
|
169242
|
-
/**
|
|
169243
|
-
* Creates a new deferred promise.
|
|
169244
|
-
*/
|
|
169245
|
-
constructor() {
|
|
169246
|
-
this.promise = new Promise((resolve, reject) => {
|
|
169247
|
-
this.resolve = resolve;
|
|
169248
|
-
this.reject = reject;
|
|
169249
|
-
});
|
|
169250
|
-
}
|
|
169251
|
-
};
|
|
169252
|
-
|
|
169253
|
-
// src/dom.ts
|
|
169254
|
-
function inTargetElement(element, targetElement) {
|
|
169255
|
-
let currentElement = element;
|
|
169256
|
-
while (currentElement) {
|
|
169257
|
-
if (currentElement === targetElement) {
|
|
169258
|
-
return true;
|
|
169259
|
-
}
|
|
169260
|
-
if (!currentElement.parentNode) {
|
|
169261
|
-
return false;
|
|
169262
|
-
}
|
|
169263
|
-
if (currentElement.parentNode instanceof ShadowRoot) {
|
|
169264
|
-
currentElement = currentElement.parentNode.host;
|
|
169265
|
-
} else {
|
|
169266
|
-
currentElement = currentElement.parentNode;
|
|
169267
|
-
}
|
|
169268
|
-
}
|
|
169269
|
-
return false;
|
|
169270
|
-
}
|
|
169271
|
-
function observeAncestorsMutation(element, attributeFilter, callback) {
|
|
169272
|
-
const { subscribe } = observe(attributeFilter);
|
|
169273
|
-
return subscribe((mutations) => {
|
|
169274
|
-
const matched = mutations.some((mutation) => inTargetElement(element, mutation.target));
|
|
169275
|
-
if (matched) {
|
|
169276
|
-
callback();
|
|
169277
|
-
}
|
|
169278
|
-
});
|
|
169279
|
-
}
|
|
169280
|
-
var observers = {};
|
|
169281
|
-
function observe(attributeFilter) {
|
|
169282
|
-
const attributes = attributeFilter.join(",");
|
|
169283
|
-
const previousObserver = observers[attributes];
|
|
169284
|
-
if (previousObserver !== void 0) {
|
|
169285
|
-
return previousObserver;
|
|
169286
|
-
}
|
|
169287
|
-
const subscribers = /* @__PURE__ */ new Set();
|
|
169288
|
-
const mutationObserver = new MutationObserver((mutations) => subscribers.forEach((callback) => callback(mutations)));
|
|
169289
|
-
mutationObserver.observe(document.documentElement, {
|
|
169290
|
-
attributes: true,
|
|
169291
|
-
attributeFilter,
|
|
169292
|
-
subtree: true
|
|
169293
|
-
});
|
|
169294
|
-
const observer = {
|
|
169295
|
-
subscribe(callback) {
|
|
169296
|
-
subscribers.add(callback);
|
|
169297
|
-
return {
|
|
169298
|
-
remove: () => {
|
|
169299
|
-
subscribers.delete(callback);
|
|
169300
|
-
if (subscribers.size === 0) {
|
|
169301
|
-
mutationObserver.disconnect();
|
|
169302
|
-
observers[attributes] = void 0;
|
|
169303
|
-
}
|
|
169304
|
-
}
|
|
169305
|
-
};
|
|
169306
|
-
}
|
|
169307
|
-
};
|
|
169308
|
-
observers[attributes] = observer;
|
|
169309
|
-
return observer;
|
|
169310
|
-
}
|
|
169311
|
-
function closestElement(base, selector) {
|
|
169312
|
-
let currentElement = base;
|
|
169313
|
-
while (currentElement) {
|
|
169314
|
-
const element = currentElement.closest(selector);
|
|
169315
|
-
if (element) {
|
|
169316
|
-
return element;
|
|
169317
|
-
}
|
|
169318
|
-
const rootElement = currentElement.getRootNode();
|
|
169319
|
-
if (rootElement === document) {
|
|
169320
|
-
return null;
|
|
169321
|
-
}
|
|
169322
|
-
currentElement = rootElement.host;
|
|
169323
|
-
}
|
|
169324
|
-
return null;
|
|
169325
|
-
}
|
|
169326
|
-
function getElementTheme(base) {
|
|
169327
|
-
const themeElt = closestElement(base, ":is(.calcite-mode-light, .calcite-mode-dark)");
|
|
169328
|
-
return themeElt && themeElt.classList.contains("calcite-mode-dark") ? "dark" : "light";
|
|
169329
|
-
}
|
|
169330
|
-
function getElementAttribute(el, prop, fallbackValue) {
|
|
169331
|
-
const closest = closestElement(el, `[${prop}]`);
|
|
169332
|
-
return closest?.getAttribute(prop) ?? fallbackValue;
|
|
169333
|
-
}
|
|
169334
|
-
function isElement(ref) {
|
|
169335
|
-
return ref.nodeType === Node.ELEMENT_NODE;
|
|
169336
|
-
}
|
|
169337
|
-
function isHTMLWithSetFocus(ref) {
|
|
169338
|
-
return "setFocus" in ref && typeof ref.setFocus === "function";
|
|
169339
|
-
}
|
|
169340
|
-
function setFocus(ref, selector = "") {
|
|
169341
|
-
if (!isElement(ref)) {
|
|
169342
|
-
return false;
|
|
169343
|
-
}
|
|
169344
|
-
if (ref.matches(selector)) {
|
|
169345
|
-
if (isHTMLWithSetFocus(ref)) {
|
|
169346
|
-
setTimeout(() => ref.setFocus(), 0);
|
|
169347
|
-
}
|
|
169348
|
-
return true;
|
|
169349
|
-
}
|
|
169350
|
-
for (const child of ref.children) {
|
|
169351
|
-
if (setFocus(child, selector)) {
|
|
169352
|
-
return true;
|
|
169353
|
-
}
|
|
169354
|
-
}
|
|
169355
|
-
const shadowRoot = ref.shadowRoot;
|
|
169356
|
-
if (shadowRoot) {
|
|
169357
|
-
for (const child of shadowRoot.children) {
|
|
169358
|
-
if (setFocus(child, selector)) {
|
|
169359
|
-
return true;
|
|
169360
|
-
}
|
|
169361
|
-
}
|
|
169362
|
-
}
|
|
169363
|
-
return false;
|
|
169364
|
-
}
|
|
169365
|
-
function setFocusOnElement(ref, selector) {
|
|
169366
|
-
if (!ref?.shadowRoot) {
|
|
169367
|
-
return;
|
|
169368
|
-
}
|
|
169369
|
-
if (ref.hasAttribute("hydrated") || ref.hasAttribute("calcite-hydrated")) {
|
|
169370
|
-
setFocus(ref, selector);
|
|
169371
|
-
return;
|
|
169372
|
-
}
|
|
169373
|
-
const mutationObserver = new MutationObserver(() => {
|
|
169374
|
-
mutationObserver.disconnect();
|
|
169375
|
-
setFocus(ref, selector);
|
|
169376
|
-
});
|
|
169377
|
-
mutationObserver.observe(ref, {
|
|
169378
|
-
attributes: true,
|
|
169379
|
-
attributeFilter: ["hydrated", "calcite-hydrated"]
|
|
169380
|
-
});
|
|
169381
|
-
}
|
|
169382
|
-
|
|
169383
|
-
// src/errors.ts
|
|
169384
|
-
function safeCall(callback, thisContext, ...rest) {
|
|
169385
|
-
try {
|
|
169386
|
-
return callback?.call(thisContext, ...rest);
|
|
169387
|
-
} catch (error) {
|
|
169388
|
-
console.error(error, callback);
|
|
169389
|
-
}
|
|
169390
|
-
return void 0;
|
|
169391
|
-
}
|
|
169392
|
-
async function safeAsyncCall(callback, thisContext, ...rest) {
|
|
169393
|
-
try {
|
|
169394
|
-
const result = callback?.call(thisContext, ...rest);
|
|
169395
|
-
return result instanceof Promise ? await result : result;
|
|
169396
|
-
} catch (error) {
|
|
169397
|
-
console.error(error, callback);
|
|
169398
|
-
}
|
|
169399
|
-
return void 0;
|
|
169400
|
-
}
|
|
169401
|
-
|
|
169402
|
-
// src/guid.ts
|
|
169403
|
-
function gen(count) {
|
|
169404
|
-
let out = "";
|
|
169405
|
-
for (let i = 0; i < count; i++) {
|
|
169406
|
-
out += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
169407
|
-
}
|
|
169408
|
-
return out;
|
|
169409
|
-
}
|
|
169410
|
-
function generateGuid() {
|
|
169411
|
-
return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
|
|
169412
|
-
}
|
|
169413
|
-
var camelToKebab = (string) => string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : "-"}${upper.toLowerCase()}`);
|
|
169414
|
-
var upperBeforeLower = /[A-Z]+(?![a-z])|[A-Z]/gu;
|
|
169415
|
-
var capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
|
|
169416
|
-
var camelToHuman = (string) => capitalize(string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : " "}${upper}`));
|
|
169417
|
-
|
|
169418
|
-
// src/intl.ts
|
|
169419
|
-
var supportedLocales = /* @__PURE__ */ new Set([
|
|
169420
|
-
"ar",
|
|
169421
|
-
"bg",
|
|
169422
|
-
"bs",
|
|
169423
|
-
"ca",
|
|
169424
|
-
"cs",
|
|
169425
|
-
"da",
|
|
169426
|
-
"de",
|
|
169427
|
-
"el",
|
|
169428
|
-
"en",
|
|
169429
|
-
"es",
|
|
169430
|
-
"et",
|
|
169431
|
-
"fi",
|
|
169432
|
-
"fr",
|
|
169433
|
-
"he",
|
|
169434
|
-
"hr",
|
|
169435
|
-
"hu",
|
|
169436
|
-
"id",
|
|
169437
|
-
"it",
|
|
169438
|
-
"ja",
|
|
169439
|
-
"ko",
|
|
169440
|
-
"lt",
|
|
169441
|
-
"lv",
|
|
169442
|
-
"nl",
|
|
169443
|
-
"nb",
|
|
169444
|
-
"pl",
|
|
169445
|
-
"pt-BR",
|
|
169446
|
-
"pt-PT",
|
|
169447
|
-
"ro",
|
|
169448
|
-
"ru",
|
|
169449
|
-
"sk",
|
|
169450
|
-
"sl",
|
|
169451
|
-
"sr",
|
|
169452
|
-
"sv",
|
|
169453
|
-
"th",
|
|
169454
|
-
"tr",
|
|
169455
|
-
"uk",
|
|
169456
|
-
"vi",
|
|
169457
|
-
"zh-CN",
|
|
169458
|
-
"zh-HK",
|
|
169459
|
-
"zh-TW"
|
|
169460
|
-
]);
|
|
169461
|
-
var defaultLocale = "en";
|
|
169462
|
-
async function fetchT9NStringsBundle(locale, assetsPath, prefix = "") {
|
|
169463
|
-
const path = `${assetsPath}/${prefix}`;
|
|
169464
|
-
const filePath = `${path}${locale}.json`;
|
|
169465
|
-
t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
|
|
169466
|
-
return await t9nStringsCache[filePath];
|
|
169467
|
-
}
|
|
169468
|
-
var t9nStringsCache = {};
|
|
169469
|
-
async function fetchBundle(locale, path) {
|
|
169470
|
-
const filePath = `${path}${locale}.json`;
|
|
169471
|
-
try {
|
|
169472
|
-
const response = await fetch(filePath);
|
|
169473
|
-
if (response.ok) {
|
|
169474
|
-
return await response.json();
|
|
169475
|
-
}
|
|
169476
|
-
} catch (error) {
|
|
169477
|
-
console.error(error);
|
|
169478
|
-
return fallbackBundle;
|
|
169479
|
-
}
|
|
169480
|
-
if (locale === defaultLocale) {
|
|
169481
|
-
return fallbackBundle;
|
|
169482
|
-
}
|
|
169483
|
-
return await fetchBundle(defaultLocale, path);
|
|
169484
|
-
}
|
|
169485
|
-
var fallbackBundle = new Proxy(
|
|
169486
|
-
{},
|
|
169487
|
-
{
|
|
169488
|
-
get: (_target, property) => camelToHuman(property.toString())
|
|
169489
|
-
}
|
|
169490
|
-
);
|
|
169491
|
-
function getElementLocales(element) {
|
|
169492
|
-
const lang = getElementAttribute(element, "lang", navigator.language || defaultLocale);
|
|
169493
|
-
if (supportedLocales.has(lang)) {
|
|
169494
|
-
return { lang, t9nLocale: lang };
|
|
169495
|
-
}
|
|
169496
|
-
const rootCode = lang.slice(0, 2);
|
|
169497
|
-
return { lang, t9nLocale: supportedLocales.has(rootCode) ? rootCode : defaultLocale };
|
|
169498
|
-
}
|
|
169499
|
-
function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
|
|
169500
|
-
let result = void 0;
|
|
169501
|
-
const callback = () => void updateComponentLocateState(element, assetsPath, assetName).then((newResult) => {
|
|
169502
|
-
if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
|
|
169503
|
-
onUpdated(newResult);
|
|
169504
|
-
}
|
|
169505
|
-
result = newResult;
|
|
169506
|
-
}).catch(console.error);
|
|
169507
|
-
callback();
|
|
169508
|
-
return observeAncestorsMutation(element, ["lang"], callback);
|
|
169509
|
-
}
|
|
169510
|
-
async function updateComponentLocateState(element, assetsPath, assetName = element.tagName.toLowerCase().replace("arcgis-", "")) {
|
|
169511
|
-
const { lang, t9nLocale } = getElementLocales(element);
|
|
169512
|
-
const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
|
|
169513
|
-
const prefix = `${assetName}.t9n.`;
|
|
169514
|
-
const t9nStrings = await fetchT9NStringsBundle(t9nLocale, t9nAssetsPath, prefix);
|
|
169515
|
-
return { lang, t9nLocale, t9nStrings };
|
|
169516
|
-
}
|
|
169517
|
-
|
|
169518
|
-
// src/strings.ts
|
|
169519
|
-
var doubleQuote = '"';
|
|
169520
|
-
var singleQuote = "'";
|
|
169521
|
-
function repeatString(value, n) {
|
|
169522
|
-
return new Array(n + 1).join(value);
|
|
169523
|
-
}
|
|
169524
|
-
function quoteString(value) {
|
|
169525
|
-
let quote = doubleQuote;
|
|
169526
|
-
let alternateQuote = singleQuote;
|
|
169527
|
-
const avoidEscape = value.includes(quote) && !value.includes(alternateQuote);
|
|
169528
|
-
if (avoidEscape) {
|
|
169529
|
-
alternateQuote = doubleQuote;
|
|
169530
|
-
quote = singleQuote;
|
|
169531
|
-
}
|
|
169532
|
-
const alternateEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${alternateQuote})+)`, "gu");
|
|
169533
|
-
value = value.replace(
|
|
169534
|
-
alternateEscape,
|
|
169535
|
-
(_, boundaryChar, leadingEscapedSlashes, escapedQuoteChars) => (
|
|
169536
|
-
// We divide the escapedQuoteChars by 2 since there are 2 characters in each escaped part ('\\"'.length === 2)
|
|
169537
|
-
boundaryChar + leadingEscapedSlashes + repeatString(alternateQuote, escapedQuoteChars.length / 2)
|
|
169538
|
-
)
|
|
169539
|
-
);
|
|
169540
|
-
const quoteEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${quote}+)`, "gu");
|
|
169541
|
-
value = value.replace(
|
|
169542
|
-
quoteEscape,
|
|
169543
|
-
(_, boundaryChar, leadingEscapedSlashes, quoteChars) => boundaryChar + leadingEscapedSlashes + repeatString(`\\${quote}`, quoteChars.length)
|
|
169544
|
-
);
|
|
169545
|
-
return quote + value + quote;
|
|
169546
|
-
}
|
|
169547
|
-
function createFilterExpression(filterWord) {
|
|
169548
|
-
const sanitizedWord = filterWord ? filterWord.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu, "\\$&") : "^.*$";
|
|
169549
|
-
return new RegExp(sanitizedWord, "i");
|
|
169550
|
-
}
|
|
169551
|
-
function setValuesInString(message, values = {}) {
|
|
169552
|
-
return (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
|
|
169553
|
-
}
|
|
169554
|
-
function addLTRMark(value) {
|
|
169555
|
-
return `\u200E${value ?? ""}\u200E`;
|
|
169556
|
-
}
|
|
169557
|
-
|
|
169558
|
-
// src/timeouts.ts
|
|
169559
|
-
function devToolsAwareTimeout(callback, timeout) {
|
|
169560
|
-
const interval = timeout > longTimeoutThreshold ? longTimeoutInterval : timeout / shortTimeoutIntervals;
|
|
169561
|
-
let elapsed = 0;
|
|
169562
|
-
const reference = setInterval(() => {
|
|
169563
|
-
elapsed += interval;
|
|
169564
|
-
if (elapsed >= timeout) {
|
|
169565
|
-
clearInterval(reference);
|
|
169566
|
-
callback();
|
|
169567
|
-
}
|
|
169568
|
-
}, interval);
|
|
169569
|
-
return reference;
|
|
169570
|
-
}
|
|
169571
|
-
var longTimeoutThreshold = 4e3;
|
|
169572
|
-
var longTimeoutInterval = 2e3;
|
|
169573
|
-
var shortTimeoutIntervals = 4;
|
|
169574
|
-
|
|
169575
|
-
// src/type-guards.ts
|
|
169576
|
-
function isNotNull(item) {
|
|
169577
|
-
return item !== null;
|
|
169578
|
-
}
|
|
169579
|
-
function isNotUndefined(item) {
|
|
169580
|
-
return item !== void 0;
|
|
169581
|
-
}
|
|
169582
|
-
|
|
169583
|
-
// src/ui.ts
|
|
169584
|
-
function debounce(func, waitFor = 100) {
|
|
169585
|
-
let timeout;
|
|
169586
|
-
return (...args) => {
|
|
169587
|
-
const later = () => {
|
|
169588
|
-
clearTimeout(timeout);
|
|
169589
|
-
func(...args);
|
|
169590
|
-
};
|
|
169591
|
-
clearTimeout(timeout);
|
|
169592
|
-
timeout = setTimeout(later, waitFor);
|
|
169593
|
-
};
|
|
169594
|
-
}
|
|
169595
|
-
|
|
169596
|
-
// src/url.ts
|
|
169597
|
-
function hasSameOrigin(url1, url2, ignoreProtocol = false) {
|
|
169598
|
-
if (!url1 || !url2) {
|
|
169599
|
-
return false;
|
|
169600
|
-
}
|
|
169601
|
-
const url1Obj = new URL(url1);
|
|
169602
|
-
const url2Obj = new URL(url2);
|
|
169603
|
-
if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
|
|
169604
|
-
return false;
|
|
169605
|
-
}
|
|
169606
|
-
if (url1Obj.host == null || url2Obj.host == null) {
|
|
169607
|
-
return false;
|
|
169608
|
-
}
|
|
169609
|
-
return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
|
|
169610
|
-
}
|
|
169611
|
-
function isURL(url) {
|
|
169612
|
-
try {
|
|
169613
|
-
new URL(url);
|
|
169614
|
-
return true;
|
|
169615
|
-
} catch (e) {
|
|
169616
|
-
return false;
|
|
169617
|
-
}
|
|
169618
|
-
}
|
|
169619
|
-
|
|
169620
|
-
/**
|
|
169621
|
-
* Filters a collection of items by the given keys and filter word.
|
|
169622
|
-
*/
|
|
169623
|
-
function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
|
|
169624
|
-
if (!keys) {
|
|
169625
|
-
return [];
|
|
169626
|
-
}
|
|
169627
|
-
const _keys = !Array.isArray(keys) ? [keys] : keys;
|
|
169628
|
-
if (!_keys.length) {
|
|
169629
|
-
return [];
|
|
169630
|
-
}
|
|
169631
|
-
const filterExpression = createFilterExpression(filterWord);
|
|
169632
|
-
return collection.filter((item) => {
|
|
169633
|
-
if (beforeFilteringFn) {
|
|
169634
|
-
const res = beforeFilteringFn(item);
|
|
169635
|
-
if (res !== null || res !== undefined) {
|
|
169636
|
-
return res;
|
|
169637
|
-
}
|
|
169638
|
-
}
|
|
169639
|
-
return _keys.some((key) => filterExpression.test(String(item[key] ?? "")));
|
|
169640
|
-
});
|
|
169641
|
-
}
|
|
169642
|
-
/**
|
|
169643
|
-
* Returns the url to the portal item.
|
|
169644
|
-
*/
|
|
169645
|
-
function portalItemPageUrl(portalItem) {
|
|
169646
|
-
if (!portalItem) {
|
|
169647
|
-
return "";
|
|
169648
|
-
}
|
|
169649
|
-
return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
|
|
169650
|
-
}
|
|
169651
|
-
//#endregion
|
|
169652
|
-
|
|
169653
|
-
/**
|
|
169654
|
-
* Returns an icon name for the field type
|
|
169655
|
-
*/
|
|
169656
|
-
function fieldTypeToIconName(field) {
|
|
169657
|
-
switch (field.type) {
|
|
169658
|
-
case "oid":
|
|
169659
|
-
return "key";
|
|
169660
|
-
case "small-integer":
|
|
169661
|
-
case "big-integer":
|
|
169662
|
-
case "integer":
|
|
169663
|
-
case "single":
|
|
169664
|
-
case "double":
|
|
169665
|
-
case "long":
|
|
169666
|
-
return "number";
|
|
169667
|
-
case "global-id":
|
|
169668
|
-
case "guid":
|
|
169669
|
-
return "key";
|
|
169670
|
-
case "string":
|
|
169671
|
-
return "string";
|
|
169672
|
-
case "date":
|
|
169673
|
-
return "date-time";
|
|
169674
|
-
case "date-only":
|
|
169675
|
-
return "calendar";
|
|
169676
|
-
case "time-only":
|
|
169677
|
-
return "clock";
|
|
169678
|
-
case "timestamp-offset":
|
|
169679
|
-
return "time-zone";
|
|
169680
|
-
default:
|
|
169681
|
-
return "cube";
|
|
169682
|
-
}
|
|
169683
|
-
}
|
|
169684
|
-
/**
|
|
169685
|
-
* Returns the Arcade type for the given field.
|
|
169686
|
-
*/
|
|
169687
|
-
function fieldTypeToArcadeType(field) {
|
|
169688
|
-
switch (field.type) {
|
|
169689
|
-
case "small-integer":
|
|
169690
|
-
case "integer":
|
|
169691
|
-
case "big-integer":
|
|
169692
|
-
case "single":
|
|
169693
|
-
case "double":
|
|
169694
|
-
case "long":
|
|
169695
|
-
case "oid":
|
|
169696
|
-
return "number";
|
|
169697
|
-
case "global-id":
|
|
169698
|
-
case "guid":
|
|
169699
|
-
case "string":
|
|
169700
|
-
return "text";
|
|
169701
|
-
case "date":
|
|
169702
|
-
return "date";
|
|
169703
|
-
case "date-only":
|
|
169704
|
-
return "dateOnly";
|
|
169705
|
-
case "time-only":
|
|
169706
|
-
return "time";
|
|
169707
|
-
default:
|
|
169708
|
-
return "text";
|
|
169709
|
-
}
|
|
169710
|
-
}
|
|
169711
|
-
function supportedFields(fields) {
|
|
169712
|
-
return (fields ?? []).filter((field) => {
|
|
169713
|
-
switch (field.type) {
|
|
169714
|
-
case "string":
|
|
169715
|
-
case "small-integer":
|
|
169716
|
-
case "integer":
|
|
169717
|
-
case "big-integer":
|
|
169718
|
-
case "single":
|
|
169719
|
-
case "double":
|
|
169720
|
-
case "long":
|
|
169721
|
-
case "date":
|
|
169722
|
-
case "date-only":
|
|
169723
|
-
case "time-only":
|
|
169724
|
-
case "timestamp-offset":
|
|
169725
|
-
case "oid":
|
|
169726
|
-
case "guid":
|
|
169727
|
-
case "global-id":
|
|
169728
|
-
return true;
|
|
169729
|
-
default:
|
|
169730
|
-
return false;
|
|
169731
|
-
}
|
|
169732
|
-
});
|
|
169733
|
-
}
|
|
169734
|
-
function fieldAlias(field) {
|
|
169735
|
-
return field.alias || field.name;
|
|
169736
|
-
}
|
|
169737
|
-
|
|
169738
169744
|
//#endregion
|
|
169739
169745
|
//#region Support functions
|
|
169740
169746
|
async function getRelatedFeatureLayer(layer, relationship) {
|
|
@@ -169750,14 +169756,6 @@ function sortFields(layer) {
|
|
|
169750
169756
|
if (secondField.type === "oid") {
|
|
169751
169757
|
return 1;
|
|
169752
169758
|
}
|
|
169753
|
-
if (isSubtypeSublayerInstance(layer)) {
|
|
169754
|
-
if (firstField.name === layer.parent.subtypeField) {
|
|
169755
|
-
return -1;
|
|
169756
|
-
}
|
|
169757
|
-
if (secondField.name === layer.parent.subtypeField) {
|
|
169758
|
-
return 1;
|
|
169759
|
-
}
|
|
169760
|
-
}
|
|
169761
169759
|
if (isSubtypeFieldCapableLayer(layer)) {
|
|
169762
169760
|
if (firstField.name === layer.subtypeField) {
|
|
169763
169761
|
return -1;
|
|
@@ -169795,86 +169793,28 @@ function assembleMemberExpression(obj, prop) {
|
|
|
169795
169793
|
return `${obj}${getMemberExpressionProperty(prop)}`;
|
|
169796
169794
|
}
|
|
169797
169795
|
function getMapPortalItem(map) {
|
|
169798
|
-
if (
|
|
169796
|
+
if (isPortalItemCapable(map)) {
|
|
169799
169797
|
return map.portalItem;
|
|
169800
169798
|
}
|
|
169801
169799
|
return null;
|
|
169802
169800
|
}
|
|
169803
|
-
|
|
169804
|
-
|
|
169805
|
-
|
|
169806
|
-
|
|
169807
|
-
|
|
169808
|
-
case "dictionary":
|
|
169809
|
-
return await dictionaryToLSDictionary(editorVariable, kind);
|
|
169810
|
-
case "feature":
|
|
169811
|
-
return await featureToLSFeature(editorVariable, kind);
|
|
169812
|
-
default:
|
|
169813
|
-
return variableToLSVariable(editorVariable, kind);
|
|
169814
|
-
}
|
|
169815
|
-
}));
|
|
169816
|
-
}
|
|
169817
|
-
function variableToLSVariable(editorVariable, kind) {
|
|
169818
|
-
const { name, type } = editorVariable;
|
|
169819
|
-
const description = editorVariable.getDescription();
|
|
169820
|
-
return {
|
|
169821
|
-
name,
|
|
169822
|
-
description,
|
|
169823
|
-
type,
|
|
169824
|
-
completion: {
|
|
169825
|
-
label: name,
|
|
169826
|
-
detail: name,
|
|
169827
|
-
insertText: name,
|
|
169828
|
-
insertTextMode: main.exports.InsertTextMode.asIs,
|
|
169829
|
-
insertTextFormat: main.exports.InsertTextFormat.PlainText,
|
|
169830
|
-
kind,
|
|
169831
|
-
documentation: { kind: "markdown", value: description },
|
|
169832
|
-
},
|
|
169833
|
-
};
|
|
169834
|
-
}
|
|
169835
|
-
async function featureToLSFeature(editorFeature, kind) {
|
|
169836
|
-
// Get the source for the definition
|
|
169837
|
-
const source = await editorFeature.loadSource();
|
|
169838
|
-
const { name } = editorFeature;
|
|
169839
|
-
const description = editorFeature.getDescription();
|
|
169840
|
-
const resultCompletion = {
|
|
169841
|
-
label: name,
|
|
169842
|
-
detail: name,
|
|
169843
|
-
insertText: name,
|
|
169844
|
-
insertTextMode: main.exports.InsertTextMode.asIs,
|
|
169845
|
-
insertTextFormat: main.exports.InsertTextFormat.PlainText,
|
|
169846
|
-
kind,
|
|
169847
|
-
};
|
|
169848
|
-
const result = {
|
|
169849
|
-
name,
|
|
169850
|
-
description,
|
|
169851
|
-
type: "dictionary",
|
|
169852
|
-
properties: [],
|
|
169853
|
-
completion: resultCompletion,
|
|
169854
|
-
};
|
|
169855
|
-
// No source definition, then it will be a feature without any known fields
|
|
169856
|
-
if (!source) {
|
|
169857
|
-
return result;
|
|
169858
|
-
}
|
|
169859
|
-
// Create properties for the fields and the aliases
|
|
169860
|
-
// Also improve the feature completion documentation
|
|
169861
|
-
let featureCompletionDescription = description;
|
|
169801
|
+
/**
|
|
169802
|
+
* converts fields to profile values and calculates the feature completion description all in one iteration
|
|
169803
|
+
*/
|
|
169804
|
+
function fieldsToProfileValues(fields, initialFeatureCompletionDescription, includeAliases = false) {
|
|
169805
|
+
let featureCompletionDescription = initialFeatureCompletionDescription;
|
|
169862
169806
|
const fieldProfileValues = [];
|
|
169863
169807
|
const aliasProfileValues = [];
|
|
169864
|
-
supportedFields(
|
|
169865
|
-
let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
|
|
169866
|
-
if (field.description) {
|
|
169867
|
-
fieldCompletionDescription += ` \n'${field.description}`;
|
|
169868
|
-
}
|
|
169808
|
+
supportedFields(fields).forEach((field) => {
|
|
169869
169809
|
if (featureCompletionDescription) {
|
|
169870
169810
|
featureCompletionDescription += " \n \n";
|
|
169871
169811
|
}
|
|
169872
|
-
featureCompletionDescription += `**${field.name}** (${
|
|
169812
|
+
featureCompletionDescription += `**${field.name}** (${field.alias}) \n${field.type}`;
|
|
169873
169813
|
if (field.description) {
|
|
169874
169814
|
featureCompletionDescription += ` \n'${field.description}`;
|
|
169875
169815
|
}
|
|
169876
169816
|
// The property for the field
|
|
169877
|
-
const type =
|
|
169817
|
+
const type = fieldTypeToApiValueVarType(field);
|
|
169878
169818
|
const insertText = getMemberExpressionProperty(field.name, false);
|
|
169879
169819
|
const description = fieldAlias(field);
|
|
169880
169820
|
fieldProfileValues.push({
|
|
@@ -169888,65 +169828,35 @@ async function featureToLSFeature(editorFeature, kind) {
|
|
|
169888
169828
|
insertTextMode: main.exports.InsertTextMode.asIs,
|
|
169889
169829
|
insertTextFormat: main.exports.InsertTextFormat.PlainText,
|
|
169890
169830
|
kind: main.exports.CompletionItemKind.Field,
|
|
169891
|
-
documentation: { kind: "markdown", value: fieldCompletionDescription },
|
|
169892
169831
|
},
|
|
169893
169832
|
});
|
|
169894
|
-
if (
|
|
169895
|
-
|
|
169896
|
-
|
|
169897
|
-
|
|
169898
|
-
|
|
169899
|
-
|
|
169900
|
-
|
|
169833
|
+
if (includeAliases) {
|
|
169834
|
+
if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
|
|
169835
|
+
return;
|
|
169836
|
+
}
|
|
169837
|
+
// The property for the alias if different than the field name
|
|
169838
|
+
let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
|
|
169839
|
+
if (field.description) {
|
|
169840
|
+
aliasCompletionDescription += ` \n'${field.description}`;
|
|
169841
|
+
}
|
|
169842
|
+
aliasProfileValues.push({
|
|
169843
|
+
name: field.alias,
|
|
169844
|
+
description: field.name,
|
|
169845
|
+
type,
|
|
169846
|
+
completion: {
|
|
169847
|
+
label: field.alias,
|
|
169848
|
+
detail: field.name,
|
|
169849
|
+
insertText,
|
|
169850
|
+
insertTextMode: main.exports.InsertTextMode.asIs,
|
|
169851
|
+
insertTextFormat: main.exports.InsertTextFormat.PlainText,
|
|
169852
|
+
kind: main.exports.CompletionItemKind.Field,
|
|
169853
|
+
documentation: { kind: "markdown", value: aliasCompletionDescription },
|
|
169854
|
+
},
|
|
169855
|
+
});
|
|
169901
169856
|
}
|
|
169902
|
-
aliasProfileValues.push({
|
|
169903
|
-
name: field.alias,
|
|
169904
|
-
description: field.name,
|
|
169905
|
-
type,
|
|
169906
|
-
completion: {
|
|
169907
|
-
label: field.alias,
|
|
169908
|
-
detail: field.name,
|
|
169909
|
-
insertText,
|
|
169910
|
-
insertTextMode: main.exports.InsertTextMode.asIs,
|
|
169911
|
-
insertTextFormat: main.exports.InsertTextFormat.PlainText,
|
|
169912
|
-
kind: main.exports.CompletionItemKind.Field,
|
|
169913
|
-
documentation: { kind: "markdown", value: aliasCompletionDescription },
|
|
169914
|
-
},
|
|
169915
|
-
});
|
|
169916
169857
|
});
|
|
169917
|
-
|
|
169918
|
-
|
|
169919
|
-
return result;
|
|
169920
|
-
}
|
|
169921
|
-
async function dictionaryToLSDictionary(editorDictionary, kind) {
|
|
169922
|
-
const { name, dictionaryVariables: variables } = editorDictionary;
|
|
169923
|
-
const description = editorDictionary.getDescription();
|
|
169924
|
-
const completionDescription = variables.reduce((previous, p) => {
|
|
169925
|
-
if (previous !== "") {
|
|
169926
|
-
previous += " \n \n";
|
|
169927
|
-
}
|
|
169928
|
-
previous += `**${p.name}** \n${p.type}`;
|
|
169929
|
-
const description = p.getDescription();
|
|
169930
|
-
if (description) {
|
|
169931
|
-
previous += ` \n${description}`;
|
|
169932
|
-
}
|
|
169933
|
-
return previous;
|
|
169934
|
-
}, description);
|
|
169935
|
-
return {
|
|
169936
|
-
name,
|
|
169937
|
-
description,
|
|
169938
|
-
type: "dictionary",
|
|
169939
|
-
properties: await variablesToLSVariable(variables, main.exports.CompletionItemKind.Field),
|
|
169940
|
-
completion: {
|
|
169941
|
-
label: name,
|
|
169942
|
-
detail: name,
|
|
169943
|
-
insertText: name,
|
|
169944
|
-
insertTextMode: main.exports.InsertTextMode.asIs,
|
|
169945
|
-
insertTextFormat: main.exports.InsertTextFormat.PlainText,
|
|
169946
|
-
kind,
|
|
169947
|
-
documentation: { kind: "markdown", value: completionDescription },
|
|
169948
|
-
},
|
|
169949
|
-
};
|
|
169858
|
+
const properties = [...fieldProfileValues, ...aliasProfileValues];
|
|
169859
|
+
return [properties, featureCompletionDescription];
|
|
169950
169860
|
}
|
|
169951
169861
|
/**
|
|
169952
169862
|
* Represents a item in the EditorProfile. The profile is converted into an optimized way for
|
|
@@ -170480,7 +170390,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
170480
170390
|
const relationshipsGroup = new GroupOfVariables(this._profile, { code: "relationships" });
|
|
170481
170391
|
const relationshipItems = await Promise.all(source.relationships.map(async (relationship) => {
|
|
170482
170392
|
const relatedLayer = await getRelatedFeatureLayer(source, relationship);
|
|
170483
|
-
if (!
|
|
170393
|
+
if (!isFeatureLayerLikeInstance(relatedLayer)) {
|
|
170484
170394
|
return null;
|
|
170485
170395
|
}
|
|
170486
170396
|
if (relationship.relatedTableId === this.relationshipsProperties?.sourceTableId) {
|
|
@@ -170651,13 +170561,14 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
170651
170561
|
if (typeof this._featureSetCollections.source === "string") {
|
|
170652
170562
|
return this._profile?.intlStrings.featureservice ?? "featureservice";
|
|
170653
170563
|
}
|
|
170654
|
-
|
|
170655
|
-
|
|
170656
|
-
|
|
170657
|
-
|
|
170658
|
-
|
|
170564
|
+
switch (this._featureSetCollections.source.declaredClass) {
|
|
170565
|
+
case "esri.WebMap":
|
|
170566
|
+
return this._profile?.intlStrings.webmap ?? "webmap";
|
|
170567
|
+
case "esri.WebScene":
|
|
170568
|
+
return this._profile?.intlStrings.webscene ?? "webscene";
|
|
170569
|
+
default:
|
|
170570
|
+
return this._profile?.intlStrings.map ?? "map";
|
|
170659
170571
|
}
|
|
170660
|
-
return this._profile?.intlStrings.map ?? "map";
|
|
170661
170572
|
}
|
|
170662
170573
|
async loadSource() {
|
|
170663
170574
|
if (isNotNull(this._loadPromise) && isNotUndefined(this._loadPromise)) {
|
|
@@ -170724,7 +170635,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
170724
170635
|
return null;
|
|
170725
170636
|
}
|
|
170726
170637
|
async _featureSetCollectionFromMap(map) {
|
|
170727
|
-
if (
|
|
170638
|
+
if (isLoadAllCapable(map)) {
|
|
170728
170639
|
// Make sure the map is loaded
|
|
170729
170640
|
await map.loadAll();
|
|
170730
170641
|
}
|
|
@@ -170782,11 +170693,11 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
170782
170693
|
.toArray()
|
|
170783
170694
|
.reverse()
|
|
170784
170695
|
.forEach((layer) => {
|
|
170785
|
-
if (
|
|
170696
|
+
if (isFeatureLayerLikeInstance(layer)) {
|
|
170786
170697
|
layerVariables.push(this._createFeatureSetVariable(layer, true));
|
|
170787
170698
|
return;
|
|
170788
170699
|
}
|
|
170789
|
-
if (
|
|
170700
|
+
if (isGroupLayerCapable(layer)) {
|
|
170790
170701
|
const groupLayerVariables = filteringTables
|
|
170791
170702
|
? this._convertWebMapLayersToVariables(layer.allTables, true)
|
|
170792
170703
|
: this._convertWebMapLayersToVariables(layer.allLayers);
|
|
@@ -170795,31 +170706,31 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
170795
170706
|
});
|
|
170796
170707
|
return layerVariables;
|
|
170797
170708
|
}
|
|
170798
|
-
_createFeatureSetVariable(
|
|
170709
|
+
_createFeatureSetVariable(featureLayerLike, isFromWebMap = false) {
|
|
170799
170710
|
return new FeatureSetVariable(this, {
|
|
170800
170711
|
profile: this._profile,
|
|
170801
|
-
declaration: { name:
|
|
170712
|
+
declaration: { name: featureLayerLike.title, definition: featureLayerLike },
|
|
170802
170713
|
label: isFromWebMap
|
|
170803
|
-
?
|
|
170804
|
-
:
|
|
170714
|
+
? featureLayerLike.title
|
|
170715
|
+
: featureLayerLike.sourceJSON.name ?? featureLayerLike.title,
|
|
170805
170716
|
description: "",
|
|
170806
170717
|
nonInteractive: true,
|
|
170807
|
-
}, this._makeFeatureSetSnippets(
|
|
170718
|
+
}, this._makeFeatureSetSnippets(featureLayerLike, isFromWebMap));
|
|
170808
170719
|
}
|
|
170809
|
-
_makeFeatureSetSnippets(
|
|
170720
|
+
_makeFeatureSetSnippets(featureLayerLike, isFromWebMap = false) {
|
|
170810
170721
|
if (!this._profile?.supportFeatureSetFunctions) {
|
|
170811
170722
|
return [];
|
|
170812
170723
|
}
|
|
170813
170724
|
if (isFromWebMap) {
|
|
170814
|
-
const snippetById = `FeatureSetById(${this.snippet}, "${
|
|
170815
|
-
const snippetByName = `FeatureSetByName(${this.snippet}, "${
|
|
170725
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.id}")`;
|
|
170726
|
+
const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayerLike.title}")`;
|
|
170816
170727
|
return [
|
|
170817
170728
|
new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
|
|
170818
170729
|
new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName }),
|
|
170819
170730
|
];
|
|
170820
170731
|
}
|
|
170821
170732
|
else {
|
|
170822
|
-
const snippetById = `FeatureSetById(${this.snippet}, "${
|
|
170733
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.layerId}")`;
|
|
170823
170734
|
return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
|
|
170824
170735
|
}
|
|
170825
170736
|
}
|
|
@@ -170857,14 +170768,6 @@ class EditorProfile extends DictionaryVariable {
|
|
|
170857
170768
|
get supportFeatureSetFunctions() {
|
|
170858
170769
|
return this.definition?.bundles?.includes("data-access") ?? false;
|
|
170859
170770
|
}
|
|
170860
|
-
/**
|
|
170861
|
-
* Returns the language service profile. It is different than the editor profile as it is optimized for Monaco.
|
|
170862
|
-
*/
|
|
170863
|
-
async toLSProfile() {
|
|
170864
|
-
const { apiVersion, bundles, hiddenApiItems } = this.definition ?? {};
|
|
170865
|
-
const variables = await variablesToLSVariable(this.dictionaryVariables);
|
|
170866
|
-
return { apiVersion, bundles, variables, hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()) };
|
|
170867
|
-
}
|
|
170868
170771
|
/**
|
|
170869
170772
|
* Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
|
|
170870
170773
|
* get the new json representing mutations.
|
|
@@ -170878,179 +170781,6 @@ class EditorProfile extends DictionaryVariable {
|
|
|
170878
170781
|
}
|
|
170879
170782
|
//#endregion
|
|
170880
170783
|
|
|
170881
|
-
function isFeatureDefinition(item) {
|
|
170882
|
-
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
170883
|
-
}
|
|
170884
|
-
function isFeatureSetDefinition(item) {
|
|
170885
|
-
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
170886
|
-
}
|
|
170887
|
-
function isFeatureSetCollectionDefinition(item) {
|
|
170888
|
-
return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
|
|
170889
|
-
}
|
|
170890
|
-
/**
|
|
170891
|
-
* Get a PredefinedProfile for a locale. If not already loaded then fetch it.
|
|
170892
|
-
* If the locale doesn't exist or the locale profile file doesn't exist then returns
|
|
170893
|
-
* the english version of the profile.
|
|
170894
|
-
*/
|
|
170895
|
-
async function getSdkPredefinedProfiles(locale = "en") {
|
|
170896
|
-
const profiles = sdkPredefinedProfilesMap.get(locale);
|
|
170897
|
-
if (profiles) {
|
|
170898
|
-
return profiles;
|
|
170899
|
-
}
|
|
170900
|
-
if (!supportedLocales.has(locale)) {
|
|
170901
|
-
return await getSdkPredefinedProfiles("en");
|
|
170902
|
-
}
|
|
170903
|
-
try {
|
|
170904
|
-
const response = await fetch(getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
|
|
170905
|
-
if (response.ok) {
|
|
170906
|
-
return cacheSdkPredefinedProfiles(locale, (await response.json()));
|
|
170907
|
-
}
|
|
170908
|
-
if (locale === "en") {
|
|
170909
|
-
return null;
|
|
170910
|
-
}
|
|
170911
|
-
return await getSdkPredefinedProfiles("en");
|
|
170912
|
-
}
|
|
170913
|
-
catch {
|
|
170914
|
-
return null;
|
|
170915
|
-
}
|
|
170916
|
-
}
|
|
170917
|
-
const sdkPredefinedProfilesMap = new Map();
|
|
170918
|
-
/**
|
|
170919
|
-
* Convert a stored profile into a PredefinedProfile and add it to the in-memory
|
|
170920
|
-
* Map of profiles per locale.
|
|
170921
|
-
*/
|
|
170922
|
-
function cacheSdkPredefinedProfiles(locale, profiles) {
|
|
170923
|
-
const map = new Map();
|
|
170924
|
-
profiles.forEach((profile) => {
|
|
170925
|
-
map.set(profile.id, profile);
|
|
170926
|
-
});
|
|
170927
|
-
sdkPredefinedProfilesMap.set(locale, map);
|
|
170928
|
-
return map;
|
|
170929
|
-
}
|
|
170930
|
-
async function getSdkPredefinedProfile(id, locale = "en") {
|
|
170931
|
-
const profiles = await getSdkPredefinedProfiles(locale);
|
|
170932
|
-
return profiles?.get(id) ?? null;
|
|
170933
|
-
}
|
|
170934
|
-
function isExtendedPredefinedProfileDefinition(item) {
|
|
170935
|
-
return !!item && typeof item === "object" && "additionalVariables" in item && Array.isArray(item.additionalVariables);
|
|
170936
|
-
}
|
|
170937
|
-
function convertApiVariables(variables) {
|
|
170938
|
-
return variables?.map(convertApiVariable);
|
|
170939
|
-
}
|
|
170940
|
-
function convertApiVariable(variable) {
|
|
170941
|
-
switch (variable.type) {
|
|
170942
|
-
case "dictionary":
|
|
170943
|
-
return {
|
|
170944
|
-
...variable,
|
|
170945
|
-
type: variable.type,
|
|
170946
|
-
properties: convertApiVariables(variable.properties),
|
|
170947
|
-
};
|
|
170948
|
-
case "array": {
|
|
170949
|
-
return {
|
|
170950
|
-
...variable,
|
|
170951
|
-
type: variable.type,
|
|
170952
|
-
elementType: { type: "number", name: "number" },
|
|
170953
|
-
};
|
|
170954
|
-
}
|
|
170955
|
-
default:
|
|
170956
|
-
return { ...variable, type: variable.type };
|
|
170957
|
-
}
|
|
170958
|
-
}
|
|
170959
|
-
async function convertToEditorProfileDefinition(predefinedProfile, locale = "en") {
|
|
170960
|
-
if (!isPredefinedProfile(predefinedProfile)) {
|
|
170961
|
-
return undefined;
|
|
170962
|
-
}
|
|
170963
|
-
const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
|
|
170964
|
-
if (!sdkPredefinedProfile) {
|
|
170965
|
-
return undefined;
|
|
170966
|
-
}
|
|
170967
|
-
const editorProfile = {
|
|
170968
|
-
bundles: [...sdkPredefinedProfile.bundles],
|
|
170969
|
-
variables: [],
|
|
170970
|
-
hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase()),
|
|
170971
|
-
};
|
|
170972
|
-
// Merge the SDK variables' definitions/properties with the predefined profile definitions.
|
|
170973
|
-
sdkPredefinedProfile.variables.forEach((predefinedVariable) => {
|
|
170974
|
-
// Don't include disabled variables
|
|
170975
|
-
if (predefinedProfile.disabledVariables?.includes(predefinedVariable.name)) {
|
|
170976
|
-
return;
|
|
170977
|
-
}
|
|
170978
|
-
// Try to get a definition from the predefined profile, for the variable that needs one.
|
|
170979
|
-
const definition = predefinedProfile.definitions[predefinedVariable.name];
|
|
170980
|
-
// Note: Something is weird with TS. The sdkVariables are being casted to the wrong type
|
|
170981
|
-
// despite the type checking from the switch statement.
|
|
170982
|
-
switch (predefinedVariable.type) {
|
|
170983
|
-
case "dictionary": {
|
|
170984
|
-
// For dictionary, we support properties overrride
|
|
170985
|
-
return editorProfile.variables.push(convertApiVariable({
|
|
170986
|
-
...predefinedVariable,
|
|
170987
|
-
type: predefinedVariable.type,
|
|
170988
|
-
properties: Array.isArray(definition) ? [...definition] : predefinedVariable.properties,
|
|
170989
|
-
}));
|
|
170990
|
-
}
|
|
170991
|
-
case "feature":
|
|
170992
|
-
// If the definition is not valid, then we don't include it.
|
|
170993
|
-
if (!isFeatureDefinition(definition)) {
|
|
170994
|
-
return;
|
|
170995
|
-
}
|
|
170996
|
-
return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
|
|
170997
|
-
case "featureSet":
|
|
170998
|
-
// If the definition is not valid, then we don't include it.
|
|
170999
|
-
if (!isFeatureSetDefinition(definition)) {
|
|
171000
|
-
return;
|
|
171001
|
-
}
|
|
171002
|
-
return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
|
|
171003
|
-
case "featureSetCollection":
|
|
171004
|
-
// If the definition is not valid, then we don't include it.
|
|
171005
|
-
if (!isFeatureSetCollectionDefinition(definition)) {
|
|
171006
|
-
return;
|
|
171007
|
-
}
|
|
171008
|
-
return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
|
|
171009
|
-
default:
|
|
171010
|
-
return editorProfile.variables.push(convertApiVariable(predefinedVariable));
|
|
171011
|
-
}
|
|
171012
|
-
});
|
|
171013
|
-
if (isExtendedPredefinedProfileDefinition(predefinedProfile)) {
|
|
171014
|
-
editorProfile.variables.push(...(predefinedProfile.additionalVariables ?? []));
|
|
171015
|
-
}
|
|
171016
|
-
return editorProfile;
|
|
171017
|
-
}
|
|
171018
|
-
|
|
171019
|
-
/**
|
|
171020
|
-
* Returns the arcade diagnostic service.
|
|
171021
|
-
* Example:
|
|
171022
|
-
* ```ts
|
|
171023
|
-
* const diagnosticService = await getArcadeDiagnosticService();
|
|
171024
|
-
* diagnosticService.onDidChangeDiagnostics(({uri, diaganostics }) => {
|
|
171025
|
-
* // Filter the diagnostics for the uri of interest
|
|
171026
|
-
* // Do something with the diagnostics
|
|
171027
|
-
* });
|
|
171028
|
-
* ```
|
|
171029
|
-
*/
|
|
171030
|
-
async function getArcadeDiagnosticService() {
|
|
171031
|
-
const mode = await getMode();
|
|
171032
|
-
return mode.getArcadeDiagnosticService();
|
|
171033
|
-
}
|
|
171034
|
-
/**
|
|
171035
|
-
* Returns the arcade worker for the model.
|
|
171036
|
-
* Example:
|
|
171037
|
-
* ```ts
|
|
171038
|
-
* const arcadeWorker = await getArcadeWorker(model.uri);
|
|
171039
|
-
* ```
|
|
171040
|
-
* @returns arcade worker
|
|
171041
|
-
*/
|
|
171042
|
-
async function getArcadeWorker(uri) {
|
|
171043
|
-
const mode = await getMode();
|
|
171044
|
-
return await mode.getArcadeWorker(uri);
|
|
171045
|
-
}
|
|
171046
|
-
/**
|
|
171047
|
-
* Request the arcade mode
|
|
171048
|
-
* @returns arcade mode module
|
|
171049
|
-
*/
|
|
171050
|
-
async function getMode() {
|
|
171051
|
-
return await import('./arcade-mode-5d46035e.js');
|
|
171052
|
-
}
|
|
171053
|
-
|
|
171054
170784
|
// this file contains the building blocks for a language default provider
|
|
171055
170785
|
const defaultContext = {
|
|
171056
170786
|
locale: "en",
|
|
@@ -171092,20 +170822,11 @@ class LanguageDefaultsBase {
|
|
|
171092
170822
|
return this._languageOptions;
|
|
171093
170823
|
}
|
|
171094
170824
|
/**
|
|
171095
|
-
* Dispose
|
|
171096
|
-
* It is the responsibility of the caller that created the editor profile to dispose it.
|
|
171097
|
-
* @param modelId The model id for which to dispose the editor profile.
|
|
170825
|
+
* Dispose any cached resources for the model
|
|
171098
170826
|
*/
|
|
171099
|
-
|
|
170827
|
+
disposeForModel(modelId) {
|
|
171100
170828
|
const key = this._getApiKey(modelId);
|
|
171101
170829
|
this._profileMap.delete(key);
|
|
171102
|
-
}
|
|
171103
|
-
/**
|
|
171104
|
-
* Dispose the api context for the given model id.
|
|
171105
|
-
* @param modelId The model id for which to dispose the api context.
|
|
171106
|
-
*/
|
|
171107
|
-
disposeApiContextForModel(modelId) {
|
|
171108
|
-
const key = this._getApiKey(modelId);
|
|
171109
170830
|
if (this._apiContextMap.delete(key)) {
|
|
171110
170831
|
this._fireModelContextDidChange(key);
|
|
171111
170832
|
}
|
|
@@ -171146,71 +170867,4 @@ class LanguageDefaultsBase {
|
|
|
171146
170867
|
}
|
|
171147
170868
|
}
|
|
171148
170869
|
|
|
171149
|
-
|
|
171150
|
-
class ArcadeLanguageServiceDefaults extends LanguageDefaultsBase {
|
|
171151
|
-
constructor() {
|
|
171152
|
-
super(...arguments);
|
|
171153
|
-
this._languageId = arcadeLanguageId;
|
|
171154
|
-
this._languageOptions = {};
|
|
171155
|
-
}
|
|
171156
|
-
/**
|
|
171157
|
-
* Create an EditorProfile for the given model id using the given definition and locale.
|
|
171158
|
-
* The EditorProfile is used by the the Arcade Language service as well by the cosing components.
|
|
171159
|
-
* The definition can be a pre-defined profile or an editor profile definition.
|
|
171160
|
-
* If the locale is not provided then the 'en' locale is used.
|
|
171161
|
-
* @param modelId The model id for which to create the context.
|
|
171162
|
-
* @param definition The definition to use for the model context.
|
|
171163
|
-
* @param locale The locale to use for the model context.
|
|
171164
|
-
* @returns The EditorProfile for the model.
|
|
171165
|
-
*/
|
|
171166
|
-
async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
|
|
171167
|
-
// Convert pre-defined profile to a runtime profile
|
|
171168
|
-
if (isPredefinedProfile(definition)) {
|
|
171169
|
-
definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
|
|
171170
|
-
}
|
|
171171
|
-
const intlStrings = await fetchT9NStringsBundle(apiContext.locale, getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
|
|
171172
|
-
if (!intlStrings) {
|
|
171173
|
-
throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
|
|
171174
|
-
}
|
|
171175
|
-
this.disposeEditorProfileForModel(modelId);
|
|
171176
|
-
const key = this._getApiKey(modelId);
|
|
171177
|
-
const editorProfile = new EditorProfile(definition, intlStrings);
|
|
171178
|
-
this._profileMap.set(key, editorProfile);
|
|
171179
|
-
const apiProfile = await editorProfile.toLSProfile();
|
|
171180
|
-
this.updateApiContextForModel(modelId, {
|
|
171181
|
-
locale: apiContext.locale,
|
|
171182
|
-
profile: apiProfile,
|
|
171183
|
-
snippets: apiContext.snippets,
|
|
171184
|
-
});
|
|
171185
|
-
}
|
|
171186
|
-
/**
|
|
171187
|
-
* Set or update the Arcade language service options.
|
|
171188
|
-
* @param languageOptions The language options to set.
|
|
171189
|
-
*/
|
|
171190
|
-
setLanguageOptions(languageOptions = {}) {
|
|
171191
|
-
// Check if options have actually changed.
|
|
171192
|
-
// Avoid restarting the worker when no updates.
|
|
171193
|
-
// Today we only have the 'assetsPath' as a property
|
|
171194
|
-
if (this._languageOptions.assetsPath === languageOptions.assetsPath) {
|
|
171195
|
-
return;
|
|
171196
|
-
}
|
|
171197
|
-
this._languageOptions = { ...this._languageOptions, ...languageOptions };
|
|
171198
|
-
this._onDidChange.fire(this);
|
|
171199
|
-
}
|
|
171200
|
-
/**
|
|
171201
|
-
* Gets the API library for the given model id.
|
|
171202
|
-
* @param modelId The model id for which to get the API library.
|
|
171203
|
-
* @returns The API library for the model.
|
|
171204
|
-
*/
|
|
171205
|
-
async getApiLibrary(modelId) {
|
|
171206
|
-
const uri = Uri.parse(modelId);
|
|
171207
|
-
const worker = await getArcadeWorker(uri);
|
|
171208
|
-
return await worker.getApiLibrary(this.getApiContextForModel(uri));
|
|
171209
|
-
}
|
|
171210
|
-
}
|
|
171211
|
-
const arcadeDefaults = new ArcadeLanguageServiceDefaults();
|
|
171212
|
-
const arcade = {
|
|
171213
|
-
setProfileForModel: arcadeDefaults.setProfileForModel.bind(arcadeDefaults),
|
|
171214
|
-
};
|
|
171215
|
-
|
|
171216
|
-
export { observeAncestorsMutation as A, KeyMod as B, addLTRMark as C, Deferred as D, monaco_editor_core_star as E, typescriptDefaults as F, main as G, debounce as H, IStandaloneThemeService as I, Emitter as J, KeyCode as K, MarkerSeverity as M, Range as R, StandaloneServices as S, Uri as U, arcade as a, safeAsyncCall as b, camelToKebab as c, devToolsAwareTimeout as d, editor as e, startLocaleObserver as f, getElementLocales as g, isURL as h, importArcade as i, hasSameOrigin as j, importRequest as k, generateGuid as l, arcadeDefaults as m, getElementTheme as n, getArcadeDiagnosticService as o, setValuesInString as p, quoteString as q, supportedFields as r, safeCall as s, generateTokensCSSForColorMap as t, commonjsGlobal as u, setFocusOnElement as v, filterCollection as w, createFilterExpression as x, languages as y, getMode as z };
|
|
170870
|
+
export { observeAncestorsMutation as A, KeyMod as B, addLTRMark as C, Deferred as D, EditorProfile as E, isNotUndefined as F, safeAsyncCall as G, devToolsAwareTimeout as H, IStandaloneThemeService as I, safeCall as J, KeyCode as K, LanguageDefaultsBase as L, monaco_editor_core_star as M, typescriptDefaults as N, Emitter as O, MarkerSeverity as P, debounce as Q, Range as R, StandaloneServices as S, Uri as U, isFeatureSetCollectionDefinition as a, isFeatureSetDefinition as b, isFeatureDefinition as c, fetchT9nStringsBundle as d, importArcade as e, fieldsToProfileValues as f, editor as g, startLocaleObserver as h, isPredefinedProfile as i, getElementLocales as j, isURL as k, hasSameOrigin as l, main as m, importRequest as n, generateGuid as o, getElementTheme as p, setValuesInString as q, quoteString as r, supportedLocales as s, supportedFields as t, generateTokensCSSForColorMap as u, commonjsGlobal as v, setFocusOnElement as w, filterCollection as x, createFilterExpression as y, languages as z };
|